never stop questioning

outp.c

outp.c
Posted May 3, 2000
Authored by teso | Site team-teso.net

outp.c will convert .s files to shell code.

tags | shell
MD5 | 458d6225aba406f32950ba38ff61d7f8

outp.c

Change Mirror Download
#include <stdio.h>
/*

convert .s to shellcode. typo/teso (typo@inferno.tusculum.edu)

$ cat lala.s
.globl cbegin
.globl cend
cbegin:
xorl %eax, %eax
...
cend:
$ gcc -Wall lala.s outp.c -o lala
$ ./lala
unsigned char shellcode[] =
"\x31\xc0\x31\xdb\x31\xc9\xb3\x0f\xb1\x0f\xb0\x47\xcd\x80\xeb\x1e\x5b"
"\x31\xc0\x88\x43\x07\x89\x5b\x08\x89\x43\x0c\x8d\x4b\x08\x8d\x53\x0c"
"\xb0\x0b\xcd\x80\x89\xc3\x31\xc0\xb0\x01\xcd\x80\xe8\xdd\xff\xff\xff"
"\x2f\x74\x6d\x70\x2f\x74\x73\x74\x65\x73\x6f\x63\x72\x65\x77\x21\x21";
...

*/

extern void cbegin();
extern void cend();

int main() {
char *buf = (char *) cbegin;
int i = 0, x = 0;

printf("unsigned char shellcode[] = \n\"");
for (; (*buf) && (buf < (char *) cend); buf++) {
if (i++ == 17) i = 1;
if (i == 1 && x != 0) printf("\"\n\"");
x = 1;
printf("\\x%02x", (unsigned char) *buf);
}
printf("\";\n");

printf("
int main() {
void (*f)();
f = (void *) shellcode;
printf(\"%%d\\n\", strlen(shellcode));
f();
}
");

return(0);
}

Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

May 2012

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    May 1st
    37 Files
  • 2
    May 2nd
    53 Files
  • 3
    May 3rd
    33 Files
  • 4
    May 4th
    4 Files
  • 5
    May 5th
    10 Files
  • 6
    May 6th
    17 Files
  • 7
    May 7th
    19 Files
  • 8
    May 8th
    36 Files
  • 9
    May 9th
    34 Files
  • 10
    May 10th
    35 Files
  • 11
    May 11th
    20 Files
  • 12
    May 12th
    18 Files
  • 13
    May 13th
    11 Files
  • 14
    May 14th
    27 Files
  • 15
    May 15th
    58 Files
  • 16
    May 16th
    54 Files
  • 17
    May 17th
    25 Files
  • 18
    May 18th
    53 Files
  • 19
    May 19th
    9 Files
  • 20
    May 20th
    15 Files
  • 21
    May 21st
    25 Files
  • 22
    May 22nd
    32 Files
  • 23
    May 23rd
    35 Files
  • 24
    May 24th
    26 Files
  • 25
    May 25th
    25 Files
  • 26
    May 26th
    0 Files
  • 27
    May 27th
    0 Files
  • 28
    May 28th
    0 Files
  • 29
    May 29th
    0 Files
  • 30
    May 30th
    0 Files
  • 31
    May 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2012 Packet Storm. All rights reserved.

close