-
Notifications
You must be signed in to change notification settings - Fork 1
/
remote_code_execution.h
36 lines (30 loc) · 1.06 KB
/
remote_code_execution.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
#ifndef rce_detector_h
#define rce_detector_h
#include "headers.h"
bool check_rce_payload(string data_payload, string payload) {
size_t found = data_payload.find(payload);
if (found != string::npos) {
return true;
}
return false;
}
void RCE_Detector(char *data_payload, char *source_ip , char* destination_ip){
string file_name = "rce_payload.txt";
ifstream infile(file_name);
string payload;
if (!infile) {
cout << "Error opening file: " << file_name << endl;
}
while (getline(infile, payload)) {
if (check_rce_payload(data_payload, payload)) {
cout<<"\n RCE Payload Detected ....";
cout << "\nPayload >> " << payload << " << found in data payload." << endl;
string str = " RCE Payload Detected .... Payload is >> " + payload + " << found in data payload Source IP attacking is >> " + source_ip + " << and Destination IP is >> " + destination_ip + " << ";
Output1(str);
// exit(0);
// exit(0);
}
}
infile.close();
}
#endif