SlideShare une entreprise Scribd logo
1  sur  51
Network Penetration Testing
Agenda
Network Penetration Testing
• Information gathering
• Port scanning with Nmap
• Vulnerability Assessment with Nessus & OpenVas
• Exploiting Network Services & Web Vulnerabilities
• Privilege Escalation
• Password Cracking with John the Ripper & Hash cat
• Clearing the tracks
Information gathering
• Information gathering requires careful planning, research, and most
importantly, the ability to think like an attacker. At this step, you will attempt to
collect as much information about the target environment as possible.
• There are two types of information gathering: passive and active.
1) Passive information gathering
• Using passive information gathering, you can discover information about targets without
touching their systems.
2) Active information gathering
• In active information gathering, we interact directly with a system to learn more about it.
We might conduct port scans for open ports on the target or conduct scans to determine
what services are running. Each system or running service that we discover gives us another
opportunity for exploitation.
• But beware If you get careless while active information gathering, you might be nabbed by an
IDS or intrusion prevention system (IPS).
Information gathering (Contd.)
Information Gathering in Metasploitable 2
• Since our vulnerable machine running in same network, we can run
netdiscover command to check the IP address of Metasploitable 2
Machine
Port Scanning with Nmap
• Nmap is a network scanner created by Gordon Lyon.
• Nmap is used to discover hosts and services on a computer network by
sending packets and analyzing the responses.
• Nmap provides a number of features for probing computer networks,
including host discovery and service and operating system detection
• Nmap is a command-line network scanner used to detect hosts and
services.
• Zenmap is a GUI version of Nmap.
• Nmap can be used by hackers to gain access to uncontrolled ports on a
system. All a hacker would need to do to successfully get into a targeted
system would be to run Nmap on that system, look for vulnerabilities, and
figure out how to exploit them.
Port Scanning with Nmap (Contd.)
• Target Specification
• Nmap Scan Techniques
• Host Discovery
• Port Specification
• Service and Version Detection
• OS Detection
• Timing and Performance
• Timing and Performance Switches
• NSE Scripts
• Useful NSE Script Examples
• Firewall / IDS Evasion and Spoofing
• Miscellaneous Nmap Flags
Reference link: https://www.stationx.net/nmap-cheat-sheet/
Port Scanning with Nmap (Contd.)
• nmap -p- -sV TargetIP (Scanning for open ports & Service version
details)
Port Scanning with Nmap (Contd.)
• nmap --script vuln -p- TargetIP (Kind of vulnerability Scan)
Vulnerability Assessment with Nessus
In Nessus scanner Interface
• 1) Click on New Scan
• 2) Choose the Scan templates
• 3) I'm choosing Advanced Scan - Scan template
• 4) In Basic -> General -> Give some name & Targets
• 5) In Discovery -> Disable Ping
• 6) In Port Scan -> give Port scan range from 0-65535
• 7) If you have credentials provide the same - depends on operating system
• For Windows authentication -> choose windows
• For Linux authentication -> choose SSH
• 8) In plugins section -> Disable Denial of Service
• 9) Launch the scan
• 10) View the results
• 11) Export the reports as HTML, PDF, CSV Formats
Vulnerability Assessment with Nessus(Contd.)
See the results difference between Unauthenticated & Authenticated scans
Exploiting Network Services & Web Vulnerabilities
FTP – Port 21
• The File Transfer Protocol (FTP) is a standard communication protocol
used for the transfer of computer files from a server to a client on a
computer network.
• FTP is built on a client–server model architecture using separate
control and data connections between the client and the server.
• Usage:
• In Kali terminal - Use FTP Command connect to FTP Server – FTP TargetIP
Exploiting VSFTPD 2.3.4
• Use Searchsploit to find the relevant exploit for vulnerable software
versions
Exploiting VSFTPD 2.3.4 (Contd.)
• msf > use exploit/unix/ftp/vsftpd_234_backdoor
• msf exploit (unix/ftp/vsftpd_234_backdoor) > set rhost TargetIP
• msf exploit (unix/ftp/vsftpd_234_backdoor) > exploit
Brute forcing FTP Login
• hydra -L user.txt -P pass.txt TargetIP ftp
Exploiting Port 22 - SSH
SSH – Port 22
• The Secure Shell Protocol is a cryptographic network protocol for
operating network services securely over an unsecured network.
• Its most notable applications are remote login and command-line
execution.
• SSH applications are based on a client–server architecture,
connecting an SSH client instance with an SSH server.
• Usage:
• Ssh root@TargetIP
Exploiting Port 22 - SSH (Contd.)
Exploiting port 23 - TELNET
TELNET – Port 23
• Telnet is an application protocol used on the Internet or local area
network to provide a bidirectional interactive text-oriented
communication facility using a virtual terminal connection.
• TELNET is commonly used by terminal emulation programs that
allow you to log into a remote host. However, TELNET can also be
used for terminal-to-terminal communication and interprocess
communication. TELNET is also used by other protocols (for example,
FTP) for establishing a protocol control channel.
• Usage: Telnet TargetIP TargetPort
Exploiting port 23 - TELNET (Contd.)
Exploiting port 23 - TELNET (Credential
Capture)
Exploiting port 23 - TELNET (Contd.)
Exploiting Port 25 - SMTP
• SMTP – Port 25
• The Simple Mail Transfer Protocol is an Internet standard communication
protocol for electronic mail transmission.
• Mail servers and other message transfer agents use SMTP to send and
receive mail messages.
• The client who wants to send the mail opens a TCP connection to the
SMTP server and then sends the mail across the connection. The SMTP
server is an always-on listening mode.
• As soon as it listens for a TCP connection from any client, the SMTP
process initiates a connection through port 25. After successfully
establishing a TCP connection the client process sends the mail instantly.
Exploiting Port 25 - SMTP (Contd.)
• smtp-user-enum -M VRFY -U user.txt -t TargetIP
Exploiting Port 80 HTTP
• Port 80 is the port number assigned to commonly used internet
communication protocol, Hypertext Transfer Protocol (HTTP).
• It is the default network port used to send and receive unencrypted
web pages.
• Visit http://metasploitable2IP
• Check for hidden directories & files in webserver
Exploiting Port 80 HTTP (Contd.)
Exploiting Port 80 HTTP (Contd.)
Exploiting Port 139 & 445
• SMB is a network file sharing protocol that requires an open port on
a computer or server to communicate with other systems. SMB
ports are generally port numbers 139 and 445.
• Port 139 is used by SMB dialects that communicate over NetBIOS. It
operates as an application layer network protocol for device
communication in Windows operating systems over a network. For
example, printers and serials ports communicate via Port 139.
• Port 445 is used by newer versions of SMB (after Windows 2000) on
top of a TCP stack, allowing SMB to communicate over the Internet.
This also means you can use IP addresses in order to use SMB like file
sharing.
Exploiting Port 139 & 445 (Contd.)
• Early versions of the SMB protocol were exploited during the WannaCry
ransomware attack through a zero-day exploit called Eternal Blue.
• WannaCry exploited legacy versions of Windows computers that used an
outdated version of the SMB protocol.
• WannaCry is a network worm with a transport mechanism designed to
spread itself automatically. The transport code scans for systems
vulnerable to the Eternal Blue exploit and then installs Double Pulsar, a
backdoor tool, and executes a copy of itself.
• It will then initiate an SMBv1 connection to the device and use buffer
overflow to take control of the system and install the ransomware
component of the attack.
Exploiting Port 139 & 445 (Contd.)
Exploiting Port 5432 - Postgres
• PostgreSQL is used for Adaptive Authentication (TCP).
• Port 5432 is opened for the Postgres database used in the Behavioral
Analytics feature of PCS.
• While scanning, customers may raise queries on 5432 Port as this
port is enabled on the internal interface. However, an attacker
cannot connect to it
• On some default Linux installations of PostgreSQL, the Postgres
service account may write to the /tmp directory and may source
UDF Shared Libraries from there as well, allowing execution of
arbitrary code
Exploiting Port 5432 – Postgres (Contd.)
Exploiting Port 6667 - UnrealIRCD
• UnrealIRCd is an open-source IRC daemon, originally based on
DreamForge, and is available for Unix-like operating systems and
Windows.
• Once users are connected to an IRC server, they can converse with
other users connected to any server in the IRC network
• IRC provides for group communication, via named channels, as well as
personal communication through “private” messages.
• UnrealIRCD backdoor - The remote IRC server is a version of
UnrealIRCD with a backdoor that allows an attacker to execute
arbitrary code on the affected host.
Exploiting Port 6667 - UnrealIRCD
Exploiting Port 36255 - distcc
• Distcc (Daemon Command Execution) is designed to speed up
compilation by taking advantage of unused processing power on
other computers.
• A machine with distcc installed can send code to be compiled across
the network to a computer which has the distccd daemon and a
compatible compiler installed.
• distcc works as an agent for the compiler.
Exploiting Port 36255 – distcc (Contd.)
Remote Login Exploitation
• A remote login is a tool that was used before ssh came into the
picture. Since we have the login credentials for Metasploitable 2, we
will be using Rlogin to connect to it, using the “-l” flag to define the
login name. (rlogin -l msfadmin TargetIP)
Remote Shell Exploitation
• Remote shell Protocol is another way to gain a remote shell, it is a
legitimate service that we will use to access the target machine with
login credentials to run a certain command (rsh -l msfadmin TargetIP
ifconfig)
Exploiting Distributed Ruby (8787)
• Distributed Ruby, also known as dRuby, or DRb, is a distributed object
system for the Ruby programming language that allows for remote
method calls between Ruby processes, even if they are on different
machines. It uses its own protocol and is written entirely in pure
Ruby.
• This makes for a flexible service that developers can use to enhance
certain programs, but it also opens up a security flaw when not
properly implemented, such as in older versions of dRuby.
• Since this is typically used for smaller projects and novice programs,
there usually isn't a lot of concern for security issues.
Exploiting Distributed Ruby (8787)
Bind shell Exploitation – Port 1524
• Metasploitable 2 comes with an open bind shell service running on
port 1524. We will be using Netcat to connect to it.
• nc TargetIP 1524
Exploiting Port 5900 - VNC
• Virtual Network Computing is a graphical desktop-sharing system
that uses the Remote Frame Buffer protocol to remotely control
another computer.
• It transmits the keyboard and mouse input from one computer to
another, relaying the graphical-screen updates, over a network.
• This service can be exploited using a module in Metasploit to find
the login credentials.
Exploiting Port 5900 – VNC (Contd.)
Exploiting Port 8180 - Apache Tomcat
• Apache Tomcat is a free and open-source implementation of the
Jakarta Servlet, Jakarta Expression Language, and Web Socket
technologies.
• It provides a "pure Java" HTTP web server environment in which Java
code can also run.
• Thus it's a Java web application server, although not a full JEE
application server
Exploiting Port 8180 - Apache Tomcat (Contd.)
Exploiting Port 3306 - MYSQL
• The MySQL database in Metasploitable 2 has negligible security, we
will connect to it using the MySQL function of Kali by defining the
username and host IP. The password will be left blank.
Exploiting Web Vulnerabilities
Privilege Escalation via Port 2049: NFS
• In this method, we will be creating an ssh key without a passphrase and
exchanging it with the ssh key of the victim machine for the root user.
• We use ssh-keygen to generate an RSA keypair without a key phrase, then
we place it in the “/root/.ssh” folder where the key is found by default.
Once the key is created and placed, we will create a directory
“/tmp/sshkey/” in our local machine.
• We will be mounting the directory we just made on the victim machine
using the Network File Sharing Function. Once mounted we write the key
from our machine to the victim’s machine, a sort of an override, using the
cat command. The thing to keep in mind here is that the key we have is
without a passphrase so the after the override the key in the victim
machine is also without a passphrase, so when it is connected using ssh,
it’s using a blank password.
Privilege Escalation via Port 2049: NFS
(Contd.)
• showmount -e TargetIP
• ssh-keygen
• mkdir /tmp/sshkey
• mount -t nfs TargetIP:/ /tmp/sshkey/
• cat ~/ .ssh/id_rsa.pub >>/tmp/sshkey/root/.ssh/authorized_keys
• umount /tmp/sshkey
• ssh root@TargetIP
Password Cracking with JTR & Hashcat
• John the Ripper is a free password cracking software tool. Originally
developed for the Unix operating system, it can run on fifteen
different platforms.
• Hashcat is a password recovery tool. It is a open source software.
Examples of Hashcat-supported hashing algorithms are LM hashes,
MD4, MD5, SHA-family and Unix Crypt formats
• Example Hashes:
https://hashcat.net/wiki/doku.php?id=example_hashes
Clearing the tracks
• The final phase of every successful hacking attack is clearing the
tracks.
• It is very important, after gaining access and misusing the network,
that the attacker cover the tracks to avoid being traced and caught.
THANK YOU !

