Commit Graph

113 Commits

Author SHA1 Message Date
Dennis Semakin 8fb4ce3e72 Bug fix - shdr segfault parsing. 2014-02-12 22:57:56 +00:00
JonathanSalwan 7acfb7ca3a push 4.0.3 2013-10-19 12:29:21 +01:00
JonathanSalwan 9546acf253 merge 2013-06-25 13:54:18 +02:00
Tom Samstag 966c1e2ed6 Fixing offsets with execve syscall
The shellcode generated for the Ubuntu 64b libc in Python format ends
with:
p += pack("<Q", off + 0x0000000000023950) # pop rax ; ret
p += pack("<Q", off + 0x000000000000003b) #  execve
p += pack("<Q", off + 0x0000000000001454) # syscall

Notice the offset being incorrectly added to the 3b literal for the
execve syscall. This results in nonfunctioning shell code. This patch
fixes that by:
1) Changing sc_print_addr_pop to sc_print_number_pop. The function is
only used once, and it's to print a numeric literal, not an address.
Popping a numeric literal should not add the library offset.
2) Adding a parameter to sc_print_code to dictate whether the value is
in the library and thus should be offset if a shared object.

With the patch applied, the resulting shell code for the same invocation
as above correctly ends in:
p += pack("<Q", off + 0x0000000000023950) # pop rax ; ret
p += pack("<Q", 0x000000000000003b) #  execve
p += pack("<Q", off + 0x0000000000001454) # syscall
2013-06-18 15:26:22 -07:00
Allan Wirth ed0fd13f2c Refactor some macros to ropgadget_funcs.h 2013-06-16 20:35:13 -04:00
Allan Wirth df1a1dba03 Refcator header file out into separate files. 2013-06-16 20:21:48 -04:00
JonathanSalwan c0578e0b7f push 4.0.2 2013-05-14 11:55:58 +02:00
JonathanSalwan 97572e6e2f Update all headers 2013-04-11 09:44:08 +02:00
Allan Wirth 01bfd66fd8 Bettwer wy of doing it. 2013-02-18 14:57:36 -05:00
Allan Wirth 815e052178 Merge branch 'dev' of github.com:JonathanSalwan/ROPgadget into dev 2013-02-18 14:43:19 -05:00
Allan Wirth 4324a88419 Fix format bug on 32 bit. 2013-02-18 14:43:05 -05:00
JonathanSalwan 549b143431 Clean syntax C. Add Intel default syntax. Update /bin/shA to /bin//sh. 2013-02-18 17:29:55 +01:00
Allan Wirth e76f0a971b Remove two useless undef's and make a useful function global. 2013-02-05 19:37:12 -05:00
Allan Wirth a8c9affffd Prepare for merge back into ropgadget. 2013-01-29 13:32:09 -05:00
Allan Wirth 3fa6bbd25a Revision 1.0.1 2013-01-20 17:36:02 -05:00
Allan Wirth eb8e1f8515 Add ABI checks. 2013-01-11 15:57:38 -05:00
Allan Wirth e435121d0a Finalize pe support, as far as I can tell at least. 2013-01-11 12:56:38 -05:00
Allan Wirth 26b1af948c Fix a bug with assembly parsing. Closer to PE file support 2013-01-11 11:49:59 -05:00
Allan Wirth 52585b77a6 Move pe.h to a more reasonable place. 2013-01-10 14:35:43 -05:00
Allan Wirth 619378f678 Add beginnings of PE file parsing. 2013-01-10 14:29:23 -05:00
Allan Wirth 68cd91dd5d Add a macro for version and generate some helpful code for shared libraries. 2013-01-09 19:07:24 -05:00
Allan Wirth 37162ccd69 Add shared object detection. 2013-01-05 20:37:27 -05:00
Allan Wirth 4ed506214c Fix shared object string loading. 2013-01-05 20:10:28 -05:00
Allan Wirth 650027e030 Add support for parsing elf dependencies. 2013-01-05 19:16:24 -05:00
Allan Wirth 83838718ac Typos and fix all the headers. 2013-01-03 13:03:49 -05:00
Allan Wirth 5594f532ee Remove useless struct and add optimization for when no argv needs to be printed. 2013-01-03 12:01:30 -05:00
Allan Wirth 7a01cbc5a8 Remove stupid importsc scanning. 2013-01-03 11:30:23 -05:00
Allan Wirth ad5fd4fd36 try and improve importsc mode. 2013-01-03 00:35:56 -05:00
Allan Wirth b595d07751 Update license information. 2013-01-02 23:30:57 -05:00
Allan Wirth b867f16fb6 Add arbitrary execve support, etc. 2013-01-02 23:12:27 -05:00
Allan Wirth 806243b049 Finalize 64 bit and ropcode generation. 2013-01-02 21:49:47 -05:00
Allan Wirth 4a6523a81b output control. add c syntax mode 2013-01-02 19:24:08 -05:00
Allan Wirth 11b4f46ceb IMPROVE 2013-01-02 18:21:29 -05:00
Allan Wirth c3ad982050 Oops. 2013-01-02 17:29:06 -05:00
Allan Wirth 078ff66cc1 Fix an issue with assembly mode imports. 2013-01-02 17:20:13 -05:00
Allan Wirth 9f4c961c5c remove duplicate data structure. 2013-01-02 16:56:05 -05:00
Allan Wirth aa47402edd Merge elf parsing. 2013-01-02 16:51:37 -05:00
Allan Wirth 1aa18fd3af Set importsc to have a real opcode inside of it to prevent casting. 2013-01-02 14:25:53 -05:00
Allan Wirth 3782e08faa Just some type cleanup from splint. 2012-12-28 14:24:07 -05:00
Allan Wirth cb7d49e743 Add fallback code generation to 32 bit. 2012-12-28 13:54:13 -05:00
Allan Wirth 558ed9f18b Finalize rop making for 64 bits! it works now! 2012-12-28 13:36:27 -05:00
Allan Wirth 87c28249bd Improved 64 bit payload generation (not quite there yet though) 2012-12-28 11:42:45 -05:00
Allan Wirth 1da6cb2e99 Commonify ropmaking. 2012-12-27 20:16:35 -05:00
Allan Wirth 6eacb50541 REFACTOR ALL THE THINGS!!!! 2012-12-27 17:52:40 -05:00
Allan Wirth 6ed86dc803 Remove stubs that aren't required anymore. 2012-12-27 16:29:56 -05:00
Allan Wirth bd6e55e000 Memoize! Refactor! Be Merry! 2012-12-27 16:06:59 -05:00
Allan Wirth 21ce3fc390 major refactor. significant code improvement. 2012-12-27 15:21:06 -05:00
Allan Wirth 20c68e68c1 refactorr 2012-12-27 13:57:00 -05:00
Allan Wirth e6105dcb15 move clutter out of header. 2012-12-27 12:30:15 -05:00
Allan Wirth f29be03670 Cleanup, remove global vars. 2012-12-27 12:11:13 -05:00