https://github.com/karpetrosyan/aioarp
ARP protocol implementation in python
https://github.com/karpetrosyan/aioarp
arp asyncio python trio
Last synced: 6 months ago
JSON representation
ARP protocol implementation in python
- Host: GitHub
- URL: https://github.com/karpetrosyan/aioarp
- Owner: karpetrosyan
- License: mit
- Created: 2023-06-02T14:45:17.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2023-10-10T10:53:24.000Z (over 1 year ago)
- Last Synced: 2024-12-12T20:09:52.110Z (6 months ago)
- Topics: arp, asyncio, python, trio
- Language: Python
- Homepage: https://karpetrosyan.github.io/aioarp/
- Size: 440 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# aioarp
[](https://pypi.org/project/aioarp)
[](https://pypi.org/project/aioarp)
[](https://app.codecov.io/gh/karosis88/aioarp)
-----
**Table of Contents**
- [Installation](#installation)
- [Documentation](#documentation)
- [ARP Spoofing](#arp-spoofing)
- [ARP requests](#how-to-send-arp-requests)
- [License](#license)## Installation
```console
pip install aioarp
```## Documentation
[Click here](https://karosis88.github.io/aioarp/)## Arp spoofing
Using this command, you can disable internet access for any device on your local network.
```shell
$ aioarp disable 192.168.0.81 192.168.0.1 enp0s3 --seconds 10
```or
```shell
$ aioarp spoof 192.168.0.81 192.168.0.1 11:11:11:11:11:11 enp0s3 --seconds 10
````spoof` can be used to specify the fake mac address.
Where...
- `192.168.0.81` is a target IP address for which we are blocking internet access.
- `192.168.0.1` is a gateway for our target IP address.
- `enp0s3` is an optional interface used to send ARP requests. if not specified, the default interface is used.
- `seconds` is an option that specifies how long we want to disable internet access for the target IP address.## How to send ARP requests
### Sync
```py
import aioarp
response = aioarp.request('10.0.2.2', 'enp0s3')
print(response.sender_mac)
# ee:xx:aa:mm:pp:le mac address
```### Async [trio or asyncio]
```py
import trio
import aioarp
response = trio.run(aioarp.arequest, '10.0.2.2', 'enp0s3')
``````py
import asyncio
import aioarp
response = asyncio.run(aioarp.arequest('10.0.2.2', 'enp0s3'))
```Or without specifying an `interface` parameter
```
response = aioarp.request('10.0.2.2')
```## License
`aioarp` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.