summaryrefslogtreecommitdiff
path: root/dns.php
diff options
context:
space:
mode:
Diffstat (limited to 'dns.php')
-rw-r--r--dns.php41
1 files changed, 41 insertions, 0 deletions
diff --git a/dns.php b/dns.php
new file mode 100644
index 0000000..2ac85d1
--- /dev/null
+++ b/dns.php
@@ -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
+}
+?>