peass-ng/PEASS-ng · error · RuntimeError
PEASS local file (#{url_peass}) does not exist!
Error message
PEASS local file (#{url_peass}) does not exist! What it means
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.
Source
Thrown at metasploit/peass.rb:287
# If no URL is set, use the default one
if datastore['CUSTOM_URL'] != ""
url_peass = datastore['CUSTOM_URL']
else
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"
end
# If URL is set, check if it is a valid URL or local file
if url_peass.include?("http://") || url_peass.include?("https://")
target = URI.parse url_peass
raise 'Invalid URL' unless target.scheme =~ /https?/
raise 'Invalid URL' if target.host.to_s.eql? ''
res = fetch(target)
peass_script = res.body
raise "Something failed downloading PEASS script from #{url_peass}" if peass_script.length < 500
else
raise "PEASS local file (#{url_peass}) does not exist!" unless ::File.exist?(url_peass)
peass_script = File.read(url_peass)
raise "Something falied reading PEASS script from #{url_peass}" if peass_script.length < 500
end
return peass_script
end
def aes_enc_peass(peass_script)
# Encrypt the PEASS script with AES (CBC Mode)
key = datastore["PASSWORD"]
iv = OpenSSL::Cipher::Cipher.new('aes-256-cbc').random_iv
c = OpenSSL::Cipher.new('aes-256-cbc').encrypt
c.iv = iv
c.key = key
encrypted = c.update(peass_script) + c.final
encrypted = [encrypted].pack('m')
View on GitHub (pinned to 53fb989abc)
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
Example fix
# before set CUSTOM_URL /tmp/linpeas.sh # file is actually elsewhere # after set CUSTOM_URL /opt/peass/linpeas.sh
Defensive patterns
Strategy: validation
Validate before calling
raise ArgumentError, "PEASS file #{path} does not exist" unless File.exist?(path) Try / catch
begin peass_script = load_peass rescue RuntimeError => e print_error(e.message) end
Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.
Related errors
- Something falied reading PEASS script from #{url_peass}
- openssl not found on victim, unset the password of the modul
- base64 not found on victim, set a 32B length password!
- Neither curl nor wget were found in victim, unset the SRVHOS
- Something failed downloading PEASS script from #{url_peass}
AI-assisted analysis of peass-ng/PEASS-ng@53fb989abc (2026-09-02).
Data as JSON: /api/errors/86b214d3dc5028cd.
Report an issue: GitHub.