Search code examples
javascriptphpformssql-injection

View the php script of any site with browser


I'm trying to hack a riddle like game on a website where we enter the correct answer and proceed to next level. In the source I've found the form is defined as <form id="submission-form" class="row" action="#" name="subForm"> and the following script

$('form').on('submit', function(e){e.preventDefault();submitAnswer();});

I tried to find the definition of submitAnswer() function but couldn't find any in all the scripts. And When I submit the form my browser makes a post request to the php file which is mentioned in the page url also.
So my questions are

  1. Is the submitAnswer a php function and if not is there any way to find its definition?
  2. Can I view the php script that the form is posting to anyhow.
  3. This one is lame , Is there any way I can extract the correct answer from the server(by sql injection or some tool) ?

Solution

    1. submitAnswer() is a Javascript function and is there somewhere, if you look hard enough.
    2. No.
    3. Probably not, depending on the proficiency of the programmer who setup the PHP code.