This repository has been archived by the owner on Feb 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDataTypes.fs
93 lines (81 loc) · 2.74 KB
/
DataTypes.fs
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
namespace Hosts
module DataTypes =
open System
open System.IO
type ExitCodes =
| Success = 0
| ErrorServerTypeSwitchMissing = -1
| ErrorServerTypeUnknown = -2
let blackHole = "0.0.0.0"
#if DEBUG
let directory = Environment.CurrentDirectory
#else
let directory = Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location)
#endif
let addedHostsFilePath = Path.Combine (directory, "addedHosts.txt")
let excludedHostsFilePath = Path.Combine (directory, "excludedHosts.txt")
let customExtrasFilePath = Path.Combine (directory, "customExtras.txt")
type DnsServerType =
| Bind
| Unbound
| Windows
| Missing
| Unknown
type DnsServer = {
Name: DnsServerType
Format: string -> string
}
let dnsServerTypes : List<DnsServer> = [
{
Name = Bind
Format = (fun x -> "zone \"" + x + "\" { type master; file \"/etc/bind/zones/db.poison\"; };")
}
{
Name = Unbound
Format = (fun x -> "local-zone: \"" + x + "\" inform_deny.")
}
{
Name = Windows
Format = (fun x -> blackHole + " " + x)
}
{
Name = Unknown
Format = (fun x -> "# domain name server type unknown")
}
]
type DomainSourceType =
| AbuseCH
| MVPS
| SANS
type DomainSource = {
Name: DomainSourceType
Url: Uri
Format: string -> string
}
let domainSources : List<DomainSource> = [
{
Name = AbuseCH;
Url = new Uri("https://ransomwaretracker.abuse.ch/downloads/RW_DOMBL.txt");
Format = (fun raw -> if raw.StartsWith("#") then "" else raw)
}
{
Name = SANS;
Url = new Uri("https://isc.sans.edu/feeds/suspiciousdomains_Low.txt");
Format = (fun raw -> if raw.StartsWith("#") || raw.StartsWith("site") then "" else raw)
}
{
Name = SANS;
Url = new Uri("https://isc.sans.edu/feeds/suspiciousdomains_Medium.txt");
Format = (fun raw -> if raw.StartsWith("#") || raw.StartsWith("site") then "" else raw)
}
{
Name = SANS;
Url = new Uri("https://isc.sans.edu/feeds/suspiciousdomains_High.txt");
Format = (fun raw -> if raw.StartsWith("#") || raw.StartsWith("site") then "" else raw)
}
{
Name = MVPS;
Url = new Uri("http://winhelp2002.mvps.org/hosts.txt");
Format = (fun (raw: string) -> if raw.StartsWith("#") || String.IsNullOrWhiteSpace raw then "" else raw.Split(" ", StringSplitOptions.RemoveEmptyEntries).[1])
}
]