Penetration Testing Slides
Penetration Testing Slides
</ Introduction To
Penetration } /> [
Testing />
If you get caught for doing so, NYP Infosec will not be
responsible for your actions!
So please, please. Think before you act.
{02} {05}
Scanning Maintaining Access
{03} {06}
Enumeration Privilege Escalation
</>
Introduction 01
} /> [
1011 011 01 1011001 10 11011 011 01 110110 110111 1101
</ What is penetration testing?
“ A penetration test, also known as a pen test, is a
simulated cyberattack against your computer system to
check for exploitable vulnerabilities. ”
- Imperva
hacker>
</>
Scanning 02
} /> [
1011 011 01 1011001 10 11011 011 01 110110 110111 1101
Scanning and Reconnaissance
● Reconnaissance is also known as information gathering. It involves unauthorized discovery and mapping of
systems, services, or vulnerabilities. This data can be used for planning and executing successful attack.
! Make sure you have permission before you scan a system you do not own. !
! Make sure you have permission before you scan a system you do not own. !
○ nc: netcat
○ -v: verbose mode
● smbclient command:
smbclient -U '%' -N \\\\<IP>\\<SHARE> # session to connect to a share
smbclient -U '<USER>' \\\\<IP>\\<SHARE> # authenticated session (you will be prompted for
password)
</>
Enumeration 03
} /> [
1011 011 01 1011001 10 11011 011 01 110110 110111 1101
What is Web Enumeration?
During service scanning, you often run into servers in port 80 and 443, but what
are they?
● These web applications usually give opportunities for the perpetrator to attack.
we will be focusing on the directory (and file) bruteforcing modes specified with the
switch dir
Results:
● Wordpress installation was identified at /wordpress
● visiting http://10.10.10.121/wordpress reveals that WordPress is still in setup
mode, which will allow us to gain remote code execution (RCE) on the server
Seclist: GitHub repository, which contains many useful lists for fuzzing and
exploitation
● Whatweb: Command-line tool that can extract the version of web servers,
supporting frameworks, and applications can also automate enumeration
processes
</>
Exploit 04
} /> [
1011 011 01 1011001 10 11011 011 01 110110 110111 1101
Metasploit Framework
(MSF)
Public exploits can be found for web applications and other applications running on
ports, like SSH or FTP.
We can use this to search for public vulnerabilities/exploits for any application. We can
install it using the following command:
</>
Maintaining
Access
05
} /> [
1011 011 01 1011001 10 11011 011 01 110110 110111 1101
What is a Shell?
Shell is a program that passes commands Inputted by users to the Operating System to
perform specific functions
Used to be the only interface that allows users to interact with systems
“Getting a shell”:
- Attackers have gained access to the shell of the victim’s system, allowing the
attackers to run any command on the system as if they were the host.
Bind Shell "Binds" to a specific port on the target host and waits for a connection from our attack’s system.
Web Shell Runs operating system commands via the web browser, typically not
interactive or semi-interactive.
With the listener inplace, attackers can execute a reverse shell command to
establish a remote connection between the attacker and the victim’s system and
shell.
First step is to choose the Port to -n Disable DNS resolution and only
connect from/to IPs, to speed up the
“listen” too connection.
The attacker can now execute commands and get the output back directly, right in
their machine
-Unlike Reverse Shell, attackers can connect to a bind shell even when connection is
loss.
-However if the victim’s system is rebooted or the Bind Shell Command is stopped,
access to the Bind Shell will be loss and the entire process will have to start over again.
For a Netcat connection, the TTY can be updated using Python and
STTY(SetTeleTYpewriter:Changes terminal/TTY settings) code.
Apache /var/www/html/
This allows the script to be executed through
the web browser Nginx /usr/local/nginx/html/
IIS c:\inetpub\wwwroot\
There are the different default webroots for
various web servers XAMPP C:\xampp\htdocs\
Web Shells are powerful as it bypasses the victim's firewalls by using already open
ports like port 80 and port 443 rather than accessing new ones
Web shells will remain connected even after the Hosts system reboots
</>
Privilege
Escalation
06
} /> [
1011 011 01 1011001 10 11011 011 01 110110 110111 1101
Priv Esc
● First Access is usually low level privilege user
access, unable to have full control
● Privilege Escalation would enable higher
privileges, to execute commands or get data
● Root user in Linux, administrator/SYSTEM on
Windows
LinPEAS
Vulnerable Software
Using the previous steps, you can find vulnerable software we can use to priv esc
Example the Sudo version on the internet leads to CVE-2021-3156: Heap-Based Buffer Overflow in Sudo which can allow
priv esc
</
Thanks! } /> [
Quiz Time!
/>
CREDITS: This presentation template was created by
Slidesgo, and includes icons by Flaticon, and infographics
& images by Freepik