Start reading Violent Python on your Kindle in under a minute. Don't have a Kindle? Get your Kindle here.
Programming Books C Java PHP Python Learn more Browse Programming Books

Deliver to your Kindle or other device

Enter a promotion code
or gift card

Try it free

Sample the beginning of this book for free

Deliver to your Kindle or other device

Anybody can read Kindle books—even without a Kindle device—with the FREE Kindle app for smartphones, tablets and computers.
Sorry, this item is not available in
Image not available for
Image not available

To view this video download Flash Player


Violent Python: A Cookbook for Hackers, Forensic Analysts, Penetration Testers and Security Engineers [Kindle Edition]

TJ O'Connor
4.3 out of 5 stars  See all reviews (53 customer reviews)

Digital List Price: $49.95 What's this?
Print List Price: $49.95
Kindle Price: $28.03
You Save: $21.92 (44%)


Amazon Price New from Used from
Kindle Edition $28.03  
Paperback $29.51  
Shop the new
New! Introducing the, a hub for Software Developers and Architects, Networking Administrators, TPMs, and other technology professionals to find highly-rated and highly-relevant career resources. Shop books on programming and big data, or read this week's blog posts by authors and thought-leaders in the tech industry. > Shop now

Book Description

Violent Python shows you how to move from a theoretical understanding of offensive computing concepts to a practical implementation. Instead of relying on another attacker’s tools, this book will teach you to forge your own weapons using the Python programming language. This book demonstrates how to write Python scripts to automate large-scale network attacks, extract metadata, and investigate forensic artifacts. It also shows how to write code to intercept and analyze network traffic using Python, craft and spoof wireless frames to attack wireless and Bluetooth devices, and how to data-mine popular social media websites and evade modern anti-virus.

- Demonstrates how to write Python scripts to automate large-scale network attacks, extract metadata, and investigate forensic artifacts.

- Write code to intercept and analyze network traffic using Python. Craft and spoof wireless frames to attack wireless and Bluetooth devices.

- Data-mine popular social media websites and evade modern anti-virus.

Editorial Reviews


"An information security specialist with the US Army, O'Connor introduces the hacker's programming language Python to new users, and describes some advanced features to those who already know it."--Reference and Research Book News, August 2013 "A quick glance at [the authors] collective credentials and experience undoubtedly creates high expectations for this title. The end result is that the book demonstrates how powerful just a few dozen lines of Python code can be. useful tips and tricks will surely be acquired simply by working through the exercises."--The Ethical Hacker Network, February 27, 2013 "Violent Python is an excellent resource that develops and enhances a diverse set of security-related Python skills. The book also serves as a great reference, where recipes could be quickly implemented to address specific issues as they arise. Readers who are actively working in an InfoSec position will likely be able to put their newly acquired skills to use immediately, and those looking to break into the field will acquire skills that differentiate themselves from others who are dependent on prebuilt tools. This title is highly recommended for anyone who wants to improve his or her Python skills within the InfoSec realm."--The Ethical Hacker Network, February 27, 2013 "When it comes to Python and penetration testing, TJ O'Connor is the grand Python master. This is the book that keeps on giving. From building penetration testing Python scripts, to antivirus-evading penetration testing malware, to interrogating the Windows Registry and investigating other forensic artifacts...O'Connor masterfully walks the reader from basic to advanced penetration testing techniques with sample code throughout."--Ove Carroll, SANS Certified Instructor, Co-Author of SANS Forensics 408 - Windows In Depth "Violent Python is chalked full of practical examples and is for all security professionals. It covers the spectrum - knowledge for pen testers to forensic analysts, beginner to advanced and offensive to defensive tasks. If you are involved in information security and are looking for a Python book, this is an excellent source."--James Shewmaker, Security Analyst, Bluenotch Corporation "The best hackers know when to write their own tools. Violent Python is a very relevant collection of examples to seed your personal hacking toolbox. From offensive actions to digital forensics, this book has useful bits for everyone."--Raphael Mudge, Creator of Armitage

About the Author

TJ O'Connor is a Department of Defense expert on information security and a US Army paratrooper. While assigned as an assistant professor at the US Military Academy, TJ taught undergraduate courses on forensics, exploitation and information assurance. He twice co-coached the winning team at the National Security Agency's annual Cyber Defense Exercise and won the National Defense University's first annual Cyber Challenge. He has served on multiple red teams, including twice on the Northeast Regional Team for the National Collegiate Cyber Defense Competition.

