SlideShare a Scribd company logo
Python for pentesters
Rashid feroz
About me!
• An information security enthusiast.
• Love to break into things!
Why Python?
• Simple Learning curve
• HUGE number of Extensive Libraries!
• Multiplatform
• Good for quick prototyping
• Makes our life easier 
What About Security?
• Exploit Development
• Networking
• Debugging
• Encryption/Decription
• Reverse Engineering
• Fuzzing
• Web
• Forensics
• Malware analysis
Who is using Python??
• ™SET
• ™Core Impact
• ™W3AF
• ™Sqlmap
• ™ImmunityDebugger
• ™Impacket
• ™IronWASP
• Sslstrip
Why Python is awesome for security scripting?
• Python for Open Source Intelligence
gathering(OSINT) tasks.
• Network Layer hacks(using Python).
• Application layer scripting(esp. HTTP).
• Wireless Network hacks.
• Some offensive/defensive scripts for a pen test.
Demo time 
Port scanner
Import nmap
nm = nmap.PortScanner()
nm.scan('127.0.0.1', '22-443')
One line web server
• python -m SimpleHTTPServer 8080
Exploit Development
#!/usr/bin/python
import socket
host = “target”
port = <port#>
cmd= “initial command”
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
buffer = “buffer to send“
shellcode= “shellcode”
Payload = cmd+ buffer + shellcode
print "n Any status message n“
s.connect((host,port))
data = s.recv(1024)
s.send(payload +”n”)
s.close
Python libraries for Penetration Testers
• Scapy - send, sniff and dissect and forge network packets.
• Mallory - TCP/UDP man-in-the-middle proxy,
• Impacket - craft and decode network packets.
• Immunity Debugger: scriptable GUI and command line debugger
• Androguard: reverse engineering and analysis of Android
applications
• pefile: read and work with Portable Executable (aka PE) files
• Fuzzbox: multi-codec media fuzzer
• Requests: elegant and simple HTTP library
• mitmproxy: SSL-capable, intercepting HTTP proxy
• Volatility: extract digital artifacts from volatile memory (RAM)
samples
• aft: Android forensic toolkit
References
• Python Infosectools - http://www.dirk-loss.de/python-
tools.htm
• Violent Python Book
Thanks 
Email: rashid.2008feroz@gmail.com
Facebook: http://fb.com/rashid.feroz1
LinkedIn: https://in.linkedin.com/in/rashid2feroz

More Related Content

What's hot

Fuzzing underestimated method of finding hidden bugs
Fuzzing underestimated method of finding hidden bugsFuzzing underestimated method of finding hidden bugs
Fuzzing underestimated method of finding hidden bugs
Pawel Rzepa
 
Why Rust? - Matthias Endler - Codemotion Amsterdam 2016
Why Rust? - Matthias Endler - Codemotion Amsterdam 2016Why Rust? - Matthias Endler - Codemotion Amsterdam 2016
Why Rust? - Matthias Endler - Codemotion Amsterdam 2016
Codemotion
 
Packers
PackersPackers
Packers
Ange Albertini
 
How Safe is your Link ?
How Safe is your Link ?How Safe is your Link ?
How Safe is your Link ?
Peter Hlavaty
 
Nullcon Hack IM 2011 walk through
Nullcon Hack IM 2011 walk throughNullcon Hack IM 2011 walk through
Nullcon Hack IM 2011 walk through
Anant Shrivastava
 
CheckPlease - Payload-Agnostic Implant Security
CheckPlease - Payload-Agnostic Implant SecurityCheckPlease - Payload-Agnostic Implant Security
CheckPlease - Payload-Agnostic Implant Security
Brandon Arvanaghi
 
Sentry (SF Python, Feb)
Sentry (SF Python, Feb)Sentry (SF Python, Feb)
Sentry (SF Python, Feb)
zeeg
 
Violent python
Violent pythonViolent python
Violent python
Xatierlike Lee
 
Un) fucking forensics
Un) fucking forensicsUn) fucking forensics
Un) fucking forensics
Shane Macaulay
 
Intro to Perfect - LA presentation
Intro to Perfect - LA presentationIntro to Perfect - LA presentation
Intro to Perfect - LA presentation
Tim Taplin
 
