imrukavina/http0

A standard PHP library for Domain Name System & Secure Sockets Layers.

1.1 2024-05-09 16:21 UTC

This package is auto-updated.

Last update: 2024-05-10 07:58:35 UTC


README

A standard PHP library for "DNS/SSL/Header" data.

Current Release GitHub commit activity Total Downloads License Minimum PHP Version GitHub Issues or Pull Requests

This library was made to make it easy to get some basic information about the "backend" of the internet.

Features

  • Full DNS data retrieval
  • SSL certificate information retrieval
  • Header retrieval for URLs
  • more features will come soon!

Why you might need it

This library provides essential functionality for interacting with internet resources. Whether you're a developer building web applications, analyzing network configurations, or conducting security assessments, having easy access to DNS data, SSL certificate information, headers, and sitemap content can greatly simplify your tasks. It allows you to understand the backend of the internet and troubleshoot issues more effectively.

License

This software is distributed under the MIT license. Please read LICENSE for information on the software availability and distribution.

Installation & loading

Http0 is available on Packagist (using semantic versioning), and installation via Composer is the recommended way to install Http0.

composer require imrukavina/http0

Note that the vendor folder and the vendor/autoload.php script are generated by Composer; they are not part of Http0.

Usage

Load the library

To load the library using Composer's autoloader, you typically include the following code at the beginning of your PHP script:

// Include Composer's autoloader
require_once 'vendor/autoload.php';

This assumes that you have installed the library using Composer and that the autoload.php file generated by Composer is located in the vendor directory of your project.

Retrieve Headers

use imrukavina\Http0\Headers;

// Instantiate the Headers class
$headers = new Headers();

// Set the URL
$headers->url = "https://example.com"; // Replace "https://example.com" with your desired URL

// Call the Get() method to retrieve headers
$headersArray = $headers->Get();

// Use the retrieved headers array as needed
var_dump($headersArray);

Retrieve SSL Information

use imrukavina\Http0\SSL;

// Instantiate the SSL class
$ssl = new SSL();

// Set the host
$ssl->host = "example.com"; // Replace "example.com" with your desired host

// Set optional parameters if needed
$ssl->SSLTimeout = 30; // Optional, defaults to 30 if not provided
$ssl->SSLPort = 443;   // Optional, defaults to 443 if not provided

// Call the Get() method to retrieve SSL certificate information
$sslInfo = $ssl->Get();

// Use the retrieved SSL certificate information as needed
var_dump($sslInfo);

Retrieve DNS Records

use imrukavina\Http0\DNS;

// Instantiate the DNS class
$dns = new DNS();

// Set the host
$dns->host = "example.com"; // Replace "example.com" with your desired host

// Call the listAll() method to retrieve DNS records
$dnsRecords = $dns->listAll();

// Use the retrieved DNS records as needed
var_dump($dnsRecords);

Security

Please disclose any vulnerabilities found responsibly – report security issues to the maintainers privately.

See SECURITY and Http0's security advisories on GitHub.

Changelog

See changelog.

TODO

  • findTXT method - A method for finding a specific TXT value
  • Per type DNS search
  • More SSL features for specific use-cases
  • Add some IP methods
  • Add some Cookie methods

Contributing

Please submit bug reports, suggestions, and pull requests to the GitHub issue tracker.