Skip to content

Commit 607c294

Browse files
authored
Merge pull request #257 from ninp0/master
PWN::Plugins::Tor module - initial commit && #bugfix in pwn_diff_csv_files_w_column_exclude Driver
2 parents a1e7115 + 7acb478 commit 607c294

35 files changed

+368
-199
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ gem 'ruby-nmap', '1.0.1'
7272
gem 'ruby-saml', '1.15.0'
7373
gem 'rvm', '1.11.3.9'
7474
gem 'savon', '2.14.0'
75-
gem 'selenium-devtools', '0.112.0'
75+
gem 'selenium-devtools', '0.113.0'
7676
gem 'serialport', '1.3.2'
7777
gem 'sinatra', '3.0.6'
7878
gem 'slack-ruby-client', '2.1.0'

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ $ rvm use ruby-3.2.2@pwn
3737
$ rvm list gemsets
3838
$ gem install --verbose pwn
3939
$ pwn
40-
pwn[v0.4.667]:001 >>> PWN.help
40+
pwn[v0.4.669]:001 >>> PWN.help
4141
```
4242

4343
[![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.2.2@pwn
5252
$ gem uninstall --all --executables pwn
5353
$ gem install --verbose pwn
5454
$ pwn
55-
pwn[v0.4.667]:001 >>> PWN.help
55+
pwn[v0.4.669]:001 >>> PWN.help
5656
```
5757

5858

bin/pwn

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,5 @@ begin
297297
prompt: prompt
298298
)
299299
rescue StandardError => e
300-
puts 1111 if Pry.config.chat_gpt
301300
raise e
302301
end

bin/pwn_diff_csv_files_w_column_exclude

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def csv_diff(opts = {})
4646
c1_path = opts[:c1_path]
4747
c2_path = opts[:c2_path]
4848
diff_path = opts[:diff_path]
49-
include_csv_headers = opts[:include_csv_headers]
49+
no_headers = opts[:no_headers]
5050
column_names_to_exclude = opts[:column_names_to_exclude].to_s.split(',')
5151

5252
csv1 = CSV.read(c1_path)
@@ -102,10 +102,17 @@ def csv_diff(opts = {})
102102
# Write diff again with all columns.
103103
csv_headers_orig = larger_csv_orig.first.join(',')
104104
File.open(diff_path, 'w') do |f|
105-
f.puts csv_headers_orig if include_csv_headers
106-
larger_csv_orig.each do |line_arr|
107-
line = line_arr.join(',')
108-
f.puts line if diff_csv.include?(line_arr)
105+
if no_headers
106+
larger_csv_orig.each do |line_arr|
107+
line = line_arr.join(',')
108+
f.puts line if diff_csv.include?(line_arr)
109+
end
110+
else
111+
f.puts csv_headers_orig
112+
larger_csv_orig[1..-1].each do |line_arr|
113+
line = line_arr.join(',')
114+
f.puts line if diff_csv.include?(line_arr)
115+
end
109116
end
110117
end
111118
end
@@ -115,14 +122,14 @@ c2_path = opts[:c2_path]
115122
diff_path = opts[:diff_path]
116123
column_names_to_exclude = opts[:column_names_to_exclude]
117124

118-
include_csv_headers = false if opts[:no_headers]
119-
include_csv_headers ||= true
125+
no_headers = true if opts[:no_headers]
126+
no_headers ||= false
120127

121128
# Compare which two is larger
122129
csv_diff(
123130
c1_path: c1_path,
124131
c2_path: c2_path,
125132
diff_path: diff_path,
126-
include_csv_headers: include_csv_headers,
133+
no_headers: no_headers,
127134
column_names_to_exclude: column_names_to_exclude
128135
)

bin/pwn_domain_reversewhois

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,9 @@ OptionParser.new do |options|
2020
opts[:output_results] = o
2121
end
2222

23-
options.on('-pPROXY', '--proxy=PROXY', '<Optional - HTTP or Socks Proxy>') do |p|
23+
options.on('-pPROXY', '--proxy=PROXY', '<Optional - HTTP or Socks Proxy || :tor>') do |p|
2424
opts[:proxy] = p
2525
end
26-
27-
options.on('-T', '--[no-]with-tor', '<Optional - Proxy w/ TOR (Defaults to false)>') do |w|
28-
opts[:with_tor] = w
29-
end
3026
end.parse!
3127

