psrp 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/psrp.rb +4 -1
- data/lib/version.rb +1 -1
- data/test_psrp.rb +1 -8
- 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: c907a84bd02d8bf0c7ae45e3579079a9910279d5
|
4
|
+
data.tar.gz: 1daf946d7ff1b5dd533c121a3741f0fcf76e6ce7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0855e51e7d0b9bbcd1401e08ee0e0823fb481f0b967dc77507316f6bc81d0f30084fffb9839e89443dff77344a0832e32a85660dd5f484f2a3922a73585816a8
|
7
|
+
data.tar.gz: 78450e8fb8d2fb9ea86fd8037254600ebc921ff1fd3711fbb69edcb890e55bcc91d5f4800abfd5a360f1443dd7714adfe780f187c1799e9a2e758bdaf7bae53a
|
data/lib/psrp.rb
CHANGED
@@ -117,7 +117,7 @@ module PSRP
|
|
117
117
|
# the server. After each received wxf:ReceiveResponse message (section 3.2.5.3.8), the client sends another
|
118
118
|
# wxf:Receive message until the RunspacePool transitions to a Closed or Broken state.
|
119
119
|
if not @opened
|
120
|
-
|
120
|
+
open
|
121
121
|
end
|
122
122
|
|
123
123
|
out_processor = PSRP::WSMV::CommandOutputProcessor.new(@session_opts, @xfer)
|
@@ -185,6 +185,9 @@ module PSRP
|
|
185
185
|
end
|
186
186
|
|
187
187
|
def close
|
188
|
+
if not @opened
|
189
|
+
return nil
|
190
|
+
end
|
188
191
|
@opened = false
|
189
192
|
@logger.debug("Closing shell")
|
190
193
|
msg = PSRP::WSMV::CloseShell.new(@session_opts, @shell_id)
|
data/lib/version.rb
CHANGED
data/test_psrp.rb
CHANGED
@@ -38,16 +38,9 @@ puts psrp.run_ps(File.read('script.ps1'))
|
|
38
38
|
psrp.close
|
39
39
|
|
40
40
|
endpoint = 'http://192.168.142.232:5985/wsman'
|
41
|
-
|
42
|
-
psrp = PSRP::PSRPService.new(endpoint, :user => 'samo-range', :pass => 'somethinglonger12345!', :log_level => :debug)
|
43
|
-
psrp.run_ps('ipconfig')
|
44
|
-
rescue PSRP::PSRPError
|
45
|
-
puts 'You should see this'
|
46
|
-
end
|
41
|
+
psrp = PSRP::PSRPService.new(endpoint, :user => 'samo-range', :pass => 'somethinglonger12345!', :log_level => :debug)
|
47
42
|
|
48
43
|
begin
|
49
|
-
psrp = PSRP::PSRPService.new(endpoint, :user => 'samo-range', :pass => 'somethinglonger12345!', :log_level => :debug)
|
50
|
-
psrp.open
|
51
44
|
psrp.run_ps('ipconfig')
|
52
45
|
rescue HTTPClient::ConnectTimeoutError
|
53
46
|
puts 'Should See A Timeout on Not Able to Connect.'
|