My name is Wendel Guglielmetti Henrique, and I'm a senior security consultant at Trustwave's SpiderLabs. I have over 12 years experience in Information Technology, with the last 7 years dedicated to penetration testing.
My recent presentations include RSA Conference 2012 (USA), ToorCon 13(USA), Defcon 19 (USA), Black Hat Arsenal 2010 (USA), OWASP AppSec Research2010 (Sweden), Black Hat Europe 2010 (Spain), as well as other large conferences around the world. I also co-authored a patent-pending penetration testing technology.
This is my first post at SpiderLabs blog; to be honest, it's the firstt ime I've ever posted on a blog.
In this post, I'll be discussing my personal experience with client-side attacks, phishing attacks, and social engineering, focusing mostly on the payloads. This will be a short brief about the most relevant points, which has allowed me to build a first-class payload resulting in a 100% success rate during engagements.
I will also be including a few suggestions for penetration testers who need to drop executable files on disk. One of the things I hear quite often is people asking for help because they are being caught by anti-virus or endpoint security software.
The name of the blog post is a tribute for all my co-workers at Trustwave that are Brazilians as well; we are a small team in Brazil but work very hard.
[DETAILS]
First of all, as much as I would like to describe each point in extreme detail, it would not be a blog post, but probably a small book. I will do my best at hitting the main points, but if I miss something or you have questions, feel free to let me know.
While doing client-side attacks or using social engineering to convince users to execute a piece of malware, I noticed that my results were not as good as I had initially hoped. During my early testing stages, I was able achieve at minimum the following tasks:
All things considered, this is not bad at all; customers like getting statistics about which employees open malicious links, submit their credentials, shell access to their workstations, etc. This kind of information is nice because it not only shows the robustness of e-mail and web filters, but it also helps organizations understand how educated their users are about these kind of attacks.
Additionally, credentials are very useful; as we know password recycling is one of the most old and still present issues related with information security. Most of the time I'm able to reuse captured credentials to log-in to VPNs, SSH servers, Citrix applications and access e-mail accounts.
This is great from the penetration testing perspective, but what if the target organization does not have any remote administration interface available on the Internet and does not offer web-access e-mail? It has not happened to me yet, but there could be cases where users do not give out their credentials and consequently I would not have a good compromise to write up in my report.
At this point, you may be wondering about the shells, right? Yes, sometimes we get shell access and this is the best result, complete pawnage.
In practice however, I have seen many payloads fail due to different defensive controls. Most of our customers take security very serious and implement different security measures to prevent or mitigate compromise. Just to expound on the customer-side successes I have seen:
You may argue that solutions for attackers exist to get around these problems and I agree, but we need to be aware that they are there and think carefully about them when designing a payload that will be successful.
For the first problem, I decided to follow this path:
If you are going to use a phishing e-mail or fake website, make sure to add the proper evasion techniques and test it extensively before delivery as not to get caught during the delivery phase. You can use the same secure solutions to learn how they work and create a bypass for them. Additionally, keep in mind the statistics that I mentioned at the beginning may be very helpful to let you identify if you were blocked by an e-mail or web filtering solution.
For the second problem, I decided to follow this path:
Based on this, I took special care to make the payload and modules to work on 32bit and 64bit Windows and Applications. I tested it extensively and I would like to thanks all my co-workers from Trustwave and SpiderLabs that offered their machines as sacrificial lambs to test on.
For the third problem, I decided to follow this path:
Most of the companies that I have worked with allow internal machines to resolve external names via internal DNS name-servers(often DNS integrated with Active Directory). The first sub-payload automatically detects the current DNS server(s) and uses DNS tunneling to evade firewalls. The payloads are configured to throttle connection speed and include evasions to make the detection process more difficult for an administrator. I also register a domain that does not look suspicious.
Since it's a penetration test exercise and not real hacking the first two sub-payloads collect a lot of information from the compromised system, attempt to escalate privileges, dump password hashes, take screenshots at random timesand send all this information over the current tunnel and exit. The third sub-payload does same but sends all information in a single e-mail with the contents attached (compressed) to an email account that I control.
The final stage is clean-up, where I make sure to remove evidence about collected information and payload.
To wrap up, I would like to thank my co-workers at SpiderLabs that gave me ideas and helped with the infrastructure. Kudos for Garret Picchioni, Barrett Weisshaar, Ryan Jones (US or "2" if you prefer :), Luiz Eduardo, Nathan Drier, Matthew Jakubowski, Alex Gatti and Jonathan Claudius
[CONCLUSION]
Pen-Testers: your payload is a very important part of your attack. If you are doing all the other stages like a professional but use an average payload you won't get the great results you expect.
Customers: If you are not including client-side attacks and social engineering in your penetration testing, you are not testing a very significant attack vector that real hackers will not hesitate to exploit.