SlideShare a Scribd company logo
Port Scanning Prabhaker Mateti
Port scanning Attackers wish to discover services they can break into. Security audit: Why are certain ports open? sending a packet to each port, one at a time. Based on the type of response, an attacker knows if the port is used. The used ports can be probed further for weakness.
Port Numbers An abstraction of the OS + Net Stds 16-bit unsigned integer Well Known Ports (0 .. 1023) Registered Ports (1024 .. 49151) Dynamic and/or Private Ports (49152 .. 65535).  http:// www.iana.org /assignments/ port-numbers
Socket calls for connection-oriented communication socket() bind() listen() read() close() socket() connect() read() write() close() blocks until server receives a connect request from client data data Server Client accept() write() connect negotiation
socket() bind() sendto() close() socket() bind() recvfrom() sendto() close() blocks until server receives data from client data data Server Client recvfrom() Socket calls for connectionless communication
Well Known: 0 - 1023 Only root-privileged progs are allowed to open the ports. Examples ftp-data 20/udp ftp 21/tcp ssh 22/tcp telnet 23/tcp Time 37/tcp Time 37/udp Whois 43/tcp Imap 143/tcp
Registered: 1024 ..49151 Ordinary programs can use these shockwave2 1257/tcp Shockwave 2 shockwave2 1257/udp Shockwave 2  x11 6000-6063/tcp X Window System x11 6000-6063/udp X Window System
Dynamic/Private: 49152 .. 65535 Ordinary programs can use these
TCP connect(0) scanning Try connect()-ing to every port If the port is listening, connect() will be succeed. Otherwise, the port isn’t reachable. No need for any special privileges. Any user can use it. Speed - slow. Attacker can be logged/ identified.
TCP SYN scanning Often referred to as half-open scanning. Send a SYN packet Wait for a response. A SYN/ACK indicates the port is listening. If a SYN/ACK is received, send an RST to tear down the connection immediately.  Most sites do not log these. Need root privileges to build SYN packets.
TCP FIN Scanning Send a FIN packet (without a preceding SYN etc.) FIN packets may pass through firewalls Closed ports reply with RST. Open ports ignore the FIN packet. Some hosts violate RFC. Reply with RST’s regardless of the port state Thus, are not vulnerable to this scan.
TCP reverse identd scanning identd  protocol (rfc1413):  disclose the username of the owner of any process  connected via TCP, even if that process didn’t initiate the connection. Example: connect to the http port (80), and then use identd to find out whether the server is running as root. Must have full TCP connection to the port.
Fragmentation scanning Not a new scanning method in and of itself. A modification of other techniques. Split the probe packet into IP fragments. By splitting up the TCP header over several packets, it is harder for packet filters to detect a probe.
FTP Bounce Scan Take advantage of a vulnerability of FTP protocol. Requires support for proxy ftp connections. For example, evil.com can establish a control communication connection to FTP server-PI (protocol interpreter) of target.com. Then it is able to request the server-PI to initiate an active server-DTP (data transfer process) to send a file anywhere on the Internet.
Bounce Scan A port scanner can exploit this to scan TCP ports form a proxy ftp server. Connect to an FTP server behind a firewall, and then scan ports that are more likely to be blocked. If the ftp server allows reading from and writing to a directory (such as /incoming), you can send arbitrary data to ports that you do find open.
FTP Bounce Use the PORT command (of FTP) to declare that our passive user-DTP is listening on the target box at a certain port number. LIST the current directory, and the results is sent over the server-DTP channel. If our target host is listening on the port, the transfer will be successful. Otherwise, connection will be refused. Then issue another PORT command to try the next port on the target.
FTP Bounce Advantages Harder to trace Potential to bypass firewalls. Disadvantages Slow Many FTP servers have (finally) disabled the proxy feature.
UDP Scans UDP is simpler, but the scanning is more difficult Open ports do not have to send an  ACK. Closed ports are not  required  to send an error packet. Most hosts send an ICMP_PORT_UNREACH error when you send a packet to a closed UDP port. Can find out if a port is NOT open.
UDP Scans Neither UDP packets, nor the ICMP errors are guaranteed to arrive. Slow: the ICMP error message rate is limited. Need to be root for access to raw ICMP socket. Non-root users  cannot read port unreachable errors directly.
UDP Scans But users can learn it indirectly. For example, a second write() call to a closed port will usually fail. recvfrom() on non-blocking UDP sockets usually return EAGAIN (try again), if the ICMP error hasn’t been received. It will return ECONNREFUSED (connection refuse), if ICMP error has been received.
Stealth Scan Simple port scanning can be easily logged by the services listening at the ports. E.g. they see an incoming connection with no data, thus they log an error. Stealth scan refers to scanning techniques that can avoid being logged. These techniques include fragmented packets, SYN scanning, FIN scanning etc.
Stealth Scan Scan slowly A port scanner typically scans a host too rapidly Some detectors recognize these “signatures”. So, scanning very slowly (e.g., over several days) is a stealth technique. Firing packets with fake IPs Flood with spoofed  scans and embed one scan from the real source (network) address.
Signatures of a port scan Several packets to different destination ports from the same source within a “short period” of time.  SYN to a non-listening port
Detection of Port Scanning Open a socket SOCK_RAW mode. protocol type IPPROTO_IP recvfrom() to capture the packets Discovering stealth scans requires kernel level work. A detector can inform us that we have been port-scanned, but the source address may have been spoofed.
Scanner Leaks If the packets we received have an IP TTL of 255, we can conclude that it was sent from or local network, regardless of what the source address field says. if TTL is 250, we can only tell that the attacker was no more than 5 hops away.
References Ron Gula, How to Handle and Identify Network Probes, April 1999,  www.securitywizards.com  [ Local Copy ] Required Reading.  Hobbit ,  The FTP Bounce Attack,   http:// www.insecure.org/nmap /  hobbit.ftpbounce.txt  The original paper on the subject. Reference.  Fyodor, Remote OS detection via TCP/IP Stack Finger Printing. Written: October 18, 1998 Last Modified: April 10, 1999.  http://www.insecure.org/nmap/nmap-fingerprinting-article.html    Required Reading.  Solar Designer, Designing and Attacking Port Scan Detection Tools, Phrack Magazine, Volume 8, Issue 53, July 8, 1998, article 13 of 15,   www.phrack.com  .  Recommended Reading.  ZoneAlarm (download free for personal use from  http:// www.zonelabs.com / ) that can detect port scans.  Try this on your own home network of Windows PCs.
Ad

More Related Content

What's hot (20)

Ch 5: Port Scanning
Ch 5: Port ScanningCh 5: Port Scanning
Ch 5: Port Scanning
Sam Bowne
 
Port scanning
Port scanningPort scanning
Port scanning
Hemanth Pasumarthi
 
Firewall and Types of firewall
Firewall and Types of firewallFirewall and Types of firewall
Firewall and Types of firewall
Coder Tech
 
Introduction to penetration testing
Introduction to penetration testingIntroduction to penetration testing
Introduction to penetration testing
Nezar Alazzabi
 
Network Security Fundamentals
Network Security FundamentalsNetwork Security Fundamentals
Network Security Fundamentals
Rahmat Suhatman
 
Active and Passive Network Attacks
Active and Passive Network AttacksActive and Passive Network Attacks
Active and Passive Network Attacks
Pradipta Poudel
 
Understanding NMAP
Understanding NMAPUnderstanding NMAP
Understanding NMAP
Phannarith Ou, G-CISO
 
Metasploit
MetasploitMetasploit
Metasploit
henelpj
 
Session Hijacking
Session HijackingSession Hijacking
Session Hijacking
n|u - The Open Security Community
 
Proxy
ProxyProxy
Proxy
Triad Square InfoSec
 
Arp spoofing
Arp spoofingArp spoofing
Arp spoofing
Luthfi Widyanto
 
Network Attacks and Countermeasures
Network Attacks and CountermeasuresNetwork Attacks and Countermeasures
Network Attacks and Countermeasures
karanwayne
 
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
MahdiHasanSowrav
 
Arpspoofing
ArpspoofingArpspoofing
Arpspoofing
UTD Computer Security Group
 
Cross Site Scripting ( XSS)
Cross Site Scripting ( XSS)Cross Site Scripting ( XSS)
Cross Site Scripting ( XSS)
Amit Tyagi
 
Secure Socket Layer
Secure Socket LayerSecure Socket Layer
Secure Socket Layer
Naveen Kumar
 
Firewall in Network Security
Firewall in Network SecurityFirewall in Network Security
Firewall in Network Security
lalithambiga kamaraj
 
