
أداة استحواذ على الأدلة الجنائية

تم التجميع والاختبار باستخدام Rust 1.50+. افتح الطرفية في دليل المشروع ولتجميع بناء إصدار اكتب
cargo build --release
يمكن تجميع بناء التصحيح باستخدام
cargo build
الملف التنفيذي المجمّع موجود في target/release/gargamel.exe أو target/debug/gargamel.exe، على التوالي.
إذا كنت ترغب في تغيير مستوى التسجيل:
src/main.rsLevelFilter::Info إلى (مثلاً) LevelFilter::Trace لتسجيل أكثر تفصيلاً.
LevelFilter::Trace سيسجل كل شيء بما في ذلك كلمات المرور.حالياً، يعمل هذا التطبيق فقط على Windows ويجب أن يستخدم الكمبيوتر المستهدف Windows أو Linux.
تأكد من وجود البرامج التالية في نفس الدليل الذي يحتوي على Gargamel.
psexec, تحميلpaexec, بديل مفتوح المصدر لـ PsExec، تحميلwinpmem, أداة صورة ذاكرة مفتوحة المصدر، تحميل.
plink و pscp, عميلا SSH/SCP واجهة سطر أوامر مفتوحا المصدر، تحميلSharpRDP, منفذ أوامر مفتوح المصدر باستخدام RDP، تحميلWMImplant, منفذ أوامر WMI باستخدام PowerShell مفتوح المصدر، تحميل7za.exe, نسخة مستقلة لوحدة التحكم من أداة الضغط 7zip، تحميلملاحظة: نحتاج كلاً من psexec و paexec. على الرغم من أن كلا التطبيقين يفترض أنهما متكافئان وظيفياً إلا أنهما في الواقع يظهران سلوكاً مختلفاً في بعض الظروف.
يجب تشغيل Gargamel من طرفية مرتفعة الصلاحيات ليكون كامل الوظائف. حالياً لا يدعم حوار UAC ولا أي نوع من الإشعارات عند التشغيل بصلاحيات محدودة. عند التشغيل بصلاحيات مستخدم محدودة، فإن بعض العمليات مثل تفريغ ذاكرة الهدف لن تعمل.
افترض أنك تريد الاتصال بجهاز كمبيوتر بالمعاملات التالية:
192.168.42.47Janonbusr123الأمر التالي سيحصل على حالة جدار الحماية، حالة الشبكة، المستخدمين المسجلين، العمليات الجارية، اتصالات الشبكة النشطة، السجل، سجلات أحداث النظام والتطبيق باستخدام طريقة PsExec.
سيتم تخزين الأدلة في الدليل testResults نسبةً إلى موقع Gargamel.
gargamel.exe -c 192.168.42.47 -u Jano --psexec -o testResults
سيطلب منك Gargamel كلمة مرور المستخدم البعيد، في مثالنا كلمة المرور هي nbusr123.
لاحظ أن كلمة المرور ستكون مخفية أثناء الكتابة.
من الممكن أيضاً تحديد كلمة المرور مباشرة كوسيط برنامج.
gargamel.exe -c 192.168.42.47 -u Jano --psexec -p nbusr123 -o testResults
افترض أنك تريد الاتصال بجهاز كمبيوتر في نطاق بالمعاملات التالية:
WORKSPACEJanovPCJanonbusr123الأمر التالي سيحصل على حالة جدار الحماية، حالة الشبكة، المستخدمين المسجلين، العمليات الجارية، اتصالات الشبكة النشطة، السجل، سجلات أحداث النظام والتطبيق باستخدام طريقة PsExec.
gargamel.exe -c JanovPC -u Jano -d WORKSPACE --psexec -o testResults
أو لتجنب طلب كلمة المرور قم بتحديدها مباشرة.
gargamel.exe -c JanovPC -u Jano -d WORKSPACE --psexec -p nbusr123 -o testResults
PsExec هي إحدى طرق الاتصال الخمس المدعومة.
يمكنك استبدال --psexec بالخيارات التالية:
--psexec--psrem, إذا تم تكوين الإدارة عن بعد لـ PowerShell على الجهاز الهدف.--rdp, إذا كان RDP ممكناً على الجهاز الهدف.--wmi.--ssh, إذا كان الجهاز الهدف يستخدم Linux.من الممكن استخدام عدة طرق في نفس الوقت. على سبيل المثال لاستخدام كل من PsExec و RDP يمكن استخدام الأمر التالي.
gargamel.exe -c 192.168.42.47 -u Jano --psexec --rdp -o testResults
هناك أيضاً مفتاح خاص --all يعادل تحديد --psexec --rdp --psrem --wmi.
ملاحظة: معاملات التشغيل غير مرتبة، أي لا يهم الترتيب الذي تُحدد به المعاملات.
للحصول أيضاً على تفريغ الذاكرة، أضف العلامة -m إلى معاملات البرنامج، أي:
gargamel.exe -c 192.168.42.47 -u Jano --psexec -o testResults -m
إذا كنت ترغب في الحصول على تفريغ الذاكرة فقط دون أدلة أخرى فاستخدم الأمر التالي.
gargamel.exe -c 192.168.42.47 -u Jano --psexec -o testResults -m --no-events-search --no-evidence-search --no-registry-search
هذه الوظيفة متاحة فقط لأهداف Windows.
يمكن لـ Gargamel تشغيل أوامر Windows CMD أو Linux shell مخصصة على الجهاز البعيد.
أولاً أنشئ ملفاً باسم custom-commands.txt بالمحتوى التالي.
# Will be run using any method
ipconfig
# Will run only when launching with at least one of --all, --psexec, --wmi methods
:psexec:wmi ipconfig -all
سيتم تخزين نتائج الأوامر أعلاه في الدليل المحدد بواسطة خيار -o.
لتشغيل الأوامر أعلاه المكتوبة في custom-commands.txt استخدم المفتاح -e، أي:
gargamel.exe -c 192.168.42.47 -u Jano --psexec -o testResults -e custom-commands.txt
يمكن لـ Gargamel تنزيل الملفات البعيدة.
أولاً أنشئ ملفاً باسم custom-files.txt بالمحتوى التالي.
C:\Users\Public\sss*
C:\Users\Jano\danove.pdf
# This line and the next one will be ignored
# C:\Users\Jano\somBajecny.pptx
سيتم تخزين نتائج الأوامر أعلاه في الدليل المحدد بواسطة خيار -o.
لتشغيل الأوامر أعلاه المكتوبة في custom-files.txt استخدم المفتاح -s، أي:
gargamel.exe -c 192.168.42.47 -u Jano --psexec -o testResults -s custom-files.txt
جميع المفاتيح المدعومة موصوفة أدناه.
USAGE:
gargamel.exe [FLAGS] [OPTIONS] --user <user>
FLAGS:
-a, --all Acquire evidence from Windows machine using all supported methods (PsExec, PsRemote,
WMI, RDP).
--no-events-search Disables Windows event logs acquisition.
--no-evidence-search Disables acquisition of evidence that can be usually downloaded quickly (like ipconfig,
firewall status etc..)
--no-registry-search Disables target registry acquisition.
-h, --help Prints help information
-m, --mem-image Optional: Memory dump of a target Windows machine.
--local Acquire evidence from local machine.
--nla Optional: Use network level authentication when using RDP. (Windows targets only)
--no-7z Optional: Disable 7zip compression for registry & memory images.This will significantly
decrease the running time, but WMI and RDP connections will probably not work properly.
(Windows targets only)
--psexec Acquire evidence from Windows machine using PsExec. Requires both PsExec64.exe and
paexec.exe in the current directory or in the path.
--psrem Acquire evidence from Windows machine using PowerShell. Requires both PsExec64.exe and
paexec.exe in the current directory or in the path.
--rdp Acquire evidence from Windows machine using RDP. Requires SharpRDP.exe in the current
directory or in the path.
--ssh Acquire evidence from Linux machine using SSH. Requires both plink.exe and pscp.exe in
the current directory or in the path.
-V, --version Prints version information
--wmi Acquire evidence from Windows machine using WMI. Requires WMImplant.ps1 in the current
directory or in the path and PowerShell 3.0+ on the host machine.Note: It is necessary
to disable Windows Defender real-time protection (other AVs not tested).
OPTIONS:
-c, --computer <computer> Remote computer address/name. [default: 127.0.0.1]
-u, --user <user> Remote user name
-d, --domain <domain> Optional: Remote Windows domain
-o, --output <local-store-directory>
Name of local directory to store the evidence [default: evidence-output]
-p, --password <password>
Optional: Remote user password. Skipping this option will prompt a possibility to put a password in hidden
way.To specify an empty password use `-p ""`
--redownload <re-download>
Optional: Download and DELETE specified file from target computer. Use this in case of previous failed
partially completed operation. For just downloading a file (without deleting it) please use a `search`
switch. If you specify a 7zip chunk (.7z.[chunk-number], e.g. .7z.004), then it will also automatically try to
download subsequent chunks.Use also with --psexec --psrem, --rdp, --wmi, --all
-r, --remote-storage <remote-store-directory>
Name of remote directory to be used as a temporary storage. (Windows targets only) [default:
C:\Users\Public]
-e, --commands <custom-command-path> Optional: File with custom commands to execute on remote computer
-s, --search <search-files-path>
Optional: File with files names to be searched on remote computer. File names supports also `*` and `?`
wildcards on file names (but not yet parent directories).
--key <ssh-key> Optional: Name/path of SSH private key file. (Linux target only)
--timeout <timeout>
Optional: Timeout in seconds for long running operations.This option is a workaround for a bug in
WMImplant.ps1 amd SharpRDP.exe where finishing of a long running operation cannot sometimes properly close
the connection leaving the Gargamel in seemingly frozen state or executing the next operation with the
previous one unfinished on target site.Increasing this timeout may solve issues when acquiring registry or
memory image from target machine. [default: 300]
_ في مساره/اسمه.حقوق النشر (C) 2020 LIFARS LLC
جميع الحقوق محفوظة