{"id":13774909,"url":"https://github.com/rpp0/scapy-fakeap","last_synced_at":"2025-06-14T11:41:40.604Z","repository":{"id":19641056,"uuid":"22893276","full_name":"rpp0/scapy-fakeap","owner":"rpp0","description":"Fake wireless Access Point (AP) implementation using Python and Scapy, intended for convenient testing of 802.11 protocols and implementations.","archived":false,"fork":false,"pushed_at":"2015-08-06T11:22:39.000Z","size":219,"stargazers_count":248,"open_issues_count":7,"forks_count":52,"subscribers_count":26,"default_branch":"master","last_synced_at":"2025-05-11T07:33:37.809Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rpp0.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-08-12T21:34:20.000Z","updated_at":"2025-04-17T00:48:17.000Z","dependencies_parsed_at":"2022-08-13T19:40:58.340Z","dependency_job_id":null,"html_url":"https://github.com/rpp0/scapy-fakeap","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rpp0/scapy-fakeap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rpp0%2Fscapy-fakeap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rpp0%2Fscapy-fakeap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rpp0%2Fscapy-fakeap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rpp0%2Fscapy-fakeap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rpp0","download_url":"https://codeload.github.com/rpp0/scapy-fakeap/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rpp0%2Fscapy-fakeap/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259811109,"owners_count":22915140,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T17:01:31.652Z","updated_at":"2025-06-14T11:41:40.567Z","avatar_url":"https://github.com/rpp0.png","language":"Python","funding_links":[],"categories":["\u003ca id=\"01f99d208e245eb44f15f720043b50d4\"\u003e\u003c/a\u003eScapy"],"sub_categories":[],"readme":"scapy-fakeap\n============\n\nFake wireless Access Point (AP) implementation using Python and Scapy, intended for convenient testing of 802.11 protocols and implementations. This library is a work in progress, and currently only supports open 802.11 networks.\n\n\nMotivation\n----------\n\nTesting 802.11 protocols and implementations for bugs or security vulnerabilities requires a simple and flexible AP implementation. This library aims to provide these features by using the popular packet manipulation program 'Scapy' for data transmission and reception. \n\n\nInstallation\n------------\n\nYou will need to have the following packages installed:\n- ```scapy```\n- ```ip```\n- ```airmon-ng```\n- ```dnsmasq``` (optional)\n\nThen, run ```python2 setup.py install``` to install ```scapy-fakeap```.\n\n\nExamples\n--------\n\nFirst, set up your device in monitor mode. You can use ```airmon-ng``` or ```iw```:\n\n```\n# iw dev wlan0 interface add mon0 type monitor\n# ifconfig mon0 up\n```\n\nFrom there, setting up a basic AP with ```scapy-fakeap``` is extremely simple, as shown in the example below:\n\n```python\n# This example is a simple 'hello world' for scapy-fakeap.\n# An open network will be created that can be joined by 802.11 enabled devices.\n\nfrom fakeap import *\n\nap = FakeAccessPoint('mon0', 'Hello scapy-fakeap world!')\nap.run()\n```\n\nFor more examples, please see the 'examples' folder.\n\n\nCallbacks\n---------\n\nThe behaviour of the AP can be completely customized by changing the callbacks associated with a certain event. To do this, pass a custom ```Callbacks()``` object to the ```FakeAccessPoint``` constructor or to an instance during runtime. Currently, the following callbacks are provided:\n\n- ```cb_recv_pkt```: Triggered every time a packet is received. This callback defines when all other callbacks are triggered.\n- ```cb_dot11_probe_req```: Triggered on reception of a Probe Request frame. The default behaviour is to reply with a Probe Response frame.\n- ```cb_dot11_beacon```: Triggered every 0.1 seconds. The default behaviour is to send a Beacon frame.\n- ```cb_dot11_auth```: Triggered on reception of an Authentication Request frame. The default behaviour is to reply with an Authentication Response frame.\n- ```cb_dot11_assoc_req```: Triggered on reception of an Association Request frame. The default behaviour is to reply with an Association Response frame.\n- ```cb_dot11_rts```: Triggered on reception of an RTS frame. The default behaviour is to reply with a CTS frame.\n- ```cb_arp_req```: Triggered on reception of an ARP Request. The default behaviour is to reply with an ARP Response.\n- ```cb_dot1X_eap_req```: Triggered on reception of an 802.1X EAP Request frame. The default behaviour is to reply with an 802.1X EAP Response frame.\n- ```cb_dhcp_discover```: Triggered on reception of a DHCP Discover message. The default behaviour is to forward the message to ```dnsmasq```.\n- ```cb_dhcp_request```: Triggered on reception of a DHCP Request message. The default behaviour is to forward the message to ```dnsmasq```.\n- ```cb_dns_request```: Triggered on reception of a DNS Request message. The default behaviour is to forward the message to ```dnsmasq```.\n- ```cb_tint_read```: Triggered on reception of a packet from the ```fakeap``` virtual interface. This callback defines when callbacks related to this interface are triggered.\n\n\n### Writing your own callback:\nThe following example shows how a custom callback for a ```Callbacks()``` instance can be easily created:\n\n```python\n# This example demonstrates how to create a new callback for a specific Callbacks() instance.\n# The callback will trigger each time an EAPOL packet is sniffed.\n\nfrom types import MethodType\nfrom scapy.layers.dot11 import EAPOL\nfrom fakeap import *\n\n\ndef do_something(self):  # Our custom callback\n    print(\"Got EAPOL packet!\")\n\n\ndef my_recv_pkt(self, packet):  # We override recv_pkt to include a trigger for our callback\n    if EAPOL in packet:\n        self.cb_do_something()\n    self.recv_pkt(packet)\n\nap = FakeAccessPoint('mon0', 'My first callback!')\nap.wpa = AP_WLAN_TYPE_WPA2  # Enable WPA2\nap.ieee8021x = 1  # Enable 802.1X (WPA-Enterprise)\nmy_callbacks = Callbacks(ap)\nmy_callbacks.cb_recv_pkt = MethodType(my_recv_pkt, my_callbacks)\nmy_callbacks.cb_do_something = MethodType(do_something, my_callbacks)\nap.callbacks = my_callbacks\n\nap.run()\n```\n\n\nService interaction\n-------------------\n\nUpon instantiation of a ```FakeAccessPoint``` object, scapy-fakeap automatically creates the ```fakeap``` virtual interface, which may be used for interacting with other services. For example, you can set it as the listen interface for ```dnsmasq``` to use a DHCP server for your fake AP.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frpp0%2Fscapy-fakeap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frpp0%2Fscapy-fakeap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frpp0%2Fscapy-fakeap/lists"}