Experiencing a Security Breach?

24 Hour Hotline: +1 (866) 659-9097 Option 5

General

+1 (312) 873-7500

Monday - Friday 8:00 AM - 6:00 PM CT (UTC -6)

Sales

Contact a Trustwave solution specialist.

+1 (888) 878-7817

Monday - Friday 8:30 AM - 5:30 PM CT (UTC -6)

Loading...

Blogs & Stories

SpiderLabs Blog

Attracting more than a half-million annual readers, this is the security community's go-to destination for technical breakdowns of the latest threats, critical vulnerability disclosures and cutting-edge research.

Detecting Brazilian Banking Trojans with Snort http_inspect

If you take a look at malware samples down here in Brazil, probably in most of Latin America they target bank users (something around 95% of Brazilian malware is banking trojans).

In Brazil, they arget most the common banks such as: Itaú, Bradesco, Caixa Economica Federal, Santander as well as some services as Serasa. It is common for them to use a Proxy Auto Configuration file also known as PAC files.

Here we can see a PAC file sample for a Brazilian banking trojan:

As we can see they don't want to redirect all traffic to their proxies, only those where they want to steal some information or money.

So how Snort will detect this?

VRT and ET have LOT of rules to detect Trojans/malware but to be honest I'm not the guy that loves signatures (I work with that and I know that's is IMPORTANT) but I'm always looking new ways to detect malicious activities without blacklisting only based on behavior (I've some talks and discussed new ideas such as pdfscore and http header hunter).

I was playing with lot of Snort options and thinking about how to improve detection using snort preprocessor since they are VERY powerful. I had a new idea with an old option: http_inspect proxy_alert.

Some folks who are new to Snort probably never used this option or have no idea that it exist since it's disabled by default. From Snort manual we have:

proxy_alertThis enables global alerting on HTTP server proxy usage. By configuring HTTP Inspect servers and enabling allow proxy use, you will only receive proxy use alerts for web users that aren't using the configured proxies or are using a rogue proxy server. Please note that if users aren't required to configure web proxy use, then you may get a lot of proxy alerts. So, please only use this feature with traditional proxy environments. Blind firewall proxies don't count.

There is an important part of this feature description:

Please note that if users aren't required to configure web proxy use, then you may get a lot of proxy alerts.

Here is the trick to mitigate false-positives in non-traditional proxy environments.

Here we could suppress alert sid/gid for all source and destination you are sure its trust proxy . Not sure where could be more powerfull and improve performance but at this moment I have no time for more tests.

Imagine you have a proxy at IP 10.0.0.10

suppress gen_id 119, sig_id 17, track by_dst, ip 10.0.0.10

Note: Beside suppresion you could decrease number of alerts using event_filter for that .

Another way is to create a whitelist for Snort reputation preprocessor with your proxies IPs list . Take a look at Snort documentation for more information about this.

Now as PoC, let's imagine I have been infected by the malware that uses a PAC file. Into my browser I will have:

If I request any website not listed it the PAC file it won't get any alert, BUT if I access any bank listed there it will force my browser to use their proxy and I will have an alert like:

I'd suggest you to have an exclusive Snort for those testing and if possible for an internal segment kinda of "Snort for malware" since it will probably decrease performance a little when enable. Since 40% of Brazilian malware use this type of action that totally value.

Understanding it will help you to mitigate false positives but remember that it's important to retest always since you could add something that all traffic will not generate alerts.