9 #define LIX_FDTABLE_MAX_FDS_CAP 2048u 41 WARNING(
"[WARNING] IntNotifyIntroEvent failed: 0x%08x\n", status);
89 ERROR(
"[ERROR] IntKernVirtMemFetchQword failed for GVA 0x%016llx: 0x%08x\n",
90 SocketGva +
LIX_FIELD(Socket, Sk), status);
97 ERROR(
"[ERROR] IntKernVirtMemFetchQword failed for GVA 0x%016llx: 0x%08x\n",
104 WARNING(
"[WARNING] Sock 0x%016llx has NULL proto pointer.", sock);
108 for (iProto = 0; iProto <
ARRAYSIZE(protos); iProto++)
110 if (proto == protos[iProto].
Gva)
121 ERROR(
"[ERROR] IntKernVirtMemRead failed for GVA 0x%016llx: 0x%08x\n",
122 proto +
LIX_FIELD(Ungrouped, ProtoName), status);
126 for (iProto = 0; iProto <
ARRAYSIZE(protos); iProto++)
128 if (!strcmp(protos[iProto].
Name, protoName))
130 protos[iProto].
Gva = proto;
144 ERROR(
"[ERROR] IntKernVirtMemRead failed for GVA 0x%016llx: 0x%08x\n",
151 Connection->Endpoint = sock;
153 memset(&Connection->LocalAddress, 0,
sizeof(Connection->LocalAddress));
154 memset(&Connection->RemoteAddress, 0,
sizeof(Connection->RemoteAddress));
161 ERROR(
"[ERROR] IntKernVirtMemRead failed for GVA 0x%016llx: 0x%08x\n",
162 sock +
LIX_FIELD(Sock, V6RcvSaddr), status);
169 ERROR(
"[ERROR] IntKernVirtMemRead failed for GVA 0x%016llx: 0x%08x\n",
170 sock +
LIX_FIELD(Sock, V6RcvSaddr), status);
179 ERROR(
"[ERROR] IntKernVirtMemRead failed for GVA 0x%016llx: 0x%08x\n",
180 sock +
LIX_FIELD(Sock, RcvSaddr), status);
187 ERROR(
"[ERROR] IntKernVirtMemRead failed for GVA 0x%016llx: 0x%08x\n",
188 sock +
LIX_FIELD(Sock, RcvSaddr), status);
196 ERROR(
"[ERROR] IntKernVirtMemRead failed for GVA 0x%016llx: 0x%08x\n",
204 ERROR(
"[ERROR] IntKernVirtMemRead failed for GVA 0x%016llx: 0x%08x\n",
238 ERROR(
"[ERROR] IntKernVirtMemFetchQword failed for GVA 0x%016llx: 0x%08x\n",
239 StructFileGva +
LIX_FIELD(Ungrouped, FileDentry), status);
246 ERROR(
"[ERROR] IntKernVirtMemFetchQword failed for GVA 0x%016llx: 0x%08x\n",
247 dentry +
LIX_FIELD(Dentry, Inode), status);
254 ERROR(
"[ERROR] IntKernVirtMemRead failed for GVA 0x%016llx: 0x%08x\n",
255 dentry +
LIX_FIELD(Dentry, Inode), status);
264 *SocketGva = inode -
LIX_FIELD(Ungrouped, SocketAllocVfsInode);
293 QWORD files, fdt, fd;
316 ERROR(
"[ERROR] IntKernVirtMemFetchQword failed for %llx: 0x%08x\n",
317 Task->Gva +
LIX_FIELD(TaskStruct, Files), status);
324 ERROR(
"[ERROR] IntKernVirtMemFetchQword failed for %llx: 0x%08x\n", files +
LIX_FIELD(Files, Fdt), status);
331 ERROR(
"[ERROR] IntKernVirtMemFetchQword failed for %llx: 0x%08x\n", fdt +
LIX_FIELD(FdTable, MaxFds), status);
338 ERROR(
"[ERROR] IntKernVirtMemFetchQword failed for %llx: 0x%08x\n", files +
LIX_FIELD(FdTable, Fd), status);
345 for (
DWORD iFd = 0; iFd < maxFds; iFd++)
353 ERROR(
"[ERROR] IntKernVirtMemFetchQword failed for %llx: 0x%08x\n", fd + iFd * 8ull, status);
365 ERROR(
"[ERROR] IntLixSocketGetConnection failed for socket %llx : 0x%08x\n", socketGva, status);
377 TRACE(
"[CONNECTION] Owner %s | Family: %u | State %s | LocalPort: %hu | RemoteAddress: %s | Endpoint %016llx\n",
417 ERROR(
"[ERROR] IntLixTaskIterateTasks failed: 0x%08x\n", status);
EVENT_CONNECTION_EVENT Connection
#define INT_STATUS_SUCCESS
INTRONET_PORT LocalPort
Local port.
An internal structure used to cache the "struct proto" addresses of required connection types...
CHAR Name[32]
The protocol name as defined in Linux kernel.
#define INT_SUCCESS(Status)
struct _SOCK_PROTO SOCK_PROTO
An internal structure used to cache the "struct proto" addresses of required connection types...
#define INT_STATUS_NOT_NEEDED_HINT
INTRO_NET_AF AddressFamily
Address family.
int INTSTATUS
The status data type.
LIX_TASK_OBJECT * OwnerTask
Pointer to the task that owns the connection.
const char * IntNetStateToString(INTRO_NET_STATE State)
Converts a connection state to a string.
INTRO_GUEST_TYPE OSType
The type of the guest.
#define INTRO_OPT_EVENT_CONNECTIONS
Enable connection events.
static INTSTATUS IntLixNetGetConnectionFromSocket(QWORD SocketGva, INTRONET_ENDPOINT *Connection)
Fills an INTRONET_ENDPOINT structure from a TCP/IP socket GVA.
static BOOLEAN IntLixNetFileIsSocket(QWORD StructFileGva, QWORD *SocketGva)
Check if a give file object is a socked and return the socket GVA.
#define INTRONET_MIN_BUFFER_SIZE
The minimum buffer size needed for the textual representation of an IP address.
GENERIC_ALERT gAlert
Global alert buffer.
INTSTATUS IntKernVirtMemFetchDword(QWORD GuestVirtualAddress, DWORD *Data)
Reads 4 bytes from the guest kernel memory.
#define IS_KERNEL_POINTER_LIX(p)
INTSTATUS IntKernVirtMemFetchQword(QWORD GuestVirtualAddress, QWORD *Data)
Reads 8 bytes from the guest kernel memory.
INTSTATUS IntNotifyIntroEvent(INTRO_EVENT_TYPE EventClass, void *Param, size_t EventSize)
Notifies the integrator about an introspection alert.
DWORD IntNetAddrToStr(const INTRO_NET_AF Family, const INTRONET_ADDRESS *Address, CHAR *String)
Converts an IP address to a string.
QWORD Current
The currently used options.
#define LIX_FDTABLE_MAX_FDS_CAP
The maximum number of file descriptors to be iterated.
#define LIX_FIELD(Structure, Field)
Macro used to access fields inside the LIX_OPAQUE_FIELDS structure.
INTRO_NET_STATE State
Connection state.
Informational event containing the connections opened by a process. See EVENT_CONNECTION_EVENT.
static void IntLixNetSendConnectionEvent(INTRONET_ENDPOINT *Connection)
Sends a connection event to the integrator.
char Comm[LIX_COMM_SIZE]
The short name of the executable.
GUEST_STATE gGuest
The current guest state.
INTSTATUS IntLixNetSendGuestConnections(void)
Sends all active in-guest TCP/IP connections as events to the integrator.
INTRONET_ADDRESS RemoteAddress
Remote address.
INTSTATUS IntKernVirtMemRead(QWORD KernelGva, DWORD Length, void *Buffer, DWORD *RetLength)
Reads data from a guest kernel virtual memory range.
#define INT_STATUS_INVALID_PARAMETER_1
#define INT_STATUS_NOT_SUPPORTED
INTSTATUS IntLixTaskIterateTasks(PFUNC_LixTaskIterateTasks Callback)
Call the Callback parameter for each task saved internally.
Event structure for connections.
INTSTATUS IntLixNetSendTaskConnections(LIX_TASK_OBJECT *Task)
Sends all active TCP/IP connections from a task to the integrator.
void IntAlertFillConnection(const INTRONET_ENDPOINT *Connection, EVENT_CONNECTION_EVENT *Event)
Saves information about a guest connection in an event.
QWORD Gva
The GVA of the "struct proto" object.
QWORD Endpoint
Guest virtual address of the endpoint/socket object.
INTRO_PROT_OPTIONS CoreOptions
The activation and protection options for this guest.
INTRO_NET_STATE IntNetConvertState(const DWORD State)
Converts a guest connection state to an Introcore connection state.