GithubHelp home page GithubHelp logo

anthrax3 / sickle Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wetw0rk/sickle

0.0 1.0 0.0 38.26 MB

A tool I have found incredibly useful whenever creating custom shellcode.

License: MIT License

Python 100.00%

sickle's Introduction

Sickle

Sickle is a shellcode development tool, created to speed up the various steps needed to create functioning shellcode.

Sickle can aid in the following:

  • Identifying instructions resulting in bad characters.
  • Formatting output in various languages (python, perl, javascript, etc).
  • Accepting shellcode via STDIN and formatting it.
  • Executing shellcode in both Windows and Linux environments.
  • Comparing reversed shellcode to original.
  • Dissembling shellcode into assembly language (ARM, x86, etc).

Quick failure check

A task I found myself doing repetitively was compiling assembly source code then extracting the shellcode, placing it into a wrapper, and testing it. If it was a bad run, the process would be repeated until successful. Sickle takes care of placing the shellcode into a wrapper for quick testing. (Works on Windows and Unix systems):

alt text

Recreating shellcode

Sometimes you find a piece of shellcode that's fluent in its execution and you want to recreate it yourself to understand its underlying mechanisms. Sickle can help you compare the original shellcode to your "recreated" version.

alt text

Bad character identification

It's important to note that currently bad character identification is best used within a Linux based operating system. When dumping shellcode on a Windows host bad characters will not be highlighted. Below is a usage example in a Unix environment:

asciicast

Disassembly

Sickle can also take a binary file and convert the extracted opcodes (shellcode) to machine instructions (-obj). Keep in mind this works with raw opcodes (-r) and STDIN (-s) as well. In the following example I am converting a reverse shell designed by Stephen Fewer to assembly.

alt text

Windows Installation

If you decide to opt-out of the disassembly functions and only want to use Sickle as a wrapper/dumping tool Sickle will work out of the box with any Python version (Including 2.7). I have only encountered issues when writing/testing 64 bit shellcode on a Windows 10 host. In order to avoid problems I recommend installing Python 3.4.4 (amd64) however any other Windows version should not have this issue. Should you be writing x86 shellcode, Windows 10 will work with any Python version eg Python 3.7.0a3. Below is a usage example testing msfvenom generated shellcode ("windows/x64/shell_reverse_tcp") on a Windows 10 host

alt text

Linux Installation

Sickle is written in Python3 and to have full functionality I recommend installing capstone directly. If you don't need the disassembly function Sickle should work out of the box. Installation of Capstone is as easy as 1,2,3:

  • apt-get install python3-pip
  • pip3 install capstone

If you don't compile your shellcode in NASM I have added an "objdump2shellcode" like function. Although I recommend using NASM for a streamline experience. For ease of access I prefer to add Sickle to the /usr/bin/ directory however if you use Black Arch Linux Sickle comes pre-installed. (previously known as objdump2shellcode):

root@wetw0rk:~# git clone https://github.com/wetw0rk/Sickle.git
root@wetw0rk:~# cd Sickle/
root@wetw0rk:~# chmod +x sickle.py
root@wetw0rk:~# cp sickle.py /usr/bin/sickle
root@wetw0rk:~# sickle
usage: sickle [-h] [-r READ] [-s] [-obj OBJDUMP] [-f FORMAT] [-b BADCHAR] [-c]
              [-v VARNAME] [-l] [-e EXAMINE] [-d] [-a ARCH] [-m MODE] [-rs]

Sickle - a shellcode development tool

optional arguments:
  -h, --help            show this help message and exit
  -r READ, --read READ  read byte array from the binary file
  -s, --stdin           read ops from stdin (EX: echo -ne "\xde\xad\xbe\xef" |
                        sickle -s -f <format> -b '\x00')
  -obj OBJDUMP, --objdump OBJDUMP
                        binary to use for shellcode extraction (via objdump
                        method)
  -f FORMAT, --format FORMAT
                        output format (use --list for a list)
  -b BADCHAR, --badchar BADCHAR
                        bad characters to avoid in shellcode
  -c, --comment         comments the shellcode output
  -v VARNAME, --varname VARNAME
                        alternative variable name
  -l, --list            list all available formats and arguments
  -e EXAMINE, --examine EXAMINE
                        examine a separate file containing original shellcode.
                        mainly used to see if shellcode was recreated
                        successfully
  -d, --disassemble     disassemble the binary file
  -a ARCH, --arch ARCH  select architecture for disassembly
  -m MODE, --mode MODE  select mode for disassembly
  -rs, --run-shellcode  run the shellcode (use at your own risk)

sickle's People

Contributors

wetw0rk avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.