This commit is contained in:
Pinga 2023-08-27 18:41:21 +03:00
parent b7065fcaa6
commit 6181ece4de
9 changed files with 84 additions and 84 deletions

View file

@ -41,7 +41,7 @@ $server->on('receive', function ($server, $fd, $reactorId, $data) {
$server->send($fd, "Error connecting to database"); $server->send($fd, "Error connecting to database");
$server->close($fd); $server->close($fd);
} }
// Validate and sanitize the domain name // Validate and sanitize the domain name
$domain = trim($data); $domain = trim($data);
if (!$domain) { if (!$domain) {
@ -57,7 +57,7 @@ $server->on('receive', function ($server, $fd, $reactorId, $data) {
$server->send($fd, "domain name invalid format"); $server->send($fd, "domain name invalid format");
$server->close($fd); $server->close($fd);
} }
// Extract TLD from the domain and prepend a dot // Extract TLD from the domain and prepend a dot
$parts = explode('.', $domain); $parts = explode('.', $domain);
$tld = "." . end($parts); $tld = "." . end($parts);
@ -92,39 +92,39 @@ $server->on('receive', function ($server, $fd, $reactorId, $data) {
$server->close($fd); $server->close($fd);
return; return;
} }
// Perform the DAS lookup // Perform the DAS lookup
try { try {
$query = "SELECT name FROM `registry`.`domain` WHERE `name` = :domain"; $query = "SELECT name FROM `registry`.`domain` WHERE `name` = :domain";
$stmt = $pdo->prepare($query); $stmt = $pdo->prepare($query);
$stmt->bindParam(':domain', $domain, PDO::PARAM_STR); $stmt->bindParam(':domain', $domain, PDO::PARAM_STR);
$stmt->execute(); $stmt->execute();
if ($f = $stmt->fetch(PDO::FETCH_ASSOC)) { if ($f = $stmt->fetch(PDO::FETCH_ASSOC)) {
$server->send($fd, "1"); $server->send($fd, "1");
if ($fp = @fopen("/var/log/das/das_request.log",'a')) { if ($fp = @fopen("/var/log/das/das_request.log",'a')) {
$clientInfo = $server->getClientInfo($fd); $clientInfo = $server->getClientInfo($fd);
$remoteAddr = $clientInfo['remote_ip']; $remoteAddr = $clientInfo['remote_ip'];
fwrite($fp,date('Y-m-d H:i:s')."\t-\t".$remoteAddr."\t-\t".$domain."\n"); fwrite($fp,date('Y-m-d H:i:s')."\t-\t".$remoteAddr."\t-\t".$domain."\n");
fclose($fp); fclose($fp);
} }
$server->close($fd); $server->close($fd);
} else { } else {
$server->send($fd, "0"); $server->send($fd, "0");
if ($fp = @fopen("/var/log/das/das_not_found.log",'a')) { if ($fp = @fopen("/var/log/das/das_not_found.log",'a')) {
$clientInfo = $server->getClientInfo($fd); $clientInfo = $server->getClientInfo($fd);
$remoteAddr = $clientInfo['remote_ip']; $remoteAddr = $clientInfo['remote_ip'];
fwrite($fp,date('Y-m-d H:i:s')."\t-\t".$remoteAddr."\t-\t".$domain."\n"); fwrite($fp,date('Y-m-d H:i:s')."\t-\t".$remoteAddr."\t-\t".$domain."\n");
fclose($fp); fclose($fp);
} }
$server->close($fd); $server->close($fd);
} }
} catch (PDOException $e) { } catch (PDOException $e) {
$server->send($fd, "Error connecting to the das database"); $server->send($fd, "Error connecting to the das database");
$server->close($fd); $server->close($fd);
} }
// Close the connection // Close the connection
$pdo = null; $pdo = null;

View file

@ -107,7 +107,7 @@ $http->start();
function handleDomainQuery($request, $response, $pdo, $domainName) { function handleDomainQuery($request, $response, $pdo, $domainName) {
// Extract and validate the domain name from the request // Extract and validate the domain name from the request
$domain = trim($domainName); $domain = trim($domainName);
// Empty domain check // Empty domain check
if (!$domain) { if (!$domain) {
$response->header('Content-Type', 'application/json'); $response->header('Content-Type', 'application/json');
@ -115,7 +115,7 @@ function handleDomainQuery($request, $response, $pdo, $domainName) {
$response->end(json_encode(['error' => 'Please enter a domain name'])); $response->end(json_encode(['error' => 'Please enter a domain name']));
return; return;
} }
// Check domain length // Check domain length
if (strlen($domain) > 68) { if (strlen($domain) > 68) {
$response->header('Content-Type', 'application/json'); $response->header('Content-Type', 'application/json');
@ -123,7 +123,7 @@ function handleDomainQuery($request, $response, $pdo, $domainName) {
$response->end(json_encode(['error' => 'Domain name is too long'])); $response->end(json_encode(['error' => 'Domain name is too long']));
return; return;
} }
// Check for prohibited patterns in domain names // Check for prohibited patterns in domain names
if (preg_match("/(^-|^\.|-\.|\.-|--|\.\.|-$|\.$)/", $domain)) { if (preg_match("/(^-|^\.|-\.|\.-|--|\.\.|-$|\.$)/", $domain)) {
$response->header('Content-Type', 'application/json'); $response->header('Content-Type', 'application/json');
@ -131,7 +131,7 @@ function handleDomainQuery($request, $response, $pdo, $domainName) {
$response->end(json_encode(['error' => 'Domain name invalid format'])); $response->end(json_encode(['error' => 'Domain name invalid format']));
return; return;
} }
// Extract TLD from the domain // Extract TLD from the domain
$parts = explode('.', $domain); $parts = explode('.', $domain);
$tld = "." . end($parts); $tld = "." . end($parts);
@ -148,7 +148,7 @@ function handleDomainQuery($request, $response, $pdo, $domainName) {
$response->end(json_encode(['error' => 'Invalid TLD. Please search only allowed TLDs'])); $response->end(json_encode(['error' => 'Invalid TLD. Please search only allowed TLDs']));
return; return;
} }
// Fetch the IDN regex for the given TLD // Fetch the IDN regex for the given TLD
$stmtRegex = $pdo->prepare("SELECT idn_table FROM domain_tld WHERE tld = :tld"); $stmtRegex = $pdo->prepare("SELECT idn_table FROM domain_tld WHERE tld = :tld");
$stmtRegex->bindParam(':tld', $tld, PDO::PARAM_STR); $stmtRegex->bindParam(':tld', $tld, PDO::PARAM_STR);
@ -177,21 +177,21 @@ function handleDomainQuery($request, $response, $pdo, $domainName) {
$stmt1->bindParam(':domain', $domain, PDO::PARAM_STR); $stmt1->bindParam(':domain', $domain, PDO::PARAM_STR);
$stmt1->execute(); $stmt1->execute();
$domainDetails = $stmt1->fetch(PDO::FETCH_ASSOC); $domainDetails = $stmt1->fetch(PDO::FETCH_ASSOC);
// Check if the domain exists // Check if the domain exists
if (!$domainDetails) { if (!$domainDetails) {
// Domain not found, respond with a 404 error // Domain not found, respond with a 404 error
$response->header('Content-Type', 'application/json'); $response->header('Content-Type', 'application/json');
$response->status(404); $response->status(404);
$response->end(json_encode([ $response->end(json_encode([
'errorCode' => 404, 'errorCode' => 404,
'title' => 'Not Found', 'title' => 'Not Found',
'description' => 'The requested domain was not found in the RDAP database.', 'description' => 'The requested domain was not found in the RDAP database.',
])); ]));
// Close the connection // Close the connection
$pdo = null; $pdo = null;
return; return;
} }
// Query 2: Get status details // Query 2: Get status details
$stmt2 = $pdo->prepare("SELECT `status` FROM `domain_status` WHERE `domain_id` = :domain_id"); $stmt2 = $pdo->prepare("SELECT `status` FROM `domain_status` WHERE `domain_id` = :domain_id");
@ -211,12 +211,12 @@ function handleDomainQuery($request, $response, $pdo, $domainName) {
$stmt4->execute(); $stmt4->execute();
$registrantDetails = $stmt4->fetch(PDO::FETCH_ASSOC); $registrantDetails = $stmt4->fetch(PDO::FETCH_ASSOC);
// Query 5: Get admin, billing and tech contacts // Query 5: Get admin, billing and tech contacts
$stmtMap = $pdo->prepare("SELECT contact_id, type FROM domain_contact_map WHERE domain_id = :domain_id"); $stmtMap = $pdo->prepare("SELECT contact_id, type FROM domain_contact_map WHERE domain_id = :domain_id");
$stmtMap->bindParam(':domain_id', $domainDetails['id'], PDO::PARAM_INT); $stmtMap->bindParam(':domain_id', $domainDetails['id'], PDO::PARAM_INT);
$stmtMap->execute(); $stmtMap->execute();
$contactMap = $stmtMap->fetchAll(PDO::FETCH_ASSOC); $contactMap = $stmtMap->fetchAll(PDO::FETCH_ASSOC);
$adminDetails = []; $adminDetails = [];
$techDetails = []; $techDetails = [];
$billingDetails = []; $billingDetails = [];
@ -251,7 +251,7 @@ function handleDomainQuery($request, $response, $pdo, $domainName) {
$stmt6->bindParam(':domain_id', $domainDetails['id'], PDO::PARAM_INT); $stmt6->bindParam(':domain_id', $domainDetails['id'], PDO::PARAM_INT);
$stmt6->execute(); $stmt6->execute();
$nameservers = $stmt6->fetchAll(PDO::FETCH_ASSOC); $nameservers = $stmt6->fetchAll(PDO::FETCH_ASSOC);
// Define the basic events // Define the basic events
$events = [ $events = [
['eventAction' => 'registration', 'eventDate' => $domainDetails['crdate']], ['eventAction' => 'registration', 'eventDate' => $domainDetails['crdate']],
@ -350,11 +350,11 @@ function handleDomainQuery($request, $response, $pdo, $domainName) {
"This response conforms to the RDAP Operational Profile for gTLD Registries and Registrars version 1.0" "This response conforms to the RDAP Operational Profile for gTLD Registries and Registrars version 1.0"
] ]
], ],
[ [
"description" => [ "description" => [
"For more information on domain status codes, please visit https://icann.org/epp" "For more information on domain status codes, please visit https://icann.org/epp"
], ],
"links" => [ "links" => [
[ [
"href" => "https://icann.org/epp", "href" => "https://icann.org/epp",
"rel" => "alternate", "rel" => "alternate",
@ -363,11 +363,11 @@ function handleDomainQuery($request, $response, $pdo, $domainName) {
], ],
"title" => "Status Codes" "title" => "Status Codes"
], ],
[ [
"description" => [ "description" => [
"URL of the ICANN RDDS Inaccuracy Complaint Form: https://icann.org/wicf" "URL of the ICANN RDDS Inaccuracy Complaint Form: https://icann.org/wicf"
], ],
"links" => [ "links" => [
[ [
"href" => "https://icann.org/wicf", "href" => "https://icann.org/wicf",
"rel" => "alternate", "rel" => "alternate",

View file

@ -41,7 +41,7 @@ $server->on('receive', function ($server, $fd, $reactorId, $data) {
$server->send($fd, "Error connecting to database"); $server->send($fd, "Error connecting to database");
$server->close($fd); $server->close($fd);
} }
$privacy = $c['privacy']; $privacy = $c['privacy'];
// Validate and sanitize the data // Validate and sanitize the data
@ -67,7 +67,7 @@ $server->on('receive', function ($server, $fd, $reactorId, $data) {
if ($queryType == 'nameserver') { if ($queryType == 'nameserver') {
// Handle nameserver query // Handle nameserver query
$nameserver = $queryData; $nameserver = $queryData;
if (!$nameserver) { if (!$nameserver) {
$server->send($fd, "please enter a nameserver"); $server->send($fd, "please enter a nameserver");
$server->close($fd); $server->close($fd);
@ -76,12 +76,12 @@ $server->on('receive', function ($server, $fd, $reactorId, $data) {
$server->send($fd, "nameserver is too long"); $server->send($fd, "nameserver is too long");
$server->close($fd); $server->close($fd);
} }
if (!preg_match('/^([a-zA-Z0-9\-]+\.)+[a-zA-Z]{2,}$/', $nameserver)) { if (!preg_match('/^([a-zA-Z0-9\-]+\.)+[a-zA-Z]{2,}$/', $nameserver)) {
$server->send($fd, "Nameserver contains invalid characters or is not in the correct format."); $server->send($fd, "Nameserver contains invalid characters or is not in the correct format.");
$server->close($fd); $server->close($fd);
} }
// Perform the WHOIS lookup // Perform the WHOIS lookup
try { try {
$query = "SELECT `name`,`clid` FROM `host` WHERE `name` = :nameserver"; $query = "SELECT `name`,`clid` FROM `host` WHERE `name` = :nameserver";
@ -91,7 +91,7 @@ $server->on('receive', function ($server, $fd, $reactorId, $data) {
if ($f = $stmt->fetch(PDO::FETCH_ASSOC)) { if ($f = $stmt->fetch(PDO::FETCH_ASSOC)) {
$res = "Server Name: ".$f['name']; $res = "Server Name: ".$f['name'];
// Fetch the registrar details for this registrar using the id // Fetch the registrar details for this registrar using the id
$regQuery = "SELECT `id`,`name`,`iana_id`,`whois_server`,`url`,`abuse_email`,`abuse_phone` FROM `registrar` WHERE `id` = :clid"; $regQuery = "SELECT `id`,`name`,`iana_id`,`whois_server`,`url`,`abuse_email`,`abuse_phone` FROM `registrar` WHERE `id` = :clid";
$regStmt = $pdo->prepare($regQuery); $regStmt = $pdo->prepare($regQuery);
@ -107,7 +107,7 @@ $server->on('receive', function ($server, $fd, $reactorId, $data) {
$res .= "\nRegistrar Abuse Contact Email: ".$registrar['abuse_email']; $res .= "\nRegistrar Abuse Contact Email: ".$registrar['abuse_email'];
$res .= "\nRegistrar Abuse Contact Phone: ".$registrar['abuse_phone']; $res .= "\nRegistrar Abuse Contact Phone: ".$registrar['abuse_phone'];
} }
$res .= "\nURL of the ICANN Whois Inaccuracy Complaint Form: https://www.icann.org/wicf/"; $res .= "\nURL of the ICANN Whois Inaccuracy Complaint Form: https://www.icann.org/wicf/";
$currentTimestamp = date('Y-m-d\TH:i:s\Z'); $currentTimestamp = date('Y-m-d\TH:i:s\Z');
$res .= "\n>>> Last update of WHOIS database: {$currentTimestamp} <<<"; $res .= "\n>>> Last update of WHOIS database: {$currentTimestamp} <<<";
@ -152,17 +152,17 @@ $server->on('receive', function ($server, $fd, $reactorId, $data) {
} }
$server->close($fd); $server->close($fd);
} }
} catch (PDOException $e) { } catch (PDOException $e) {
$server->send($fd, "Error connecting to the whois database"); $server->send($fd, "Error connecting to the whois database");
$server->close($fd); $server->close($fd);
} }
} }
elseif ($queryType == 'registrar') { elseif ($queryType == 'registrar') {
// Handle registrar query // Handle registrar query
$registrar = $queryData; $registrar = $queryData;
if (!$registrar) { if (!$registrar) {
$server->send($fd, "please enter a registrar name"); $server->send($fd, "please enter a registrar name");
$server->close($fd); $server->close($fd);
@ -171,12 +171,12 @@ $server->on('receive', function ($server, $fd, $reactorId, $data) {
$server->send($fd, "registrar name is too long"); $server->send($fd, "registrar name is too long");
$server->close($fd); $server->close($fd);
} }
if (!preg_match('/^[a-zA-Z0-9\s\-]+$/', $registrar)) { if (!preg_match('/^[a-zA-Z0-9\s\-]+$/', $registrar)) {
$server->send($fd, "Registrar name contains invalid characters."); $server->send($fd, "Registrar name contains invalid characters.");
$server->close($fd); $server->close($fd);
} }
// Perform the WHOIS lookup // Perform the WHOIS lookup
try { try {
$query = "SELECT `id`,`name`,`iana_id`,`whois_server`,`url`,`abuse_email`,`abuse_phone` FROM `registrar` WHERE `name` = :registrar"; $query = "SELECT `id`,`name`,`iana_id`,`whois_server`,`url`,`abuse_email`,`abuse_phone` FROM `registrar` WHERE `name` = :registrar";
@ -191,7 +191,7 @@ $server->on('receive', function ($server, $fd, $reactorId, $data) {
."\nRegistrar IANA ID: ".$f['iana_id'] ."\nRegistrar IANA ID: ".$f['iana_id']
."\nRegistrar Abuse Contact Email: ".$f['abuse_email'] ."\nRegistrar Abuse Contact Email: ".$f['abuse_email']
."\nRegistrar Abuse Contact Phone: ".$f['abuse_phone']; ."\nRegistrar Abuse Contact Phone: ".$f['abuse_phone'];
// Fetch the contact details for this registrar using the id // Fetch the contact details for this registrar using the id
$contactQuery = "SELECT * FROM `registrar_contact` WHERE `id` = :registrar_id"; $contactQuery = "SELECT * FROM `registrar_contact` WHERE `id` = :registrar_id";
$contactStmt = $pdo->prepare($contactQuery); $contactStmt = $pdo->prepare($contactQuery);
@ -208,7 +208,7 @@ $server->on('receive', function ($server, $fd, $reactorId, $data) {
$res .= "\nFax: " . $contact['fax']; $res .= "\nFax: " . $contact['fax'];
$res .= "\nPublic Email: " . $contact['email']; $res .= "\nPublic Email: " . $contact['email'];
} }
$res .= "\nURL of the ICANN Whois Inaccuracy Complaint Form: https://www.icann.org/wicf/"; $res .= "\nURL of the ICANN Whois Inaccuracy Complaint Form: https://www.icann.org/wicf/";
$currentTimestamp = date('Y-m-d\TH:i:s\Z'); $currentTimestamp = date('Y-m-d\TH:i:s\Z');
$res .= "\n>>> Last update of WHOIS database: {$currentTimestamp} <<<"; $res .= "\n>>> Last update of WHOIS database: {$currentTimestamp} <<<";
@ -253,11 +253,11 @@ $server->on('receive', function ($server, $fd, $reactorId, $data) {
} }
$server->close($fd); $server->close($fd);
} }
} catch (PDOException $e) { } catch (PDOException $e) {
$server->send($fd, "Error connecting to the whois database"); $server->send($fd, "Error connecting to the whois database");
$server->close($fd); $server->close($fd);
} }
} }
else { else {
@ -367,7 +367,7 @@ $server->on('receive', function ($server, $fd, $reactorId, $data) {
$stmt5->execute(); $stmt5->execute();
$f2 = $stmt5->fetch(PDO::FETCH_ASSOC); $f2 = $stmt5->fetch(PDO::FETCH_ASSOC);
if ($privacy) { if ($privacy) {
$res .= "\nRegistry Registrant ID: REDACTED FOR PRIVACY" $res .= "\nRegistry Registrant ID: REDACTED FOR PRIVACY"
."\nRegistrant Name: REDACTED FOR PRIVACY" ."\nRegistrant Name: REDACTED FOR PRIVACY"
."\nRegistrant Organization: REDACTED FOR PRIVACY" ."\nRegistrant Organization: REDACTED FOR PRIVACY"
@ -381,7 +381,7 @@ $server->on('receive', function ($server, $fd, $reactorId, $data) {
."\nRegistrant Phone: REDACTED FOR PRIVACY" ."\nRegistrant Phone: REDACTED FOR PRIVACY"
."\nRegistrant Fax: REDACTED FOR PRIVACY" ."\nRegistrant Fax: REDACTED FOR PRIVACY"
."\nRegistrant Email: Kindly refer to the RDDS server associated with the identified registrar in this output to obtain contact details for the Registrant, Admin, or Tech associated with the queried domain name."; ."\nRegistrant Email: Kindly refer to the RDDS server associated with the identified registrar in this output to obtain contact details for the Registrant, Admin, or Tech associated with the queried domain name.";
} else { } else {
$res .= "\nRegistry Registrant ID: ".$f2['identifier'] $res .= "\nRegistry Registrant ID: ".$f2['identifier']
."\nRegistrant Name: ".$f2['name'] ."\nRegistrant Name: ".$f2['name']
."\nRegistrant Organization: ".$f2['org'] ."\nRegistrant Organization: ".$f2['org']
@ -395,7 +395,7 @@ $server->on('receive', function ($server, $fd, $reactorId, $data) {
."\nRegistrant Phone: ".$f2['voice'] ."\nRegistrant Phone: ".$f2['voice']
."\nRegistrant Fax: ".$f2['fax'] ."\nRegistrant Fax: ".$f2['fax']
."\nRegistrant Email: ".$f2['email']; ."\nRegistrant Email: ".$f2['email'];
} }
$query6 = "SELECT contact.identifier,contact_postalInfo.name,contact_postalInfo.org,contact_postalInfo.street1,contact_postalInfo.street2,contact_postalInfo.street3,contact_postalInfo.city,contact_postalInfo.sp,contact_postalInfo.pc,contact_postalInfo.cc,contact.voice,contact.fax,contact.email $query6 = "SELECT contact.identifier,contact_postalInfo.name,contact_postalInfo.org,contact_postalInfo.street1,contact_postalInfo.street2,contact_postalInfo.street3,contact_postalInfo.city,contact_postalInfo.sp,contact_postalInfo.pc,contact_postalInfo.cc,contact.voice,contact.fax,contact.email
FROM domain_contact_map,contact,contact_postalInfo WHERE domain_contact_map.domain_id=:domain_id AND domain_contact_map.type='admin' AND domain_contact_map.contact_id=contact.id AND domain_contact_map.contact_id=contact_postalInfo.contact_id"; FROM domain_contact_map,contact,contact_postalInfo WHERE domain_contact_map.domain_id=:domain_id AND domain_contact_map.type='admin' AND domain_contact_map.contact_id=contact.id AND domain_contact_map.contact_id=contact_postalInfo.contact_id";
@ -404,7 +404,7 @@ $server->on('receive', function ($server, $fd, $reactorId, $data) {
$stmt6->execute(); $stmt6->execute();
$f2 = $stmt6->fetch(PDO::FETCH_ASSOC); $f2 = $stmt6->fetch(PDO::FETCH_ASSOC);
if ($privacy) { if ($privacy) {
$res .= "\nRegistry Admin ID: REDACTED FOR PRIVACY" $res .= "\nRegistry Admin ID: REDACTED FOR PRIVACY"
."\nAdmin Name: REDACTED FOR PRIVACY" ."\nAdmin Name: REDACTED FOR PRIVACY"
."\nAdmin Organization: REDACTED FOR PRIVACY" ."\nAdmin Organization: REDACTED FOR PRIVACY"
@ -418,7 +418,7 @@ $server->on('receive', function ($server, $fd, $reactorId, $data) {
."\nAdmin Phone: REDACTED FOR PRIVACY" ."\nAdmin Phone: REDACTED FOR PRIVACY"
."\nAdmin Fax: REDACTED FOR PRIVACY" ."\nAdmin Fax: REDACTED FOR PRIVACY"
."\nAdmin Email: Kindly refer to the RDDS server associated with the identified registrar in this output to obtain contact details for the Registrant, Admin, or Tech associated with the queried domain name."; ."\nAdmin Email: Kindly refer to the RDDS server associated with the identified registrar in this output to obtain contact details for the Registrant, Admin, or Tech associated with the queried domain name.";
} else { } else {
$res .= "\nRegistry Admin ID: ".$f2['identifier'] $res .= "\nRegistry Admin ID: ".$f2['identifier']
."\nAdmin Name: ".$f2['name'] ."\nAdmin Name: ".$f2['name']
."\nAdmin Organization: ".$f2['org'] ."\nAdmin Organization: ".$f2['org']
@ -432,7 +432,7 @@ $server->on('receive', function ($server, $fd, $reactorId, $data) {
."\nAdmin Phone: ".$f2['voice'] ."\nAdmin Phone: ".$f2['voice']
."\nAdmin Fax: ".$f2['fax'] ."\nAdmin Fax: ".$f2['fax']
."\nAdmin Email: ".$f2['email']; ."\nAdmin Email: ".$f2['email'];
} }
$query7 = "SELECT contact.identifier,contact_postalInfo.name,contact_postalInfo.org,contact_postalInfo.street1,contact_postalInfo.street2,contact_postalInfo.street3,contact_postalInfo.city,contact_postalInfo.sp,contact_postalInfo.pc,contact_postalInfo.cc,contact.voice,contact.fax,contact.email $query7 = "SELECT contact.identifier,contact_postalInfo.name,contact_postalInfo.org,contact_postalInfo.street1,contact_postalInfo.street2,contact_postalInfo.street3,contact_postalInfo.city,contact_postalInfo.sp,contact_postalInfo.pc,contact_postalInfo.cc,contact.voice,contact.fax,contact.email
FROM domain_contact_map,contact,contact_postalInfo WHERE domain_contact_map.domain_id=:domain_id AND domain_contact_map.type='billing' AND domain_contact_map.contact_id=contact.id AND domain_contact_map.contact_id=contact_postalInfo.contact_id"; FROM domain_contact_map,contact,contact_postalInfo WHERE domain_contact_map.domain_id=:domain_id AND domain_contact_map.type='billing' AND domain_contact_map.contact_id=contact.id AND domain_contact_map.contact_id=contact_postalInfo.contact_id";
@ -441,7 +441,7 @@ $server->on('receive', function ($server, $fd, $reactorId, $data) {
$stmt7->execute(); $stmt7->execute();
$f2 = $stmt7->fetch(PDO::FETCH_ASSOC); $f2 = $stmt7->fetch(PDO::FETCH_ASSOC);
if ($privacy) { if ($privacy) {
$res .= "\nRegistry Billing ID: REDACTED FOR PRIVACY" $res .= "\nRegistry Billing ID: REDACTED FOR PRIVACY"
."\nBilling Name: REDACTED FOR PRIVACY" ."\nBilling Name: REDACTED FOR PRIVACY"
."\nBilling Organization: REDACTED FOR PRIVACY" ."\nBilling Organization: REDACTED FOR PRIVACY"
@ -455,7 +455,7 @@ $server->on('receive', function ($server, $fd, $reactorId, $data) {
."\nBilling Phone: REDACTED FOR PRIVACY" ."\nBilling Phone: REDACTED FOR PRIVACY"
."\nBilling Fax: REDACTED FOR PRIVACY" ."\nBilling Fax: REDACTED FOR PRIVACY"
."\nBilling Email: Kindly refer to the RDDS server associated with the identified registrar in this output to obtain contact details for the Registrant, Admin, or Tech associated with the queried domain name."; ."\nBilling Email: Kindly refer to the RDDS server associated with the identified registrar in this output to obtain contact details for the Registrant, Admin, or Tech associated with the queried domain name.";
} else { } else {
$res .= "\nRegistry Billing ID: ".$f2['identifier'] $res .= "\nRegistry Billing ID: ".$f2['identifier']
."\nBilling Name: ".$f2['name'] ."\nBilling Name: ".$f2['name']
."\nBilling Organization: ".$f2['org'] ."\nBilling Organization: ".$f2['org']
@ -469,7 +469,7 @@ $server->on('receive', function ($server, $fd, $reactorId, $data) {
."\nBilling Phone: ".$f2['voice'] ."\nBilling Phone: ".$f2['voice']
."\nBilling Fax: ".$f2['fax'] ."\nBilling Fax: ".$f2['fax']
."\nBilling Email: ".$f2['email']; ."\nBilling Email: ".$f2['email'];
} }
$query8 = "SELECT contact.identifier,contact_postalInfo.name,contact_postalInfo.org,contact_postalInfo.street1,contact_postalInfo.street2,contact_postalInfo.street3,contact_postalInfo.city,contact_postalInfo.sp,contact_postalInfo.pc,contact_postalInfo.cc,contact.voice,contact.fax,contact.email $query8 = "SELECT contact.identifier,contact_postalInfo.name,contact_postalInfo.org,contact_postalInfo.street1,contact_postalInfo.street2,contact_postalInfo.street3,contact_postalInfo.city,contact_postalInfo.sp,contact_postalInfo.pc,contact_postalInfo.cc,contact.voice,contact.fax,contact.email
FROM domain_contact_map,contact,contact_postalInfo WHERE domain_contact_map.domain_id=:domain_id AND domain_contact_map.type='tech' AND domain_contact_map.contact_id=contact.id AND domain_contact_map.contact_id=contact_postalInfo.contact_id"; FROM domain_contact_map,contact,contact_postalInfo WHERE domain_contact_map.domain_id=:domain_id AND domain_contact_map.type='tech' AND domain_contact_map.contact_id=contact.id AND domain_contact_map.contact_id=contact_postalInfo.contact_id";
@ -478,7 +478,7 @@ $server->on('receive', function ($server, $fd, $reactorId, $data) {
$stmt8->execute(); $stmt8->execute();
$f2 = $stmt8->fetch(PDO::FETCH_ASSOC); $f2 = $stmt8->fetch(PDO::FETCH_ASSOC);
if ($privacy) { if ($privacy) {
$res .= "\nRegistry Tech ID: REDACTED FOR PRIVACY" $res .= "\nRegistry Tech ID: REDACTED FOR PRIVACY"
."\nTech Name: REDACTED FOR PRIVACY" ."\nTech Name: REDACTED FOR PRIVACY"
."\nTech Organization: REDACTED FOR PRIVACY" ."\nTech Organization: REDACTED FOR PRIVACY"
@ -492,7 +492,7 @@ $server->on('receive', function ($server, $fd, $reactorId, $data) {
."\nTech Phone: REDACTED FOR PRIVACY" ."\nTech Phone: REDACTED FOR PRIVACY"
."\nTech Fax: REDACTED FOR PRIVACY" ."\nTech Fax: REDACTED FOR PRIVACY"
."\nTech Email: Kindly refer to the RDDS server associated with the identified registrar in this output to obtain contact details for the Registrant, Admin, or Tech associated with the queried domain name."; ."\nTech Email: Kindly refer to the RDDS server associated with the identified registrar in this output to obtain contact details for the Registrant, Admin, or Tech associated with the queried domain name.";
} else { } else {
$res .= "\nRegistry Tech ID: ".$f2['identifier'] $res .= "\nRegistry Tech ID: ".$f2['identifier']
."\nTech Name: ".$f2['name'] ."\nTech Name: ".$f2['name']
."\nTech Organization: ".$f2['org'] ."\nTech Organization: ".$f2['org']
@ -506,7 +506,7 @@ $server->on('receive', function ($server, $fd, $reactorId, $data) {
."\nTech Phone: ".$f2['voice'] ."\nTech Phone: ".$f2['voice']
."\nTech Fax: ".$f2['fax'] ."\nTech Fax: ".$f2['fax']
."\nTech Email: ".$f2['email']; ."\nTech Email: ".$f2['email'];
} }
$query9 = "SELECT `name` FROM `domain_host_map`,`host` WHERE `domain_host_map`.`domain_id` = :domain_id AND `domain_host_map`.`host_id` = `host`.`id`"; $query9 = "SELECT `name` FROM `domain_host_map`,`host` WHERE `domain_host_map`.`domain_id` = :domain_id AND `domain_host_map`.`host_id` = `host`.`id`";
$stmt9 = $pdo->prepare($query9); $stmt9 = $pdo->prepare($query9);