How To Create Your Own Port Scanner | Ruby

preview_player
Показать описание
#Source code
#Simple port scanner
require 'socket'
require 'timeout'
print "IP/Address : "

ports = 19..25 #You can select ports manually, if you wanted to scan ports from 1 to 10 type "1..10"
begin
rescue
puts "closed : #{scan}"
else
puts "open : #{scan}"
end
end
#-----------------------------------------
If you have any problems or a question feel free to contact me

This program was written in Ruby
Рекомендации по теме
Комментарии
Автор

It works but it's very slow, thank you so much! :D

uwuster
Автор

Hi, if you want their program to work better change Timeout::timeout(10){TCPSocket.new("#{ip}", scan)} to Timeout::timeout(0.1){TCPSocket.new("#{ip}", scan)} and ports = 19..25 to ports = 1..65535
I tried that on mine and it made it go a lot faster and more thorough.
I know that it works because it said ports 80 and 443 were open.

uwuster
Автор

Haha cool I love ruby. you can do anything with that language.

luissantiago
Автор

thanks really helped, clever coding. :)

coolguy-fmdy