سكربت خفيف لتجربه ل VEMHaYeF5Checker



ميزه البرمجه كتالي :
قالب احترافي بسيط بلغة PHP:
✅ دالة استخراج الإيميلات
✅ دالة استخراج أرقام الهواتف
✅ فحص صحة الرابط
✅ فحص موثوقية الدومين
✅ رابط مباشر لعرض الفحص في VirusTotal
✅ تصميم احترافي Responsive (بـ CSS فقط بدون مكتبات خارجية)
✅ حقوق موقعك بأسفل الصفحة
تصميم متجاوب (Responsive)
دعم RTL (اللغة العربية)
دعم استخراج إيميلات وهواتف
فحص موثوقية الدومين ✅
رابط مباشر لفحص VirusTotal بدون تسجيل
سهل التوسعة والإضافة
كود نظيف ومنظم
واجهة سهلة للمستخدم
1- كود القالب
<?php
function findEmails($text) {
preg_match_all("/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-z]{2,}/", $text, $matches);
return $matches[0];
}
function findPhones($text) {
preg_match_all("/(\+?\d{1,4}[\s\-]?)?(\(?\d{2,3}\)?[\s\-]?)?[\d\s\-]{5,}/", $text, $matches);
return $matches[0];
}
function isTrustedDomain($url) {
$trustedDomains = [
'google.com',
'facebook.com',
'twitter.com',
'youtube.com',
'moh.gov.sa',
'gov.sa',
'apple.com',
'microsoft.com'
];
$host = parse_url($url, PHP_URL_HOST);
if (!$host) return false;
foreach ($trustedDomains as $domain) {
if (stripos($host, $domain) !== false) {
return true;
}
}
return false;
}
function classifyRisk($html) {
$dangerWords = ['login', 'password', 'verify', 'phishing', 'bank', 'bitcoin', 'credit card', 'ssn', 'passport'];
$score = 0;
foreach ($dangerWords as $word) {
if (stripos($html, $word) !== false) {
$score++;
}
}
if ($score >= 4) return ['🔴 عالي جدًا', 'high'];
if ($score >= 2) return ['🟠 متوسط', 'medium'];
if ($score >= 1) return ['🟡 منخفض', 'low'];
return ['🟢 آمن', 'safe'];
}
function getEmailProvider($email) {
$providers = [
'gmail.com' => 'Gmail',
'yahoo.com' => 'Yahoo',
'hotmail.com' => 'Hotmail',
'outlook.com' => 'Outlook',
'icloud.com' => 'iCloud',
'aol.com' => 'AOL',
'protonmail.com' => 'ProtonMail',
'zoho.com' => 'Zoho',
'gmx.com' => 'GMX',
'mail.com' => 'Mail.com',
'edu.sa' => 'تعليمي سعودي',
'gov.sa' => 'حكومي سعودي'
];
$domain = strtolower(substr(strrchr($email, "@"), 1));
return $providers[$domain] ?? 'غير معروف';
}
function getEmailCountry($email) {
// تقريب للدومينات
$domain = strtolower(substr(strrchr($email, "@"), 1));
$countryByDomain = [
'sa' => 'السعودية 🇸🇦',
'eg' => 'مصر 🇪🇬',
'us' => 'الولايات المتحدة 🇺🇸',
'uk' => 'المملكة المتحدة 🇬🇧',
'ae' => 'الإمارات 🇦🇪',
'in' => 'الهند 🇮🇳',
'fr' => 'فرنسا 🇫🇷',
'de' => 'ألمانيا 🇩🇪',
'ca' => 'كندا 🇨🇦',
];
$parts = explode('.', $domain);
$tld = end($parts);
$sld = count($parts) > 1 ? $parts[count($parts)-2] : '';
if (isset($countryByDomain[$tld])) {
return $countryByDomain[$tld];
}
if (isset($countryByDomain[$sld])) {
return $countryByDomain[$sld];
}
return 'غير معروف 🌐';
}
function findNameInHtml($html, $name) {
$results = [];
preg_match_all('/<p[^>]*>(.*?)<\/p>/is', $html, $matches);
foreach ($matches[1] as $paragraph) {
if (stripos($paragraph, $name) !== false) {
// تنظيف النص من الوسوم html لعرضه فقط
$cleanText = strip_tags($paragraph);
$results[] = $cleanText;
}
}
return $results;
}
$error = null;
$urlResult = null;
$emailResult = null;
$nameResult = null;
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if (!empty($_POST['url']) && empty($_POST['email']) && empty($_POST['name'])) {
$url = filter_var($_POST['url'], FILTER_SANITIZE_URL);
if (filter_var($url, FILTER_VALIDATE_URL)) {
$html = @file_get_contents($url);
if ($html === false) {
$error = "لا يمكن الوصول إلى الرابط أو الرابط غير صالح.";
} else {
$emails = findEmails($html);
$phones = findPhones($html);
$trusted = isTrustedDomain($url);
$risk = classifyRisk($html);
$urlResult = [
'length' => strlen($html),
'emails' => $emails,
'phones' => $phones,
'trusted' => $trusted,
'risk' => $risk,
'url' => $url
];
}
} else {
$error = "الرابط غير صالح.";
}
} elseif (!empty($_POST['email'])) {
$email = filter_var($_POST['email'], FILTER_SANITIZE_EMAIL);
if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
$provider = getEmailProvider($email);
$country = getEmailCountry($email);
$subscriptions = [];
if (stripos($email, 'gmail.com') !== false) {
$subscriptions = ['Google Drive', 'YouTube', 'Gmail'];
} elseif (stripos($email, 'yahoo.com') !== false) {
$subscriptions = ['Yahoo Mail', 'Yahoo News'];
} elseif (stripos($email, 'hotmail.com') !== false || stripos($email, 'outlook.com') !== false) {
$subscriptions = ['Outlook Mail', 'OneDrive'];
} else {
$subscriptions = ['خدمات بريدية عامة'];
}
$emailResult = [
'email' => $email,
'provider' => $provider,
'country' => $country,
'subscriptions' => $subscriptions
];
} else {
$error = "الإيميل غير صالح.";
}
} elseif (!empty($_POST['name']) && !empty($_POST['url_name'])) {
$name = trim($_POST['name']);
$url_name = filter_var($_POST['url_name'], FILTER_SANITIZE_URL);
if (!$name) {
$error = "الرجاء إدخال الاسم الصحيح.";
} elseif (!filter_var($url_name, FILTER_VALIDATE_URL)) {
$error = "الرابط غير صالح لفحص الاسم.";
} else {
$html = @file_get_contents($url_name);
if ($html === false) {
$error = "لا يمكن الوصول إلى الرابط أو الرابط غير صالح.";
} else {
$foundParagraphs = findNameInHtml($html, $name);
$nameResult = [
'name' => $name,
'url' => $url_name,
'found' => $foundParagraphs
];
}
}
}
}
?>
<!DOCTYPE html>
<html lang="ar" dir="rtl">
<head>
<meta charset="UTF-8" />
<title>أمانك - فحص روابط وإيميلات وأسماء</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style>
body {
font-family: Tahoma, Arial, sans-serif;
background: #f9f9f9;
margin: 0; padding: 0;
color: #222;
}
header {
background: #34495e;
color: white;
padding: 15px;
text-align: center;
}
main {
max-width: 720px;
margin: 30px auto;
background: white;
padding: 20px;
border-radius: 8px;
box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}
h2 {
margin-top: 0;
}
form {
margin-bottom: 20px;
}
input[type=text], input[type=email] {
width: 100%;
padding: 10px;
margin: 8px 0 15px 0;
border: 1px solid #ccc;
border-radius: 5px;
font-size: 16px;
}
button {
background: #2980b9;
color: white;
border: none;
padding: 12px 20px;
font-size: 16px;
border-radius: 5px;
cursor: pointer;
transition: background 0.3s ease;
}
button:hover {
background: #21618c;
}
.tabs {
display: flex;
gap: 10px;
margin-bottom: 20px;
justify-content: center;
flex-wrap: wrap;
}
.tab {
padding: 12px 25px;
border-radius: 30px;
background: #ddd;
cursor: pointer;
user-select: none;
font-weight: bold;
color: #555;
white-space: nowrap;
}
.tab.active {
background: #2980b9;
color: white;
}
.tab-content {
display: none;
}
.tab-content.active {
display: block;
}
.result-box {
background: #f0f8ff;
padding: 15px;
border-radius: 6px;
margin-top: 15px;
border: 1px solid #a9c5f1;
max-height: 400px;
overflow-y: auto;
}
.error {
background: #ffe6e6;
color: #b30000;
padding: 10px;
border-radius: 5px;
margin-bottom: 15px;
font-weight: bold;
}
ul {
padding-left: 20px;
}
.trusted { color: green; font-weight: bold; }
.untrusted { color: red; font-weight: bold; }
.high { color: red; font-weight: bold; }
.medium { color: orange; font-weight: bold; }
.low { color: goldenrod; font-weight: bold; }
.safe { color: green; font-weight: bold; }
p.found-item {
border-bottom: 1px solid #ccc;
padding: 8px 0;
margin: 0;
white-space: pre-wrap;
line-height: 1.4em;
}
a.external-link {
color: #2980b9;
text-decoration: none;
}
a.external-link:hover {
text-decoration: underline;
}
</style>
</head>
<body>
<header>
<h1>أمانك - فحص روابط وإيميلات وأسماء</h1>
</header>
<main>
<?php if ($error): ?>
<div class="error"><?= htmlspecialchars($error) ?></div>
<?php endif; ?>
<div class="tabs">
<div class="tab active" data-tab="tab-url">فحص رابط</div>
<div class="tab" data-tab="tab-email">فحص إيميل</div>
<div class="tab" data-tab="tab-name">فحص اسم داخل رابط</div>
</div>
<div id="tab-url" class="tab-content active">
<h2>فحص رابط</h2>
<form method="POST">
<input type="text" name="url" placeholder="أدخل الرابط هنا مثل: https://HaYeF5.com" required />
<button type="submit">فحص الرابط</button>
</form>
<?php if ($urlResult): ?>
<div class="result-box">
<p><strong>طول الصفحة:</strong> <?= $urlResult['length'] ?> بايت</p>
<p><strong>الإيميلات المكتشفة:</strong></p>
<?php if (!empty($urlResult['emails'])): ?>
<ul>
<?php foreach ($urlResult['emails'] as $em): ?>
<li><?= htmlspecialchars($em) ?></li>
<?php endforeach; ?>
</ul>
<?php else: ?>
<p>لا يوجد</p>
<?php endif; ?>
<p><strong>أرقام الهواتف المكتشفة:</strong></p>
<?php if (!empty($urlResult['phones'])): ?>
<ul>
<?php
$phonesToShow = array_slice($urlResult['phones'], 0, 5);
foreach ($phonesToShow as $ph): ?>
<li><?= htmlspecialchars($ph) ?></li>
<?php endforeach; ?>
<?php if (count($urlResult['phones']) > 5): ?>
<li>... وهناك المزيد</li>
<?php endif; ?>
</ul>
<?php else: ?>
<p>لا يوجد</p>
<?php endif; ?>
<p><strong>هل الموقع موثوق؟</strong>
<span class="<?= $urlResult['trusted'] ? 'trusted' : 'untrusted' ?>">
<?= $urlResult['trusted'] ? 'نعم' : 'لا' ?>
</span>
</p>
<p><strong>تصنيف أمان الموقع:</strong>
<span class="<?= $urlResult['risk'][1] ?>">
<?= $urlResult['risk'][0] ?>
</span>
</p>
<p><a href="https://www.virustotal.com/gui/url/<?= urlencode($urlResult['url']) ?>" target="_blank" rel="noopener" class="external-link">تفقد في VirusTotal</a></p>
</div>
<?php endif; ?>
</div>
<div id="tab-email" class="tab-content">
<h2>فحص إيميل</h2>
<form method="POST">
<input type="email" name="email" placeholder="أدخل الإيميل هنا مثل: example@HaYeF5.com" required />
<button type="submit">فحص الإيميل</button>
</form>
<?php if ($emailResult): ?>
<div class="result-box">
<p><strong>الإيميل:</strong> <?= htmlspecialchars($emailResult['email']) ?></p>
<p><strong>مزود البريد:</strong> <?= $emailResult['provider'] ?></p>
<p><strong>الدولة (تقريبية):</strong> <?= $emailResult['country'] ?></p>
<p><strong>الاشتراكات المحتملة:</strong></p>
<ul>
<?php foreach ($emailResult['subscriptions'] as $sub): ?>
<li><?= htmlspecialchars($sub) ?></li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>
</div>
<div id="tab-name" class="tab-content">
<h2>فحص اسم داخل رابط</h2>
<form method="POST">
<input type="text" name="url_name" placeholder="أدخل رابط الموقع هنا مثل: https://HaYeF5.com" required />
<input type="text" name="name" placeholder="أدخل الاسم (عربي أو إنجليزي) هنا" required />
<button type="submit">فحص الاسم</button>
</form>
<?php if ($nameResult): ?>
<div class="result-box">
<p><strong>الاسم الذي تم البحث عنه:</strong> <?= htmlspecialchars($nameResult['name']) ?></p>
<p><strong>الرابط:</strong> <a href="<?= htmlspecialchars($nameResult['url']) ?>" target="_blank" rel="noopener" class="external-link"><?= htmlspecialchars($nameResult['url']) ?></a></p>
<p><strong>الفقرات التي تحتوي الاسم:</strong></p>
<?php if (!empty($nameResult['found'])): ?>
<?php foreach ($nameResult['found'] as $paragraph): ?>
<p class="found-item"><?= htmlspecialchars($paragraph) ?></p>
<?php endforeach; ?>
<?php else: ?>
<p>لم يتم العثور على الاسم في المحتوى.</p>
<?php endif; ?>
</div>
<?php endif; ?>
</div>
</main>
<script>
const tabs = document.querySelectorAll('.tab');
const contents = document.querySelectorAll('.tab-content');
tabs.forEach(tab => {
tab.addEventListener('click', () => {
tabs.forEach(t => t.classList.remove('active'));
tab.classList.add('active');
contents.forEach(c => c.classList.remove('active'));
document.getElementById(tab.dataset.tab).classList.add('active');
});
});
</script>
</body>
</html>
* واذا حبيت ل جرب
نرسل الرابط إلى VirusTotal API → يرجع لنا تقرير (هل فيه تهديدات أمنية؟)
✅ خطوات الاستخدام:
سجّل في VirusTotal
واحصل على API Key
خذ المفتاح وضعه في كود PHP
🧾 كود PHP لاستخدام VirusTotal API:
function scanWithVirusTotal($url) {
$apiKey = 'YOUR_VIRUSTOTAL_API_KEY'; // ← ضع مفتاحك هنا
$apiUrl = 'https://www.virustotal.com/api/v3/urls';
// يجب ترميز الرابط بـ base64 (خاص بـVirusTotal)
$encodedUrl = base64_encode($url);
$encodedUrl = rtrim(strtr($encodedUrl, '+/', '-_'), '=');
$headers = [
'x-apikey: ' . $apiKey
];
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => $apiUrl . '/' . $encodedUrl,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => $headers
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
return 'خطأ في الاتصال بـ VirusTotal.';
}
$data = json_decode($response, true);
if (isset($data['data']['attributes']['last_analysis_stats'])) {
return $data['data']['attributes']['last_analysis_stats'];
} else {
return 'لا توجد بيانات تحليل.';
}
}
📌 كيف تدمجها مع الكود الرئيسي:
بعد تحميل الرابط في كودك السابق:
$virusTotalResult = scanWithVirusTotal($url);
وفي HTML:
<?php if (is_array($virusTotalResult)): ?>
<p>نتيجة VirusTotal:</p>
<ul>
<li>تحذيرات: <?= $virusTotalResult['malicious'] ?></li>
<li>مريبة: <?= $virusTotalResult['suspicious'] ?></li>
<li>نظيفة: <?= $virusTotalResult['harmless'] ?></li>
<li>غير محددة: <?= $virusTotalResult['undetected'] ?></li>
</ul>
<?php else: ?>
<p><?= $virusTotalResult ?></p>
<?php endif; ?>
✅ النتيجة النهائية:
صفحة PHP تقوم بـ:
فحص الرابط
استخراج الإيميلات/أرقام
معرفة إن كان الدومين موثوق
إرسال الرابط إلى VirusTotal وعرض النتيجة
💡 ملاحظات:
API مجاني في VirusTotal محدود (عدد مرات الفحص في اليوم)
إذا أردت دعم API آخر (مثلاً Google Safe Browsing) يمكنني مساعدتك
ممكن نحسن الأداء لاحقًا بإضافة caching أو قاعدة بيانات صغيرة لتسجيل النتائج
يمكنك تطويره اخوكم هايف السـفـ العجمي ــراني
0 تعليقات