Kali and Linux

  •  Default login:
    kali
    kali

  • Basic Linux Commands:
    pwd
    cd
    ls
    mkdir, rmdir
    cp, rm, mv, locate
    updatedb
    passwd
    man

         echo "Hi!" > test.txt


  • Commands
    chmod
    adduser
    /etc/passwd,/etc/shadow
    su    (switch user)
    sudo 

    ifconfig
    iwconfig
    arp
    netstat
    route

  • View, create and edit files
    echo
       echo "Hi!" > test.txt
    cat
    replacing vs appending (> vs >>)
    touch 
    nano  vi or vim)
    gedit (N/A)

  • start and stop Kali Services
    services
       service apache2 start/stop
       alternative to launch a webserver to transfer file, run in a directory, then from browser will see directory file list
       python -m SimpleHTTPServer [portnumber]

    systemctl  (start server permanently)
    systemctl enable ssh
    systemctl enable postgresql

  • Installing
    installing updates with apt-get
       apt-get update && apt-get upgrade
       apt-get install git
     or tools with apt-get
    git  (github)

  • script
    grep
    cut
    tr
    script writing
    for loops

    example:
    ping 192.168.2.1 -c 1 > ip.txt
    cat ip.txt
    cat ip.txt | grep "64 bytes"
    cat ip.txt | grep "64 bytes" | cut -d " " -f 4      (-d delimiter, -f field)
    cat ip.txt | grep "64 bytes" | cut -d " " -f 4 | tr -d ":" 

#! /bin/bash
if [ "$1" == "" ]
then
echo "you forgot an ip address"
echo "Syntax:  ./ipsweep.sh 192.168.1"
else
for ip in `seq 1 254` ; do
ping -c 1 $1.$ip | grep "64 bytes" | cut -d " " -f 4 | tr -d ":" &
done
fi

                      ./ipsweep.sh 192.168.2 > iplist.txt

                      for ip in $(cat iplist.txt); do nmap -sS -p80 -T4 $ip & done


                      https://www.thecybermentor.com/
                      https://www.hackthebox.com/
                      https://www.virtualhackinglabs.com/
                      https://www.vulnhub.com/

                      Nessus


                      ======Linux=====

                      Sudo stands for SuperUser DO and is used to access restricted files and operations. By default, Linux restricts access to certain parts of the system preventing sensitive files from being compromised.

                      The sudo command temporarily elevates privileges allowing users to complete sensitive tasks without logging in as the root user.



                      back to last directory I was 
                      cd -      

                      back to home directory
                      cd ~

                      clear screen
                      clear or Ctrl+L

                      Backgroup and frontgroup
                      Example, when in vi, need switch to terminal, Ctrl+Z, in Terminal, type fg to go back vi

                      call back last command with sudo 
                      sudo !!

                      History commands
                      history
                      !xxx








                      Comments