cetfor / PaperMachete

A project that uses Binary Ninja and GRAKN.AI to perform static analysis on binary files with the goal of identifying bugs in software.
MIT License
57 stars 9 forks source link

Grakn import failure #2

Closed mozark24 closed 6 years ago

mozark24 commented 6 years ago

With my newly constructed json file, it appears that the parser/migrator to Grakn is not functioning correctly (Loaded 0 statements on each of the 7 steps). Any suggestions?

Screenshot here

cetfor commented 6 years ago

Hey @mozark24, I'm going to look into this and get back to you on or before Friday 5/18. Thanks for creating this issue.

Just to confirm, are you using Grakn 1.0.0 or Grakn 0.16.0?

mozark24 commented 6 years ago

Cool, let me know if you need any further information!

cetfor commented 6 years ago

Ok, so I got a chance to dig into this. I fired up a Linux VM I had, installed Grakn v1.0.0, PM, and analyzed a binary from MIT's new Rode0day competition and immediately ran into the same issue shown in your screenshot (failed migration/import). So this is certainly a reproducible issue.

A lot has changed from Grakn v0.16.0 (which this work is originally based on) to v1.0.0. Since then there have been some bug fixes in Grakn which brings us to the current Grakn v1.2.0. Grakn is extremely dependent on Java JRE 8. I had some insanely confusing issues starting the Grakn stack using JRE 10.

Also, a graql query of match $f isa function; will no longer return results, and now requires a query like match $f isa function; get;. Leaving off the get; portion will return a syntax error: no viable alternative at input 'match $f isa function;'.

I always assumed using Grakn at such an early stage in its development would cause issues, so this is expected sadly. Grakn has matured quite a bit and over that time there have been some breaking changes like this silly get; addition.

I installed a fresh Ubuntu 16.08 VM and went back through the entire install process documented here, using Grakn v1.2.0 and was able to get PM up and running, analyzing binaries, correctly inserting into the knowledge graph, and running the example CWE queries.

If this is cool with you, can you please follow the newly revised setup steps on the Paper Machete wiki (here) and see if that all works?

I'll leave this open for now, as I plan to ramp up some maintenance work on Paper Machete over the summer. Although I don't have a clear sense of the root of the problem, I suspect the JRE version is the main culprit here.

Let me know if you have any more issues or questions. Thank you again for reporting this issue!

Image of resulting migration sweep: https://imgur.com/rKWyIr8

cetfor commented 6 years ago

Please let me know if the above steps fail to work for anyone and I'll reopen. I think this is solved.