SlideShare a Scribd company logo
Ultimate Pen Test
Compromising a highly secure environment




                              Nikhil Mittal
                              @nikhil_mitt

                                              1
What this paper is about
•   Pen Testing a highly secure environment.
•   Methods used (Different phases of the test).
•   Bad Practices faced.
•   This is a real world scenario.




                                                   2
The Environment
• Network IPS and Firewall at DMZ
• Internal NIPS
• HIPS, HIDS and AV as end point security.
• Complete segregation by Internal firewalls.
• Servers and Desktops patched and hardened.
• Limited internet access to nearly fifty websites
  (related to vendors).
• Dedicated Security Operations Team

                                                 3
Recon Phase 1
• Info about products and vendors (mostly
  banner grabbing).
• Listing of possible targets (machines and
  humans).
• Starting place was browsing the target portal
  and looking for help contact, admin contacts.



                                                  4
Listing of possible targets
• Help Please!
• A small bug in the target’s application was
  discovered and help was asked regarding it.
• Direct involvement of someone from Technical
  Support and with Authority was asked for.
• Idea was to get someone with who has access
  to things, like the internet.


                                             5
A mail used in the attack




                            6
What was the result
• A nice list of hierarchy (based on emails) was
  prepared.
• In total thirteen such mail ID were gathered
  including two group mail ID.




                                                   7
Attack Phase 1
• Forged mails were sent pretending to be
   employees from vendors.
• Domain names similar to that of vendors and
   the target itself were used.
  (e.g. ibmindia.selfip.biz, microsoft.dnss.com)
• In some of the websites BeEF hook was used.
• Above helped in bypassing the white list.
• Multiple methods were used.
                                                   8
White list Internet
• Websites history listed by BeEF.
• SET was used to send emails.
• Simple Social Engineering emails from name
   of vendors gave two useful things
   1. Vendor websites are allowed.
   2. Some meterpreter sessions already
   popped up.


                                               9
10
11
12
13
14
15
Distracting the Security Team
• Distracting the team was required so that any activity
  detected internally may be ignored.
• A nice tool is available in backtrack which makes that
  much noise which can deafen even the best SIEM
  devices.
• ADMdnsfuckr is the tool.
• Capable of generating nearly 1.5 lakhs of fake DNS
  requests from a 4Mbps line in an hour.
• Within 15 minutes the attacking IP was blocked.
• Concentration must be on DMZ then but already
  insider access was there.

                                                           16
Gaining more access
• Admin level access to compromised machines.
• Access to more systems to understand the
  architecture.
• Access to a whole network was required to
  actually understand how things were working
  inside.



                                            17
Admin level access
• Recon turned out to be very useful here as
  victims with “authority” had admin rights.
• Simple getsystem is enough once you are an
  admin on some machine.
• A hashdump followed to get hashes for local
  admin user.



                                                18
19
Local admin
• Generally, for local admin password will be
  same for most of the machines on a LAN.
  Same was the case here for victim subnet.
• psexec with route was used to get Local Admin
  (and then system) privileges on most of the
  machines in the victim LAN.



                                              20
21
Maintaining access
• To maintain access two ways were used.
• Persistence script of meterpreter and method
  posted by HDM at metasploit blog.
• For both of these it was sensible to kill AV (at
  least temporarily).
• But there was a problem.



                                                     22
23
•A simple script was created to duplicate the session, migrate it to AV
process and kill self and bingo!! we knocked AV down.
• Below is how it was done.




                                                                     24
• Persistence script was used and persistent meterpreter connections
were created on the victim machines.
•A little change was required; change the default connect method to
reverse_https in place of reverse_tcp in persistence.rb.




                                                                  25
Other Network reachable from victim
• A ping sweep was done.




                                      26
What we have now
• Now we control a complete LAN mostly with
  administrative privileges.
• We have a list of IP of servers and other
  devices, thanks to our ping sweep.




                                              27
Recon Phase 2
• Listing critical assets (humans and machines)
• Searching machines for Network diagrams, IP
  lists, password lists etc.
• Logging of keystrokes to read mails, gather
  passwords.
• Residing on the network to gather
  information.


                                                  28
