ClippyC2: Clipboard-Based C2

Oct 6, 2026 von Patrick Schmid

ClippyC2: Clipboard-Based C2

In our earlier post on bypassing Remote Browser Isolation (RBI), we briefly introduced ClippyC2, a technical idea for a clipboard-based command-and-control (C2) channel for reaching a local implant through an RBI-isolated browser. As described there, we did not pursue this idea due to other, more suitable approaches that have proven to be successful. However, we still saw added value in the idea with minimal endpoint footprint, no browser instrumentation, traffic that blends into ordinary web activity. Therefore, we continued developing it into a more complete proof-of-concept to determine whether clipboard sync can support a working, usable C2 channel in practice.

Remote Browser Isolation moves web rendering into an isolated container and streams sanitized output to the endpoint. Untrusted JavaScript does not execute on the host, which breaks traditional web implants, HTML smuggling, and most drive-by delivery paths. Organisations often combine RBI with strict endpoint egress controls, so a local implant that survives initial access still cannot call home over HTTP, DNS, or similar channels.

ClippyC2 targets a gap in that model. It assumes three conditions: the endpoint implant has no outbound path to the team server; the RBI-backed browser can reach the internet; and clipboard synchronization is enabled between the RBI container and the local endpoint. The third condition is what enables the proposed approach. Clipboard synchronization is a deliberate, bidirectional data channel across the trust boundary, not a flaw in the isolation layer but a feature users expect.



Attackers already abuse the same boundary for ClickFix-style initial access, where a user is tricked into pasting a command into their local shell. ClippyC2 extends that logic: once code is running on the endpoint, the clipboard may be sufficient to carry C2 traffic in both directions. No code crosses the boundary, only text. The local agent does not open a socket, and the browser does not require debugging ports or automation frameworks.

Architecture

ClippyC2 splits the problem into four components, each limited to the network surface it can use:

Component Role
Team server Queues commands, stores results, serves the browser portal
Operator console Queues tasks, retrieves output
Browser Bridge Polls the server, reads and writes the clipboard
Local agent Watches the clipboard, executes commands

The implant on the endpoint has no direct route to the team server. The clipboard is the only link between the RBI session and the host, resulting in the following architecture and communication flow:

On the endpoint, the agent can now be just any local script or implant that interacts with the clipboard and executes commands (or BOFs).

In order to ensure basic OPSEC and have a clean basis for further development and improvements, ClippyC2 was already built based on the following design principles:

GET-only traffic

The browser bridge does not send POST, PUT, or fetch with a request body to the team server. All communication uses GET requests:

  • /ScriptResource.axd — periodic poll for the next queued command, shaped like an ASP.NET script resource request.
  • /Default.aspx?__VIEWSTATE=... — postback carrying encrypted agent output in the __VIEWSTATE query parameter.

Commands arrive inbound inside the poll response. Results leave outbound inside query parameters. No C2 data is placed in a request body, which avoids detection by potentially traffic inspecting Data Loss Prevention (DLP) solutions.

VIEWSTATE & Microsoft AJAX Delivery

Inbound commands (via /ScriptResource.axd) and outbound results (via /Default.aspx) are wrapped in a synthetic __VIEWSTATE blob. In ASP.NET, VIEWSTATE is a standard mechanism used to persist page and control state across round-trips to the server. Since Microsoft .NET is highly prevalent in corporate environments, these parameters are extremely common and blend in perfectly to transport our encrypted payload as seemingly normal, random-looking application state. This communication flow is based on the following architecture:

For outbound commands, the VIEWSTATE blob is directly added as GET parameter to /Default.aspx. For inbound commands, received as response to /ScriptResource.axd, the response mimics Microsoft AJAX’s partial-page rendering mechanism by returning a string block structured exactly like a Microsoft AJAX update script:

