{"record":{"id":"1b2991b90fb77ec2","repo":"peass-ng/PEASS-ng","slug":"base64-not-found-on-victim-set-a-32b-length-passw","errorCode":null,"errorMessage":"base64 not found on victim, set a 32B length password!","messagePattern":"base64 not found on victim, set a 32B length password!","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"metasploit/peass.rb","lineNumber":128,"sourceCode":"        # As the PS function is only capable of decrypting readable strings\n        # in Windows we encrypt the B64 of the binary and then load it in memory \n        # from the initial B64. Then: original -> B64 -> encrypt -> B64\n        aes_enc_peass_ret = aes_enc_peass(Base64.encode64(peass_script)) # Base64 before encrypting it\n        peass_script_64 = aes_enc_peass_ret[\"encrypted\"]\n        key_b64 = aes_enc_peass_ret[\"key_b64\"]\n        iv_b64 = aes_enc_peass_ret[\"iv_b64\"]\n        load_winpeas = get_ps_aes_decr()\n        \n        ps_var2 = rand(36**6).to_s(36)\n        load_winpeas += \"$#{ps_var2} = DecryptStringFromBytesAes \\\"#{key_b64}\\\" \\\"#{iv_b64}\\\" $#{ps_var1};\"\n        load_winpeas += \"$#{rand(36**7).to_s(36)} = [System.Reflection.Assembly]::Load([Convert]::FromBase64String($#{ps_var2}));\"\n      end\n    \n    else\n      # If no Windows, check if base64 exists\n      if !session.platform.include?(\"win\")\n        base64_path = cmd_exec(\"command -v base64\")\n        raise 'base64 not found on victim, set a 32B length password!' unless base64_path.include?(\"base64\")\n      end\n\n      # Encode PEASS script\n      print_status(\"Encoding PEASS in Base64...\")\n      peass_script_64 = Base64.encode64(peass_script)\n\n      # Needed code to decode it in Unix and Windows\n      decode_linpeass_cmd = \"base64 -d\"\n      load_winpeas = \"$#{rand(36**6).to_s(36)} = [System.Reflection.Assembly]::Load([Convert]::FromBase64String($#{ps_var1}));\"\n    \n    end\n    \n    # Write obfuscated PEASS to a local file\n    file = Tempfile.new('peass_metasploit')\n    file.write(peass_script_64)\n    file.rewind\n    @temp_file_path = file.path\n","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/peass-ng/PEASS-ng/blob/53fb989abc2219826385683a6fee826bd6cd38d6/metasploit/peass.rb#L110-L146","documentation":"When no PASSWORD is set, peass.rb base64-encodes the PEASS script and relies on the victim's base64 binary to decode it. If `command -v base64` finds nothing on a non-Windows session, the module raises this error, asking you to either ensure base64 exists or switch to a 32-byte-length PASSWORD (OpenSSL path).","triggerScenarios":"Running the peass module with PASSWORD unset (or length <= 1) against a Unix session where `command -v base64` returns empty — base64 utility missing from the victim's PATH.","commonSituations":"Minimal Docker images or BusyBox systems without coreutils base64; alternative base64 implementations with different names/paths.","solutions":["Install base64 (coreutils) on the victim or provide it at a PATH-visible location","Set a PASSWORD (32-byte length recommended) so the module uses openssl instead of base64","Verify `command -v base64` works on the session before running the module"],"exampleFix":"# before\nrun_single(\"use multi/meterpreter/peass; set SRVHOST 10.0.0.5; run\")\n# after\nrun_single(\"use multi/meterpreter/peass; set PASSWORD a]GK9s2LmV4bQz7XpR1tNw8yJeF6HdC3; run\")","handlingStrategy":"validation","validationCode":"if session.platform !~ /win/\n  b64 = session.shell_command_token(\"command -v base64\")\n  raise \"base64 missing; set a PASSWORD instead\" unless b64.to_s.include?(\"base64\")\nend","typeGuard":null,"tryCatchPattern":"begin\n  run_single(\"use multi/meterpreter/peass; unset PASSWORD; run\")\nrescue ::Exception => e\n  print_error(\"#{e.message}; retrying with openssl-based password\")\n  run_single(\"use multi/meterpreter/peass; set PASSWORD <32-char-password>; run\")\nend","preventionTips":["Verify base64 exists on the victim before running without PASSWORD","Use a 32B password so the module uses openssl instead","Upload a busybox/coreutils base64 binary if the target lacks one"],"tags":["metasploit","base64","victim-environment"],"backgroundTag":"missing-binary-on-target","analyzedSha":"53fb989abc2219826385683a6fee826bd6cd38d6","analyzedAt":"2026-09-02T04:25:09.259Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T11:17:12.671Z"}