Advertisement
Candyland

File_Binder/Hider

Mar 18th, 2017
202
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
  2. #AutoIt3Wrapper_Compression=4
  3. #AutoIt3Wrapper_UseX64=n
  4. #AutoIt3Wrapper_Change2CUI=y
  5. #AutoIt3Wrapper_Res_Description=Binder by Candyland
  6. #AutoIt3Wrapper_Res_Fileversion=0.2.1.0
  7. #AutoIt3Wrapper_Res_LegalCopyright=CC-BY-NC
  8. #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
  9. #cs ----------------------------------------------------------------------------
  10.  
  11.     AutoIt Version: 3.3.15.0 (Beta)
  12.     Author:        Candyland
  13.     Licens:         CC-BY-NC readable here: https://creativecommons.org/licenses/by-nc/3.0/de/
  14.  
  15.     Description:    This Program Binds an file onto another. The file will be encrypted via RC4 and copied to another files end.
  16.                     This is may usefull to sent suspicious information to another people.
  17.  
  18.     Example:        You bind a suspicious information(myaddress.txt) to an .jpg and sent it through dropbox to the recipient.
  19.  
  20.     Usage:          Encrypt:
  21.                     Start the Program, Press Yes for Encode. First Choose the file you want to run when the user clicks it.
  22.                     Second choose the file to encrypt and hide. Third choose a Password or use the predefined. Click OK.
  23.                     After some time a Beep appears(right after it the program end) now the file is binded.
  24.                     Runtimefiles=max300Mb, Hiddenfile=max20mb.
  25.                     the Result will be saved to the same directory as the executable runs under the name Binded.*
  26.  
  27.                     Decrypt:
  28.                     Start the Program, Press No for Decode. First Choose the file you know from its binded.
  29.                     Second Enter the correct(Case-Sensitive) Password. Click OK.
  30.                     The Hidden file will be decrypted and saved under Result.* Same Directory.
  31.  
  32.                     Does not Work with [..] as runtime. everything that shows its own source. [.txt .html .bat .vbs etc.]
  33.  
  34.     PS:             The technique could be used in crypters. But there is no legitimate reason for. Dont market my script.
  35.  
  36.  
  37.     Executable could be downloaded here: --Nothing to see here--
  38. #ce ----------------------------------------------------------------------------
  39.  
  40. #include <crypt.au3>
  41. #include "_Base64.au3" ;<=https://www.autoitscript.com/forum/topic/21399-base64-converter/
  42. #include <MsgBoxConstants.au3>
  43.  
  44. Local $iAnswer = MsgBox(BitOR($MB_YESNO, $MB_SYSTEMMODAL), "Bind program by Candyland", "Yes=Add an Encode file to an Working File" & @CRLF & "No=Decode an Binded file")
  45. If $iAnswer = 7 Then ;<=On No
  46.     $O_Choose = FileOpenDialog("Choose File to decode", @ScriptDir, "(*.*)", 1) ;<=Give me something to works with, exspecially some binded stuff
  47.     If @error Then Exit
  48.  
  49.     $R_Choose = FileRead(FileOpen($O_Choose, 16))
  50.     $Seperate_Choose = StringMid($R_Choose, StringInStr($R_Choose, StringTrimLeft(StringToBinary("-=TESTME=-"), 2)) + StringLen(StringToBinary("-=TESTME=-")) - 2, -1) ;<=Search for the Binded
  51.  
  52.     $NumberOfChar_Choose = BinaryToString("0x" & StringLeft($Seperate_Choose, 2)) ;<=give me the leng of the chars via number
  53.     $NumberOfChar_ChooseTrimm = StringTrimLeft($Seperate_Choose, 2) ;<=Trimm it
  54.  
  55.     $CharsGetting_Choose = StringLeft($NumberOfChar_ChooseTrimm, $NumberOfChar_Choose * 2) ;<=give me the (file.***) (whatever that word was)
  56.     $CharsToString_Choose = BinaryToString("0x" & $CharsGetting_Choose)
  57.     $Specify_Result = @ScriptDir & "\Result." & $CharsToString_Choose ;<=Specify what the Result.**** <= was
  58.     $Specify_ResultTrimm = "0x" & StringTrimLeft($NumberOfChar_ChooseTrimm, $NumberOfChar_Choose * 2) ;<=Trimm it. $Specify_ResultTrimm has now the binded binary and can Decrypt it
  59.  
  60.     $Decode_Password = InputBox("Password getting", "The file is protected by a password." & @CRLF & "Warning it's Visible" & @CRLF & @CRLF & "The extracted will be Named Result." & $CharsToString_Choose, "\6sdx'sJX&,n21ads*")
  61.     If @error Then Exit ;<=Everyone likes long lines. You could click on Cancel on every Question to end the Programm.
  62.  
  63.     _Crypt_Startup()
  64.     Local $EnDecrypt_Algo = $CALG_RC4
  65.     Local $Derive_Decode_Password = _Crypt_DeriveKey($Decode_Password, $EnDecrypt_Algo)
  66.     Local $Decrypt_Binary = _Crypt_DecryptData($Specify_ResultTrimm, $Derive_Decode_Password, $CALG_USERKEY) ;<=Decrypt the Binded
  67.     _Crypt_DestroyKey($Derive_Decode_Password)
  68.     _Crypt_Shutdown()
  69.  
  70.     $Base64EnDecode_String = _Base64Decode(BinaryToString($Decrypt_Binary)) ;<=To make it not as easy for the hacker to crack this, it is =>Base64=>
  71.  
  72.     FileDelete($Specify_Result) ;<=Make room for the new Result file
  73.     $Write_FileOpen = FileOpen($Specify_Result, 16 + 1)
  74.     FileWrite($Write_FileOpen, $Base64EnDecode_String) ;<=Write The Decrypted,Decoded file down.
  75.  
  76.     Beep(500, 500) ;<=Booop(s)
  77.  
  78.     Exit
  79.  
  80. ElseIf $iAnswer = 6 Then ;<= On Yes
  81.     $C_Choose_Runtime = FileOpenDialog("Choose File for Runtime", @ScriptDir, "(*.*)", 1) ;<=Choose a file which should be running when clicked on file(runtime)
  82.     If @error Then Exit
  83.  
  84.     $ExtractFileName = StringTrimLeft($C_Choose_Runtime, StringInStr($C_Choose_Runtime, "\", 1, -1)) ;<=Get Filename and (.***)
  85.  
  86.     $C_Choose_Bind = FileOpenDialog("Choose File to Bind", @ScriptDir, "(*.*)", 1) ;<=Choose the File to be Encrypted and binded!
  87.     If @error Then Exit
  88.  
  89.     $ExtractEndung_Bind = StringMid($C_Choose_Bind, StringInStr($C_Choose_Bind, ".") + 1, -1) ;<=Binded (file.***)
  90.     $GetLengOf_ExtractEndung = StringLen($ExtractEndung_Bind) ;<=Leng of $ExtractEndung_Bind
  91.  
  92.     $Specify_Result = @ScriptDir & "\Binded_" &  $ExtractFileName
  93.  
  94.     $Encode_Password = InputBox("Password giving", "The file will be encrypted" & @CRLF & "Choose Password. Warning it's Visible" & @CRLF & @CRLF & "The binded file will be Named Binded_" & $ExtractFileName, "\6sdx'sJX&,n21ads*")
  95.     If @error Then Exit ;<=Remember it ^^
  96.  
  97.     $O_Choose_Bind = FileOpen($C_Choose_Bind, 16) ;<=Open In binary
  98.     $R_Choose_Bind = FileRead($O_Choose_Bind) ;<=Read it
  99.     $Base64EnDecode_String = _Base64Encode(BinaryToString($R_Choose_Bind)) ;<=Encode it =>Base64=>
  100.  
  101.     _Crypt_Startup()
  102.     Local $EnDecrypt_Algo = $CALG_RC4
  103.     Local $Derive_Decode_Password = _Crypt_DeriveKey($Encode_Password, $EnDecrypt_Algo)
  104.     Local $Encrypt_Binary = _Crypt_EncryptData($Base64EnDecode_String, $Derive_Decode_Password, $CALG_USERKEY) ;<= Encrypt the Base64 string with a algorithm for RC4
  105.     _Crypt_DestroyKey($Derive_Decode_Password)
  106.     _Crypt_Shutdown()
  107.  
  108.     $O_Choose_Runtime = FileOpen($C_Choose_Runtime, 16) ;<=Open In binary
  109.     $R_Choose_Runtime = FileRead($O_Choose_Runtime) ;<=Read it
  110.     FileDelete($Specify_Result) ;<=Make room for the new Result file
  111.     $O_Result = FileOpen($Specify_Result, 16 + 1)
  112.     FileWrite($O_Result, $R_Choose_Runtime) ;<=First Write the Runtimefile
  113.     FileWrite($O_Result, StringToBinary("-=TESTME=-" & $GetLengOf_ExtractEndung & $ExtractEndung_Bind)) ;<=Then write a "Trenner", the Leng of $ExtractEndung_Bind & the (.***)
  114.     FileWrite($O_Result, $Encrypt_Binary) ;<=Nooow write to the end the encrypted file
  115.     FileClose($O_Result)
  116.     FileClose($O_Choose_Runtime)
  117.  
  118.     Beep(500, 500) ;<= boop booooop boooooop(s)
  119.  
  120.     Exit
  121.  
  122.     ;Programm is here, couple of lines and chars big
  123.     ;Then there is in the mid of nothing coming a line like -=TESTME=-3jpg 3 stands for the leng of the chars behind =-3=>
  124.     ;So the program now knows how much chars he has to read and trim. After it it has 3 chars which is in this case jpg
  125.     ;Now it knows that the binded file is a .jpg which could be usefull when sending file with special(.***)(not knowing the word)
  126.     ;and all after it is the binded encrypted file.
  127.  
  128.     ;File looks like this:
  129.     ;Here is the Source of the Runtime File, like a .mp3
  130.     ;Then there comes on the end of the .mp3 => -=TESTME=-6ascipq
  131.     ;All after it is the Encrypted file!
  132.  
  133. EndIf
  134. Exit
Advertisement
RAW Paste Data Copied
Advertisement