Threat Level: green Handler on Duty: Didier Stevens

SANS ISC: Analyzing outgoing network traffic - SANS Internet Storm Center SANS ISC InfoSec Forums


Sign Up for Free!   Forgot Password?
Log In or Sign Up for Free!
Analyzing outgoing network traffic

We all know that network traffic contains real treasure when trying to identify malicious activities. Various organizations recognized this and even mandate that IDS or IPS systems are implemented.

However, such systems typically have similar problems as anti-virus products – they depend either on pre-made signatures or some kind of heuristics which can be (sometimes easily) evaded.

At the same time, in the AV world we can see that more vendors rely on things such as cloud scanning and reputation systems.

One of the things I often recommend to people is that they check outgoing network sessions created by their networks – not only established connections but also various attempts. For example, you should regularly monitor your firewall logs to see what traffic has been dropped – but put more effort into analyzing what egress connections were blocked since that can help you identify potentially infected (or hacked) machines on your network.

The best example of when such analysis really pays off is RSA Security – through egress log analysis they found out that the hacker that compromised their network used FTP to transfer files to an external machine. This should make you ask yourself – do you monitor egress connections to detect big(ger) transfers to external hosts, especially those in weird locations?

Another thing that I found really useful is to correlate those connection attempts to known bad reputation sources; this is where we get to the beginning of this diary. Such correlation can really add value to your firewall/router data – knowing that an internal IP address tried to connect to an external IP address, and that this connection attempt was blocked is good, but knowing that the external IP address is actually a ZeuS C&C really adds value!

Some of the reputation sources that are free, and that I found to be working really well are the following (in no particular order):

Do you use other reputation sources? Anything you wish to add to this list? Let us know!

--
Bojan
INFIGO IS

I will be teaching next: Web App Penetration Testing and Ethical Hacking - SANS Riyadh April 2019

Bojan

376 Posts
ISC Handler
For me, this one is good too... http://www.malwaredomainlist.com/mdl.php

Sorry to ask, but how reliable is RBN list for you guys?
Yew Chuan

1 Posts
We use those three abuse.ch lists as well and also the the lists of the spamhaus project (www.spamhaus.org). Apparently the spamhaus project has started integrating the abuse.ch lists ("Spamhaus Botnet C&C List"), for more information -> http://www.spamhaus.org/bgpf/. But we have just recently started investigating correlations between IDS-Positives and reputation sources. So we don't have much experience gathered, but it looks promising. But I wonder how reliable the RBN list actually is, we don't use that one,

But since many years at our institute (Swiss Federal Institute of Technology) we analyze the egress connections. We use statistical methods to automatically detect peaks and also correlations between positives. The last powerpoint presentation of our implementation can be found here:
https://www1.ethz.ch/id/services/list/security/workshops/IDS-ETHS-SWITCH_SecWG2011
It is not quite up to date some, things are missing there, but essentially it is a correct description of our setup.

Christian Hallqvist
www.ethz.ch
Yew Chuan
1 Posts
Might be of use, some overlap, inbound and outbound.

http://rules.emergingthreats.net/open/suricata/rules/compromised-ips.txt
http://rules.emergingthreats.net/open/suricata/rules/botcc.rules
http://rules.emergingthreats.net/open/suricata/rules/rbn-ips.txt
https://www.projecthoneypot.org/list_of_ips.php
http://rules.emergingthreats.net/open/suricata/rules/tor.rules
http://rules.emergingthreats.net/open/suricata/rules/compromised.rules
http://www.malwaredomainlist.com/hostslist/ip.txt
http://rules.emergingthreats.net/open/suricata/rules/rbn.rules
http://www.mtc.sri.com/live_data/attackers/
http://intel.martincyber.com/ip/
https://spyeyetracker.abuse.ch/blocklist.php?download=ipblocklist
https://zeustracker.abuse.ch/blocklist.php?download=ipblocklist
https://reputation.alienvault.com/reputation.generic
https://www.openbl.org/lists/base.txt
http://www.blocklist.de/lists/ssh.txt
https://palevotracker.abuse.ch/
http://www.malwaregroup.com/ipaddresses
http://www.ciarmy.com/list/ci-badguys.txt
http://www.malware.com.br/cgi/submit?action=list
Yew Chuan
1 Posts
The complement to the listed would include
-monitoring outbound routes (may be an infrastructure activity if firewall is not adequately monitoring outbound)
- monitor, control and log any outbound encryption (dont assume all encryption is good_)
-special attention to open proxies (e.g. hidemyass.com )
Yew Chuan
3 Posts
http://www.autoshun.org/files/shunlist.html

Anonymous
Thanks for all comments so far! I will collect everything we receive from our readers and will update a diary in a day or two.
Bojan

376 Posts
ISC Handler
For what it's worth (probably not much), I downloaded all the lists mentioned above, pulled out just the IPs. There were 18,796 uniq IPs or CIDRs (didn't eliminate given IPs contained in given CIDRs) from 27 pages (didn't follow links on pages to other lists). I georeference the addresses, and here are the top 12 countries:

Rank #Addrs CC
---- ------ --
1 5898 US
2 1819 CN
3 1435 RU
4 1180 DE
5 736 NL
6 510 UA
7 463 GB
8 424 FR
9 406 KR
10 380 CA
11 330 BR
12 307 TW

I'm a little surprised to see Germany at #4, because it doesn't seem to show up as much in the contexts with which I usually deal.

Hal

50 Posts
Christian mentions Spamhaus. He points to the bgpf services that they ask a fee for.
Free lists from Spamhaus are DROP en EDROP:
http://www.spamhaus.org/drop/
Anonymous
While IP reputation is useful, unless you are able to see some detail of the communication (e.g. HTTP URLs accessed), due to web sites being hosted on the same IP as harmless web sites you cannot fully be sure the communication is suspect. Egress filtering along with DNS inspection (or DNS sinkhole) offers much greater insight, obviously if backed up with IDS/IPS filtering to give defence in depth (or inspection in depth if passive). I am not saying IP reputation is not a useful layer of defence, just worth remembering it is only one layer and not an entire solution.
W60

14 Posts
I've always found that authenticating outbound traffic as much as possible through active directory an effective method of limiting the damage of malware that runs in the system context. If the malware attempts to egress on commonly open ports such as 80/443, without proper AD creds, the traffic goes nowhere and gets logged by your gateway device.
W60
1 Posts
I've found that if something is doing an outbound HTTP or (alternate port like 8080) request via IP direct, it's probably bad. Any legit site would at least have a DNS name tied to it - so, I block any URL that includes an IP address going out, thus forcing all sites to be resolved through our DNS server which DNS sinkholes all bad domains. This also has the advantage of preventing users from visiting blocked websites via IP (which may or may not work depending on the site's code) If your firewall can do regex blocking, I'd recommend: ^http(s)?://\d+\.\d+\.\d+\.\d+(/|$)
If your firewall can't do regex I'd suggest:
*.*.*.*1 through *.*.*.*0 before the 3rd / to take care of this.
W60
2 Posts

Sign Up for Free or Log In to start participating in the conversation!