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.11.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.11-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for badbyte-0.1.11.tar.gz
Algorithm Hash digest
SHA256 2f5ead494cd0b77bdeff92a48bb489031c1c0daf40c877727e06b1daef9d7203
MD5 5369719465df3bf063e49878739e06db
BLAKE2b-256 e8000bf07ac5ddea3116755bd8341d0ad54e88d157fa60293aa83a469ffd43c9

See more details on using hashes here.

Provenance

The following attestation bundles were made for badbyte-0.1.11.tar.gz:

Publisher: python-publish.yml on C3l1n/badbyte

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

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

File hashes

Hashes for badbyte-0.1.11-py3-none-any.whl
Algorithm Hash digest
SHA256 c64de5cfb22e3c73585ea0c982504ecc5f21e126a67f4130cde5939fcb835d8e
MD5 c681eee9495b03b5e1667a5427a6023f
BLAKE2b-256 abc67a4e80d42d45c4b048f8b6bd643296248723d2b6d64f9d078376de9e30ff

See more details on using hashes here.

Provenance

The following attestation bundles were made for badbyte-0.1.11-py3-none-any.whl:

Publisher: python-publish.yml on C3l1n/badbyte

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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