Send scapy packets through raw sockets in python
<p>Is it possible? If yes? How?</p>

<p>This is my script (it doesn't work):</p>

<pre><code>from scapy.all import *
import socket

try:
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    p=IP(dst="192.168.1.254")/TCP(flags="S", sport=RandShort(), dport=80)
    s.connect(("192.168.1.254",80))
    s.send(p)
    print ("Request sent!")
except:
    print ("An error occurred.")
</code></pre>

<p><strong>--UPDATE--</strong></p>

<pre><code>p = bytes(IP(dst="DESTINATIONIP")/TCP(flags="S", sport=RandShort(), dport=80))
    while True:
        try:
            socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, sockip, sockport, True)
            s = socks.socksocket()
            s.connect((DESTINATIONIP,DESTINATIONPORT))
            s.send(p)
            print ("Request Sent!")
        except:
            print ("An error occurred.")
</code></pre>

<p>is it possible to send this syn packet but through an http proxy instead of socks?</p>