title: Sniff RTS's and send CTS in return with Scapy
body: <p>I'm able to sniff RTS packets without a problem. I'm also able to utilize 'sendp' to send CTS packets. What I'm unable to figure out is how to have Scapy sniff RTS packets and reply to those RTS's with a crafted CTS in real-time. The intent is to send a CTS for every RTS that my AWUS036ACH can hear regardless of the intended device.</p>
  <hr />
  <pre><code>import os
  import time
  from threading import Thread
  from scapy.layers.all import Dot11,Dot11Elt,RadioTap,sniff,sendp
  
  def change_channel():
      ch = 1
      while True:
          try:
              os.system(f&quot;iwconfig {iface} channel {ch}&quot;)
              ch = ch % 14 + 1
              time.sleep(1)
          except KeyboardInterrupt:
              break
  
  if __name__ == &quot;__main__&quot;:
      iface = &quot;wlan0&quot;
      channel_changer = Thread(target=change_channel)
      channel_changer.daemon = True
      channel_changer.start()
  
  def PacketHandler(packet):
      if packet.haslayer(Dot11):
          if packet.type==1 and packet.subtype==11:
              rts_list.append(bssid)
              bssid = packet[Dot11].addr2
              print(&quot;MAC: %s&quot; %(bssid))
  
  sniff(iface=iface, prn=PacketHandler)
  
  i=1
  while 1:
      time.sleep(.100)
      i = i + 1
  
      dot11 = Dot11(type=1, subtype=12, addr1=bssid,ID=0x99)
      pkt = RadioTap()/dot11
      sendp(pkt,iface=iface, realtime=True)
  </code></pre>