pyradamsa
==========================
`pyradamsa` provides an interface for calling libradamsa methods from within Python, allowing one to perform mutations on byte blocks (aka fuzzing). For more details see [radamsa](https://gitlab.com/akihe/radamsa) (a general-purpose fuzzer) and [libradamsa](https://github.com/andreafioraldi/libradamsa) (precompiled radamsa library).
## Usage
Install the package using `pip` (or [build](#building) it from source)
```bash
pip install pyradamsa
```
Do some fuzzing
```python
import pyradamsa
rad = pyradamsa.Radamsa()
mydata = b'GET /auth?pass=HelloWorld HTTP1.1'
fuzzed = rad.fuzz(mydata, seed=1337)
print(fuzzed)
> b'GET /auth?pass=HelloWorld HTTP\xc0\xb1.1'
# seed is randomly set if not provided
rad.fuzz(mydata)
> b'\tG\xf3\xa0\x81\x9c\xf7dLET \xe2\x81/aut\xf3\xa0\x80\xafHTTP2.rld HTTP2.rld HTTP3.2\xe1\xa0\x8e9'
rad.fuzz(mydata)
> b'GET /auth?pass=HelloWorld HTTP1.340282366920938463463374607431768211455'
etc.
# enforce static seed on initialization
rad = pyradamsa.Radamsa(seed=0)
# max_mut enforces a maximum length for returned data
# it defaults to (data length + an offset of 4096 bytes)
fuzzed = rad.fuzz(mydata, seed=1337, max_mut=10)
> b'GET /auth?'
# the offset may be overwritten on init
rad = pyradamsa.Radamsa(mut_offset=2048)
```
## Building
Currently wheels are available for linux i686 and x86_64
```sh
# Clone the repo
git clone --recurse-submodules https://github.com/tsundokul/pyradamsa.git
cd pyradamsa
# patch memory leak when reinitializing owl vm
patch libradamsa/libradamsa.c realloc.patch
# OPTIONAL: when using manylinux (https://github.com/pypa/manylinux)
docker run --rm -it -v `pwd`:/io quay.io/pypa/manylinux2010_x86_64 /bin/bash
cd /io && alias python='/opt/python/cp35-cp35m/bin/python3.5'
export PATH="/opt/python/cp35-cp35m/bin/:${PATH}"
# Install requirements
python -m pip install -r requirements.txt
# Build C extension (libradamsa.so)
python setup.py build_ext
# Run tests
./run_tests
# Build wheel
python setup.py bdist_wheel
```
## Contributing
* Fork the repo
* Check out a feature or bug branch
* Add your changes
* Update README when needed
* Submit a pull request to upstream repo
* Add description of your changes
* Ensure tests are passing
* Ensure branch is mergeable
_MIT License, 2020_ [@tim17d](https://twitter.com/tim17d)
Raw data
{
"_id": null,
"home_page": "https://github.com/tsundokul/pyradamsa",
"name": "pyradamsa",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "radamsa fuzzing libradamsa",
"author": "Daniel Timofte @tim17d",
"author_email": "timofte.daniel@tuta.io",
"download_url": "",
"platform": "",
"description": "pyradamsa\n==========================\n\n`pyradamsa` provides an interface for calling libradamsa methods from within Python, allowing one to perform mutations on byte blocks (aka fuzzing). For more details see [radamsa](https://gitlab.com/akihe/radamsa) (a general-purpose fuzzer) and [libradamsa](https://github.com/andreafioraldi/libradamsa) (precompiled radamsa library).\n\n## Usage\n\nInstall the package using `pip` (or [build](#building) it from source)\n```bash\npip install pyradamsa\n```\n\nDo some fuzzing\n```python\nimport pyradamsa\n\nrad = pyradamsa.Radamsa()\n\nmydata = b'GET /auth?pass=HelloWorld HTTP1.1'\nfuzzed = rad.fuzz(mydata, seed=1337)\nprint(fuzzed)\n\n> b'GET /auth?pass=HelloWorld HTTP\\xc0\\xb1.1'\n\n# seed is randomly set if not provided\nrad.fuzz(mydata)\n> b'\\tG\\xf3\\xa0\\x81\\x9c\\xf7dLET \\xe2\\x81/aut\\xf3\\xa0\\x80\\xafHTTP2.rld HTTP2.rld HTTP3.2\\xe1\\xa0\\x8e9'\nrad.fuzz(mydata)\n> b'GET /auth?pass=HelloWorld HTTP1.340282366920938463463374607431768211455'\netc.\n\n# enforce static seed on initialization\nrad = pyradamsa.Radamsa(seed=0)\n\n# max_mut enforces a maximum length for returned data\n# it defaults to (data length + an offset of 4096 bytes)\nfuzzed = rad.fuzz(mydata, seed=1337, max_mut=10)\n> b'GET /auth?'\n\n# the offset may be overwritten on init\nrad = pyradamsa.Radamsa(mut_offset=2048)\n```\n\n## Building\nCurrently wheels are available for linux i686 and x86_64\n```sh\n# Clone the repo\ngit clone --recurse-submodules https://github.com/tsundokul/pyradamsa.git\ncd pyradamsa\n\n# patch memory leak when reinitializing owl vm\npatch libradamsa/libradamsa.c realloc.patch\n\n# OPTIONAL: when using manylinux (https://github.com/pypa/manylinux)\ndocker run --rm -it -v `pwd`:/io quay.io/pypa/manylinux2010_x86_64 /bin/bash\ncd /io && alias python='/opt/python/cp35-cp35m/bin/python3.5'\nexport PATH=\"/opt/python/cp35-cp35m/bin/:${PATH}\"\n\n# Install requirements\npython -m pip install -r requirements.txt\n\n# Build C extension (libradamsa.so)\npython setup.py build_ext\n\n# Run tests\n./run_tests\n\n# Build wheel\npython setup.py bdist_wheel\n```\n\n## Contributing\n* Fork the repo\n* Check out a feature or bug branch\n* Add your changes\n* Update README when needed\n* Submit a pull request to upstream repo\n* Add description of your changes\n* Ensure tests are passing\n* Ensure branch is mergeable\n\n_MIT License, 2020_ [@tim17d](https://twitter.com/tim17d)\n\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "Python bindings for radamsa fuzzing library.",
"version": "0.1.1",
"project_urls": {
"Homepage": "https://github.com/tsundokul/pyradamsa"
},
"split_keywords": [
"radamsa",
"fuzzing",
"libradamsa"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "187fdc8b93c40e6cb810295187de68285515083caad944487ec5b77214166015",
"md5": "06438c54264d820695aa110aa7aceb3e",
"sha256": "e8bf3c115cec8b38bdd4d169a55b837789d5f4a48468c2a6240306ea6f426365"
},
"downloads": -1,
"filename": "pyradamsa-0.1.1-cp32-abi3-manylinux1_i686.whl",
"has_sig": false,
"md5_digest": "06438c54264d820695aa110aa7aceb3e",
"packagetype": "bdist_wheel",
"python_version": "cp32",
"requires_python": null,
"size": 550450,
"upload_time": "2020-07-14T18:09:50",
"upload_time_iso_8601": "2020-07-14T18:09:50.755202Z",
"url": "https://files.pythonhosted.org/packages/18/7f/dc8b93c40e6cb810295187de68285515083caad944487ec5b77214166015/pyradamsa-0.1.1-cp32-abi3-manylinux1_i686.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "f386bac767757153b0ba0027022c64e924f1097bba09e397902c9d790eda949f",
"md5": "f8082838d654ed4ca1cde01ad03bfc0e",
"sha256": "dd12d5e3e42b00cc715e130c197a53d4810feb54e4feb41631ad990b500f6e34"
},
"downloads": -1,
"filename": "pyradamsa-0.1.1-cp32-abi3-manylinux1_x86_64.whl",
"has_sig": false,
"md5_digest": "f8082838d654ed4ca1cde01ad03bfc0e",
"packagetype": "bdist_wheel",
"python_version": "cp32",
"requires_python": null,
"size": 545209,
"upload_time": "2020-07-14T18:09:52",
"upload_time_iso_8601": "2020-07-14T18:09:52.514962Z",
"url": "https://files.pythonhosted.org/packages/f3/86/bac767757153b0ba0027022c64e924f1097bba09e397902c9d790eda949f/pyradamsa-0.1.1-cp32-abi3-manylinux1_x86_64.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2020-07-14 18:09:50",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "tsundokul",
"github_project": "pyradamsa",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "pytest",
"specs": []
},
{
"name": "pytest-cov",
"specs": []
},
{
"name": "setuptools",
"specs": []
}
],
"lcname": "pyradamsa"
}