Is Rust Programming ready for embedded development?
Is Rust Programming ready for embedded development?Is Rust Programming ready for embedded development?
Is Rust Programming ready for embedded development?
Knoldus Inc.
 
Python Introduction
Python IntroductionPython Introduction
Python Introduction
Sofian Hadiwijaya
 
CheckPlease: Payload-Agnostic Targeted Malware
CheckPlease: Payload-Agnostic Targeted MalwareCheckPlease: Payload-Agnostic Targeted Malware
CheckPlease: Payload-Agnostic Targeted Malware
Brandon Arvanaghi
 
Kasza smashing the_jars
Kasza smashing the_jarsKasza smashing the_jars
Kasza smashing the_jars
PacSecJP
 
GPU Computing for Data Science
GPU Computing for Data Science GPU Computing for Data Science
GPU Computing for Data Science
Domino Data Lab
 
DefCon 2012 - Rooting SOHO Routers
DefCon 2012 - Rooting SOHO RoutersDefCon 2012 - Rooting SOHO Routers
DefCon 2012 - Rooting SOHO Routers
Michael Smith
 
BSides Rochester 2018: Esteban Rodriguez: Ducky In The Middle: Injecting keys...
BSides Rochester 2018: Esteban Rodriguez: Ducky In The Middle: Injecting keys...BSides Rochester 2018: Esteban Rodriguez: Ducky In The Middle: Injecting keys...
BSides Rochester 2018: Esteban Rodriguez: Ducky In The Middle: Injecting keys...
JosephTesta9
 
JavaCro'14 - Test Automation using RobotFramework Libraries – Stojan Peshov
JavaCro'14 - Test Automation using RobotFramework Libraries – Stojan PeshovJavaCro'14 - Test Automation using RobotFramework Libraries – Stojan Peshov
JavaCro'14 - Test Automation using RobotFramework Libraries – Stojan Peshov
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
Practical IoT Exploitation (DEFCON23 IoTVillage) - Lyon Yang
Practical IoT Exploitation (DEFCON23 IoTVillage) - Lyon YangPractical IoT Exploitation (DEFCON23 IoTVillage) - Lyon Yang
Practical IoT Exploitation (DEFCON23 IoTVillage) - Lyon Yang
Lyon Yang
 
Patching Windows Executables with the Backdoor Factory | DerbyCon 2013
Patching Windows Executables with the Backdoor Factory | DerbyCon 2013Patching Windows Executables with the Backdoor Factory | DerbyCon 2013
Patching Windows Executables with the Backdoor Factory | DerbyCon 2013
midnite_runr
 

What's hot (20)

Fuzzing underestimated method of finding hidden bugs
Fuzzing underestimated method of finding hidden bugsFuzzing underestimated method of finding hidden bugs
Fuzzing underestimated method of finding hidden bugs
 
Why Rust? - Matthias Endler - Codemotion Amsterdam 2016
Why Rust? - Matthias Endler - Codemotion Amsterdam 2016Why Rust? - Matthias Endler - Codemotion Amsterdam 2016
Why Rust? - Matthias Endler - Codemotion Amsterdam 2016
 
Packers
PackersPackers
Packers
 
How Safe is your Link ?
How Safe is your Link ?How Safe is your Link ?
How Safe is your Link ?
 
Nullcon Hack IM 2011 walk through
Nullcon Hack IM 2011 walk throughNullcon Hack IM 2011 walk through
Nullcon Hack IM 2011 walk through
 
CheckPlease - Payload-Agnostic Implant Security
CheckPlease - Payload-Agnostic Implant SecurityCheckPlease - Payload-Agnostic Implant Security
CheckPlease - Payload-Agnostic Implant Security
 
Sentry (SF Python, Feb)
Sentry (SF Python, Feb)Sentry (SF Python, Feb)
Sentry (SF Python, Feb)
 
Violent python
Violent pythonViolent python
Violent python
 
Un) fucking forensics
Un) fucking forensicsUn) fucking forensics
Un) fucking forensics
 
Intro to Perfect - LA presentation
Intro to Perfect - LA presentationIntro to Perfect - LA presentation
Intro to Perfect - LA presentation
 
