GLITCH
  • Who Am I ?
  • WRITEUPS
    • CyberDefenders Labs
      • PhishStrike Write-up
      • OpenWire Write-up
      • BlueSky Ransomware Write-up
      • PsExec Hunt Write-up
      • Red Stealer Write-up
      • Amadey Write-up
      • GrabThePhisher Write-up
      • BlackEnergy Write-up
  • SUMMARIEs
    • Phishing
    • Kerberos_AD
    • Bug Hunting
    • MITRE
  • OSEP
  • GLITCH HUB
    • Books
    • Courses
      • Youtube
    • Githubs
    • Tools
    • Bookmarks
  • Projects
    • Youtube Downloader
  • Malware Analysis
    • SOON!
Powered by GitBook
On this page
  • 1 - How Does Email Work? (A)
  • 2 - Mail Headers (A)
  • 3 - Phishing Types (A)
  • 4 - How To Analyze Emails (A)
  • 5 - Reference (A)
  • English Version
  • 1 - How Does Email Work? (E)
  • 2 - Mail Headers (E)
  • 3 - Phishing Types (E)
  • 4 - How To Analyze Emails (E)
  • 5 - Reference (E)
  1. SUMMARIEs

Phishing

السلام عليكم

بقالي كتير منزلتش شرح لي حاجه ف حبيت انهارده اكلمكم علي كام نقطه مهما لاي حد في التراكين ف يلا بسم الله

إن أحسنت فمن الله، وإن أسأت فمن نفسي والشيطان

For English Version Scroll Down ')

  1. How Does Email Work

  2. Mail Headers

  3. Phishing Types

  4. How To Analyze Emails

  5. Reference


1 - How Does Email Work? (A)

البريد الإلكتروني بيعدي بمراحل كتير من أول ما تكتب الرسالة لحد ما توصل للشخص التاني، وكل مرحلة ليها دور معين.

  1. MUA (Mail User Agent):

بتبدأ تكتب الرسالة في البرنامج زي Gmail أو Outlook، وده بيبقى الـ MUA. لما بتضغط "إرسال/send"، الرسالة بتروح للمرحلة اللي بعدها.

  1. MSA (Mail Submission Agent)

الرسالة بتروح للـ MSA اللي بيستقبلها من جهازك باستخدام بروتوكول SMTP، وده بيشيك على البيانات ويتأكد إنها صح قبل ما يبعتها للسيرفرات اللي بعدها.

  1. MTA (Mail Transfer Agent):

بعد كده، الرسالة بتتنقل من خلال الـ MTA، وده المسؤول عن نقل الرسالة بين السيرفرات لحد ما توصل لسيرفر الشخص المستلم.

  1. MDA (Mail Delivery Agent):

لما الرسالة توصل لسيرفر المستلم، الـ MDA بيحطها في "صندوق البريد/Mail box" الخاص بالمستلم، وبتبقى جاهزة إنه يشوفها.

  1. (IMAP/POP3)

لما المستلم يفتح بريده، بيستخدم بروتوكول IMAP أو POP3 عشان يحمل الرسالة:

  • IMAP: بيخلي نسخة من الرسالة على السيرفر، عشان يقدر يفتحها من أي جهاز.

  • POP3: بينقل الرسالة لجهاز واحد ويمسحها من السيرفر.

  1. SMTP Relay

أثناء تنقل الرسالة بين السيرفرات، بيحصل حاجه اسمه SMTP Relay، وده اللي بيساعد الرسالة توصل لسيرفر المستلم.

يبقا احنا كدا اتكلمنا علي:

  • MUA: البرنامج اللي المرسل بيستخدمه عشان يبعت الرسالة.

  • MSA: بيستلم الرسالة من المستخدم ويشيك عليها.

  • MTA: بيقوم بنقل الرسالة بين السيرفرات لحد ما توصل للجهة المطلوبة.

  • MDA: بيقوم بتسليم الرسالة لصندوق بريد المستلم.

  • IMAP و POP3: بروتوكولات بيستخدمها المستلم عشان يحمل الرسالة.المستلم.


