Exemple #1
0
def DisplayAdapters():
    #
    print("[*] Displaying network adapters...")
    time.sleep(1)
    #
    print()
    #
    interfaces = get_windows_if_list()
    #
    print("<<< Network Adapters >>>  \t MAC \t IPV4 \t IPV6")
    #
    print("------------------------  \t --- \t ---- \t ----")
    #
    for i in range(0, len(interfaces)):
        #
        single_intf = AddPrintBuffer(interfaces[i]['name'])
        #
        macAddr = AddPrintBuffer(interfaces[i]['mac'])
        #
        ip_addr_v4 = AddPrintBuffer(interfaces[i]['ips'][1])
        #
        ip_addr_v6 = interfaces[i]['ips'][0]
        #
        print(i, ')', single_intf, ' ', macAddr, ' ', ip_addr_v4, ' ',
              ip_addr_v6)
        #
    print()
    #
    time.sleep(3)
    #
    return
Exemple #2
0
def udp_sniffer():
    interfaces = get_windows_if_list()
    pprint(interfaces)

    print('\n[*] start udp sniffer')
    sniff(
        filter="udp port 5612",
        iface=r'Intel(R) 82574L Gigabit Network Connection', prn=parse_packet
    )
Exemple #3
0
def _scapy_iface(iface):
    from scapy.layers.l2 import get_if_hwaddr
    if IS_WINDOWS:
        from scapy.arch.windows import get_windows_if_list
        interfaces = get_windows_if_list()
        for i in interfaces:
            if any(iface in i[x] for x in ['name', 'netid', 'description', 'win_index']):
                return i['mac']
    # Do not put an 'else' here!
    return get_if_hwaddr(iface)
Exemple #4
0
def udp_sniffer():
    """start a sniffer.
    """
    interfaces = get_windows_if_list()
    pprint(interfaces)

    print('\n[*] Listening in: Realtek PCIe GbE Family Controller')
    sniff(
        filter="udp port 53",
        iface=r'Realtek PCIe GbE Family Controller', prn=parse_packet
		#iface=r'VirtualBox Host-Only Ethernet Adapter', prn=parse_packet
    )
def main():
    #
    print("""
***********************************
*                                 *
*    ___           _        _     *
*   / _ \__ _  ___| | _____| |_   *
*  / /_)/ _` |/ __| |/ / _ \ __|  *
* / ___/ (_| | (__|   <  __/ |_   *
* \/    \__,_|\___|_|\_\___|\__|  *
*                                 *
*   __       _  __  __            *
*  / _\_ __ (_)/ _|/ _| ___ _ __  *
*  \ \| '_ \| | |_| |_ / _ \ '__| *
* _ \ \ | | | |  _|  _|  __/ |    *
* \__/ _| |_|_|_| |_|  \___|_|    *
*                                 *
*                                 *
***********************************                              
          """)
    #
    conf.verb = 0
    #
    interfaces = get_windows_if_list()
    #
    print("[*] Interfaces [*]")
    #
    print("------------------")
    #
    for i in range(0, len(interfaces)):
        #
        print i, ")\t", interfaces[i]['name']
        #
    index = int(input("[+] Enter the interface index-> "))
    #
    interface = interfaces[index]['name']
    #
    headerString = "[*] Capture Interface: %s [*]\n" % interface
    #
    fileObject.write("[*] Capture Interface: %s [*]\n" % interface)
    #
    fileObject.write("-" * (len(headerString) - 1))
    #
    fileObject.write('\n')
    #
    print("[*] Starting sniffer on: %s ..." % interface)
    #
    sniff(filter="", store=False, iface=r'%s' % interface, prn=Parser)
Exemple #6
0
def GetAdapters():
    #
    print("[*] Identifying network interfaces...")
    time.sleep(1)
    #
    print()
    #
    interfaces = get_windows_if_list()
    #
    print(
        "<<< Network Adapters >>>  \t     MAC \t\t\t      IPV4 \t\t\t       IPV6"
    )
    #
    print(
        "------------------------  \t     --- \t\t\t      ---- \t\t\t       ----"
    )
    #
    for i in range(0, len(interfaces)):
        #
        single_intf = AddPrintBuffer(interfaces[i]['name'])
        #
        macAddr = AddPrintBuffer(interfaces[i]['mac'])
        #
        ip_addr_v4 = AddPrintBuffer(interfaces[i]['ips'][1])
        #
        ip_addr_v6 = interfaces[i]['ips'][0]
        #
        print(i, ')', single_intf, ' ', macAddr, ' ', ip_addr_v4, ' ',
              ip_addr_v6)
        #
    print()
    #
    interface = int(input("[+] Enter the interface index-> "))
    #
    print("[*] Selected: %s " % interfaces[interface]['name'])
    #
    activeInterface = interfaces[interface]['name']
    #
    activeMAC = interfaces[interface]['mac']
    #
    subjectInterface = [activeInterface, activeMAC]
    #
    return subjectInterface
Exemple #7
0
 #
 print("""
 *****************************************************
 A lightweight Host Intrustion Detection System (HIDS)
 *****************************************************
       """)
 #
 print()
 time.sleep(1)
 #
 print("[*] Collecting interface data...")
 time.sleep(1)
 #
 print()
 #
 interfaces = get_windows_if_list()
 #
 print("<<< Network Interfaces >>>")
 #
 print("--------------------------")
 #
 for i in range(0, len(interfaces)):
     #
     print(i, ')', interfaces[i]['name'])
     #
 print()
 #
 interface = int(input("[+] Enter the interface index-> "))
 #
 print("[*] Selected: %s " % interfaces[interface]['name'])
 #