Prev | Current Page 221 | Next

Mark D. Spivey

"Practical Hacking Techniques and Countermeasures"


port
Specifies a port number or service name.
676

Practical Hacking Techniques and Countermeasures
Chapter Tool Syntax
Chapter 2
(continued)
Netcat
Connect to somewhere:
nc [-options] hostname port[s]
[ports] ...
Listen for inbound:
nc -l -p port [options] [hostname] [port]
Options
:
-d
Detach from console, background mode.
-e prog
Inbound program to exec [dangerous!].
-g gateway
Source-routing hop point[s], up to 8.
-G num
Source-routing pointer: 4, 8, 12, ...
-h
This cruft.
-i secs
Delay interval for lines sent, ports scanned.
-l
Listen mode, for inbound connects.
-L
Listen harder, re-listen on socket close.
-n
Numeric-only IP addresses, no DNS.
-o file
Hex dump of traffic.
-p port
Local port number.
-r
Randomize local and remote ports.
-s addr
Local source address.
-t
Answer Telnet negotiation.
-u
UDP mode.
-v
Verbose [use twice to be more verbose].
-w secs
Timeout for connects and final net reads.
-z
Zero-I/O mode [used for scanning].
Port numbers can be individual or ranges: m-n [inclusive].
Scanline
sl [-?bhijnprsTUvz]
[-cdgmq ]
[-flLoO ]
[-tu [,-]]
IP[,IP-IP]
Options:
-?
Shows this help text.
-b
Gets port banners.
-c
Timeout for TCP and UDP attempts (ms). Default is 4000.
-d
Delay between scans (ms). Default is 0.
-f
Read IPs from file. Use ???stdin??? for stdin.
-g
Bind to given local port.
-h
Hide results for systems with no open ports.


Pages:
209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233