n0va_sa

PowershellEncoder

Feb 4th, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.36 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <string.h>
  4. using namespace std;
  5. /*
  6. Manual - You can preety much compile this in any OS ,all you have to look after is
  7.         that you open the file with existing powershell commands,this will encrypt the
  8.         powershell shell code to an encrypted Format,(You can use your own techniques
  9.         be creative with the encoding techniques)
  10.         Author - S0urav (n0va)
  11. */
  12.  
  13. class PowershellEncrypter{
  14.     private:
  15.         string shellCode;
  16.     public:
  17.     int encoder(){
  18.         ifstream shell_reader("shellCode.n0va");
  19.         while(getline(shell_reader,shellCode)){
  20.             shell_reader >> shellCode;
  21.         }
  22.         shell_reader.close();
  23.         //This is Where the Encoding Happens, After Encoding It Have no work
  24.         int len_ofShell = shellCode.length();
  25.         for(int i = 0;i<len_ofShell;i++){
  26.             if(shellCode.at(i) == 112) shellCode.at(i) = shellCode.at(i) - 17;
  27.             if(shellCode.at(i) == 113) shellCode.at(i) = shellCode.at(i) - 99;
  28.             else shellCode.at(i) = shellCode.at(i) + 17;
  29.         }
  30.         ofstream shell_writer;
  31.         shell_writer.open("shellCode.n0va",ios::trunc);
  32.         shell_writer << shellCode;
  33.         int newLen = shellCode.length();
  34.         if(newLen == len_ofShell){
  35.             return 0;
  36.         }
  37.         return 1;
  38.     }
  39.  
  40. };
  41. int main(){
  42.     int temp;
  43.     PowershellEncrypter psh;
  44.     psh.encoder();
  45.     cin >> temp;
  46. }
  47. /*NOT ONLY POWERSHELL SHELL-CODE BE CREATIVE TRY THIS WITH OTHER PAYLOADS AS WELL like (webDelivery)*/
Add Comment
Please, Sign In to add comment