{"record":{"id":"0619c64382d18c15","repo":"peass-ng/PEASS-ng","slug":"openssl-not-found-on-victim-unset-the-password-of","errorCode":null,"errorMessage":"openssl not found on victim, unset the password of the module!","messagePattern":"openssl not found on victim, unset the password of the module!","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"metasploit/peass.rb","lineNumber":94,"sourceCode":"        OptString.new('URIPATH', [false, 'URI path to download the script from there (only used if SRVHOST)', \"/\" + rand(36**4).to_s(36) + \".txt\"])\n      ])\n    \n    @temp_file_path = \"\"\n  end\n\n  def run\n    ps_var1 = rand(36**5).to_s(36) # Winpeas PS needed variable\n\n    # Load PEASS script in memory\n    peass_script = load_peass()\n    print_good(\"PEASS script successfully retrieved.\")\n\n    # Obfuscate loaded PEASS script\n    if datastore[\"PASSWORD\"].length > 1\n      # If no Windows, check if openssl exists\n      if !session.platform.include?(\"win\")\n        openssl_path = cmd_exec(\"command -v openssl\")\n        raise 'openssl not found on victim, unset the password of the module!' unless openssl_path.include?(\"openssl\")\n      end\n\n      # Get encrypted PEASS script in B64\n      print_status(\"Encrypting PEASS and encoding it in Base64...\")\n      \n      # Needed code to decrypt from unix\n      if !session.platform.include?(\"win\")\n        aes_enc_peass_ret = aes_enc_peass(peass_script)\n        peass_script_64 = aes_enc_peass_ret[\"encrypted\"]\n        key_hex = aes_enc_peass_ret[\"key_hex\"]\n        iv_hex = aes_enc_peass_ret[\"iv_hex\"]\n        decode_linpeass_cmd = \"openssl aes-256-cbc -base64 -d -K #{key_hex} -iv #{iv_hex}\"\n      \n      # Needed code to decrypt from Windows\n      else\n        # 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","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/peass-ng/PEASS-ng/blob/53fb989abc2219826385683a6fee826bd6cd38d6/metasploit/peass.rb#L76-L112","documentation":"The peass.rb Metasploit module encrypts the PEASS script with OpenSSL when a PASSWORD is set, so the victim must have an openssl binary to decrypt it. Before uploading, run checks `command -v openssl` on the session; on a non-Windows session without openssl it aborts with this error, telling you to unset PASSWORD (use plain base64 encoding instead).","triggerScenarios":"Running the peass module with datastore['PASSWORD'] longer than 1 char against a Unix/Linux session whose `command -v openssl` returns nothing (openssl not installed or not in PATH).","commonSituations":"Minimal containers, BusyBox-based systems, stripped embedded devices, or restricted PATH on the victim where openssl is absent.","solutions":["Unset the PASSWORD datastore option so the script is sent base64-encoded instead of encrypted","Install openssl on the victim (e.g. `apt install openssl`)","Ensure openssl is in the PATH used by cmd_exec"],"exampleFix":"# before\nrun_single(\"use multi/meterpreter/peass; set PASSWORD mysecretpw; run\")\n# after\nrun_single(\"use multi/meterpreter/peass; unset PASSWORD; set SRVHOST 10.0.0.5; run\")","handlingStrategy":"validation","validationCode":"# check on the victim session before running peass with PASSWORD\nif session.platform !~ /win/\n  openssl_path = session.shell_command_token(\"command -v openssl\")\n  raise \"openssl missing on victim; unset PASSWORD\" unless openssl_path.to_s.include?(\"openssl\")\nend","typeGuard":null,"tryCatchPattern":"begin\n  run_single(\"use multi/meterpreter/peass; set PASSWORD xxx; run\")\nrescue ::Exception => e\n  print_error(\"#{e.message}; retrying without PASSWORD\")\n  run_single(\"use multi/meterpreter/peass; unset PASSWORD; run\")\nend","preventionTips":["Run `command -v openssl` on the session before setting PASSWORD","Fall back to base64 (unset PASSWORD) on minimal targets","Pre-install openssl or upload a static binary to the victim"],"tags":["metasploit","openssl","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"}