Send Cisco Discovery Protocol packets with Scapy
Project description
CDP Sender Module
Overview
scapy-cdp provides a small command line utility to send Cisco Discovery Protocol (CDP) packets using Scapy. It installs a cdp-sender command that transmits a CDP packet every 60 seconds. The module works well on Linux systems, including Raspberry Pi.
Installation
Install the package with pip:
sudo pip3 install scapy-cdp
This creates the /usr/local/bin/cdp-sender executable.
Usage
Display available options:
sudo cdp-sender --help
Example:
sudo cdp-sender --interface eth0 --device-id MyDevice --software-version "1.2.3" --platform "MyPlatform"
Settings can also come from a JSON configuration file:
{
"interface": "eth0",
"device_id": "MyDevice",
"software_version": "1.2.3",
"platform": "MyPlatform",
"ttl": 120,
"capabilities": "0x0038"
}
Run with the configuration file:
sudo cdp-sender --config config.json
Systemd Service
Create /etc/systemd/system/cdp_sender.service:
[Unit]
Description=CDP Sender Service
After=network.target
[Service]
ExecStart=/usr/local/bin/cdp-sender
Restart=always
User=root
[Install]
WantedBy=multi-user.target
Then enable and start the service:
sudo systemctl daemon-reload
sudo systemctl enable cdp_sender
sudo systemctl start cdp_sender
Cron Alternative
To run the script every minute with cron:
sudo crontab -e
Add this line:
* * * * * /usr/local/bin/cdp-sender
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file scapy_cdp-0.1.0.tar.gz.
File metadata
- Download URL: scapy_cdp-0.1.0.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c77fbd45931bc9e94997893763c24adfb15225f7619e9ccbbc02393fca3dcab8
|
|
| MD5 |
b9f77a137c4a9c792951d7709e34ac4d
|
|
| BLAKE2b-256 |
29c1925eae2ef1f5f0ddcee93424ed68491971de36af21f8200281d4859a258b
|
File details
Details for the file scapy_cdp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: scapy_cdp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8c2079600b125c6b3b17bad5ada1504e73708031bb168d8aec78ea39409ce33
|
|
| MD5 |
cec3dca46abb9119af6eaba7618d3534
|
|
| BLAKE2b-256 |
587bc9a740679bcf3f306e6f4f62e9b68ca97a08a25d6a3261fd121cd0fde0e3
|