Analyzing JavaScript Files for Bug Bounty Hunters

Thexssrat
Geek Culture
Published in
3 min readApr 13, 2021

--

What is JS?

Javascript is a client-side object-oriented scripting language. In essence, this has several meanings:

  • Client-side, it runs on the computer of the client (victim)
  • Object-oriented (Programming term)
  • Scripting language, this means cross-site scripting is also possible

Developers have used this over the years to make static websites a bit more interactive and beautiful with things like javascript image carrousels but also XHR requests and AJAX requests to the backend server to automatically fill in a page. Javascript can do many things and for this reason it’s of interest to us.

We can either analyze a javascript file statically (not running it) and dynamically (debugging or running it). We will mostly focus on static analysis here.

What does a JS file contain?

Besides the regular cross site scripting sinks (locations where our XSS attack vector is reflected in the JS) we can also find several other juicy secrets in there that we can use.

These secrets can contain but are not limited to:

  • New endpoints, one time i found a whole list of endpoints in the comments
  • Hidden parameters
  • API keys, sometimes they are supposed to be public though, so be careful with these. Verify the impact before you report…

--

--

Thexssrat
Geek Culture

No b*llshit Hacking tutorials with extreme value in short bursts