Skip to content

feat(http): implement short polling for reverse shell and create portal#2071

Closed
hulto wants to merge 2 commits intomainfrom
feat/http-short-poll-streaming-7032004942279343568
Closed

feat(http): implement short polling for reverse shell and create portal#2071
hulto wants to merge 2 commits intomainfrom
feat/http-short-poll-streaming-7032004942279343568

Conversation

@hulto
Copy link
Collaborator

@hulto hulto commented Mar 13, 2026

This PR introduces short polling over HTTP/1.1 to implement Reverse Shell and Create Portal capabilities for agents connecting over HTTP rather than direct gRPC or DNS.

Changes include:

  • tavern/internal/redirectors/http1/grpc_stream.go: Added ReverseShell and CreatePortal stream config definitions.
  • tavern/internal/redirectors/http1/redirector.go: Hooked up handlers for /c2.C2/ReverseShell and /c2.C2/CreatePortal.
  • tavern/internal/redirectors/http1/handlers.go: Implemented handleShortPollStreaming which receives a request, sends any embedded gRPC payloads to the backend stream, reads waiting items, and flushes them as a response to the same POST cycle.
  • implants/lib/transport/src/http.rs: Implemented handle_short_poll_streaming and connected it to ReverseShell and CreatePortal interfaces. Agents loop repeatedly posting data buffers and waiting for server instruction.

PR created automatically by Jules for task 7032004942279343568 started by @hulto

…ortal

Update the HTTP/1.1 transport to support bidirectional streaming via short polling for `ReverseShell` and `CreatePortal`. This enables interactive connections across agents restricted to HTTP-only communications.

- Define new gRPC stream configs for ReverseShell and CreatePortal.
- Add `handleShortPollStreaming` in `tavern` HTTP redirector for decoding POST payloads and replying with backend payloads.
- Update `http.rs` in `imix` transport to frequently POST requests to send output or ping, receiving commands iteratively.

Co-authored-by: hulto <7121375+hulto@users.noreply.github.com>
@google-labs-jules
Copy link
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 13, 2026

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
2816    ±0 2816    ±0 0    ±0 0    ±0 0    ±0 0    ±0 1ms    ±0

Previous Results

Build 🏗️ Result 🧪 Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
#1708 2816 2816 0 0 0 0 39.0s

Insights

Average Tests per Run Total Flaky Tests Total Failed Slowest Test (p95)
2816 0 0 5.6s

Slowest Tests

Test 📝 Results 📊 Duration (avg) ⏱️ Duration (p95) ⏱️
TestDockerExecutor_Build_ContextCancellation 1 5.6s 5.6s
eldritch-libsys: std::dll_inject_impl::tests::test_dll_inject_simple 1 5.2s 5.2s
TestInteractiveShell 1 5.1s 5.1s
TestOtherStreamOutput 1 5.0s 5.0s
imix::bin/imix: install::tests::test_install_execution 3 1.8s 5.0s
imix::bin/imix: install::tests::test_install_execution 3 1.8s 5.0s
imix::bin/imix: install::tests::test_install_execution 3 1.8s 5.0s
TestDockerExecutor_Build_SimpleEcho 1 3.7s 3.7s
imix::bin/imix: tests::task_tests::test_task_streaming_output 3 3.0s 3.0s
imix::bin/imix: tests::task_tests::test_task_streaming_output 3 3.0s 3.0s

🎉 No failed tests in this run. | 🍂 No flaky tests in this run.

Github Test Reporter by CTRF 💚

🔄 This comment has been updated

Copy link
Collaborator Author

@hulto hulto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jules first pass

@hulto hulto closed this Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant