Many of the bots I am observing attempt to detect the infected system’s public (“WAN”) IP address. Most of these systems are assumed to be behind NAT. To detect the external IP address, these bots use various public APIs. It may be helpful to detect these requests. Many use unique host names. This will make detecting the request in DNS logs easy even if TLS is not intercepted.
Note that there is useful software using these APIs. Do not just block them. But keeping an eye on who is sending these requests can be useful
Here are a few I remember seeing. The list I have seen isn’t very long, making it easy to detect. Let me know if there are others:
- http://ip-api.com/json/
- http://api64.ipify.org
- http://api.ipify.org
- https://ip.seeip.org
- http://checkip.dyndns.org
- https://ipapi.co/ip/
Some of these APIs will block commonly abused user agents like ‘curl’ or ‘pylib.’ This will block many of the common bots from using the specific APIs (and they typically do not bother to specify a user agent but instead use a different API without restrictions).
There are some other websites that malware could use with a bit of screen scraping, but I have not seen malware use them. And as you are looking through your logs: Requests for “wanipcn.xml” are not related to looking up the WAN IP address. These requests attempt to exploit an older Realtek SDK vulnerability.
—
Johannes B. Ullrich, Ph.D. , Dean of Research, SANS.edu
Twitter|
(c) SANS Internet Storm Center. https://isc.sans.edu Creative Commons Attribution-Noncommercial 3.0 United States License.