Web Application Penetration Testing
Web Application Penetration Testing Web Application Penetration Testing
Web Application Penetration Testing
Priyanka Aash
 
Port scanning
Port scanningPort scanning
Port scanning
Hemanth Pasumarthi
 
Firewalls and packet filters
Firewalls and packet filtersFirewalls and packet filters
Firewalls and packet filters
MOHIT AGARWAL
 

Viewers also liked (20)

Network scanning
Network scanningNetwork scanning
Network scanning
oceanofwebs
 
Port Scanning Overview
Port Scanning  OverviewPort Scanning  Overview
Port Scanning Overview
Publicly traded global multi-billion services company
 
Ceh v5 module 07 sniffers
Ceh v5 module 07 sniffersCeh v5 module 07 sniffers
Ceh v5 module 07 sniffers
Vi Tính Hoàng Nam
 
File Transfer protocols
File Transfer protocolsFile Transfer protocols
File Transfer protocols
Aayushi Pareek
 
Nmap(network mapping)
Nmap(network mapping)Nmap(network mapping)
Nmap(network mapping)
SSASIT
 
File transfer protocol
File transfer protocolFile transfer protocol
File transfer protocol
Milind Swane
 
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
Ravi Rajput
 
Nmap Basics
Nmap BasicsNmap Basics
Nmap Basics
amiable_indian
 
Nmap
NmapNmap
Nmap
Fat-Thing Gabriel-Culley
 
N map presentation
N map presentationN map presentation
N map presentation
ulirraptor
 
Nmap(network mapping)
Nmap(network mapping)Nmap(network mapping)
Nmap(network mapping)
shwetha mk
 
Dynamic Port Scanning
Dynamic Port ScanningDynamic Port Scanning
Dynamic Port Scanning
amiable_indian
 
Hacking With Nmap - Scanning Techniques
Hacking With Nmap - Scanning TechniquesHacking With Nmap - Scanning Techniques
Hacking With Nmap - Scanning Techniques
amiable_indian
 
Nmap 9 truth "Nothing to say any more"
Nmap 9 truth "Nothing to say  any more"Nmap 9 truth "Nothing to say  any more"
Nmap 9 truth "Nothing to say any more"
abend_cve_9999_0001
 
Configuring Access & Trunk Ports
Configuring Access & Trunk PortsConfiguring Access & Trunk Ports
Configuring Access & Trunk Ports
NetProtocol Xpert
 
Sandboxing in .NET CLR
Sandboxing in .NET CLRSandboxing in .NET CLR
Sandboxing in .NET CLR
Mikhail Shcherbakov
 
Hack In Paris 2011 - Practical Sandboxing
Hack In Paris 2011 - Practical SandboxingHack In Paris 2011 - Practical Sandboxing
Hack In Paris 2011 - Practical Sandboxing
Tom Keetch
 
Secure and Simple Sandboxing in SELinux
Secure and Simple Sandboxing in SELinuxSecure and Simple Sandboxing in SELinux
Secure and Simple Sandboxing in SELinux
James Morris
 
Ethical hacking Chapter 6 - Port Scanning - Eric Vanderburg
Ethical hacking   Chapter 6 - Port Scanning - Eric VanderburgEthical hacking   Chapter 6 - Port Scanning - Eric Vanderburg
Ethical hacking Chapter 6 - Port Scanning - Eric Vanderburg
Eric Vanderburg
 
7 5-94-101
7 5-94-1017 5-94-101
7 5-94-101
Naveen J Setty
 
Network scanning
Network scanningNetwork scanning
Network scanning
oceanofwebs
 
File Transfer protocols
File Transfer protocolsFile Transfer protocols
File Transfer protocols
Aayushi Pareek
 
Nmap(network mapping)
Nmap(network mapping)Nmap(network mapping)
Nmap(network mapping)
SSASIT
 
File transfer protocol
File transfer protocolFile transfer protocol
File transfer protocol
Milind Swane
 
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
Ravi Rajput
 
N map presentation
N map presentationN map presentation
N map presentation
ulirraptor
 
Nmap(network mapping)
Nmap(network mapping)Nmap(network mapping)
Nmap(network mapping)
shwetha mk
 
Hacking With Nmap - Scanning Techniques
Hacking With Nmap - Scanning TechniquesHacking With Nmap - Scanning Techniques
Hacking With Nmap - Scanning Techniques
amiable_indian
 
Nmap 9 truth "Nothing to say any more"
Nmap 9 truth "Nothing to say  any more"Nmap 9 truth "Nothing to say  any more"
Nmap 9 truth "Nothing to say any more"
abend_cve_9999_0001
 
Configuring Access & Trunk Ports
Configuring Access & Trunk PortsConfiguring Access & Trunk Ports
Configuring Access & Trunk Ports
NetProtocol Xpert
 
Hack In Paris 2011 - Practical Sandboxing
Hack In Paris 2011 - Practical SandboxingHack In Paris 2011 - Practical Sandboxing
Hack In Paris 2011 - Practical Sandboxing
Tom Keetch
 
Secure and Simple Sandboxing in SELinux
Secure and Simple Sandboxing in SELinuxSecure and Simple Sandboxing in SELinux
Secure and Simple Sandboxing in SELinux
James Morris
 
Ethical hacking Chapter 6 - Port Scanning - Eric Vanderburg
Ethical hacking   Chapter 6 - Port Scanning - Eric VanderburgEthical hacking   Chapter 6 - Port Scanning - Eric Vanderburg
Ethical hacking Chapter 6 - Port Scanning - Eric Vanderburg
Eric Vanderburg
 
Ad

Similar to Port Scanning (20)

Module 3 Scanning
Module 3   ScanningModule 3   Scanning
Module 3 Scanning
leminhvuong
 
Node finder presentation
Node finder presentationNode finder presentation
Node finder presentation
Varun Varshney
 
Port Scanning in computer networks with .ppt
Port Scanning in computer networks with .pptPort Scanning in computer networks with .ppt
Port Scanning in computer networks with .ppt
imranahmadrana28
 
01204427-scanner.ppt
01204427-scanner.ppt01204427-scanner.ppt
01204427-scanner.ppt
VarunBehere1
 
Scanning
ScanningScanning
Scanning
Ashok kumar sandhyala
 
Best!
Best!Best!
Best!
gofortution
 
Tcp Ip Overview
Tcp Ip OverviewTcp Ip Overview
Tcp Ip Overview
Amir Malik
 
transport protocols
transport protocolstransport protocols
transport protocols
keerthigakeerthigaD
 
packet sniffing with Wireshark and its implementation.pptx
packet sniffing with Wireshark and its implementation.pptxpacket sniffing with Wireshark and its implementation.pptx
packet sniffing with Wireshark and its implementation.pptx
RohitAhuja58
 
Firewall - Network Defense in Depth Firewalls
Firewall - Network Defense in Depth FirewallsFirewall - Network Defense in Depth Firewalls
Firewall - Network Defense in Depth Firewalls
phanleson
 
Attacks and their mitigations
Attacks and their mitigationsAttacks and their mitigations
Attacks and their mitigations
Mukesh Chaudhari
 
Network Scanning refers to the set of procedures adopted for identifying a ne...
Network Scanning refers to the set of procedures adopted for identifying a ne...Network Scanning refers to the set of procedures adopted for identifying a ne...
Network Scanning refers to the set of procedures adopted for identifying a ne...
MarkoKustro
 
Exploiting Network Protocols To Exhaust Bandwidth Links 2008 Final
Exploiting Network Protocols To Exhaust Bandwidth Links 2008 FinalExploiting Network Protocols To Exhaust Bandwidth Links 2008 Final
Exploiting Network Protocols To Exhaust Bandwidth Links 2008 Final
masoodnt10
 
How to Leverage Go for Your Networking Needs
How to Leverage Go for Your Networking NeedsHow to Leverage Go for Your Networking Needs
How to Leverage Go for Your Networking Needs
DigitalOcean
 
Tcpip
TcpipTcpip
Tcpip
julien pauli
 
Firewall
FirewallFirewall
Firewall
Manikyala Rao
 
12 tcp-dns
12 tcp-dns12 tcp-dns
12 tcp-dns
Culverton Blessy
 
Hacking Cisco
Hacking CiscoHacking Cisco
Hacking Cisco
guestd05b31
 
Packet sniffingin switch lans
Packet sniffingin switch lansPacket sniffingin switch lans
Packet sniffingin switch lans
Encarnación Marín Caballero
 
Layer Two ( 2 ) Security of Cisco switch
Layer Two ( 2 )  Security  of  Cisco switchLayer Two ( 2 )  Security  of  Cisco switch
Layer Two ( 2 ) Security of Cisco switch
ssuserb1479b
 
Module 3 Scanning
Module 3   ScanningModule 3   Scanning
Module 3 Scanning
leminhvuong
 
Node finder presentation
Node finder presentationNode finder presentation
Node finder presentation
Varun Varshney
 
Port Scanning in computer networks with .ppt
Port Scanning in computer networks with .pptPort Scanning in computer networks with .ppt
Port Scanning in computer networks with .ppt
imranahmadrana28
 
01204427-scanner.ppt
01204427-scanner.ppt01204427-scanner.ppt
01204427-scanner.ppt
VarunBehere1
 
Tcp Ip Overview
Tcp Ip OverviewTcp Ip Overview
Tcp Ip Overview
Amir Malik
 
packet sniffing with Wireshark and its implementation.pptx
packet sniffing with Wireshark and its implementation.pptxpacket sniffing with Wireshark and its implementation.pptx
packet sniffing with Wireshark and its implementation.pptx
RohitAhuja58
 
Firewall - Network Defense in Depth Firewalls
Firewall - Network Defense in Depth FirewallsFirewall - Network Defense in Depth Firewalls
Firewall - Network Defense in Depth Firewalls
phanleson
 
Attacks and their mitigations
Attacks and their mitigationsAttacks and their mitigations
Attacks and their mitigations
Mukesh Chaudhari
 
Network Scanning refers to the set of procedures adopted for identifying a ne...
Network Scanning refers to the set of procedures adopted for identifying a ne...Network Scanning refers to the set of procedures adopted for identifying a ne...
Network Scanning refers to the set of procedures adopted for identifying a ne...
MarkoKustro
 
Exploiting Network Protocols To Exhaust Bandwidth Links 2008 Final
Exploiting Network Protocols To Exhaust Bandwidth Links 2008 FinalExploiting Network Protocols To Exhaust Bandwidth Links 2008 Final
Exploiting Network Protocols To Exhaust Bandwidth Links 2008 Final
masoodnt10
 
How to Leverage Go for Your Networking Needs
How to Leverage Go for Your Networking NeedsHow to Leverage Go for Your Networking Needs
How to Leverage Go for Your Networking Needs
DigitalOcean
 
Layer Two ( 2 ) Security of Cisco switch
Layer Two ( 2 )  Security  of  Cisco switchLayer Two ( 2 )  Security  of  Cisco switch
Layer Two ( 2 ) Security of Cisco switch
ssuserb1479b
 
Ad

More from amiable_indian (20)

Phishing As Tragedy of the Commons
Phishing As Tragedy of the CommonsPhishing As Tragedy of the Commons
Phishing As Tragedy of the Commons
amiable_indian
 
Cisco IOS Attack & Defense - The State of the Art
Cisco IOS Attack & Defense - The State of the Art Cisco IOS Attack & Defense - The State of the Art
Cisco IOS Attack & Defense - The State of the Art
amiable_indian
 
Secrets of Top Pentesters
Secrets of Top PentestersSecrets of Top Pentesters
Secrets of Top Pentesters
amiable_indian
 
Workshop on Wireless Security
Workshop on Wireless SecurityWorkshop on Wireless Security
Workshop on Wireless Security
amiable_indian
 
Insecure Implementation of Security Best Practices: of hashing, CAPTCHA's and...
Insecure Implementation of Security Best Practices: of hashing, CAPTCHA's and...Insecure Implementation of Security Best Practices: of hashing, CAPTCHA's and...
Insecure Implementation of Security Best Practices: of hashing, CAPTCHA's and...
amiable_indian
 
Workshop on BackTrack live CD
Workshop on BackTrack live CDWorkshop on BackTrack live CD
Workshop on BackTrack live CD
amiable_indian
 
Reverse Engineering for exploit writers
Reverse Engineering for exploit writersReverse Engineering for exploit writers
Reverse Engineering for exploit writers
amiable_indian
 
State of Cyber Law in India
State of Cyber Law in IndiaState of Cyber Law in India
State of Cyber Law in India
amiable_indian
 
AntiSpam - Understanding the good, the bad and the ugly
AntiSpam - Understanding the good, the bad and the uglyAntiSpam - Understanding the good, the bad and the ugly
AntiSpam - Understanding the good, the bad and the ugly
amiable_indian
 
Reverse Engineering v/s Secure Coding
Reverse Engineering v/s Secure CodingReverse Engineering v/s Secure Coding
Reverse Engineering v/s Secure Coding
amiable_indian
 
Network Vulnerability Assessments: Lessons Learned
Network Vulnerability Assessments: Lessons LearnedNetwork Vulnerability Assessments: Lessons Learned
Network Vulnerability Assessments: Lessons Learned
amiable_indian
 
Economic offenses through Credit Card Frauds Dissected
Economic offenses through Credit Card Frauds DissectedEconomic offenses through Credit Card Frauds Dissected
Economic offenses through Credit Card Frauds Dissected
amiable_indian
 
Immune IT: Moving from Security to Immunity
Immune IT: Moving from Security to ImmunityImmune IT: Moving from Security to Immunity
Immune IT: Moving from Security to Immunity
amiable_indian
 
Reverse Engineering for exploit writers
Reverse Engineering for exploit writersReverse Engineering for exploit writers
Reverse Engineering for exploit writers
amiable_indian
 
Hacking Client Side Insecurities
Hacking Client Side InsecuritiesHacking Client Side Insecurities
Hacking Client Side Insecurities
amiable_indian
 
Web Exploit Finder Presentation
Web Exploit Finder PresentationWeb Exploit Finder Presentation
Web Exploit Finder Presentation
amiable_indian
 
Network Security Data Visualization
Network Security Data VisualizationNetwork Security Data Visualization
Network Security Data Visualization
amiable_indian
 
Enhancing Computer Security via End-to-End Communication Visualization
Enhancing Computer Security via End-to-End Communication Visualization Enhancing Computer Security via End-to-End Communication Visualization
Enhancing Computer Security via End-to-End Communication Visualization
amiable_indian
 
Top Network Vulnerabilities Over Time
Top Network Vulnerabilities Over TimeTop Network Vulnerabilities Over Time
Top Network Vulnerabilities Over Time
amiable_indian
 
What are the Business Security Metrics?
What are the Business Security Metrics? What are the Business Security Metrics?
What are the Business Security Metrics?
amiable_indian
 
Phishing As Tragedy of the Commons
Phishing As Tragedy of the CommonsPhishing As Tragedy of the Commons
Phishing As Tragedy of the Commons
amiable_indian
 
Cisco IOS Attack & Defense - The State of the Art
Cisco IOS Attack & Defense - The State of the Art Cisco IOS Attack & Defense - The State of the Art
Cisco IOS Attack & Defense - The State of the Art
amiable_indian
 
Secrets of Top Pentesters
Secrets of Top PentestersSecrets of Top Pentesters
Secrets of Top Pentesters
amiable_indian
 
Workshop on Wireless Security
Workshop on Wireless SecurityWorkshop on Wireless Security
Workshop on Wireless Security
amiable_indian
 
Insecure Implementation of Security Best Practices: of hashing, CAPTCHA's and...
Insecure Implementation of Security Best Practices: of hashing, CAPTCHA's and...Insecure Implementation of Security Best Practices: of hashing, CAPTCHA's and...
Insecure Implementation of Security Best Practices: of hashing, CAPTCHA's and...
amiable_indian
 
Workshop on BackTrack live CD
Workshop on BackTrack live CDWorkshop on BackTrack live CD
Workshop on BackTrack live CD
amiable_indian
 
Reverse Engineering for exploit writers
Reverse Engineering for exploit writersReverse Engineering for exploit writers
Reverse Engineering for exploit writers
amiable_indian
 
State of Cyber Law in India
State of Cyber Law in IndiaState of Cyber Law in India
State of Cyber Law in India
amiable_indian
 
AntiSpam - Understanding the good, the bad and the ugly
AntiSpam - Understanding the good, the bad and the uglyAntiSpam - Understanding the good, the bad and the ugly
AntiSpam - Understanding the good, the bad and the ugly
amiable_indian
 
Reverse Engineering v/s Secure Coding
Reverse Engineering v/s Secure CodingReverse Engineering v/s Secure Coding
Reverse Engineering v/s Secure Coding
amiable_indian
 
