9

I love using Python for the scripts I need and for work. But I really want to learn Python for network security since I will start a NS course next year.

My question would be how would it be the best way to learn? I was thinking of starting by writing a network sniffer or a like, but I think this is a bit to high to start learning (correct me if I am wrong), what would be the basic tool to code for the learning?

6 Answers 6

10

Not to repeat the Scapy recommendation but on a slightly different aspect, as you're a beginner, check out Adam Maxwell's new basic intro guide to Scapy, it's a very good introduction.

I would also recommend checking this course out - it's only $200 and well worth it. The course is both an excellent introduction to Python and also how to use Python in security, with some great challenges where you can put your new skillz into practice.

Finally, I'd follow Mark Baggett on Twitter and have a look at some of his work, such as this. Most of his stuff is on his site here. His python scripts are from both an offensive and defensive aspect so go check those links out.

12

I would recommend take a look at scapy ( http://www.secdev.org/projects/scapy/ ). While "python for network security" is quite unclear ( ie, for testing network security, for analysis, etc ), I think scapy would be a good tool to add to the tool box of someone learning security.

2
  • Sorry for not being so clear, I meant Pentesting, I took a look at the scapy before, really great tool! I would like to create a xss tester for example, just not sure where to start, is there any book I should consider reading? Except Grey Hat Python, since it's for windows :(
    – seds
    Jun 6, 2012 at 9:08
  • 2
    Please edit your question to include this new info. Also, scapy is directly related to pen testing, and xss is for web app testing. What are you looking to do?
    – schroeder
    Jun 6, 2012 at 18:05
4

if you decide to focus on using Python for security, I will recommend you to read these books:

  • Violent Python: A Cookbook for Hackers, Forensic Analysts, Penetration Testers, and Security Engineers
  • Gray Hat Python: Python Programming for Hackers and Reverse Engineers

And to get a glimpse what is Cryptography in terms of Python (this one is free):

Last but not least, OWASP has project which focus on Python security called pythonsecurity.org. Unfortunately, the project hasn't been really active lately.

BTW, on May 2014, my paper is accepted at PyCon APAC 2014. The conference was held in Taiwan. You may take a look at my paper and watch the video hence the organizer recorded my session. The title of my paper is Python for Application Security Testing.

3

It appears that you have 2 things you want to learn:

  1. Using Python for Security Testing
  2. Security Testing

You can understand how those things conflict. Python is a tool to help you accomplish a task. If you do not understand the task, then the tool will not be helpful.

Tools
Scapy is a wonderful python-based tool that will help you understand basic traffic concepts.

Twill is a python-based tool for web application testing.

But first, understand what you hope to accomplish with the tools. Know what xss is first before you throw a tool at a site. Once you know what xss is, it becomes easy for someone who knows python scripting to write their own tools. The benefit of pre-made tools is that you benefit from the experience of others.

Concepts
To learn more about Security Testing, you can look at DVWA or Mutillidae. For a more complete collection of tools and targets, try out the Web Security Dojo.

1

This course sounds perfect for you http://securitytube-training.com/certifications/securitytube-python-scripting-expert/

I have watched his videos In the past and they are great quality.

0

Just learn how TCP/IP work, code for example own server, own traceroute, understand how RAW SOCKET works. Play with wireshark to understand how packet looks like

1
  • @Ephexeve - usual practice is not to add a comment, but to upvote answers you like, and to click the check mark next to the answer which helps you most.
    – Rory Alsop
    Jun 15, 2012 at 16:09

Not the answer you're looking for? Browse other questions tagged or ask your own question.