- Ad
- Soyad
- Katılım
- 30 Mayıs 2019
- Konum
- web master
- Konular
- 327
- Mesajlar
- 493
- Ticaret - 100%
- iletişim
- Meslek
- Seo Danışmanı
Detay
- Meslek
- Seo Danışmanı
Siteye saldırı yapınca whois yükselmekte whois yükselince cloudflarede güvenliği ddos saldırısı altında diye değiştiriyorum yedek olsun diye paylaşmaktayım.
PHP Kod:
ddose(1); //ddos korumasını aktif eder
ddose(0); //ddos korumasını pasif eder
PHP Kod:
ddose(1); //ddos korumasını aktif eder
ddose(0); //ddos korumasını pasif eder
Kod:
function ddose($ddos) {
if ($ddos == 1) {
$value = 'under_attack';
} else {
$value = 'high';
}
$email = "--mail--";
$api_key = "--apikey--";
$zone_id = "--siteye ait zoneid--";
$url = "https://api.cloudflare.com/client/v4/zones/".$zone_id.
"/settings/security_level";
$data = ['value' => $value, ];
$json_data = json_encode($data);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_data);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PATCH');
$headers = array('X-Auth-Email: '.$email, 'X-Auth-Key: '.$api_key, 'Content-Type: application/json');
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
curl_close($ch);
return $result;
}
Moderatör tarafında düzenlendi: