From f7306b70c8576f7b733381af44de43df746fb874 Mon Sep 17 00:00:00 2001 From: Suvodip Date: Mon, 21 Oct 2024 16:23:40 +0530 Subject: [PATCH] s1 --- .htac_404.php | 2 +- _home.php | 2 +- color-code-from-image.php | 113 ++++++++++++++++++++++++++++++ geoip_domain.php | 6 ++ location-ip-to-location.php | 135 +++++++++++++++++++++++++++++++----- what-is-my-ip.php | 28 ++++---- who-is.php | 106 ++++++++++++++++------------ 7 files changed, 312 insertions(+), 80 deletions(-) create mode 100644 color-code-from-image.php create mode 100644 geoip_domain.php diff --git a/.htac_404.php b/.htac_404.php index 7d98ed9..d5311dc 100644 --- a/.htac_404.php +++ b/.htac_404.php @@ -3,7 +3,7 @@ require_once('.hta_config/db_config.php'); require_once('.htac_header.php'); ?> -
+

SiliconPin - Tools

All diff --git a/_home.php b/_home.php index 2cbd087..1d1e860 100644 --- a/_home.php +++ b/_home.php @@ -3,7 +3,7 @@ require_once('.hta_config/db_config.php'); require_once('.htac_header.php'); ?> -
+

SiliconPin - Tools

All diff --git a/color-code-from-image.php b/color-code-from-image.php new file mode 100644 index 0000000..249a06b --- /dev/null +++ b/color-code-from-image.php @@ -0,0 +1,113 @@ +
+

Color Hex/RGB Code From Image

+

The Color Code Extractor from Image is a simple and efficient web-based tool that allows users to upload an image and click on any part of it to get the RGB and HEX color codes of the pixel they clicked on. This tool is particularly useful for designers, developers, and anyone who needs to identify and use specific colors from images.

+
+
+

+
+
+
Click on the image to get the color code.
+ +
+
+
+

Usage:

+
    +
  • Upload an Image: Click on the file input field and select an image file from your device.
  • +
  • Display the Image: Once the image is uploaded, it will be displayed on a hidden canvas element.
  • +
  • Extract Color Code: Click on any part of the displayed image. The tool will capture the color of the clicked pixel and display both the RGB and HEX color codes.
  • +
  • Copy Color Code: Click the "Copy Color Code" button to copy the displayed color code to your clipboard for easy use in your projects.
  • +
+ +

Features:

+
    +
  • Easy Image Upload: Supports uploading images directly from your device.
  • +
  • Accurate Color Extraction: Retrieves the exact RGB and HEX color codes from any pixel of the image.
  • +
  • Clipboard Copy Functionality: Allows you to easily copy the extracted color codes to your clipboard.
  • +
  • Fallback for Compatibility: Provides a fallback method for copying color codes on browsers that do not support the Clipboard API.
  • +
  • User-Friendly Interface: Simple and intuitive design for ease of use.
  • +
+ +

Use Case:

+
    +
  • Web Designers and Developers: Quickly extract color codes from images for use in web design and development projects.
  • +
  • Graphic Designers: Identify and use specific colors from images in design software.
  • +
  • Digital Artists: Match colors from reference images to create cohesive artworks.
  • +
  • Marketing Professionals: Ensure brand consistency by extracting and using exact colors from marketing materials and logos.
  • +
  • DIY Enthusiasts: Use color codes to match paint colors, fabrics, or other materials in home decoration projects.
  • +
+
+
+ \ No newline at end of file diff --git a/geoip_domain.php b/geoip_domain.php new file mode 100644 index 0000000..bc6888b --- /dev/null +++ b/geoip_domain.php @@ -0,0 +1,6 @@ + \ No newline at end of file diff --git a/location-ip-to-location.php b/location-ip-to-location.php index 03f5aca..c967766 100644 --- a/location-ip-to-location.php +++ b/location-ip-to-location.php @@ -1,21 +1,118 @@ city($_GET['ip']); - - $city = $records->city->name; - - echo json_encode(['city' => $city]); - } catch (Exception $e) { - echo json_encode(['error' => $e->getMessage()]); - } -} else { - echo json_encode(['error' => 'Invalid parameters']); -} + require '.hta_lib/vendors/maxmind-db-reader/vendor/autoload.php'; ?> +
+

IP Information

+

This tool provides detailed geographical and ISP information for a given IP address using the GeoIP2.

+ city($_GET['ip']); + $records2 = $reader2->asn($_GET['ip']); + // var_dump($records2); + $country = $records->country->name ?? null; + $state = $records->mostSpecificSubdivision->name ?? null; + $city = $records->city->name ?? null; + $region = $records->subdivisions[0]->name ?? null; + $timezone = $records->location->timeZone ?? null; + + $data = [ + 'ip' => $_GET['ip'], + 'country' => $records->country->name ?? null, + 'country_iso_code' => $records->country->iso_code ?? null, + 'state' => $records->mostSpecificSubdivision->name ?? null, + 'state_iso_code' => $records->mostSpecificSubdivision->iso_code ?? null, + 'city' => $records->city->name ?? null, + 'region' => $records->subdivisions[0]->name ?? null, + 'timezone' => $records->location->timeZone ?? null, + 'latitude' => $records->location->latitude ?? null, + 'longitude' => $records->location->longitude ?? null, + 'postal_code' => $records->postal->code ?? null, + 'continent' => $records->continent->name ?? null, + 'asn' => $records2->autonomousSystemNumber ?? null, + 'isp' => $records2->autonomousSystemOrganization ?? null, + ]; + $dataArray = [$data]; // Wrap in an array if it's a single record. + ?> +
+ +

