Intro to Kali Linux

Kali Linux

Linux Commands

๐Ÿ”— explainshell.com

๐Ÿ”— TCM Linux-101 - syselement

  • ๐Ÿ“Œ Use TAB for autocompletion

โžก๏ธ File System

sudo - run commands and tasks as a superuser or another user, with elevated privileges.

sudo <COMMAND>

# Switch to "root" user
sudo su -

pwd - print the current working directory absolute path

pwd

cd - change current working directory

# Change dir to user's home dir
cd

# Change dir to parent dir (one level up)
cd ..

# Change dir
cd /home/user
cd /etc

ls - list current directory contents

mkdir - make a new directory

rmdir - remove a directory

man - manual of a command

echo - display a line of text as output

cat - concatenate files to standard output

> - redirect the output of a command to a file

>> - append the output of a command to a file

rm - delete files/dirs

mv - move/renames files/dirs

cp - copy files and directories

locate - find files by name in a prebuilt database

updatedb - update the locate database

history - show user's history input list

passwd - change user's password

touch - create a new empty file or change existing file timestamp

nano - text editor (other are vi, vim)

mousepad - GUI text editor

โžก๏ธ Users & Permissions

ls -la
  • r - read

  • w - write

  • x - execute

d rwx r-x r-x 2 syselement syselement 4096 Jun 13 15:01 Desktop

  • Permissions

    • 1st character - d / - / l = directory / file / symbolic link

    • 2nd block - owner permissions

    • 3rd block - group permissions

    • 4th block - world permissions

      • - (hyphen) = no permission

  • File hard links - #

  • user

  • group

  • file size (bytes)

  • date

  • file name

chmod - change the mode/permissions of files/dirs

Octal
Decimal
Permission
Representation

000

0 (0+0+0)

No Permission

---

001

1 (0+0+1)

Execute

--x

010

2 (0+2+0)

Write

-w-

011

3 (0+2+1)

Write + Execute

-wx

100

4 (4+0+0)

Read

r--

101

5 (4+0+1)

Read + Execute

r-x

110

6 (4+2+0)

Read + Write

rw-

111

7 (4+2+1)

Read + Write + Execute

rwx

๐Ÿ”— chmod Calculator

adduser - create a new user

su - switch to another user

/etc/passwd - user's list, shell types, etc

/etc/shadow - user's passwords hashes

/etc/sudoers - sudo configuration directives

sudo -l - list user's privileges or check a specific command

โžก๏ธ Network

Network

ip / ifconfig- show/manipulate routing, network devices, interfaces and tunnels

iwconfig - show wireless network interface configuration and status

ARP & Routes

ip n - display the neighbor/ARP table

arp -a - display ARP cache, IP-to-MAC address mapping

ip r - display the IP routing table (destination networks, gateway IP, net interfaces)

route - display/manipulate the IP routing table

ping <IP>

ping - send ICMP ECHO_REQUEST to network hosts, checking network connectivity

netstat / ss - print network connections (e.g. for open ports)

โžก๏ธ Services

service - manipulate services

service

python

python3 -m http.server 80

systemctl

โžก๏ธ Tools

apt update - update the packages list and upgrade installed packages using the APT package manager

apt install - install packages

git - work with Git repository and version control

๐Ÿ”— pimpmykali


Other Tools Install


Bash Scripting & Piping

โžก๏ธ Ping Sweep Script

  • Make a bash script that gathers data from a ping command during a ping sweep network scanning.

grep - print lines that match patterns

Script: Sweep every IP address in a specific subnet network and export only the IPs that respond back.

๐Ÿ”— Github - ipsweep repositories

One liner nmap scan of ips.txt


Last updated

Was this helpful?