{"record":{"id":"86b214d3dc5028cd","repo":"peass-ng/PEASS-ng","slug":"peass-local-file-url-peass-does-not-exist","errorCode":null,"errorMessage":"PEASS local file (#{url_peass}) does not exist!","messagePattern":"PEASS local file \\(#(.+?)\\) does not exist!","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"metasploit/peass.rb","lineNumber":287,"sourceCode":"    # If no URL is set, use the default one\n    if datastore['CUSTOM_URL'] != \"\"\n      url_peass = datastore['CUSTOM_URL']\n    else\n      url_peass = datastore['WINPEASS'].to_s.strip.downcase == 'true' ? \"https://github.com/peass-ng/PEASS-ng/releases/latest/download/winPEASany_ofs.exe\" : \"https://github.com/peass-ng/PEASS-ng/releases/latest/download/linpeas.sh\"\n    end\n    # If URL is set, check if it is a valid URL or local file\n    if url_peass.include?(\"http://\") || url_peass.include?(\"https://\")\n      target = URI.parse url_peass\n      raise 'Invalid URL' unless target.scheme =~ /https?/\n      raise 'Invalid URL' if target.host.to_s.eql? ''\n      \n      res = fetch(target)\n      peass_script = res.body\n\n      raise \"Something failed downloading PEASS script from #{url_peass}\" if peass_script.length < 500\n\n    else\n      raise \"PEASS local file (#{url_peass}) does not exist!\" unless ::File.exist?(url_peass)        \n      peass_script = File.read(url_peass)\n      raise \"Something falied reading PEASS script from #{url_peass}\" if peass_script.length < 500\n    end\n\n    return peass_script\n  end\n\n  def aes_enc_peass(peass_script)\n    # Encrypt the PEASS script with AES (CBC Mode)\n    key = datastore[\"PASSWORD\"]\n    iv = OpenSSL::Cipher::Cipher.new('aes-256-cbc').random_iv\n    \n    c = OpenSSL::Cipher.new('aes-256-cbc').encrypt\n    c.iv = iv\n    c.key = key\n    encrypted = c.update(peass_script) + c.final\n    encrypted = [encrypted].pack('m')\n","sourceCodeStart":269,"sourceCodeEnd":305,"githubUrl":"https://github.com/peass-ng/PEASS-ng/blob/53fb989abc2219826385683a6fee826bd6cd38d6/metasploit/peass.rb#L269-L305","documentation":"When CUSTOM_URL does not contain http:// or https://, the module treats it as a local filesystem path and raises this error unless the file exists. It fails fast before attempting File.read on a missing path.","triggerScenarios":"CUSTOM_URL is set to a relative or absolute path like '/tmp/peass.sh' that does not exist on the machine running Metasploit; typo in the filename; file was deleted or never staged; wrong path separator.","commonSituations":"Operator stages linpeas.sh on their attack box but sets a path valid on a different host; typo like /tmp/linpeas.sh.txt; file downloaded to a different directory; running msf from a container where the host path is not mounted.","solutions":["Verify the path with 'ls -l /path/to/file' on the host running Metasploit and correct CUSTOM_URL","Use an absolute path, not a relative one (relative paths resolve against the msfconsole working directory)","Upload/copy the PEASS script to the expected location before running the module","If you meant to download it, use a full http(s):// URL in CUSTOM_URL instead"],"exampleFix":"# before\nset CUSTOM_URL /tmp/linpeas.sh   # file is actually elsewhere\n# after\nset CUSTOM_URL /opt/peass/linpeas.sh","handlingStrategy":"validation","validationCode":"raise ArgumentError, \"PEASS file #{path} does not exist\" unless File.exist?(path)","typeGuard":null,"tryCatchPattern":"begin\n  peass_script = load_peass\nrescue RuntimeError => e\n  print_error(e.message)\nend","preventionTips":["Use absolute paths for CUSTOM_URL file mode","Confirm the file exists on the host running msfconsole (not another machine/container)","Check for typos and double extensions","Re-download the file if it may have been cleaned up"],"tags":["filesystem","metasploit","local-file","path"],"backgroundTag":"file-not-found","analyzedSha":"53fb989abc2219826385683a6fee826bd6cd38d6","analyzedAt":"2026-09-02T04:25:09.259Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T11:17:12.671Z"}