A forum for reverse engineering, OS internals and malware analysis 

Forum for analysis and discussion about malware.
 #17217  by whoknows
 Sun Dec 16, 2012 8:42 pm
Hi :),
I am working on analyzing the BOT nets in different type of networks.
My question is, how does a BOT realizes that it has a Public IP and not a Private one? Does every BOT has its own version of detection?
Thanks in advance! :)
 #17235  by whoknows
 Mon Dec 17, 2012 1:23 pm
I know how it can be done manually by the following methods:

[*]Compare the IP address of the current Ethernet interface with the IP address returned by the web services like http://www.whatismyip.info

[*]TRACEROUTE or TRACERT and find the reply of the first packet!

But, is there any other method then these above?
 #17241  by malaya_zemlya
 Mon Dec 17, 2012 8:06 pm
On most home or office computers your local ip will be something like 10.*.*.* or 192.168.*.* A bot would be very lucky to land on a server with an external IP.
I think the easiest way is just to contact C&C or some other external server and ask it to tell you what ip does it see.
You also slightly vary the traceroute technique by looking at contents of the returned ICMP Time Exceeded headers. By the standard, they should contain the IP header of the original packet.
If the ttl was exceeded after crossing the NAT, then the embedded IP should also be the public one.
 #17242  by Ormu
 Mon Dec 17, 2012 8:22 pm
These ranges are reserved for local network use so seeing such an address means that the external address is something different:

192.168.x.y
10.x.y.z
172.16.0.0 - 172.31.255.255