shell bypass 403

Cubjrnet7 Shell


name : net_events.c
/**
@file     net_events.c
@brief    Network based events
@details  Copyright (c) 2024 Acronis International GmbH
@author   Denis Kopyrin ([email protected])
@since    $Id: $
*/

#include "net_events.h"

#include "net_compat.h"
#include "transport/message.h"
#include "si_templates.h"
#include "si_writer.h"
#include "si_writer_common.h"

#ifdef KERNEL_MOCK
#include "mock/mock.h"
#endif

#define SI_TMPL_AUTH_LOG(tmpl) \
    SI_COMMON_FIELDS(tmpl) \
    tmpl(FP_SI_PI_LOG_STR)

void net_event_auth_log(task_info_t* task_info, string_view_t str, bool success)
{
	uint64_t unique_pid = make_unique_pid(current);
	uint64_t event_uid;
	const uint32_t event_size = SI_ESTIMATE_TMPL_SIZE(SI_TMPL_AUTH_LOG) + str.len;
	msg_t *msg = msg_new(success ? FP_SI_OT_NOTIFY_SOCKET_AUTH_LOG_SUCCESS : FP_SI_OT_NOTIFY_SOCKET_AUTH_LOG_FAILED
	                   , 0
	                   , SI_CT_POST_CALLBACK
	                   , unique_pid
	                   , event_size);
	if (!msg)
		goto end;

	event_uid = transport_global_sequence_next();

	{
		si_property_writer_t writer;
		si_event_writer_init(&writer, &msg->event, event_size);
		si_property_writer_write_common(&writer, event_uid, current->pid, current->tgid, task_info);
		{
			SiSizedString si_str;
			si_str.value = str.str;
			si_str.length = str.len;
			si_property_writer_write_log_str(&writer, si_str);
		}
		si_event_writer_finalize(&msg->event, &writer);
	}

	msg->task_info = task_info_get(task_info);
	msg->id = event_uid;

end:
	return send_msg_async_unref(msg);
}

© 2025 Cubjrnet7