Contenu connexe

Tendances

Tendances (20)

Windows attacks - AT is the new black
Windows attacks - AT is the new blackWindows attacks - AT is the new black
Windows attacks - AT is the new black
 
VAPT PRESENTATION full.pptx
VAPT PRESENTATION full.pptxVAPT PRESENTATION full.pptx
VAPT PRESENTATION full.pptx
 
Penetration Testing Tutorial | Penetration Testing Tools | Cyber Security Tra...
Penetration Testing Tutorial | Penetration Testing Tools | Cyber Security Tra...Penetration Testing Tutorial | Penetration Testing Tools | Cyber Security Tra...
Penetration Testing Tutorial | Penetration Testing Tools | Cyber Security Tra...
 
A Threat Hunter Himself
A Threat Hunter HimselfA Threat Hunter Himself
A Threat Hunter Himself
 
How to Hunt for Lateral Movement on Your Network
How to Hunt for Lateral Movement on Your NetworkHow to Hunt for Lateral Movement on Your Network
How to Hunt for Lateral Movement on Your Network
 
System hacking
System hackingSystem hacking
System hacking
 
VAPT - Vulnerability Assessment & Penetration Testing
VAPT - Vulnerability Assessment & Penetration Testing VAPT - Vulnerability Assessment & Penetration Testing
VAPT - Vulnerability Assessment & Penetration Testing
 
Nmap basics
Nmap basicsNmap basics
Nmap basics
 
NMAP
NMAPNMAP
NMAP
 
Présentation ELK/SIEM et démo Wazuh
Présentation ELK/SIEM et démo WazuhPrésentation ELK/SIEM et démo Wazuh
Présentation ELK/SIEM et démo Wazuh
 
Metasploit
MetasploitMetasploit
Metasploit
 
Ethical Hacking n VAPT presentation by Suvrat jain
Ethical Hacking n VAPT presentation by Suvrat jainEthical Hacking n VAPT presentation by Suvrat jain
Ethical Hacking n VAPT presentation by Suvrat jain
 
Threat hunting 101 by Sandeep Singh
Threat hunting 101 by Sandeep SinghThreat hunting 101 by Sandeep Singh
Threat hunting 101 by Sandeep Singh
 
Analysing Ransomware
Analysing RansomwareAnalysing Ransomware
Analysing Ransomware
 
You can detect PowerShell attacks
You can detect PowerShell attacksYou can detect PowerShell attacks
You can detect PowerShell attacks
 
Metasploit
MetasploitMetasploit
Metasploit
 
Next Generation War: EDR vs RED TEAM
Next Generation War: EDR vs RED TEAMNext Generation War: EDR vs RED TEAM
Next Generation War: EDR vs RED TEAM
 
MITRE ATT&CK Framework
MITRE ATT&CK FrameworkMITRE ATT&CK Framework
MITRE ATT&CK Framework
 
Hunting Lateral Movement in Windows Infrastructure
Hunting Lateral Movement in Windows InfrastructureHunting Lateral Movement in Windows Infrastructure
Hunting Lateral Movement in Windows Infrastructure
 
Recon with Nmap
Recon with Nmap Recon with Nmap
Recon with Nmap
 

Similaire à Network Penetration Testing

Packet Analysis - Course Technology Computing Conference
Packet Analysis - Course Technology Computing ConferencePacket Analysis - Course Technology Computing Conference
Packet Analysis - Course Technology Computing Conference
Cengage Learning
 
modul2-footprintingscanningenumeration.pdf
modul2-footprintingscanningenumeration.pdfmodul2-footprintingscanningenumeration.pdf
modul2-footprintingscanningenumeration.pdf
tehkotak4
 
Client side exploits
Client side exploitsClient side exploits
Client side exploits
nickyt8
 
metaploit framework
metaploit frameworkmetaploit framework
metaploit framework
Le Quyen
 
For your final step, you will synthesize the previous steps and la
For your final step, you will synthesize the previous steps and laFor your final step, you will synthesize the previous steps and la
For your final step, you will synthesize the previous steps and la
ShainaBoling829
 

Similaire à Network Penetration Testing (20)

Nmap project presentation : Unlocking Network Secrets: Mastering Port Scannin...
Nmap project presentation : Unlocking Network Secrets: Mastering Port Scannin...Nmap project presentation : Unlocking Network Secrets: Mastering Port Scannin...
Nmap project presentation : Unlocking Network Secrets: Mastering Port Scannin...
 
Network Scanning Phases and Supporting Tools
Network Scanning Phases and Supporting ToolsNetwork Scanning Phases and Supporting Tools
Network Scanning Phases and Supporting Tools
 
Network scan
Network scanNetwork scan
Network scan
 
Phases of penetration testing
Phases of penetration testingPhases of penetration testing
Phases of penetration testing
 
Chap 1 Network Theory & Java Overview
Chap 1   Network Theory & Java OverviewChap 1   Network Theory & Java Overview
Chap 1 Network Theory & Java Overview
 
Scanning and Enumeration in Cyber Security.pptx
Scanning and Enumeration in Cyber Security.pptxScanning and Enumeration in Cyber Security.pptx
Scanning and Enumeration in Cyber Security.pptx
 
lecture5.pptx
lecture5.pptxlecture5.pptx
lecture5.pptx
 
DC612 Day - Hands on Penetration Testing 101
DC612 Day - Hands on Penetration Testing 101DC612 Day - Hands on Penetration Testing 101
DC612 Day - Hands on Penetration Testing 101
 
