{"record":{"id":"7933fa75c0ae1624","repo":"peass-ng/PEASS-ng","slug":"something-failed-downloading-peass-script-from-u","errorCode":null,"errorMessage":"Something failed downloading PEASS script from #{url_peass}","messagePattern":"Something failed downloading PEASS script from #(.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"metasploit/peass.rb","lineNumber":284,"sourceCode":"    # Load the PEASS script from a local file or from Internet\n    peass_script = \"\"\n    url_peass = \"\"\n    # 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","sourceCodeStart":266,"sourceCodeEnd":302,"githubUrl":"https://github.com/peass-ng/PEASS-ng/blob/53fb989abc2219826385683a6fee826bd6cd38d6/metasploit/peass.rb#L266-L302","documentation":"After parsing and fetching the PEASS URL, the module checks that the downloaded body is at least 500 characters and raises this error otherwise. A tiny body means the fetch did not return the real PEASS binary/script — typically an error page, redirect notice, or empty response.","triggerScenarios":"fetch(target) succeeds at HTTP level but returns a body < 500 bytes: a 404/403 HTML error page served with 200, an auth/captive-portal page, a truncated response, or an empty proxy response.","commonSituations":"Hosting linpeas.sh on a web server that returns a login redirect or 404 page with status 200; a proxy/firewall injecting a block page; GitHub rate limiting; uploading a placeholder file to a local web server; TLS-intercepting appliance returning a notice page.","solutions":["Open the URL in a browser or 'curl -s <url> | wc -c' and verify it returns the actual PEASS file (>500 bytes)","Fix the web server path/permissions so the real file is served instead of an error page","Re-upload the correct linpeas.sh/winPEASany_ofs.exe to your hosting server","Bypass or correctly configure the proxy that is returning an interception/block page","Clear CUSTOM_URL to fall back to the official GitHub release download"],"exampleFix":"# before\nset CUSTOM_URL http://10.0.0.5/peass.sh   # serves 404 page\n# after\n# copy the real file to the webroot, then\nset CUSTOM_URL http://10.0.0.5/linpeas.sh","handlingStrategy":"validation","validationCode":"body = Net::HTTP.get_response(URI(url)).body\nraise 'URL does not serve the PEASS payload' if body.nil? || body.length < 500","typeGuard":null,"tryCatchPattern":"begin\n  res = fetch(target)\n  raise 'empty response' if res.nil? || res.body.to_s.length < 500\nrescue StandardError => e\n  print_error(\"PEASS download failed: #{e.message}; verify the URL serves the real file\")\nend","preventionTips":["Verify with 'curl -sI <url>' that the file is served with 200 and a plausible size","Host the genuine release file, not a redirect or placeholder","Bypass misconfigured proxies/TLS interceptors","Prefer the default GitHub release URL over custom hosting"],"tags":["network","download","metasploit","http"],"backgroundTag":"download-failed","analyzedSha":"53fb989abc2219826385683a6fee826bd6cd38d6","analyzedAt":"2026-09-02T04:25:09.259Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T11:17:12.671Z"}