Update NETWORKING.md

This commit is contained in:
mayfrost 2018-10-14 00:28:51 +00:00 committed by GitHub
parent 2993da8141
commit 0820707117
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,87 +33,87 @@ You can save either example in a script to activate the Wi-Fi whenever you want.
## Next ## Next
### using ufw ### ufw
sudo ufw status sudo ufw status
sudo ufw enable sudo ufw enable
sudo ufw disable sudo ufw disable
sudo ufw default deny sudo ufw default deny
sudo ufw default allow sudo ufw default allow
sudo ufw allow PORT_NUMBER sudo ufw allow PORT_NUMBER
* delete a rule * delete a rule
sudo ufw delete allow PORT_NUMBER sudo ufw delete allow PORT_NUMBER
* allow everything for a specific address * allow everything for a specific address
sudo ufw allow from IP_ADDRESS sudo ufw allow from IP_ADDRESS
* allow a specific port for a specific address * allow a specific port for a specific address
sudo ufw allow from IP_ADDRESS to any port PORT_NUMBER sudo ufw allow from IP_ADDRESS to any port PORT_NUMBER
### tcpdump ### tcpdump
* dump all * dump all
sudo tcpdump sudo tcpdump
* dump 5 packets * dump 5 packets
sudo tcpdump -c 5 sudo tcpdump -c 5
* dump in ASCii format * dump in ASCii format
sudo tcpdump -A sudo tcpdump -A
* dump in hexadecimal format * dump in hexadecimal format
sudo tcpdump -xx sudo tcpdump -xx
* dump from an specific interface * dump from an specific interface
sudo tcpdump -i INTERFACE_NAME sudo tcpdump -i INTERFACE_NAME
* dump from a specific port * dump from a specific port
sudo tcpdump port PORT_NUMBER sudo tcpdump port PORT_NUMBER
* dump 5 packets in hexadecimal from an specific interface and a specific port * dump 5 packets in hexadecimal from an specific interface and a specific port
sudo tcpdump -c 5 -xx -i INTERFACE port PORT_NUMBER sudo tcpdump -c 5 -xx -i INTERFACE port PORT_NUMBER
### netstat ### netstat
* show routing table, including gateway * show routing table, including gateway
netstat -nr netstat -nr
* show all ports * show all ports
netstat -tulpn netstat -tulpn
* show network usage of devices * show network usage of devices
netstat -i netstat -i
* show active connections * show active connections
netstat -ta netstat -ta
* show active connections, but show ip addresses instead * show active connections, but show ip addresses instead
netstat -tan netstat -tan
### traceroute ### traceroute
* show which route your connection takes between your computer to the destination * show which route your connection takes between your computer to the destination
traceroute WEBNAME_OR_IP traceroute WEBNAME_OR_IP
### nmap ### nmap
* scan a specific ip address (including devices) * scan a specific ip address (including devices)
nmap IP_NUMBER nmap IP_NUMBER
* scan a specific website * scan a specific website
nmap WEBSITE_NAME nmap WEBSITE_NAME
* scan a specific ip address (including devices) with more information * scan a specific ip address (including devices) with more information
nmap -v IP_NUMBER nmap -v IP_NUMBER
* scan two ip address (including devices), 192.168.0.1 and 192.168.0.54 * scan two ip address (including devices), 192.168.0.1 and 192.168.0.54
nmap 192.168.0.1,54 nmap 192.168.0.1,54
* scan a range of ip address (including devices), from 192.168.0.1 to 192.168.0.100 * scan a range of ip address (including devices), from 192.168.0.1 to 192.168.0.100
nmap 192.168.0.1-100 nmap 192.168.0.1-100
* scan all ip address (including devices) from network 192.168.0.0 * scan all ip address (including devices) from network 192.168.0.0
nmap 192.168.0.* nmap 192.168.0.*
* scan address from a file * scan address from a file
nmap -il FILE nmap -il FILE
* scan address and identify OS and running services * scan address and identify OS and running services
nmap -A IP_NUMBER nmap -A IP_NUMBER
* check if target is up * check if target is up
nmap -sP IP_NUMBER nmap -sP IP_NUMBER
* check reason for services states * check reason for services states
nmap --reason IP_NUMBER nmap --reason IP_NUMBER
* show host interfaces * show host interfaces
nmap --iflist IP_NUMBER nmap --iflist IP_NUMBER
### SSH ### SSH
* login to remote host * login to remote host
ssh ADDRESS ssh ADDRESS
* login to remote host as user USER * login to remote host as user USER
ssh USER@ADDRESS ssh USER@ADDRESS
* set ssh server configuration in /etc/ssh/sshd_config * set ssh server configuration in /etc/ssh/sshd_config
Port 22 # default port Port 22 # default port
PermitRootLogin without-password # change "without-password" to "no" PermitRootLogin without-password # change "without-password" to "no"
AllowUsers USER_NAME # by allowing a specific user it restricts the others AllowUsers USER_NAME # by allowing a specific user it restricts the others
* restart "ssh" service to activate changes * restart "ssh" service to activate changes
## /etc/network/interfaces
# use last 8 octets for hosts * use last 8 octets for hosts
255.255.255.0 255.255.255.0