Penetration Testing Boot CAMP
Penetration Testing Boot CAMPPenetration Testing Boot CAMP
Penetration Testing Boot CAMP
 
Slide Deck – Session 9 – FRSecure CISSP
Slide Deck – Session 9 – FRSecure CISSP Slide Deck – Session 9 – FRSecure CISSP
Slide Deck – Session 9 – FRSecure CISSP
 
Packet Analysis - Course Technology Computing Conference
Packet Analysis - Course Technology Computing ConferencePacket Analysis - Course Technology Computing Conference
Packet Analysis - Course Technology Computing Conference
 
Modul 2 - Footprinting Scanning Enumeration.ppt
Modul 2 - Footprinting Scanning Enumeration.pptModul 2 - Footprinting Scanning Enumeration.ppt
Modul 2 - Footprinting Scanning Enumeration.ppt
 
modul2-footprintingscanningenumeration.pdf
modul2-footprintingscanningenumeration.pdfmodul2-footprintingscanningenumeration.pdf
modul2-footprintingscanningenumeration.pdf
 
An Toan Thong Tin.pptx
An Toan Thong Tin.pptxAn Toan Thong Tin.pptx
An Toan Thong Tin.pptx
 
Client side exploits
Client side exploitsClient side exploits
Client side exploits
 
metaploit framework
metaploit frameworkmetaploit framework
metaploit framework
 
640-554 IT Certification and Career Paths
640-554 IT Certification and Career Paths640-554 IT Certification and Career Paths
640-554 IT Certification and Career Paths
 
Application Protocol
Application Protocol Application Protocol
Application Protocol
 
For your final step, you will synthesize the previous steps and la
For your final step, you will synthesize the previous steps and laFor your final step, you will synthesize the previous steps and la
For your final step, you will synthesize the previous steps and la
 
Nous Sommes Cyber - HTB Blue
Nous Sommes Cyber - HTB BlueNous Sommes Cyber - HTB Blue
Nous Sommes Cyber - HTB Blue
 

Plus de Mohammed Adam

Plus de Mohammed Adam (20)

Android Penetration Testing - Day 3
Android Penetration Testing - Day 3Android Penetration Testing - Day 3
Android Penetration Testing - Day 3
 
Android Penetration testing - Day 2
 Android Penetration testing - Day 2 Android Penetration testing - Day 2
Android Penetration testing - Day 2
 
Android Penetration Testing - Day 1
Android Penetration Testing - Day 1Android Penetration Testing - Day 1
Android Penetration Testing - Day 1
 
Wireless Penetration Testing
Wireless Penetration TestingWireless Penetration Testing
Wireless Penetration Testing
 
Basic Foundation For Cybersecurity
Basic Foundation For CybersecurityBasic Foundation For Cybersecurity
Basic Foundation For Cybersecurity
 
Golden Ticket Attack - AD - Domain Persistence
Golden Ticket Attack - AD - Domain PersistenceGolden Ticket Attack - AD - Domain Persistence
Golden Ticket Attack - AD - Domain Persistence
 
Evading Antivirus software for fun and profit
Evading Antivirus software for fun and profitEvading Antivirus software for fun and profit
Evading Antivirus software for fun and profit
 
Introduction to Network Fundamentals
Introduction to Network FundamentalsIntroduction to Network Fundamentals
Introduction to Network Fundamentals
 
Breaking out of crypto authentication
Breaking out of crypto authenticationBreaking out of crypto authentication
Breaking out of crypto authentication
 
Cybersecurity Awareness Session by Adam
Cybersecurity Awareness Session by AdamCybersecurity Awareness Session by Adam
Cybersecurity Awareness Session by Adam
 
Career Guidance on Cybersecurity by Mohammed Adam
Career Guidance on Cybersecurity by Mohammed AdamCareer Guidance on Cybersecurity by Mohammed Adam
Career Guidance on Cybersecurity by Mohammed Adam
 
Introduction to null villupuram community
Introduction to null villupuram communityIntroduction to null villupuram community
Introduction to null villupuram community
 
Internet security
Internet securityInternet security
Internet security
 
BugBounty Roadmap with Mohammed Adam
BugBounty Roadmap with Mohammed AdamBugBounty Roadmap with Mohammed Adam
BugBounty Roadmap with Mohammed Adam
 
Webinar On Ethical Hacking & Cybersecurity - Day2
Webinar On Ethical Hacking & Cybersecurity - Day2Webinar On Ethical Hacking & Cybersecurity - Day2
Webinar On Ethical Hacking & Cybersecurity - Day2
 
