superkojiman / onetwopunch

Use unicornscan to quickly scan all open ports, and then pass the open ports to nmap for detailed scans.
MIT License
629 stars 137 forks source link

Proposed changes to prepare for ArchAssault inclusion #1

Closed nicoqwertyu closed 9 years ago

nicoqwertyu commented 9 years ago
superkojiman commented 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.

nicoqwertyu commented 9 years ago

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.

superkojiman commented 9 years ago

I'm fine with mydir=$(dirname $0). I've merged your pull request and updated it to use getopts.