cyberchallenge-modem/webpanel/index.php

76 lines
1.9 KiB
PHP
Raw Normal View History

2020-05-20 09:54:59 +02:00
<?php
$title = "Index";
require_once("includes/config.php");
require_once("includes/header.php");
require_once("includes/nav.php");
?>
<div class="container">
<h3>Flag</h3>
<p><?php echo $flag ?></p>
<h2>System</h2>
<h3>Info</h3>
<table class="table">
<tbody>
<tr>
<td>Kernel</td>
<td><?php $uname = posix_uname(); echo $uname['nodename'].' '.$uname['release'] ?></td>
</tr>
<tr>
<td>Uptime</td>
<td><?php echo file_get_contents('/proc/uptime'); ?></td>
</tr>
<tr>
<td>Memory</td>
<td><?php $meminfo = explode("\n", file_get_contents('/proc/meminfo')); echo $meminfo[0].'/'.$meminfo[1] ?></td>
</tr>
</tbody>
</table>
<h2>Network</h2>
<h3>Info</h3>
<table class="table">
<tbody>
<tr>
<td>Wifi</td>
<td><?php $hostapod = file_get_contents('/etc/hostapd.conf'); ?></td>
</tr>
<tr>
<td>Ip Address</td>
<td><?php $dhcpd = file_get_contents('/etc/dhcpd.conf'); ?></td>
</tr>
<tr>
<td>Stats</td>
<td><?php $rx = file_get_contents('/sys/class/net/'.$interface.'/statistics/rx_bytes'); $tx = file_get_contents('/sys/class/net/'.$interface.'/statistics/tx_bytes'); echo ($rx/1024/1024).'MB RX / '.($tx/1024/1024).'MB TX'; ?></td>
</tr>
</tbody>
</table>
<h3>Client List</h3>
<table class="table">
<thead>
<tr>
<th>Ip Address</th>
<th>MAC</th>
<th>Hostname</th>
</tr>
</thead>
<tbody>
<tr>
<td>192.168.77.2</td>
<td>00:11:22:AA:BB:CC</td>
<td>desktop-ab2846ad</td>
</tr>
<tr>
<td>192.168.77.2</td>
<td>00:11:22:AA:BB:DD</td>
<td>android-deadbeef</td>
</tr>
<tr>
<td>192.168.77.4</td>
<td>00:11:22:AA:BB:EE</td>
<td>windows-laptop</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>