r/PythonProjects2 • u/uknown67789 • 28d ago
Built a Python framework to automate authentication testing for JavaScript-based Dahua DVR logins. Looking for feedback
Hi everyone,
I'm a 15-year-old student from Morocco who's been learning Python and cybersecurity over the past year.
While experimenting in an authorized environment, I discovered that traditional tools such as Hydra couldn't interact with a Dahua DVR's JavaScript-based login page. Instead of giving up, I decided to build my own Python framework using Selenium to automate browser-driven authentication testing.
The project is called RedaForce.
GitHub: https://github\[.\]com/REDA-MAH/RedaForce
I'm not posting this to ask for stars. I'd genuinely appreciate technical feedback on:
Code quality and project structure
README and documentation
Python best practices
Repository organization
Features you think would make the project more useful
I'm still learning, so I'm especially interested in constructive criticism from more experienced developers.
Thanks for taking the time to look!
1
u/caramel_mutt 26d ago edited 26d ago
So you can program a maximum of tries to access a site using a "For" loop combined with a "try-except" block for requests library. Track the loop count then catch the connect errors, and use "break" to stop it when/if connection works.
Something like this: range(1, max_tries + 1) for the loop
and this "requests.get(url)" sends the request to the target.
And this time.sleep(2) adds to the cycle a quality so there isn't a server overload.
Then simple conditional for the ending of the loop with an "Else"
Edit: don't forget a 404 request timeout message at the end of the 20 tries. Also include a IP block after recurring attempts form the same IP address. On the 3 try advice the user to reset password...20 tries is generous, 5 is more than enough.
Ok 5 tries, lock account, send email notification to the user saying account locked please reset password. If after the 5 attempts it reaches 10 block the IP address. Doesn't matter how many times this happens, if you create an API to manage backend requests you take the stress out of the server being requested.