Monday, 28 March 2016

What happens if you write a TCP stack in Python? - Julia Evans

What happens if you write a TCP stack in Python? - Julia Evans:

"During Hacker School, I wanted to understand networking better, and I decided to write a miniature TCP stack as part of that. I was much more comfortable with Python than C and I'd recently discovered the scapy networking library which made sending packets really easy. So I started writing teeceepee!

The basic idea was:


  1. open a raw network socket that lets me send TCP packets 
  2. send a HTTP request to GET google.com 
  3. get and parse a response 
  4. celebrate! 

I didn't care much about proper error handling or anything; I just wanted to get one webpage and declare victory :)"

Traceroute in 15 lines of code using Scapy


'via Blog this'

No comments:

Post a Comment