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

<?php
$rootPW = $_POST["rootPW"];
$hsname = $_POST["hsname"];
$newTorState = "hs"
$configureHiddenService1 = "echo $rootPW | sudo -S sed -i 's/#HiddenServiceDir\ \/var\/lib\/tor\/hidden_service/HiddenServiceDir\ \/var\/lib\/tor\/$hsname/' /etc/tor/torrc";
$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";
$restartTor = "echo $rootPW | sudo -S systemctl restart tor";
$replaceTorState = "echo $newTorState > torstate.csv"
$writeTheNewGeneratedAddress = "echo $rootPW | sudo -S cat /var/lib/tor/$hsname/hostname > hshostname.txt"
$output = exec($configureHiddenService1);
$output1 = exec($configureHiddenService2);
$output2 = exec($restartTor);
$output3 = exec($replaceTorState);
$output4 = exec($writeTheNewGeneratedAddress);
echo $output3;
echo " oi oi oi ";
?>