๐ PowerShell Web Downloads -
Useful if HTTP/HTTPS browsing is allowed
๐ PowerShell Web Downloads โ Transfer Files Like a Ninja
Most companies allow HTTP/HTTPS traffic through the firewall โ This means you can use it to download files, but defenders might:
โ Block specific file types (like
.exe
)โ Restrict by domain
๐ Use Web filtering or allow only whitelisted websites
But you, the clever operator, still have PowerShell! ๐งโโ๏ธ
โ๏ธ PowerShell's System.Net.WebClient
Methods
System.Net.WebClient
MethodsHereโs what you can do with it:
Method
Description
Returns the data from a resource without blocking the calling thread.
Downloads data from a resource and returns a Byte array.
Downloads data from a resource and returns a Byte array without blocking the calling thread.
Downloads data from a resource to a local file.
Downloads data from a resource to a local file without blocking the calling thread.
Downloads a String from a resource and returns a String.
Downloads a String from a resource without blocking the calling thread.
๐พ Download a File with DownloadFile
๐ Download a File with DownloadFileAsync:
๐ง Fileless Execution with DownloadString
& IEX
๐ต๏ธโโ๏ธ
DownloadString
& IEX
๐ต๏ธโโ๏ธNo touching disk! ๐ซฃ Just download and execute in memory:
Or via pipeline (same thing):
Great for stealth operations ๐
๐ข Invoke-WebRequest
(aka iwr
, curl
, wget
)
Invoke-WebRequest
(aka iwr
, curl
, wget
)๐ซ Slower than WebClient, but very powerful.
๐งฐ Common PowerShell Web Errors (and Fixes)
โ Internet Explorer First-Launch Not Complete?
Fix it with:
โ SSL/TLS Trust Error? (Invalid Cert) ๐งป
Bypass it like this:
Then retry your download.
๐ Pro Tip!
Avoid disk writes ๐๐ฑ๏ธ
Bypass proxy issues ๐งฑ
Stay under the radar ๐ป
Last updated