update dirs/readme

This commit is contained in:
franjsco 2020-05-13 00:59:15 +02:00
parent 7137d41ac4
commit 517d3ea4e9
9 changed files with 747 additions and 618 deletions

View File

@ -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 ([@franjsco](https://github.com/franjsco))
***
_This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_

1260
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,12 +1,12 @@
{
"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",
@ -23,11 +23,11 @@
"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"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 527 KiB

After

Width:  |  Height:  |  Size: 461 KiB

View File

@ -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');

View File

@ -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,

View File

@ -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) {

View File

@ -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');

View File

@ -1,4 +1,4 @@
const appConfig = require('./config.json');
const appConfig = require('../config.json');
function isAuthorizedUser(userId) {
return appConfig.app.authorizedUsers.includes(userId);