Upload files to "/"

This commit is contained in:
beenull 2024-01-08 13:29:26 +00:00
parent 246fd8496f
commit 0de133acd9
5 changed files with 2253 additions and 0 deletions

21
LICENSE Normal file
View file

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2022 nibblegap
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

1
dark.css Normal file

File diff suppressed because one or more lines are too long

223
index.php Normal file
View file

@ -0,0 +1,223 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Domain Name, IP Whois Search System - NibbleGap</title>
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="stylesheet" type="text/css" href="dark.css">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="Welcome to Domain Name, IP WHOIS Search. You can check domain whois and ipv4 ipv6 whois." />
<link rel="icon" type="image/png" href="https://nibblecdn.com/logo/nibblegap.svg">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<h1><a href="https://whois.nibblegap.com"><img style="vertical-align:middle" src="https://nibblecdn.com/logo/nibblegap.svg" alt="nibblegap logo" width="30" height="30"></a> <a style="vertical-align:middle" href="https://whois.nibblegap.com"> Domain Name, IP WHOIS Search System</a></h1>
<form method="post" action="">
<input type="text" name="query" placeholder="Please enter and press Enquiry." required value="<?php echo isset($_POST['query']) ? htmlspecialchars(removeSpaces($_POST['query']), ENT_QUOTES, 'UTF-8') : ''; ?>">
<select name="type">
<?php
$options = [
'whois' => 'Domain WHOIS Search',
'ipwhois' => 'IP WHOIS Search',
];
foreach ($options as $value => $label) {
$selected = (isset($_POST['type']) && $_POST['type'] === $value) ? 'selected' : '';
echo '<option value="' . $value . '" ' . $selected . '>' . $label . '</option>';
}
?>
</select>
<input type="submit" name="submit" value="Enquiry">
</form>
<?php
function removeSpaces($input)
{
return preg_replace('/\s+/', '', $input);
}
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['submit'])) {
$query = removeSpaces($_POST['query']);
$type = $_POST['type'];
$query = idn_to_ascii($query);
switch ($type) {
case 'whois':
performWhoisQuery($query);
break;
case 'ipwhois':
performIPWhoisQuery($query);
break;
}
}
function performWhoisQuery($domain)
{
require_once __DIR__ . '/whois_servers.php';
$extension = getDomainExtension($domain);
if (isset($whoisServers[$extension])) {
$server = $whoisServers[$extension];
$result = queryWhoisServer($server, $domain);
$isRegistered = isDomainRegistered($result);
$hasRegistrarInfo = false;
echo '<div class="result">';
if (!empty($result)) {
echo '<h2>' . $domain . ' WHOIS Information</h2>';
echo '<div class="info-container">';
echo '<p>Searched from: ' . $server . '</p>';
echo '<p>Domain Registration: ' . ($isRegistered ? 'Registered' : 'Unregistered') . '</p>';
echo '<p>Reserved domain name: ' . (isDomainReserved($result) ? 'Reserved' : 'Not Reserved') . '&nbsp;(Only Reference)' . '</p>';
foreach ($result as $line) {
if (strpos($line, 'Expiration Date') !== false || strpos($line, 'Registrar Registration Expiration Date') !== false || strpos($line, 'Registry Expiry Date') !== false || strpos($line, 'Expiry Date:') !== false || strpos($line, 'Expiration Time:') !== false) {
echo '<p>Expiration Date: ' . trim(str_replace(['Expiration Date:', 'Registrar Registration Expiration Date:', 'Registry Expiry Date:', 'Expiry Date:', 'Expiration Time:'], '', $line)) . '</p>';
}
elseif (strpos($line, 'Creation Date') !== false || strpos($line, 'Domain Registration Date') !== false || strpos($line, 'created:') !== false || strpos($line, 'Registration Time:') !== false) {
echo '<p>Registration Date: ' . trim(str_replace(['Creation Date:', 'Domain Registration Date:', 'created:', 'Registration Time:'], '', $line)) . '</p>';
}
elseif (strpos($line, 'Updated Date') !== false || strpos($line, 'Last Updated') !== false || strpos($line, 'last-update:') !== false) {
echo '<p>Last Updated Date: ' . trim(str_replace(['Updated Date:', 'Last Updated:', 'last-update:'], '', $line)) . '</p>';
}
elseif (strpos($line, 'Name Server') !== false || strpos($line, 'Name Servers') !== false || strpos($line, 'NS') !== false || strpos($line, 'nserver:') !== false) {
echo '<p>DNS: ' . trim(str_replace(['Name Server:', 'Name Servers:', 'NS:', 'nserver:'], '', $line)) . '</p>';
}
elseif (strpos($line, 'Registrant:') !== false || strpos($line, 'Registrant Name:') !== false || strpos($line, 'Registrant Organization:') !== false) {
echo '<p>Registrant: ' . trim(str_replace(['Registrant:', 'Registrant Name:', 'Registrant Organization:'], '', $line)) . '</p>';
}
elseif (strpos($line, 'Registrant Email') !== false) {
echo '<p>Registrant Email: ' . trim(str_replace('Registrant Email:', '', $line)) . '</p>';
}
elseif (!$hasRegistrarInfo && (strpos($line, 'Registrar:') !== false || strpos($line, 'Registrar WHOIS Server') !== false || strpos($line, 'registrar:') !== false)) {
echo '<p>Registrar: ' . trim(str_replace(['Registrar:', 'Registrar WHOIS Server:', 'registrar:'], '', $line)) . '</p>';
$hasRegistrarInfo = true;
}
elseif (strpos($line, 'Status:') !== false) {
echo '<p>Status: ' . trim(str_replace('Status:', '', $line)) . '</p>';
}
}
echo '</div>';
echo '<button class="btn btn-link" onclick="toggleDetails()">Show Details</button>';
echo '<div class="details-content" id="details-content">';
echo '<div class="info-container">';
echo '<ul>';
foreach ($result as $line) {
echo '<li>' . $line . '</li>';
}
echo '</ul>';
echo '</div>';
echo '</div>';
} else {
echo '<h3>WHOIS information for the domain name could not be found. The domain name may not be registered or the domain Whois server is not accessible.</h3>';
}
echo '</div>';
} else {
echo '<div class="result">';
echo '<h3>WHOIS search for this domain name is not supported.</h3>';
echo '</div>';
}
}
function performIPWhoisQuery($ip)
{
$server = 'whois.apnic.net';
$result = queryWhoisServer($server, $ip);
echo '<div class="result">';
if (!empty($result)) {
echo '<h2>' . $ip . ' WHOIS information</h2>';
echo '<p>Searched from: ' . $server . '</p>';
echo '<ul>';
foreach ($result as $line) {
echo '<li>' . $line . '</li>';
}
echo '</ul>';
} else {
echo '<h2>IP WHOIS information not available.</h2>';
}
echo '</div>';
}
function getDomainExtension($domain)
{
$parts = explode('.', $domain);
$extension = end($parts);
return strtolower($extension);
}
function queryWhoisServer($server, $query)
{
$result = array();
$fp = @fsockopen($server, 43, $errno, $errstr, 10);
if ($fp) {
fputs($fp, $query . "\r\n");
while (!feof($fp)) {
$result[] = fgets($fp);
}
fclose($fp);
}
return $result;
}
function isDomainReserved($whoisResult)
{
$reservedKeywords = array('reserved', 'reserved domain name', 'keep', 'clientHold', 'serverHold');
foreach ($whoisResult as $line) {
foreach ($reservedKeywords as $keyword) {
if (stripos($line, $keyword) !== false) {
return true;
}
}
}
return false;
}
function isDomainRegistered($whoisResult)
{
$registeredPatterns = array(
'/^\s*Registrar:\s+/i',
'/^\s*Creation Date:\s+/i',
'/^\s*Domain Name:\s+/i',
'/^\s*Registry Domain ID:\s+/i',
'/^\s*connect\s+/i',
'/^\s*Status:\s+connect/i',
'/^\s*Status:\s+active/i'
);
foreach ($whoisResult as $line) {
foreach ($registeredPatterns as $pattern) {
if (preg_match($pattern, $line)) {
return true;
}
}
}
return false;
}
?>
</body>
<footer><br><br>
<p><a href="https://nibblegap.com" target="_blank">NibbleGap</a></p>
</footer>
<script>
function toggleDetails() {
var detailsContent = document.getElementById('details-content');
var detailsToggle = document.querySelector('.details-toggle');
if (detailsContent.style.display === 'none') {
detailsContent.style.display = 'block';
detailsToggle.classList.add('open');
} else {
detailsContent.style.display = 'none';
detailsToggle.classList.remove('open');
}
}
</script>
</html>

