pwn 0.4.471 → 0.4.474

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: 32922a349d82bb446e9fad95fb55df251fa80c58d9b72cbe6fafb50fb0e92a0c
4
- data.tar.gz: d95bc2403937f02a5579744f8c85850c354f522e264300fed35a772360266477
3
+ metadata.gz: 9ff179fc1eb5aa54b6c3546f5de3cc523044c53895dc2736b1207b6998068711
4
+ data.tar.gz: 6c56807bd01715adb522f82cb209bb7edac4856a6b73f22fe25a09cf0e9cf7c3
5
5
  SHA512:
6
- metadata.gz: 634a521d25395485a6f6318ad5754f5e7a8bd9c20bffe680bcbf0bea1fb6b01836cda1f01d658666e824073292d3c30e331754f88f9cde7bd0544cdcb7554b5a
7
- data.tar.gz: 00ca0f938d5ce07390a7e3b92a4fb7c4be156a6e299997414b33ab5ad743be80b65dce1e38882d1d88a59e62c3ac3b2f69514afe737af824ce23869f031f213b
6
+ metadata.gz: 18cb621068a698d6f43701137a298bb375df0b660a0a458a4a46e545ef9c1eaa587b574e4a8b38cb5ab51a63c98a0f9ba3e12d2781108af37c298c84673a2362
7
+ data.tar.gz: f679e8a261b1e8720cd064949c5c9d0a1d2e2f013bbaa54fa28f10729ca4e4d949895cec68d0d0e143bf4fec5fd0efa0cacf69ecc2104fa990b47faa36473686
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.471]:001 >>> PWN.help
40
+ pwn[v0.4.474]: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.471]:001 >>> PWN.help
55
+ pwn[v0.4.474]: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
 
@@ -31,36 +31,39 @@ if opts.empty?
31
31
  end
32
32
 
33
33
  begin
34
- yaml_file = opts[:yaml]
34
+ yaml_file = opts[:yaml].to_s
35
35
  raise "ERROR: #{yaml_file} does not exist." unless File.exist?(yaml_file)
36
36
 
37
37
  yaml = YAML.load_file(yaml_file, symbolize_names: true)
38
38
 
39
39
  api_key = yaml[:api_key]
40
40
 
41
- query_file = opts[:query_file]
41
+ query_file = opts[:query_file].to_s
42
42
  raise "ERROR: #{query_file} does not exist." unless File.exist?(query_file)
43
43
 
44
44
  queries = File.readlines(query_file)
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"
48
+ query_results_file ||= "/tmp/shodan-results-#{timestamp}"
49
49
 
50
- raw_query_results_file = "/tmp/shodan-results-#{timestamp}-RAW.json"
50
+ raw_query_results_file = "#{query_results_file}-RAW.json"
51
51
  File.open(raw_query_results_file, 'w') do |r|
52
52
  File.open(query_results_file, 'w') do |f|
53
53
  queries.each do |query_line|
54
54
  query = query_line.chomp
55
55
  print "QUERY: '#{query}'"
56
- r.puts("QUERY: '#{query}'")
57
56
  f.puts("QUERY: '#{query}'")
58
57
  search_results = PWN::Plugins::Shodan.search(
59
58
  api_key: api_key,
60
59
  query: query
61
60
  )
62
61
  puts " >>> Matches: #{search_results[:total]}"
63
- r.puts search_results.to_json
62
+
63
+ raw_results = {}
64
+ raw_results[:query] = query
65
+ raw_results[:results] = search_results
66
+ r.puts raw_results.to_json
64
67
 
65
68
  search_results[:matches].select do |m|
66
69
  f.puts "ORG: #{m[:org]} | PUBIP: #{m[:ip_str]} #{'*' * 36}"
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.471'
4
+ VERSION = '0.4.474'
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.471
4
+ version: 0.4.474
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