TJ holds a Master of Science degree in Computer Science from North Carolina State, a Master of Science degree in Information Security Engineering from the SANS Technical Institute, and a Bachelor of Science degree in Computer Science from the US Military Academy. He has published technical research at USENIX workshops, ACM conferences, security conferences, the SANS Reading Room, the Internet Storm Center, the Army Magazine, and the Armed Forces Journal. He holds expert cyber security credentials, including the prestigious GIAC Security Expert (GSE) and Offensive Security Certified Expert (OSCE). TJ is a member of the elite SANS Red and Blue Team Cyber Guardians.

TJ O'Connor is an active duty Army Major and former faculty member at the United States Military Academy, where he taught courses on forensics, exploitation, and information assurance. He has published research at USENIX workshops, ACM Conferences, and spoken at various security conferences, including ShmooCon. He has participated in numerous cyber defense exercises, including winning the National Defense University Cyber Challenge, coaching the winning team at the National Security Agency's Cyber Defense Exercise and working as a red team member of the Northeast Regional Collegiate Cyber Defense Competition. He has earned the SANS Certifications GIAC Gold certifications in GCFA, GCIH, GSEC, GCIA, and holds other GIAC certifications.

Product Details

  • File Size: 1406 KB
  • Print Length: 289 pages
  • Page Numbers Source ISBN: 1597499579
  • Publisher: Syngress; 1 edition (December 28, 2012)
  • Sold by: Amazon Digital Services, Inc.
  • Language: English
  • ASIN: B00ABY67JS
  • Text-to-Speech: Enabled
  • X-Ray:
  • Lending: Not Enabled
  • Amazon Best Sellers Rank: #47,387 Paid in Kindle Store (See Top 100 Paid in Kindle Store)
  •  Would you like to give feedback on images?

Customer Reviews

Most Helpful Customer Reviews
101 of 112 people found the following review helpful
3.0 out of 5 stars Violent Python Libraries December 3, 2012
Violent python is an introductory level book on python with a introductory look at security concepts in general. It is great for those who are new to the language and would like example use cases of simplistic security tools, but not for those who want to understand Python, deeply understand the security concepts covered, or using python for reliable tools.

Problems I had:

1.) This book is about python libraries and interacting with them and other programs. It is not about understanding the attack and implementing them in Python. Sure, some may be required for ease to the beginner when it comes to forensics, communicating with ssh, or integrating with other tools for complex protocols like SMB, but anything else is really not fair to those who may not be able to use the library, who have problems and need to understand why, or those who want to understand what is happening on a lower level. Examples:

1a.) Use ftplib for your ftp bruteforcer.
1b.) Use zipfile to crack zip archives.
1c.) Use os to send metasploit exploit code (your own 'conficker')/os to use msfpayload to bypass a/v.
1d.) Use smtplib to communicate with smtp (regardless of the functions being ironically similiar to the real commands).

The problem with this is it doesn't teach you how these libraries work. For example, one should show the person how to interact with FTP with the sockets library, what to send, what to look for, and then show them the easy libraries. As previosly stated, it also doesn't prepare them for issues (like programs that don't like complying with rfc standards).

2.) More exception handling. The socket code is not helpfully handled on all stages of attempted connection.
Read more ›
Was this review helpful to you?
43 of 47 people found the following review helpful
5.0 out of 5 stars My Python is Getting Violent November 26, 2012
By Matthew
I'd been looking forward to this book for over a month so when it arrived last week I tented my hands like Mr. Burns. I finally finished chapter 1 and can officially declare this book to be awesome.

I was recommending it to a friend yesterday morning when he said "you didn't need the introduction to python chapter did you?" I started laughing and told him that in the "introduction" chapter you:

[+]Set up your development environment.
[+]Write and subsequently make several modifications to a vulnerability scanner.
[+]Write a password hash cracker and are then asked to go, on your own, to modify it to crack SHA512 hashes as well.
[+]Write a .zip file password cracker and then modify it so that it's multithreaded.

Any of those could have been final projects in a lot of books so that should give you an idea of how packed full of information this book is.

If you're python is limited (like mine) you'll be doing a decent amount of Google searches to look further into certain commands. If you're brand new to python I would zip through a free online course to get the basics of the language structure before you tackle this book.

