Well I just wrote my first shell script today and I wanted to share this experience with you all. Its an amazing feeling, jr. programming 101 or something to that effect. I figured i'd share this easy script with you guys, any comments, suggestions or improvements are appreciated and desired.

I used this as my primary guide, I am still going through it, but that and some youtube videos so far gave me what I needed to build this script.

fairly simple, but useful I hope in future studies... >:) One thing I wanted to do, not sure if it's possible, but originally, I wanted "scanning..." or something to that effect to be displayed while the command was running, and then "scan complete" at the end. Can that be done without adding too much complexity?

Also, many of the examples I saw used quotation marks around statements that were to be echoed. Based on what I found, quotes are used for variables or something to that effect, can someone explain them to me, and when they should/should not be used?

Last edited by SephStorm on Mon Oct 01, 2012 4:55 pm, edited 1 time in total.

You might wanna change "namp" to "nmap", also the gateway isn't always 192.168.1.0, the script is good over all, but try replace 192.168.1.0 with localhost so you don't have to change it every time when using different networks. Just like this:

ZeroOne wrote:You might wanna change "namp" to "nmap", also the gateway isn't always 192.168.1.0, the script is good over all, but try replace 192.168.1.0 with localhost so you don't have to change it every time when using different networks. Just like this:

SephStorm - even before 'prettying it up' with your scanning message, might I suggest figuring out something you'll find more useful -

Work out how to pass in variables to your scripts, such that you can pass in a network address and subnet mask, from a command-line, so you could use it in other networks. (This type of scripting will come in handy on pentests, when you can 'modularize' things and pass in variable data, for faster automation of scanning activity.)

~ hayabusa ~

"All men can see these tactics whereby I conquer, but what none can see is the strategy out of which victory is evolved." - Sun Tzu, 'The Art of War'

Yes. Arguments passed into the program are assigned to $1, $2, $3, $4, and so on, with $0 being the name of the program itself. It's actually not that complicated, bash is a pretty easy thing to learn. If you check the manual for bash, you'll see a lot of neat tricks and things you can incorporate into your script.