Advertisement
metalx1000

Embed and extract zip file

Jul 13th, 2014
883
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $Base64 = "<Base64 code>"
  2.  
  3. $zip_file = "$env:temp\package.zip"
  4.  
  5. $Content = [System.Convert]::FromBase64String($Base64)
  6. Set-Content -Path $zip_file -Value $Content -Encoding Byte
  7.  
  8. $shell = new-object -com shell.application
  9.  
  10. $zip = $shell.NameSpace($zip_file)
  11.  
  12. foreach($item in $zip.items())
  13. {
  14.     $shell.Namespace($env:temp).copyhere($item,0x14)
  15. }
  16.  
  17. Remove-Item $zip_file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement