INNER CODE UNIT · Ruby

remote_file_path

Hackplayers/evil-winrm · evil-winrm.rb:155

          remote_file_path = remote_file_path[0..index_last_folder-1]
        end

        FileUtils.mkdir_p(local_path) unless File.directory?(local_path)
        command = "Get-ChildItem #{remote_path} | Select-Object Name"

        @connection.shell(:powershell) { |e| e.run(command) }.stdout.strip.split(/\n/).drop(2).each do |file|
          sanitized_path = File.basename(file.strip)
          next if sanitized_path.empty? || sanitized_path == '.' || sanitized_path == '..'

          download(File.join(remote_file_path.to_s, file.strip), File.join(local_path, sanitized_path), chunk_size, false)
        end
      end

      true
    end
  end
end

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…