Network Vulnerability Assessments: Lessons Learned
Network Vulnerability Assessments: Lessons LearnedNetwork Vulnerability Assessments: Lessons Learned
Network Vulnerability Assessments: Lessons Learned
amiable_indian
 
Economic offenses through Credit Card Frauds Dissected
Economic offenses through Credit Card Frauds DissectedEconomic offenses through Credit Card Frauds Dissected
Economic offenses through Credit Card Frauds Dissected
amiable_indian
 
Immune IT: Moving from Security to Immunity
Immune IT: Moving from Security to ImmunityImmune IT: Moving from Security to Immunity
Immune IT: Moving from Security to Immunity
amiable_indian
 
Reverse Engineering for exploit writers
Reverse Engineering for exploit writersReverse Engineering for exploit writers
Reverse Engineering for exploit writers
amiable_indian
 
Hacking Client Side Insecurities
Hacking Client Side InsecuritiesHacking Client Side Insecurities
Hacking Client Side Insecurities
amiable_indian
 
Web Exploit Finder Presentation
Web Exploit Finder PresentationWeb Exploit Finder Presentation
Web Exploit Finder Presentation
amiable_indian
 
Network Security Data Visualization
Network Security Data VisualizationNetwork Security Data Visualization
Network Security Data Visualization
amiable_indian
 
Enhancing Computer Security via End-to-End Communication Visualization
Enhancing Computer Security via End-to-End Communication Visualization Enhancing Computer Security via End-to-End Communication Visualization
Enhancing Computer Security via End-to-End Communication Visualization
amiable_indian
 
Top Network Vulnerabilities Over Time
Top Network Vulnerabilities Over TimeTop Network Vulnerabilities Over Time
Top Network Vulnerabilities Over Time
amiable_indian
 
What are the Business Security Metrics?
What are the Business Security Metrics? What are the Business Security Metrics?
What are the Business Security Metrics?
amiable_indian
 

Recently uploaded (20)

Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 