While Violent Python is in the "We're going to do some cool stuff, keep up" style, I never once felt confused or frustrated. The code is clear, easy to understand and a quick trip to Google always filled in any gaps.

I usually wait until I'm finished with a book to review it but with this one that could take a while. I've found myself using the code in this book as building blocks for other similar ideas I have in my head so I've been building those before I move on. These modifications have helped me truly understand the topics presented rather than trying to knock out the book ASAP.

Check out the table of contents. If that looks like something you're interested in, do yourself a favor and grab the book.
Comment | 
Was this review helpful to you?
18 of 19 people found the following review helpful
4.0 out of 5 stars Cookbook for hackers, like it says December 25, 2012
Format:Paperback|Verified Purchase
A lot of security folks have little to no development experience, complicating their jobs when they want to do something that's slightly different from what existing tools can do. Python provides a particularly useful tool for them because of its innate readability, support for multiple programming paradigms, and tremendous library of existing modules that can be adapted and connected to do new and interesting things. And for those of us with more extensive programming backgrounds in addition to our security skillsets, Python provides an excellent workbench for nearly any relevant task.

Violent Python does not pretend in any way to teach readers how to program. In fact, when kicking off the brief section introducing the language itself, it flat out refers to to the reader "as an experienced programmer" (p. 6). However, a motivated hacker with limited exposure to Python can still follow along and pick things up relatively quickly, as VP doesn't really use any particularly esoteric language features.

That said, it also does not necessarily require the reader to cover it linearly from page 1 to the end. The subtitle of the book, after all, calls it a "cookbook for hackers", and it handles its end of the bargain. VP does not go into great detail for these projects but illustrates how to accomplish them relatively simply, primarily as inspiration for the reader who can then use the ideas and code as building blocks for self-driven projects.

I rarely like getting technology books in electronic format, and so I have the paperback copy. Given the complete lack of diagrams in this book, however, it wouldn't matter as much in this case.
Read more ›
Comment | 
Was this review helpful to you?
Most Recent Customer Reviews
4.0 out of 5 stars Good for security professionals who use Python
This was an optional read for a Python class I attended to obtain my Masters Degree in digital forensics. Read more
Published 1 month ago by David
5.0 out of 5 stars Good Read!!
I will love incorporating these items in my next set of tasks!! Keep up the good work!! When will the next book be available?? :)
Published 1 month ago by James Burden
5.0 out of 5 stars Python
A very good book to teach you how to use Violent Python. This is a good resource book for ethical hackers.
Published 2 months ago by Mimi
4.0 out of 5 stars One of two books
you need to purchase to make sure the NSA is watching you. Get this and the anarchist cookbook and you will finally make the "list" Making that list is a big deal, it... Read more
Published 2 months ago by Adrian Pomilio
5.0 out of 5 stars Excellent book!
This is great stuff for my ethical hacking students. I saw a lot of great Python videos on SecurityTube, and this is similar stuff. Read more
Published 2 months ago by Sam Bowne
5.0 out of 5 stars Great text
a very fun and in depth intro to crafting your own python tools for internet security (or insecurity as the case may be)
Published 2 months ago by twon
5.0 out of 5 stars cool
this is a great book. great examples to learn from. the code in the book really works and can be used in the real world.
Published 3 months ago by zakmanx
1.0 out of 5 stars The examples don't work
I'm in the introduction chapter, and I'm trying to install the python-nmap package. I've transcribed the code verbatim, and I keep getting the invalid syntax error message. Read more
Published 3 months ago by Nishant Singh
3.0 out of 5 stars nice book for understanding how hacks work
pretty informational, but not that good to try with Windows. Better for Linux as it does not explain how to do same things on Windows. Read more
Published 3 months ago by Ralph J. Gorham
3.0 out of 5 stars Violent Python
A bit too advanced for someone who does not typically write code. Good content. Reasonably well written, formatted, and presented.
Published 3 months ago by Robert K. Ferguson
Search Customer Reviews
Only search this product's reviews

More About the Author

Discover books, learn about writers, read author blogs, and more.

What Other Items Do Customers Buy After Viewing This Item?


There are no discussions about this product yet.
Be the first to discuss this product with the community.
Start a new discussion
First post:
Prompts for sign-in

Look for Similar Items by Category