This repos keeps track of all the ideas, examples and challenges that we will encounter during this project.
Recap of the progresses week by week.
As the first step of our project we deployed the whole angr infrastructure with the Java support and we wrote a quick tutorial on how to do it.
Then we wrote a simple Java application (you can find the surce code in /example/simple) to test which SOOT instructions and which SimProcedure are already implemented by angr.
During this experiment we find out that;
- SimSootExpr_StaticFieldRef is not implemented in angr and therefore is not correctly emulated
- Only 3 SimProcedures are actually implemmented in angr (read, write and exit)
Implemented the simple java application that uses String.equals() function. Implemented the corresponding simProcedure in angr that returns the constraints of the String.equal() function. In order to do this, we had to plug in the string solver and modify the internal option of Angr. Fixed <SimState>.block() if the arch is soot, so now the basic blocks are lifted correctly.
During the execution of some program, we figured out that the support for Java in angr is lack of fundamental funcitonalities that needs to be implemented in order to perform a meaningful analysis of the program.
These functionalities are:
- Array cannot be used and analyzed.
- Command line arguments are not recognized.
- Function calls are not supported.
- Objects are not supported
Implemented the functionalities that weren't supoorted from last week except for the object. Started to implement the demo for the class (fauxware), but we figured that the static fields inside of classes are not supported yet. Implemented the simple simProcedure for scanner.nextLine() in order to read from standard input.
Implemented the support for static fields in java classess. The static field reference with default values are initiallized during the time when the classes are loaded using the method <clinit>. During the normal execution of the program, this method is never executed, so we decided to force its execution at the first time the class is called.
Implemented the simple java application that uses String.concat() function. Implemented the corresponding simProcedure in angr that returns the constraints of the String.concat() function. Found a bug in command line arguements handling.
- Fix call <SimState>.block() if the arch is soot
- Implement support java.lang.String in angr
- Implement Simprocedure java.lang.String.equals
- Implement Simprocedure java.lang.String.concat
- Implement Simprocedure java.util.scanner.nextLine
- Implement the array support in angr
- Implement the command line arguments in angr
- Implement the function calls with parameters passed in
- Implement the objects support in angr
- Implement the support for static fields in java classes
- Fix the command line arguments handling bug in angr
- Install python packages virtualenv and virtualenvwrapper.
- Clone angr-dev.
- Install angr with the instructions provided by angr-dev.
- Remove the following directories inside of angr-dev "angr", "claripy" becuase we will replace with our own implementations.
- Clone our forked version of angr to angr-dev.
- Clone our forked version of claripy to angr-dev.
- Install pysmt. We need it to parse and dump smt lib scripts.
pip install pysmt - Clone pysoot to angr-dev.
- Install pysoot.
pip install -e . - Switch to branch feat/soot in angr
- Switch to branch feat/strings in claripy
- Browse to the directory examples/java_fauxwawre_string
- Run the script test_java_string_fauxware.py
This script will explore all possible states of the java program fauxware and it will collect all teh constraints.