Skip to content

Instantly share code, notes, and snippets.

@tehmoon
Last active November 14, 2018 17:19
Show Gist options
  • Save tehmoon/df7c23931f95760f913771ca759c5758 to your computer and use it in GitHub Desktop.
Save tehmoon/df7c23931f95760f913771ca759c5758 to your computer and use it in GitHub Desktop.
Windows stuff

Run as:

powershell -ExecutionPolicy bypass Start-Process  .\log-exporter.exe, -Verb, RunAs, -ArgumentList "-u `"blih`""

Escape string + get current user:

$blih = [System.Security.Principal.WindowsIdentity]::GetCurrent().Name

powershell "echo  `"$blih`""

Tail:

Get-Content -Wait -Last <number> <file>

Send file through http post

Have netcat ready

Invoke-WebRequest -Uri $url -Method Post -Body ([Convert]::ToBase64String((get-content -Raw $path -Encoding Byte)))

You should have the http headers and the payload in your netcat console.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment