Loading....
ifconfig : print the network interface $ ifconfig | cut -c-10 | tr -d ' ' | tr -s '\n' grep ing ip address $ ifconfig wlan0 | egrep -o "inet addr:[^ ]*" | grep -o "[0-9.]*" 192.168.0.82 host muslum21.com nslookup muslum21.com sembolic name for ip # echo IP_ADDRESS symbolic_name >> /etc/hosts route: showing routing table info ping -c 2 muslum21.com (ctrl+C) traceroute muslum21.com listing alive machines on a network shell script for ip in 192.168.0.{1..255} do ping $ip -c 2 &> /dev/null; if [ $? -eq 0 ]; then echo $ip is alive else echo $ip is not fi done parallel ping () & () subshell wait #!/bin/bash #Filename: fast_ping.sh # Change base address 192.168.0 according to your network. for ip in 192.168.0.{1..255} ; do ( ping $ip -c2 &> /dev/null ; if [ $? -eq 0 ]; then echo $ip is alive fi )& done wait SSH ssh root@ip command from local stdin to remote stdin $ echo 'text' | ssh user@remote_host 'echo' text # Redirect data from file as: $ ssh user@remote_host 'echo' < file Transfering files through the network FTP, SFTP, RSYNC, SCP lftp:
Auto-login with SSH
Mounting a Remote Drive to local mount point # sshfs -o allow_other user@remotehost:/home/path /mnt/mountpoint Password: Network Traffic and port Analysis lsof, netstats lsof -i : In order to list all opened ports on the system along with the details on each service attached to it netstat-tnp : Use netstat -tnp to list opened port and services as follows: Creating arbitrary sockets command : nc, netcat 1. Set up the listening socket using the following: nc -l 1234 This will create a listening socket on port 1234 on the local machine. 2. Connect to the socket using the following: nc HOST 1234 If you are running this on the same machine that the listening socket is, replace HOST with localhost, otherwise replace it with the IP address or hostname of the machine. 3. To actually send messages, type something and press Enter on the terminal where you performed step 2. The message will appear on the terminal where you performed step 1 Quickly copying files over the network We can exploit netcat and shell redirection to easily copy files over the network:
Sharing internet connection basic firewall using iptablesLast Update: Posted by: müslüm ÇEN