Skip to content

diegargon/monnet

Repository files navigation

GithubTest PhpUnit PhpStan CodeSniffer License: CC BY-NC-ND 4.0

MonNet

MonNet is a hybrid of a homepage accessible from your web browser and a preview/summary of your network, featuring additional options.

MonNet Status

MonNet is currently in an early version. It is possible that issues may arise between versions. The compatibility is not guaranteed.

You can add bookmarks, networks, and other elements, but some features, modification is not yet possible. (Except by directly accessing the database, obviously)

The English language (EN/US) is IA generated.

Versions

v0.0.0 Mayor.Minor.Revision

Revision version implied not changes to the database only code changes Mayor/Minor implies changes to database

MonNet Install

Deps

LAMP Linux, Apache, Mysql, PHP Composer arp Optional for get mac's address, only work same network (other method will added in the future)

phpseclib (Composer) Features is disable due rewriting. Thinking if port CLI scripts to python.

Initial database settings

mysql -u root -p
mysql> CREATE DATABASE monnet;
mysql> CREATE USER 'monnet'@'localhost' IDENTIFIED BY 'password';
mysql> GRANT ALL PRIVILEGES ON monnet.* TO 'monnet'@'localhost'

Clone repo

/var/www/html# git clone https://github.com/diegargon/monnet .

/var/www/html# chown -R www-data:www-data *
/var/www/html# chmod 755 cache

Composer deeps

#
/path/to/monnet# composer require phpseclib/phpseclib:~3.0
#optional for send messsages (not yet)
/path/to/monnet# composer require phpmailer/phpmailer

Config

Check config/config.defaults.php and add the keywords you want change to /etc/monnet/config.inc.php

If you copy it's better remove all unnchaged config. Don't rename or modify directly config.defaults.php

That the main config keyboards you must check/change and copy to the ethc file

$cfg_db['dbhost'] $cfg_db['dbname'] $cfg_db['dbuser'] $cfg_db['dbpassword'] $cfg['path'] = '/var/www/html'; $cfg['rel_path'] = '/'; $cfg['lang'] = 'es';

Load the sql

/var/www/html# mysql monnet < config/monnet.sql -p

Default user : pwd

monnet : monnetadmin

Setting crontab

Times depends of your network

$ nano /etc/crontab
*/5 * * * * root /usr/bin/php /var/www/html/monnet-cli.php
*/15 * * * * root /usr/bin/php /var/www/html/monnet-discovery.php

CERTS (disable temporaraly due rewriting)

(without password)

$ mkdir /var/certs && cd /var/certs
$ ssh-keygen -m PEM -t rsa -b 4096

add /var/certs/id_rsa to cfg[‘certs’]

Server to monitor (disable temporaraly due rewriting)

$ adduser monnet
$ usermod -aG sudo monnet
$ usermod -aG adm monnet

Add to /etc/sudoers

monnet ALL=(ALL) NOPASSWD: /sbin/poweroff, /sbin/reboot, /sbin/shutdown

From monnet server to server to monitor

$ ssh-copy-id -i /var/certs/id_rsa.pub monnet@ip.ip.ip.ip

MAC address, latest oui.csv

https://regauth.standards.ieee.org/standards-ra-web/pub/view.html

IANNA Standard port

https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.csv