Is Rust Programming ready for embedded development?
Is Rust Programming ready for embedded development?Is Rust Programming ready for embedded development?
Is Rust Programming ready for embedded development?
 
Python Introduction
Python IntroductionPython Introduction
Python Introduction
 
CheckPlease: Payload-Agnostic Targeted Malware
CheckPlease: Payload-Agnostic Targeted MalwareCheckPlease: Payload-Agnostic Targeted Malware
CheckPlease: Payload-Agnostic Targeted Malware
 
Kasza smashing the_jars
Kasza smashing the_jarsKasza smashing the_jars
Kasza smashing the_jars
 
GPU Computing for Data Science
GPU Computing for Data Science GPU Computing for Data Science
GPU Computing for Data Science
 
DefCon 2012 - Rooting SOHO Routers
DefCon 2012 - Rooting SOHO RoutersDefCon 2012 - Rooting SOHO Routers
DefCon 2012 - Rooting SOHO Routers
 
BSides Rochester 2018: Esteban Rodriguez: Ducky In The Middle: Injecting keys...
BSides Rochester 2018: Esteban Rodriguez: Ducky In The Middle: Injecting keys...BSides Rochester 2018: Esteban Rodriguez: Ducky In The Middle: Injecting keys...
BSides Rochester 2018: Esteban Rodriguez: Ducky In The Middle: Injecting keys...
 
JavaCro'14 - Test Automation using RobotFramework Libraries – Stojan Peshov
JavaCro'14 - Test Automation using RobotFramework Libraries – Stojan PeshovJavaCro'14 - Test Automation using RobotFramework Libraries – Stojan Peshov
JavaCro'14 - Test Automation using RobotFramework Libraries – Stojan Peshov
 
Practical IoT Exploitation (DEFCON23 IoTVillage) - Lyon Yang
Practical IoT Exploitation (DEFCON23 IoTVillage) - Lyon YangPractical IoT Exploitation (DEFCON23 IoTVillage) - Lyon Yang
Practical IoT Exploitation (DEFCON23 IoTVillage) - Lyon Yang
 
Patching Windows Executables with the Backdoor Factory | DerbyCon 2013
Patching Windows Executables with the Backdoor Factory | DerbyCon 2013Patching Windows Executables with the Backdoor Factory | DerbyCon 2013
Patching Windows Executables with the Backdoor Factory | DerbyCon 2013
 

Viewers also liked

Operations security - SyPy Dec 2014 (Sydney Python users)
Operations security - SyPy Dec 2014 (Sydney Python users)Operations security - SyPy Dec 2014 (Sydney Python users)
Operations security - SyPy Dec 2014 (Sydney Python users)
Mikko Ohtamaa
 
اسلاید دوم جلسه یازدهم کلاس پایتون برای هکر های قانونی
اسلاید دوم جلسه یازدهم کلاس پایتون برای هکر های قانونیاسلاید دوم جلسه یازدهم کلاس پایتون برای هکر های قانونی
اسلاید دوم جلسه یازدهم کلاس پایتون برای هکر های قانونی
Mohammad Reza Kamalifard
 
Evdokimov python arsenal for re
Evdokimov   python arsenal for reEvdokimov   python arsenal for re
Evdokimov python arsenal for re
DefconRussia
 
Stegano Secrets - Python
Stegano Secrets - PythonStegano Secrets - Python
Stegano Secrets - Python
n|u - The Open Security Community
 
Pycon Sec
Pycon SecPycon Sec
Pycon Sec
guesta762e4
 
Network programming in python..
Network programming in python..Network programming in python..
Network programming in python..
Bharath Kumar
 
Python build your security tools.pdf
Python build your security tools.pdfPython build your security tools.pdf
Python build your security tools.pdf
TECHNOLOGY CONTROL CO.
 
Offensive cyber security: Smashing the stack with Python
Offensive cyber security: Smashing the stack with PythonOffensive cyber security: Smashing the stack with Python
Offensive cyber security: Smashing the stack with Python
Malachi Jones
 
Network Security and Analysis with Python
Network Security and Analysis with PythonNetwork Security and Analysis with Python
Network Security and Analysis with Python
pycontw
 
