soba3kofta-shamshama 0.0.0.pre28 → 0.0.0.pre29
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/soba3kofta-shamshama/base.rb +1 -1
- data/lib/soba3kofta-shamshama/scan.rb +25 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ebee30d547340e72d58c71d2f90b241ead369a95
|
4
|
+
data.tar.gz: 758f90616b24bdce796c4222ef18618af9d3fe63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a9419fdf0b3d6be1c1d71c856873ab8ce969910201ea6e9915ad44aaad4c3fa86e5f745327ac6472f8f824a0b314b72f4e3735ea6fb5ae49f697016b50e9eca
|
7
|
+
data.tar.gz: c81320d0427a21fcac71232ac686d99a8701fe48e0209464934d7bf1a4d4eeeeb068c77b0dceb4376b1792af737b3fa44b8ff7893ed8a5c26612d58f73d3fd0a
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'socket' #socket library
|
2
|
+
@open_ports = []
|
3
|
+
def open_port(host, port)
|
4
|
+
p "Trying #{port} on #{host}"
|
5
|
+
sock = Socket.new(:INET, :STREAM)
|
6
|
+
raw = Socket.sockaddr_in(port, host)
|
7
|
+
if sock.connect(raw)
|
8
|
+
puts "#{port} open." #if sock.connect(raw)
|
9
|
+
@open_ports << port
|
10
|
+
end
|
11
|
+
rescue (Errno::ECONNREFUSED)
|
12
|
+
rescue(Errno::ETIMEDOUT)
|
13
|
+
end
|
14
|
+
|
15
|
+
def main(host, start_port, end_port)
|
16
|
+
threads = (start_port..end_port).map do |i|
|
17
|
+
Thread.new(i) do |i|
|
18
|
+
open_port(host, i)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
threads.each {|t| t.join;}
|
22
|
+
p "#################### #{@open_ports} #####################"
|
23
|
+
end
|
24
|
+
|
25
|
+
main ARGV[0], ARGV[1].to_i, ARGV[2].to_i
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: soba3kofta-shamshama
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.0.
|
4
|
+
version: 0.0.0.pre29
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- theotherstupidguy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: shamshama
|
14
14
|
email:
|
@@ -19,6 +19,7 @@ extra_rdoc_files: []
|
|
19
19
|
files:
|
20
20
|
- lib/soba3kofta-shamshama.rb
|
21
21
|
- lib/soba3kofta-shamshama/base.rb
|
22
|
+
- lib/soba3kofta-shamshama/scan.rb
|
22
23
|
homepage: https://github.com/theotherstupidguy/soba3kofta-shamshama
|
23
24
|
licenses:
|
24
25
|
- MIT
|