+ 2
How can i check if an ip has some ports opened?
i'd like to do it in python
2 Answers
+ 1
In Java you can do it the following way:
[Pseudo Code]
/**Checks an IP for open ports between 0 and 3000**/
for (int port=0; port <= 3000; port++)
try {
Socket(ip,port);
printf("Socket on port" + port + " is open");
}
//if Socket() failed
catch (Exception) {
printf("Socket on port " + port + "is closed");
}
I've actually never done it in python but I hope you got the idea.
GL! :)
0
thanks