mirror of https://github.com/franjsco/lscanbot
Compare commits
11 Commits
Author | SHA1 | Date |
---|---|---|
Francesco Esposito | d56e9796d8 | |
dependabot[bot] | a4501e602c | |
franjsco | 517d3ea4e9 | |
Francesco Esposito | 7137d41ac4 | |
Francesco Esposito | da0ec71ba5 | |
Francesco Esposito | 87fa508522 | |
dependabot[bot] | e3df205956 | |
dependabot[bot] | 3128b53f44 | |
Francesco Esposito | 8a39821d89 | |
dependabot[bot] | c3a9feb90b | |
Francesco Esposito | 3de24e30dc |
69
README.md
69
README.md
|
@ -1,12 +1,37 @@
|
|||
# lscanbot
|
||||
<h1 align="center">Welcome to lscanbot 📱</h1>
|
||||
<p>
|
||||
<a href="https://github.com/franjsco/lscanbot/graphs/commit-activity" target="_blank">
|
||||
<img alt="Maintenance" src="https://img.shields.io/badge/Maintained%3F-yes-green.svg" />
|
||||
</a>
|
||||
<a href="https://github.com/franjsco/lscanbot/blob/master/LICENSE" target="_blank">
|
||||
<img alt="License: GPL--3.0" src="https://img.shields.io/github/license/franjsco/lscanbot" />
|
||||
</a>
|
||||
<a href="https://twitter.com/franjsco" target="_blank">
|
||||
<img alt="Twitter: franjsco" src="https://img.shields.io/twitter/follow/franjsco.svg?style=social" />
|
||||
</a>
|
||||
</p>
|
||||
|
||||
An opensource telegram bot to find devices on your LAN.
|
||||
> A telegram bot to find devices on your LAN.
|
||||
|
||||
<img src="screenshot.png" height="400">
|
||||
<img src="screenshot.png">
|
||||
|
||||
The bot is written in Node.js.
|
||||
## Install
|
||||
|
||||
### Step by step
|
||||
1. Install **arp-scan** package on your GNU/Linux system.
|
||||
2. Configure **arp-scan** to use without sudo. (`chmod u+s`)
|
||||
3. Clone this repository on your system.
|
||||
4. Install dependecies with `npm install`.
|
||||
5. Create new bot with **@BotFather** on Telegram.
|
||||
6. Insert your **API Token** (app.token) into `config.json`.
|
||||
7. Insert your **Telegram ID** (app.authorizedUsers) into `config.json`.
|
||||
8. Insert your **Network Device** (scanner.interface) into `config.json`.
|
||||
|
||||
## Usage
|
||||
Start server:
|
||||
```sh
|
||||
npm run start
|
||||
```
|
||||
|
||||
**lscanbot** scans devices with arp-scan, showing only devices registered in the inventory.
|
||||
|
||||
|
@ -16,8 +41,7 @@ Before scanning, you must insert the devices into the inventory (to track it):
|
|||
|
||||
(use `;` to split arguments)
|
||||
|
||||
|
||||
example: (/add My device; Me; AB:CC:MY:MC:AD)
|
||||
example: (/add Motorola Moto G6; Frank; AB:CC:MY:MC:AD)
|
||||
|
||||
|
||||
|
||||
|
@ -31,32 +55,23 @@ It will send back the devices connected to your network.
|
|||
### Remove
|
||||
> /remove [MAC Address]
|
||||
|
||||
## Installation
|
||||
|
||||
In order to use this bot is required that the code is hosted on a GNU/Linux system connected to your LAN (Raspberry Pi would be a good choice)
|
||||
## Author
|
||||
|
||||
👤 **franjsco (Francesco Esposito)**
|
||||
|
||||
### Prerequisites
|
||||
- Node.js
|
||||
- npm
|
||||
- GNU/Linux
|
||||
* Website: https://franjsco.github.io/
|
||||
* Twitter: [@franjsco](https://twitter.com/franjsco)
|
||||
* Github: [@franjsco](https://github.com/franjsco)
|
||||
|
||||
### Step by step
|
||||
1. Install **arp-scan** package on your linux system.
|
||||
2. Configure arp-scan to use without sudo.
|
||||
(`chmod u+s`)
|
||||
3. Clone this repository on your system.
|
||||
4. Install dependecies with `npm install`.
|
||||
5. Create new bot with BotFather on Telegram.
|
||||
6. Insert your **token** (app.token) into `config.json`.
|
||||
7. Insert your **TelegramID** (app.authorizedUsers) into `config.json`.
|
||||
8. Insert your **network device** (scanner.interface) into `config.json`.
|
||||
8. Start with `npm start`.
|
||||
## Show your support
|
||||
|
||||
Give a ⭐️ if this project helped you!
|
||||
|
||||
### License
|
||||
## 📝 License
|
||||
|
||||
GPLv3
|
||||
Copyright © 2020 [franjsco (Francesco Esposito)](https://github.com/franjsco).<br />
|
||||
This project is [GPL--3.0](https://github.com/franjsco/lscanbot/blob/master/LICENSE) licensed.
|
||||
|
||||
---
|
||||
Made with ❤️ by Francesco Esposito ([@frab1t](https://github.com/frab1t))
|
||||
***
|
||||
_This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_
|
File diff suppressed because it is too large
Load Diff
22
package.json
22
package.json
|
@ -1,33 +1,33 @@
|
|||
{
|
||||
"name": "lscanbot",
|
||||
"version": "1.0.0",
|
||||
"description": "A telegram bot to scan your LAN.",
|
||||
"main": "index.js",
|
||||
"description": "A telegram bot to find devices on your LAN.",
|
||||
"main": "server.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"lint": "eslint .",
|
||||
"start": "node index.js"
|
||||
"start": "node src/server.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/frab1t/lscanbot.git"
|
||||
"url": "git+https://github.com/franjsco/lscanbot.git"
|
||||
},
|
||||
"author": "frab1t",
|
||||
"author": "franjsco",
|
||||
"license": "GPL-3.0",
|
||||
"bugs": {
|
||||
"url": "https://github.com/frab1t/lscanbot/issues"
|
||||
"url": "https://github.com/franjsco/lscanbot/issues"
|
||||
},
|
||||
"homepage": "https://github.com/frab1t/lscanbot#readme",
|
||||
"homepage": "https://github.com/franjsco/lscanbot#readme",
|
||||
"dependencies": {
|
||||
"arpscan": "^0.6.0",
|
||||
"bunyan": "^1.8.12",
|
||||
"network-list": "^1.1.5",
|
||||
"sqlite3": "^4.0.2",
|
||||
"telebot": "^1.2.6"
|
||||
"telebot": "^1.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint": "^5.6.0",
|
||||
"eslint-config-airbnb-base": "^13.1.0",
|
||||
"eslint-plugin-import": "^2.14.0"
|
||||
"eslint": "^5.16.0",
|
||||
"eslint-config-airbnb-base": "^13.2.0",
|
||||
"eslint-plugin-import": "^2.20.2"
|
||||
}
|
||||
}
|
||||
|
|
BIN
screenshot.png
BIN
screenshot.png
Binary file not shown.
Before Width: | Height: | Size: 476 KiB After Width: | Height: | Size: 461 KiB |
|
@ -1,6 +1,6 @@
|
|||
const sqlite3 = require('sqlite3').verbose();
|
||||
const fs = require('fs');
|
||||
const appConfig = require('./config.json');
|
||||
const appConfig = require('../config.json');
|
||||
|
||||
function connectDB() {
|
||||
const db = new sqlite3.Database('data.db');
|
|
@ -1,5 +1,5 @@
|
|||
const bunyan = require('bunyan');
|
||||
const appConfig = require('./config.json');
|
||||
const appConfig = require('../config.json');
|
||||
|
||||
const log = bunyan.createLogger({
|
||||
name: appConfig.app.name,
|
|
@ -1,5 +1,5 @@
|
|||
const arpScanner = require('arpscan/promise');
|
||||
const appConfig = require('./config.json');
|
||||
const appConfig = require('../config.json');
|
||||
const db = require('./db');
|
||||
|
||||
function scanNetwork(userId) {
|
|
@ -1,5 +1,5 @@
|
|||
const TeleBot = require('telebot');
|
||||
const appConfig = require('./config.json');
|
||||
const appConfig = require('../config.json');
|
||||
const scanner = require('./scanner.js');
|
||||
const utils = require('./utils.js');
|
||||
const logger = require('./logger.js');
|
|
@ -1,4 +1,4 @@
|
|||
const appConfig = require('./config.json');
|
||||
const appConfig = require('../config.json');
|
||||
|
||||
function isAuthorizedUser(userId) {
|
||||
return appConfig.app.authorizedUsers.includes(userId);
|
||||
|
@ -7,13 +7,13 @@ function isAuthorizedUser(userId) {
|
|||
function templateStart() {
|
||||
const msg = `* Welcome to ${appConfig.app.name} 📱📡*\n
|
||||
A bot to find devices on your network. \n
|
||||
Made with ❤️ by @frab1t `;
|
||||
Made with ❤️ by @franjsco `;
|
||||
return msg;
|
||||
}
|
||||
|
||||
function templateUnauthorizedUser() {
|
||||
const msg = `Unauthorized user. 🤖 \n
|
||||
Clone the repository https://github.com/frab1t/lscanbot
|
||||
Clone the repository https://github.com/franjsco/lscanbot
|
||||
and run the bot on your local network. 😎`;
|
||||
return msg;
|
||||
}
|
||||
|
@ -29,10 +29,10 @@ function templateHelp() {
|
|||
}
|
||||
|
||||
function templateDevicesList(data) {
|
||||
if(data.length === 0) {
|
||||
if (data.length === 0) {
|
||||
let devices = '📡 Devices Not Found. \n\n';
|
||||
return devices;
|
||||
}
|
||||
}
|
||||
let devices = '📡 Devices available: \n\n';
|
||||
data.forEach((elem) => {
|
||||
devices += `----- \n 📱 * ${elem.device} * \n 👉 _ ${elem.owner} _ \n \n `;
|
Loading…
Reference in New Issue