2 using System.Collections.Generic;
5 using System.Threading.Tasks;
11 internal Dictionary<string, string> queryData {
get;
set; }
12 private HashSet<string> CalledMethods =
new HashSet<string>();
13 private string searchText =
string.Empty;
21 queryData.Add(
"before", time.ToString(
"dd/MM/yyyy"));
32 queryData.Add(
"after", time.ToString(
"dd/MM/yyyy"));
43 queryData.Add(
"asn", asn);
49 queryData.Add(
"city", city);
55 queryData.Add(
"country", country);
66 queryData.Add(
"has_screenshot", hasScreenshot.ToString());
72 queryData.Add(
"hostname", hostname);
78 queryData.Add(
"html", html);
84 queryData.Add(
"isp", isp);
90 queryData.Add(
"net", net);
96 queryData.Add(
"org", org);
102 queryData.Add(
"os", os);
108 queryData.Add(
"port", port);
114 queryData.Add(
"postal", postal);
120 queryData.Add(
"product", product);
126 queryData.Add(
"state", state);
132 queryData.Add(
"title", title);
138 queryData.Add(
"version", version);
144 queryData.Add(
"bitcoin.ip", bitcoinip);
148 public QueryGenerator With_Bitcoinip_count(
string bitcoinip_count)
150 queryData.Add(
"bitcoin.ip_count", bitcoinip_count);
156 queryData.Add(
"bitcoin.port", bitcoinport);
162 queryData.Add(
"bitcoin.version", bitcoinversion);
168 queryData.Add(
"ntp.ip", ntpip);
174 queryData.Add(
"ntp.ip_count", ntpip_count);
180 queryData.Add(
"ntp.more", ntpmore);
186 queryData.Add(
"ntp.port", ntpport);
192 if(!
string.IsNullOrWhiteSpace(this.searchText))
196 this.searchText = searchText;
200 internal string Generate()
202 var sb =
new StringBuilder(searchText);
203 if(!
string.IsNullOrWhiteSpace(searchText))
207 foreach(var item
in queryData)
209 sb.Append($
"{item.Key}:{item.Value}");
211 return sb.ToString();
QueryGenerator WithAsn(string asn)
The Autonomous System Number that identifies the network the device is on.
QueryGenerator HasScreenshot(bool hasScreenshot=true)
If "true" only show results that have a screenshot available.
QueryGenerator After(DateTime time)
Only show results that were collected after the given date