fast_port_scanner 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: aabddbdb47855a6134882f489a197da60261caa2
4
+ data.tar.gz: 1f30f3ed821854168665f743172bd1def747a094
5
+ SHA512:
6
+ metadata.gz: ef666a3885151ae46623a9f6fbf37b9d53d2d5d256125d32d64e275f3bdfea0254e9908d2dcee882c686c25e6b0269aff0b4adf9e9f37434b31aaa8efd839089
7
+ data.tar.gz: 96c9a7890ca39c4be43d18908714d0c1f84311e47e3ba840105b97524977bb0f6f814001a650f01d7067f30c984fb99dbbe4bfe5cc385b1bf34743c2eb374a2c
@@ -0,0 +1 @@
1
+ x<�G��hR�?�br����v�~�ۨ�؄�$'�<��_��/OeZ�a[#@���!�u���r��K���!:#����P���A��z(�?'�˱�9�?2cT0z�1�Dz��h�"^R��襻��&w������C�Ѽ���OrwW���xd4�W$]��oz㪀��כ��9,׏�ȸ8�+���n��
@@ -0,0 +1,2 @@
1
+ ��)�H$��n�q@[&��M�؃�����\��~*�������nK�th��'�@�A\���B���H�G)�#d.3�d�0����Fu�R�����N���6n��%ά��$"q��v��:ry���|��*+�q<�sI�=I� �tg<�����j�˛B=�4�ڝ����I��b��&��s�
2
+ ��5^�=��GȈ{��6�`��݀�W����CҊ��n���Y?� �?Q��{�V~�`�t��ܴ6���mz�3
@@ -0,0 +1,44 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # file: fast_port_scanner.rb
4
+
5
+ require 'socket'
6
+ require 'timeout'
7
+
8
+
9
+ class FastPortScanner
10
+
11
+ def self.scan(ip='127.0.0.1', ports: 1..1000, wait: 1.25)
12
+
13
+ a = []
14
+
15
+ ports.map do |port|
16
+
17
+ Thread.new do
18
+
19
+ begin
20
+ Timeout::timeout(1){TCPSocket.new(ip, port)}
21
+ rescue
22
+ #puts "closed : #{port}"
23
+ else
24
+ #puts "open : #{port}"
25
+ a << port
26
+ end
27
+
28
+ end
29
+
30
+ end.join
31
+
32
+ sleep wait
33
+
34
+ @to_a = a.sort
35
+
36
+ end
37
+
38
+ end
39
+
40
+ if __FILE__ == $0 then
41
+
42
+ a = FastPortScanner.scan
43
+
44
+ end
metadata ADDED
@@ -0,0 +1,67 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: fast_port_scanner
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - James Robertson
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain:
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIDljCCAn6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBIMRIwEAYDVQQDDAlnZW1t
14
+ YXN0ZXIxHjAcBgoJkiaJk/IsZAEZFg5qYW1lc3JvYmVydHNvbjESMBAGCgmSJomT
15
+ 8ixkARkWAmV1MB4XDTE2MDYxNDE3MTg0OVoXDTE3MDYxNDE3MTg0OVowSDESMBAG
16
+ A1UEAwwJZ2VtbWFzdGVyMR4wHAYKCZImiZPyLGQBGRYOamFtZXNyb2JlcnRzb24x
17
+ EjAQBgoJkiaJk/IsZAEZFgJldTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
18
+ ggEBAN/GzcBuulwiP3uuUuXTUcrZyd4RYSheEAwU44WLp7uhjhYNT0Rg4tEklxrk
19
+ Og8Yq0ZVEYuw4ddHlabfQ/67iiqLpx/fmuMGEDayRQlGYHDXQ7M1Saaf3GDyDsw6
20
+ zN8ROS6NKLSqmm8a95w/c+Pj4pX5jjRoSX/oub7wHoc16awyxqRPPsgvdGRy9ar6
21
+ 9qY4vME+iWNJts7KkQD94BbTHFqE588fkSzRXSR81MSHw0+qnwct47UgngvVLf55
22
+ UKG/1f3LL5ZMwTvcJze1AcXA5Nest2hb/IKJKSvqDFVg5kQ4y5jf+iVvf0BJNsVN
23
+ HvGVlh9P+PM7DPIslnst/Q1g53UCAwEAAaOBijCBhzAJBgNVHRMEAjAAMAsGA1Ud
24
+ DwQEAwIEsDAdBgNVHQ4EFgQUdjn31wK0uGLAgXFhPT8P8293iLkwJgYDVR0RBB8w
25
+ HYEbZ2VtbWFzdGVyQGphbWVzcm9iZXJ0c29uLmV1MCYGA1UdEgQfMB2BG2dlbW1h
26
+ c3RlckBqYW1lc3JvYmVydHNvbi5ldTANBgkqhkiG9w0BAQUFAAOCAQEApJUk+5TU
27
+ xbEfzD4el8WH0aue7SnXHz0dAk+EqSYt7KOTXB0Rglha3ih1JT2x5pC4+CKWi/Dt
28
+ xrT7bnXHnddF8x8A0j5MHrCQe5ngrTqYxoBjk0oyAM0It/y/skYiZTjambZeioQ6
29
+ IIaYAeGbXcr2EYXnoMgOBVL401nD49uT+PXUsYA9QooUeAc33gDbGb0kVQMjbjJ1
30
+ Ls3Gzdmq5pQJ0COYRvEo1Bu5YtjckD4mtE2cdyshQzAaLWe2D+ekbdY2eyP5C8/F
31
+ bt8FV5j5T8lbqflmZR5fxvOH/BKoctM5vpxrndjozBi7g7k8c+sv38azm4gViifr
32
+ 4aAmgGCUj3BFnQ==
33
+ -----END CERTIFICATE-----
34
+ date: 2016-06-14 00:00:00.000000000 Z
35
+ dependencies: []
36
+ description:
37
+ email: james@r0bertson.co.uk
38
+ executables: []
39
+ extensions: []
40
+ extra_rdoc_files: []
41
+ files:
42
+ - lib/fast_port_scanner.rb
43
+ homepage: https://github.com/jrobertson/fast_port_scanner
44
+ licenses:
45
+ - MIT
46
+ metadata: {}
47
+ post_install_message:
48
+ rdoc_options: []
49
+ require_paths:
50
+ - lib
51
+ required_ruby_version: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ required_rubygems_version: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ requirements: []
62
+ rubyforge_project:
63
+ rubygems_version: 2.5.1
64
+ signing_key:
65
+ specification_version: 4
66
+ summary: A fast and simple port scanner which uses TCPSocket, Timeout, and threads.
67
+ test_files: []
Binary file