quickregister 1 Posted January 18, 2018 Report Share Posted January 18, 2018 (edited) I am trying to log into this site using http post http://www.freeglobalclassifiedads.com/user/login Here is the code I have set(#freeglobalget, $plugin function("HTTP post.dll", "$http get", "http://www.freeglobalclassifiedads.com/user/login", "Mozilla", "http://www.freeglobalclassifiedads.com/user/login", "", ""), "Global") load html(#freeglobalget) set(#CSRFName, $find regular expression(#freeglobalget, "(?<=CSRFName\\\'\\ value\\=\\\').*(?=\\\'\\ \\/\\>)"), "Global") set(#CSRFToken, $find regular expression(#freeglobalget, "(?<=name\\=\\\'CSRFToken\\\'\\ value\\=\\\').*(?=\\\'\\ \\/\\>)"), "Global") load html($plugin function("HTTP post.dll", "$http post", "http://www.freeglobalclassifiedads.com", "CSRFName={#CSRFName}&CSRFToken={#CSRFToken}&page=login&action=login_post&email=info%40mydomain.com&password=mypassword", "", "", "", "")) navigate("http://www.freeglobalclassifiedads.com", "Wait") wait(10) I am successfully scrapting the CSRFNAME and CSRFToken however whenever I run the post I get Invalid CSRFToken This is because this token is dynamically changed every time a page is loaded or there is a post. I need a way to scrape the CSRFname and CSRFToken at the exact same time as I run the post. Does anybody have any ideas? Thanks Edited January 18, 2018 by quickregister Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted January 19, 2018 Report Share Posted January 19, 2018 Hi, Try something more like this... set(#UA,"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0","Global") set(#freeglobalget,$plugin function("HTTP post.dll", "$http get", "http://www.freeglobalclassifiedads.com/user/login", #UA, "http://www.freeglobalclassifiedads.com/user/login", "", ""),"Global") set(#CSRFName,$find regular expression(#freeglobalget,"(?<=CSRFName\\\'\\ value\\=\\\').*(?=\\\'\\ \\/\\>)"),"Global") alert(#CSRFName) set(#CSRFToken,$find regular expression(#freeglobalget,"(?<=name\\=\\\'CSRFToken\\\'\\ value\\=\\\').*(?=\\\'\\ \\/\\>)"),"Global") alert(#CSRFToken) set(#url encode EMAIL,$plugin function("HTTP post.dll", "$http text encoder", "url decode", "emai@gmail.com"),"Global") set(#url encode PW,$plugin function("HTTP post.dll", "$http text encoder", "url decode", "your password"),"Global") load html($plugin function("HTTP post.dll", "$http post", "http://www.freeglobalclassifiedads.com", "CSRFName={#CSRFName}&CSRFToken={#CSRFToken}&page=login&action=login_post&email={#url encode EMAIL}&password={#url encode PW}", #UA, "", "", "")) Hope this helps,CD Quote Link to post Share on other sites
quickregister 1 Posted January 19, 2018 Author Report Share Posted January 19, 2018 Wow that worked to get by the CSRF token error messaage. I did not know the encode email function I will have to read up on that. I am now getting another error message "too many automatic redirections were attempted" which is a completely separate issue. But your method worked to get by the issue I was having. Thank you! Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted January 19, 2018 Report Share Posted January 19, 2018 np, type redirects in the search in ubotshould be a command likemax redirectsor something like that Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.