Kuboid
Open Luck·Kuboid.in

War Stories from a TryHard Bug Bounty Hunter

DEFCONConference40,438 views50:37over 1 year ago

This presentation details eleven critical vulnerabilities discovered across various web, mobile, and IoT targets, focusing on practical exploitation techniques. The speaker demonstrates methods for bypassing Nginx 403 restrictions, performing arbitrary account takeovers via documentation-based credential discovery, and executing remote code on IoT devices through configuration file injection and SIP protocol manipulation. The talk emphasizes the importance of deep application analysis, source code review, and creative use of tools like Burp Suite and Frida to achieve high-impact findings.

From Nginx 403 Bypasses to IoT Hijacking: Lessons from Real-World Bug Bounties

TLDR: This post breaks down high-impact exploitation techniques, including Nginx 403 bypasses, configuration file injection in IoT devices, and SIP protocol manipulation. By moving beyond standard automated scans and performing deep application analysis, researchers can uncover critical vulnerabilities that remain hidden to most. These findings highlight the necessity of manual source code review and creative protocol testing in modern bug bounty programs.

Security research often gets bogged down in the noise of automated scanners and low-hanging fruit. While those tools have their place, the most critical vulnerabilities—the ones that net five-figure payouts and provide full system access—require a shift in mindset. It is about understanding the underlying architecture of the target, not just the surface-level endpoints.

Bypassing Nginx 403 Restrictions with Normalization

Many developers rely on Nginx as a reverse proxy to restrict access to internal-only API endpoints. A common configuration error involves blocking access based on the URL path without accounting for how the backend application interprets that path. If the Nginx configuration blocks /api/internal/, it might not account for path normalization or encoding tricks that the backend server handles differently.

During a recent engagement, I encountered an application that returned a 403 Forbidden error for specific internal API routes. By fuzzing the path and experimenting with URL encoding, I discovered that double-URL encoding certain characters allowed the request to pass through the proxy while still being interpreted correctly by the backend. This is a classic case of a mismatch in how the proxy and the application server handle input. When the proxy sees the encoded path, it doesn't match the block rule, but the backend decodes it and executes the request. This simple technique led to a massive PII leak, proving that even basic proxy configurations can be bypassed with the right input manipulation.

Configuration File Injection in IoT

IoT devices are frequently overlooked in bug bounty programs, yet they often contain the most egregious security flaws. Many of these devices use configuration files to manage network settings, and these files are often generated dynamically based on user input. If an attacker can influence the content of these files, they can often achieve Remote Code Execution (RCE).

In one instance, I targeted a router that allowed users to set static IP reservations. The backend generated a dnsmasq.conf file based on these inputs. By injecting newline characters and additional configuration directives into the input fields, I was able to append arbitrary commands to the configuration file. Because the device restarted the dnsmasq service after applying changes, the injected commands were executed with root privileges.

The key here is to look for where user-supplied data interacts with system-level configuration files. If you can control the input, you control the system. For those interested in the mechanics of these services, the dnsmasq documentation provides a clear view of how these configuration files are structured and how they can be manipulated.

Exploiting SIP for Call Hijacking

Voice over IP (VoIP) and video conferencing applications often rely on the Session Initiation Protocol (SIP) to manage connections. SIP is notoriously complex, and its implementation in mobile and IoT applications is frequently flawed.

I discovered a vulnerability in a tabletop IoT device that allowed for unauthorized call hijacking. The application used a custom authentication token to register the device with the SIP server. By analyzing the mobile application’s source code using Jadx, I found that the authentication token contained fields for the "from" and "to" addresses. Because the server failed to cryptographically verify that the "from" address matched the authenticated user, I could modify the "from" field in the SIP INVITE request to impersonate any other user on the platform.

This allowed me to register my device as the recipient for calls intended for other users. When a call was placed, my device would ring, and I could answer it, effectively eavesdropping on private conversations. This finding underscores the importance of Broken Access Control in protocol-level implementations.

The Power of Manual Analysis

The common thread across these findings is the move away from black-box testing toward a deep understanding of the target's internal logic. Whether it is using Frida to hook functions in a mobile app or using DotPeek to decompile .NET binaries, the goal is to see what the developers intended and where they failed.

When you are testing, do not just look for the standard OWASP Top 10 vulnerabilities. Look for the logic flaws that exist in the gaps between components. If a proxy is in front of an app, look for how they disagree on input. If a device uses a configuration file, look for how that file is built. If a protocol is used, look for how the authentication is handled.

The most successful researchers are those who treat every target as a puzzle. They don't just run a scanner and hope for the best; they read the documentation, they decompile the code, and they experiment with the protocols. If you find a bug in one area, look for similar patterns elsewhere in the application. If it works once, it will likely work again. Stop looking for noise and start looking for the architecture. That is where the real vulnerabilities live.

Talk Type
talk
Difficulty
advanced
Category
web security
Has Demo Has Code Tool Released


DEF CON 32

260 talks · 2024
Browse conference →
Premium Security Audit

We break your app before they do.

Professional penetration testing and vulnerability assessments by the Kuboid Secure Layer team. Securing your infrastructure at every layer.

Get in Touch
Official Security Partner
kuboid.in