shaddox 0.0.13 → 0.0.14
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 +4 -4
- data/Doxfile +1 -1
- data/lib/shaddox/target.rb +15 -8
- data/lib/shaddox/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 57d55169746bf088a8f1808239e6bce9246bb3b2
|
4
|
+
data.tar.gz: 1b1e3f67edf2df39bcb17d271fc0dcff7dc3111d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91135741672ec330d1ec135f70a4d0e7cdc813b54683c7c12eaf2c61b701aab83bb5eaa02d1d713f6cc026a2a9a71083c3e75107c445d1ca9f6b9df942712f4c
|
7
|
+
data.tar.gz: c9ea2e0fd3834a5f774f3c2741d89cb1a1ac2e5d8bc31a3d96ac8b1d87363f238c6774394576940321cdaf775762e0b9d43db787acf12af8bc967106a143e9cf
|
data/Doxfile
CHANGED
data/lib/shaddox/target.rb
CHANGED
@@ -35,14 +35,17 @@ module Shaddox
|
|
35
35
|
shaddox_installed = lambda { exec 'gem list shaddox -i >/dev/null' }
|
36
36
|
if shaddox_installed.call()
|
37
37
|
info "Updating shaddox...", 1
|
38
|
-
updated = exec "gem update shaddox"
|
38
|
+
updated = exec "gem update shaddox", :quiet => true
|
39
|
+
updated = exec "sudo gem update shaddox" unless updated
|
39
40
|
warn "Shaddox could not be automatically updated. Please update it manually with 'gem update shaddox'.", 1 unless updated
|
40
41
|
else
|
41
42
|
info "Installing shaddox...", 1
|
42
|
-
exec "gem install shaddox"
|
43
|
+
installed = exec "gem install shaddox", :quiet => true
|
44
|
+
installed = exec "sudo gem install shaddox" unless installed
|
45
|
+
warn "Shaddox could not be automatically installed. Please update it manually with 'gem update shaddox'.", 1 unless installed
|
43
46
|
end
|
44
47
|
unless shaddox_installed.call()
|
45
|
-
raise TargetError, "Shaddox
|
48
|
+
raise TargetError, "Shaddox was not found on this target."
|
46
49
|
end
|
47
50
|
|
48
51
|
# Push the shadow script to tmpdir:
|
@@ -117,17 +120,21 @@ module Shaddox
|
|
117
120
|
super(&block)
|
118
121
|
end
|
119
122
|
end
|
120
|
-
def exec(command)
|
123
|
+
def exec(command, opts = {})
|
121
124
|
exit_code = nil
|
122
125
|
@ssh.open_channel do |channel|
|
123
126
|
channel.request_pty do |c, success|
|
124
127
|
raise "SSH could not obtain a pty." unless success
|
125
128
|
channel.exec(command)
|
126
129
|
channel.on_data do |c_, data|
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
130
|
+
if data =~ /\[sudo\]/ || data =~ /Password/i
|
131
|
+
warn "Target is asking for password: ", 1
|
132
|
+
$stdout.print data
|
133
|
+
puts ""
|
134
|
+
pass = $stdin.gets.chomp
|
135
|
+
channel.send_data "#{pass}\n"
|
136
|
+
else
|
137
|
+
$stdout.print data unless opts[:quiet]
|
131
138
|
end
|
132
139
|
end
|
133
140
|
channel.on_request('exit-status') do |ch, data|
|
data/lib/shaddox/version.rb
CHANGED