pwn 0.4.472 → 0.4.475

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 79226d5832fb6d629db612d4a2f44e02c27ae32ddbfdd41722feca31cfb13b7c
4
- data.tar.gz: d1116586791753444e1d60d46efe5f4f8d099fd40d4397e4f045943fb41dce23
3
+ metadata.gz: 73e46f9f5d11b3a1678cc2b01ff31932ab1086a6bb950f4401c5b60f4379a018
4
+ data.tar.gz: a4a54c020973d8b83e8692193ad5e3fcc3f0500dc8cf5967d10eaddcbfdc221a
5
5
  SHA512:
6
- metadata.gz: 23b26a6bbb579a707b948ea8bec858089e6a5dce7df26c8920946e6bc4637762cc71e8e03aa013d96ec9ad4fc35a497d4323b4fe006f5e50615e0093b6a279dd
7
- data.tar.gz: 072f7811b42f425ef8a56fc120d64f6132df02408a19fa6229d725595464fe7a585db4bc9563c382a35ac5b083cc77f6df0017db466afaef86a2a99f147d5780
6
+ metadata.gz: 65c2271c0947f84645a6d25f981aa40cb5243bc56387fd9694925911c281745d51e264de03638003d745335a80a4e73212ad4e448115915b71a2c6a707cf63e5
7
+ data.tar.gz: 33fda34f85dc4e1155d527452f6d7dec225ce85cd81018ece1fb7a7496236cde8bcacfe32ea1c1f6ade513c3aef0df9569be146621049be6fb3c50ef0230e078
data/README.md CHANGED
@@ -37,7 +37,7 @@ $ rvm use ruby-3.1.2@pwn
37
37
  $ rvm list gemsets
38
38
  $ gem install --verbose pwn
39
39
  $ pwn
40
- pwn[v0.4.472]:001 >>> PWN.help
40
+ pwn[v0.4.475]:001 >>> PWN.help
41
41
  ```
42
42
 
43
43
  [![Installing the pwn Security Automation Framework](https://raw.githubusercontent.com/0dayInc/pwn/master/documentation/pwn_install.png)](https://youtu.be/G7iLUY4FzsI)
@@ -52,7 +52,7 @@ $ rvm use ruby-3.1.2@pwn
52
52
  $ gem uninstall --all --executables pwn
53
53
  $ gem install --verbose pwn
54
54
  $ pwn
55
- pwn[v0.4.472]:001 >>> PWN.help
55
+ pwn[v0.4.475]:001 >>> PWN.help
56
56
  ```
57
57
 
58
58
 
@@ -12,7 +12,7 @@ OptionParser.new do |options|
12
12
  #{$PROGRAM_NAME} [opts]
13
13
  "
14
14
 
15
- options.on('-c', '--config-yaml', '<Required - YAML config containing api_key from Shodan.io>') do |y|
15
+ options.on('-cYAML', '--config-yaml=YAML', '<Required - YAML config containing api_key from Shodan.io>') do |y|
16
16
  opts[:yaml] = y
17
17
  end
18
18
 
@@ -45,33 +45,35 @@ begin
45
45
 
46
46
  timestamp = Time.now.strftime('%Y-%m-%d.%H:%M:%S')
47
47
  query_results_file = opts[:output_results_file]
48
- query_results_file ||= "/tmp/shodan-results-#{timestamp}.txt"
49
- query_results_dir = File.dirname(query_results_file)
48
+ query_results_file ||= "/tmp/shodan-results-#{timestamp}"
50
49
 
51
- raw_query_results_file = "#{query_results_dir}/shodan-results-#{timestamp}-RAW.json"
52
- File.open(raw_query_results_file, 'w') do |r|
53
- File.open(query_results_file, 'w') do |f|
54
- queries.each do |query_line|
55
- query = query_line.chomp
56
- print "QUERY: '#{query}'"
57
- r.puts("QUERY: '#{query}'")
58
- f.puts("QUERY: '#{query}'")
59
- search_results = PWN::Plugins::Shodan.search(
60
- api_key: api_key,
61
- query: query
62
- )
63
- puts " >>> Matches: #{search_results[:total]}"
64
- r.puts search_results.to_json
50
+ raw_query_results_file = "#{query_results_file}-RAW.json"
51
+ raw_results_arr = []
52
+ File.open(query_results_file, 'w') do |f|
53
+ queries.each do |query_line|
54
+ query = query_line.chomp
55
+ print "QUERY: '#{query}'"
56
+ f.puts("QUERY: '#{query}'")
57
+ search_results = PWN::Plugins::Shodan.search(
58
+ api_key: api_key,
59
+ query: query
60
+ )
61
+ puts " >>> Matches: #{search_results[:total]}"
65
62
 
66
- search_results[:matches].select do |m|
67
- f.puts "ORG: #{m[:org]} | PUBIP: #{m[:ip_str]} #{'*' * 36}"
68
- f.puts "Product: #{m[:product]}"
69
- f.puts "TCP Port: #{m[:port]}"
70
- f.puts "Data: #{m[:data]}\n\n\n"
71
- end
63
+ raw_results = {}
64
+ raw_results[:query] = query
65
+ raw_results[:results] = search_results
66
+ raw_results_arr.push(raw_results.to_json)
67
+
68
+ search_results[:matches].select do |m|
69
+ f.puts "ORG: #{m[:org]} | PUBIP: #{m[:ip_str]} #{'*' * 36}"
70
+ f.puts "Product: #{m[:product]}"
71
+ f.puts "TCP Port: #{m[:port]}"
72
+ f.puts "Data: #{m[:data]}\n\n\n"
72
73
  end
73
74
  end
74
75
  end
76
+ File.write(raw_query_results_file, raw_results_arr)
75
77
  rescue SystemExit, Interrupt
76
78
  puts "\nGoodbye."
77
79
  end
data/lib/pwn/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PWN
4
- VERSION = '0.4.472'
4
+ VERSION = '0.4.475'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pwn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.472
4
+ version: 0.4.475
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-03 00:00:00.000000000 Z
11
+ date: 2022-06-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport