the interface of the KaosCube
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

256 lines
4.7 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. <!doctype html>
  2. <?php
  3. $lang=$_GET['lang'];
  4. if ( in_array ($lang, array('en-US'))){
  5. $loc = "$lang".".utf8";
  6. $loc1 = $lang;
  7. }
  8. else {
  9. $loc = "de-DE";
  10. $loc1 = "de-DE";
  11. }
  12. $color=$_GET['color'];
  13. if (strlen($color) <= 1){
  14. $color = "deeppink";
  15. }
  16. include "Spyc.php";
  17. $localeYaml = Spyc::YAMLLoad('locale.yaml');
  18. $domain = "messages";
  19. setlocale(LC_MESSAGES, $loc);
  20. setlocale(LC_ALL, $loc);
  21. $results = putenv("LC_ALL=$loc");
  22. $results = putenv("LC_MESSAGES=$loc");
  23. ?>
  24. <head>
  25. <meta charset="utf-8"/>
  26. <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  27. <title><?php echo $localeYaml['title'][$loc1]?></title>
  28. <link rel="stylesheet" href="css/index.css">
  29. </head>
  30. <style>
  31. body {
  32. background: <?php echo $color?>;
  33. }
  34. input[type="text"] {
  35. background: <?php echo $color?>;
  36. }
  37. input[type="text"]:focus {
  38. background: <?php echo $color?>;
  39. }
  40. </style>
  41. <body>
  42. <center>
  43. <div id="containerdiv">
  44. <a href="/"><p id="linktext"><b><?php echo $localeYaml['connect'][$loc1]?></b></p></a>
  45. <a href="changeKCPW.php"><p id="linktext"><?php echo $localeYaml['changePassword'][$loc1]?></p></a>
  46. <a href="info.php"><p id="linktext"><?php echo $localeYaml['info'][$loc1]?></p></a>
  47. <a href="onion.php"><p id="linktext"><?php echo $localeYaml['onionFeatures'][$loc1]?></p></a>
  48. <a href="freedom.php"><p id="linktext"><?php echo $localeYaml['freedom'][$loc1]?></p></a>
  49. </div>
  50. </center>
  51. <br><br><br>
  52. <center>
  53. <img src="images/info_graffiti_digitalized.png">
  54. </center>
  55. <?php
  56. $shellcommand2 = "nmcli c show > connections.csv";
  57. $output = shell_exec($shellcommand2);
  58. ?>
  59. <br><br><br><br>
  60. <center>
  61. <p> You have your hiddenservice running. It's address is</p>
  62. <br>
  63. <?php
  64. $stream = fopen("hshostname.txt", "r");
  65. while (($row = fgets($stream)) !== false) {
  66. echo $row;
  67. }
  68. fclose($stream);
  69. ?>
  70. <br><br><br><br>
  71. <?php echo $localeYaml['connections'][$loc1]?>
  72. <table id="demo"><tr>
  73. <th></th>
  74. <th></th>
  75. <th></th>
  76. <th></th>
  77. </tr>
  78. <?php
  79. // (A) OPEN CSV FILE
  80. $stream = fopen("connections.csv", "r");
  81. // (B) EXTRACT ROWS & COLS
  82. while (($row = fgets($stream)) !== false) {
  83. echo "<tr>";
  84. $col = preg_split( '/\s{2,}/', $row, -1, PREG_SPLIT_NO_EMPTY );
  85. // var_dump( preg_split( '/\s{2,}/', $row ) );
  86. $n = 0;
  87. $id = 'oi';
  88. foreach ($col as $c)
  89. {
  90. $n+=1;
  91. echo "<td>$c</td>";
  92. if ($n==1)
  93. {
  94. $id=substr($c, 0, -1);
  95. }
  96. }
  97. echo "</tr>";
  98. }
  99. // (C) CLOSE CSV FILE
  100. fclose($stream);
  101. ?></table>
  102. </center>
  103. </br></br></br></br>
  104. <?php
  105. $shellcommand3 = "nmcli dev status > devices.csv";
  106. $output = shell_exec($shellcommand3);
  107. ?>
  108. <br><br><br><br><br><br>
  109. <center>
  110. <?php echo $localeYaml['devices'][$loc1]?>
  111. <table id="demo"><tr>
  112. <th></th>
  113. <th></th>
  114. <th></th>
  115. <th></th>
  116. </tr>
  117. <?php
  118. // (A) OPEN CSV FILE
  119. $stream = fopen("devices.csv", "r");
  120. // (B) EXTRACT ROWS & COLS
  121. while (($row = fgets($stream)) !== false) {
  122. echo "<tr>";
  123. $col = preg_split( '/\s{2,}/', $row, -1, PREG_SPLIT_NO_EMPTY );
  124. // var_dump( preg_split( '/\s{2,}/', $row ) );
  125. $n = 0;
  126. $id = 'oi';
  127. foreach ($col as $c)
  128. {
  129. $n+=1;
  130. echo "<td>$c</td>";
  131. if ($n==1)
  132. {
  133. $id=substr($c, 0, -1);
  134. }
  135. }
  136. echo "</tr>";
  137. }
  138. // (C) CLOSE CSV FILE
  139. fclose($stream);
  140. ?></table>
  141. </center>
  142. </br></br></br></br>
  143. <?php
  144. $shellcommand2 = "nmcli -t --fields SSID,RATE,BARS,SECURITY dev wifi list > ssids.csv";
  145. $output = shell_exec($shellcommand2);
  146. ?>
  147. <center>
  148. <?php echo $localeYaml['ssids'][$loc1]?>
  149. <table id="demo"><tr>
  150. <th>SSID</th>
  151. <th>RATE</th>
  152. <th>BARS</th>
  153. <th>SEC</th>
  154. </tr>
  155. <?php
  156. // (A) OPEN CSV FILE
  157. $stream = fopen("ssids.csv", "r");
  158. // (B) EXTRACT ROWS & COLS
  159. while (($row = fgets($stream)) !== false) {
  160. echo "<tr>";
  161. $col = preg_split( '/:/', $row, -1, PREG_SPLIT_NO_EMPTY );
  162. // var_dump( preg_split( '/\s{2,}/', $row ) );
  163. $n = 0;
  164. $id = 'oi';
  165. foreach ($col as $c)
  166. {
  167. $n+=1;
  168. echo "<td>$c</td>";
  169. if ($n==1)
  170. {
  171. $id=substr($c, 0, -1);
  172. }
  173. }
  174. echo "</tr>";
  175. }
  176. // (C) CLOSE CSV FILE
  177. fclose($stream);
  178. ?></table>
  179. </center>
  180. </br></br></br></br>
  181. <footer>
  182. <center>
  183. <a href="mailto:contact@cannabinieri.de"><p id="linktext"><?php echo $localeYaml['contact'][$loc1]?></p></a>
  184. <p>© 2022 by Cannabinieri </p>
  185. <address>
  186. https://www.cannabinieri.de<br>
  187. E-Mail: contact@cannabinieri.de<br><br>
  188. </address>
  189. </center>
  190. </footer>
  191. </center>
  192. <center>
  193. <div id="containerdiv2">
  194. <a href="?color=deeppink"><p id="linktext"><b>pink</b></p></a>
  195. <a href="?color=lightblue"><p id="linktext">azurro</p></a>
  196. </div>
  197. </center>
  198. </body>
  199. </html>