Debug School

Cover image for Pentest
Suyash Sambhare
Suyash Sambhare

Posted on

Pentest

🖥️ Fat Client: Network Traffic in Desktop Applications

When conducting a penetration test on desktop applications—commonly referred to as fat clients or thick clients—analyzing network traffic is a cornerstone of the process. The ability to inspect and manipulate the data exchanged between the client and its servers often reveals critical vulnerabilities. Achieving this requires positioning oneself as a Machine-in-the-Middle (MitM), enabling visibility and control over traffic in transit.


🔍 Initial Steps in Network Traffic Analysis

Before intercepting traffic, it's essential to understand the application's network behavior. Since Microsoft Windows remains the dominant desktop OS, analysts typically set up a Windows environment with full administrative privileges for deep inspection.

Recommended Tools:

  • SysInternals Suite: Especially ProcMon, which tracks file system, registry, and network events.
  • Observation Phase: Run the target application and monitor its behavior to identify:
    • URLs
    • IP addresses
    • Ports

These endpoints become the focus of proxying efforts, as they represent the communication channels we aim to intercept.


🔄 Proxy-Aware vs Proxy-Unaware Clients

Understanding whether an application supports proxying is crucial for choosing the right interception strategy.

Type of Client Description
Proxy-Aware Supports proxy configuration either natively or via OS-level settings.
Proxy-Unaware Designed to avoid proxying, often seen in security software like AV agents.

Proxy-aware clients are easier to handle, while proxy-unaware ones may require more aggressive techniques such as DNS manipulation or function hooking.


🌐 Protocols Matter: HTTP vs Binary Traffic

Not all traffic is created equal. While many applications use HTTP/HTTPS, desktop clients often rely on binary protocols—standardized or custom.

Common Protocols:

  • HTTP/HTTPS: Easily intercepted using tools like BurpSuite.
  • Java RMI: A standardized binary protocol for Java-based RPC.
  • Custom Binary Protocols: Require reverse engineering to understand message formats and functionality.

Tooling for Binary Protocols:

  • BurpSuite + NoPE Extension: Adds binary proxying capabilities but may suffer from stability issues.
  • PETEP by warxim: A robust alternative tailored for binary traffic, offering features like:
    • Packet interception
    • Replay functionality
    • Custom message crafting

Pen Test

🛠️ Proxying Made Easy: For Proxy-Aware Clients

For applications that support proxying, setup can be straightforward:

.NET Configuration Example

If your application is named application.exe, the config file will be application.exe.config. Add the following to route traffic through localhost:8080:

<configuration>
  <system.net>
    <defaultProxy enabled="true">
      <proxy
        proxyaddress="http://127.0.0.1:8080"
        bypassonlocal="false"
      />
    </defaultProxy>
  </system.net>
</configuration>
Enter fullscreen mode Exit fullscreen mode

OS-Level Proxy Configuration

If the application or framework doesn’t support proxying directly, fall back to OS-level settings:

🪟 Windows

  • Command Line:
  netsh winhttp set proxy 127.0.0.1:8080
Enter fullscreen mode Exit fullscreen mode
  • UI Options: Available in both the classic Control Panel and the modern Settings menu.

🐧 Linux

  • Environment Variables:
  export HTTP_PROXY=http://127.0.0.1:8080
  export HTTPS_PROXY=http://127.0.0.1:8080
Enter fullscreen mode Exit fullscreen mode
  • Scope Considerations:
    • Temporary: Shell session only.
    • Persistent: Add to ~/.profile or /etc/environment.

🧨 Proxying Proxy-Unaware Clients: Hard Mode

If all else fails, it's time to get creative and trick the application into communicating with your proxy.

🧠 DNS Manipulation

Most applications use domain names to locate backend services. By manipulating DNS resolution, you can redirect traffic to your proxy.

Recommended Setup:

  • Two VMs:
    • App VM: Runs the target application.
    • Router VM: Acts as a gateway and proxy.

Router VM Configuration (Kali Linux):

#!/bin/bash
source=$1
target=$2
iptables -P FORWARD ACCEPT
iptables -A FORWARD -i $source -o $target -j ACCEPT
iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
iptables -t nat -A POSTROUTING -o $target -j MASQUERADE
sysctl net.ipv4.ip_forward=1
Enter fullscreen mode Exit fullscreen mode

🗂️ Hosts File Redirection

  • Linux: /etc/hosts
  • Windows: C:\Windows\System32\drivers\etc\hosts

Add entries to redirect domains to your proxy IP.

🧪 Custom DNS Server with dnsmasq

Configure dnsmasq on the router VM:

