Uploaded by robertnabisco

kali linux notes

Kali Linux
• “2x tab key” = will give you list of things you can input. Tip: put in the first letter and it
will list all starting with those letters.
• “up arrow” = cycle through previously typed commands
• pwd – Present Working Directory
• cd – Change Directory
o cd root/ = change to root directory
o cd .. = go up one directory
o cd “g” = list all folders beginning with g
o cd ~/Music/ = change to Music folder without having to type full destination
address ex. /root/desktop/Music
• ls – Lists Folder Contents
o ls /etc/ = will list all contents of “etc” folder without having to navigate to it
o ls Desktop/ = desktop folder contents (case sensitive)
o ls -la = will list everything including hidden folders. You can change directory into
hidden folders and ls their contents
• mkdir – Make Directory rmdir – Remove Directory
o mkdir bmd = create “bmd” folder
o rmdir bmd/ = delete “bmd” folder
• echo – Create File
o echo “Hi!” > test.txt = create a file named test.txt in the current directory
• cp – Copy File to New Folder
o cp test.txt Downloads/ = copy test.txt to Downloads folder
▪ ls Downloads/ = confirms move
• rm – Remove file
o rm Downloads/test.txt
• mv – Move File
o mv test.txt Downloads/
• locate – Locate a File on System
o locate bash = will find everything with “bash” in it
• updatedb – Update the Database. Do this pretty often.
• passwd – Update password
• man – Instructions for Each Command
o man ls = lists all instructions
Kali Linux
• ls -la – list all files including hidden
o First Column shows file info, group permissions and privileges
▪ “-“ = file
▪ “d” = directory
▪ “rwx” = read, write, execute
▪ 3 User groups in next columns
• 1st is actual owner
• 2nd is group ownership
• 3rd is all users
▪ Look for folders like “temp” that have full access. This ensures your script
or file will have full access.
• chmod – Change Mode
o chmod 777 hello.txt
▪ “777” & “+r or rw or rwx” gives full access across the board. Now
hello.txt turns green and has full when you check “ls -la”
• adduser – Add User
o adduser john
• /etc/passwd – Will Show All Users
o cat /etc/passwd
• /etc/shadow – Shows all passwords in Hash. Hashcat an crack the Hash file
• su – Switch User
o su john su root (may require password for root)
• sudo – Elevate Privileges. The sudoers file lists users who have the elevated
permissions. Only root has admin priv unless you add user to sudoers.
Kali Linux
• ifconfig – Similar to ipconfig. Subnet, ip, netmask, broadcast add., MAC
• iwconfig – Wireless Adapter ifconfig
• ping – Establishes communication with device like router on network. It will talk back.
o ping 192.168.x.x
▪ Endlessly pings device on network until you press Ctrl+C
• arp – IP address it talks to and the MAC address assoc. with it. Sends broadcast signal.
o arp -a
• netstat – Display all active connections and listening ports running on machine
o netstat -ano
▪ You want to know if a machine is communicating over a port.
▪ Ex. If you open firefox you will see an active open port communicating
with the internet.
• route – Displays routing tables. Tells you where the traffic exits. A machine could
have 2 NICs so you could discover the machine is actually talking to a totally different
network than what you originally thought.