C3l1n / badbyte

Deal with bad characters easily during exploit writing with badchars.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

badbyte

logo

Deal with bad characters easily during exploit writing with badchars.

Table of Contents

  1. Installation
  2. Usage
  3. Programatically use

Instalation

using pip:

pip3 install badbyte 

or from repo:

git clone git@github.com:C3l1n/badbyte.git
cd badbyte
pip3 install .

Usage

You can always use:

badbyte --help

Cyclic pattern generate

It is useful to search for offset at which you should put your sniper shot constants. For example return address: you generate pattern with this function, trigger vulnerability with generated payload. EIP value (remember about little ending in x86) has uniq part of pattern and offset of that part could be calculated with badbyte parse (see next chapter).

badbyte c -u 4 -l 100 --bad "61 62"

cyclegenerate

Search for offset in cyclic pattern

Search for offset of provided part in --pattern argument.

badbyte o -u 4 -l 100 --bad "61 62" -p cocc

cyclesearch

Generate payload to check all characters

badbyte g --bad "3d 26 25 0d" --pre START --post STOP

generate-payloag

use:

  • --bad to supply hexascii values of bad characters
  • --pre to set string for marking start point (or leave default)
  • --post to set string for marking stop point (or leave default)

Then use payload in your exploit and fire it.

Analyze memory dumped after trigger

Copy hexascii from memory dump of your favourite debugger i.e. windbg:

dump-copy

remember to skip addresses and ascii representation. I use vim and column select or visual studio code and alt+shift select.

select-hexdump

Fire badbyte to analyze output:

badbyte p -c --pre START --post STOP

analyze

Programatically use

Documentation not made (feel free to read code) but you can find in example/programatically_generate_payload.py example of payload generation in exploit.

About

Deal with bad characters easily during exploit writing with badchars.

License:MIT License


Languages

Language:Python 100.0%