-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathhuntdetails.php
269 lines (259 loc) · 9.21 KB
/
huntdetails.php
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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
<?php
include ("header.php");
if (isset($huntGUID)) {
if($huntGUID != '') {
$sqlFilter = " AND hu.huntingGUID = '$huntGUID'";
}
echo '
<h1>
Hunt Details
<small>NOAH 0.1</small>
</h1>
<ol class="breadcrumb">
<li><a href="index.php"><i class="fa fa-dashboard"></i> Home</a></li>
<li><a href="hunt.php"><i class="fa fa-cube"></i> Hunts</a></li>
<li class="active">Hunt Details</li>
</ol>
</section>
<!-- Main content -->
<section class="content">';
if (isset($_GET['hunt'])) {
if($huntGUID != '') {
$sqlFilter = " AND hu.huntingGUID = '$huntGUID'";
}
$huntGUID = htmlentities(trim(htmlspecialchars(addslashes($_GET['hunt']))));
$tsql = "SELECT huntingID, [huntingGUID]
,[huntingDate]
,[huntingState]
,[huntingComputerNumber]
,[huntingDescription]
FROM [NOAH].[dbo].[Hunt] hu
WHERE huntingGUID LIKE '$huntGUID'
ORDER BY huntingDate DESC";
$getHunt = sqlsrv_query($conn, $tsql);
if ( $getHunt === false)
die( print_r( sqlsrv_errors(), true));
$data = array();
$data['data'] = '';
if(sqlsrv_has_rows($getHunt)) {
$huntingState = '';$huntGUID='';$huntDate='';$huntingComputerNumber='';$huntingDescription='';
if( $row = sqlsrv_fetch_array( $getHunt, SQLSRV_FETCH_ASSOC)) {
$huntDate = date_format($row['huntingDate'], 'Y-m-d H:i:s');
if($row['huntingState'] == 1){
$huntingState = '<span class="label label-success">Completed</span>';
}
else {
$huntingState = '<span class="label label-warning">Pending</span>';
}
$huntingID = $row['huntingID'];
$huntingGUID = $row['huntingGUID'];
$huntingComputerNumber = $row['huntingComputerNumber'];
$huntingDescription = $row['huntingDescription'];
}
}
echo '
<!-- Main row -->
<div class="row">
<div class="box">
<div class="box-header">
<h3 class="box-title">Hunting Actions</h3>
</div>
<div class="box-body">
<p>Use the <code>buttons</code> below to <code>hunt</code>:</p>';
if((CountArtifactByHuntAndHost($conn, "AmcacheAudited", $sqlFilter)) > 0){
echo '
<a href="artifact1.php?hunt='.$huntingGUID.'&pageSwitch=amcache" class="btn btn-app">
<i class="fa fa-archive"></i> AM Cache
</a>';
}
if((CountArtifactByHuntAndHost($conn, "BrowserHistoryAudited", $sqlFilter)) > 0){
echo '
<a href="artifact1.php?hunt='.$huntingGUID.'&pageSwitch=browserhistory" class="btn btn-app">
<i class="fa fa-internet-explorer"></i> Browser History
</a>';
}
if((CountArtifactByHuntAndHost($conn, "DNSCacheAudited", $sqlFilter)) > 0){
echo '
<a href="artifact1.php?hunt='.$huntingGUID.'&pageSwitch=dnscache" class="btn btn-app">
<i class="fa fa-cloud"></i> DNS Cache
</a>';
}
if((CountArtifactByHuntAndHost($conn, "ExplorerBarAudited", $sqlFilter)) > 0){
echo '
<a href="artifact1.php?hunt='.$huntingGUID.'&pageSwitch=explorerbar" class="btn btn-app">
<i class="fa fa-folder"></i> Explorer Bar
</a>';
}
if((CountArtifactByHuntAndHost($conn, "LinkFilesAudited", $sqlFilter)) > 0){
echo '
<a href="artifact1.php?hunt='.$huntingGUID.'&pageSwitch=linkfile" class="btn btn-app">
<i class="fa fa-file-code-o"></i> LNK Files
</a>';
}
if((CountArtifactByHuntAndHost($conn, "NetStatAudited", $sqlFilter)) > 0){
echo '
<a href="artifact1.php?hunt='.$huntingGUID.'&pageSwitch=netstat" class="btn btn-app">
<i class="fa fa-exchange"></i> Network Flows
</a>';
}
if((CountArtifactByHuntAndHost($conn, "ODBCInstalledAudited", $sqlFilter)) > 0){
echo '
<a href="artifact1.php?hunt='.$huntingGUID.'&pageSwitch=obdcinstalled" class="btn btn-app">
<i class="fa fa-database"></i> ODBC Installed
</a>';
}
if((CountArtifactByHuntAndHost($conn, "ODBCConfiguredAudited", $sqlFilter)) > 0){
echo '
<a href="artifact1.php?hunt='.$huntingGUID.'&pageSwitch=obdcconfigured" class="btn btn-app">
<i class="fa fa-database"></i> ODBC Configured
</a>';
}
if((CountArtifactByHuntAndHost($conn, "AutorunAudited", $sqlFilter)) > 0){
echo '
<a href="artifact1.php?hunt='.$huntingGUID.'&pageSwitch=persistence" class="btn btn-app">
<i class="fa fa-history"></i> Persistence
</a>';
}
if((CountArtifactByHuntAndHost($conn, "PrefetchAudited", $sqlFilter)) > 0){
echo '
<a href="artifact1.php?hunt='.$huntingGUID.'&pageSwitch=prefetch" class="btn btn-app">
<i class="fa fa-th"></i> Prefetch Files
</a>';
}
if((CountArtifactByHuntAndHost($conn, "ProcessTreeAudited", $sqlFilter)) > 0){
echo '
<a href="artifact1.php?hunt='.$huntingGUID.'&pageSwitch=processtreebyserver" class="btn btn-app">
<i class="fa fa-cogs"></i> Process Tree
</a>';
}
if((CountArtifactByHuntAndHost($conn, "RecentDocsAudited", $sqlFilter)) > 0){
echo '
<a href="artifact1.php?hunt='.$huntingGUID.'&pageSwitch=recentdocs" class="btn btn-app">
<i class="fa fa-file-word-o"></i> Recent Docs
</a>';
}
if((CountArtifactByHuntAndHost($conn, "RecentFileCacheAudited", $sqlFilter)) > 0){
echo '
<a href="artifact1.php?hunt='.$huntingGUID.'&pageSwitch=recentfilecache" class="btn btn-app">
<i class="fa fa-archive"></i> Recent File Cache
</a>';
}
if((CountArtifactByHuntAndHost($conn, "RunMRUsAudited", $sqlFilter)) > 0){
echo '
<a href="artifact1.php?hunt='.$huntingGUID.'&pageSwitch=runmru" class="btn btn-app">
<i class="fa fa-hdd-o"></i> Run MRU
</a>';
}
if((CountArtifactByHuntAndHost($conn, "ScheduledTaskAudited", $sqlFilter)) > 0){
echo '
<a href="artifact1.php?hunt='.$huntingGUID.'&pageSwitch=scheduledtask" class="btn btn-app">
<i class="fa fa-tasks"></i> Scheduled Tasks
</a>';
}
if((CountArtifactByHuntAndHost($conn, "ServiceAudited", $sqlFilter)) > 0){
echo '
<a href="artifact1.php?hunt='.$huntingGUID.'&pageSwitch=service" class="btn btn-app">
<i class="fa fa-gear"></i> Services
</a>';
}
if((CountArtifactByHuntAndHost($conn, "ShimCacheAudited", $sqlFilter)) > 0){
echo '
<a href="artifact1.php?hunt='.$huntingGUID.'&pageSwitch=shimcache" class="btn btn-app">
<i class="fa fa-archive"></i> Shim Cache
</a>';
}
if((CountArtifactByHuntAndHost($conn, "InstalledProgramAudited", $sqlFilter)) > 0){
echo '
<a href="artifact1.php?hunt='.$huntingGUID.'&pageSwitch=software" class="btn btn-app">
<i class="fa fa-laptop"></i> Software Installed
</a>';
}
if((CountArtifactByHuntAndHost($conn, "USBHistoryAudited", $sqlFilter)) > 0){
echo '
<a href="artifact1.php?hunt='.$huntingGUID.'&pageSwitch=usbhistory" class="btn btn-app">
<i class="fa fa-bolt"></i> USB Forensic
</a>';
}
//if((CountArtifactByHuntAndHost($conn, "ExplorerBarAudited", $sqlFilter)) > 0){
echo '
<a href="useraccess.php?hunt='.$huntingGUID.'" class="btn btn-app">
<i class="fa fa-users"></i> Users Access
</a>';
//}
//if((CountArtifactByHuntAndHost($conn, "ExplorerBarAudited", $sqlFilter)) > 0){
echo '
<a class="btn btn-app">
<i class="fa fa-users"></i> Users Profiles
</a>';
//}
echo '
</div>
<!-- /.box-body -->
</div>
<!-- Left col -->
<div class="col-md-12">
<!-- MAP & BOX PANE -->
<!-- TABLE: LATEST ORDERS -->
<div class="box box-info">
<div class="box-header with-border">
<h3 class="box-title">Hunt Details</h3><br />
<p class="help-block"><?php echo "($huntingGUID - $huntingDescription - $huntDate)";?></p>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
</button>
<button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
</div>
</div>
<!-- /.box-header -->
<div class="box-body">
<div class="table-responsive">
<table class="table no-margin">
<thead>
<tr>
<th>Sever Name</th>
<th>Domain</th>
<th>Role</th>
<th>HW_Make</th>
<th>HW_Model</th>
</tr>
</thead>
<tbody id="suspiciousmruph">
<div class="input-group input-group-sm">
<form action="processtree.php">
<input type="text" class="form-control" id="mruinput">
<span class="input-group-btn">
<button type="button" class="btn btn-info btn-flat" id="mru">Go!</button>
</span>
</form>
</div>';
$getHunt = RetrieveHuntDetails($conn, $huntingID);
foreach($getHunt as $result) {
echo $result;
}
echo '
</tbody>
</table>
</div>
<!-- /.table-responsive -->
</div>
<!-- /.box-body -->
<div class="box-footer clearfix">
<a href="launchhunt.php" class="btn btn-sm btn-info btn-flat pull-left">Make New Hunt</a>
<a href="hunt.php" class="btn btn-sm btn-default btn-flat pull-right">View All Hunts</a>
</div>
<!-- /.box-footer -->
</div>
<!-- /.box -->
</div>
<!-- /.col -->
</div>
<!-- /.row -->';
}
echo '
</section>
<!-- /.content -->
</div>
<!-- /.content-wrapper -->';
}
include ("footer.php");
sqlsrv_close($conn);