-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcallMisconfigureFw.snippet
174 lines (152 loc) · 4.88 KB
/
callMisconfigureFw.snippet
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
// existing subnets
// subnet remoteSN
// subnet internetSN
// subnet dmzSN
// subnet serverSN
// subnet printerSN
// subnet engineeringClientSN
// subnet engineeringServerSN
// subnet productionSN
$PortPool$=["1337","22","2337","25","3200","3306","3389","443","465","7270","80","8080","8443"];
//determine number of misconfigurations for all subnet pairs
$numFwErrorsInternetDmz$=$PROB([0,1,2,3,4,5,6,7,8])$;
$netA$=$internetSNhosts$;
$netB$=$dmzSNhosts$;
$misconfigurations$=$numFwErrorsInternetDmz$;
if($misconfigurations$ != 0){
for($I$ in range(1,$misconfigurations$)){
$hostA$=$PROB($netA$)$;
$hostB$=$PROB($netB$)$;
$Port$=$PROB($PortPool$)$;
fwallow misconf$hostA$$hostB$$I$=new fwallow([$hostA$.tmpIp,$hostB$.tmpIp],[$Port$]);
};
};
$numFwErrorsDmzServer$=$PROB([0,1,2,3,4,5,6,7,8])$;
$netA$=$dmzSNhosts$;
$netB$=$serverSNhosts$;
$misconfigurations$=$numFwErrorsDmzServer$;
if($misconfigurations$ != 0){
for($I$ in range(1,$misconfigurations$)){
$hostA$=$PROB($netA$)$;
$hostB$=$PROB($netB$)$;
$Port$=$PROB($PortPool$)$;
fwallow misconf$hostA$$hostB$$I$=new fwallow([$hostA$.tmpIp,$hostB$.tmpIp],[$Port$]);
};
};
$numFwErrorsAccountingServer$=$PROB([0,1,2,3,4,5,6,7,8])$;
$netA$=$accountingSNhosts$;
$netB$=$serverSNhosts$;
$misconfigurations$=$numFwErrorsDmzServer$;
if($misconfigurations$ != 0){
for($I$ in range(1,$misconfigurations$)){
$hostA$=$PROB($netA$)$;
$hostB$=$PROB($netB$)$;
$Port$=$PROB($PortPool$)$;
fwallow misconf$hostA$$hostB$$I$=new fwallow([$hostA$.tmpIp,$hostB$.tmpIp],[$Port$]);
};
};
$numFwErrorsMarketingServer$=$PROB([0,1,2,3,4,5,6,7,8])$;
$netA$=$marketingSNhosts$;
$netB$=$serverSNhosts$;
$misconfigurations$=$numFwErrorsDmzServer$;
if($misconfigurations$ != 0){
for($I$ in range(1,$misconfigurations$)){
$hostA$=$PROB($netA$)$;
$hostB$=$PROB($netB$)$;
$Port$=$PROB($PortPool$)$;
fwallow misconf$hostA$$hostB$$I$=new fwallow([$hostA$.tmpIp,$hostB$.tmpIp],[$Port$]);
};
};
$numFwErrorsAdminServer$=$PROB([0,1,2,3,4,5,6,7,8])$;
$netA$=$adminSNhosts$;
$netB$=$serverSNhosts$;
$misconfigurations$=$numFwErrorsDmzServer$;
if($misconfigurations$ != 0){
for($I$ in range(1,$misconfigurations$)){
$hostA$=$PROB($netA$)$;
$hostB$=$PROB($netB$)$;
$Port$=$PROB($PortPool$)$;
fwallow misconf$hostA$$hostB$$I$=new fwallow([$hostA$.tmpIp,$hostB$.tmpIp],[$Port$]);
};
};
$numFwErrorsServerEngineeringserver$=$PROB([0,1,2,3,4,5,6,7,8])$;
$netA$=$serverSNhosts$;
$netB$=$engineeringServerSNhosts$;
$misconfigurations$=$numFwErrorsDmzServer$;
if($misconfigurations$ != 0){
for($I$ in range(1,$misconfigurations$)){
$hostA$=$PROB($netA$)$;
$hostB$=$PROB($netB$)$;
$Port$=$PROB($PortPool$)$;
fwallow misconf$hostA$$hostB$$I$=new fwallow([$hostA$.tmpIp,$hostB$.tmpIp],[$Port$]);
};
};
$numFwErrorsEngineeringclientEngineeringserver$=$PROB([0,1,2,3,4,5,6,7,8])$;
$netA$=$engineeringClientSNhosts$;
$netB$=$engineeringServerSNhosts$;
$misconfigurations$=$numFwErrorsDmzServer$;
if($misconfigurations$ != 0){
for($I$ in range(1,$misconfigurations$)){
$hostA$=$PROB($netA$)$;
$hostB$=$PROB($netB$)$;
$Port$=$PROB($PortPool$)$;
fwallow misconf$hostA$$hostB$$I$=new fwallow([$hostA$.tmpIp,$hostB$.tmpIp],[$Port$]);
};
};
$numFwErrorsProductionEngineeringserver$=$PROB([0,1,2,3,4,5,6,7,8])$;
$netA$=$productionSNhosts$;
$netB$=$engineeringServerSNhosts$;
$misconfigurations$=$numFwErrorsDmzServer$;
if($misconfigurations$ != 0){
for($I$ in range(1,$misconfigurations$)){
$hostA$=$PROB($netA$)$;
$hostB$=$PROB($netB$)$;
$Port$=$PROB($PortPool$)$;
fwallow misconf$hostA$$hostB$$I$=new fwallow([$hostA$.tmpIp,$hostB$.tmpIp],[$Port$]);
};
};
$numFwErrorsProductionEngineeringclient$=$PROB([0,1,2,3,4,5,6,7,8])$;
$netA$=$productionSNhosts$;
$netB$=$engineeringClientSNhosts$;
$misconfigurations$=$numFwErrorsDmzServer$;
if($misconfigurations$ != 0){
for($I$ in range(1,$misconfigurations$)){
$hostA$=$PROB($netA$)$;
$hostB$=$PROB($netB$)$;
$Port$=$PROB($PortPool$)$;
fwallow misconf$hostA$$hostB$$I$=new fwallow([$hostA$.tmpIp,$hostB$.tmpIp],[$Port$]);
};
};
for($member$ in $dmzSNhosts$){
node dmzSN.member=$member$;
};
for($member$ in $printerSNhosts$){
node printerSN.member=$member$;
};
for($member$ in $remoteSNhosts$){
node remoteSN.member=$member$;
};
for($member$ in $internetSNhosts$){
node internetSN.member=$member$;
};
for($member$ in $serverSNhosts$){
node serverSN.member=$member$;
};
for($member$ in $accountingSNhosts$){
node accountingSN.member=$member$;
};
for($member$ in $marketingSNhosts$){
node marketingSN.member=$member$;
};
for($member$ in $adminSNhosts$){
node adminSN.member=$member$;
};
for($member$ in $engineeringServerSNhosts$){
node engineeringServerSN.member=$member$;
};
for($member$ in $engineeringClientSNhosts$){
node engineeringClientSN.member=$member$;
};
for($member$ in $productionSNhosts$){
node productionSN.member=$member$;
};