diff options
author | Luke Bratch <luke@bratch.co.uk> | 2017-04-05 23:46:36 +0100 |
---|---|---|
committer | Luke Bratch <luke@bratch.co.uk> | 2017-04-05 23:46:36 +0100 |
commit | 5b26412a166c9e88c251d8ba376317bbc3fe4fdb (patch) | |
tree | 11260e59513b7641ec0ae253d23d00ac6df3ab80 |
Initial commit
-rw-r--r-- | dns.php | 41 | ||||
l--------- | dns.phps | 1 |
2 files changed, 42 insertions, 0 deletions
@@ -0,0 +1,41 @@ +<?php +ini_set("display_errors", 1); +ini_set("display_startup_errors", 1); +error_reporting(E_ALL); + +if ($_POST['domain']) { + echo "domain posted\n"; + + $connection = ssh2_connect("misc.tghost.co.uk", 22, array("hostkey" => "ssh-rsa")); + + if (ssh2_auth_pubkey_file($connection, "bladns.net", "/home/bladns.net/.ssh/id_rsa.pub", "/home/bladns.net/.ssh/id_rsa")) { + echo "Public Key Authentication Successful\n<br>\n<br>"; + } else { + echo "Public Key Authentication Failed\n<br>\n<br>"; + } + + echo "<pre>"; + $stream = ssh2_exec($connection, "ps aux | grep named"); + stream_set_blocking($stream, true); + $stream_out = ssh2_fetch_stream($stream, SSH2_STREAM_STDIO); + echo stream_get_contents($stream_out); + echo "</pre>"; +} else { +?> +<!DOCTYPE html> +<html> + <head> + <title>BlaDNS</title> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> + </head> + <body> + <form name="login" action="dns.php" method="post"> + Domain name: <input type="text" name="domain"><br> + Password: <input type="password" name="password"><br> + <input type="submit"> + </form> + </body> +</html> +<?php +} +?> diff --git a/dns.phps b/dns.phps new file mode 120000 index 0000000..66c56b0 --- /dev/null +++ b/dns.phps @@ -0,0 +1 @@ +dns.php
\ No newline at end of file |