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.

30 lines
929 B

  1. <?php
  2. $rootPW = $_POST["rootPW"];
  3. $hsname = $_POST["hsname"];
  4. $newTorState = "hs"
  5. $configureHiddenService1 = "echo $rootPW | sudo -S sed -i 's/#HiddenServiceDir\ \/var\/lib\/tor\/hidden_service/HiddenServiceDir\ \/var\/lib\/tor\/$hsname/' /etc/tor/torrc";
  6. $configureHiddenService2 = "echo $rootPW | sudo -S sed '0,/#HiddenServiceP/{s/#HiddenServicePort\ 80 127.0.0.1:80/HiddenServicePort 80 127.0.0.1:80\nHiddenServicePort 22 127.0.0.1:22/}' /etc/tor/torrc";
  7. $restartTor = "echo $rootPW | sudo -S systemctl restart tor";
  8. $replaceTorState = "echo $newTorState > torstate.csv"
  9. $writeTheNewGeneratedAddress = "echo $rootPW | sudo -S cat /var/lib/tor/$hsname/hostname > hshostname.txt"
  10. $output = exec($configureHiddenService1);
  11. $output1 = exec($configureHiddenService2);
  12. $output2 = exec($restartTor);
  13. $output3 = exec($replaceTorState);
  14. $output4 = exec($writeTheNewGeneratedAddress);
  15. echo $output3;
  16. echo " oi oi oi ";
  17. ?>