Skip to content

Commit

Permalink
Fixes persistence module by revering changes to the value returned by…
Browse files Browse the repository at this point in the history
… the write_script_to_target function, which screws up the path that is used for startup. Currently an escaped path "C://Users//..." is being used instead of using windows standards "C:\Users\...".
  • Loading branch information
Jervelund committed Mar 10, 2015
1 parent cd992d5 commit c6cb1e8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions modules/exploits/windows/local/persistence.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ def write_script_to_target(vbs, name)
begin
write_file(tempvbs, vbs)
print_good("Persistent Script written to #{tempvbs}")
tempvbs = tempvbs.gsub(/\\/, '//') # Escape windows pathname separators.
@clean_up_rc << "rm #{tempvbs}\n"
# Escape windows pathname separators.
@clean_up_rc << "rm #{tempvbs.gsub(/\\/, '//')}\n"
rescue
print_error("Could not write the payload on the target hosts.")
# return nil since we could not write the file on the target host.
Expand Down
4 changes: 2 additions & 2 deletions scripts/meterpreter/persistence.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ def write_script_to_target(target_dir,vbs)
fd.write(vbs)
fd.close
print_good("Persistent Script written to #{tempvbs}")
tempvbs = tempvbs.gsub(/\\/, '//') # Escape windows pathname separators.
file_local_write(@clean_up_rc, "rm #{tempvbs}\n")
# Escape windows pathname separators.
file_local_write(@clean_up_rc, "rm #{tempvbs.gsub(/\\/, '//')}\n")
return tempvbs
end

Expand Down

0 comments on commit c6cb1e8

Please sign in to comment.