From b722d515a57395f2c31c91de9eeb4fe1c63a74db Mon Sep 17 00:00:00 2001
From: Pinga <121483313+getpinga@users.noreply.github.com>
Date: Mon, 27 Nov 2023 17:32:02 +0200
Subject: [PATCH] Added rdap web client
---
rdap/client/index.php | 162 ++++++++++++++++++++++++++++++++++++++++++
rdap/client/rdap.php | 42 +++++++++++
2 files changed, 204 insertions(+)
create mode 100644 rdap/client/index.php
create mode 100644 rdap/client/rdap.php
diff --git a/rdap/client/index.php b/rdap/client/index.php
new file mode 100644
index 0000000..c66db4f
--- /dev/null
+++ b/rdap/client/index.php
@@ -0,0 +1,162 @@
+build();
+
+ $_SESSION['captcha'] = $captcha->getPhrase();
+
+ header('Content-type: image/jpeg');
+ $captcha->output();
+ exit;
+}
+?>
+
+
+
+
+
+
+ RDAP Lookup
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/rdap/client/rdap.php b/rdap/client/rdap.php
new file mode 100644
index 0000000..00c983c
--- /dev/null
+++ b/rdap/client/rdap.php
@@ -0,0 +1,42 @@
+ 'Invalid request method.']);
+ exit;
+}
+
+// Captcha validation (if used)
+if ($_POST['captcha'] !== $_SESSION['captcha']) {
+ echo json_encode(['error' => 'Captcha verification failed']);
+ exit;
+}
+
+// Invalidate the current captcha
+unset($_SESSION['captcha']);
+
+// Domain name from the POST request
+$domain = $_POST['domain'];
+
+// RDAP server URL
+$rdapServer = 'https://rdap.EXAMPLE.COM/domain/';
+
+// Initialize cURL session
+$ch = curl_init();
+curl_setopt($ch, CURLOPT_URL, $rdapServer . $domain);
+curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
+
+// Execute cURL session and close it
+$response = curl_exec($ch);
+curl_close($ch);
+
+// Check for errors
+if (!$response) {
+ echo json_encode(['error' => 'Error fetching RDAP data.']);
+ exit;
+}
+
+// Output the RDAP data
+echo $response;
\ No newline at end of file