Metodologia david ch
Metodologia david chMetodologia david ch
Metodologia david ch
Eduardo David
 
โครงงานคอมพิวเตอร์
โครงงานคอมพิวเตอร์ โครงงานคอมพิวเตอร์
โครงงานคอมพิวเตอร์
Mark'k Stk
 
Presentasi Sistem Profitbomber
Presentasi Sistem ProfitbomberPresentasi Sistem Profitbomber
Presentasi Sistem Profitbomber
profitbomber
 
2015-05-20 openmdm-architecture
2015-05-20 openmdm-architecture2015-05-20 openmdm-architecture
2015-05-20 openmdm-architecture
Andreas Benzing
 
โครงงานคอมพิวเตอร์ (1)
โครงงานคอมพิวเตอร์ (1)โครงงานคอมพิวเตอร์ (1)
โครงงานคอมพิวเตอร์ (1)
Mark'k Stk
 
David Draper Resume 2
David Draper Resume 2David Draper Resume 2
David Draper Resume 2
David Draper
 
ΚΙΤΟU ANNA CV-EN
ΚΙΤΟU ANNA CV-ENΚΙΤΟU ANNA CV-EN
ΚΙΤΟU ANNA CV-EN
ANNA KITOU
 
Continuous Delivery Summit, Washington D.C., 2015
Continuous Delivery Summit, Washington D.C., 2015Continuous Delivery Summit, Washington D.C., 2015
Continuous Delivery Summit, Washington D.C., 2015
karunbakshi
 
La Escuela al Centro
La Escuela al CentroLa Escuela al Centro
La Escuela al Centro
supervision60c
 
openMDM5: From a fat client to a scalable, omni-channel architecture
openMDM5: From a fat client to a scalable, omni-channel architectureopenMDM5: From a fat client to a scalable, omni-channel architecture
openMDM5: From a fat client to a scalable, omni-channel architecture
Andreas Benzing
 
Family life and culture from china
Family life and culture from chinaFamily life and culture from china
Family life and culture from china
luhanyan
 

Viewers also liked (20)

Operations security - SyPy Dec 2014 (Sydney Python users)
Operations security - SyPy Dec 2014 (Sydney Python users)Operations security - SyPy Dec 2014 (Sydney Python users)
Operations security - SyPy Dec 2014 (Sydney Python users)
 
اسلاید دوم جلسه یازدهم کلاس پایتون برای هکر های قانونی
اسلاید دوم جلسه یازدهم کلاس پایتون برای هکر های قانونیاسلاید دوم جلسه یازدهم کلاس پایتون برای هکر های قانونی
اسلاید دوم جلسه یازدهم کلاس پایتون برای هکر های قانونی
 
Evdokimov python arsenal for re
Evdokimov   python arsenal for reEvdokimov   python arsenal for re
Evdokimov python arsenal for re
 
Stegano Secrets - Python
Stegano Secrets - PythonStegano Secrets - Python
Stegano Secrets - Python
 
Pycon Sec
Pycon SecPycon Sec
Pycon Sec
 
Network programming in python..
Network programming in python..Network programming in python..
Network programming in python..
 
Python build your security tools.pdf
Python build your security tools.pdfPython build your security tools.pdf
Python build your security tools.pdf
 
Offensive cyber security: Smashing the stack with Python
Offensive cyber security: Smashing the stack with PythonOffensive cyber security: Smashing the stack with Python
Offensive cyber security: Smashing the stack with Python
 
Network Security and Analysis with Python
Network Security and Analysis with PythonNetwork Security and Analysis with Python
Network Security and Analysis with Python
 
Metodologia david ch
Metodologia david chMetodologia david ch
Metodologia david ch
 
โครงงานคอมพิวเตอร์
โครงงานคอมพิวเตอร์ โครงงานคอมพิวเตอร์
โครงงานคอมพิวเตอร์
 
Presentasi Sistem Profitbomber
Presentasi Sistem ProfitbomberPresentasi Sistem Profitbomber
Presentasi Sistem Profitbomber
 
2015-05-20 openmdm-architecture
2015-05-20 openmdm-architecture2015-05-20 openmdm-architecture
2015-05-20 openmdm-architecture
 
