Snake Bytes C0c0n
AI Generated Summary
AI Generated Content Disclaimer
Note: This summary is AI-generated and may contain inaccuracies, errors, or omissions. If you spot any issues, please contact the site owner for corrections. Errors or omissions are unintended.
At c0c0n 2013, the talk “Python for Web Pen-testers (Snake bites)” introduced Python to working web penetration testers. The deck covers why Python fits security work, the language variations and module ecosystem worth knowing, hands-on work with requests, BeautifulSoup, and argparse, three live demonstrations, and how to package and carry Python tools onto other platforms.
Summary
The scope was set up front: the presentation focused only on Python, with no comparisons to other languages, and aimed to give a regular web penetration tester a head start with the functionalities available in the language. There was no new tool release; the value was in the walkthrough itself.
The why section stacked up the reasons: Python is an easy and flexible language; its massive module base lets whole use cases be written in a small timeframe and codebase; the language has inbuilt support inside tools like Burp and IRONWASP; OWASP ZAP exposes an API for it; and custom application logic or requirements often just need a quick script. A slide of existing Python tools proved the ecosystem was already doing security work, naming w3af, Canvas, SpikeProxy, Pyscan, sqlmap, DeBlaze, ProxyStrike, Scapy, wapiti, MonkeyFist, sulley, Pcapy, Peach, and MyNav Idapython. The variations slide distinguished Cython, Jython, and IronPython, and told the audience to treat Python 2.X and 3.X as different languages.
The module tour started with the standard library versus the external module universe, then focused on three essentials. Requests was presented as the alternative to urllib2 for HTTP handling, one that internally handles the HTTP to HTTPS transition and exposes a simpler interface through calls like requests.get and attributes like r.text, r.status_code, and r.headers. BeautifulSoup served as the text and HTML parser, demonstrated by pulling a page with requests and searching for each div with class attachment to enumerate WordPress attachments. Argparse closed the trio, building quick command line programs with options and switches, required arguments like a target URL, and boolean debug flags.
The demonstration block delivered three working scenarios. Regular expression pattern matching fingerprinted CMS platforms: a regex looking for a stylesheet link containing wp-content identifies WordPress, while a pattern matching sites/default or sites/all theme and module paths identifies Drupal, with the script printing the matched content for each detection. A simple XSS fuzzer read payloads from a file, URL-encoded each row, appended it to a target parameter, and checked whether the payload reflected in the response content. The SVN extractor tool extracted all web resources from a .SVN folder exposed over a network, published at github.com/anantshri/svn-extractor with a companion blog post.
Packaging and portability came next: PyInstaller bundles every dependency into a single executable for one-click distribution without a Python installation, and Python for Android puts Python 2.7 on a phone, where SL4A unlocks Android specific features so the laptop and SSH session stop being restrictions. The closing learning path recommended Learn Python the Hard Way, Dive Into Python, an SPSE or other online certification, reading Violent Python and Grey-hat Python, using Python daily for all operations, and exploiting the inbuilt support in IRONWASP’s inline scripting and Burp’s extension system. The null community, specifically Akash Mahajan, Lava Kumar, Prasanna, and Amol Naik, was credited for helping, criticizing, and forcing the skill set to improve.
Key Themes
- A head start, not a product: the session exists to introduce working web pentesters to Python’s capabilities, with no new tool release attached.
- Why Python wins here: an easy, flexible language with a massive module base, inbuilt support in Burp and IRONWASP, and an API in OWASP ZAP.
- An established ecosystem: w3af, sqlmap, Scapy, Canvas, sulley, Peach, and more show Python was already the language of security tooling.
- Three modules carry the load: Requests for HTTP, BeautifulSoup for parsing, and argparse for command line interfaces form the working core of most quick tools.
- Demos over slides: regex CMS fingerprinting, an XSS payload fuzzer, and SVN extraction turn the modules into working scenarios.
- Ship it anywhere: PyInstaller wraps scripts into dependency-free executables, and SL4A moves Python onto Android devices.
- A learning path: books, certifications, daily use, and the scripting hooks in IRONWASP and Burp keep the skill growing.
Notable Points
- Existing Python security tools named in the deck: w3af, Canvas, SpikeProxy, Pyscan, sqlmap, DeBlaze, ProxyStrike, Scapy, wapiti, MonkeyFist, sulley, Pcapy, Peach, and MyNav Idapython.
- Python variations covered: Cython, Jython, and IronPython, with Python 2.X and 3.X to be treated as different languages.
- Requests was presented as the urllib2 alternative that internally handles the HTTP or HTTPS transition, exposing r.text or r.content, r.status_code, and r.headers.
- The BeautifulSoup demo enumerated WordPress attachments by finding each div with class attachment in a fetched page.
- The argparse demo built a tool with a required –url argument and a boolean –debug flag.
- The CMS fingerprinting regexes: a stylesheet link containing wp-content detects WordPress, and a pattern on sites/default or sites/all theme and module paths detects Drupal.
- The simple XSS fuzzer reads payloads from xss.txt, URL-encodes each with urllib.quote, appends it to the target parameter, and reports rows that reflect in the response.
- The SVN extractor, published at github.com/anantshri/svn-extractor, extracts web resources from an exposed .SVN folder, with a write-up at blog.anantshri.info.
- PyInstaller packages every dependency into a single executable for distribution without Python installed.
- Python 2.7 runs on Android through Python for Android, with SL4A providing access to Android specific features.
- Learning resources named: Learn Python the Hard Way, Dive Into Python, SPSE or similar online certifications, Violent Python, and Grey-hat Python.
- Community credits: Akash Mahajan, Lava Kumar, Prasanna, and Amol Naik from null, plus documentation at docs.python.org.
Notable Quotes
“Presentation is only focused on python. (No comparisons with other languages please)”
“There is no new tools release”
“Remember to consider these two as different”
“Or as simple as JUST FOR THE FACT THAT YOU CAN DO IT”
“Use Python on a daily basis for all operations.”
“Ssh or laptop are not the restrictions now.”






















