Skip to content

Instantly share code, notes, and snippets.

@tuankiet65
Last active December 19, 2018 13:34
Show Gist options
  • Save tuankiet65/4ff394402156374c4cab20c48c17f60a to your computer and use it in GitHub Desktop.
Save tuankiet65/4ff394402156374c4cab20c48c17f60a to your computer and use it in GitHub Desktop.
* Bị obfuscated, có thể dùng de4dot (https://github.com/0xd4d/de4dot) để deobfuscate
* Dùng ILSpy để decompile, hoặc dnSpy để decompile + sửa code để null
* Entry point: ns0.Class4.Main
* Khởi tạo TestMetro.Form1
* TestMetro.Form1..ctor
* Gọi InitializeComponent(): khởi tạo các UI element
* Tạo ns1.MouseHook, on mouse action gọi TestMetro.Form1.method_12
* Load Form1 (implied)
* TestMetro.Form1.Form1_Load:
* Tắt task manager
* Phát hiện NPF (packet capture service của WinPcap), nếu có sẽ cảnh báo và tắt
* Giải pháp: dùng Wireshark + Npcap (https://nmap.org/npcap/)
* Phát hiện máy ảo:
* Chạy `systeminfo`, extract những field có từ khóa "System"
* Match giá trị với các keyword ["VIRTUAL", "Virtual", "VMware"]
* Báo lỗi và thoát nếu phát hiện
* Giải pháp:
* Dùng VM khác như Parallel, KVM (Linux)
* Tìm cách để đổi lại (possible, Google)
* Kiểm tra phiên bản hệ điều hành
* Chỉ cho chạy trên Windows 7, 8, 10
* Chạy `netsh advfirewall reset` (?)
* Kết nối tới một SQL Server ở 10.9.9.12
* Password: 123@123aAAsynchronousPocessing=True
* User ID: FPTDN
* Data Source: 10.9.9.12
* Initial Catalog: ExamClient
* Lấy data từ SQL Server kể trên:
* SQL command: exec SP_SelectExamConfig;
* Dùng Stored Procedure
* Dữ liệu trả về (ở dưới)
* Kiểm tra version, nếu quá cũ => báo lỗi
* InitBrowser(): Khởi tạo CEF
* Tắt kiểm tra cert hợp lệ
* Khi LoadStateChanged: gọi TestMetro.Form1.method_3
* Khi FrameLoadStart: gọi TestMetro.Form1.method_1
* Khi FrameLoadEnd: gọi TestMetro.Form1.method_2
* Khi LoadError: gọi TestMetro.Form1.method_4
* Khi AddressChanged: gọi TestMetro.Form1.method_5
* Address = địa chỉ lấy ở bước trên
* FirewallBlock(): Chặn hết mọi thứ (trừ browser) ?
* Tạo background thread cho TestMetro.Form1+Class2.method_0
* Check firewall ngầm liên tục mỗi 4 giây
* Tạo background thread cho TestMetro.Form1+Class2.method_1
* Check bắt gói ngầm liên tục mỗi 7 giây
* Tạo background thread cho TestMetro.Form1+Class2.method_2
* Check tình trạng mạng Internet mỗi 5/10 giây
* Check như thế nào?
* Tạo background thread cho TestMetro.Form1+Class2.method_3
* Check có kết nối đúng mạng wifi FPT hay không
* Tên lấy từ SQL Server trên
* Tạo background thread cho TestMetro.Form1+Class2.method_3
* Kill mọi cửa sổ FPT Exam khác (chỉ được có 1 FPT Exam được bật)
* Nếu IP của máy nằm trong khoảng 10.82.0.0/16
* Đúng: lblinfoIPMac.Visible = true
* 10.82.0.0/16: có thể là IP range của giáo viên
* lblinfoMac: Một Label
* Label được hiện khi ở sai mạng (tên mạng được get ở SQL database ở trên)
* Hook vào keyboard để chặn các phím không cho phép?
* SetWindowDisplayAffinity(handle, WDM_DISPLAY)
* https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-setwindowdisplayaffinity
* Không cho phép print screen và các thứ khác
* Hiển thị cờ
* SQL command: "exec SP_DMY;"
* Get ngày tháng năm từ SQL Server
* Format ở phía dưới
* Flag được lưu trong TestMetro.Form1.string_4, PNG, base64 encoded, có 10 cờ khác nhau
* Flag được hiển thị = TestMetro.Form1.string_4[(<ngày hiện tại> + <tháng hiện tại>) % 10]
* Tạo background thread cho @class.method_4
* ?
TestMetro.Form1.method_1:
* Hiện loading screen?
TestMetro.Form1.method_2:
* Ẩn loading screen?
TestMetro.Form1.method_3:
* ?
TestMetro.Form1.method_4:
* Xuất lỗi khi bị lỗi lúc load trang
TestMetro.Form1.method_5:
* Lấy username từ address (dưới dạng GET param)
* Hiện username ra interface
* Nếu username chứa chuỗi "phatdt" thì load trang báo lỗi trong CEF
Trang thi:
* Hình như default là https://exam2.fud.edu.vn
* HTTPS nhưng cert không hợp lệ và CEF bỏ qua cert validation => MITM?
* Domain trên chỉ resolve được khi dùng DNS server của FPT, không resolve với public DNS
* Resolve về IP nội bộ dựa trên cơ sở
* Hình như phải kèm parameter examcode mới truy cập được ?? :D ??
* https://exam2.fud.edu.vn/login/index.php?examcode=a23eab67167c0 (thay đổi liên tục)
Dữ liệu trả về ví dụ của SP_SelectExamConfig:
ID,Content,Description,STT,Type,Status,IPCreate,CreateDate,IPUpdate,UpdateDate,
1,10,Octect 1,1,1,1,<local machine>,04/11/2015 02:13:22 PM,,04/11/2015 02:13:22 PM
2,12,Octect 2,2,1,1,<local machine>,04/11/2015 02:13:41 PM,,04/11/2015 02:13:41 PM
3,http://exam.fus.edu.vn/login/index.php,Login,3,2,1,<local machine>,04/11/2015 02:14:34 PM,,04/11/2015 02:14:34 PM
4,http://exam.fus.edu.vn,Home,4,2,1,<local machine>,04/11/2015 02:15:15 PM,,04/11/2015 02:15:15 PM
5,http://exam.fus.edu.vn/login/show.php,Login Wrong,5,2,1,<local machine>,04/11/2015 02:17:08 PM,,04/11/2015 02:17:08 PM
6,SSID,SSID,6,3,1,<local machine>,04/11/2015 02:17:51 PM,,04/11/2015 02:17:51 PM
7,FPT_University,FPT_University,7,3,1,<local machine>,04/11/2015 02:18:20 PM,,04/11/2015 02:18:20 PM
8,10.9.,GetHostentry,8,3,1,<local machine>,04/11/2015 02:18:43 PM,,04/11/2015 02:18:43 PM
9,exam2.fud.edu.vn,IPSocket,9,24,1,<local machine>,04/11/2015 02:20:46 PM,,04/11/2015 02:20:46 PM
10,10.82.3.20,IPDNS,10,24,1,<local machine>,04/11/2015 02:21:25 PM,,04/11/2015 02:21:25 PM
11,18302,Port,11,22,1,<local machine>,04/11/2015 02:21:59 PM,,04/11/2015 02:21:59 PM
12,http://ems.fus.edu.vn/login/index.php?examcode=EXAM@201@81!2,EXAM@303@83!3,12,20,1,<local machine>,04/11/2015 02:23:46 PM,,04/11/2015 02:23:46 PM
13,https://exam2.fud.edu.vn/login/index.php?examcode=a23eab67167c0,a23eab67167c0,13,13,1,<local machine>,04/11/2015 02:31:15 PM,,04/11/2015 02:31:15 PM
14,Yellow,Color,14,14,1,<local machine>,04/11/2015 02:37:03 PM,,04/11/2015 02:37:03 PM
15,Red,Color,15,14,1,<local machine>,04/11/2015 02:37:41 PM,,04/11/2015 02:37:41 PM
16,false,chkUser,16,15,1,<local machine>,05/11/2015 11:41:33 AM,,05/11/2015 11:41:33 AM
17,false,chkComputerName,17,15,1,<local machine>,05/11/2015 11:41:43 AM,,05/11/2015 11:41:43 AM
18,true,chkAllowKill,18,15,1,<local machine>,05/11/2015 11:41:51 AM,,05/11/2015 11:41:51 AM
19,false,TopMost,19,15,1,<local machine>,05/11/2015 11:42:01 AM,,05/11/2015 11:42:01 AM
20,True,Virtual,20,15,1,<local machine>,05/11/2015 11:42:19 AM,,05/11/2015 11:42:19 AM
21,20,Language,21,15,1,<local machine>,02/08/2017 09:19:43 AM,,02/08/2017 09:19:43 AM
22,true,Move,22,15,1,<local machine>,02/03/2018 08:37:52 AM,,02/03/2018 08:37:52 AM
"{{ID 1}}.{{ID 2}}": IP subnet của thí sinh
"{{ID 9}}": Domain trang thi. Dùng trong Form1.Checklive
"{{ID 8}}": Subnet của trang thi. Dùng trong Form1.Checklive
"{{ID 13}}": Trang thi
"{{ID 7}}": SSID đúng của thí sinh. Dùng trong Form1.GetSSID
"{{ID 12, cột Description}}": Version mà server thi yêu cầu
"{{ID 20}}": có vai trò gì đó trong Form1.gHook_KeyDown
"{{ID 19}}": Giá trị để gán cho base.TopMost (TopMost?)
"{{ID 22}}": Flag có cảnh báo khi Form1 bị di chuyển vị trí hay không
"{{ID 17}}": Vai trò gì đó trong Form1.method_5
"{{ID 18}}" Có cho phép kill mọi process dám foreground trước FPT Exam hay không
Dữ liệu trả về của SP_DMY:
19,11,2018
Định dạng: DD,MM,YYYY
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment