-
Notifications
You must be signed in to change notification settings - Fork 16
/
detexploit.hpp
85 lines (70 loc) · 2.7 KB
/
detexploit.hpp
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
77
78
79
80
81
82
83
84
85
/*
detexploit.hpp
Header file of DetExploit C++ Program.
DetExploit (https://github.com/moppoi5168/DetExploit)
Licensed by GPL License
*/
#ifndef DETEXPLOIT_HPP
#define DETEXPLOIT_HPP
#define DETEXPLOIT_VERSION "v1.4-ALPHA-CLI"
#include <windows.h>
#include <iostream>
#include <iterator>
#include <string>
#include <sstream>
#include <fstream>
#include <conio.h>
#include <time.h>
#include <tchar.h>
#include <urlmon.h>
#include <map>
#include <vector>
#include <set>
#include <comdef.h>
#pragma comment(lib, "Ws2_32.lib")
#pragma comment(lib, "urlmon.lib")
#pragma comment(lib, "wininet.lib")
//#include <boost/format.hpp>
#include "resources/langpack/en_langdata.hpp"
#include "INIReader/INIReader.h"
typedef struct DVI {
std::string version;
bool is_edb;
bool is_jvn;
bool is_nvd;
bool is_winupd;
std::string severity;
} VulnInfo;
/* main.cpp */
INIReader init_cp(char *arg);
/* exploitdb.cpp */
#define EDB_VULNDATA_FILENAME "exploitdb.detexploit"
std::map<std::string, std::string> proc_edb(HANDLE hStdout);
int edb_download_vulndata(HANDLE hStdout);
std::vector<std::string> edb_extract_vulndata(HANDLE hStdout);
std::map<std::string, std::string> edb_parse_vulndata(std::vector<std::string> data_list);
std::map<std::string, VulnInfo> edb_scan(std::map<std::string, std::string> edb_vulndata, std::map<std::string, std::string> installed);
/* jvn.cpp */
std::map<std::string, std::string> jvn_download_vulndata(HANDLE hStdout);
std::map<std::string, VulnInfo> jvn_scan(std::map<std::string, std::string> jvn_vulndata, std::map<std::string, std::string> installed);
/* nvd.cpp */
std::map<std::string, std::string> nvd_download_vulndata(HANDLE hStdout);
std::map<std::string, VulnInfo> nvd_scan(std::map<std::string, std::string> nvd_vulndata, std::map<std::string, std::string> installed);
/* winupdate.cpp */
/* utils.cpp */
std::string ghostname();
bool checkFileExistence(const std::string& str);
std::vector<std::string> split(const std::string& src, const char* delim);
std::string join(const std::vector<std::string>& v, const char* delim);
std::string base64_encode(unsigned char const* bytes_to_encode, unsigned int in_len);
bool config_test();
/* report.cpp */
std::string determine_severity(std::string data_src, std::string ext);
void generate_report(INIReader cp, std::string session_id, std::string scan_starttime, std::string scan_endtime, std::map<std::string, VulnInfo> resultdict);
/* local_app.cpp */
std::map<std::string, std::string> getapp_all();
std::map<std::string, std::string> getapp_from_wmi();
std::map<std::string, std::string> getapp_from_hklm();
std::map<std::string, std::string> getapp_from_hklmwow64();
std::map<std::string, std::string> getapp_from_hkcu();
#endif