Cloudflare Bypasser for Nitro Type Race

Bypass Cloudflare

  1. // ==UserScript==
  2. // @name Cloudflare Bypasser for Nitro Type Race
  3. // @match https://www.nitrotype.com/race
  4. // @match https://www.nitrotype.com/race/*
  5. // @author Sing Developments
  6. // @grant none
  7. // @description Bypass Cloudflare
  8. // @license MIT
  9. // @version 2
  10. // @namespace https://singdevelopmentsblog.wordpress.com/?p=4354
  11. // @icon https://singdevelopmentsblog.files.wordpress.com/2022/11/nitrotype-logo.jpg
  12. // ==/UserScript==
  13.  
  14.  
  15. // This code is for educational purposes only and may not work or be safe to use.
  16. // It tries to reverse engineer the Cloudflare JavaScript challenge and make a request to the target website.
  17.  
  18. // Define the target website URL
  19. const targetURL = 'https://nitrotype.com/race';
  20.  
  21. // Define a function to extract the challenge parameters from the HTML source
  22. function getChallengeParams(html) {
  23. // Use regular expressions to match the challenge parameters
  24. const challenge = /name="jschl_vc" value="(\w+)"/.exec(html)[1];
  25. const pass = /name="pass" value="(.+?)"/.exec(html)[1];
  26. const s = /s\s*=\s*document\.createElement\('div'\);\s*s\.innerHTML\s*=\s*"(.+?)";/.exec(html)[1];
  27. const k = /k\s*=\s*'(\w+)';/.exec(html)[1];
  28. return {challenge, pass, s, k};
  29. }
  30.  
  31. // Define a function to solve the challenge expression using eval
  32. function solveChallengeExpr(expr) {
  33. // Replace document.getElementById with a dummy function
  34. expr = expr.replace(/document\.getElementById/g, 'function(){}');
  35. // Evaluate the expression and return the result
  36. return eval(expr);
  37. }
  38.  
  39. // Define a function to make a request using XMLHttpRequest
  40. function makeRequest(url, callback) {
  41. // Create a new XMLHttpRequest object
  42. const xhr = new XMLHttpRequest();
  43. // Open a GET request to the url
  44. xhr.open('GET', url);
  45. // Set the response type to text
  46. xhr.responseType = 'text';
  47. // Set the onload event handler to call the callback function with the response text
  48. xhr.onload = function() {
  49. callback(xhr.responseText);
  50. };
  51. // Send the request
  52. xhr.send();
  53. }
  54.  
  55. // Make an initial request to the target website
  56. makeRequest(targetURL, function(response) {
  57. // Get the challenge parameters from the response
  58. const params = getChallengeParams(response);
  59. // Solve the challenge expression using eval
  60. const answer = solveChallengeExpr(params.s + params.k);
  61. // Construct the verification URL with the challenge parameters and answer
  62. const verifyURL = targetURL + '/cdn-cgi/l/chk_jschl?jschl_vc=' + params.challenge + '&pass=' + params.pass + '&jschl_answer=' + answer;
  63. // Wait for 4 seconds before making the verification request
  64. setTimeout(function() {
  65. makeRequest(verifyURL, function(response) {
  66. // Check if the verification was successful
  67. if (response.includes('You are being redirected')) {
  68. // Redirect to the target website
  69. window.location.href = targetURL;
  70. } else {
  71. // Display an error message
  72. alert('Verification failed');
  73. }
  74. });
  75. }, 4000);
  76. });