In this lab, we will develop a trivial static binary code analyzer that will search for known buffer overflow prone library functions like
However, we will construct a backward callgraph based slice (see video) to know which functions call such vulnerable functions (because buffer overflow will affect these functions).
Indeed, most of the vulnerabilities are found in the functions which call these vulnerable functions.
Even though we call it a trivial scanner, you should know that several early code scanners were actually like the one we will build see this paper.
As a proof of concept, we will analyze a utility called
dnstracer to find a known vulnerability CVE-2017-9430.
Download this tool dnstracer.
Extract and build the program (from the root directory, use commands
This will create a binary
we will use this binary later on for analysis.
call-graph-back-slice.pyfile contains all the instructions you should follow.
dnstracerbinary in the opened project and double-click it. Ghidra will ask to analyze it. Once done, open the ScriptManager and select your scripting file. Run it and check the output.