pwn 0.5.153 → 0.5.154

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: 19b5a2c08a7c1a2e6f2d425d684f38dd56d4c8900cd58ed834168b7070d12c09
4
- data.tar.gz: 47eb458cac4381bfdcf5c2d97172d467d50c5485a0543666d5aeada43a82662a
3
+ metadata.gz: cdc176de7f592b5c19650942854e4efa7d0158c835e89ace9f40af31a5a92f90
4
+ data.tar.gz: 3f756b2f5deb2589c2e9d30068d13b1e460b0e7091cdeae6a0097fa3947e98ce
5
5
  SHA512:
6
- metadata.gz: 37fa4e3f1343a65818901039df701eb05037584111d797fcdfe076d0459a389b2703440f99f326a9a05be9633577423274d6f6931ee932dc4041396710be5bac
7
- data.tar.gz: 3192b67dbebe9a383575a1877ad0241a4c2d6c7bb0681df65cf97cfc04889bfc6d04278790446bb0f0b81258f9f26a10f6a2f5bffae2ad9cb0fb0cf98966e187
6
+ metadata.gz: 7a6437ab3cb220bd0c374b9672848646bace31fd6ba283e717a67db97a7826a397a9e8a68d0339f209cffebb55d8e63c918ebd211335b9406961822b2136c715
7
+ data.tar.gz: 7ece6c1aeb18b7a16d772552717708c0df8b30483547e4080f2f2699173e52b1207b2a2b55ab3856cd077a958e065e89f32bf274d58894799db53b55db6a1939
data/README.md CHANGED
@@ -37,7 +37,7 @@ $ cd /opt/pwn
37
37
  $ ./install.sh
38
38
  $ ./install.sh ruby-gem
39
39
  $ pwn
40
- pwn[v0.5.153]:001 >>> PWN.help
40
+ pwn[v0.5.154]: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.3.1@pwn
52
52
  $ gem uninstall --all --executables pwn
53
53
  $ gem install --verbose pwn
54
54
  $ pwn
55
- pwn[v0.5.153]:001 >>> PWN.help
55
+ pwn[v0.5.154]:001 >>> PWN.help
56
56
  ```
57
57
 
58
58
  If you're using a multi-user install of RVM do:
@@ -62,7 +62,7 @@ $ rvm use ruby-3.3.1@pwn
62
62
  $ rvmsudo gem uninstall --all --executables pwn
63
63
  $ rvmsudo gem install --verbose pwn
64
64
  $ pwn
65
- pwn[v0.5.153]:001 >>> PWN.help
65
+ pwn[v0.5.154]:001 >>> PWN.help
66
66
  ```
67
67
 
68
68
  PWN periodically upgrades to the latest version of Ruby which is reflected in `/opt/pwn/.ruby-version`. The easiest way to upgrade to the latest version of Ruby from a previous PWN installation is to run the following script:
@@ -149,6 +149,8 @@ module PWN
149
149
  timestamp = Time.now.strftime('%Y-%m-%d_%H.%M.%S')
150
150
  results_file = opts[:results_file] ||= "/tmp/SUBS.#{parent_domain}-#{timestamp}-pwn_bruteforce_subdomains.txt"
151
151
 
152
+ File.write(results_file, '[')
153
+
152
154
  # Break up dictonary file into sublines and process each subline in a thread
153
155
  dict_lines = File.readlines(dictionary).shuffle
154
156
  mutex = Mutex.new
@@ -157,8 +159,7 @@ module PWN
157
159
  max_threads: max_threads
158
160
  ) do |subline|
159
161
  subdomain = subline.to_s.scrub.strip.chomp
160
- next if subdomain.empty?
161
-
162
+ target = parent_domain if subdomain.empty?
162
163
  target = "#{subdomain}.#{parent_domain}"
163
164
  ip_info_resp = get(
164
165
  target: target,
@@ -171,12 +172,21 @@ module PWN
171
172
 
172
173
  mutex.synchronize do
173
174
  File.open(results_file, 'a') do |file|
174
- file.puts JSON.generate(ip_info_resp) unless ip_info_resp.empty?
175
+ resp_len = ip_info_resp.length
176
+ next unless resp_len.positive?
177
+
178
+ ip_info_resp.each do |ip_info_hash|
179
+ file.puts "#{JSON.generate(ip_info_hash)},"
180
+ end
175
181
  end
176
182
  end
177
183
  end
178
184
  rescue StandardError => e
179
185
  raise e
186
+ ensure
187
+ # Strip trailing comma and close JSON array
188
+ File.readlines(results_file)[-1].chomp!(',')
189
+ File.append(results_file, ']')
180
190
  end
181
191
 
182
192
  # Author(s):: 0day Inc. <support@0dayinc.com>
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.5.153'
4
+ VERSION = '0.5.154'
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.5.153
4
+ version: 0.5.154
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.