Jump to content

How to reverse engineir Javascript


Recommended Posts

So I have a question. How do I reverse enginer a Javascript file? The problem comes from my previous thread: 

The goal is to get the request headers the website has so I can scrape data from the website. The problem is that the website uses a javasricpt to download the request headers and can therefore not be seen in chrome. In the script that the website uses, headers.js does someother mean things. It replaces the http connection with a websocket one:


So I want to run the javascript file so I can print out the final url that it creates complete with headers. Right now they don't show up.

Maybe a way would be to directly interact with the website, maybe the chrome console?

Link to JS if anyone would able to help: https://www.avanza.se/jmvc/production/241897.18/header/header.js

Link to comment
Share on other sites

Try using the JavaScript console. CTRL+SHIFT+J opens the console. you can either try manipulating or running the function directly in the console, or open the network tab, hit refresh, then run the page. You can then click on each item, and read the header values. Export as HAR, or cURL. Somewhere between all of this, you should be able to see the headers needed, and the URL's you want, or even use the sources tab, set a breakpoint and debug the script manually.


Finally, if you can download the JS, you should be able to reverse engineer it directly, but there are a number of online sites you can paste code in and it will spit out results. Deobfuscation sites or even jsbeautifier help clean up and make code easier to read and then work out the parts you need to create the end result.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...