![]() |
|
Simple Browser detection in JavaScript - Printable Version +- Sinisterly (https://sinister.li) +-- Forum: Hacking (https://sinister.li/Forum-Hacking) +--- Forum: Hacking Tools (https://sinister.li/Forum-Hacking-Tools) +---- Forum: Hacxx's Posts (https://sinister.li/Forum-Hacxx-s-Posts) +---- Thread: Simple Browser detection in JavaScript (/Thread-Simple-Browser-detection-in-JavaScript) |
Simple Browser detection in JavaScript - hacxx - 02-12-2019 A simple method developed in JavaScript to detect browser type and version Browser Info.html Code: <script>
// Identify Browsers
// By default browsers use misleading information, the solution is specify the version
if (navigator.userAgent.indexOf("Firefox/54") != -1) {alert('Using Firefox v54');}
if (navigator.userAgent.indexOf("rv:11.0") != -1) {alert('Using IE v11');}
if (navigator.userAgent.indexOf("Version/5.1.7") != -1) {alert('Using Safari v5.1.7');}
if (navigator.userAgent.indexOf("Edge/14") != -1) {alert('Using Edge v14');}
if (navigator.userAgent.indexOf("OPR") != -1) {alert('Using Opera 46.0');}
if (navigator.userAgent.indexOf("Chrome/59") != -1) {alert('Using Chrome v59');}
</script>Download: https://www.file-up.org/5nm40aywb3k3 Virus Scan: https://www.virustotal.com/#/file/fa488b9b00b501dc46768fd4e94a435b034a71ba1bef709443876a2fbd90b7c4/detection RE: Simple Browser detection in JavaScript - hacxx - 04-09-2019 (02-12-2019, 02:32 PM)UplayAlts Wrote: I tried this and it seems to detect Brave under chrome, makes sense because it's chromium Yes, that just a misconfiguration because the script is only looking for the word Chrome in the User Agent. If you want to create a detection script for Brave Browser just use the word Brave or specify a version if you are developing exploit kits. For example Brave/0.37 or brave/0.8 Here is an example of Brave Browser User Agent... Code: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) brave/0.8.3 Chrome/49.0.2623.108 Brave/0.37.3 Safari/537.36RE: Simple Browser detection in JavaScript - mothered - 04-10-2019 Those who're Interested, here's a comprehensive list of user agent strings. |