Closed nicoqwertyu closed 9 years ago
Hey there, thanks for the proposed changes! I like the idea of setting the options in the command line so it isnt necessary to modify the script. However, if that's the case, I'd rather it used getopts to override the default options:
root# ./onetwopunch.sh
usage: ./onetwopunch.sh -t targets.txt [-p tcp/udp/all] [-i interface] [-n nmap-options]
Eg: ./onetwopunch.sh -p all -t targets.txt -n "-A -O"
./onetwopunch.sh -t targets.txt -i wlan0
root# onetwopunch.sh -t ip.txt
[+] protocol : tcp
[+] interface: eth0
[+] nmap opts: -A
[+] targets : ip.txt
[+] scanning 127.0.0.1 for tcp ports...
I can make updates to the code so that it uses getopts which I hope satisfies the requirements for inclusion into ArchAssault. Otherwise, you're welcome to let me know what else needs changing.
Hey, getops is definitely more elegant than the way I did it, in the pull request. The biggest needed change is that the script needs to be able to tell where it is run from and installed to.
I did it by adding $MYDIR=$(dirname $0), and then shoving that infront of all the variables (except for the targets loop), but I'm not sure if that's the cleanest way.
I'm fine with mydir=$(dirname $0). I've merged your pull request and updated it to use getopts.