I'm trying to write a simple fuzzer that detects a buffer overflow. The code I want to fuzz is below:
#include <stdio.h>
int main(int argc, char *argv[])
{
char buf[256];
memcpy(buf, argv[1],strlen(argv[1]));
printf(buf);
}
And my current Peach Pit is the following:
<DataModel name="MyString">
<String value="">
<Analyzer class="StringToken" />
</String>
</DataModel>
<StateModel name="StateVfolder" initialState="Initial">
<State name="Initial">
<Action type="output">
<DataModel ref="MyString"/>
</Action>
</State>
</StateModel>
<Agent name="LocalAgent">
<Monitor class="LinuxDebugger">
<Param name="Executable" value="./test"/>
</Monitor>
</Agent>
<Test name="Default">
<Agent ref="LocalAgent"/>
<StateModel ref="StateVfolder"/>
<Publisher class="Console" />
<Logger class="File">
<!-- save crash information in the Logs directory -->
<Param name="Path" value="Logs"/>
</Logger>
<Strategy class="Sequential" />
</Test>
</Peach>
How can I make this work? Any help would be greatly appreciated. Thank you. I've found a few references to this exact thing but I can't get the files to work correctly.