Commit Graph

310 Commits

Author SHA1 Message Date
Ralf df98d7a8fa fix 2026-01-21 00:48:33 +03:00
Ralf f97ae4eb71 fix 2026-01-21 00:41:19 +03:00
Ralf 94ec32429b events update 2026-01-19 23:44:49 +03:00
Ralf 3c422c3240 fix 2026-01-19 23:44:21 +03:00
Ralf 24c8ae04ae new TS API 2026-01-19 23:44:01 +03:00
Mikhail Shashin c2dbd4f5bf Delete profile.json 2026-01-18 07:43:43 +03:00
Mikhail Shashin 3534ed1091 Move JSON to YAML (Makefile) 2026-01-18 07:26:02 +03:00
Ralf b0c4c9f244 New Service extender type 2026-01-18 00:50:14 +03:00
Ralf 698f5529ff fix 2026-01-18 00:45:51 +03:00
Ralf 81e3ac04e9 configs json to yaml 2026-01-15 22:38:52 +03:00
Ralf 8851b4e29e gopher prebuild fix 2026-01-15 22:14:15 +03:00
Ralf 03268c3ba8 terminal fix 2026-01-15 22:10:47 +03:00
Ralf 36198e491c sync update 2026-01-15 22:10:33 +03:00
Ralf 07f86bab94 TS db upgrade 2026-01-15 22:09:08 +03:00
Ralf b22731fc61 plugins update 2026-01-15 22:07:54 +03:00
Ralf 68f92ad0fa Multi transport support 2026-01-15 22:06:09 +03:00
Ralf a65e26fef2 Add EventHookManager 2026-01-11 17:49:16 +03:00
Ralf bf14ee0efe optimize 2026-01-11 14:49:07 +03:00
Ralf f548ca2e7c optimize 2026-01-11 13:42:27 +03:00
Ralf c4f655d318 rename event to notify 2026-01-11 11:53:40 +03:00
Ralf 5e46e69d6b Agent ws build payload 2026-01-10 22:35:18 +03:00
Ralf fd073bd7f1 small fix 2026-01-10 22:33:59 +03:00
Ralf 5cc51e05a1 axc2 update 2026-01-10 14:00:45 +03:00
Ralf 1ec2e2e2dd Move const to axc2 2026-01-10 13:58:38 +03:00
Ralf 187cea92fe fix 2026-01-09 23:15:24 +03:00
Ralf 52172e2e23 add listener pause/resume 2026-01-08 22:37:26 +03:00
Mikhail Shashin e0b4a9be43 Update Extender's Makefiles 2026-01-08 21:16:56 +03:00
Ralf 9dccf325c8 fix 2026-01-08 20:08:02 +03:00
Ralf 0246980734 fix 2026-01-08 17:44:52 +03:00
Ralf d715a9580b axc2 update 2026-01-08 12:16:47 +03:00
Ralf 746ab971f6 beacon agent extender upgrade 2026-01-07 23:21:18 +03:00
Ralf a85837e507 gopher agent extender upgrade 2026-01-07 23:20:41 +03:00
Ralf 5a82d79cfd beacon listener dns extender upgrade 2026-01-07 23:20:04 +03:00
Ralf 778e7de1d6 beacon listener http extender upgrade 2026-01-07 23:19:07 +03:00
Ralf 809a11e9d0 beacon listener smb extender upgrade 2026-01-07 23:18:31 +03:00
Ralf e715401b1d beacon listener tcp extender upgrade 2026-01-07 23:17:24 +03:00
Ralf 3059c98751 gopher listener extender upgrade 2026-01-07 23:16:09 +03:00
Ralf b6dde96cdf axc2 update 2026-01-07 23:14:50 +03:00
Ralf a9a376f633 TsApi rewrite 2026-01-07 23:12:44 +03:00
Ralf 739fc13c31 extenders rewrite 2026-01-07 23:09:29 +03:00
Ralf 98fa4ad466 beacon add dns 2026-01-07 15:46:14 +03:00
Mikhail Shashin cdf23b0c1a fix(dns-agent): fix heartbeat logic for non-TXT query types
- Remove qtype[0]=='T' check that prevented heartbeat from working
  with A, AAAA, and CNAME query types
- Fix heartbeat->API transition: when heartbeat indicates pending tasks,
  continue to API request instead of returning early
- Add hasPendingTasks check before sending heartbeat to avoid redundant
  heartbeats when tasks are already known to be pending

Previously, agents using non-TXT query types (A, AAAA, CNAME) would
skip heartbeat and go directly to API requests, causing a loop where
the server indicated pending tasks but the agent never fetched them.
2026-01-05 05:21:34 +03:00
Mikhail Shashin ad366435e6 refactor(beacon_agent): reduce code duplication in Go plugin
- Add wrapProxyData() and wrapProxyDataWithError() helpers in pl_main.go
  to eliminate repetitive TaskData struct construction
