Which NetCat option specifies the local port to use?

Study for the SANS560 GIAC Penetration Tester (GPEN) Test. Study with flashcards and multiple choice questions, each question has hints and explanations. Get ready for your exam!

Multiple Choice

Which NetCat option specifies the local port to use?

Explanation:
You can control the local source port in NetCat with the -p option. This lets you force the port that your outgoing connection will originate from, which is useful when firewall rules or intrusion-detection systems expect traffic from a specific port or when you’re testing how a service responds to connections from a particular source port. For example, to connect to a target on port 80 using local port 4444, you would specify -p 4444 along with the destination and remote port. The other options serve different purposes: -e runs a program after connecting, -z enables zero-I/O mode for scanning, and -n disables DNS resolution.

You can control the local source port in NetCat with the -p option. This lets you force the port that your outgoing connection will originate from, which is useful when firewall rules or intrusion-detection systems expect traffic from a specific port or when you’re testing how a service responds to connections from a particular source port. For example, to connect to a target on port 80 using local port 4444, you would specify -p 4444 along with the destination and remote port. The other options serve different purposes: -e runs a program after connecting, -z enables zero-I/O mode for scanning, and -n disables DNS resolution.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy