Name | syntax-symphony JSON |
Version |
0.1.0
JSON |
| download |
home_page | None |
Summary | Efficient grammar-based fuzzer. |
upload_time | 2024-07-09 17:56:33 |
maintainer | None |
docs_url | None |
author | Stanimir Iglev |
requires_python | >=3.10 |
license | MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
fuzzer
fuzzing
testing
grammar
grammars
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Syntax Symphony
## Overview
Syntax Symphony is a powerful fuzzer designed to automatically generate test inputs for various applications based on user-defined grammars.
The fuzzer leverages the grammar rules to create meaningful and diverse input data, facilitating robust testing of applications.
In order to achieve high diversity and coverage of grammar rules, it uses k-coverage, as discussed by [Havrikov et al.](https://ieeexplore.ieee.org/abstract/document/8952419). This work has been greatly influenced by the concepts and ideas outlined in the [Fuzzing Book](https://www.fuzzingbook.org/).
With Syntax Symphony, you can enhance the quality and reliability of your software by generating a comprehensive set of test cases effortlessly. Start fuzzing today and make your software more robust against unexpected inputs!
## Getting Started
### Prerequisites
- Python 3.10 or higher
### Installation
#### From PyPI
```bash
pip install syntax-symphony
```
#### From Source
1. Clone the repository:
```bash
git clone
cd syntax_symphony
```
2. We recommend creating a virtual environment to install the dependencies:
```bash
python -m venv venv
source venv/bin/activate
python -m pip install -r requirements.txt
```
3. Install locally (add flag -e to install in editable mode):
```bash
pip install .
```
4. To build the package:
```bash
python -m pip install build
python -m build
```
This should create the package in the `dist/` directory.
## CLI
Syntax Symphony provides a command-line interface (CLI) to interact with the fuzzer. The CLI allows you to specify the grammar file, the number of test cases to generate, and the output directory to save the generated test cases among others.
### Example usage:
```bash
# Generate 100 test cases using the grammar file examples/expr_grammar.json
ssfuzz -g examples/expr_grammar.json -c 100
# Save the output in the directory out/
ssfuzz -g examples/expr_grammar.json -c 100 -d out
# Set the start symbol
ssfuzz -g examples/expr_grammar.json -c 100 --start begin
# Set the file extension
ssfuzz -g examples/expr_grammar.json -c 100 -e json
```
### Full syntax:
```
ssfuzz [-h] -g FILE [-s SYMBOL] -c NUMBER [-d DIR] [-e EXT] [--max-depth NUMBER] [--min-depth NUMBER] [-k NUMBER]
Syntax Symphony Fuzzer
options:
-h, --help show this help message and exit
-g FILE, --grammar FILE
Path to the grammar file
-s SYMBOL, --start SYMBOL
Start symbol of the grammar (without <...>). Default: start
-c NUMBER, --count NUMBER
Number of strings to generate
-d DIR, --dir DIR Output directory for the generated strings. Default: output
-e EXT, --file-extension EXT
The file extension to be used for the produced documents. Default: txt
--max-depth NUMBER Maximum depth for the derivation trees. Default: 10
--min-depth NUMBER Minimum depth for the derivation trees. Default: 1
-k NUMBER, --kcov NUMBER
Number of strings to generate for k-cov. Default: 1
```
## API
Syntax Symphony can also be used as a library in your Python projects. The API provides a simple interface to generate test inputs using the fuzzer.
### Example usage:
```python
from syntax_symphony.fuzzer import SyntaxSymphony
from syntax_symphony.grammar import Grammar
# Define the grammar
grammar = Grammar({
"<start>": ["<expr>"],
"<expr>": ["<term> + <expr>", "<term> - <expr>", "<term>"],
"<term>": ["<factor> * <term>", "<factor> / <term>", "<factor>"],
"<factor>": ["<number>", "(<expr>)"],
"<number>": ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
})
# Create the fuzzer
fuzzer = SyntaxSymphony(grammar)
# Generate 10 test cases
for i in range(10):
test_case = fuzzer.fuzz()
print(test_case)
```
## Contributing
We welcome contributions from the community. If you have ideas for improvements, new features, or bug fixes, please submit a pull request or open an issue on our GitHub repository.
## License
This project is licensed under the MIT License. See [LICENSE](LICENSE) for more details.
Raw data
{
"_id": null,
"home_page": null,
"name": "syntax-symphony",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": "Stanimir Iglev <iglev.stanimir@gmail.com>",
"keywords": "fuzzer, fuzzing, testing, grammar, grammars",
"author": "Stanimir Iglev",
"author_email": "Stanimir Iglev <iglev.stanimir@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/e9/27/6c6f338c94c6800833c51b00d48b249b543da26f714654bd7884565b2bf1/syntax_symphony-0.1.0.tar.gz",
"platform": null,
"description": "# Syntax Symphony\n\n## Overview\n\nSyntax Symphony is a powerful fuzzer designed to automatically generate test inputs for various applications based on user-defined grammars.\nThe fuzzer leverages the grammar rules to create meaningful and diverse input data, facilitating robust testing of applications.\nIn order to achieve high diversity and coverage of grammar rules, it uses k-coverage, as discussed by [Havrikov et al.](https://ieeexplore.ieee.org/abstract/document/8952419). This work has been greatly influenced by the concepts and ideas outlined in the [Fuzzing Book](https://www.fuzzingbook.org/).\n\nWith Syntax Symphony, you can enhance the quality and reliability of your software by generating a comprehensive set of test cases effortlessly. Start fuzzing today and make your software more robust against unexpected inputs!\n\n\n## Getting Started\n\n### Prerequisites\n- Python 3.10 or higher\n\n### Installation\n\n#### From PyPI\n```bash\npip install syntax-symphony\n```\n#### From Source\n1. Clone the repository:\n```bash\ngit clone\ncd syntax_symphony\n```\n\n2. We recommend creating a virtual environment to install the dependencies:\n```bash\npython -m venv venv\nsource venv/bin/activate\npython -m pip install -r requirements.txt\n```\n\n3. Install locally (add flag -e to install in editable mode):\n```bash\npip install .\n```\n\n4. To build the package:\n```bash\npython -m pip install build\npython -m build\n```\nThis should create the package in the `dist/` directory.\n\n## CLI\nSyntax Symphony provides a command-line interface (CLI) to interact with the fuzzer. The CLI allows you to specify the grammar file, the number of test cases to generate, and the output directory to save the generated test cases among others.\n\n### Example usage:\n```bash\n# Generate 100 test cases using the grammar file examples/expr_grammar.json\nssfuzz -g examples/expr_grammar.json -c 100\n\n# Save the output in the directory out/\nssfuzz -g examples/expr_grammar.json -c 100 -d out\n\n# Set the start symbol\nssfuzz -g examples/expr_grammar.json -c 100 --start begin\n\n# Set the file extension\nssfuzz -g examples/expr_grammar.json -c 100 -e json\n```\n\n### Full syntax:\n```\nssfuzz [-h] -g FILE [-s SYMBOL] -c NUMBER [-d DIR] [-e EXT] [--max-depth NUMBER] [--min-depth NUMBER] [-k NUMBER]\n\nSyntax Symphony Fuzzer\n\noptions:\n -h, --help show this help message and exit\n -g FILE, --grammar FILE\n Path to the grammar file\n -s SYMBOL, --start SYMBOL\n Start symbol of the grammar (without <...>). Default: start\n -c NUMBER, --count NUMBER\n Number of strings to generate\n -d DIR, --dir DIR Output directory for the generated strings. Default: output\n -e EXT, --file-extension EXT\n The file extension to be used for the produced documents. Default: txt\n --max-depth NUMBER Maximum depth for the derivation trees. Default: 10\n --min-depth NUMBER Minimum depth for the derivation trees. Default: 1\n -k NUMBER, --kcov NUMBER\n Number of strings to generate for k-cov. Default: 1\n```\n\n## API\nSyntax Symphony can also be used as a library in your Python projects. The API provides a simple interface to generate test inputs using the fuzzer.\n\n### Example usage:\n```python\nfrom syntax_symphony.fuzzer import SyntaxSymphony\nfrom syntax_symphony.grammar import Grammar\n\n# Define the grammar\ngrammar = Grammar({\n \"<start>\": [\"<expr>\"],\n \"<expr>\": [\"<term> + <expr>\", \"<term> - <expr>\", \"<term>\"],\n \"<term>\": [\"<factor> * <term>\", \"<factor> / <term>\", \"<factor>\"],\n \"<factor>\": [\"<number>\", \"(<expr>)\"],\n \"<number>\": [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\"]\n})\n\n# Create the fuzzer\nfuzzer = SyntaxSymphony(grammar)\n\n# Generate 10 test cases\nfor i in range(10):\n test_case = fuzzer.fuzz()\n print(test_case)\n```\n\n## Contributing\nWe welcome contributions from the community. If you have ideas for improvements, new features, or bug fixes, please submit a pull request or open an issue on our GitHub repository.\n\n## License\nThis project is licensed under the MIT License. See [LICENSE](LICENSE) for more details.\n",
"bugtrack_url": null,
"license": " MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
"summary": "Efficient grammar-based fuzzer.",
"version": "0.1.0",
"project_urls": {
"Changelog": "https://github.com/StanimirIglev/syntax-symphony/blob/master/CHANGELOG.md",
"Documentation": "https://github.com/StanimirIglev/syntax-symphony/blob/master/README.md",
"Homepage": "https://github.com/StanimirIglev/syntax-symphony",
"Repository": "https://github.com/StanimirIglev/syntax-symphony"
},
"split_keywords": [
"fuzzer",
" fuzzing",
" testing",
" grammar",
" grammars"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8c88e994896b4aafc3e87b41e078c11152518ad965233bae401af594d66eb8a4",
"md5": "8eab0ca0b47049cd5f42ae044fd4460f",
"sha256": "8a34b69afa988af1694bae1e197247cb105bcef2137bec11048b4fddcd35beca"
},
"downloads": -1,
"filename": "syntax_symphony-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8eab0ca0b47049cd5f42ae044fd4460f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 13090,
"upload_time": "2024-07-09T17:56:32",
"upload_time_iso_8601": "2024-07-09T17:56:32.543742Z",
"url": "https://files.pythonhosted.org/packages/8c/88/e994896b4aafc3e87b41e078c11152518ad965233bae401af594d66eb8a4/syntax_symphony-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e9276c6f338c94c6800833c51b00d48b249b543da26f714654bd7884565b2bf1",
"md5": "bbedbb06448a2e461c3870641c47c236",
"sha256": "5f9dfcbc926c77ed79a040ea5b29cc47230d40b478e8e97b1f6e649090a3af26"
},
"downloads": -1,
"filename": "syntax_symphony-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "bbedbb06448a2e461c3870641c47c236",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 14862,
"upload_time": "2024-07-09T17:56:33",
"upload_time_iso_8601": "2024-07-09T17:56:33.526851Z",
"url": "https://files.pythonhosted.org/packages/e9/27/6c6f338c94c6800833c51b00d48b249b543da26f714654bd7884565b2bf1/syntax_symphony-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-09 17:56:33",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "StanimirIglev",
"github_project": "syntax-symphony",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "syntax-symphony"
}