2 - Mail Headers (A)

الـ Mail Headers هي عبارة عن مجموعة من البيانات أو المعلومات بتبقى موجودة في خلفية الرسالة، وبتحتوي على تفاصيل عن الرسالة زي مين اللي بعتها، عنوان الـ IP اللي اتبعتت منه، وتوقيت الإرسال. الحاجات دي بتساعدك تتأكد من مصدر الرسالة وهل هي أصلية ولا لا

أهم الـ Headers اللي تركز عليها:

Received:

ده بيوضح كل السيرفرات اللي الرسالة عدت عليها قبل ما توصلك. لو لقيت الـ IP بتاع السيرفر الأول مختلف عن اللي متوقعه من الجهة اللي بعتالك، يبقى فيه احتمال إنها رسالة مزيفة.

From و Return-Path:

دول بيوضحوا لك مين اللي بعت الرسالة. ساعات المهاجمين بيحاولوا يغيروا "الاسم" عشان يبقى باين إنه من جهة موثوقة، لكن من الـ Return-Path تقدر تعرف العنوان الحقيقي اللي اتبعتت منه الرسالة.

Reply-To:

ده العنوان اللي هترد عليه لو رديت على الرسالة. ساعات بيحطوا عنوان وهمي في الـ From، لكن الـ Reply-To بيكون العنوان الحقيقي بتاع المهاجم.

Message-ID:

كل رسالة ليها ID مميز، وده بيتم إنشاؤه في السيرفر الأصلي. لو لقيت إن الـ Message-ID مش متوافق مع دومين الجهة المرسلة، يبقى ده مؤشر إن الرسالة مش أصلية.

SPF, DKIM و DMARC:

دي بروتوكولات أمان بتساعد إنك تتأكد من إن الرسالة فعلاً جاية من الدومين بتاع الجهة المرسلة. لو الرسالة مش متوافقة مع البروتوكولات دي، ممكن تكون رسالة تصيد. (هسبلك مصادر عشان تتعمق في ال3 بروتوكولات دول اكتر)

بلي انا شرحتهولك فوق ده هتبقا فاهم الي جي.


3 - Phishing Types (A)

إيه هو التصيد الإلكتروني (Phishing)؟

الPhishing هو نوع من الهجمات اللي فيها المهاجم بيحاول يخدع الضحية عشان ياخد منه معلومات حساسة زي الباسورد أو بيانات البنك. الفكرة إن المهاجم بيعمل نفسه جهة موثوقة زي بنك أو شركة كبيرة، عشان الضحية يصدق ويديله المعلومات.

أنواع التصيد الإلكتروني

Phishing:

ده النوع التقليدي، فيه المهاجم بيبعت رسالة لعدد كبير من الناس ويجرب حظه، الرسالة بتبقى عامة زي "حسابك فيه مشكلة، دخل بياناتك عشان نحلها."

Spear Phishing:

هنا المهاجم بيكون مركز على شخص معين أو شركة معينة، وبيدرس المستهدف كويس عشان الرسالة تبان شخصية أكتر، زي رسالة من "المدير" تطلب معلومات حساسة.

Whaling:

النوع ده موجه لأشخاص في مناصب عالية زي المديرين والرؤساء التنفيذيين، والهجوم بيبقى متقن أكتر عشان يقنعهم يشاركوا معلومات مهمة.

Vishing:

ده بيتم من خلال مكالمات، والمهاجم بيعمل نفسه موظف في بنك أو شركة، ويطلب من الضحية بياناته بحجة إن في "مشكلة" في حسابه.

Smishing:

هنا الهجوم بيجي عن طريق رسائل على الموبايل، زي رسالة تقولك "كسبت جائزة، اضغط هنا ودخل بياناتك" والرابط ده غالبًا بيبقى موقع مزيف.


4 - How To Analyze Emails (A)

احتارت ازاي اشرح الجزء ده بس لقيت ان الشرح العملي افيد شئ ف علي بركه الله

