https://github.com/linusu/dhcp-spy
Silently listen for DHCP requests on the network
https://github.com/linusu/dhcp-spy
Last synced: about 1 year ago
JSON representation
Silently listen for DHCP requests on the network
- Host: GitHub
- URL: https://github.com/linusu/dhcp-spy
- Owner: LinusU
- Created: 2017-11-21T19:54:42.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-11-17T00:47:05.000Z (over 6 years ago)
- Last Synced: 2025-05-07T23:44:04.713Z (about 1 year ago)
- Language: JavaScript
- Size: 20.5 KB
- Stars: 8
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# DHCP Spy
Silently listen for DHCP requests on the network. Useful for monitoring when devices connects to the network, and can be used to detect presses on an [Amazon Dash Button](https://www.amazon.co.uk/Amazon-Dash-Button/b?ie=UTF8&node=10833773031).
Requires root priveligies in order to listen on port 67.
## Installation
```sh
npm install --save dhcp-spy
```
## Usage
```js
const spy = require('dhcp-spy')
spy.listening.then(() => {
console.log('Listening for DHCP requests')
})
spy.on('detected', (mac) => {
console.log(`Detected a request from ${mac}`)
})
spy.on('78:e1:03:b0:08:24', () => {
console.log('Someone pressed the "Mentos" dash button')
})
```