Listing critical assets
• Servers were listed down from the data
  collected using ping sweep, port scans and
  excel sheets found for assets while searching
  various machines across compromised LAN.
• Naming convention and role of servers
  revealed the critical ones.
• Some password sheets were also found on the
  compromised machines.

                                              29
•Search_dwld script is a powerful method to get
useful files.
• Excel Sheets (xls, xlsx), Word documents (doc, docx)
and diagrams (jpg, jpeg) were searched for.




                                                   30
Gathering more info
• Keystrokes were dumped for days.
• Gave access to official mail id, employee
  management portal, passwords to production
  servers, for firewalls; virtually to everything in
  that environment.
• Screenshot from meterpreter was used.
• Source code was received “on the fly” as coded
  by developers.
• Password were also captured with the help of
  BeEF Prompt Dialog module.

                                                       31
Keyscan_dump output




                      •Screenshot of one of
                      the victims. (was
                      showing too much
                      details).

                      •Screenshots helped in
                      understanding the
                      working environment
                      and habit of victim
                      users.
                                        32
33
Attack Phase 2
• Using gathered info to compromise
  production.
• There was nothing actually left to do to
  compromise.
• Even UPS consoles were accessed.
• Query to view sensitive data from databases
  were “sniffed” from keystroke dumps.


                                                34
Bad Practices Identified
• Help desk too helpful.
• Employees found out to be more than happy
  to click links and open unknown pdf.
• Higher authority means Administrator
  privilege.
• Local Administrator exception of password
  policy.
• Unencrypted password lists.
• Sites allowed in form of *.domain.*
                                              35
How it can be avoided

Educating the employees
 Educating the employees
  Educating the employees
   Educating the employees
    Educating the employees




                              36
• Thank You
• Questions Please ?




                       37

More Related Content

PPTX
Evading Microsoft ATA for Active Directory Domination
PPTX
PowerShell for Practical Purple Teaming
PPTX
Red Team Revenge - Attacking Microsoft ATA
PPTX
AMSI: How Windows 10 Plans to Stop Script-Based Attacks and How Well It Does It
PPTX
Forging Trusts for Deception in Active Directory
PPTX
Workshop: PowerShell for Penetration Testers
PPTX
Client side attacks using PowerShell
PPTX
Powerpreter: Post Exploitation like a Boss
Evading Microsoft ATA for Active Directory Domination
PowerShell for Practical Purple Teaming
Red Team Revenge - Attacking Microsoft ATA
AMSI: How Windows 10 Plans to Stop Script-Based Attacks and How Well It Does It
Forging Trusts for Deception in Active Directory
Workshop: PowerShell for Penetration Testers
Client side attacks using PowerShell
Powerpreter: Post Exploitation like a Boss

What's hot (20)

