www.flickr.com
Petri Lopia's items Go to Petri Lopia's photostream

Netdiscover finding IP-address when there is no DHCP server

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:

netdiscover -i wlan1 -p

More coming soon…

Linux: Show your IP-address

Show IP-Address

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`
echo "$INTIP"

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:

#!/bin/sh
INT="eth0";
INTIP=`ifconfig $INT|grep 'inet addr'|cut -d' ' -f12|cut -c6-20`
echo "$INTIP";

Linux: History command

You can see your command history on Linux just using command history:

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:

!line_of_history

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:

history | grep apt-get

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:

echo $HISTSIZE

and you will see how long your history file is and if you want to change it just say:

export HISTSIZE=1000

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

Photography / Valokuvia

If you are here for photograps visit: http://www.flickr.com/photos/whig/sets/.
Jos tulit valokuvien takia niin klikkaa: http://www.flickr.com/photos/whig/sets/.

You can find me on facebook / Löydät minut myös facebookista: http://www.facebook.com/petrilopia


www.flickr.com

Continue reading Photography / Valokuvia