145
style.css Normal file
View file

@ -0,0 +1,145 @@
body {
font-family: Arial, sans-serif;
margin: 20px;
}
h1 {
text-align: center;
}
form {
text-align: center;
margin-bottom: 20px;
}
input[type="text"],
select {
padding: 10px;
font-size: 16px;
border: 1px solid #d9534f;
}
.result h2 {
text-transform: uppercase;
text-align: center;
margin-bottom: 10px;
}
.result p {
text-align: center;
}
.details-toggle {
cursor: pointer;
text-decoration: none;
margin-bottom: 10px;
}
.details-content {
display: none;
}
.details-toggle::after {
font-family: 'Font Awesome 5 Free';
content: "\f107";
display: inline-block;
margin-left: 5px;
}
.details-toggle.open::after {
content: "\f106";
}
ul {
list-style-type: none;
padding: 0;
}
ul li {
margin-bottom: 5px;
}
footer {
text-align: center;
}
a {
color: #20a53a;
text-decoration: none;
}
@media screen and (min-width: 768px) {
input[type="text"],
select {
width: 16%;
box-sizing: border-box;
}
input[type="submit"] {
padding: 10px;
font-size: 16px;
background-color: #007bff;
color: white;
border: 1px solid #d9534f;
cursor: pointer;
width: 6%;
margin-top: 15px;
}
.result {
margin-top: 15px;
padding: 10px;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
max-width: 600px;
margin-left: auto;
margin-right: auto;
}
.result .info-container {
box-sizing: border-box;
padding: 10px;
margin: 15px 0 5px 0;
border: 1px solid #d9534f;
}
}
@media screen and (max-width: 767px) {
input[type="text"],
select {
border-radius: 30px;
width: 100%;
box-sizing: border-box;
}
input[type="submit"] {
border-radius: 30px;
padding: 10px 20px;
font-size: 16px;
background-color: #007bff;
color: white;
border: none;
cursor: pointer;
width: 100%;
margin-top: 10px;
}
.result {
margin-top: 15px;
padding: 10px;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
max-width: 600px;
margin-left: auto;
margin-right: auto;
}
}

1863
whois_servers.php Normal file

File diff suppressed because it is too large Load diff