iwscan.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. include_once("../../../auth.php");
  3. ?>
  4. <html>
  5. <head>
  6. <title>iwscan report</title>
  7. <link href="../../../script/tocas/tocas.css" rel='stylesheet'>
  8. <style>
  9. .fullscreen{
  10. width:100%;
  11. height:100%;
  12. }
  13. body{
  14. padding:10px;
  15. padding-bottom:30px;
  16. }
  17. </style>
  18. </head>
  19. <body>
  20. <?php
  21. if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
  22. die('<div class="ts message">
  23. <div class="header">Not Supported OS</div>
  24. <p>This function is not supported in Windows Host.</p>
  25. </div>');
  26. }
  27. ?>
  28. <div class="fullscreen ts input">
  29. <textarea class="fullscreen" readonly>
  30. <?php
  31. $content = trim(shell_exec("sudo iw wlan0 scan"));
  32. if($content == ""){
  33. echo "Interface not found or disabled. Please make sure you have wlan0 enabled.";
  34. }else{
  35. echo $content;
  36. }
  37. ?>
  38. </textarea>
  39. </div>
  40. </body>
  41. </html>