من فتره نزلت writeup لي Challenge علي cyberdefenders باسم PhishStrike فكره الChallenge ان معايا Phishing mail بحاول اعملو analysis عشان اطلع اي IOCs تبع الthreat actor

التولز الي بستخدمها في الحواار ده كالاتي

phishtool.com = رقم واحد

toolbox.googleapps.com

arin.net

المهم بعد محملت الفايل من الموقع و حطيتو علي phishtool.com

من الي ظاهر ان الميل عباره عن عمليه دفع حصلت و بيستدرج الموظفين عشان يحملو الفاتوره االي هيا طبعا malicious file

نرجع للChallenge طالب مني اول سوال اني اعرف الip بتاع الشخص االي بعتلي الميل

وده ممكن اجيبو بكذا طريقه منهم انك تبص علي ال SPF & DKIM Values

لو جيت مثلا فتحت ال error result بتاع SPF هتلاقيه بيقلك ان ال ip ده 18.208.22.104 مش مسمحلو انو يرسل ايميلات عن طريق الدومين ده uptc.edu.co (هنا بتيجي فايديت البروتوكولات دي)

السوال التاني عايز يعرف اي الReturn-Path الي موجود في الميل وده هتشوفو ف التاب بتاعت الheader

بعد كدا طالب منك تعرف ال ip ألي مرفوع عليه ال malicious file ده هتلاقيه في التابه بتاعت message URLs

فانت كدا قدرت تجمع ال IP بتاع الاتكر و الميل الي بعتلك منو و كمان ال IP الي احتمال يبقا الC2 Server بتاعو

بس انا حبيت اوريك مثال بسيط جدا عشان تبقا فاهم انا كنت بتكلم في اي و هسبلك في ال Reference شويت مقالات و challenges تحلها عشان الموضوع يثبت معاك اكتر


5 - Reference (A)



English Version

1 - How Does Email Work? (E)

An email goes through several stages from when you write it to when it arrives in the other person’s inbox. Each stage has a specific role.

  • MUA (Mail User Agent): You start by writing the email in an app like Gmail or Outlook—this is your MUA. When you hit "Send," the email moves to the next stage.

  • MSA (Mail Submission Agent): The email is then sent to the MSA, which takes it from your device using the SMTP protocol, checks the data, and makes sure it's all good before passing it on to other servers.

  • MTA (Mail Transfer Agent): The MTA then transfers the email from server to server until it reaches the recipient’s server.

  • MDA (Mail Delivery Agent): When the email reaches the recipient's server, the MDA places it in their mailbox, ready for them to view.

  • IMAP/POP3: When the recipient opens their inbox, they use IMAP or POP3 to download the email:

    • IMAP: Keeps a copy on the server, so they can access it from any device.

    • POP3: Moves the email to one device and deletes it from the server.

  • SMTP Relay: As the email moves between servers, it uses SMTP Relay, which helps it reach the recipient’s server.

So, to break it down:

  • MUA: The app the sender uses to write and send the email.

  • MSA: Receives the email from the sender and checks it.

  • MTA: Transfers the email between servers to its final destination.

  • MDA: Delivers the email to the recipient's inbox.

  • IMAP/POP3: Protocols the recipient uses to download the email.


2 - Mail Headers (E)

Mail Headers are data hidden in the email that contain information about the email, like who sent it, the IP it was sent from, and the sending time. These help you verify the email's origin and authenticity.

Key Headers to Focus On:

  • Received: This shows all the servers the email went through before reaching you. If the IP of the first server is different from what you'd expect from the sender, it might be a fake email.

  • From and Return-Path: These tell you who sent the email. Attackers often change the "name" to look like it's from a trusted source, but the Return-Path reveals the real address it came from.

  • Reply-To: This is where your reply will go if you respond. Sometimes they put a fake address in the From field, but the real attacker's address is in the Reply-To.

  • Message-ID: Every email has a unique ID created by the original server. If the Message-ID doesn’t match the sender’s domain, that’s a sign the email isn’t legit.

  • SPF, DKIM, and DMARC: These are security protocols that help confirm that the email is genuinely from the sender’s domain. If the email doesn’t pass these, it could be a phishing attempt. (I’ll include resources for more details on these protocols.)


