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 + + + +
+

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