IP:

+

Continent:

+

Country:

+

State:

+

City:

+

Region:

+

Timezone:

+

Latitude:

+

Longitude:

+

Postal Code:

+

ASN:

+

ISP:

+ Invalid data format


'; + echo '
+ Back +
'; + } + } + ?> +
+
+ Back +
+ $e->getMessage()]); + echo '
+ Back +
'; + } + } else { + ?> +

+
+ +
+ + +
+

+
+ + +
+

Usage:

+
    +
  • Enter IP Address: Input the IP address you wish to check in the provided query parameter.
  • +
  • Check Location: Send a request with the IP address to retrieve and display the geographical and ISP information.
  • +
  • View Results: The location and ISP details will be displayed in a structured format, showing country, city, region, ASN, ISP, and other relevant information.
  • +
+ +

Features:

+
    +
  • Uses MaxMind GeoLite2 databases for accurate geo-location and ISP information.
  • +
  • Displays detailed geographical information including continent, country, state, city, and region.
  • +
  • Provides additional information such as timezone, latitude, longitude, and postal code.
  • +
  • Displays Autonomous System Number (ASN) and Internet Service Provider (ISP) details.
  • +
+

Example Use Cases:

+
    +
  • Network administrators tracking the location of IP addresses accessing their networks.
  • +
  • Security professionals analyzing IP addresses for potential threats.
  • +
  • Developers building applications that require IP-based location services.
  • +
  • Marketers tailoring content based on the geographic location of their audience.
  • +
+
+
\ No newline at end of file diff --git a/what-is-my-ip.php b/what-is-my-ip.php index 627d47b..be9c406 100644 --- a/what-is-my-ip.php +++ b/what-is-my-ip.php @@ -1,19 +1,17 @@ "; -echo "IPv6 Address: " . $ipv6 . "
"; + // Display IPv4 and IPv6 addresses + echo "IPv4 Address: " . $ipv4 . "
"; + echo "IPv6 Address: " . $ipv6 . "
"; ?> diff --git a/who-is.php b/who-is.php index 245fa79..63fefc9 100644 --- a/who-is.php +++ b/who-is.php @@ -1,56 +1,74 @@

Ultimate Domain & IP Lookup Tool

-
- - -
-
+

This tool allows you to perform a comprehensive lookup of domain names or IP addresses, providing detailed WHOIS information.

+ +

OR

- +
 ',$output, '


'; - } else { - echo "Invalid domain."; - } - } - if(isset($_POST['ip']) && $_POST['ip']){ - function validatePublicIp($ip) { - if (filter_var($ip, FILTER_VALIDATE_IP)) { - if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) { + if(isset($_POST['domain']) && $_POST['domain']){ + function validateDomain($domain) { + $regex = "/^(?!\-)(?:[a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]\.)+[a-zA-Z]{2,}$/"; + if (preg_match($regex, $domain)) { return true; + } else { + return false; } } - return false; - } - $ip = isset($_POST['ip']) ? $_POST['ip'] : ''; - if ($ip && validatePublicIp($ip)) { - $command = 'whois '.$_POST['ip']; - $escaped_command = escapeshellcmd($command); - $output = shell_exec($escaped_command); - echo '
 ',$output, '


'; - } else { - echo "Invalid IP address."; - } - } - -?> + $domain = isset($_POST['domain']) ? $_POST['domain'] : ''; + if ($domain && validateDomain($domain)) { + $command = 'whois '.$_POST['domain']; + $escaped_command = escapeshellcmd($command); + $output = shell_exec($escaped_command); + echo '
 ',$output, '


'; + } else { + echo "Invalid domain."; + } + } + if(isset($_POST['ip']) && $_POST['ip']){ + function validatePublicIp($ip) { + if (filter_var($ip, FILTER_VALIDATE_IP)) { + if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) { + return true; + } + } + return false; + } + $ip = isset($_POST['ip']) ? $_POST['ip'] : ''; + if ($ip && validatePublicIp($ip)) { + $command = 'whois '.$_POST['ip']; + $escaped_command = escapeshellcmd($command); + $output = shell_exec($escaped_command); + echo '
 ',$output, '


'; + } else { + echo "Invalid IP address."; + } + } + ?> +
+

Usage:

+
    +
  • Enter a domain name or an IP address into the respective input field.
  • +
  • Click the "Check" button to retrieve WHOIS information.
  • +
+ +

Features:

+
    +
  • Supports lookup for both domain names and IP addresses.
  • +
  • Displays WHOIS data including registration details and administrative contacts.
  • +
  • Secure input validation to ensure accurate results.
  • +
+ +

Example Use Cases:

+
    +
  • Investigate ownership and registration details of a domain.
  • +
  • Check the WHOIS information of an IP address for network troubleshooting.
  • +
  • Verify domain availability and registration status.
  • +
+
+