Fixes on whois and rdap

This commit is contained in:
Pinga 2024-07-28 12:34:19 +03:00
parent 70513a23d1
commit 26cf1d9983
2 changed files with 290 additions and 253 deletions

View file

@ -422,7 +422,7 @@ function handleDomainQuery($request, $response, $pdo, $domainName, $c, $log) {
$registrarAbuseDetails = $stmt3a->fetch(PDO::FETCH_ASSOC); $registrarAbuseDetails = $stmt3a->fetch(PDO::FETCH_ASSOC);
// Query 4: Get registrant details // Query 4: Get registrant details
$stmt4 = $pdo->prepare("SELECT contact.id,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.voice_x,contact.fax,contact.fax_x,contact.email FROM contact,contact_postalInfo WHERE contact.id=:registrant AND contact_postalInfo.contact_id=contact.id"); $stmt4 = $pdo->prepare("SELECT contact.id,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.voice_x,contact.fax,contact.fax_x,contact.email,contact.disclose_voice,contact.disclose_fax,contact.disclose_email,contact_postalInfo.type,contact_postalInfo.disclose_name_int,contact_postalInfo.disclose_name_loc,contact_postalInfo.disclose_org_int,contact_postalInfo.disclose_org_loc,contact_postalInfo.disclose_addr_int,contact_postalInfo.disclose_addr_loc FROM contact,contact_postalInfo WHERE contact.id=:registrant AND contact_postalInfo.contact_id=contact.id");
$stmt4->bindParam(':registrant', $domainDetails['registrant'], PDO::PARAM_INT); $stmt4->bindParam(':registrant', $domainDetails['registrant'], PDO::PARAM_INT);
$stmt4->execute(); $stmt4->execute();
$registrantDetails = $stmt4->fetch(PDO::FETCH_ASSOC); $registrantDetails = $stmt4->fetch(PDO::FETCH_ASSOC);
@ -438,7 +438,7 @@ function handleDomainQuery($request, $response, $pdo, $domainName, $c, $log) {
$billingDetails = []; $billingDetails = [];
foreach ($contactMap as $map) { foreach ($contactMap as $map) {
$stmtDetails = $pdo->prepare("SELECT contact.id, 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.voice_x, contact.fax, contact.fax_x, contact.email FROM contact, contact_postalInfo WHERE contact.id = :contact_id AND contact_postalInfo.contact_id = contact.id"); $stmtDetails = $pdo->prepare("SELECT contact.id, 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.voice_x, contact.fax, contact.fax_x, contact.email, contact.disclose_voice,contact.disclose_fax,contact.disclose_email,contact_postalInfo.type,contact_postalInfo.disclose_name_int,contact_postalInfo.disclose_name_loc,contact_postalInfo.disclose_org_int,contact_postalInfo.disclose_org_loc,contact_postalInfo.disclose_addr_int,contact_postalInfo.disclose_addr_loc FROM contact, contact_postalInfo WHERE contact.id = :contact_id AND contact_postalInfo.contact_id = contact.id");
$stmtDetails->bindParam(':contact_id', $map['contact_id'], PDO::PARAM_INT); $stmtDetails->bindParam(':contact_id', $map['contact_id'], PDO::PARAM_INT);
$stmtDetails->execute(); $stmtDetails->execute();

View file

@ -339,9 +339,21 @@ $server->on('receive', function ($server, $fd, $reactorId, $data) use ($c, $pool
} }
// Determine which type of disclosure to use // Determine which type of disclosure to use
$disclose_name = ($f2['type'] == 'loc') ? $f2['disclose_name_loc'] : $f2['disclose_name_int']; $disclose_name = isset($f2['type']) && $f2['type'] == 'loc' ?
$disclose_org = ($f2['type'] == 'loc') ? $f2['disclose_org_loc'] : $f2['disclose_org_int']; (isset($f2['disclose_name_loc']) ? $f2['disclose_name_loc'] : 0) :
$disclose_addr = ($f2['type'] == 'loc') ? $f2['disclose_addr_loc'] : $f2['disclose_addr_int']; (isset($f2['disclose_name_int']) ? $f2['disclose_name_int'] : 0);
$disclose_org = isset($f2['type']) && $f2['type'] == 'loc' ?
(isset($f2['disclose_org_loc']) ? $f2['disclose_org_loc'] : 0) :
(isset($f2['disclose_org_int']) ? $f2['disclose_org_int'] : 0);
$disclose_addr = isset($f2['type']) && $f2['type'] == 'loc' ?
(isset($f2['disclose_addr_loc']) ? $f2['disclose_addr_loc'] : 0) :
(isset($f2['disclose_addr_int']) ? $f2['disclose_addr_int'] : 0);
$disclose_voice = isset($f2['disclose_voice']) ? $f2['disclose_voice'] : 0;
$disclose_fax = isset($f2['disclose_fax']) ? $f2['disclose_fax'] : 0;
$disclose_email = isset($f2['disclose_email']) ? $f2['disclose_email'] : 0;
// Admin Name // Admin Name
$res .= ($disclose_name ? "\nAdmin Name: ".$f2['name'] : "\nAdmin Name: REDACTED FOR PRIVACY"); $res .= ($disclose_name ? "\nAdmin Name: ".$f2['name'] : "\nAdmin Name: REDACTED FOR PRIVACY");
@ -369,13 +381,13 @@ $server->on('receive', function ($server, $fd, $reactorId, $data) use ($c, $pool
} }
// Admin Phone // Admin Phone
$res .= ($f2['disclose_voice'] ? "\nAdmin Phone: ".$f2['voice'] : "\nAdmin Phone: REDACTED FOR PRIVACY"); $res .= ($disclose_voice ? "\nAdmin Phone: ".$f2['voice'] : "\nAdmin Phone: REDACTED FOR PRIVACY");
// Admin Fax // Admin Fax
$res .= ($f2['disclose_fax'] ? "\nAdmin Fax: ".$f2['fax'] : "\nAdmin Fax: REDACTED FOR PRIVACY"); $res .= ($disclose_fax ? "\nAdmin Fax: ".$f2['fax'] : "\nAdmin Fax: REDACTED FOR PRIVACY");
// Admin Email // Admin Email
$res .= ($f2['disclose_email'] ? "\nAdmin Email: ".$f2['email'] : "\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."); $res .= ($disclose_email ? "\nAdmin Email: ".$f2['email'] : "\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.");
} }
$query7 = "SELECT contact.id,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,contact.disclose_voice,contact.disclose_fax,contact.disclose_email,contact_postalInfo.type,contact_postalInfo.disclose_name_int,contact_postalInfo.disclose_name_loc,contact_postalInfo.disclose_org_int,contact_postalInfo.disclose_org_loc,contact_postalInfo.disclose_addr_int,contact_postalInfo.disclose_addr_loc $query7 = "SELECT contact.id,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,contact.disclose_voice,contact.disclose_fax,contact.disclose_email,contact_postalInfo.type,contact_postalInfo.disclose_name_int,contact_postalInfo.disclose_name_loc,contact_postalInfo.disclose_org_int,contact_postalInfo.disclose_org_loc,contact_postalInfo.disclose_addr_int,contact_postalInfo.disclose_addr_loc
@ -407,9 +419,21 @@ $server->on('receive', function ($server, $fd, $reactorId, $data) use ($c, $pool
} }
// Determine which type of disclosure to use // Determine which type of disclosure to use
$disclose_name = ($f2['type'] == 'loc') ? $f2['disclose_name_loc'] : $f2['disclose_name_int']; $disclose_name = isset($f2['type']) && $f2['type'] == 'loc' ?
$disclose_org = ($f2['type'] == 'loc') ? $f2['disclose_org_loc'] : $f2['disclose_org_int']; (isset($f2['disclose_name_loc']) ? $f2['disclose_name_loc'] : 0) :
$disclose_addr = ($f2['type'] == 'loc') ? $f2['disclose_addr_loc'] : $f2['disclose_addr_int']; (isset($f2['disclose_name_int']) ? $f2['disclose_name_int'] : 0);
$disclose_org = isset($f2['type']) && $f2['type'] == 'loc' ?
(isset($f2['disclose_org_loc']) ? $f2['disclose_org_loc'] : 0) :
(isset($f2['disclose_org_int']) ? $f2['disclose_org_int'] : 0);
$disclose_addr = isset($f2['type']) && $f2['type'] == 'loc' ?
(isset($f2['disclose_addr_loc']) ? $f2['disclose_addr_loc'] : 0) :
(isset($f2['disclose_addr_int']) ? $f2['disclose_addr_int'] : 0);
$disclose_voice = isset($f2['disclose_voice']) ? $f2['disclose_voice'] : 0;
$disclose_fax = isset($f2['disclose_fax']) ? $f2['disclose_fax'] : 0;
$disclose_email = isset($f2['disclose_email']) ? $f2['disclose_email'] : 0;
// Billing Name // Billing Name
$res .= ($disclose_name ? "\nBilling Name: ".$f2['name'] : "\nBilling Name: REDACTED FOR PRIVACY"); $res .= ($disclose_name ? "\nBilling Name: ".$f2['name'] : "\nBilling Name: REDACTED FOR PRIVACY");
@ -437,13 +461,13 @@ $server->on('receive', function ($server, $fd, $reactorId, $data) use ($c, $pool
} }
// Billing Phone // Billing Phone
$res .= ($f2['disclose_voice'] ? "\nBilling Phone: ".$f2['voice'] : "\nBilling Phone: REDACTED FOR PRIVACY"); $res .= ($disclose_voice ? "\nBilling Phone: ".$f2['voice'] : "\nBilling Phone: REDACTED FOR PRIVACY");
// Billing Fax // Billing Fax
$res .= ($f2['disclose_fax'] ? "\nBilling Fax: ".$f2['fax'] : "\nBilling Fax: REDACTED FOR PRIVACY"); $res .= ($disclose_fax ? "\nBilling Fax: ".$f2['fax'] : "\nBilling Fax: REDACTED FOR PRIVACY");
// Billing Email // Billing Email
$res .= ($f2['disclose_email'] ? "\nBilling Email: ".$f2['email'] : "\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."); $res .= ($disclose_email ? "\nBilling Email: ".$f2['email'] : "\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.");
} }
$query8 = "SELECT contact.id,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,contact.disclose_voice,contact.disclose_fax,contact.disclose_email,contact_postalInfo.type,contact_postalInfo.disclose_name_int,contact_postalInfo.disclose_name_loc,contact_postalInfo.disclose_org_int,contact_postalInfo.disclose_org_loc,contact_postalInfo.disclose_addr_int,contact_postalInfo.disclose_addr_loc $query8 = "SELECT contact.id,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,contact.disclose_voice,contact.disclose_fax,contact.disclose_email,contact_postalInfo.type,contact_postalInfo.disclose_name_int,contact_postalInfo.disclose_name_loc,contact_postalInfo.disclose_org_int,contact_postalInfo.disclose_org_loc,contact_postalInfo.disclose_addr_int,contact_postalInfo.disclose_addr_loc
@ -475,9 +499,21 @@ $server->on('receive', function ($server, $fd, $reactorId, $data) use ($c, $pool
} }
// Determine which type of disclosure to use // Determine which type of disclosure to use
$disclose_name = ($f2['type'] == 'loc') ? $f2['disclose_name_loc'] : $f2['disclose_name_int']; $disclose_name = isset($f2['type']) && $f2['type'] == 'loc' ?
$disclose_org = ($f2['type'] == 'loc') ? $f2['disclose_org_loc'] : $f2['disclose_org_int']; (isset($f2['disclose_name_loc']) ? $f2['disclose_name_loc'] : 0) :
$disclose_addr = ($f2['type'] == 'loc') ? $f2['disclose_addr_loc'] : $f2['disclose_addr_int']; (isset($f2['disclose_name_int']) ? $f2['disclose_name_int'] : 0);
$disclose_org = isset($f2['type']) && $f2['type'] == 'loc' ?
(isset($f2['disclose_org_loc']) ? $f2['disclose_org_loc'] : 0) :
(isset($f2['disclose_org_int']) ? $f2['disclose_org_int'] : 0);
$disclose_addr = isset($f2['type']) && $f2['type'] == 'loc' ?
(isset($f2['disclose_addr_loc']) ? $f2['disclose_addr_loc'] : 0) :
(isset($f2['disclose_addr_int']) ? $f2['disclose_addr_int'] : 0);
$disclose_voice = isset($f2['disclose_voice']) ? $f2['disclose_voice'] : 0;
$disclose_fax = isset($f2['disclose_fax']) ? $f2['disclose_fax'] : 0;
$disclose_email = isset($f2['disclose_email']) ? $f2['disclose_email'] : 0;
// Tech Name // Tech Name
$res .= ($disclose_name ? "\nTech Name: ".$f2['name'] : "\nTech Name: REDACTED FOR PRIVACY"); $res .= ($disclose_name ? "\nTech Name: ".$f2['name'] : "\nTech Name: REDACTED FOR PRIVACY");
@ -505,13 +541,14 @@ $server->on('receive', function ($server, $fd, $reactorId, $data) use ($c, $pool
} }
// Tech Phone // Tech Phone
$res .= ($f2['disclose_voice'] ? "\nTech Phone: ".$f2['voice'] : "\nTech Phone: REDACTED FOR PRIVACY"); $res .= ($disclose_voice ? "\nTech Phone: ".$f2['voice'] : "\nTech Phone: REDACTED FOR PRIVACY");
// Tech Fax // Tech Fax
$res .= ($f2['disclose_fax'] ? "\nTech Fax: ".$f2['fax'] : "\nTech Fax: REDACTED FOR PRIVACY"); $res .= ($disclose_fax ? "\nTech Fax: ".$f2['fax'] : "\nTech Fax: REDACTED FOR PRIVACY");
// Tech Email // Tech Email
$res .= ($f2['disclose_email'] ? "\nTech Email: ".$f2['email'] : "\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."); $res .= ($disclose_email ? "\nTech Email: ".$f2['email'] : "\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.");
}
} }
$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";