Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Introduction to Network Programming with Python

Introduction to Network Programming with Python

Let's understand how devices talk to each other through the network by looking at the network packets, creating them and sending our very own packets into the wild network using Scapy, a library to build networking applications and manipulate packets with Python.
This was presented during @hackingmx meetup #4, on @hackerGarage in Guadalajara, Jalisco, Mexico.

Avatar for Rafael Santos

Rafael Santos

March 28, 2013
Tweet

Other Decks in Programming

Transcript

  1. • Why? • Network Packets • Packets and Python •

    Demo Network Programming with Python
  2. Why? With most tools you won't build someting the author

    did not imagine. To stop being an script kiddie. It's fun!
  3. Let's talk a bit about networking How/Why does the internet

    work? How does my machine talk to others?
  4. IP

  5. Scapy • Written in Python • Command-line interactive • TCP,IP,ICMP,ARP,...

    • Easy encapsulation • Decodes but doesn't interpret
  6. Scapy Creating an IP packet: >>> ip = IP() >>>

    ip.dst = "127.0.0.1" >>> ip <IP dst=127.0.0.1 |>
  7. Interpreting results IP / TCP 192.168.1.185:(sport) > 192.168.1.177:(dport) S ==>

    IP / TCP 192.168.1.177:(dport) > 192.168.1.185:(sport) SA
  8. References Warriors of the Net (warriorsofthe.net) The TCP/IP Guide (TCPIPGuide.com)

    The Very Unofficial Dummies Guide to Scapy (scapy-guide.googlecode.com) Scapy Official docs (http://www.secdev. org/projects/scapy/doc/)