1
2
3
4
5
6
7
8
9
//Version:4.0.30319
//52e8a1d4
(function(){
    var __vs='/wEPDwUKLTkxMzY1MTgyM2QYAQUeX19QYXlsb2FkX192MTpBRVNDaXBoZXJUZXh0R29lc0hlcmU=';
    var __vsg='C8A1D4E9';
    if(typeof Sys!=='undefined'&&Sys.WebForms){
        Sys.WebForms.PageRequestManager.getInstance()._commit(__vs,__vsg);
    }
})();

The same VIEWSTATE-based blob is received as part of the __vs parameter.

Windows agent and BOF support

Basic command execution can be handled by any implant. This is however not really a usable approach in a red teaming engagement. To push the envelope, our proof-of-concept also implements support for Beacon Object Files (BOF). If supported by the local agent, BOFs can run in-process without dropping another executable. The constraint is however the size: a BOF must fit in a single clipboard message (~256 KB after base64 encoding). BOFs that depend on full Beacon semantics therefore may not work as expected in our current proof-of-concept.

Clipboard wire format

The clipboard protocol uses fixed prefixes so the most simple agents can participate without a custom runtime, correlation between commands and results over multiple tasks is always possible and arbitrary clipboard content gets ignored:

Direction Format & Prefix Description & Example
Command
(Browser → Agent)
c:<uuid>:<json> Initiates a task. The UUID correlates the command with its subsequent result.

Shell: {"type":"shell","cmd":"whoami /all"}
BOF: {"type":"bof","name":"...","object_b64":"...","args_b64":"..."}
Result
(Agent → Browser)
r:<uuid>\n<output> Returns task output, separated from the prefix by a newline.

Example:
r:49bc78e2-45fe...
desktop\operator

Because the clipboard represents shared state, if two commands were written at once, one would overwrite the other. To avoid collisions, the communication flow enforces serial execution: the team server maintains a FIFO queue with at most one in-flight command. The browser bridge copies a command to the clipboard and waits until it detects a matching r:<uuid> result from the agent before releasing the next queued command.

Proof of Concept

The proof of concept code is available in our GitHub repository. The stack runs via Docker through a docker compose up. The operator opens the portal in the RBI browser, grants clipboard permissions, deploys an agent on the endpoint, and interacts with the agent through the console:

1
2
3
4
5
6
7
8
clippyc2 > exec whoami
[+] Queued: whoami [a1b2c3d4] (1 in queue)

clippyc2 > tasks a1b2c3d4
  ID: a1b2c3d4-...
  Command: whoami
  Result:
    desktop\operator

BOFs are queued with bof /path/to/object.o arg1 arg2 and require an agent with BOF execution support on the target.

Limitations

The proof-of-concept works within a narrow operational envelope. These are the constraints identified during development:

Area Constraint
Focused tab The Clipboard API requires a focused, HTTPS-origin tab. Background tabs cannot read or write the clipboard, so the portal window must remain in the foreground.
Polling latency Commands and results move at the poll interval. Suitable for interactive use; not suited to high-throughput.
Serial execution One command at a time. No parallelism over the clipboard channel.
Message size BOFs and command output must fit in a single clipboard buffer (~256 KB). No chunked file transfer.
Clipboard contention User copy/paste activity during a session can interfere with the protocol. The browser attempts to resync, but concurrent clipboard use remains unreliable.
Agent simplicity Simple listeners execute commands via standard shells (such as bash -c or Invoke-Expression). Built-in evasion, elevation, or injection must be supplied by a more mature implant.

Conclusion

ClippyC2 shows that clipboard synchronization, a feature many RBI deployments enable by default to ensure usability, can serve as a bidirectional C2 transport channel. Even without direct communication between implant on the endpoint with an team server a C2 channel can be established successfully by relying soly on clipboard interactions via the browser. The current proof-of-concept is fully functional and usable for insider-based scenarios, where a target can keep a browser tab focused. This PoC can also be used to assess and demonstrate the technical limitations of RBI solutions. Read also our earlier post on bypassing Remote Browser Isolation (RBI) to see our other approaches.


< zurück