This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [ -f /tmp/skip-only-enable-connectable-sta-mode-wifi-interface ] ; then | |
logger -s -t fqrouter skip-only-enable-connectable-sta-mode-wifi-interface found | |
return | |
fi | |
if [ "remove" == "$ACTION" -a "wlan0" == "$INTERFACE" ] ; then | |
/etc/init.d/disable_sta_mode_wifi_interfaces start | |
fi | |
if [ "add" == "$ACTION" -a "wlan0" == "$INTERFACE" ] ; then | |
logger -s -t fqrouter try to bring up sta mode wifi interface |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import dpkt | |
import socket | |
import binascii | |
hex_ip_packets = [ | |
'binascii.hexlify output of SYN' # replace with your own captured output | |
'binascii.hexlify output of HTTP GET' # replace with your own captured output | |
] | |
raw_socket = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_RAW) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from netfilterqueue import NetfilterQueue | |
import subprocess | |
import signal | |
import dpkt | |
import traceback | |
import socket | |
import sys | |
TARGET_IP = '173.252.110.27' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from netfilterqueue import NetfilterQueue | |
import traceback | |
import subprocess | |
import signal | |
import dpkt | |
import socket | |
raw_socket = socket.socket(socket.AF_PACKET, socket.SOCK_RAW, socket.htons(3)) | |
raw_socket.setsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF, 2**30) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from netfilterqueue import NetfilterQueue | |
import traceback | |
import subprocess | |
import signal | |
import dpkt | |
import socket | |
import time | |
raw_socket = socket.socket(socket.AF_PACKET, socket.SOCK_RAW, socket.htons(3)) | |
raw_socket.setsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF, 2**30) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from netfilterqueue import NetfilterQueue | |
import traceback | |
import subprocess | |
import signal | |
import dpkt | |
import socket | |
import time | |
raw_socket = socket.socket(socket.AF_PACKET, socket.SOCK_RAW, socket.htons(3)) | |
raw_socket.setsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF, 2**30) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from netfilterqueue import NetfilterQueue | |
import traceback | |
import subprocess | |
import signal | |
import dpkt | |
import socket | |
raw_socket = socket.socket(socket.AF_PACKET, socket.SOCK_RAW, socket.htons(3)) | |
raw_socket.setsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF, 2**30) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
import dpkt.ip | |
def main_loop(server_socket, raw_socket): | |
while True: | |
packet_bytes, from_ip = server_socket.recvfrom(4096) | |
packet = dpkt.ip.IP(packet_bytes) | |
dst = socket.inet_ntoa(packet.dst) | |
print('%s:%s => %s:%s' % (socket.inet_ntoa(packet.src), packet.data.sport, dst, packet.data.dport)) | |
raw_socket.sendto(packet_bytes, (dst, 0)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import subprocess | |
# source http://zh.wikipedia.org/wiki/%E5%9F%9F%E5%90%8D%E6%9C%8D%E5%8A%A1%E5%99%A8%E7%BC%93%E5%AD%98%E6%B1%A1%E6%9F%93 | |
WRONG_ANSWERS = { | |
'4.36.66.178', | |
'8.7.198.45', | |
'37.61.54.158', | |
'46.82.174.68', | |
'59.24.3.173', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from netfilterqueue import NetfilterQueue | |
import subprocess | |
import signal | |
import dpkt | |
import traceback | |
import socket | |
import sys | |
DNS_IP = '8.8.8.8' |