PPTX
Hacked? Pray that the Attacker used PowerShell
PPTX
Owning windows 8 with human interface devices
PPTX
RACE - Minimal Rights and ACE for Active Directory Dominance
PPTX
More fun using Kautilya
PPTX
Catch Me If You Can: PowerShell Red vs Blue
PPTX
Automating Post Exploitation with PowerShell
PPTX
Defending Your "Gold"
PPTX
PSConfEU - Building an Empire with PowerShell
PPTX
PowerShell for Penetration Testers
PPTX
Invoke-CradleCrafter: Moar PowerShell obFUsk8tion & Detection (@('Tech','niqu...
PDF
Power on, Powershell
PPTX
PowerShell for Cyber Warriors - Bsides Knoxville 2016
PPTX
Obfuscating The Empire
PPTX
Kautilya: Teensy beyond shell
PPTX
The Travelling Pentester: Diaries of the Shortest Path to Compromise
PDF
The Unintended Risks of Trusting Active Directory
PDF
SANS DFIR Prague: PowerShell & WMI
PPTX
Building an Empire with PowerShell
PDF
Ace Up the Sleeve
PPTX
BlueHat 2014 - The Attacker's View of Windows Authentication and Post Exploit...
Hacked? Pray that the Attacker used PowerShell
Owning windows 8 with human interface devices
RACE - Minimal Rights and ACE for Active Directory Dominance
More fun using Kautilya
Catch Me If You Can: PowerShell Red vs Blue
Automating Post Exploitation with PowerShell
Defending Your "Gold"
PSConfEU - Building an Empire with PowerShell
PowerShell for Penetration Testers
Invoke-CradleCrafter: Moar PowerShell obFUsk8tion & Detection (@('Tech','niqu...
Power on, Powershell
PowerShell for Cyber Warriors - Bsides Knoxville 2016
Obfuscating The Empire
Kautilya: Teensy beyond shell
The Travelling Pentester: Diaries of the Shortest Path to Compromise
The Unintended Risks of Trusting Active Directory
SANS DFIR Prague: PowerShell & WMI
Building an Empire with PowerShell
Ace Up the Sleeve
BlueHat 2014 - The Attacker's View of Windows Authentication and Post Exploit...
Ad

Similar to Ultimate pen test compromising a highly secure environment (nikhil) (20)

KEY
Unity makes strength
PDF
Penetration Testing is the Art of the Manipulation
PDF
The Dirty Little Secrets They Didn’t Teach You In Pentesting Class
PPTX
Final project.ppt
PDF
Invited Talk - Cyber Security and Open Source
PPTX
Teensy Programming for Everyone
PPT
Bsides-Philly-2016-Finding-A-Companys-BreakPoint
PDF
Real life hacking101
PDF
Red Team: Emulating Advanced Adversaries in Cyberspace
PPTX
Hacker tooltalk: Social Engineering Toolkit (SET)
PDF
13th Symposium of Association of Anti Virus Asia Researchers (AAVAR 2010) con...
PPT
Intro To Hacking
PDF
Cisel1 d
PDF
Hack Attack! An Introduction to Penetration Testing
PDF
Advanced Threats and Lateral Movement Detection
PDF
A6704d01
PPTX
Why internal pen tests are still fun
PDF
Network Vulnerabilities And Cyber Kill Chain Essay
PPTX
Red Team Apocalypse
PDF
Honeypots for Active Defense
Unity makes strength
Penetration Testing is the Art of the Manipulation
The Dirty Little Secrets They Didn’t Teach You In Pentesting Class
Final project.ppt
Invited Talk - Cyber Security and Open Source
Teensy Programming for Everyone
Bsides-Philly-2016-Finding-A-Companys-BreakPoint
Real life hacking101
Red Team: Emulating Advanced Adversaries in Cyberspace
Hacker tooltalk: Social Engineering Toolkit (SET)
13th Symposium of Association of Anti Virus Asia Researchers (AAVAR 2010) con...
Intro To Hacking
Cisel1 d
Hack Attack! An Introduction to Penetration Testing
Advanced Threats and Lateral Movement Detection
A6704d01
Why internal pen tests are still fun
Network Vulnerabilities And Cyber Kill Chain Essay
Red Team Apocalypse
Honeypots for Active Defense
Ad

More from ClubHack (20)

PDF
India legal 31 october 2014
PPTX
Cyberlaw by Mr. Pavan Duggal at ClubHack Infosec KeyNote @ Bangalore
PPT
Cyber Insurance
PPTX
Summarising Snowden and Snowden as internal threat
PPTX
Fatcat Automatic Web SQL Injector by Sandeep Kamble
PDF
The Difference Between the Reality and Feeling of Security by Thomas Kurian
PDF
Stand Close to Me & You're pwned! Owning Smart Phones using NFC by Aditya Gup...
PPTX
Smart Grid Security by Falgun Rathod
PPTX
Legal Nuances to the Cloud by Ritambhara Agrawal
PPT
Infrastructure Security by Sivamurthy Hiremath
PDF
Hybrid Analyzer for Web Application Security (HAWAS) by Lavakumar Kuppan
PPTX
Hacking and Securing iOS Applications by Satish Bomisstty
PPTX
Critical Infrastructure Security by Subodh Belgi
PPTX
Content Type Attack Dark Hole in the Secure Environment by Raman Gupta
PDF
XSS Shell by Vandan Joshi
PDF
Clubhack Magazine Issue February 2012
PDF
ClubHack Magazine issue 26 March 2012
PDF
ClubHack Magazine issue April 2012
PDF
ClubHack Magazine Issue May 2012
PDF
ClubHack Magazine – December 2011
India legal 31 october 2014
Cyberlaw by Mr. Pavan Duggal at ClubHack Infosec KeyNote @ Bangalore
Cyber Insurance
Summarising Snowden and Snowden as internal threat
Fatcat Automatic Web SQL Injector by Sandeep Kamble
The Difference Between the Reality and Feeling of Security by Thomas Kurian
Stand Close to Me & You're pwned! Owning Smart Phones using NFC by Aditya Gup...
Smart Grid Security by Falgun Rathod
Legal Nuances to the Cloud by Ritambhara Agrawal
Infrastructure Security by Sivamurthy Hiremath
Hybrid Analyzer for Web Application Security (HAWAS) by Lavakumar Kuppan
Hacking and Securing iOS Applications by Satish Bomisstty
Critical Infrastructure Security by Subodh Belgi
Content Type Attack Dark Hole in the Secure Environment by Raman Gupta
XSS Shell by Vandan Joshi
Clubhack Magazine Issue February 2012
ClubHack Magazine issue 26 March 2012
ClubHack Magazine issue April 2012
ClubHack Magazine Issue May 2012
ClubHack Magazine – December 2011

Recently uploaded (20)

PDF
Spectral efficient network and resource selection model in 5G networks
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Electronic commerce courselecture one. Pdf
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PPTX
Machine Learning_overview_presentation.pptx
PPTX
Tartificialntelligence_presentation.pptx
PDF
Machine learning based COVID-19 study performance prediction
PPTX
Spectroscopy.pptx food analysis technology
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
Programs and apps: productivity, graphics, security and other tools
PPT
Teaching material agriculture food technology
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Spectral efficient network and resource selection model in 5G networks
“AI and Expert System Decision Support & Business Intelligence Systems”
Accuracy of neural networks in brain wave diagnosis of schizophrenia
Group 1 Presentation -Planning and Decision Making .pptx
MIND Revenue Release Quarter 2 2025 Press Release
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Network Security Unit 5.pdf for BCA BBA.
Electronic commerce courselecture one. Pdf
NewMind AI Weekly Chronicles - August'25-Week II
SOPHOS-XG Firewall Administrator PPT.pptx
Machine Learning_overview_presentation.pptx
Tartificialntelligence_presentation.pptx
Machine learning based COVID-19 study performance prediction
Spectroscopy.pptx food analysis technology
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Dropbox Q2 2025 Financial Results & Investor Presentation
Programs and apps: productivity, graphics, security and other tools
Teaching material agriculture food technology
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf

Ultimate pen test compromising a highly secure environment (nikhil)

  • 1. Ultimate Pen Test Compromising a highly secure environment Nikhil Mittal @nikhil_mitt 1
  • 2. What this paper is about • Pen Testing a highly secure environment. • Methods used (Different phases of the test). • Bad Practices faced. • This is a real world scenario. 2
  • 3. The Environment • Network IPS and Firewall at DMZ • Internal NIPS • HIPS, HIDS and AV as end point security. • Complete segregation by Internal firewalls. • Servers and Desktops patched and hardened. • Limited internet access to nearly fifty websites (related to vendors). • Dedicated Security Operations Team 3
  • 4. Recon Phase 1 • Info about products and vendors (mostly banner grabbing). • Listing of possible targets (machines and humans). • Starting place was browsing the target portal and looking for help contact, admin contacts. 4
  • 5. Listing of possible targets • Help Please! • A small bug in the target’s application was discovered and help was asked regarding it. • Direct involvement of someone from Technical Support and with Authority was asked for. • Idea was to get someone with who has access to things, like the internet. 5
  • 6. A mail used in the attack 6
  • 7. What was the result • A nice list of hierarchy (based on emails) was prepared. • In total thirteen such mail ID were gathered including two group mail ID. 7
  • 8. Attack Phase 1 • Forged mails were sent pretending to be employees from vendors. • Domain names similar to that of vendors and the target itself were used. (e.g. ibmindia.selfip.biz, microsoft.dnss.com) • In some of the websites BeEF hook was used. • Above helped in bypassing the white list. • Multiple methods were used. 8
  • 9. White list Internet • Websites history listed by BeEF. • SET was used to send emails. • Simple Social Engineering emails from name of vendors gave two useful things 1. Vendor websites are allowed. 2. Some meterpreter sessions already popped up. 9
  • 10. 10
  • 11. 11
  • 12. 12
  • 13. 13
  • 14. 14
  • 15. 15
  • 16. Distracting the Security Team • Distracting the team was required so that any activity detected internally may be ignored. • A nice tool is available in backtrack which makes that much noise which can deafen even the best SIEM devices. • ADMdnsfuckr is the tool. • Capable of generating nearly 1.5 lakhs of fake DNS requests from a 4Mbps line in an hour. • Within 15 minutes the attacking IP was blocked. • Concentration must be on DMZ then but already insider access was there. 16
  • 17. Gaining more access • Admin level access to compromised machines. • Access to more systems to understand the architecture. • Access to a whole network was required to actually understand how things were working inside. 17
  • 18. Admin level access • Recon turned out to be very useful here as victims with “authority” had admin rights. • Simple getsystem is enough once you are an admin on some machine. • A hashdump followed to get hashes for local admin user. 18
  • 19. 19
  • 20. Local admin • Generally, for local admin password will be same for most of the machines on a LAN. Same was the case here for victim subnet. • psexec with route was used to get Local Admin (and then system) privileges on most of the machines in the victim LAN. 20
  • 21. 21
  • 22. Maintaining access • To maintain access two ways were used. • Persistence script of meterpreter and method posted by HDM at metasploit blog. • For both of these it was sensible to kill AV (at least temporarily). • But there was a problem. 22
  • 23. 23
  • 24. •A simple script was created to duplicate the session, migrate it to AV process and kill self and bingo!! we knocked AV down. • Below is how it was done. 24
  • 25. • Persistence script was used and persistent meterpreter connections were created on the victim machines. •A little change was required; change the default connect method to reverse_https in place of reverse_tcp in persistence.rb. 25
  • 26. Other Network reachable from victim • A ping sweep was done. 26
  • 27. What we have now • Now we control a complete LAN mostly with administrative privileges. • We have a list of IP of servers and other devices, thanks to our ping sweep. 27
  • 28. Recon Phase 2 • Listing critical assets (humans and machines) • Searching machines for Network diagrams, IP lists, password lists etc. • Logging of keystrokes to read mails, gather passwords. • Residing on the network to gather information. 28
  • 29. Listing critical assets • Servers were listed down from the data collected using ping sweep, port scans and excel sheets found for assets while searching various machines across compromised LAN. • Naming convention and role of servers revealed the critical ones. • Some password sheets were also found on the compromised machines. 29
  • 30. •Search_dwld script is a powerful method to get useful files. • Excel Sheets (xls, xlsx), Word documents (doc, docx) and diagrams (jpg, jpeg) were searched for. 30
  • 31. Gathering more info • Keystrokes were dumped for days. • Gave access to official mail id, employee management portal, passwords to production servers, for firewalls; virtually to everything in that environment. • Screenshot from meterpreter was used. • Source code was received “on the fly” as coded by developers. • Password were also captured with the help of BeEF Prompt Dialog module. 31
  • 32. Keyscan_dump output •Screenshot of one of the victims. (was showing too much details). •Screenshots helped in understanding the working environment and habit of victim users. 32
  • 33. 33
  • 34. Attack Phase 2 • Using gathered info to compromise production. • There was nothing actually left to do to compromise. • Even UPS consoles were accessed. • Query to view sensitive data from databases were “sniffed” from keystroke dumps. 34
  • 35. Bad Practices Identified • Help desk too helpful. • Employees found out to be more than happy to click links and open unknown pdf. • Higher authority means Administrator privilege. • Local Administrator exception of password policy. • Unencrypted password lists. • Sites allowed in form of *.domain.* 35
  • 36. How it can be avoided Educating the employees Educating the employees Educating the employees Educating the employees Educating the employees 36
  • 37. • Thank You • Questions Please ? 37