- Refactor TunnelMessage* functions
- Refactor TerminalMessage* functions
- Add formatBurstStatus() helper in pl_utils.go for burst config formatting
- Replace 3 duplicate burst status format strings with helper calls
2026-01-05 05:21:34 +03:00
Mikhail Shashin 3eea187333 feat(dns): add configurable burst mode settings
Add burst mode configuration to DNS listener with three settings:
- burst_enabled: toggle to enable/disable fast transfer mode
- burst_sleep: sleep duration in ms during burst mode (default: 50)
- burst_jitter: jitter percentage for burst mode (0-90%, default: 0)

When burst mode is disabled, the agent uses normal sleep intervals
even during data transfer, making traffic patterns less detectable.

When enabled with jitter, burst sleep varies randomly within the
configured percentage range (e.g., 50ms with 50% jitter = 25-75ms).

UI: When burst mode checkbox is unchecked, sleep and jitter fields
are grayed out and disabled.

Files modified:
- ax_config.axs: UI controls with connected enable/disable logic
- pl_listener.go: DNSConfig struct with new fields
- pl_agent.go: buildDNSProfileParams passes burst settings
- AgentConfig.h: ProfileDNS struct with burst fields
- AgentConfig.cpp: unpack burst settings from profile
- MainAgent.cpp: use burst settings with jitter calculation
2026-01-05 05:21:06 +03:00
Mikhail Shashin 2e68d74d84 style(dns-listener): replace block comment separators with single-line comments
Remove verbose block comment separators (// ===...===) and replace
with simple single-line section headers following standard Go style.

Files updated:
- pl_dns.go: Constants, Types, Constructors, Utility Functions,
  DNSListener Lifecycle, Persistence, Request Parsing,
  Task Fetching, Operation Handlers, Fragment Management,
  Main DNS Handler
- pl_main.go: Teamserver Interface, Module, Plugin Entry Point,
  Listener Management
- pl_listener.go: Configuration, Constructors, Utility Functions,
  Handler Methods

This reduces visual noise and aligns with Go community conventions.
2026-01-05 05:21:06 +03:00
Mikhail Shashin aec781a25b refactor(dns-agent): add byte order helpers and simplify binary operations
Add inline helper functions for big-endian and little-endian operations:
- WriteBE32: write 32-bit value in big-endian format
- ReadBE32: read 32-bit value from big-endian bytes
- ReadLE32: read 32-bit value from little-endian bytes

Refactor binary operations throughout ConnectorDNS:
- Simplify BuildAckData from 12 lines to 3 calls
- Simplify frame building in SendData upload loop
- Simplify reqData building for GET requests
- Simplify download chunk parsing (total, offset, nonce)
- Simplify agentId extraction in SetConfig

This reduces ~50 lines of repetitive bit-shift code and improves
readability by making byte order explicit.
2026-01-05 05:21:06 +03:00
Mikhail Shashin a8d880c93b feat(dns-reliability): implement fragment confirmation and retry mechanism
Implement reliability mechanism for DNS communication:
- Fragment confirmation from server (PUT ACK responses)
- Track confirmed offsets to avoid duplicate transmission
- Detect missing fragments and request retransmission
- Handle reset signals from server on data loss
- Improved offset mismatch handling during task download
- Stale timeout notification mechanism via heartbeat
- Optimize retry attempts with confirmation tracking
2026-01-05 05:21:06 +03:00
Mikhail Shashin d75a7ddabc fix(agent): fix use-after-free bug in agent object initialization
Fix critical use-after-free bug in agent initialization:
- Replace MemAllocLocal + copy assignment with proper new operator
- Fix object construction to prevent destructor from freeing in-use memory
- Ensure proper object lifecycle management
2026-01-05 05:21:06 +03:00
Mikhail Shashin ec1d4ffc01 chore: configure workspace and project structure for DNS tunneling
Configure project structure for DNS tunneling support:
- Add modules to Go workspace
- Update configuration files for DNS listener and agent
- Configure .gitignore for build artifacts
- Set up profiles for DNS tunneling
2026-01-05 05:21:06 +03:00
Mikhail Shashin 317218875f feat(listener-dns): implement DNS listener plugin for teamserver
Implement DNS listener plugin for receiving DNS queries from agents:
- UDP and TCP servers for handling DNS queries
- DNS query parsing with encoded data extraction
- Support for HI, PUT, GET, HB operations for communication stages
- Message fragmentation and reassembly for large payloads
- Agent state management (SID-based session management)
- Completed upload caching for deduplication
- Inflight delivery mechanism for reliable task delivery
- Inflight task persistence via JSON files
- Stale entry cleanup by timeouts
- Multiple domain support for single listener
2026-01-05 05:20:50 +03:00