Jump to content

Ruby Port Scanner. Works With Droid


i8igmac
 Share

Recommended Posts

Install irb on your droid. It's just a quick scanner I use for discovering services on my network... When I need to find my ftp server or rdp... No need to root your device...

Example: nmap -p 135,139,445,5900,8080,80,21,22 192.168.1.1-255

 require 'socket'

Thread.start{
for ip in 1..255
for port in [135,139,445,5900,80,8080,21,22]
Thread.start{ 
begin
  t = TCPSocket.open("192.168.1.#{ip.to_s}", port) 

rescue  
print "e"
else
t.close
puts""
puts "#{ip}:#{port} open ports!!!"

end}
sleep 0.1
end
end
}

Notes, if it crashes irb, set the sleep to 0.2 or higher. Your phone is limited on threads

The ip address must look like this*

"192.169.1.#{ip.to_s} "

"192.168.#{ip.to_s}.1"

"xxx.#{ip.to_s}.x.x"

"#{ip.to_s}.66.66.66"

You can add more ports,

Edited by i8igmac
Link to comment
Share on other sites

  • 1 month later...

Neat little script! Thanks for sharing it. It works great on my Thunderbolt running CM7.

Install irb on your droid. It's just a quick scanner I use for discovering services on my network... When I need to find my ftp server or rdp... No need to root your device...

Example: nmap -p 135,139,445,5900,8080,80,21,22 192.168.1.1-255

 require 'socket'

Thread.start{
for ip in 1..255
for port in [135,139,445,5900,80,8080,21,22]
Thread.start{ 
begin
  t = TCPSocket.open("192.168.1.#{ip.to_s}", port) 

rescue  
print "e"
else
t.close
puts""
puts "#{ip}:#{port} open ports!!!"

end}
sleep 0.1
end
end
}

Notes, if it crashes irb, set the sleep to 0.2 or higher. Your phone is limited on threads

The ip address must look like this*

"192.169.1.#{ip.to_s} "

"192.168.#{ip.to_s}.1"

"xxx.#{ip.to_s}.x.x"

"#{ip.to_s}.66.66.66"

You can add more ports,

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...