a phising page made for Crimson Defence CTF
1<!doctype html>
2<html lang="en">
3 <head>
4 <meta charset="UTF-8" />
5 <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6 <link rel="icon" type="image/x-icon" href="favicon.png" />
7 <title>Admin Dashboard</title>
8 <link rel="stylesheet" href="styles.css" />
9 <style>
10 .admin-container {
11 width: 90%;
12 max-width: 1200px;
13 margin: 20px auto;
14 padding: 20px;
15 background-color: #fff;
16 border-radius: 8px;
17 box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
18 }
19
20 table {
21 width: 100%;
22 border-collapse: collapse;
23 margin-top: 20px;
24 }
25
26 th, td {
27 padding: 12px;
28 text-align: left;
29 border-bottom: 1px solid #ddd;
30 }
31
32 th {
33 background-color: #c62828;
34 color: white;
35 }
36
37 tr:hover {
38 background-color: #f5f5f5;
39 }
40
41 .refresh-btn {
42 background-color: #c62828;
43 color: white;
44 border: none;
45 padding: 10px 20px;
46 border-radius: 4px;
47 cursor: pointer;
48 margin-bottom: 20px;
49 }
50
51 .refresh-btn:hover {
52 background-color: #b71c1c;
53 }
54 </style>
55 </head>
56 <body>
57 <header>
58 <img src="banner.png" alt="" width="500px" />
59 </header>
60
61 <div class="header">
62 <h1>Admin Dashboard</h1>
63 </div>
64
65 <div class="admin-container">
66 <h2>Password Change Logs</h2>
67 <button id="refreshBtn" class="refresh-btn">Refresh Data</button>
68 <div id="logsContainer">
69 <table id="logsTable">
70 <thead>
71 <tr>
72 <th>ID</th>
73 <th>Username</th>
74 <th>Old Password</th>
75 <th>New Password</th>
76 <th>IP Address</th>
77 <th>User Agent</th>
78 <th>Timestamp</th>
79 </tr>
80 </thead>
81 <tbody id="logsTableBody">
82 <!-- Logs will be inserted here -->
83 </tbody>
84 </table>
85 </div>
86 </div>
87
88 <script>
89 // Function to fetch and display logs
90 function fetchLogs() {
91 fetch('/api/logs')
92 .then(response => response.json())
93 .then(data => {
94 const tableBody = document.getElementById('logsTableBody');
95 tableBody.innerHTML = ''; // Clear existing rows
96
97 data.forEach(log => {
98 const row = document.createElement('tr');
99 row.innerHTML = `
100 <td>${log.id}</td>
101 <td>${log.username}</td>
102 <td>${log.old_password}</td>
103 <td>${log.new_password}</td>
104 <td>${log.ip_address}</td>
105 <td>${log.user_agent}</td>
106 <td>${log.timestamp}</td>
107 `;
108 tableBody.appendChild(row);
109 });
110 })
111 .catch(error => {
112 console.error('Error fetching logs:', error);
113 });
114 }
115
116 // Fetch logs when page loads
117 document.addEventListener('DOMContentLoaded', fetchLogs);
118
119 // Refresh button event listener
120 document.getElementById('refreshBtn').addEventListener('click', fetchLogs);
121 </script>
122 </body>
123</html>