[C] Test for open ports globally 09-15-2020, 05:44 PM
#1
This came up in a discord chat, and I wrote up a sample program to check nearly all of the IPv4 range for machines that respond on port 22 within 250ms. I figured that I'd share it here for you guys.
It is crude, but should be a good starting point for anyone wanting to do something similar.
https://pastebin.com/kBJ5b8P2
Code (in case the pastebin link disappears in the future)
Based on my calculations, this would take about a month to sweep through it. Multithreading could be an option, but you'd need to modify the timeout code.
Hope you enjoy.
It is crude, but should be a good starting point for anyone wanting to do something similar.
https://pastebin.com/kBJ5b8P2
Code (in case the pastebin link disappears in the future)
Spoiler:
Based on my calculations, this would take about a month to sweep through it. Multithreading could be an option, but you'd need to modify the timeout code.
Hope you enjoy.