-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
83 lines (82 loc) · 3.01 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Rapport recherche Hack</title>
<link href="https://cdn.datatables.net/1.12.1/css/jquery.dataTables.min.css" rel="stylesheet">
</head>
<body>
<h2>Comportements suspects</h2>
<table id="rapport">
<thead>
<tr>
<th>id</th>
<th>time</th>
<th>remote_host</th>
<th>request_line</th>
<th>response_code</th>
<th>bytes_sent</th>
</tr>
</thead>
<tbody>
<?php
try{
$db = new PDO('mysql:host=localhost;dbname=hack', 'root', '');
}catch(Exception $e){
echo "Erreur : ".$e->getMessage();
}
$sql="SELECT id,time,remote_host,request_line,response_code,bytes_sent FROM logs WHERE method in ('POST','PUT','DELETE','CONNECT') and response_code not in (200,201,204,301,302)";
$query=$db->prepare($sql);
$query->execute();
$result=$query->fetchAll();
foreach($result as $row){
echo "<tr><td>".$row['id']."</td><td>".$row['time']."</td><td>".$row['remote_host']."</td><td>".$row['request_line']."</td><td>".$row['response_code']."</td><td>".$row['bytes_sent']."</td></tr>";
}
?>
</tbody>
</table>
<h2>Attaques potentiellement réussies</h2>
<table id="rapport2">
<thead>
<tr>
<th>id</th>
<th>time</th>
<th>remote_host</th>
<th>request_line</th>
<th>response_code</th>
<th>bytes_sent</th>
</tr>
</thead>
<tbody>
<?php
try{
$db = new PDO('mysql:host=localhost;dbname=hack', 'root', '');
}catch(Exception $e){
echo "Erreur : ".$e->getMessage();
}
$sql="SELECT id,time,remote_host,request_line,response_code,bytes_sent FROM logs WHERE method in ('POST','PUT','DELETE','CONNECT') and response_code in (200,201,204) and request_line REGEXP '(uploadimage|alfacgiapi|alfa|videostab|file_upload|_ajax|createordersmagavenue|sistem|license|search|perl|security|hack|upload|form|import|pwn|hijack|root|bash|wget|sql|bak|bkp|old|localhost|dump|user|backup)'=1";
$query=$db->prepare($sql);
$query->execute();
$result=$query->fetchAll();
foreach($result as $row){
echo "<tr><td>".$row['id']."</td><td>".$row['time']."</td><td>".$row['remote_host']."</td><td>".urldecode($row['request_line'])."</td><td>".$row['response_code']."</td><td>".$row['bytes_sent']."</td></tr>";
}
?>
</tbody>
</table>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://cdn.datatables.net/1.12.1/js/jquery.dataTables.min.js"></script>
<script>
$(document).ready(function() {
$('#rapport').DataTable({
"pageLength": 50
});
$('#rapport2').DataTable({
"pageLength": 50
});
} );
</script>
</body>
</html>