Skip to main content
The 2024 Developer Survey results are live! See the results
Bounty Ended with 50 reputation awarded by CommunityBot
Expanded explaination
Source Link

Edit to expand on how I discovered the link:

I opened up the websites source code using the Inspect function of Chrome, then started reading JavaScript that attempts to display the pdf. At the end of the source there is part:

  /**
   * Asynchronously downloads PDF.
   */
  PDFJS.getDocument(url).then(function (pdfDoc_)

The url paremeter looked promising, so I looked where it was defined:

var url = Base64.decode(getParameterByName('pdfName'));  

Function getParameterByName:

    function getParameterByName(name) { 
        name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
        var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
        results = regex.exec(location.search);
        return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
    }

This function takes parameter name you give it, escapes any square brackets (adds \ before any [ and ] characters), and adds it to a regular expression that looks for a string looking like (in this example) ?pdfName=(any string not containing & or #). You can see how the regular expression works here.

Function then grabs the part of the website url after pdfview.html (using location.search) and applies to it the regular expression it made earier and if it matches, returning the part after = character.

This is where it all falls apart a little, since the URL provided doesn't contain any = characters and the function returns an empty string, but that's where humans pattern matching ability is better than computers - it's easy to see that the URL contains part ?pdfName, so the rest is probably the parameter we are looking for. All that was left was to stick the string aHR0cHM6Ly93d3cuaWJwcy5pbi93cC1jb250ZW50L3VwbG9hZHMvQ1JQLVBPLUlYdmdndi1OT1RJQ0UucGRm into a Base64 decoder and I was pleasantly surprised to see a working URL for the PDF file. I also suspected that, despite the name, the Base64 decoder used in the script wasn't completely standard, so I copied it's definition from the pages source code (var Base64={... ), pasted it into console in Chrome DevTools and ran

Base64.decode('aHR0cHM6Ly93d3cuaWJwcy5pbi93cC1jb250ZW50L3VwbG9hZHMvQ1JQLVBPLUlYdmdndi1OT1RJQ0UucGRm')

to verify I got the same answer.


Sorry if this is too high level, but once you discover how to get one link, getting others using the same method is trivial: simply copy part of the address after ?pdfName to a base64 decoder and click decode to get the PDF link.


Edit to expand on how I discovered the link:

I opened up the websites source code using the Inspect function of Chrome, then started reading JavaScript that attempts to display the pdf. At the end of the source there is part:

  /**
   * Asynchronously downloads PDF.
   */
  PDFJS.getDocument(url).then(function (pdfDoc_)

The url paremeter looked promising, so I looked where it was defined:

var url = Base64.decode(getParameterByName('pdfName'));  

Function getParameterByName:

    function getParameterByName(name) { 
        name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
        var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
        results = regex.exec(location.search);
        return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
    }

This function takes parameter name you give it, escapes any square brackets (adds \ before any [ and ] characters), and adds it to a regular expression that looks for a string looking like (in this example) ?pdfName=(any string not containing & or #). You can see how the regular expression works here.

Function then grabs the part of the website url after pdfview.html (using location.search) and applies to it the regular expression it made earier and if it matches, returning the part after = character.

This is where it all falls apart a little, since the URL provided doesn't contain any = characters and the function returns an empty string, but that's where humans pattern matching ability is better than computers - it's easy to see that the URL contains part ?pdfName, so the rest is probably the parameter we are looking for. All that was left was to stick the string aHR0cHM6Ly93d3cuaWJwcy5pbi93cC1jb250ZW50L3VwbG9hZHMvQ1JQLVBPLUlYdmdndi1OT1RJQ0UucGRm into a Base64 decoder and I was pleasantly surprised to see a working URL for the PDF file. I also suspected that, despite the name, the Base64 decoder used in the script wasn't completely standard, so I copied it's definition from the pages source code (var Base64={... ), pasted it into console in Chrome DevTools and ran

Base64.decode('aHR0cHM6Ly93d3cuaWJwcy5pbi93cC1jb250ZW50L3VwbG9hZHMvQ1JQLVBPLUlYdmdndi1OT1RJQ0UucGRm')

to verify I got the same answer.


Sorry if this is too high level, but once you discover how to get one link, getting others using the same method is trivial: simply copy part of the address after ?pdfName to a base64 decoder and click decode to get the PDF link.

Source Link

Is that this one?

The url of this website can be broken down to https://www.ibps.in/pdfview.html?pdfName(base64 encoded URL of the PDF)

Decode that last part (using any one of many online base64 decoders) , and you get the link.

I can't verify if it's correct, since the pdf on the page itself won't load for me (Chrome refuses to load js scripts with MIME type 'application/octet-stream' instead of 'text/javascript')