lil endian
This program is comptaible with both Python 2 and 3.
It simply returns escaped shell code in Little Endian format for whatever memory address is submitted as the first argument.
It's smart enough to distinguish between addresses with an 0x prefix and accounts for that.
If the address is only in the 64-bit range, you will only receive the 64-bit output.
If the address can fit in the x86_64 ranges, you will receive both 32 and 64-bit output.
Install for python3 via PyPI:
pip3 install lilendian
Install for python2 via setup.py:
python setup.py install
Run in place:
./lilendian [single memory address]
Examples
$ ./lilendian deadbeef
\xef\xbe\xad\xde
\xef\xbe\xad\xde\x00\x00\x00\x00
$ ./lilendian 0xdeadbeef
\xef\xbe\xad\xde
\xef\xbe\xad\xde\x00\x00\x00\x00
$ ./lilendian 0x00007fffffffd980
\x80\xd9\xff\xff\xff\x7f\x00\x00
Shell script example snippet:
Let's say you wanted to get a piece of 64-bit shellcode for 0xdeadbeef + 0xbadcafe + 0xcafebabe + 0xabadbabe.
for addr in {0xdeadbeef,0xbadcafe,0xcafebabe,0xabadbabe}; do
lilendian $addr | tail -1
done | tr -d "\n"; echo
Output:
\xef\xbe\xad\xde\x00\x00\x00\x00\xfe\xca\xad\x0b\x00\x00\x00\x00\xbe\xba\xfe\xca\x00\x00\x00\x00\xbe\xba\xad\xab\x00\x00\x00\x00
Copy and paste that guy straight into your payload.
Calling from within gdb:
(gdb) ! lilendian 0xdeadbeef
\xef\xbe\xad\xde
\xef\xbe\xad\xde\x00\x00\x00\x00
Future:
I might tweak it in the future to take multiple memory addresses, but as of right now, it only outputs a single memory address.
I have kept it short and simple to be easily scriptable, so I'll leave the rest up to you.
Metadata
Release files for lilendian 1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| lilendian-1.1-py3-none-any.whl | Python 3 | none | any | Details |
Release files / lilendian-1.1-py3-none-any.whl
| Download URL | lilendian-1.1-py3-none-any.whl |
|---|---|
| Size | 3.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c35812e3d8c4fe0243027ad53b8deb606851e6f3b584d53df64e144c9b844da0
|
|
BLAKE2b-256 checksum How to use checksums |
98d624e4010a3fb8e9ccb3d4d14de1be033c0e90292f1238c62bf8ee887dbf0d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5
|