Security Report Lab3
Security Report Lab3
Nmap -sn: The nmap -sn command is used to perform a "Ping Scan" in
Nmap. Specifically, it sends ICMP Echo Request (ping) packets to discover
live hosts on the network without scanning ports.
Find / -type f -name flag.txt: The command find / -type f -name flag.txt
is used in Linux to search for files named "flag.txt" within the entire
filesystem starting from the root directory (/). Here's a breakdown of the
command and its components:
● find: This is the command used to search for files and directories
within a specified directory hierarchy.
● /: This specifies the starting point of the search, which is the root
directory of the filesystem. All directories and subdirectories under the
root directory will be recursively searched.
● -type f: This option specifies that only regular files should be
considered in the search. It filters out directories, symbolic links,
device files, sockets, and other types of special files, focusing only on
regular files.
● -name flag.txt: This option specifies the name of the file to search
for. In this case, it looks for files with the exact name "flag.txt". The
search is case-sensitive, so only files named "flag.txt" (not "Flag.txt"
or "FLAG.TXT", for example) will be matched.
When you run this command, find will traverse the entire filesystem starting
from the root directory (/). It will recursively search through all directories
and subdirectories, looking for files named "flag.txt". Once it finds matching
files, it will print out the full paths to those files.
cat <file directory>: The cat command in Linux is used to display the
contents of a file on the terminal. When used with the <file directory>
argument, it will display the contents of the specified file.
Here's a breakdown of how to use the cat command and its components:
Then the nmap tool is used to discover all devices on the network as
shown in the image below.
OS scan is performed using nmap for the other 3 ip addresses to
determine which is the ip address of the target Vm.
IP address of my laptop
In this case 3 ports host a web page which are ports (80,443,631)
according to the nmap aggressive scan which was performed on the target
Vm.
In this case 1 port only hosts a database which is port 3306 and the
database type is mysql according to the nmap aggressive scan which was
performed on the target Vm.
Part 2
SQL Injection as the login page interacts with a database to authenticate users, it
may be vulnerable to SQL injection attacks. Attackers can manipulate input fields
to inject SQL queries, potentially bypassing authentication or accessing sensitive
information.
2. Provide and explain three techniques that you can use to conduct
the exploit. Your explanation should include the theoretical aspect of
the exploit.
3. Which one of those three did you practically use? Your explanation
should include any assumptions you have made, in addition to
screenshots to show how you managed to successfully execute it.
I used sql injection to bypass the login page by typing( ‘or 1=1 -- - ) in the
username and password fields. This string resembles a SQL injection
payload commonly used to bypass authentication mechanisms in web
applications.
First using 1st hint which I found in the tags stating that I should perform
enumeration I used the dirb command to get the 2nd hint which was a
webpage written beside it hack me I opened the url then found the 2nd hint
2nd hint
After searching I decided to use sql injection as explained and mentioned
above to bypass the login page.
Part 3
1. By the end of this part, you should obtain a shell on your Kali Linux
machine that can execute commands remotely as you have seen in
the tutorial.
As shown in the image below this is the command that I have used in the
mystery page to obtain a shell on my kali linux that can execute commands
remotely but, before it I typed in the kali linux command prompt this
command to let kali linux listen on a certain port (nc -nvlp 12345).
The mystery page is used to ping the ip address that you type
3. What is the application layer vulnerability that is present in the
mystery page?
1. Theoretical Aspect:
● Command line injection exploits vulnerabilities in applications
that execute shell commands using user-controlled input. By
injecting malicious commands into input fields or parameters
that are subsequently passed to the underlying operating
system's shell for execution. The injected commands can
include shell commands, system commands, or even chained
commands.
2. Exploit Technique:
● We exploited command line injection vulnerabilities by injecting
specially crafted commands into the input field accepted by the
vulnerable mystery page which made us gain access and
execute commands remotely as shown in the images below
Part 4
Cat /etc/passwd command is used to show all other users with their
privileges as shown in the image below.
3. Which of these users have the lowest privileges and which is the
highest?
In the /etc/passwd file, each line represents a user account and contains
several fields separated by colons (:). The third field typically represents
the numeric user ID (UID), which can be used to determine the relative
privilege level. Generally, lower UID values indicate higher privilege levels,
with 0 reserved for the root user (superuser).
5. You have to mention the command that you used to reach the flag
file and if you searched for it manually you have to support your
answer with screenshots.