summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2021-12-25Fix typo in for loop in asm rep prefix docdusoleil1-1/+1
Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
2021-12-20Add install/uninstall instructions to radare docdusoleil1-0/+8
Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
2021-12-20Add radare2 command cheatsheetdusoleil1-0/+80
Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
2021-12-20Add doc about fixing a ptrace error in debugger.dusoleil1-0/+22
Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
2021-12-20Add doc about the rep prefix on an x86 instructiondusoleil1-0/+18
Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
2021-12-17Add short doc on the one_gadget tooldusoleil1-0/+57
Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
2021-12-17Remove curl example line from READMEdusoleil1-1/+0
Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
2021-12-16Add cheatsheet of common flags for curldusoleil1-0/+89
Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
2021-12-13Add a short doc with links to reqbin and hookbindusoleil1-0/+7
Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
2021-09-05Add Short Doc About proxychainsdusoleil1-0/+10
Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
2021-09-05Add Example that Uses Custom Charsetdusoleil1-0/+1
Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
2021-09-05Update Incremental Examples to Use Short Flagdusoleil1-3/+3
Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
2021-09-05Add Info About Issues with Small Workloaddusoleil1-0/+24
Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
2021-09-05Add More Mask/Hybrid Attacks to Examplesdusoleil1-0/+6
Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
2021-09-05Add Examples for Showing Cracks/Identifying Typedusoleil1-0/+2
Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
2021-09-05Add --status Flag to Examplesdusoleil1-6/+6
Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
2021-09-05Fix Paths in Examplesdusoleil1-4/+4
Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
2021-09-05Remove "LIGHT"/"HEAVY" Descriptors from Examplesdusoleil1-2/+2
Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
2021-09-05Add hashcat docdusoleil1-0/+101
Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
2021-09-05Add iptables docdusoleil1-0/+147
Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
2021-09-05sploit: Rename Comm instance to 'io'Malfurious1-1/+1
If the user's script contains from sploit import * then the exported 'comm' communication object is clobbered by the 'comm' source module. Switching the name to 'io' avoids this issue, is more to the point, and is even fewer characters to type. Signed-off-by: Malfurious <m@lfurio.us> Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
2021-09-05sploit: Properly scope user-script executionMalfurious1-2/+2
Rather than implicitly inheriting names in scope for the user-script, this collection is sanitized and we only export the 'comm' communication object. This seems to be a safer way to operate and addresses an issue with sub-scopes in the user's script not functioning properly. (Previously, user-defined functions did not have access to globals, or library functions.) Additionally, the user's code is now passed through compile() to attach the original file name. This is useful for debugging / diagnostic situations, to make it more obvious if a crash originated from the user's script. Signed-off-by: Malfurious <m@lfurio.us> Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
2021-09-02Merge tag 'pull-sploit-rework' of https://github.com/Dusoleil/lib-des-gnuxMalfurious18-329/+290
Rework Sploit Tool Rewrite core functionality with new design and UX considerations. Organize functionality into separate modules. Add support for various use cases including: -pip install -running the installed sploit command -running the sploit.py script -running python -m sploit -importing the modules from the python interpreter Add a "daemon" mode which will continue to rehost the exploit script on the same pipes until you are done. * tag 'pull-sploit-rework' of https://github.com/Dusoleil/lib-des-gnux: (25 commits) Change behavior for import sploit Add mem module for calculating memory offsets Handle Process destr when Process constr throws Reuse read() and readline() in the until() API Add readall() which reads until EOF Move comm toggles for consistency Add arch config module Add Config Toggles for Read/Write Extra Behavior Rewrite interact() to be Single Threaded Add Convenience Utility to readuntil() readlineuntil() Operates on an Array of Lines Correct read() Semantics Throw a BrokenPipeError on Broken Read Formatting Handle Exceptions in Daemon Mode Allow Exit with Ctrl+C without a Stacktrace Move "Read Rest of Output" Out of Destructor Better Shutdown Process for Pipes Better Shutdown Process for Target Program Better Info Messages ...
2021-09-02Change behavior for import sploitdusoleil1-0/+1
The statement import sploit will now import all of the sploit modules under the sploit namespace. Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
2021-09-02Add mem module for calculating memory offsetsdusoleil2-1/+16
Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
2021-09-02Handle Process destr when Process constr throwsdusoleil1-0/+1
Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
2021-09-02Reuse read() and readline() in the until() APIdusoleil1-4/+5
Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
2021-09-02Add readall() which reads until EOFdusoleil2-2/+8
Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
2021-09-02Move comm toggles for consistencydusoleil1-3/+3
Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
2021-09-02Add arch config moduledusoleil2-1/+29
Add Arch class which specifies wordsize, endianness, alignment, and a nop code for an architecture. Add a couple predefined architectures for x86 and x86_64 Add a "configured" architecture which is set to x86_64 by default. Added btoi and itob functions which will convert to and from bytes and ints based on the current architecture config Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
2021-09-01Add Config Toggles for Read/Write Extra Behaviordusoleil1-5/+8
logonread can enable/disable logging the result of every read flushonwrite can enable/disable automatically flushing every write Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
2021-09-01Rewrite interact() to be Single Threadeddusoleil1-36/+26
Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
2021-09-01Add Convenience Utility to readuntil()dusoleil3-3/+20
readuntil() and readlineuntil() will now automatically bind() a predicate and given arguments to produce the single function predicate required. The 'until' module will provide convenience utilities for use with readuntil() and readlineuntil(). For now, it contains functools.partial renamed as bind(), lastline() which can call a predicate with the last element of the array of lines given from readlineuntil(), and simplified versions of re.search and re.fullmatch renamed as contains and equals. These allow us to write powerful and legible statements like: comm.readlineuntil(lastline,contains,b'Enter') Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
2021-09-01readlineuntil() Operates on an Array of Linesdusoleil1-4/+9
Instead of only operating on and returning the last line read, readlineuntil() will now check the predicate against an array of all lines read and return that array when the predicate is true. Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
2021-09-01Correct read() Semanticsdusoleil1-1/+1
The BufferedReader's .read() doesn't behave as expected. It reads EXACTLY size bytes and will block until there are enough available to read. os.read() does what we expect. It will read UP TO size bytes and only block if there is nothing available to read. Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
2021-09-01Throw a BrokenPipeError on Broken Readdusoleil1-0/+4
Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
2021-09-01Formattingdusoleil2-16/+16
Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
2021-09-01Handle Exceptions in Daemon Modedusoleil1-1/+12
If the user presses Ctrl+C while waiting on a connection, we want to gracefully exit. If the user presses Ctrl+C during the script, we want to stop executing the script and restart the loop. If any other exception happens during the script, we want to print out the stacktrace as normal, but continue the loop. Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
2021-09-01Allow Exit with Ctrl+C without a Stacktracedusoleil1-8/+11
Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
2021-09-01Move "Read Rest of Output" Out of Destructordusoleil2-4/+2
With the "read rest of output" code in the Comm destructor, it would continue to read output even in situations where some error happened and we expect sploit to die or when the user presses Ctrl+C to end sploit. By moving it to the end of the script running code in main, it behaves more intuitively. Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
2021-09-01Better Shutdown Process for Pipesdusoleil1-4/+7
Handle all of the edge cases when shutting down in Pipes mode. e.g. If the pipes are broken (tried to write after the program died) If the fifos don't exist anymore (sometimes tempfile cleans them up before the destructor finishes when certain errors happen) If the object attributes for the streams and fifo paths aren't set (this can happen if the constructor didn't finish. e.g. the user cancels while waiting on a connection) Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
2021-09-01Better Shutdown Process for Target Programdusoleil1-1/+8
If we need to wait on the target program to die, we don't want to just wait forever with no indication to the user. Instead, only call wait if the program is still alive, inform the user that we are doing this, and give them the ability to forcefully kill the target program with Ctrl+C. Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
2021-09-01Better Info Messagesdusoleil2-2/+3
Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
2021-08-31Use Entire Path When Given The Pipe Directorydusoleil2-3/+4
Previously, you could specify a directory which must exist under /tmp. Now, you can give the full path to a directory to be used by Pipes. Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
2021-08-31Add Interactive Mode to Commsdusoleil1-1/+49
comm.interact() will drop the user into an "interactive" mode where they can directly control what is sent. A SIGINT (Ctrl+C) will drop the script out of interactive mode and continue executing the rest of the script. If the output of the program (input into our script) goes into a broken state (such as when the target program exits), interactive mode will automatically exit. Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
2021-08-31Add readuntil() and readlineuntil() to Commsdusoleil1-0/+14
Both new functions check the input for a predicate and keep reading until the predicate is true. readuntil() will consume input byte by byte and use the entire string read to check the predicate. It will then return that entire string. readlineuntil() consumes input line by line and only uses the last line to check the predicate. The line that satisfies the predicate is all that is returned. Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
2021-08-31Use With Statement for Temporary Directorydusoleil1-4/+4
Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
2021-08-30Sploit Rework MVP Structure, Packaging, and Commsdusoleil15-329/+133
First part of the MVP for the larger Sploit rework effort. Add project structure, python packaging, basic comms, and "log" hook. From in or out of the sploit directory, you can run the "sploit.py" script, run python -m sploit, or import the sploit modules from the python3 shell. You can also pip install Sploit and from anywhere you can run the sploit command, run python -m sploit, or import the sploit modules from the python3 shell. Running as a standalone application, Sploit can run in a "target" mode, a "pipe" mode, and a "pipe daemon" mode. In "target" mode, Sploit will launch a target program as a subprocess and run an exploit script against its I/O. In "pipe" mode, Sploit will create named fifos and wait for a program to connect to them to run an exploit script against them. In "pipe daemon" mode, Sploit will run similar to the "pipe" mode, but automatically recreate the fifos with the same name after each execution. Basic comm operations of read, readline, write, and writeline are available to the exploit script. A "log" hook is executed whenever data is read in from the target program. This will just print the data out, but it can be configured to decode it with a specific encoding or you could replace the function for different behavior. Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
2021-08-22Merge branch 'shellcode-templates'Malfurious9-34/+100
This is content from an old repo of mine. I think it makes much more sense to merge it into lib-des-gnux. templates/shellcode/ will track any useful shellcode recipes and contains utilities for building them into ready-to-use payloads. * shellcode-templates: Globally ignore all build artifacts Add Makefile for shellcode templates Refactor genhex into shelltool Add sys_exit shellcode templates Add generic /bin/sh shellcode templates
2021-08-22Globally ignore all build artifactsMalfurious2-1/+8
Signed-off-by: Malfurious <m@lfurio.us>