3228
if opts.empty?
@@ -37,13 +33,13 @@ end
3733
registrant_filter = opts[:registrant_filter].to_s.strip.chomp.scrub
3834
output_results = opts[:output_results].to_s.strip.chomp.scrub
3935
proxy = opts[:proxy].to_s.scrub.strip.chomp unless opts[:proxy].nil?
40-
with_tor = opts[:with_tor]
4136

4237
begin
43-
if proxy != '' && with_tor
44-
browser_obj = PWN::Plugins::TransparentBrowser.open(browser_type: :headless, proxy: proxy, with_tor: true)
45-
elsif proxy != '' && with_tor.nil?
46-
browser_obj = PWN::Plugins::TransparentBrowser.open(browser_type: :headless, proxy: proxy)
38+
if proxy
39+
browser_obj = PWN::Plugins::TransparentBrowser.open(
40+
browser_type: :headless,
41+
proxy: proxy
42+
)
4743
else
4844
browser_obj = PWN::Plugins::TransparentBrowser.open(browser_type: :headless)
4945
end

bin/pwn_pastebin_sample_filter

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,9 @@ OptionParser.new do |options|
1414
opts[:regex] = r
1515
end
1616

17-
options.on('-pPROXY', '--proxy=PROXY', '<Optional - HTTP or Socks Proxy>') do |p|
17+
options.on('-pPROXY', '--proxy=PROXY', '<Optional - HTTP or Socks Proxy || :tor>') do |p|
1818
opts[:proxy] = p
1919
end
20-
21-
options.on('-T', '--[no-]with-tor', '<Optional - Proxy w/ TOR (Defaults to false)>') do |w|
22-
opts[:with_tor] = w
23-
end
2420
end.parse!
2521

2622
if opts.empty?
@@ -29,13 +25,11 @@ if opts.empty?
2925
end
3026

3127
proxy = opts[:proxy]
32-
with_tor = opts[:with_tor]
3328
regex = opts[:regex]
3429

3530
browser_obj = PWN::WWW::Pastebin.open(
3631
browser_type: :headless,
37-
proxy: proxy,
38-
with_tor: with_tor
32+
proxy: proxy
3933
)
4034

4135
begin

bin/pwn_web_cache_deception

Lines changed: 9 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,9 @@ OptionParser.new do |options|
3838
opts[:mfa] = f
3939
end
4040

41-
options.on('-pPROXY', '--proxy=PROXY', '<Optional - HTTP or Socks Proxy>') do |p|
41+
options.on('-pPROXY', '--proxy=PROXY', '<Optional - HTTP or Socks Proxy || :tor>') do |p|
4242
opts[:proxy] = p
4343
end
44-
45-
options.on('-T', '--[no-]with-tor', '<Optional - Proxy w/ TOR (Defaults to false)>') do |w|
46-
opts[:with_tor] = w
47-
end
4844
end.parse!
4945

5046
if opts.empty?
@@ -88,7 +84,6 @@ else
8884
end
8985

9086
proxy = opts[:proxy].to_s.scrub.strip.chomp unless opts[:proxy].nil?
91-
with_tor = opts[:with_tor]
9287

9388
begin
9489
def get_web_cache_deception(opts = {})
@@ -157,18 +152,10 @@ begin
157152

158153
puts "#{@green}Leveraging PWN::WWW::#{pwn_www_mod_str} to Obtain a Post AuhN State...#{@end_of_color}"
159154
if proxy
160-
if with_tor
161-
browser_obj = pwn_www_mod.open(
162-
browser_type: :chrome,
163-
proxy: proxy,
164-
with_tor: true
165-
)
166-
else
167-
browser_obj = pwn_www_mod.open(
168-
browser_type: :chrome,
169-
proxy: proxy
170-
)
171-
end
155+
browser_obj = pwn_www_mod.open(
156+
browser_type: :chrome,
157+
proxy: proxy
158+
)
172159
else
173160
browser_obj = pwn_www_mod.open(browser_type: :chrome)
174161
end
@@ -181,18 +168,10 @@ begin
181168
)
182169
puts "#{@green}complete.#{@end_of_color}\n\n\n"
183170
elsif pwn_www_mod_str == '' && proxy
184-
if with_tor
185-
browser_obj = PWN::Plugins::TransparentBrowser.open(
186-
browser_type: :chrome,
187-
proxy: proxy,
188-
with_tor: true
189-
)
190-
else
191-
browser_obj = PWN::Plugins::TransparentBrowser.open(
192-
browser_type: :chrome,
193-
proxy: proxy
194-
)
195-
end
171+
browser_obj = PWN::Plugins::TransparentBrowser.open(
172+
browser_type: :chrome,
173+
proxy: proxy
174+
)
196175
else
197176
browser_obj = PWN::Plugins::TransparentBrowser.open(browser_type: :chrome)
198177
end

