Upgrade to Pro — share decks privately, control downloads, hide ads and more …

BSides Jaipur

Sahil Dari
October 06, 2023

BSides Jaipur

Sahil Dari

October 06, 2023
Tweet

More Decks by Sahil Dari

Other Decks in Technology

Transcript

  1. what is JavaScript analysis?  Add-on to your regular Web

    Application Assessment.  Static part of the DAST.  Widen your scope of Web Application Assessment.
  2. why perform JavaScript analysis?  Your scope of testing widens

    and the probability to find bugs increases.  You can find Hardcoded Sensitive Data, Hidden parameters, Hidden Functions, Hidden Endpoints, Encryption/Decryption keys, etc.
  3. how to get JavaScript files?  By Using gau, waybackurls

    or other command line tools.  Output all the URLs from gau/waybackurls in a file URLs.txt  Open URLs.txt in Sublime-text  Find all URLs with .js and copy these URLs.  Open the copied URLs in your browser running BurpSuite Proxy.
  4. how to get JavaScript files? contd…  By using BurpSuite

    Professional  Always turn on your BurpSuite proxy while navigating to your Web Application.  Do your normal Manual Testing and after you are done, Navigate to Targets > The URL in scope > Right Click > Engagement Tools > Find Scripts > Export Scripts > Save to a file.  Save all the JavaScript of the application in scope to Scipts.js.
  5. how to perform JavaScript Analysis  Now we have all

    the JavaScript “code” curated in a single file (Scripts.js)  Open Scripts.js in Sublime-text.
  6. keywords for Hardcoded Secrets  secret  password  token

     key  private  pass  user  code
  7. keywords for Hidden Endpoints  api  v1  v2

     json  post  get  localhost  data  content
  8. keywords for Hidden/Interesting Functions  reset  password  forgot

     forget  admin  super  verify  encrypt/decrypt  encode/decode
  9. bugs I found via JavaScript Analysis  Account Take Over

     AES Encryption/Decryption Keys  AWS secrets  PII Information Leaks  Hidden Endpoints