seana88 2 Posted August 24, 2015 Report Share Posted August 24, 2015 Yesterday I was able to get some session ID's using the xpath parser from Aymen.I tried to get it with a csrfmiddlewaretoken but couldn't seem to return anything. This is the token i'm trying to get action='/auth/login/?next=/accounts/register/'> <input type='hidden' name='csrfmiddlewaretoken' value='IjAh8whMMaZX76NzIekohGQ2wlZmBty6' /> <label for="id_username">Username:</label> <input id="id_username" maxlength="254" name="username" type="text" /> <label for="id_password">Password:</label> <input id="id_password" name="password" type="password" /> <label for="id_rememberme">Keep me logged in:</label> <input id="id_rememberme" name="rememberme" type="checkbox" /> <input type='submit' value='login' class="button"/> <input type='hidden' name='next' value='/accounts/register/'> </form> How would I go about getting this with xpath? or any of Aymens functions? Thanks for any help!Sean Quote Link to post Share on other sites
HelloInsomnia 1103 Posted August 24, 2015 Report Share Posted August 24, 2015 Here you go, you can change the input of course to be the sites source code set(#input,"action=\'/auth/login/?next=/accounts/register/\'> <input type=\'hidden\' name=\'csrfmiddlewaretoken\' value=\'IjAh8whMMaZX76NzIekohGQ2wlZmBty6\' /> <label for=\"id_username\">Username:</label> <input id=\"id_username\" maxlength=\"254\" name=\"username\" type=\"text\" /> <label for=\"id_password\">Password:</label> <input id=\"id_password\" name=\"password\" type=\"password\" /> <label for=\"id_rememberme\">Keep me logged in:</label> <input id=\"id_rememberme\" name=\"rememberme\" type=\"checkbox\" /> <input type=\'submit\' value=\'login\' class=\"button\"/> <input type=\'hidden\' name=\'next\' value=\'/accounts/register/\'> </form>","Global") set(#csrftoken,$plugin function("HTTP post.dll", "$xpath parser", #input, "//input[@name=\'csrfmiddlewaretoken\']", "value", "HTML"),"Global") Quote Link to post Share on other sites
seana88 2 Posted August 24, 2015 Author Report Share Posted August 24, 2015 Hey HelloInsomnia, Thank you again for the help...small problem though. It's on the page twice and I deleted duplicates when I added it to my list but it's still there. Any solution for this?Here pis a picture in the debug, http://imgur.com/zab4o9Z . Thank you again for your assistance . Quote Link to post Share on other sites
HelloInsomnia 1103 Posted August 24, 2015 Report Share Posted August 24, 2015 Change the xpath to be: (//input[@name=csrfmiddlewaretoken])[1] 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.