OSINT - Open Soure Intelligence - Webinar on CyberSecurity
OSINT - Open Soure Intelligence - Webinar on CyberSecurityOSINT - Open Soure Intelligence - Webinar on CyberSecurity
OSINT - Open Soure Intelligence - Webinar on CyberSecurity
 
Android Application Penetration Testing - Mohammed Adam
Android Application Penetration Testing - Mohammed AdamAndroid Application Penetration Testing - Mohammed Adam
Android Application Penetration Testing - Mohammed Adam
 
Vulnerability assessment & Penetration testing Basics
Vulnerability assessment & Penetration testing Basics Vulnerability assessment & Penetration testing Basics
Vulnerability assessment & Penetration testing Basics
 
What is SSL ? The Secure Sockets Layer (SSL) Protocol
What is SSL ? The Secure Sockets Layer (SSL) ProtocolWhat is SSL ? The Secure Sockets Layer (SSL) Protocol
What is SSL ? The Secure Sockets Layer (SSL) Protocol
 
Network Security
Network SecurityNetwork Security
Network Security
 

Dernier

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Dernier (20)

Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 

Network Penetration Testing

  • 2. Agenda Network Penetration Testing • Information gathering • Port scanning with Nmap • Vulnerability Assessment with Nessus & OpenVas • Exploiting Network Services & Web Vulnerabilities • Privilege Escalation • Password Cracking with John the Ripper & Hash cat • Clearing the tracks
  • 3. Information gathering • Information gathering requires careful planning, research, and most importantly, the ability to think like an attacker. At this step, you will attempt to collect as much information about the target environment as possible. • There are two types of information gathering: passive and active. 1) Passive information gathering • Using passive information gathering, you can discover information about targets without touching their systems. 2) Active information gathering • In active information gathering, we interact directly with a system to learn more about it. We might conduct port scans for open ports on the target or conduct scans to determine what services are running. Each system or running service that we discover gives us another opportunity for exploitation. • But beware If you get careless while active information gathering, you might be nabbed by an IDS or intrusion prevention system (IPS).
  • 5. Information Gathering in Metasploitable 2 • Since our vulnerable machine running in same network, we can run netdiscover command to check the IP address of Metasploitable 2 Machine
  • 6. Port Scanning with Nmap • Nmap is a network scanner created by Gordon Lyon. • Nmap is used to discover hosts and services on a computer network by sending packets and analyzing the responses. • Nmap provides a number of features for probing computer networks, including host discovery and service and operating system detection • Nmap is a command-line network scanner used to detect hosts and services. • Zenmap is a GUI version of Nmap. • Nmap can be used by hackers to gain access to uncontrolled ports on a system. All a hacker would need to do to successfully get into a targeted system would be to run Nmap on that system, look for vulnerabilities, and figure out how to exploit them.
  • 7. Port Scanning with Nmap (Contd.) • Target Specification • Nmap Scan Techniques • Host Discovery • Port Specification • Service and Version Detection • OS Detection • Timing and Performance • Timing and Performance Switches • NSE Scripts • Useful NSE Script Examples • Firewall / IDS Evasion and Spoofing • Miscellaneous Nmap Flags Reference link: https://www.stationx.net/nmap-cheat-sheet/
  • 8. Port Scanning with Nmap (Contd.) • nmap -p- -sV TargetIP (Scanning for open ports & Service version details)
  • 9. Port Scanning with Nmap (Contd.) • nmap --script vuln -p- TargetIP (Kind of vulnerability Scan)
  • 10. Vulnerability Assessment with Nessus In Nessus scanner Interface • 1) Click on New Scan • 2) Choose the Scan templates • 3) I'm choosing Advanced Scan - Scan template • 4) In Basic -> General -> Give some name & Targets • 5) In Discovery -> Disable Ping • 6) In Port Scan -> give Port scan range from 0-65535 • 7) If you have credentials provide the same - depends on operating system • For Windows authentication -> choose windows • For Linux authentication -> choose SSH • 8) In plugins section -> Disable Denial of Service • 9) Launch the scan • 10) View the results • 11) Export the reports as HTML, PDF, CSV Formats
  • 11. Vulnerability Assessment with Nessus(Contd.) See the results difference between Unauthenticated & Authenticated scans
  • 12. Exploiting Network Services & Web Vulnerabilities FTP – Port 21 • The File Transfer Protocol (FTP) is a standard communication protocol used for the transfer of computer files from a server to a client on a computer network. • FTP is built on a client–server model architecture using separate control and data connections between the client and the server. • Usage: • In Kali terminal - Use FTP Command connect to FTP Server – FTP TargetIP
  • 13. Exploiting VSFTPD 2.3.4 • Use Searchsploit to find the relevant exploit for vulnerable software versions
  • 14. Exploiting VSFTPD 2.3.4 (Contd.) • msf > use exploit/unix/ftp/vsftpd_234_backdoor • msf exploit (unix/ftp/vsftpd_234_backdoor) > set rhost TargetIP • msf exploit (unix/ftp/vsftpd_234_backdoor) > exploit
  • 15. Brute forcing FTP Login • hydra -L user.txt -P pass.txt TargetIP ftp
  • 16. Exploiting Port 22 - SSH SSH – Port 22 • The Secure Shell Protocol is a cryptographic network protocol for operating network services securely over an unsecured network. • Its most notable applications are remote login and command-line execution. • SSH applications are based on a client–server architecture, connecting an SSH client instance with an SSH server. • Usage: • Ssh root@TargetIP
  • 17. Exploiting Port 22 - SSH (Contd.)
  • 18. Exploiting port 23 - TELNET TELNET – Port 23 • Telnet is an application protocol used on the Internet or local area network to provide a bidirectional interactive text-oriented communication facility using a virtual terminal connection. • TELNET is commonly used by terminal emulation programs that allow you to log into a remote host. However, TELNET can also be used for terminal-to-terminal communication and interprocess communication. TELNET is also used by other protocols (for example, FTP) for establishing a protocol control channel. • Usage: Telnet TargetIP TargetPort
  • 19. Exploiting port 23 - TELNET (Contd.)
  • 20. Exploiting port 23 - TELNET (Credential Capture)
  • 21. Exploiting port 23 - TELNET (Contd.)
  • 22. Exploiting Port 25 - SMTP • SMTP – Port 25 • The Simple Mail Transfer Protocol is an Internet standard communication protocol for electronic mail transmission. • Mail servers and other message transfer agents use SMTP to send and receive mail messages. • The client who wants to send the mail opens a TCP connection to the SMTP server and then sends the mail across the connection. The SMTP server is an always-on listening mode. • As soon as it listens for a TCP connection from any client, the SMTP process initiates a connection through port 25. After successfully establishing a TCP connection the client process sends the mail instantly.
  • 23. Exploiting Port 25 - SMTP (Contd.) • smtp-user-enum -M VRFY -U user.txt -t TargetIP
  • 24. Exploiting Port 80 HTTP • Port 80 is the port number assigned to commonly used internet communication protocol, Hypertext Transfer Protocol (HTTP). • It is the default network port used to send and receive unencrypted web pages. • Visit http://metasploitable2IP • Check for hidden directories & files in webserver
  • 25. Exploiting Port 80 HTTP (Contd.)
  • 26. Exploiting Port 80 HTTP (Contd.)
  • 27. Exploiting Port 139 & 445 • SMB is a network file sharing protocol that requires an open port on a computer or server to communicate with other systems. SMB ports are generally port numbers 139 and 445. • Port 139 is used by SMB dialects that communicate over NetBIOS. It operates as an application layer network protocol for device communication in Windows operating systems over a network. For example, printers and serials ports communicate via Port 139. • Port 445 is used by newer versions of SMB (after Windows 2000) on top of a TCP stack, allowing SMB to communicate over the Internet. This also means you can use IP addresses in order to use SMB like file sharing.
  • 28. Exploiting Port 139 & 445 (Contd.) • Early versions of the SMB protocol were exploited during the WannaCry ransomware attack through a zero-day exploit called Eternal Blue. • WannaCry exploited legacy versions of Windows computers that used an outdated version of the SMB protocol. • WannaCry is a network worm with a transport mechanism designed to spread itself automatically. The transport code scans for systems vulnerable to the Eternal Blue exploit and then installs Double Pulsar, a backdoor tool, and executes a copy of itself. • It will then initiate an SMBv1 connection to the device and use buffer overflow to take control of the system and install the ransomware component of the attack.
  • 29. Exploiting Port 139 & 445 (Contd.)
  • 30. Exploiting Port 5432 - Postgres • PostgreSQL is used for Adaptive Authentication (TCP). • Port 5432 is opened for the Postgres database used in the Behavioral Analytics feature of PCS. • While scanning, customers may raise queries on 5432 Port as this port is enabled on the internal interface. However, an attacker cannot connect to it • On some default Linux installations of PostgreSQL, the Postgres service account may write to the /tmp directory and may source UDF Shared Libraries from there as well, allowing execution of arbitrary code
  • 31. Exploiting Port 5432 – Postgres (Contd.)
  • 32. Exploiting Port 6667 - UnrealIRCD • UnrealIRCd is an open-source IRC daemon, originally based on DreamForge, and is available for Unix-like operating systems and Windows. • Once users are connected to an IRC server, they can converse with other users connected to any server in the IRC network • IRC provides for group communication, via named channels, as well as personal communication through “private” messages. • UnrealIRCD backdoor - The remote IRC server is a version of UnrealIRCD with a backdoor that allows an attacker to execute arbitrary code on the affected host.
  • 33. Exploiting Port 6667 - UnrealIRCD
  • 34. Exploiting Port 36255 - distcc • Distcc (Daemon Command Execution) is designed to speed up compilation by taking advantage of unused processing power on other computers. • A machine with distcc installed can send code to be compiled across the network to a computer which has the distccd daemon and a compatible compiler installed. • distcc works as an agent for the compiler.
  • 35. Exploiting Port 36255 – distcc (Contd.)
  • 36. Remote Login Exploitation • A remote login is a tool that was used before ssh came into the picture. Since we have the login credentials for Metasploitable 2, we will be using Rlogin to connect to it, using the “-l” flag to define the login name. (rlogin -l msfadmin TargetIP)
  • 37. Remote Shell Exploitation • Remote shell Protocol is another way to gain a remote shell, it is a legitimate service that we will use to access the target machine with login credentials to run a certain command (rsh -l msfadmin TargetIP ifconfig)
  • 38. Exploiting Distributed Ruby (8787) • Distributed Ruby, also known as dRuby, or DRb, is a distributed object system for the Ruby programming language that allows for remote method calls between Ruby processes, even if they are on different machines. It uses its own protocol and is written entirely in pure Ruby. • This makes for a flexible service that developers can use to enhance certain programs, but it also opens up a security flaw when not properly implemented, such as in older versions of dRuby. • Since this is typically used for smaller projects and novice programs, there usually isn't a lot of concern for security issues.
  • 40. Bind shell Exploitation – Port 1524 • Metasploitable 2 comes with an open bind shell service running on port 1524. We will be using Netcat to connect to it. • nc TargetIP 1524
  • 41. Exploiting Port 5900 - VNC • Virtual Network Computing is a graphical desktop-sharing system that uses the Remote Frame Buffer protocol to remotely control another computer. • It transmits the keyboard and mouse input from one computer to another, relaying the graphical-screen updates, over a network. • This service can be exploited using a module in Metasploit to find the login credentials.
  • 42. Exploiting Port 5900 – VNC (Contd.)
  • 43. Exploiting Port 8180 - Apache Tomcat • Apache Tomcat is a free and open-source implementation of the Jakarta Servlet, Jakarta Expression Language, and Web Socket technologies. • It provides a "pure Java" HTTP web server environment in which Java code can also run. • Thus it's a Java web application server, although not a full JEE application server
  • 44. Exploiting Port 8180 - Apache Tomcat (Contd.)
  • 45. Exploiting Port 3306 - MYSQL • The MySQL database in Metasploitable 2 has negligible security, we will connect to it using the MySQL function of Kali by defining the username and host IP. The password will be left blank.
  • 47. Privilege Escalation via Port 2049: NFS • In this method, we will be creating an ssh key without a passphrase and exchanging it with the ssh key of the victim machine for the root user. • We use ssh-keygen to generate an RSA keypair without a key phrase, then we place it in the “/root/.ssh” folder where the key is found by default. Once the key is created and placed, we will create a directory “/tmp/sshkey/” in our local machine. • We will be mounting the directory we just made on the victim machine using the Network File Sharing Function. Once mounted we write the key from our machine to the victim’s machine, a sort of an override, using the cat command. The thing to keep in mind here is that the key we have is without a passphrase so the after the override the key in the victim machine is also without a passphrase, so when it is connected using ssh, it’s using a blank password.
  • 48. Privilege Escalation via Port 2049: NFS (Contd.) • showmount -e TargetIP • ssh-keygen • mkdir /tmp/sshkey • mount -t nfs TargetIP:/ /tmp/sshkey/ • cat ~/ .ssh/id_rsa.pub >>/tmp/sshkey/root/.ssh/authorized_keys • umount /tmp/sshkey • ssh root@TargetIP
  • 49. Password Cracking with JTR & Hashcat • John the Ripper is a free password cracking software tool. Originally developed for the Unix operating system, it can run on fifteen different platforms. • Hashcat is a password recovery tool. It is a open source software. Examples of Hashcat-supported hashing algorithms are LM hashes, MD4, MD5, SHA-family and Unix Crypt formats • Example Hashes: https://hashcat.net/wiki/doku.php?id=example_hashes
  • 50. Clearing the tracks • The final phase of every successful hacking attack is clearing the tracks. • It is very important, after gaining access and misusing the network, that the attacker cover the tracks to avoid being traced and caught.