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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5453ebbc5938bd3524a2717fbd412b3c6cbae940
4
- data.tar.gz: e29e70aef8c4ea1a13630d9d2876753175eda65f
3
+ metadata.gz: 57d55169746bf088a8f1808239e6bce9246bb3b2
4
+ data.tar.gz: 1b1e3f67edf2df39bcb17d271fc0dcff7dc3111d
5
5
  SHA512:
6
- metadata.gz: 3c4948e0476e99926f220e62382ca39507b866140d4a0f4e52aa57efafc12967880dcfbe00a69222a7dfa8accaea43ff2d4bfe4a92c9c6c49c0a2b4e335db479
7
- data.tar.gz: 20af0a2218f08ed384007ed82e7a488cd60453c4802827f8d9312798bdadf87a62a696d162fad214c682b559d1834edcb1e8fd7c28962d265d2ade70202814bb
6
+ metadata.gz: 91135741672ec330d1ec135f70a4d0e7cdc813b54683c7c12eaf2c61b701aab83bb5eaa02d1d713f6cc026a2a9a71083c3e75107c445d1ca9f6b9df942712f4c
7
+ data.tar.gz: c9ea2e0fd3834a5f774f3c2741d89cb1a1ac2e5d8bc31a3d96ac8b1d87363f238c6774394576940321cdaf775762e0b9d43db787acf12af8bc967106a143e9cf
data/Doxfile CHANGED
@@ -33,7 +33,7 @@ task :broken => :foo do
33
33
  end
34
34
 
35
35
  task :sudo do
36
- sh "sudo -S echo 'this is a sudo echo'"
36
+ sh "sudo echo 'this is a sudo echo'"
37
37
  end
38
38
 
39
39
  task :git_clone do
@@ -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 could not be automatically installed. Please install manually with 'gem install 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
- $stdout.print data
128
- if data =~ /^\[sudo\]|Password/i
129
- warning "Target is asking for password: ", 1
130
- channel.send_data(gets.strip + "\n")
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|
@@ -1,3 +1,3 @@
1
1
  module Shaddox
2
- VERSION = "0.0.13"
2
+ VERSION = "0.0.14"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shaddox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - joshglendenning