โครงงานคอมพิวเตอร์ (1)
โครงงานคอมพิวเตอร์ (1)โครงงานคอมพิวเตอร์ (1)
โครงงานคอมพิวเตอร์ (1)
 
David Draper Resume 2
David Draper Resume 2David Draper Resume 2
David Draper Resume 2
 
ΚΙΤΟU ANNA CV-EN
ΚΙΤΟU ANNA CV-ENΚΙΤΟU ANNA CV-EN
ΚΙΤΟU ANNA CV-EN
 
Continuous Delivery Summit, Washington D.C., 2015
Continuous Delivery Summit, Washington D.C., 2015Continuous Delivery Summit, Washington D.C., 2015
Continuous Delivery Summit, Washington D.C., 2015
 
La Escuela al Centro
La Escuela al CentroLa Escuela al Centro
La Escuela al Centro
 
openMDM5: From a fat client to a scalable, omni-channel architecture
openMDM5: From a fat client to a scalable, omni-channel architectureopenMDM5: From a fat client to a scalable, omni-channel architecture
openMDM5: From a fat client to a scalable, omni-channel architecture
 
Family life and culture from china
Family life and culture from chinaFamily life and culture from china
Family life and culture from china
 

Similar to Python for pentesters

Python-Assisted Red-Teaming Operation
Python-Assisted Red-Teaming OperationPython-Assisted Red-Teaming Operation
Python-Assisted Red-Teaming Operation
Satria Ady Pradana
 
Hacking the Gateways
Hacking the GatewaysHacking the Gateways
Hacking the Gateways
Onur Alanbel
 