Port Scanning

  • 2. Port scanning Attackers wish to discover services they can break into. Security audit: Why are certain ports open? sending a packet to each port, one at a time. Based on the type of response, an attacker knows if the port is used. The used ports can be probed further for weakness.
  • 3. Port Numbers An abstraction of the OS + Net Stds 16-bit unsigned integer Well Known Ports (0 .. 1023) Registered Ports (1024 .. 49151) Dynamic and/or Private Ports (49152 .. 65535). http:// www.iana.org /assignments/ port-numbers
  • 4. Socket calls for connection-oriented communication socket() bind() listen() read() close() socket() connect() read() write() close() blocks until server receives a connect request from client data data Server Client accept() write() connect negotiation
  • 5. socket() bind() sendto() close() socket() bind() recvfrom() sendto() close() blocks until server receives data from client data data Server Client recvfrom() Socket calls for connectionless communication
  • 6. Well Known: 0 - 1023 Only root-privileged progs are allowed to open the ports. Examples ftp-data 20/udp ftp 21/tcp ssh 22/tcp telnet 23/tcp Time 37/tcp Time 37/udp Whois 43/tcp Imap 143/tcp
  • 7. Registered: 1024 ..49151 Ordinary programs can use these shockwave2 1257/tcp Shockwave 2 shockwave2 1257/udp Shockwave 2 x11 6000-6063/tcp X Window System x11 6000-6063/udp X Window System
  • 8. Dynamic/Private: 49152 .. 65535 Ordinary programs can use these
  • 9. TCP connect(0) scanning Try connect()-ing to every port If the port is listening, connect() will be succeed. Otherwise, the port isn’t reachable. No need for any special privileges. Any user can use it. Speed - slow. Attacker can be logged/ identified.
  • 10. TCP SYN scanning Often referred to as half-open scanning. Send a SYN packet Wait for a response. A SYN/ACK indicates the port is listening. If a SYN/ACK is received, send an RST to tear down the connection immediately. Most sites do not log these. Need root privileges to build SYN packets.
  • 11. TCP FIN Scanning Send a FIN packet (without a preceding SYN etc.) FIN packets may pass through firewalls Closed ports reply with RST. Open ports ignore the FIN packet. Some hosts violate RFC. Reply with RST’s regardless of the port state Thus, are not vulnerable to this scan.
  • 12. TCP reverse identd scanning identd protocol (rfc1413): disclose the username of the owner of any process connected via TCP, even if that process didn’t initiate the connection. Example: connect to the http port (80), and then use identd to find out whether the server is running as root. Must have full TCP connection to the port.
  • 13. Fragmentation scanning Not a new scanning method in and of itself. A modification of other techniques. Split the probe packet into IP fragments. By splitting up the TCP header over several packets, it is harder for packet filters to detect a probe.
  • 14. FTP Bounce Scan Take advantage of a vulnerability of FTP protocol. Requires support for proxy ftp connections. For example, evil.com can establish a control communication connection to FTP server-PI (protocol interpreter) of target.com. Then it is able to request the server-PI to initiate an active server-DTP (data transfer process) to send a file anywhere on the Internet.
  • 15. Bounce Scan A port scanner can exploit this to scan TCP ports form a proxy ftp server. Connect to an FTP server behind a firewall, and then scan ports that are more likely to be blocked. If the ftp server allows reading from and writing to a directory (such as /incoming), you can send arbitrary data to ports that you do find open.
  • 16. FTP Bounce Use the PORT command (of FTP) to declare that our passive user-DTP is listening on the target box at a certain port number. LIST the current directory, and the results is sent over the server-DTP channel. If our target host is listening on the port, the transfer will be successful. Otherwise, connection will be refused. Then issue another PORT command to try the next port on the target.
  • 17. FTP Bounce Advantages Harder to trace Potential to bypass firewalls. Disadvantages Slow Many FTP servers have (finally) disabled the proxy feature.
  • 18. UDP Scans UDP is simpler, but the scanning is more difficult Open ports do not have to send an ACK. Closed ports are not required to send an error packet. Most hosts send an ICMP_PORT_UNREACH error when you send a packet to a closed UDP port. Can find out if a port is NOT open.
  • 19. UDP Scans Neither UDP packets, nor the ICMP errors are guaranteed to arrive. Slow: the ICMP error message rate is limited. Need to be root for access to raw ICMP socket. Non-root users cannot read port unreachable errors directly.
  • 20. UDP Scans But users can learn it indirectly. For example, a second write() call to a closed port will usually fail. recvfrom() on non-blocking UDP sockets usually return EAGAIN (try again), if the ICMP error hasn’t been received. It will return ECONNREFUSED (connection refuse), if ICMP error has been received.
  • 21. Stealth Scan Simple port scanning can be easily logged by the services listening at the ports. E.g. they see an incoming connection with no data, thus they log an error. Stealth scan refers to scanning techniques that can avoid being logged. These techniques include fragmented packets, SYN scanning, FIN scanning etc.
  • 22. Stealth Scan Scan slowly A port scanner typically scans a host too rapidly Some detectors recognize these “signatures”. So, scanning very slowly (e.g., over several days) is a stealth technique. Firing packets with fake IPs Flood with spoofed scans and embed one scan from the real source (network) address.
  • 23. Signatures of a port scan Several packets to different destination ports from the same source within a “short period” of time. SYN to a non-listening port
  • 24. Detection of Port Scanning Open a socket SOCK_RAW mode. protocol type IPPROTO_IP recvfrom() to capture the packets Discovering stealth scans requires kernel level work. A detector can inform us that we have been port-scanned, but the source address may have been spoofed.
  • 25. Scanner Leaks If the packets we received have an IP TTL of 255, we can conclude that it was sent from or local network, regardless of what the source address field says. if TTL is 250, we can only tell that the attacker was no more than 5 hops away.
  • 26. References Ron Gula, How to Handle and Identify Network Probes, April 1999, www.securitywizards.com [ Local Copy ] Required Reading. Hobbit , The FTP Bounce Attack,  http:// www.insecure.org/nmap / hobbit.ftpbounce.txt The original paper on the subject. Reference. Fyodor, Remote OS detection via TCP/IP Stack Finger Printing. Written: October 18, 1998 Last Modified: April 10, 1999. http://www.insecure.org/nmap/nmap-fingerprinting-article.html    Required Reading. Solar Designer, Designing and Attacking Port Scan Detection Tools, Phrack Magazine, Volume 8, Issue 53, July 8, 1998, article 13 of 15,  www.phrack.com .  Recommended Reading. ZoneAlarm (download free for personal use from http:// www.zonelabs.com / ) that can detect port scans.  Try this on your own home network of Windows PCs.