-
Notifications
You must be signed in to change notification settings - Fork 30
/
LooquerScanner.h
95 lines (80 loc) · 1.82 KB
/
LooquerScanner.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#pragma once
#include "Stdafx.h"
#include "HostScanner.h"
#include <string>
/*!
* Implements a passive scanner which returns Mr. Looquer data.
*/
class LooquerScanner : public HostScanner
{
public:
/*!
* Initializes a new instance of this class.
*/
LooquerScanner() = default;
/*!
* Initializes a new instance of this class.
*
* \param key API key to use for the requests.
*/
explicit LooquerScanner(const std::string& key);
/*!
* Sets the specified API key.
*
* \param key API key to set.
*/
void SetKey(const std::string& key);
/*!
* Value indicating whether an API key was specified.
*
* \return true if key is present, otherwise false.
*/
bool HasKey();
/*!
* Sets the specified API endpoint location.
*
* \param uri API location to set.
*/
void SetEndpoint(const std::string& uri);
/*!
* Value indicating whether this instance is a passive scanner.
*
* A passive scanner does not actively send packets towards the
* scanned target, it instead uses miscellaneous data sources to
* gather information regarding the target.
*
* \return true if passive, false if not.
*/
bool IsPassive() override;
/*!
* Scans a host to determine service availability.
*
* \param host Host.
*/
void Scan(Host* host) override;
/*!
* Scans a list of hosts to determine service availability.
*
* \param hosts List of hosts.
*/
void Scan(Hosts* hosts) override;
/*!
* Frees up the resources allocated during the lifetime of this instance.
*/
~LooquerScanner() override;
private:
/*!
* API key to use for the requests.
*/
std::string key;
/*!
* API endpoint location.
*/
std::string endpoint = "https://mrlooquer.com/api/v1";
/*!
* Gets the information available on the API for the specified host.
*
* \param host Host.
*/
void getHostInfo(Host* host);
};