Sometimes you have to get IP-address from the network and when there is DHCP server it’s pretty easy but sometimes when all devices have static IP-address and there is no DHCP server you might have a little problem to find out which IP-range they are using on this network.
There is one really nice and usefully software to find out which IP-range there is in the use.
http://nixgeneration.com/~jaime/netdiscover/ (This tool is included on Linux distribution which is made for penetration testing called BackTrack Linux)
I’m not sure why they say “Netdiscover is an active/passive address reconnaissance tool, mainly developed for those wireless networks without dhcp server, when you are wardriving.” on their website… IMHO you don’t need that when you are WarDriving. You might need that if you are trying to attact to somebody’s network which is ofcourse illegal you should never do that. I find use for this tool on support peoples and pentesters too.
Start netdiscover on passive mode so it’s not going to send anything it’s just listening:
More coming soon…
How to get your IP-address:
ifconfig "eth0"|grep 'inet addr'|cut -d' ' -f12|cut -c6-20
and if you want to use IP-address at your own scripts just use:
INTIP=`ifconfig eth0|grep 'inet addr'|cut -d' ' -f12|cut -c6-20`
and now you have your IP-address on $INTIP enviroment and you can use that at your scripts.
If you want easy to change which interface IP-address you want to get just example do:
INTIP=`ifconfig $INT|grep 'inet addr'|cut -d' ' -f12|cut -c6-20`
You can see your command history on Linux just using command history:
and this should show you all commands which you have wrote with a line number on the beginning of the line.
You can redo those commands just with ! and writing number of that line which command you want to redo:
add date and time to history list:
export HISTTIMEFORMAT='%d/%m/%Y %H:%M:%S '
or finnish way:
export HISTTIMEFORMAT='%d.%m.%Y %H:%M:%S '
Ofcourse you can use grep with history example like this:
and get only line which has apt-get on them.
If you think that your history list is too short or too long just say:
and you will see how long your history file is and if you want to change it just say:
at the command line to set your history size to 1000 lines.
If you just want to run again last command just do:
Continue reading Linux: History command