interface=eth1
bind-interfaces
dhcp-range=10.10.13.100,10.10.13.200,24h
address=/appserver.com/10.10.13.99
Enter fullscreen mode Exit fullscreen mode

🧬 Function Hooking and Deep Interception

When DNS manipulation isn’t enough, intercept traffic at the OS or API level.

🧰 Linux: proxychains

  • Install: Via package manager.
  • Configure: /etc/proxychains4.conf
  • Usage:
  sudo proxychains ./application
Enter fullscreen mode Exit fullscreen mode

🪟 Windows: EchoMirage (Legacy)

  • GUI-based interception tool.
  • Hooks networking functions.
  • Outdated but still useful in some cases.

🧠 Frida + Deluder (Modern Approach)

  • Frida: Hooks native functions via JavaScript.
  • Deluder: Wraps Frida with prebuilt scripts for common networking APIs.
  • Integration: Works seamlessly with PETEP for binary traffic analysis.

🔐 Breaking SSL Encrypted Traffic

Even with traffic flowing through your proxy, encryption can still be a barrier. If the application performs a TLS handshake with the server, the data remains unreadable. To inspect it:

🧩 TLS Termination Strategy

  • Force the application to perform the handshake with your proxy.
  • Your proxy terminates the encryption, allowing inspection.
  • The proxy then re-encrypts and forwards traffic to the actual server.

🔑 Handling Client Certificates

Some applications use client certificates for secure communication. These must be present on the machine to work—meaning you can extract them.

Extraction Tips:

  • Java Applications: Look for keystores (.jks), often protected with the default password changeit.
  • Windows: Certificates may reside in the OS certificate store. If marked “unexportable,” use mimikatz to extract them.

Once obtained, import the certificate into your proxy tool (BurpSuite or PETEP) and configure it for the relevant connection.


Breaking SSL encrypted traffic—more accurately referred to as SSL/TLS decryption—has several practical applications, particularly in cybersecurity, enterprise monitoring, and penetration testing. Here’s a breakdown of its most impactful uses:


🔐 Practical Applications of Breaking SSL Encrypted Traffic

1. Threat Detection and Malware Prevention

  • Encrypted Malware Delivery: Over 85% of malware is now delivered via HTTPS, making SSL inspection essential for detecting threats hidden in encrypted traffic.
  • Phishing and Drive-by Attacks: Attackers often use SSL to mask malicious payloads. Decryption allows security tools to inspect and block these threats before they reach users.

2. Data Loss Prevention (DLP)

  • Insider Threat Monitoring: SSL decryption helps detect unauthorized data exfiltration attempts by insiders using encrypted channels.
  • Sensitive Data Leakage: Organizations can monitor for the transmission of confidential information (e.g., PII, financial data) over encrypted connections.

3. Zero Trust Security Enforcement

  • Visibility into All Traffic: SSL decryption is a cornerstone of Zero Trust models, which require inspection of all traffic regardless of source or destination.
  • Policy Enforcement: Enables granular access control and enforcement of security policies across encrypted sessions.

4. Penetration Testing and Security Audits

  • Application Behavior Analysis: Testers can inspect how applications handle sensitive data, authentication tokens, and session management.
  • Client Certificate Extraction: Reveals how applications authenticate securely and whether credentials can be intercepted or reused.

5. Monitoring IoT and Unmanaged Devices

  • Endpoint Limitations: Devices that cannot run endpoint security software (e.g., IoT, legacy systems) can still be monitored via SSL decryption at the network level.
  • Compromised Control Channels: Detects encrypted command-and-control traffic used by malware or attackers.

6. Compliance and Forensics

  • Regulatory Requirements: Some industries require full visibility into data flows for compliance (e.g., HIPAA, GDPR).
  • Incident Investigation: Decrypted traffic logs provide forensic evidence during breach analysis or legal investigations.

⚠️ Considerations and Challenges

While SSL decryption offers powerful capabilities, it comes with trade-offs:

  • Performance Overhead: Decryption is computationally intensive and may impact network performance.
  • Privacy Concerns: Inspecting encrypted traffic can raise ethical and legal issues, especially with personal or sensitive data.
  • Selective Inspection: Organizations often exempt categories like healthcare or banking from inspection to comply with privacy regulations.

🧾 Conclusion

Inspecting and proxying network traffic in fat clients is a layered and technical process. Whether you're dealing with proxy-aware applications or need to dive deep into DNS manipulation, function hooking, or SSL termination, the right combination of tools and techniques can unlock powerful insights into application behavior and security.


Ref: https://www.usd.de/en/fat-client-pentests-analysis-proxying-traffic/

Top comments (0)