0

there is a website and I want to create the link address that can automate the login process.

from the login page source code, I understood that it will submit the id, passwd values with post method in form.

but I want to know the entire 'url' address which this form submission leads to. I mean, eventually it will pass on the id, passwd values like in 'somewebpage?id=someid&passwd=somepw' right? (of course it will be processed with encodeURIComponent by the form)

this parameter included url address is what I'm looking for because I think if I know this, then I can automate the login process.

However, this address is not explicitly shown(not even for a brief moment). Is there a trick to somehow 'alert()' this url address or view it through chrome developer tools or something?

here's the login page example by the way:

<form id="login" name="login" class="login" method="post"
      action="" enctype="application/x-www-form-urlencoded"
      style="background-image: url(../main/image/index.gif)">
<input type="hidden" name="url" value="../main/index.cgi" />

<table class="login-form">
<tr>
  <td>
    <table>
    <tr>
      <td class="label"><label for="login_id">ID</label></td>
      <td class="input">
      <input type="text" id="login_id" name="id" value="" onclick="select();" maxlength="8"/>
    </td>
    </tr> 
    <tr>
      <td class="label"><label for="login_passwd">Passwd</label></td>
      <td class="input">
      <input type="password" id="login_passwd" name="passwd" value="" onclick="select();" maxlength="8"/> 
      </td>
    </tr>
    </table>
  </td>
  <td>
  <input type="submit" id="login_submit" value="Go" />
  </td>
</tr>
<tr>

</tr>
</table>
</form>
kwagjj
  • 607
  • 1
  • 8
  • 19

3 Answers3

1

You should be able to see the POST url in firebug net panel.

minion
  • 4,037
  • 2
  • 15
  • 32
  • this got me to the point which I wanted but still there seems to be some conflicts with reality and my predictions. still, thanks for introducing such a good tool – kwagjj Feb 12 '15 at 05:47
1

Form action attribute defines where the form will be submitted.

<form action="demo_form.asp" method="get">

The current form you have will submit to it self, meaning the current url the form is now on.

You can see the page properties from chrome developer tools network tab.

Azadey
  • 11
  • 4
  • yep I understand that part. but I want to know the entire url with the variables attached in POST method. how can I view this? – kwagjj Feb 12 '15 at 03:48
  • To prcess the login are you using php ? if so you can put a `die()` in the current page if the `GET` parameter is there and view the full url. – Azadey Feb 12 '15 at 03:54
1

When there is no url in action the page, the form will post to itself. So all you would need to do is post the username and password to this page using the name of the input. On the server side, the username and password will be checked against the DB. To automate the post process look at the function here: https://stackoverflow.com/a/133997/3402205

Community
  • 1
  • 1
Geoff Lentsch
  • 916
  • 10
  • 16
  • I was thinking of extending the automation process using bash terminal in the end, but I guess this could be an option... – kwagjj Feb 12 '15 at 04:04
  • I just assumed you wanted to automate using JavaScript, because the tags said JavaScript. To do this in bash, you could just use curl, and set the url to that of the login page, where you pulled this html. – Geoff Lentsch Feb 12 '15 at 04:09