pwn 0.4.473 → 0.4.476

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 800a4481ec352e62a264e69979b18283eac032c9b4b4fa34a8785a6dd046bc7c
4
- data.tar.gz: ee5c3d0a5bf0ef7347ea27cd54fd4ebd851039509e94b6ae3464bd28100126ef
3
+ metadata.gz: 8ef8af0c110613df805e43c7194ba3c2583c7e18b1d6c0a214f693a3d8b5d8f8
4
+ data.tar.gz: 646b090115b4f9180d26f14222d1fea8ad57b31b083e38ae71ffeaa44aa62273
5
5
  SHA512:
6
- metadata.gz: 1a6784dc075ec9dabae9bea756f0cbd16fea0494a5445e09a9cf7402aa652f207ee140430c1dc9c689bffdbb62ec1983cc9cca2bb5b6aa366fe4b52cfa60bccd
7
- data.tar.gz: 5115ddcd05d4c3a2526727386e6b0a53a9fb8f5155dc4495d4e473bc7372517611d17fd06b9229a330c1cee907a7683b5a309c78e51c07339ef68a14c3dda30f
6
+ metadata.gz: cab4b7f4c5a4e4c1b03a4f2d79ab502a9a4472589631485b3022ef59396d75b143f4c58b9e82a78f508f00cabe4108f218edc95483f67ae992f31f3965d5d4e5
7
+ data.tar.gz: 2fc157515f103b9869314c6fead5d88c5de7464e472ef2555e29d97f38558f0c2962ec4ac7166e7d8654e2be75bdbf85e08ee3d09f18e4c186c6c96959b8c51a
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.473]:001 >>> PWN.help
40
+ pwn[v0.4.476]: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.473]:001 >>> PWN.help
55
+ pwn[v0.4.476]:001 >>> PWN.help
56
56
  ```
57
57
 
58
58
 
@@ -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)
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.to_json)
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.473'
4
+ VERSION = '0.4.476'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pwn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.473
4
+ version: 0.4.476
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.