Swagshop RCE

Hi, I’m having the same error, in my I though it is because of adding a new login[‘username’] and login[‘password’] in the python code, so it have two of each on the form instead of one. So, just commenting out:

#br.form.new_control(‘text’, ‘login[username]’, {‘value’: username}) # Had to manually add username control.
#br.form.fixup()

Fix THAT issue for me, but then I have an issue later:

Traceback (most recent call last):
File “v2.py”, line 54, in
url = url.group(1)
AttributeError: ‘NoneType’ object has no attribute ‘group’

Analyzing the request in BURP what I see is that:
-It does the POST and in the response there is a Cookie called “adminhtml” set with a value.
-It does the GET to the new location, but this Cookie (“adminhtml”) is not among the headers, so the response doesn’t include the authenticated Admin page but again the login one.
-If I send this GET request to BURP and insert manually the “adminhtml” Cookie among the headers with the value received in response to my POST, it works, meaning I got the proper response with the Admin page content.

Any help on how to force mechanize to send all Cookies he receives? Any clue why in other writeups they don’t need to do that may be Mechanize version?

Thanks!

1 Like