@@ -48,9 +48,7 @@ module so thanks very much to the author/s of that great tool. This module is u
48
48
49
49
50
50
51
- #-----------------------------------
52
51
# This is the main controle method
53
- #-----------------------------------
54
52
def run_host ( ip )
55
53
cmd = "C:\\ WINDOWS\\ SYSTEM32\\ cmd.exe"
56
54
text = "\\ WINDOWS\\ Temp\\ #{ Rex ::Text . rand_text_alpha ( 16 ) } .txt"
@@ -85,9 +83,7 @@ def run_host(ip)
85
83
86
84
87
85
88
- #------------------------------------
89
86
# Executes specified Windows Command
90
- #------------------------------------
91
87
def execute_command ( smbshare , ip , cmd , text , bat )
92
88
begin
93
89
#Try and execute the provided command
@@ -98,15 +94,13 @@ def execute_command(smbshare, ip, cmd, text, bat)
98
94
return True
99
95
rescue StandardError => execerror
100
96
print_error ( "#{ ip } - Unable to execute specified command: #{ execerror } " )
101
- return False
97
+
102
98
end
103
99
end
104
100
105
101
106
102
107
- # ----------------------------
108
103
# Retrive output from command
109
- #-----------------------------
110
104
def get_output ( smbshare , ip , file )
111
105
begin
112
106
simple . connect ( "\\ \\ #{ ip } \\ #{ smbshare } " )
@@ -127,9 +121,7 @@ def get_output(smbshare, ip, file)
127
121
128
122
129
123
130
- #----------------------------------------------------------------------------------
131
124
# This is the cleanup method, removes .txt and .bat file/s created during execution-
132
- #-----------------------------------------------------------------------------------
133
125
def cleanup_after ( smbshare , ip , cmd , text , bat )
134
126
begin
135
127
# Try and do cleanup command
@@ -145,10 +137,8 @@ def cleanup_after(smbshare, ip, cmd, text, bat)
145
137
146
138
147
139
148
- #------------------------------------------------------------------------------------------------------------------------
149
- # This code was stolen straight out of psexec.rb. Thanks very much for all who contributed to that module!!
140
+ # This code was stolen straight out of psexec.rb. Thanks very much HDM and all who contributed to that module!!
150
141
# Instead of uploading and runing a binary. This method runs a single windows command fed into the #{command} paramater
151
- #------------------------------------------------------------------------------------------------------------------------
152
142
def psexec ( smbshare , command )
153
143
filename = "filename"
154
144
servicename = "servicename"
0 commit comments