Article by @idekdude

Introduction

Since you are reading this, I assume you already know what Akamai is and have a basic understanding of Javascript, therefore we will brush over the introductions, and get straight to it!


Where to start?

Akamai, in the sneaker community, is known as one of the easiest antibots to solve, but despite this, many of the new members to this community, are still lost. Which leads us to the question; Where to start? For Akamai the first step should be to find a copy of the script, to do this we can get it from the sources tab in devtools.

Obfuscated Akamai Script

Once we have found the script, we can then deobfuscate it using an online deobfuscator, such as this one. We can also use this toolbox made specifically for helping one in solving Akamai. Now, all we have to do is copy and paste the script into the deobfuscator, and set it to array mode! Our resulting output should no longer have all of those annoying arrays!

Deobfuscated Akamai Script

Whats Next??

Now that we have successfully deobfuscated this script, we can get onto the fun part! Reversing the script! In order to do this we want to go ahead and create two new files in the code editor of our choice (I will be using vscode), the files should be called, AkamaiDeob.js and AkamaiGen.js.

Our File Structure

In AkamaiDeob.js we want to paste the deobfuscated script we obtained earlier. Upon further inspecion of the deobfuscated script, we can see that there is a function called bpd, this is where the sensor data1 is formed.

Start of the bpd() function inside of the file.

Inside of our AkamaiGen.js file we want to put the following code in it.


bmak = {
            
}
          
Defines bmak class; holds the variables and functions needed to create sensor data.

Starting a Generator!

Now that we have both of our files setup, we can start reversing the functions in the script. The first function called inside of bpd() is bmak.sd_debug(), the majority of people ignore this function, as it is not needed. The first function of use to us, is right below it, bmak.get_cf_date(). If we search for that function in the script we will find this.


get_cf_date: function () {
  return Date.now ? Date.now() : +new Date
},
          

In reality, this function can be reduced to:


get_cf_date: function () {
  return Date.now()
}
          
This code does not have to be reduced if you do not want to.

You want to continue in this same format for the rest of the functions, when you encounter functions that are for browser values, such as: window, html, etc. you can use a data collecting website to gather these values. I suggest using this collecter to do so. In order to call our functions inside of the bmak class, we can make a function similar to bpd(), where you will assemble the sensor data. The final code snippet of this tutorial shows how to do just that.


bmak = {
  get_cf_date: function () {
    return Date.now ? Date.now() : +new Date();
  }
}

function gen_sensor() {
  var t = 0;
  try {
    t = bmak.get_cf_date();
  }
}
          
All of the functions inside of the bmak class are called in the same way as seen above.

I hope you enjoyed this article on getting started with Akamai, to complete you generator, you want to follow the same steps as we did for get_cf_date() with the rest of the functions that are called, including those that are called inside of ones are being called by bpd(). Good luck with Akamai!

@kronozdev by @casualhyped