Fabric icon indicating copy to clipboard operation
Fabric copied to clipboard

Add New "create_command" Pattern

Open lukewegryn opened this issue 2 years ago • 0 comments

What this Pull Request (PR) does

This adds a new "create_command" pattern that generates CLI commands for any locally installed tool (including appropriate options and switches) based on a description of what the user wants the tool to do. The user describes what the specified tool should do and the documentation from the "-h" help switch that most commands have. The pattern then acts as an individual who is reading the help documentation and selecting the correct options and switches to add to the command to achieve the specified goal.

For example, if the user wants to know how to run sqlmap under specific conditions, they may use fabric with the create_command pattern as follows (specify the tool, description of what the tool should do, and the help documentation via the "-h" switch for the tool):

tool=sqlmap; echo -e "use $tool target https://example.com?test=id url, specifically the test parameter. use a random user agent and do the scan aggressively with the highest risk and level\n\n$($tool -h 2>&1)" | fabric --pattern create_command

fabric responds with:

python3 sqlmap -u https://example.com?test=id --random-agent --level=5 --risk=3 -p test

The inspiration for this comes from penetration testing, where many CLI tools are used, but it can be difficult to remember all of the options and switches.

Details and examples can be found in the README.

lukewegryn avatar Feb 28 '24 02:02 lukewegryn