توصيات الإصلاح اللي تتنفّد فعلاً
الفرق بين توصية عامة زي «حسّن الأمان» وتوصية محددة: الإجراء، ومثال، والحل المؤقت والدائم، وإزاي يتأكدوا إن الإصلاح نجح.
نص شرح المعلم والكود الذي كتبه ونتيجة تشغيله، بنفس ترتيب الدرس.
أهلاً بيك. توصية زي: صلّح الثَّغْرة… أو: حسّن الأمان… دي مش توصية. المطور هيقراها ويقول: طب أعمل إيه بالزبط؟
التوصية الكويسة فيها: إجراء محدد: تعمل إيه، وفين. مِسال code أو command لو ينفع. حل سريع مؤقت، لو الإصلاح الكامل هياخد وقت. حل دائم يعالج السبب. وإزاي يتأكدوا إن الإصلاح نجح. ليه الحل المؤقت؟ لأن ساعات الإصلاح الكامل محتاج أسابيع. فـ WAF rule، أو قِفل الـ service مؤقتاً، بيحمي العميل لحد ما الإصلاح الحقيقي يخلص. بس اكتب بوضوح إن ده مش كفاية لوحده. نقارن التوصيات العامة بتوصية كويسة. نشغّل… التوصية الكويسة المطور يقدر يبدأ فيها على طول.
vague = ["Fix the vulnerability", "Improve security", "Update software"]
good = [
{
"action": "Use prepared statements in login.php for all SQL queries",
"example": 'cur.execute("SELECT * FROM users WHERE name = %s", (name,))',
"short_term": "Block payloads like ' OR 1=1 with the WAF",
"long_term": "Train developers on OWASP secure coding",
"verify": "Re-run the payload: login must fail",
}
]
print("Vague:", vague)
for r in good:
for k, v in r.items():
print(f"{k}: {v}")المخرجات
Vague: ['Fix the vulnerability', 'Improve security', 'Update software']
action: Use prepared statements in login.php for all SQL queries
example: cur.execute("SELECT * FROM users WHERE name = %s", (name,))
short_term: Block payloads like ' OR 1=1 with the WAF
long_term: Train developers on OWASP secure coding
verify: Re-run the payload: login must failوكام قاعدة كمان: اصلح السبب، مش العَرَض. ما تقترحش حل يوقّف البيزنس، زي اقفلوا الموقع خالص. ولو فيه كدا Finding ليهم نفس السبب، اكتب توصية واحدة تجمعهم. دورك: ضيف توصية تانية للـ default admin password، بنفس الأجزاء الخمسة.
ضيف dictionary تاني للـ good فيه action و example و short_term و long_term و verify.
الحل: نشغّل…
vague = ["Fix the vulnerability", "Improve security", "Update software"]
good = [
{
"action": "Use prepared statements in login.php for all SQL queries",
"example": 'cur.execute("SELECT * FROM users WHERE name = %s", (name,))',
"short_term": "Block payloads like ' OR 1=1 with the WAF",
"long_term": "Train developers on OWASP secure coding",
"verify": "Re-run the payload: login must fail",
},
{
"action": "Change the default admin password to a long random one",
"example": "openssl rand -base64 24",
"short_term": "Disable the admin account until it is changed",
"long_term": "Enforce a password policy and MFA for admins",
"verify": "Login with admin:admin must fail",
},
]
print("Vague:", vague)
for r in good:
for k, v in r.items():
print(f"{k}: {v}")المخرجات
Vague: ['Fix the vulnerability', 'Improve security', 'Update software']
action: Use prepared statements in login.php for all SQL queries
example: cur.execute("SELECT * FROM users WHERE name = %s", (name,))
short_term: Block payloads like ' OR 1=1 with the WAF
long_term: Train developers on OWASP secure coding
verify: Re-run the payload: login must fail
action: Change the default admin password to a long random one
example: openssl rand -base64 24
short_term: Disable the admin account until it is changed
long_term: Enforce a password policy and MFA for admins
verify: Login with admin:admin must failالدرس الجاي: عندك الـ Findings في Python… ليه تنسخهم بإيدك في Word؟ نخلّي الـ code يكتب التقرير. يلا بينا.
03 / دروس المسار (21)
- 01ليه التقرير أهم حاجة في الـ Pentest
- 02مين بيقرا التقرير؟
- 03نظام Notes من أول دقيقة
- 04Activity Log: كل حاجة بالوقت
- 05خلّي الـ Terminal يسجّل لوحده
- 06الأدلة: إيه اللي يعتبر دليل؟
- 07سلامة الأدلة: Hash و Chain of Custody
- 08إخفاء البيانات الحساسة (Redaction)
- 09خطوات إعادة التنفيد (Steps to Reproduce)
- 10الـ Impact: الخطر الحقيقي على البيزنس
- 11CVSS: الخطورة برقم
- 12الـ Risk Matrix: الاحتمال في الـ Impact
- 13ترتيب الأولويات والـ Quick Wins
- 14هيكل تقرير اختبار الاختراق
- 15الـ Executive Summary: صفحة للإدارة
- 16كتابة الـ Finding التقني
- 17توصيات الإصلاح اللي تتنفّد فعلاًانت هنا
- 18خلّي Python يكتب التقرير
- 19المراجعة قبل التسليم والـ Retest
- 20تقرير امتحان OSCP
- 21المراجعة النهائية: من الـ Note للتقرير