SlideShare une entreprise Scribd logo
1  sur  6
Télécharger pour lire hors ligne
Aidin Naserifard--------------------------------------------------------------------------------------Payload Structure
1
Payload structure
Aidin Naserifard--------------------------------------------------------------------------------------Payload Structure
2
‫ساختار‬PAYLOAD‫طر‬ ‫و‬‫ي‬‫نوشتن‬ ‫قه‬Rule‫برا‬ ‫مناسب‬‫ي‬‫جلوگ‬‫ي‬‫ر‬‫ي‬‫سيستم‬ ‫در‬ ‫تهديد‬ ‫از‬‫نفوذ‬ ‫تشخيص‬ ‫هاي‬:
‫کن‬ ‫فرض‬‫ي‬‫پ‬ ‫د‬‫ي‬‫ز‬ ‫لود‬‫ي‬‫به‬ ‫مربوط‬ ،‫ر‬‫ي‬‫حمله‬ ‫ک‬buffer over flow‫که‬ ‫بوده‬‫عل‬ ‫بر‬‫ي‬‫سرو‬ ‫ه‬‫ي‬‫س‬sadmind‫انجام‬
‫م‬‫ي‬‫گ‬‫ي‬.‫رد‬‫(سرو‬‫ي‬‫س‬sadmind‫پ‬ ‫بصورت‬ ،‫ي‬‫ش‬‫س‬ ‫در‬ ،‫فرض‬‫ي‬‫ستم‬‫ها‬‫ي‬solaris‫ا‬ .‫است‬ ‫نصب‬ ،‫ي‬‫سرو‬ ‫ن‬‫ي‬‫برا‬ ‫س‬‫ي‬
‫عمل‬ ‫کردن‬ ‫هماهنگ‬‫ي‬‫مد‬ ‫ات‬‫ي‬‫ر‬‫ي‬‫ت‬‫ي‬‫س‬‫ي‬‫ستم‬‫ها‬‫ي‬‫توز‬‫ي‬‫شده‬ ‫ع‬‫دور‬ ‫راه‬ ‫از‬ ،‫م‬ ‫بکار‬‫ي‬).‫رود‬
89 09 9c e2 00 00 00 00 00 00 00 02 00 01 87 88 ................
00 00 00 0a 00 00 00 01 00 00 00 01 00 00 00 20 ...............
40 28 3a 10 00 00 00 0a 4d 45 54 41 53 50 4c 4f @(:.....metasplo
49 54 00 00 00 00 00 00 00 00 00 00 00 00 00 00 it..............
00 00 00 00 00 00 00 00 40 28 3a 14 00 07 45 df ........@(:...e.
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 06 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 04 ................
7f 00 00 01 00 01 87 88 00 00 00 0a 00 00 00 04 ................
7f 00 00 01 00 01 87 88 00 00 00 0a 00 00 00 11 ................
00 00 00 1e 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 3b 4d 45 54 41 53 50 4c 4f .......;metasplo
49 54 00 00 00 00 00 00 00 00 00 00 00 00 00 00 it..............
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 06 73 79 73 74 65 6d 00 00 ........system..
00 00 00 15 2e 2e 2f 2e 2e 2f 2e 2e 2f 2e 2e 2f ....../../../../
2e 2e 2f 62 69 6e 2f 73 68 00 00 00 00 00 04 1e ../bin/sh....... <snip>
•‫نوع‬ ‫از‬ ‫اعداد‬unsigned integer 32‫ب‬‫ي‬‫ت‬‫ي‬.‫هستند‬
•‫رد‬ ‫هر‬‫ي‬‫ف‬16‫با‬‫ي‬‫م‬ ‫ت‬‫ي‬.‫باشد‬‫ي‬‫عن‬‫ي‬256‫ب‬‫ي‬.‫ت‬
‫حال‬32‫با‬‫ي‬‫ت‬‫بررس‬ ‫را‬ ‫اول‬‫ي‬‫م‬‫ي‬‫کن‬‫ي‬:‫م‬
89 09 9c e2‫شماره‬ :id‫برا‬ ‫بفرد‬ ‫منحصر‬‫ي‬‫درخواست‬ ‫هر‬
00 00 00 00‫پروتکل‬ ‫نوع‬ :rpc(call=0, response=1)
00 00 00 02‫نسخه‬ :rpc‫که‬2‫م‬‫ي‬.‫باشد‬
Aidin Naserifard--------------------------------------------------------------------------------------Payload Structure
3
00 01 87 88:‫شماره‬‫برنامه‬rpc(0x00018788=100232=sadmind)
‫نکته‬1‫هگزادس‬ ‫کد‬ ‫چگونه‬ :‫ي‬‫دس‬ ‫به‬ ‫را‬ ‫مال‬‫ي‬‫تبد‬ ‫مال‬‫ي‬‫کن‬ ‫ل‬‫ي‬‫پا‬ ‫از‬ ‫استفاده‬ ‫با‬ ‫م؟‬‫ي‬:‫تون‬
‫نکته‬2‫برنامه‬ ‫شماره‬ :‫ها‬‫ي‬rpc‫م‬ ‫را‬‫ي‬‫توان‬‫ي‬‫ل‬ ‫از‬ ‫د‬‫ي‬‫ز‬ ‫نک‬‫ي‬‫نما‬ ‫مشاهده‬ ‫ر‬‫يي‬:‫د‬
-program-numbers/rpc-program-http://www.iana.org/assignments/rpc
numbers.xhtml
00 00 00 0a‫برنامه‬ ‫نسخه‬ :RPC(0x0000000a=10)
00 00 00 01‫پروس‬ ‫شماره‬ :‫ي‬‫جر‬rpc
00 00 00 01:‫گواه‬ ‫کد‬‫ي‬‫ل‬‫ي‬‫نوکس‬‫ي‬(1=auth_unix)
00 00 00 20‫د‬ ‫طول‬ :‫ي‬‫تا‬‫ي‬auth_unix(32)
‫حال‬32‫با‬‫ي‬‫ت‬‫بعد‬‫ي‬‫ها‬ ‫داده‬ ‫که‬‫ي‬‫هو‬ ‫احراز‬‫ي‬‫ت‬‫ي‬‫يون‬‫ي‬‫بررس‬ ‫را‬ ‫هستند‬ ‫کس‬‫ي‬‫م‬‫ي‬‫کن‬‫ي‬:‫م‬
40 28 3a 10:‫زمان‬‫تول‬‫ي‬‫پ‬ ‫د‬‫ي‬‫لود‬(02 / 10 / 04 @ 1:55:28am UTC
0x40283a10=1076378128=
‫توجه‬:timestamp‫م‬ ‫را‬‫ي‬‫سا‬ ‫از‬ ‫توان‬‫ي‬‫ز‬ ‫ت‬‫ي‬:‫آورد‬ ‫بدست‬ ‫ر‬
http://www.unixtimestamp.com/index.php
Aidin Naserifard--------------------------------------------------------------------------------------Payload Structure
4
00 00 00 0a‫ماش‬ ‫نام‬ ‫طول‬ :‫ي‬‫کال‬ ‫ن‬‫ي‬‫نت‬(0a=10)
4d 45 54 41 53 50 4c 4f 49 54‫کلمه‬ :METASPLOIT
‫توجه‬‫سا‬ ‫از‬ :‫ي‬‫ز‬ ‫ت‬‫ي‬‫م‬ ‫ر‬‫ي‬‫توان‬‫ي‬‫کد‬ ‫د‬hex‫به‬ ‫را‬string‫تبد‬‫ي‬‫کن‬ ‫ل‬‫ي‬:‫د‬
string.aspx-functions.com/hex-http://www.string
00 00 00 00:uid‫کاربر‬
00 00 00 00:gid‫کاربر‬
00 00 00 00:extra group ids
00 00 00 00:‫تا‬ ‫کد‬‫يي‬(‫د‬0=auth_null)
:00 00 00 00‫تا‬ ‫کد‬ ‫طول‬‫يي‬‫د‬
،‫خوب‬‫با‬ ‫ابتدا‬‫ي‬‫بفهم‬ ‫د‬‫ي‬‫حاو‬ ،‫بسته‬ ‫که‬ ‫م‬‫ي‬‫پروتکل‬rpc‫فراخوان‬ ‫و‬ ‫بوده‬‫ي‬‫م‬‫ي‬:‫شود‬
content:"|00 00 00 00|"; offset:4; depth:4;
‫همچن‬‫ي‬‫پروتکل‬ ‫ن‬rpc‫برنامه‬ ،sadmind‫فراخوان‬ ‫را‬‫ي‬:‫کند‬
content:"|00 01 87 88|"; offset:12; depth:4;
‫پروس‬ ‫سپس‬‫ي‬‫جر‬rpc‫که‬1‫فراخوان‬ ‫را‬ ‫هست‬‫ي‬‫م‬‫ي‬‫ا‬ .‫کند‬‫ي‬‫پروس‬ ‫ن‬‫ي‬‫آس‬ ‫جر‬‫ي‬‫ب‬‫پذ‬‫ي‬‫م‬ ‫ر‬‫ي‬:‫باشد‬
content:"|00 00 00 01|"; offset:20; depth:4;
‫اعتبار‬ ‫بسته‬ ‫سپس‬auth_unix‫م‬ ‫چک‬ ‫را‬‫ي‬:‫کند‬
Aidin Naserifard--------------------------------------------------------------------------------------Payload Structure
5
content:"|00 00 00 01|"; offset:24; depth:4;
‫حال‬4‫با‬‫ي‬‫بعد‬ ‫ت‬‫ي‬‫با‬ ‫از‬ ‫و‬ ‫بوده‬ ‫زمان‬‫ي‬‫ت‬36‫شده‬ ‫شروع‬ ‫هاست‬ ‫نام‬ ‫بسته‬ ‫در‬ ‫ام‬‫ها‬ ‫داده‬ ‫و‬‫ي‬‫ز‬ ‫صورت‬ ‫به‬ ‫ان‬‫ي‬:‫است‬ ‫ر‬
00 00 00 0a 4d 45 54 41 53 50 4c 4f 49 54 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00
‫ا‬‫ي‬‫جا‬ ‫تا‬ ‫ها‬ ‫داده‬ ‫ن‬‫يي‬‫با‬ ‫به‬ ‫که‬ ‫است‬ ‫بسته‬ ‫در‬‫ي‬‫ت‬0x40283a14‫ي‬‫عن‬‫ي‬.‫برسد‬ ‫پکتها‬ ‫ارسال‬ ‫زمان‬ ‫شروع‬
‫ن‬ ‫فقط‬ ‫ما‬‫ي‬‫دار‬ ‫از‬‫ي‬‫را‬ ‫هاست‬ ‫نام‬ ‫طول‬ ‫تا‬ ‫م‬‫بدان‬‫ي‬‫لذا‬ .‫م‬4‫با‬‫ي‬‫هاست‬ ‫نام‬ ‫طول‬ ‫به‬ ‫مربوط‬ ‫که‬ ‫ت‬‫م‬‫ي‬‫ن‬ ‫و‬ ‫خوانده‬ ‫را‬ ‫باشد‬‫ي‬‫از‬
‫دار‬ ‫آن‬ ‫عدد‬ ‫به‬‫ي‬.‫م‬‫از‬ ‫لذا‬‫م‬ ‫پرش‬ ‫هاست‬ ‫نام‬‫ي‬‫کن‬‫ي‬‫ن‬ ‫ما‬ .‫م‬‫ي‬‫دستور‬ ‫به‬ ‫از‬‫ي‬‫دار‬‫ي‬‫تا‬ ‫م‬32‫با‬‫ي‬.‫کند‬ ‫کامل‬ ‫را‬ ‫ت‬
Byte_jump:4,36,align;
‫ا‬‫ي‬‫با‬ ‫از‬ ‫دستور‬ ‫ن‬‫ي‬‫ت‬36‫جستجو‬ ‫به‬ ‫شروع‬ ‫بسته‬ ‫در‬ ‫ام‬‫ي‬‫و‬ ‫کرده‬ ‫الگو‬4‫با‬‫ي‬‫ت‬‫م‬ ‫نشان‬ ‫را‬ ‫آن‬ ‫عدد‬ ‫و‬ ‫خوانده‬‫ي‬.‫دهد‬
‫و‬ ‫کرده‬ ‫نگاه‬ ‫را‬ ‫بسته‬ ‫سپس‬8‫درخواست‬4‫با‬‫ي‬‫ت‬‫ي‬‫در‬32‫با‬‫ي‬‫با‬ ‫بسته‬ ‫از‬ ‫ت‬‫ي‬‫لذا‬ .‫باشد‬ ‫د‬‫مابق‬‫ي‬‫م‬ ‫گرد‬ ‫را‬‫ي‬.‫کند‬‫ي‬‫عن‬‫ي‬:
4d 45 54 41 53 50 4c 4f 49 54 00 00
‫حال‬4‫با‬‫ي‬‫بعد‬ ‫ت‬‫ي‬‫کاربر‬ ‫شماره‬ ‫به‬ ‫مربوط‬uid،4‫با‬‫ي‬‫بعد‬ ‫ت‬‫ي‬‫به‬ ‫مربوط‬gid،4‫با‬‫ي‬‫بعد‬ ‫ت‬‫ي‬‫به‬ ‫مربوط‬extra
group id،4‫با‬‫ي‬‫بعد‬ ‫ت‬‫ي‬‫به‬ ‫مربوط‬‫تصد‬‫ي‬‫هو‬ ‫ق‬‫ي‬‫ل‬ ‫ت‬‫ي‬‫نوکس‬‫که‬null‫م‬‫ي‬‫و‬ ‫باشد‬4‫با‬‫ي‬‫بعد‬ ‫ت‬‫ي‬‫طول‬‫نشان‬ ‫را‬ ‫آن‬
‫م‬‫ي‬.‫دهد‬
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00
‫دستور‬‫ي‬‫فقط‬ ‫که‬uid‫کاف‬ ،‫بکند‬ ‫چک‬ ‫را‬‫ي‬:‫است‬
content:"|00 00 00 00|"; within:4;
Aidin Naserifard--------------------------------------------------------------------------------------Payload Structure
6
‫ا‬ ‫تا‬ ‫ما‬ ،‫خوب‬‫ي‬‫ز‬ ‫دستورات‬ ‫نجا‬‫ي‬‫نوشت‬ ‫را‬ ‫ر‬‫ي‬:‫م‬
content:"|00 00 00 00|"; offset:4; depth:4;
content:"|00 01 87 88|"; offset:12; depth:4;
content:"|00 00 00 01|"; offset:20; depth:4;
content:"|00 00 00 01|"; offset:24; depth:4;
byte_jump:4,36,align;
content:"|00 00 00 00|"; within:4;
‫دستو‬‫م‬ ‫لذا‬ .‫هستند‬ ‫محتوا‬ ‫هم‬ ‫چهارم‬ ‫و‬ ‫سوم‬ ‫ر‬‫ي‬‫در‬ ‫را‬ ‫آنها‬ ‫توان‬‫ي‬:‫نوشت‬ ‫دستور‬ ‫ک‬
content:"|00 00 00 00|"; offset:4; depth:4;
content:"|00 01 87 88|"; offset:12; depth:4;
content:"|00 00 00 01 00 00 00 01|"; offset:20; depth:8;
byte_jump:4,36,align;
content:"|00 00 00 00|"; within:4;
‫زمان‬‫ي‬‫که‬IPS‫با‬ ،‫دانست‬ ‫را‬ ‫هاست‬ ‫نام‬ ‫طول‬ ،‫ي‬‫محتوا‬ ‫که‬ ‫بکند‬ ‫چک‬ ‫د‬‫ي‬‫بسته‬‫ا‬‫ي‬‫سمت‬ ‫به‬ ‫که‬sadmind‫فرستاده‬
‫م‬‫ي‬‫مثال‬ ‫از‬ ،‫شود‬200‫با‬‫ي‬‫ب‬ ‫ت‬‫ي‬‫ز‬ ‫دستور‬ ‫لذا‬ .‫نباشد‬ ‫شتر‬‫ي‬‫جا‬ ‫را‬ ‫ر‬‫ي‬‫گز‬‫ي‬‫قبل‬ ‫دستور‬ ‫ر‬‫ي‬‫م‬‫ي‬‫کن‬‫ي‬:‫م‬
byte_test:4,>,200,36;
‫از‬ ‫بسته‬ ‫اگر‬ ‫حال‬200‫با‬‫ي‬‫ب‬ ‫ت‬‫ي‬،‫باشد‬ ‫شتر‬IPS‫از‬action‫تعر‬ ‫واکنش‬ ‫و‬ ‫کرده‬ ‫استفاده‬ ‫ها‬‫ي‬‫م‬ ‫اعمال‬ ‫را‬ ‫شده‬ ‫ف‬‫ي‬.‫کند‬
‫نها‬ ‫در‬‫ي‬،‫ت‬Rule‫اي‬‫م‬ ‫که‬‫ي‬‫توان‬‫ي‬‫بنو‬ ‫م‬‫ي‬‫س‬‫ي‬‫م‬،‫ز‬ ‫شکل‬ ‫به‬‫ي‬:‫است‬ ‫ر‬
Alert tcp any any -> any any (msg:sadmind buffer over flow attempt;
content:"|00 00 00 00|"; offset:4; depth:4;
content:"|00 01 87 88|"; offset:12; depth:4;
content:"|00 00 00 01 00 00 00 01|"; offset:16; depth:8;
byte_test:4,>,200,36;)
‫فرد‬ ‫ناصري‬ ‫آيدين‬ :‫نويسنده‬

Contenu connexe

En vedette

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 

En vedette (20)

Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 

payload structure

  • 2. Aidin Naserifard--------------------------------------------------------------------------------------Payload Structure 2 ‫ساختار‬PAYLOAD‫طر‬ ‫و‬‫ي‬‫نوشتن‬ ‫قه‬Rule‫برا‬ ‫مناسب‬‫ي‬‫جلوگ‬‫ي‬‫ر‬‫ي‬‫سيستم‬ ‫در‬ ‫تهديد‬ ‫از‬‫نفوذ‬ ‫تشخيص‬ ‫هاي‬: ‫کن‬ ‫فرض‬‫ي‬‫پ‬ ‫د‬‫ي‬‫ز‬ ‫لود‬‫ي‬‫به‬ ‫مربوط‬ ،‫ر‬‫ي‬‫حمله‬ ‫ک‬buffer over flow‫که‬ ‫بوده‬‫عل‬ ‫بر‬‫ي‬‫سرو‬ ‫ه‬‫ي‬‫س‬sadmind‫انجام‬ ‫م‬‫ي‬‫گ‬‫ي‬.‫رد‬‫(سرو‬‫ي‬‫س‬sadmind‫پ‬ ‫بصورت‬ ،‫ي‬‫ش‬‫س‬ ‫در‬ ،‫فرض‬‫ي‬‫ستم‬‫ها‬‫ي‬solaris‫ا‬ .‫است‬ ‫نصب‬ ،‫ي‬‫سرو‬ ‫ن‬‫ي‬‫برا‬ ‫س‬‫ي‬ ‫عمل‬ ‫کردن‬ ‫هماهنگ‬‫ي‬‫مد‬ ‫ات‬‫ي‬‫ر‬‫ي‬‫ت‬‫ي‬‫س‬‫ي‬‫ستم‬‫ها‬‫ي‬‫توز‬‫ي‬‫شده‬ ‫ع‬‫دور‬ ‫راه‬ ‫از‬ ،‫م‬ ‫بکار‬‫ي‬).‫رود‬ 89 09 9c e2 00 00 00 00 00 00 00 02 00 01 87 88 ................ 00 00 00 0a 00 00 00 01 00 00 00 01 00 00 00 20 ............... 40 28 3a 10 00 00 00 0a 4d 45 54 41 53 50 4c 4f @(:.....metasplo 49 54 00 00 00 00 00 00 00 00 00 00 00 00 00 00 it.............. 00 00 00 00 00 00 00 00 40 28 3a 14 00 07 45 df ........@(:...e. 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 06 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 04 ................ 7f 00 00 01 00 01 87 88 00 00 00 0a 00 00 00 04 ................ 7f 00 00 01 00 01 87 88 00 00 00 0a 00 00 00 11 ................ 00 00 00 1e 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 3b 4d 45 54 41 53 50 4c 4f .......;metasplo 49 54 00 00 00 00 00 00 00 00 00 00 00 00 00 00 it.............. 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 06 73 79 73 74 65 6d 00 00 ........system.. 00 00 00 15 2e 2e 2f 2e 2e 2f 2e 2e 2f 2e 2e 2f ....../../../../ 2e 2e 2f 62 69 6e 2f 73 68 00 00 00 00 00 04 1e ../bin/sh....... <snip> •‫نوع‬ ‫از‬ ‫اعداد‬unsigned integer 32‫ب‬‫ي‬‫ت‬‫ي‬.‫هستند‬ •‫رد‬ ‫هر‬‫ي‬‫ف‬16‫با‬‫ي‬‫م‬ ‫ت‬‫ي‬.‫باشد‬‫ي‬‫عن‬‫ي‬256‫ب‬‫ي‬.‫ت‬ ‫حال‬32‫با‬‫ي‬‫ت‬‫بررس‬ ‫را‬ ‫اول‬‫ي‬‫م‬‫ي‬‫کن‬‫ي‬:‫م‬ 89 09 9c e2‫شماره‬ :id‫برا‬ ‫بفرد‬ ‫منحصر‬‫ي‬‫درخواست‬ ‫هر‬ 00 00 00 00‫پروتکل‬ ‫نوع‬ :rpc(call=0, response=1) 00 00 00 02‫نسخه‬ :rpc‫که‬2‫م‬‫ي‬.‫باشد‬
  • 3. Aidin Naserifard--------------------------------------------------------------------------------------Payload Structure 3 00 01 87 88:‫شماره‬‫برنامه‬rpc(0x00018788=100232=sadmind) ‫نکته‬1‫هگزادس‬ ‫کد‬ ‫چگونه‬ :‫ي‬‫دس‬ ‫به‬ ‫را‬ ‫مال‬‫ي‬‫تبد‬ ‫مال‬‫ي‬‫کن‬ ‫ل‬‫ي‬‫پا‬ ‫از‬ ‫استفاده‬ ‫با‬ ‫م؟‬‫ي‬:‫تون‬ ‫نکته‬2‫برنامه‬ ‫شماره‬ :‫ها‬‫ي‬rpc‫م‬ ‫را‬‫ي‬‫توان‬‫ي‬‫ل‬ ‫از‬ ‫د‬‫ي‬‫ز‬ ‫نک‬‫ي‬‫نما‬ ‫مشاهده‬ ‫ر‬‫يي‬:‫د‬ -program-numbers/rpc-program-http://www.iana.org/assignments/rpc numbers.xhtml 00 00 00 0a‫برنامه‬ ‫نسخه‬ :RPC(0x0000000a=10) 00 00 00 01‫پروس‬ ‫شماره‬ :‫ي‬‫جر‬rpc 00 00 00 01:‫گواه‬ ‫کد‬‫ي‬‫ل‬‫ي‬‫نوکس‬‫ي‬(1=auth_unix) 00 00 00 20‫د‬ ‫طول‬ :‫ي‬‫تا‬‫ي‬auth_unix(32) ‫حال‬32‫با‬‫ي‬‫ت‬‫بعد‬‫ي‬‫ها‬ ‫داده‬ ‫که‬‫ي‬‫هو‬ ‫احراز‬‫ي‬‫ت‬‫ي‬‫يون‬‫ي‬‫بررس‬ ‫را‬ ‫هستند‬ ‫کس‬‫ي‬‫م‬‫ي‬‫کن‬‫ي‬:‫م‬ 40 28 3a 10:‫زمان‬‫تول‬‫ي‬‫پ‬ ‫د‬‫ي‬‫لود‬(02 / 10 / 04 @ 1:55:28am UTC 0x40283a10=1076378128= ‫توجه‬:timestamp‫م‬ ‫را‬‫ي‬‫سا‬ ‫از‬ ‫توان‬‫ي‬‫ز‬ ‫ت‬‫ي‬:‫آورد‬ ‫بدست‬ ‫ر‬ http://www.unixtimestamp.com/index.php
  • 4. Aidin Naserifard--------------------------------------------------------------------------------------Payload Structure 4 00 00 00 0a‫ماش‬ ‫نام‬ ‫طول‬ :‫ي‬‫کال‬ ‫ن‬‫ي‬‫نت‬(0a=10) 4d 45 54 41 53 50 4c 4f 49 54‫کلمه‬ :METASPLOIT ‫توجه‬‫سا‬ ‫از‬ :‫ي‬‫ز‬ ‫ت‬‫ي‬‫م‬ ‫ر‬‫ي‬‫توان‬‫ي‬‫کد‬ ‫د‬hex‫به‬ ‫را‬string‫تبد‬‫ي‬‫کن‬ ‫ل‬‫ي‬:‫د‬ string.aspx-functions.com/hex-http://www.string 00 00 00 00:uid‫کاربر‬ 00 00 00 00:gid‫کاربر‬ 00 00 00 00:extra group ids 00 00 00 00:‫تا‬ ‫کد‬‫يي‬(‫د‬0=auth_null) :00 00 00 00‫تا‬ ‫کد‬ ‫طول‬‫يي‬‫د‬ ،‫خوب‬‫با‬ ‫ابتدا‬‫ي‬‫بفهم‬ ‫د‬‫ي‬‫حاو‬ ،‫بسته‬ ‫که‬ ‫م‬‫ي‬‫پروتکل‬rpc‫فراخوان‬ ‫و‬ ‫بوده‬‫ي‬‫م‬‫ي‬:‫شود‬ content:"|00 00 00 00|"; offset:4; depth:4; ‫همچن‬‫ي‬‫پروتکل‬ ‫ن‬rpc‫برنامه‬ ،sadmind‫فراخوان‬ ‫را‬‫ي‬:‫کند‬ content:"|00 01 87 88|"; offset:12; depth:4; ‫پروس‬ ‫سپس‬‫ي‬‫جر‬rpc‫که‬1‫فراخوان‬ ‫را‬ ‫هست‬‫ي‬‫م‬‫ي‬‫ا‬ .‫کند‬‫ي‬‫پروس‬ ‫ن‬‫ي‬‫آس‬ ‫جر‬‫ي‬‫ب‬‫پذ‬‫ي‬‫م‬ ‫ر‬‫ي‬:‫باشد‬ content:"|00 00 00 01|"; offset:20; depth:4; ‫اعتبار‬ ‫بسته‬ ‫سپس‬auth_unix‫م‬ ‫چک‬ ‫را‬‫ي‬:‫کند‬
  • 5. Aidin Naserifard--------------------------------------------------------------------------------------Payload Structure 5 content:"|00 00 00 01|"; offset:24; depth:4; ‫حال‬4‫با‬‫ي‬‫بعد‬ ‫ت‬‫ي‬‫با‬ ‫از‬ ‫و‬ ‫بوده‬ ‫زمان‬‫ي‬‫ت‬36‫شده‬ ‫شروع‬ ‫هاست‬ ‫نام‬ ‫بسته‬ ‫در‬ ‫ام‬‫ها‬ ‫داده‬ ‫و‬‫ي‬‫ز‬ ‫صورت‬ ‫به‬ ‫ان‬‫ي‬:‫است‬ ‫ر‬ 00 00 00 0a 4d 45 54 41 53 50 4c 4f 49 54 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ‫ا‬‫ي‬‫جا‬ ‫تا‬ ‫ها‬ ‫داده‬ ‫ن‬‫يي‬‫با‬ ‫به‬ ‫که‬ ‫است‬ ‫بسته‬ ‫در‬‫ي‬‫ت‬0x40283a14‫ي‬‫عن‬‫ي‬.‫برسد‬ ‫پکتها‬ ‫ارسال‬ ‫زمان‬ ‫شروع‬ ‫ن‬ ‫فقط‬ ‫ما‬‫ي‬‫دار‬ ‫از‬‫ي‬‫را‬ ‫هاست‬ ‫نام‬ ‫طول‬ ‫تا‬ ‫م‬‫بدان‬‫ي‬‫لذا‬ .‫م‬4‫با‬‫ي‬‫هاست‬ ‫نام‬ ‫طول‬ ‫به‬ ‫مربوط‬ ‫که‬ ‫ت‬‫م‬‫ي‬‫ن‬ ‫و‬ ‫خوانده‬ ‫را‬ ‫باشد‬‫ي‬‫از‬ ‫دار‬ ‫آن‬ ‫عدد‬ ‫به‬‫ي‬.‫م‬‫از‬ ‫لذا‬‫م‬ ‫پرش‬ ‫هاست‬ ‫نام‬‫ي‬‫کن‬‫ي‬‫ن‬ ‫ما‬ .‫م‬‫ي‬‫دستور‬ ‫به‬ ‫از‬‫ي‬‫دار‬‫ي‬‫تا‬ ‫م‬32‫با‬‫ي‬.‫کند‬ ‫کامل‬ ‫را‬ ‫ت‬ Byte_jump:4,36,align; ‫ا‬‫ي‬‫با‬ ‫از‬ ‫دستور‬ ‫ن‬‫ي‬‫ت‬36‫جستجو‬ ‫به‬ ‫شروع‬ ‫بسته‬ ‫در‬ ‫ام‬‫ي‬‫و‬ ‫کرده‬ ‫الگو‬4‫با‬‫ي‬‫ت‬‫م‬ ‫نشان‬ ‫را‬ ‫آن‬ ‫عدد‬ ‫و‬ ‫خوانده‬‫ي‬.‫دهد‬ ‫و‬ ‫کرده‬ ‫نگاه‬ ‫را‬ ‫بسته‬ ‫سپس‬8‫درخواست‬4‫با‬‫ي‬‫ت‬‫ي‬‫در‬32‫با‬‫ي‬‫با‬ ‫بسته‬ ‫از‬ ‫ت‬‫ي‬‫لذا‬ .‫باشد‬ ‫د‬‫مابق‬‫ي‬‫م‬ ‫گرد‬ ‫را‬‫ي‬.‫کند‬‫ي‬‫عن‬‫ي‬: 4d 45 54 41 53 50 4c 4f 49 54 00 00 ‫حال‬4‫با‬‫ي‬‫بعد‬ ‫ت‬‫ي‬‫کاربر‬ ‫شماره‬ ‫به‬ ‫مربوط‬uid،4‫با‬‫ي‬‫بعد‬ ‫ت‬‫ي‬‫به‬ ‫مربوط‬gid،4‫با‬‫ي‬‫بعد‬ ‫ت‬‫ي‬‫به‬ ‫مربوط‬extra group id،4‫با‬‫ي‬‫بعد‬ ‫ت‬‫ي‬‫به‬ ‫مربوط‬‫تصد‬‫ي‬‫هو‬ ‫ق‬‫ي‬‫ل‬ ‫ت‬‫ي‬‫نوکس‬‫که‬null‫م‬‫ي‬‫و‬ ‫باشد‬4‫با‬‫ي‬‫بعد‬ ‫ت‬‫ي‬‫طول‬‫نشان‬ ‫را‬ ‫آن‬ ‫م‬‫ي‬.‫دهد‬ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ‫دستور‬‫ي‬‫فقط‬ ‫که‬uid‫کاف‬ ،‫بکند‬ ‫چک‬ ‫را‬‫ي‬:‫است‬ content:"|00 00 00 00|"; within:4;
  • 6. Aidin Naserifard--------------------------------------------------------------------------------------Payload Structure 6 ‫ا‬ ‫تا‬ ‫ما‬ ،‫خوب‬‫ي‬‫ز‬ ‫دستورات‬ ‫نجا‬‫ي‬‫نوشت‬ ‫را‬ ‫ر‬‫ي‬:‫م‬ content:"|00 00 00 00|"; offset:4; depth:4; content:"|00 01 87 88|"; offset:12; depth:4; content:"|00 00 00 01|"; offset:20; depth:4; content:"|00 00 00 01|"; offset:24; depth:4; byte_jump:4,36,align; content:"|00 00 00 00|"; within:4; ‫دستو‬‫م‬ ‫لذا‬ .‫هستند‬ ‫محتوا‬ ‫هم‬ ‫چهارم‬ ‫و‬ ‫سوم‬ ‫ر‬‫ي‬‫در‬ ‫را‬ ‫آنها‬ ‫توان‬‫ي‬:‫نوشت‬ ‫دستور‬ ‫ک‬ content:"|00 00 00 00|"; offset:4; depth:4; content:"|00 01 87 88|"; offset:12; depth:4; content:"|00 00 00 01 00 00 00 01|"; offset:20; depth:8; byte_jump:4,36,align; content:"|00 00 00 00|"; within:4; ‫زمان‬‫ي‬‫که‬IPS‫با‬ ،‫دانست‬ ‫را‬ ‫هاست‬ ‫نام‬ ‫طول‬ ،‫ي‬‫محتوا‬ ‫که‬ ‫بکند‬ ‫چک‬ ‫د‬‫ي‬‫بسته‬‫ا‬‫ي‬‫سمت‬ ‫به‬ ‫که‬sadmind‫فرستاده‬ ‫م‬‫ي‬‫مثال‬ ‫از‬ ،‫شود‬200‫با‬‫ي‬‫ب‬ ‫ت‬‫ي‬‫ز‬ ‫دستور‬ ‫لذا‬ .‫نباشد‬ ‫شتر‬‫ي‬‫جا‬ ‫را‬ ‫ر‬‫ي‬‫گز‬‫ي‬‫قبل‬ ‫دستور‬ ‫ر‬‫ي‬‫م‬‫ي‬‫کن‬‫ي‬:‫م‬ byte_test:4,>,200,36; ‫از‬ ‫بسته‬ ‫اگر‬ ‫حال‬200‫با‬‫ي‬‫ب‬ ‫ت‬‫ي‬،‫باشد‬ ‫شتر‬IPS‫از‬action‫تعر‬ ‫واکنش‬ ‫و‬ ‫کرده‬ ‫استفاده‬ ‫ها‬‫ي‬‫م‬ ‫اعمال‬ ‫را‬ ‫شده‬ ‫ف‬‫ي‬.‫کند‬ ‫نها‬ ‫در‬‫ي‬،‫ت‬Rule‫اي‬‫م‬ ‫که‬‫ي‬‫توان‬‫ي‬‫بنو‬ ‫م‬‫ي‬‫س‬‫ي‬‫م‬،‫ز‬ ‫شکل‬ ‫به‬‫ي‬:‫است‬ ‫ر‬ Alert tcp any any -> any any (msg:sadmind buffer over flow attempt; content:"|00 00 00 00|"; offset:4; depth:4; content:"|00 01 87 88|"; offset:12; depth:4; content:"|00 00 00 01 00 00 00 01|"; offset:16; depth:8; byte_test:4,>,200,36;) ‫فرد‬ ‫ناصري‬ ‫آيدين‬ :‫نويسنده‬