bin/pwn_www_checkip

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,24 @@ OptionParser.new do |options|
1010
#{$PROGRAM_NAME} [opts]
1111
"
1212

13-
options.on('-pPROXY', '--proxy=PROXY', '<Optional - HTTP or Socks Proxy>') do |p|
13+
options.on('-pPROXY', '--proxy=PROXY', '<Optional - HTTP or Socks Proxy || :tor>') do |p|
1414
opts[:proxy] = p
1515
end
1616

17-
options.on('-T', '--[no-]with-tor', '<Optional - Proxy w/ TOR (Defaults to false)>') do |w|
18-
opts[:with_tor] = w
19-
end
20-
2117
options.on('-i', '--[no-]ipinfo', '<Optional - Return Details about Public IP Returned from CheckIP>') do |i|
2218
opts[:ipinfo] = i
2319
end
2420
end.parse!
2521

2622
proxy = opts[:proxy].to_s.scrub.strip.chomp unless opts[:proxy].nil?
27-
with_tor = opts[:with_tor]
2823
ipinfo = opts[:ipinfo]
2924

3025
begin
31-
if proxy != '' && with_tor
32-
browser_obj = PWN::Plugins::TransparentBrowser.open(browser_type: :rest, proxy: proxy, with_tor: true)::Request
33-
elsif proxy != '' && with_tor.nil?
34-
browser_obj = PWN::Plugins::TransparentBrowser.open(browser_type: :rest, proxy: proxy)::Request
26+
if proxy
27+
browser_obj = PWN::Plugins::TransparentBrowser.open(
28+
browser_type: :rest,
29+
proxy: proxy
30+
)::Request
3531
else
3632
browser_obj = PWN::Plugins::TransparentBrowser.open(browser_type: :rest)::Request
3733
end

bin/pwn_xss_dom_vectors

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,10 @@ OptionParser.new do |options|
2626
opts[:browser_type] = b
2727
end
2828

29-
options.on('-pPROXY', '--proxy=PROXY', '<Optional - HTTP or Socks Proxy>') do |p|
29+
options.on('-pPROXY', '--proxy=PROXY', '<Optional - HTTP or Socks Proxy || :tor>') do |p|
3030
opts[:proxy] = p
3131
end
3232

33-
options.on('-T', '--[no-]with-tor', '<Optional - Proxy w/ TOR (Defaults to false)>') do |w|
34-
opts[:with_tor] = w
35-
end
36-
3733
options.on('-S', '--[no-]spider-fqdn', '<Optional - Spider Target FQDN>') do |s|
3834
opts[:spider] = s
3935
end
@@ -56,7 +52,6 @@ else
5652
end
5753

5854
proxy = opts[:proxy].to_s.scrub.strip.chomp unless opts[:proxy].nil?
59-
with_tor = opts[:with_tor]
6055

6156
if opts[:spider]
6257
spider = true
@@ -109,18 +104,10 @@ begin
109104
end
110105

111106
if proxy
112-
if with_tor
113-
browser_obj = PWN::Plugins::TransparentBrowser.open(
114-
browser_type: browser_type,
115-
proxy: proxy,
116-
with_tor: true
117-
)
118-
else
119-
browser_obj = PWN::Plugins::TransparentBrowser.open(
120-
browser_type: browser_type,
121-
proxy: proxy
122-
)
123-
end
107+
browser_obj = PWN::Plugins::TransparentBrowser.open(
108+
browser_type: browser_type,
109+
proxy: proxy
110+
)
124111
else
125112
browser_obj = PWN::Plugins::TransparentBrowser.open(browser_type: browser_type)
126113
end

lib/pwn/plugins.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ module Plugins
5858
autoload :Spider, 'pwn/plugins/spider'
5959
autoload :SSN, 'pwn/plugins/ssn'
6060
autoload :ThreadPool, 'pwn/plugins/thread_pool'
61+
autoload :Tor, 'pwn/plugins/tor'
6162
autoload :TransparentBrowser, 'pwn/plugins/transparent_browser'
6263
autoload :TwitterAPI, 'pwn/plugins/twitter_api'
6364
autoload :URIScheme, 'pwn/plugins/uri_scheme'

0 commit comments

Comments
 (0)