Questions tagged [port-scanning]

The act of scanning the ports on a remote computer in a systematic fashion.

The act of scanning the ports on a remote computer in a systematic fashion. By finding ports which are unsecured ("open") port scanning can be used to identify security vulnerabilities on a system. As such, it can be used as a tool both by systems administrators (to find and secure vulnerabilities on their systems), or by attackers (to find vulnerabilities to exploit).

183 questions
39
votes
10 answers

How to check Network port access and display useful message?

I was trying to check whether the port is opened or not using powershell like follows. (new-object Net.Sockets.TcpClient).Connect("10.45.23.109", 443) This method works , but the output is not user-friendly. It means if there are no errors then it…
Samselvaprabu
  • 16,830
  • 32
  • 144
  • 230
35
votes
8 answers

Fastest way to scan ports with Java

I made a very simple port scanner, but it runs too slow, so I'm looking for a way to make it scan faster. Here is my code: public boolean portIsOpen(String ip, int port, int timeout) { try { Socket socket = new Socket(); …
Rohit Malish
  • 3,209
  • 12
  • 49
  • 67
26
votes
2 answers

How to retrieve both TCP and UDP ports with Nmap?

I need to retrieve both TCP and UDP ports in the same scan with Nmap in the fastest way possible. I'll try to explain it better. If I use the most common command: nmap 192.168.1.1 It retrieves ONLY TCP ports and it is really fast. If I use the…
raz3r
  • 3,071
  • 8
  • 44
  • 66
25
votes
2 answers

nmap warning: giving up on port because retransmission cap hit (2)

I am trying to scan a large set of domain names using nmap. I used the following command: Nmap -PN -p443 -sS -T5 -oX out.xml -iL in.csv I get the following warning: Warning: xx.xx.xx.xx giving up on port because retransmission cap hit (2). Why…
Wiliam A
  • 457
  • 3
  • 7
  • 10
9
votes
11 answers

Making a Fast Port Scanner

So I'm making a port scanner in python... import socket ip = "External IP" s = socket.socket(2, 1) #socket.AF_INET, socket.SOCK_STREAM def porttry(ip, port): try: s.connect((ip, port)) return True except: return…
Shane
  • 267
  • 1
  • 5
  • 13
6
votes
1 answer

How to make the process of scanning TCP ports faster?

I'm trying to asynchronously scan TCP ports. Since the open ports take just a few hundredths of milliseconds to complete they're fine, but when ports are closed I have to wait for the response. So what happens is that I run the app and almost right…
NewHelpNeeder
  • 693
  • 1
  • 10
  • 19
6
votes
2 answers

Implementing all portscanning techniques in C# / Creating raw low level packets in C#

I am trying to write a port scanner in C#. I did some research on port scanning methods. If you are interested, these are the links I found useful: http://www.cs.wright.edu/~pmateti/InternetSecurity/Lectures/Probing/index.html ^PPT…
claws
  • 52,236
  • 58
  • 146
  • 195
6
votes
3 answers

Nmap IP range specification

I need to specify specific IP range for Nmap scan, for example: 192.168.1.140 - 192.168.3.255 If I do it like: 192.168.1-3.140-255 IP addresses like 192.168.2.7,192.168.3.7 won't be scanned (only 140-255 in 4th actet).
user2463016
  • 63
  • 1
  • 1
  • 4
5
votes
2 answers

Checking open UDP Port in C++

How can I check if a remote UDP port is open by using native C++? Since UDP is connection-less, calling connect() is not helpful. I cannot try binding it since it is not local. nmap cannot also indicate. (however netstat can find out, but I think it…
Mustafa
  • 10,013
  • 10
  • 70
  • 116
4
votes
1 answer

UDP port scanning Java finds only 1 open UDP port

I have an assigment about port scanning. I am scanning UDP ports of some IP addresses in Java.In my program (assuming everything is OK) I can only find one open UDP port. In the other hands port scanning over "nmap" I get 4 open UDP ports. Can…
snvngrc
  • 177
  • 2
  • 4
  • 12
4
votes
0 answers

Simple TCP scan with Go

I am learning to use Golang to develop hacking tools through Blackhat-Go and port scan scanme.nmap.org on Windows and Linux while doing TCP scanning.Here's my code package main import ( "fmt" "net" "sort" ) func worker(ports, result…
L2ksy0d
  • 83
  • 4
4
votes
1 answer

C# How do I check USB Ports with USB Hub and used Controller?

I am currently trying to scan all USB Ports with their USB Hub (check if it is Root or not) and to which controller they are connectet. To make it more visible: USB Port1 (nothing plugged in) -> USB Hub1 | |-> Controller 1 USB…
Megajin
  • 2,648
  • 2
  • 25
  • 44
4
votes
3 answers

PHP Port Scanning

This may be a duplicate post, BUT I've not seen any answer that correctly resolves this. I'm trying to find a php script that can correctly determine the state of a TCP or UDP port. I've tried several of the ones I've found online and they all…
Rocket
  • 1,065
  • 2
  • 21
  • 44
3
votes
2 answers

Threaded Python port scanner

I am having issues with a port scanner I'm editing to use threads. This is the basics for the original code: for i in range(0, 2000): s = socket(AF_INET, SOCK_STREAM) result = s.connect_ex((TargetIP, i)) if(result == 0) : …
Amnite
  • 221
  • 1
  • 4
  • 9
3
votes
2 answers

Whats the difference between -sS and -PS in nmap?

I was learning how to use nmap and i have gone through many documentations and tutorials but no where iam getting perfect information about what is the use of -sS and -PS. In general what is the differences between all -s 's and -P 's? Both are for…
Revanth Kumar
  • 809
  • 12
  • 18
1
2 3
12 13