Get HTTP Response Status Code
<p>I'm using python and scapy to send HTTP request to a specific URL address. After sending it, I want to read the response status code (200, 401, 404, etc.).</p>

<p>I used this method:</p>

<pre><code>&gt;&gt;&gt; syn = IP(dst='www.google.com') / TCP(dport=80, flags='S')
&gt;&gt;&gt; syn_ack = sr1(syn)
&gt;&gt;&gt; getStr = 'GET / HTTP/1.1\r\nHost: www.google.com\r\n\r\n'
&gt;&gt;&gt; request = IP(dst='www.google.com') / TCP(dport=80, sport=syn_ack[TCP].dport, seq=syn_ack[TCP].ack, ack=syn_ack[TCP].seq + 1, flags='A') / getStr
&gt;&gt;&gt; reply = sr1(request)
</code></pre>

<p>For some reason, I can't see it in "reply".</p>

<p>Thanks for helping!</p>