Some description.


License
MIT
Install
pip install netw0rk==1.11.3

Documentation

Netw0rk

Author(s): Daan van den Bergh
Copyright: © 2020 Daan van den Bergh All Rights Reserved


Bergh-Encryption

Installation

pip3 install netw0rk --upgrade && python3 -c "import netw0rk" --create-alias

CLI:

The netw0rk cli tool.

Usage: netw0rk <mode> <options> 
Modes:
    --network : Access the network.
        --info : Retrieve the current firewall information.
    --firewall : Access the firewall (Linux only).
        --disable : Disable the firewall.
        --enable : Enable the firewall.
        --set-default false : Set the default firewall behaviour (deny/allow).
        --allow 22 : Allow a port in the firewall settings.
        --deny 22 : Deny a port in the firewall settings.
    -h / --help : Show the documentation.
Options:
    -c : Do not clear the logs.
Author: Daan van den Bergh. 
Copyright: © Daan van den Bergh 2020. All rights reserved.

Python Examples.

The FireWall object class

The FireWall() object class.

# import the package.
import netw0rk

# retrieve the firewall information.
response = netw0rk.firewall.info()

# disable the firewall.
response = netw0rk.firewall.disable()

# enable the firewall.
response = netw0rk.firewall.enable()

# set the default port action.
response = netw0rk.firewall.set_default(deny=True)

# allow a port.
response = netw0rk.firewall.allow(2200)

# deny a port.
response = netw0rk.firewall.deny(2200)

The Network object class

The Network() object class.

# import the package.
import netw0rk

# get network info.
response = netw0rk.network.info()

# ping an ip.
response = netw0rk.network.ping("192.168.1.200")

# convert a dns.
response = netw0rk.network.convert_dns("vandenberghinc.com")

Response Object.

When a function completed successfully, the "success" variable will be "True". When an error has occured the "error" variable will not be "None". The function returnables will also be included in the response.

{
	"success":False,
	"message":None,
	"error":None,
	"...":"...",
}