Skip to main content

Deal with bad characters easily during exploit writing with badchars.

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

badbyte-0.1.7.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

badbyte-0.1.7-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file badbyte-0.1.7.tar.gz.

File metadata

  • Download URL: badbyte-0.1.7.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for badbyte-0.1.7.tar.gz
Algorithm Hash digest
SHA256 65acdaf13b6805a7be44376059f92d78e1f84a6a5caeea5c8fcc3f1d6fbd74ae
MD5 ffa2b1064defcf5eb08ccfb11945dce3
BLAKE2b-256 32b14a7cd9fe6d06f63118ac49f1c4887b37a432e2d4b8de75b3946f1f8ed704

See more details on using hashes here.

File details

Details for the file badbyte-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: badbyte-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for badbyte-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 1dafb8abc044cc954c8a43ef0aaad7ddb007abadcb58358806973a32701e60fe
MD5 7c0a5cff7abe23b1d88b99266beaa9c8
BLAKE2b-256 c1d83f2b1234a2a14a74209c8d8522f00086998d9a3fb48442f304a1e239e2c5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page