Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Ethical hacking with Python tools at Europython...
Search
jmortegac
July 22, 2016
Programming
700
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Ethical hacking with Python tools at Europython 2016
Ethical hacking with Python tools at Europython 2016
jmortegac
July 22, 2016
Transcript
66 slides
JOSE MANUEL ORTEGA @JMORTEGAC Ethical hacking with Python tools
https://speakerdeck.com/jmortega
INDEX Introduction Python pentesting Modules(Sockets,Requests,BeautifulSoup,Shodan) Analysis metadata
Port scanning & Checking vulnerabilities Advanced tools Pentesting-tool
Python Pentesting Multi platform Prototypes and proofs of
concept(POC) Many tools and libraries focused on security OSINT and Pentesting tools Very good documentation
Python Pentesting
http://sparta.secforce.com/
The Harvester
The Harvester
W3AF
Tools Scapy Capturing and analysing network packets
FiMap Detecting RFI/LFI vulnerabilites XSScrapy Detecting XSS vulnerabilites
Sockets Port scan import socket #TCP sock = socket(socket.AF_INET,socket.SOCK_STREAM) result
= sock.connect_ex(('127.0.0.1',80)) if result == 0: print "Port is open" else: print "Port is filtered"
Sockets Port scan
Socket resolving IP/domain
Banner server
Banner server
Requests
Checking headers
Checking headers
Requests import requests http_proxy = "http://10.10.10.10:3000" https_proxy = "https://10.10.10.10:3000" proxyDict
= { "http" : http_proxy, "https" : https_proxy } r = requests.get(url,proxies=proxyDict)
Requests Authentication
BeautifulSoup
Internal/external links
Internal/external links
Extract images and documents
Scrapy
Web Scraping
Shodan
https://developer.shodan.io
Shodan import shodan SHODAN_API_KEY = "insert your API key here"
api = shodan.Shodan(SHODAN_API_KEY)
Shodan
https://www.shodan.io/host/136.243.32.71
Shodan
Shodan
BuiltWith pip install builtwith builtwith.parse(‘https://ep2016.europython.eu’)
Analysis metadata
Analysis metadata
Analysis metadata
Port Scanning
Python-nmap Automating port scanning Synchronous and asynchronous modes
import nmap # Synchronous nm = nmap.PortScanner() # nm.scan(‘ip/range’,’port_list’) results = nm.scan('127.0.0.1', '22,25,80,443')
NmapScanner
NmapScanner for port in port_list: NmapScanner().nmapScan(ip, port)
NmapScanner Async #Asynchronous nm_async = nmap.PortScannerAsync() def callback_result(host, scan_result): print
'------------------' print host, scan_result nm_async.scan(hosts='192.168.1.0/30', arguments='-sP', callback=callback_result) while nm_async .still_scanning(): print("Waiting >>>") nm_async.wait(2)
NmapScanner Async
Scripts Nmap
Scripts Nmap Programming routines allow to find potential vulnerabilities
in a given target First check if the port is open Detect vulnerabilities in the service port openned nm.scan(arguments="-n -A -p3306 -- script=/usr/share/nmap/scripts/mysql- info.nse")
Mysql Scripts Nmap
Check FTP Login Anonymous
Check FTP Login Anonymous
Check Webs sites pip install pywebfuzz https://github.com/disassembler/pywebfuzz
PyWebFuzz from pywebfuzz import fuzzdb import requests logins = fuzzdb.Discovery.PredictableRes.Logins
domain = "http://192.168.56.101" for login in logins: print “Checking... "+ domain + login response = requests.get(domain + login) if response.status_code == 200: print "Login Resource: " +login
PyWebFuzz
Heartbleed Vulnerability in OpenSSL V1.0.1 Multi-threaded tool for
scanning hosts for CVE- 2014-0160. https://github.com/musalbas/heartbleed-masstest https://filippo.io/Heartbleed
Heartbleed
Heartbleed
Advanced tools
Metasploit python-msfrpc
Metasploit API call Calls in msgpack format
Nexpose Tool developed by Rapid7 for scanning and vulnerability
discovery. It allows programmatic access to other programs via HTTP/s requests. BeautifulSoup to obtain data from vulnerabilities server
Nexpose
Pentesting tool
https://github.com/jmortega/python-pentesting
https://github.com/jmortega/europython_ethical_hacking
References & libs http://docs.shodanhq.com http://docs.python-requests.org/en/master/ http://scrapy.org
http://xael.org/pages/python-nmap-en.html http://www.pythonsecurity.org/libs https://github.com/dloss/python-pentest-tools http://kali-linux.co/2016/07/12/python-tools-for- penetration-testers%E2%80%8B/ https://github.com/PacktPublishing/Effective-Python- Penetration-Testing
Books
Books
THANK YOU!
More Decks by jmortegac
See All by jmortegac
Defending the AI Factory: Practical Security Strategies for MLOps
jmortega
0
29
Seguridad en Agentes de IA.Implementando Model Context Protocol (MCP) de forma segura con el OWASP MCP Top 10
jmortega
0
16
Seguridad en Agentes de IA.Implementando Model Context Protocol (MCP) de forma segura con el OWASP MCP Top 10
jmortega
0
35
Security in Model Context Protocol: An Analysis of the OWASP MCP Top 10
jmortega
0
80
Simulando ataques adversarios con TextAttack: Vulnerabilidades y defensas en PLN
jmortega
0
56
Seguridad en la nube: defensa para activos digitales
jmortega
0
54
Simulando ataques adversarios con TextAttack: Vulnerabilidades y defensas en PLN
jmortega
1
80
Seguridad y auditorías en Modelos grandes del lenguaje (LLM)
jmortega
1
87
Seguridad y auditorías en Modelos grandes del lenguaje (LLM)
jmortega
1
160
Other Decks in Programming
See All in Programming
느린 네트워크와 저사양 디바이스 사용자를 위한 웹뷰 로딩 시간 개선기
kmkim
1
270
LLM 101: Exploring LLMs, Starting with Tokens.
dalinaum
0
120
AIエージェントの「テストは通るのに本番で壊れる」を減らす
shibuiwilliam
3
130
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
440
AppFunctionsの内部実装を紐解く
hiroaki404
1
130
そのデザイントークン、Flutterでも同じ見た目になりますか?
nakamizu
0
490
作れるエンジニアから、価値を届けるエンジニアへ
ryunakayama
1
1.3k
Crash Auto Pipelines
veronikapj
1
450
Distance field of Julia set
kinakomoti321
0
330
どうしても Eloquent でリポジトリパターンをやりたいんだ #phpcon_niigata / phpcon-niigata-2026
shogogg
0
700
[Kotlin Fest 2026] eBPF Tracing for Kotlin
takehaya
1
410
flutter_test のその先へ — Flutter アプリの LLM 機能に「評価」という品質保証を
kosukesaigusa
0
210
Featured
See All Featured
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
860
GitHub's CSS Performance
jonrohan
1033
470k
Building the Perfect Custom Keyboard
takai
2
970
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
670
Why Our Code Smells
bkeepers
PRO
340
58k
How to Think Like a Performance Engineer
csswizardry
28
3k
Navigating Weather and Climate Data
rabernat
0
600
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
1.1k
Become a Pro
speakerdeck
PRO
31
6.4k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Building a Scalable Design System with Sketch
lauravandoore
464
34k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M