Gilad Reti f8134aad5e Fix i386 syscall argument constraints (#1)
At some point in the past, it seems like the argument constraint went from "r"  (general register) to "g" (anything but non-general registers).
Since all syscall callers are changing the stack pointer by pushing "ebx" on the stack without the compiler's knowledge, this causes bugs when the compiler chooses to save the argument on the stack, as it cannot reference it correctly later.

Switch back to the "r" constraint to resolve this issue.
2023-04-25 23:55:37 +08:00
2013-11-17 10:08:24 +01:00
2018-03-04 11:40:16 +01:00
2013-11-17 01:07:11 -08:00
2018-03-04 11:26:43 +01:00

shellforge4

Shellforge4 is an enhanced version of secdev's shellforge G3. More platforms, architectures and syscalls supported.

The original sources were from http://trac.secdev.org

Shellforge is a python program that uses the SFlib and gcc (cross-)compilers to generate shellcodes from C files.

Example Given the hello.c program :

 int main(void) 
 {
         char buf[] = "Hello world!\n";
        write(1, buf, sizeof(buf));
        exit(5);
 }

We can make a shellcode :

 $ python sf.py examples/hello.c
 \x55\x89\xe5\x56\x83\xec\x14\x83\xe4\xf0\xbe\x01\x00\x00
 \x00\x83\xec\x10\x8d\x4d\xee\xb8\x04\x00\x00\x00\xba\x0e
 \x00\x00\x00\x53\xbb\x01\x00\x00\x00\xcd\x80\x5b\x89\xf0
 \x53\xbb\x05\x00\x00\x00\xcd\x80\x5b\x8b\x75\xfc\xc9\xc3

How to install it

Shellforge needs sflib in order to work. You can install it by executing the installation script in sflib directory.

$ cd sflib
$ sudo sh ./install.sh

How to use it

Help $ cd shellforge $ ./sf.py -h

Generate the shellcode $ cd shellforge $ ./sf.py examples/hello.c

Generate the shellcode and test it $ cd shellforge $ ./sf.py -t examples/hello.c

S
Description
Enhanced version of secdev's shellforge G3. More platforms and architectures supported.
Readme GPL-2.0
2.2 MiB
0 Stars 1 Watchers 0 Forks
Languages
C 87.9%
Python 11.5%
Assembly 0.5%