script PHP ssh checker gratis

Pertanyaan saya tentang website/situs yang dibuat oleh bahasa PHP yang berfungsi untuk mengecek SSH. ada yg punya script ssh checker sperti ini

script PHP ssh checker gratis

SD Ditanyakan on 2 Juli 2016 pada Internet.
Tambah Komentar
  • 2 Jawaban

    Berikut adalah contoh script untuk mengecek SSH menggunakan PHP yang hasilnya langsung terkirim ke email, silahkan anda edit sendiri.

    <?php
    // the threshold for connections from a remote IP to be considered an attack
    $incomingThreshold = 10;
    // send an email report?
    $sendEmail = TRUE;
    // where to send the email report to
    $emailAddress = 'email@ipxcore.com';
    // email subject
    $emailSubject = 'sshcheck.php report from ' . php_uname('n');
    // email's From address
    $emailFrom = 'email@ipxcore.com';
    // do you want the system to add iptables rules automatically?
    $addIPTablesRules = TRUE;
    // prefix for iptables. should not need to change
    $iptablesPrefix = "/sbin/";
    //==================================================
    exec("netstat -n | grep \":22 \"", $netstatArray);
    if (!empty($netstatArray)) {
     foreach ($netstatArray as $netstatData) {
     $netstatDataSplit[] = preg_split('/\s+/', $netstatData);
     }
    } else {
     die("No data was collected from netstat!");
    }
    foreach ($netstatDataSplit as $dataKey => $dataRow) {
     if (substr_count($dataRow[4], ":") == 1 ) {
     $onlyRemoteIP = substr($dataRow[4],0,strpos($dataRow[4],":"));
     $remoteIP[$onlyRemoteIP]++;
     $remoteIPtoLocalIP[$onlyRemoteIP][] = $dataRow[3];
     }
    }
    foreach ($remoteIP as $addressToCheck => $addressToCheckCounter) {
     if ($addressToCheckCounter > $incomingThreshold) {
     exec($iptablesPrefix . "iptables -n --list FORWARD | grep $addressToCheck", $inIPTables);
     if (empty($inIPTables)) {
     if ($sendEmail == TRUE) {
     $reportData = "Hello, this is sshcheck.php running on " . php_uname('n') . "\n";
     $reportData .= "\n";
     $reportData .= "Current time: " . date(DATE_RFC822) . "\n";
     $reportData .= "\n";
     if($addIPTablesRules == TRUE) {
     $reportData .= "Adding iptables DROP rule. Remove it with:\n";
     $reportData .= "iptables -D FORWARD -s $addressToCheck -j DROP\n";
     $reportData .= "\n";
     }
     $reportData .= "IP " . $addressToCheck . " is involved in a brute force attack against the following IPs:\n";
     $reportData .= "\n";
     $reportData .= "Count: " . count($remoteIPtoLocalIP[$addressToCheck]) . "\n";
     foreach($remoteIPtoLocalIP[$addressToCheck] as $targetedIP) {
     $reportData .= $targetedIP . "\n";
     }
     $reportData = wordwrap($reportData, 70);
     mail($emailAddress, $emailSubject, $reportData, 'From: ' . $emailFrom);
     }
     if($addIPTablesRules == TRUE) {
     system($iptablesPrefix . "iptables -I FORWARD -s $addressToCheck -j DROP");
     }
     unset($reportData);
     }
     unset($inIPTables);
     }
    }
    ?>
    

    Megister Terjawab on 2 Juli 2016

    muncul error gini gan
    $dataRow) { if (substr_count($dataRow[4], “:”) == 1 ) { $onlyRemoteIP = substr($dataRow[4],0,strpos($dataRow[4],”:”)); $remoteIP[$onlyRemoteIP]++; $remoteIPtoLocalIP[$onlyRemoteIP][] = $dataRow[3]; } } foreach ($remoteIP as $addressToCheck => $addressToCheckCounter) { if ($addressToCheckCounter > $incomingThreshold) { exec($iptablesPrefix . “iptables -n –list FORWARD | grep $addressToCheck”, $inIPTables); if (empty($inIPTables)) { if ($sendEmail == TRUE) { $reportData = “Hello, this is sshcheck.php running on ” . php_uname(‘n’) . “\n”; $reportData .= “\n”; $reportData .= “Current time: ” . date(DATE_RFC822) . “\n”; $reportData .= “\n”; if($addIPTablesRules == TRUE) { $reportData .= “Adding iptables DROP rule. Remove it with:\n”; $reportData .= “iptables -D FORWARD -s $addressToCheck -j DROP\n”; $reportData .= “\n”; } $reportData .= “IP ” . $addressToCheck . ” is involved in a brute force attack against the following IPs:\n”; $reportData .= “\n”; $reportData .= “Count: ” . count($remoteIPtoLocalIP[$addressToCheck]) . “\n”; foreach($remoteIPtoLocalIP[$addressToCheck] as $targetedIP) { $reportData .= $targetedIP . “\n”; } $reportData = wordwrap($reportData, 70); mail($emailAddress, $emailSubject, $reportData, ‘From: ‘ . $emailFrom); } if($addIPTablesRules == TRUE) { system($iptablesPrefix . “iptables -I FORWARD -s $addressToCheck -j DROP”); } unset($reportData); } unset($inIPTables); } } ?>

    on 2 Juli 2016.

    Yang saya kasik adalah sebuah contoh dari script pengecekan ssh bukan script yang sudah fix bisa di jalankan, jadi silahkan edit dan ikuti logika dari contoh script diatas gan

    on 16 Juli 2016.
    Tambah Komentar

    Untuk alternatif Check SSH bisa pakai terminal OS Linux atau Aplikasi SSH Pilot di windows. Aplikasi ini ada di Admob Pilot :

    Megister Terjawab on 2 Juli 2016
    Tambah Komentar
    Loading...

    Smilies Kaskus

    Dengan memposting jawaban, anda setuju dengan Kebijakan Privasi dan ketentuan layanan.