Kali Linux : Small Walkthrough


Kali Navigation
  1.     Terminal
    1. pwd - current location
    2. cd - change directory . cd.. ( cd with 2 dots will take you back to one level)
    3. ls - list everything in current path 
    4. cd root - will take to root directory.
    5. mkdir - mkdir to create folder
    6. rmdir - remove directory
    7. ls -la    - list hidden and all files folders
    8. echo - to create file with data. eg echo "hi" > test.txt
    9. cp - copy file.
    10. rm - remove file
    11. locate -  locate bash
    12. updatedb - to update files names folder names in the file system
    13. passwd - to change password
    14. man - manual for commands - man ls
____________________________________________________________________________________

Kali Network commands
  1. ifconfig  or ifconfig- to check IP address and other details . MAC, subnet mask
  2. iwconfig - when extra wifi adaptor
  3. ping - to know the communication is happening or not
  4. arp -a   - if arp do not work
    1. export PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin"
  5. netstat -ano
    1. active connections running on machine
    2. suppose i open firefox and start browsing then comes and enter netsta -ano command on terminal then it will be able to show firefox with specific port communication.
  6. route
    1. shows ip routing table.
    2. how your IP is reaching to its destination.

___________________________________________________________________________________

Viewing Creating and Editing Files
  1. echo : - 
    1. write to file.
    2. echo "hey hello!!!" > h.txt
  2. cat: -
    1. cat h.txt   - to view the content of file
  3. to append the file content : -
    1. echo " hey hello again today!!!" >> h.txt
  4. touch 
    1. touch <<filename>>
  5. nano
    1. terminal text editor

____________________________________________________________________________________

Start Stopping Kali Services
  1. Web servers on kali
    1. apache
      1. to start the service
        1. service apache2 start
      2. apache server do not run by default so we need to start the service.
        1. to make it permanent
          1. systemctl enable postgresql

      3. to stop the service
      1. service apache2 stop
    1. Python
      1. python -m SimpleHTTPServer 8833
        1. python server will be created on the same location where you have run the above command.
        2. check on browser with IPaddress:port number

____________________________________________________________________________________

Installing updating tools
  1. apt update && apt upgrade - from the repository
  2. github - git clone
____________________________________________________________________________________

To find the content in kali

  1. locate - before using locate you need to use  updatedb then use locate.
  2. findThe find command is a more aggressive search tool than locate or which. Find is able torecursively search any given path for various files.
  3. which - The which command searches through the directories that are defined in the $PATH environment variable for a given filename.
  4. passwd - for changing password
  5. ssh service - is used for remotely access computer (the secure shell). it works on port 22. systemctl start ssh.  To confirm whether is it running or not use   netstat -antp | grep sshd
____________________________________________________________________________________

Users and Privileges


  1. -rw-r--r--   [from above screenshot]
    1.    - means it is a file
  2. drwxr-xr-x
    1. d means directory
    2. rwx ( read write executable)
    3. Three groups are available.
      1. first group =  rwx = owner of the file full permission
      2. second group  =  r-x = members of the group, only read and executable permission cannot write
      3. third group  =  r-x  = any other user, only read and executable permission cannot write 
  3. tmp folder has full access, read write execute. also available another /var/tmp folder.
  4. chmod 
    1. change mode
    2. chmod 777 <<filename>>
    3. 777 is for full permission
  5. adduser
    1. to add new user
    2. addusr xxxx
    3. add all necessary information which it asks.
    4. to confirm the user id added or not
      1. cat /etc/passwd
  6. shadow file has all password in encrypted form
    1. cat /etc/shadow
    2. hashcat to crack the password.
  7. su
    1. su - switch user
    2. su username
      1. give password
    3. non root user should be the part of sudoers file to change the permission of files and folders created by other.
        


Comments