bats3c / shad0w

A post exploitation framework designed to operate covertly on heavily monitored environments
https://blog.dylan.codes/shad0w/
MIT License
2.03k stars 323 forks source link

shad0w cli doesn't print help messages #37

Closed bblenard closed 4 years ago

bblenard commented 4 years ago

Currently the shad0w cli tool doesn't understand --help for its subcommands and will only return help messages for the top level. This makes using the tool hard if you do not already know the cli arguments. Operators can "trick" the parser into printing the subcommands help message by supplying bogus cli arguments but this is not ideal. shad0w's cli component should support help messages for each of the subcommands as well as the top level help message. Below are examples of the top level help message and bogus argument workaround

Top Level Help

root@d7d7d46a8fc9:~/shad0w# ./shad0w.py listen -h                                                                                                                                                                                             
usage: shad0w.py [-h]                                                                                                                                                                                                                         

positional arguments:                                                                                                                                                                                                                         
  listen      Tell shad0w to listen for connections                                                                                                                                                                                           
  beacon      Tell shad0w to create a beacon                                                                                                                                                                                                  
  update      Update shad0w                                                                                                                                                                                                                   

optional arguments:                                                                                                                                                                                                                           
  -h, --help  show this help message and exit                                                                                                                                                                                                 
root@d7d7d46a8fc9:~/shad0w# ./shad0w.py beacon -h                                                                                                                                                                                             
usage: shad0w.py [-h]                                                                                                                                                                                                                         

positional arguments:                                                                                                                                                                                                                         
  listen      Tell shad0w to listen for connections                                                                                                                                                                                           
  beacon      Tell shad0w to create a beacon                                                                                                                                                                                                  
  update      Update shad0w                                                                                                                                                                                                                   

optional arguments:                                                                                                                                                                                                                           
  -h, --help  show this help message and exit                                                                                                                                                                                                 
root@d7d7d46a8fc9:~/shad0w# ./shad0w.py update -h                                                                                                                                                                                             
usage: shad0w.py [-h]                                                                                                                                                                                                                         

positional arguments:                                                                                                                                                                                                                         
  listen      Tell shad0w to listen for connections                                                                                                                                                                                           
  beacon      Tell shad0w to create a beacon                                                                                                                                                                                                  
  update      Update shad0w                                                                                                                                                                                                                   

optional arguments:
  -h, --help  show this help message and exit

Bogus Argument to print subcommand help

root@d7d7d46a8fc9:~/shad0w# ./shad0w.py listen --asdf                                                                   
usage: listen [-h] [-a ADDRESS] [-p PORT] [-k KEY] [-c CERT] [-m MIRROR] [-d] [-e ENDPOINT]
listen: error: unrecognized arguments: --asdf