3 - Phishing Types (E)

What is Phishing?

Phishing is a type of attack where the attacker tricks the victim into sharing sensitive information, like passwords or bank details, by pretending to be a trusted source like a bank or big company.

Types of Phishing Attacks:

  • Phishing: The classic type. The attacker sends a general email to many people, hoping someone will fall for it. Messages usually say something like, “There’s an issue with your account. Enter your details so we can fix it.”

  • Spear Phishing: Here, the attacker targets a specific person or company, studying them to make the email feel personal, like a message from a “manager” asking for sensitive information.

  • Whaling: This targets high-level people, like executives, with a well-crafted message to make them share important info.

  • Vishing: Phishing through calls. The attacker pretends to be from a bank or company, asking for details, saying there's an “issue” with the account.

  • Smishing: Phishing via SMS. The attacker sends a text saying something like “You won a prize, click here to claim it,” leading to a fake site.


4 - How To Analyze Emails (E)

I thought practical examples would help explain this best, so here we go!

Tools I Use in This Process:

  • phishtool.com: My go-to tool for phishing analysis.

  • toolbox.googleapps.com

  • arin.net

After downloading the file from the challenge and uploading it to phishtool.com, it turned out to be a payment scam trying to trick employees into downloading a “invoice” (obviously a malicious file).

In the challenge, the first question asked was how to find the IP address of the person who sent the email. There are a few ways to do this, like checking the SPF and DKIM values.

For instance, if you look at the SPF error result, you'll see that IP address 18.208.22.104 wasn’t authorized to send emails on behalf of the domain uptc.edu.co (this is where these protocols come in handy).

The second question asked for the Return-Path in the email, which you can find in the header tab.

Then, they wanted the IP where the malicious file is hosted. You’ll see this in the message URLs tab.

So, from here, you can gather the attacker’s IP, the email they used, and even the IP that might be their C2 (Command & Control) server.


5 - Reference (E)

PreviousBlackEnergy Write-upNextKerberos_AD

Last updated 6 months ago

وده الينك حجو

تقدر تكمل للChallenge مع نفسك بقا من هنا

A while ago, I published a writeup for a challenge on CyberDefenders called "PhishStrike." The challenge was to analyze a phishing email and find Indicators of Compromise (IOCs) linked to the threat actor. You can check out the writeup here: .

You can continue with the rest of the challenge here: . I just wanted to give a simple example to help you follow along. I’ll also leave a few articles and challenges in the references so you can practice more!

https://g1it0h.gitbook.io/glitch/writeups/cyberdefenders-labs/phishstrike-write-up
https://cyberdefenders.org/blueteam-ctf-challenges/phishstrike/
https://cyberdefenders.org/blueteam-ctf-challenges/
https://g1it0h.gitbook.io/glitch/writeups/cyberdefenders-labs/phishstrike-write-up
https://www.fortinet.com/resources/cyberglossary/phishing-email-analysis#:~:text=You%20can%20spot%20a%20phishing,sensitive%20information%2C%20and%20suspicious%20attachments.
https://mailtrap.io/blog/spf-records-explained
https://mailtrap.io/blog/dkim/
PhishStrike Challenge Writeup
PhishStrike CTF
https://cyberdefenders.org/blueteam-ctf-challenges/
https://g1it0h.gitbook.io/glitch/writeups/cyberdefenders-labs/phishstrike-write-up
https://www.fortinet.com/resources/cyberglossary/phishing-email-analysis#:~:text=You%20can%20spot%20a%20phishing,sensitive%20information%2C%20and%20suspicious%20attachments.
https://mailtrap.io/blog/spf-records-explained
https://mailtrap.io/blog/dkim/
Page cover image