🕵️ Small Cybersecurity Challenge
You're analyzing login attempts from a server.
Write a function:
detect_suspicious(logins)
Each login is:
[username, success]
Return the usernames that have 3 or more consecutive failed login attempts.
Test Cases
detect_suspicious([("ali", False), ("ali", False), ("ali", False)])
Expected:
["ali"]
detect_suspicious([("ali", False), ("ali", True), ("ali", False), ("ali", False)])
Expected:
[]
detect_suspicious([("ali", False), ("bob", False), ("ali", False), ("ali", False), ("bob", False)])
Expected:
["ali"]
detect_suspicious([("ali", False), ("ali", False), ("ali", True), ("ali", False), ("ali", False), ("ali", False)])
Expected:
["ali"]
🔥 BONUS:
What if the attacker changes usernames after every failed attempt?
For example:
[("admin", False), ("admin1", False), ("admin2", False), ("admin3", False)]
How would you detect this pattern?
⚠️ No spoilers in the comments. Let everyone try first.
Good luck! 🕷️
1
2 comments
Umar Farooq
1
🕵️ Small Cybersecurity Challenge
powered by
The Black Widow Community
skool.com/bree-1280
Get Paid To Hunt Bounties, Solve CTF's & Compete For Gadgets.
It's all here.
Want to become an ethical hacker? We built this community for you.
Build your own community
Bring people together around your passion and get paid.
Powered by