Cyber Crime / Cyber Secuity Testing Architecture by MRITYUNJAYA HIKKALGUTTI (...
Cyber Crime / Cyber Secuity Testing Architecture by MRITYUNJAYA HIKKALGUTTI (...Cyber Crime / Cyber Secuity Testing Architecture by MRITYUNJAYA HIKKALGUTTI (...
Cyber Crime / Cyber Secuity Testing Architecture by MRITYUNJAYA HIKKALGUTTI (...
MrityunjayaHikkalgut1
 
Workshop on Network Security
Workshop on Network SecurityWorkshop on Network Security
Workshop on Network Security
UC San Diego
 
Nmap for Scriptors
Nmap for ScriptorsNmap for Scriptors
Nmap for Scriptors
n|u - The Open Security Community
 
Open Source Cyber Weaponry
Open Source Cyber WeaponryOpen Source Cyber Weaponry
Open Source Cyber Weaponry
Joshua L. Davis
 
The Offensive Python: Practical Python for Penetration Testing
The Offensive Python: Practical Python for Penetration TestingThe Offensive Python: Practical Python for Penetration Testing
The Offensive Python: Practical Python for Penetration Testing
Satria Ady Pradana
 
The Offensive Python - Practical Python for Penetration Testing
The Offensive Python - Practical Python for Penetration TestingThe Offensive Python - Practical Python for Penetration Testing
The Offensive Python - Practical Python for Penetration Testing
Satria Ady Pradana
 
Beginner’s Guide on How to Start Exploring IoT Security 1st Session
Beginner’s Guide on How to Start Exploring IoT Security 1st SessionBeginner’s Guide on How to Start Exploring IoT Security 1st Session
Beginner’s Guide on How to Start Exploring IoT Security 1st Session
veerababu penugonda(Mr-IoT)
 
Hacktrikz - Introduction to Information Security & Ethical Hacking
Hacktrikz - Introduction to Information Security & Ethical HackingHacktrikz - Introduction to Information Security & Ethical Hacking
Hacktrikz - Introduction to Information Security & Ethical Hacking
Ravi Sankar
 
Time Series Anomaly Detection with Azure and .NETT
Time Series Anomaly Detection with Azure and .NETTTime Series Anomaly Detection with Azure and .NETT
Time Series Anomaly Detection with Azure and .NETT
Marco Parenzan
 
y3dips hacking priv8 network
y3dips hacking priv8 networky3dips hacking priv8 network
y3dips hacking priv8 network
idsecconf
 
idsecconf2010-hacking priv8 network
idsecconf2010-hacking priv8 networkidsecconf2010-hacking priv8 network
idsecconf2010-hacking priv8 network
Ammar WK
 
Ready set hack
Ready set hackReady set hack
Ready set hack
GDSCBVCOENM
 
DEF CON 27 - ORANGE TSAI and MEH CHANG - infiltrating corporate intranet like...
DEF CON 27 - ORANGE TSAI and MEH CHANG - infiltrating corporate intranet like...DEF CON 27 - ORANGE TSAI and MEH CHANG - infiltrating corporate intranet like...
DEF CON 27 - ORANGE TSAI and MEH CHANG - infiltrating corporate intranet like...
Felipe Prado
 
BSIDES-PR Keynote Hunting for Bad Guys
BSIDES-PR Keynote Hunting for Bad GuysBSIDES-PR Keynote Hunting for Bad Guys
BSIDES-PR Keynote Hunting for Bad Guys
Joff Thyer
 
Thick client pentesting_the-hackers_meetup_version1.0pptx
Thick client pentesting_the-hackers_meetup_version1.0pptxThick client pentesting_the-hackers_meetup_version1.0pptx
Thick client pentesting_the-hackers_meetup_version1.0pptx
Anurag Srivastava
 
Phases of penetration testing
Phases of penetration testingPhases of penetration testing
Phases of penetration testing
Abdul Rahman
 
Threat hunting on the wire
Threat hunting on the wireThreat hunting on the wire
Threat hunting on the wire
InfoSec Addicts
 
RIoT (Raiding Internet of Things) by Jacob Holcomb
RIoT  (Raiding Internet of Things)  by Jacob HolcombRIoT  (Raiding Internet of Things)  by Jacob Holcomb
RIoT (Raiding Internet of Things) by Jacob Holcomb
Priyanka Aash
 

Similar to Python for pentesters (20)

Python-Assisted Red-Teaming Operation
Python-Assisted Red-Teaming OperationPython-Assisted Red-Teaming Operation
Python-Assisted Red-Teaming Operation
 
Hacking the Gateways
Hacking the GatewaysHacking the Gateways
Hacking the Gateways
 
Cyber Crime / Cyber Secuity Testing Architecture by MRITYUNJAYA HIKKALGUTTI (...
Cyber Crime / Cyber Secuity Testing Architecture by MRITYUNJAYA HIKKALGUTTI (...Cyber Crime / Cyber Secuity Testing Architecture by MRITYUNJAYA HIKKALGUTTI (...
Cyber Crime / Cyber Secuity Testing Architecture by MRITYUNJAYA HIKKALGUTTI (...
 
Workshop on Network Security
Workshop on Network SecurityWorkshop on Network Security
Workshop on Network Security
 
Nmap for Scriptors
Nmap for ScriptorsNmap for Scriptors
Nmap for Scriptors
 
Open Source Cyber Weaponry
Open Source Cyber WeaponryOpen Source Cyber Weaponry
Open Source Cyber Weaponry
 
The Offensive Python: Practical Python for Penetration Testing
The Offensive Python: Practical Python for Penetration TestingThe Offensive Python: Practical Python for Penetration Testing
The Offensive Python: Practical Python for Penetration Testing
 
The Offensive Python - Practical Python for Penetration Testing
The Offensive Python - Practical Python for Penetration TestingThe Offensive Python - Practical Python for Penetration Testing
The Offensive Python - Practical Python for Penetration Testing
 
Beginner’s Guide on How to Start Exploring IoT Security 1st Session
Beginner’s Guide on How to Start Exploring IoT Security 1st SessionBeginner’s Guide on How to Start Exploring IoT Security 1st Session
Beginner’s Guide on How to Start Exploring IoT Security 1st Session
 
Hacktrikz - Introduction to Information Security & Ethical Hacking
Hacktrikz - Introduction to Information Security & Ethical HackingHacktrikz - Introduction to Information Security & Ethical Hacking
Hacktrikz - Introduction to Information Security & Ethical Hacking
 
Time Series Anomaly Detection with Azure and .NETT
Time Series Anomaly Detection with Azure and .NETTTime Series Anomaly Detection with Azure and .NETT
Time Series Anomaly Detection with Azure and .NETT
 
y3dips hacking priv8 network
y3dips hacking priv8 networky3dips hacking priv8 network
y3dips hacking priv8 network
 
idsecconf2010-hacking priv8 network
idsecconf2010-hacking priv8 networkidsecconf2010-hacking priv8 network
idsecconf2010-hacking priv8 network
 
Ready set hack
Ready set hackReady set hack
Ready set hack
 
DEF CON 27 - ORANGE TSAI and MEH CHANG - infiltrating corporate intranet like...
DEF CON 27 - ORANGE TSAI and MEH CHANG - infiltrating corporate intranet like...DEF CON 27 - ORANGE TSAI and MEH CHANG - infiltrating corporate intranet like...
DEF CON 27 - ORANGE TSAI and MEH CHANG - infiltrating corporate intranet like...
 
BSIDES-PR Keynote Hunting for Bad Guys
BSIDES-PR Keynote Hunting for Bad GuysBSIDES-PR Keynote Hunting for Bad Guys
BSIDES-PR Keynote Hunting for Bad Guys
 
Thick client pentesting_the-hackers_meetup_version1.0pptx
Thick client pentesting_the-hackers_meetup_version1.0pptxThick client pentesting_the-hackers_meetup_version1.0pptx
Thick client pentesting_the-hackers_meetup_version1.0pptx
 
Phases of penetration testing
Phases of penetration testingPhases of penetration testing
Phases of penetration testing
 
Threat hunting on the wire
Threat hunting on the wireThreat hunting on the wire
Threat hunting on the wire
 
RIoT (Raiding Internet of Things) by Jacob Holcomb
RIoT  (Raiding Internet of Things)  by Jacob HolcombRIoT  (Raiding Internet of Things)  by Jacob Holcomb
RIoT (Raiding Internet of Things) by Jacob Holcomb
 

Python for pentesters

  • 2. About me! • An information security enthusiast. • Love to break into things!
  • 3. Why Python? • Simple Learning curve • HUGE number of Extensive Libraries! • Multiplatform • Good for quick prototyping • Makes our life easier 
  • 4. What About Security? • Exploit Development • Networking • Debugging • Encryption/Decription • Reverse Engineering • Fuzzing • Web • Forensics • Malware analysis
  • 5. Who is using Python?? • ™SET • ™Core Impact • ™W3AF • ™Sqlmap • ™ImmunityDebugger • ™Impacket • ™IronWASP • Sslstrip
  • 6. Why Python is awesome for security scripting? • Python for Open Source Intelligence gathering(OSINT) tasks. • Network Layer hacks(using Python). • Application layer scripting(esp. HTTP). • Wireless Network hacks. • Some offensive/defensive scripts for a pen test.
  • 8. Port scanner Import nmap nm = nmap.PortScanner() nm.scan('127.0.0.1', '22-443')
  • 9. One line web server • python -m SimpleHTTPServer 8080
  • 10. Exploit Development #!/usr/bin/python import socket host = “target” port = <port#> cmd= “initial command” s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) buffer = “buffer to send“ shellcode= “shellcode” Payload = cmd+ buffer + shellcode print "n Any status message n“ s.connect((host,port)) data = s.recv(1024) s.send(payload +”n”) s.close
  • 11. Python libraries for Penetration Testers • Scapy - send, sniff and dissect and forge network packets. • Mallory - TCP/UDP man-in-the-middle proxy, • Impacket - craft and decode network packets. • Immunity Debugger: scriptable GUI and command line debugger • Androguard: reverse engineering and analysis of Android applications • pefile: read and work with Portable Executable (aka PE) files • Fuzzbox: multi-codec media fuzzer • Requests: elegant and simple HTTP library • mitmproxy: SSL-capable, intercepting HTTP proxy • Volatility: extract digital artifacts from volatile memory (RAM) samples • aft: Android forensic toolkit
  • 12. References • Python Infosectools - http://www.dirk-loss.de/python- tools.htm • Violent Python Book
  • 13. Thanks  Email: rashid.2008feroz@gmail.com Facebook: http://fb.com/rashid.feroz1 LinkedIn: https://in.linkedin.com/in/rashid2feroz