Jump to content
UBot Underground

Recommended Posts

I am trying to do a http post to log into a site.

Below is what I got from live http headers

 

CSRFName=CSRF1103754532_791906178&CSRFToken=8687482b73766e6d88494351e4ee362f118d103d36d93e2855a79056449754f9f8ea5ebe9e96b4673bad22076774ec85d8c7d7f5b4c4cdd3bd577f2921ee7eab&page=login&action=login_post&email=info%40mydomain.com&password=password: undefined


I need to be able to extract the CSRFName

and the CSRFToken using regex and save it to a list.

 

The part I am stuck on is extracting the CSRFName and CSRFToken

in order to put those variables in the http post.

 

I tried using this (?<=CSRFName\=).(?=\&CSRFToken)

 

To get the CSRFName.

Not working.

 

If somebody could point me in the direction I would really appreciate it.

 

The site I am trying to log into is http://www.freeglobalclassifiedads.com/user/login

 

Thank you.

 

Link to post
Share on other sites

You are very close, you need to put a * after the . because you want more than one (of anything), try this:

set(#input,"CSRFName=CSRF1103754532_791906178&CSRFToken=8687482b73766e6d88494351e4ee362f118d103d36d93e2855a79056449754f9f8ea5ebe9e96b4673bad22076774ec85d8c7d7f5b4c4cdd3bd577f2921ee7eab&page=login&action=login_post&email=info%40mydomain.com&password=password: undefined","Global")
set(#csrfName,$find regular expression(#input,"(?<=CSRFName\\=).*?(?=&)"),"Global")
set(#csrfToken,$find regular expression(#input,"(?<=CSRFToken\\=).*?(?=&)"),"Global")
Link to post
Share on other sites

Thank you. Your addition worked. However, I had given you the wrong information to make the regex code from.

I got the info from the http headers but I really needed to get it from the html source code.

 

So the code that worked for one of the variables ended up being.

(?<=CSRFName\'\ value\=\').*(?=\'\ \/\>) 

Because I needed to take it from here:

<input type='hidden' name='CSRFName' value='CSRF1103754532_1655122622' />

Also, I sent you an email about your regex builder which I just bought.

 

I noticed that there was not a place for "target" as in the videos.

 

Is there another way I can define the target using the software?

 

Thank you for your help. I really appreciate it!

 

Matt

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...