# Root Android Emulator - Cài Burp Suite CA để intercept HTTPS

Root Android Emulator và cài Burp Suite CA để intercept HTTPS — hướng dẫn chi tiết cho Android 12+, bao gồm AVD, root, cài chứng chỉ hệ thống và khắc phục lỗi.

## Tải rootAVD về máy

`git clone https://gitlab.com/newbit/rootAVD.git` hoặc tải nhanh tại đây [rootAVD](https://gitlab.com/newbit/rootAVD/-/archive/master/rootAVD-master.zip)

## Tạo 1 máy ảo Android

Mở `Virtual Device Manager` lên

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1759310002821/240a2ffe-d8b6-4bd7-9c78-4734441f7f63.png align="center")

Tạo 1 máy ảo Android (ở đây tôi sẽ dùng Pixel 4)

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1759310057334/226beb74-944c-4065-b1b3-bbb16b54070c.png align="center")

Chọn phiên bản Android (tôi sẽ dùng phiên bản Android 12.0 - API 31)

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1759310096243/5a86032e-07f2-4653-aa15-19d1819eae04.png align="center")

Chạy máy ảo vừa tạo lên

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1759310134610/4c86bf19-4ade-42ea-bcd2-9c6a97f96b8d.png align="center")

## Root máy ảo

Truy cập vào thư mục chứa `rootAVD` vừa tải về

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1759310260520/49901e3c-b746-4f60-a572-c4e9f1a9593a.png align="center")

Sau đó mở `CMD` lên, gõ lệnh `rootAVD.bat ListAllAVDs`

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1759310484252/af4b8293-c032-4c63-a60a-4212540e8e4e.png align="center")

Chạy lệnh `rootAVD.bat system-images\android-31\google_apis_playstore\x86_64\ramdisk.img` để root AVD

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1759310594966/94076f91-ba04-4eda-970b-e8f915d75f7d.png align="center")

Chờ tới khi root thành công

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1759310826955/b3b259b9-0f32-4e20-948b-264e9ea42084.png align="center")

Chạy lại Android với `Cold Boot`

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1759310868868/2bde8c6c-bc2a-4977-b389-55ef75f92079.png align="center")

Kiểm tra nếu có ứng dụng `Magisk` là thành công

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1759310995207/469e1051-72e3-45d6-93f4-199764e39582.png align="center")

Vào `Settings` bật `Zygisk` nếu chưa được bật

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1759311065827/043f52c3-c8d8-4290-9dc3-c20bb2a50c23.png align="center")

Sau đó `reboot` lại để cấu hình được cập nhật

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1759311140379/bd649443-ec61-4c62-98c3-c9973d5e5fd4.png align="center")

Bật `Zygisk` thành công

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1759311384716/746c273e-ac27-48b2-b8e3-1ef3ec9a47ea.png align="center")

## Cài Burp Suite CA để intercept HTTPS

Tải Burp Suite CA về máy, mở Burp Suite Browser lên và nhập URL `http://burp`. Bấm vào `CA Certificate` để tải cert về máy

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1759311631715/d24bde5c-f9c2-413e-b7a7-3c9558f4ac1c.png align="center")

Tiếp theo tải `AlwaysTrustUserCerts` tại đường dẫn `https://github.com/NVISOsecurity/AlwaysTrustUserCerts/releases/latest`.

Ở đây tôi sẽ dùng phiên bản `AlwaysTrustUserCerts_v1.3`

Đẩy file lên máy ảo android bằng lệnh sau:

```bash
adb push cacert.der /sdcard
```

```bash
adb push AlwaysTrustUserCerts_v1.3.zip /sdcard
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1759312053513/7faa3cdb-b418-490b-99bc-0b10adfc1e23.png align="center")

Để cài đặt CA Certificate ta cần vào cài đặt như sau: `Settings → Security → Encryption & credentials → Install a certificate → chọn CA Certificate`

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1759313130948/cc087732-5fc7-4d2d-aafc-1bac70d5bb00.png align="center")

Để kiểm tra cài cert thành công hay không ta vào: `Settings → Security → Encryption & credentials → Trusted credentials → chọn tab User`

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1759313335353/fa973eda-7501-4f67-ad5c-c7b54513f84e.png align="center")

Đã cài đặt cert thành công, nhưng mục tiêu là cần đẩy cái cert này sang bên System để có thể nhiều quyền hơn.

Ta cài đặt module `AlwaysTrustUserCerts` vào app `Magisk` → chọn tab Modules (dưới cùng tay phải)

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1759313449586/6b27f75e-cb27-4ceb-9196-ca653006c70c.png align="center")

Chọn file `AlwaysTrustUserCerts_v1.3.zip`

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1759313468478/13ab7834-3807-4d6d-a335-344ca45901e4.png align="center")

Sau khi cài đặt thành công thì bấm `Reboot` ở dưới

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1759313528781/01ce32bc-4538-458c-9412-aed0c04cbc16.png align="center")

Kiểm tra lại module đã hiện lên chưa

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1759313581635/d661ef9e-f21c-42c8-b48a-a4e54186e98d.png align="center")

Kiểm tra cert đã sang bên System chưa, ta vào: `Settings → Security → Encryption & credentials → Trusted credentials → chọn tab System → kéo xuống tìm PortSwigger`

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1759313748303/e6e42768-30ee-4dd9-958e-659d59e590ab.png align="center")

Như vậy ta đã cài thành công cert ^^

## Cấu hình proxy Burp Suite

Để kiểm tra xem Burp Suite đã bắt được request thành công chưa, ta cấu hình proxy như sau

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1759319262695/eed20c3c-ed2b-4101-8ec4-db08488612a7.png align="center")

Sau đó, mở trình duyệt và kiểm tra request

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1759319664903/450ab9ae-13c7-4d3a-8ac4-562d8ae21959.png align="center")

Bắt request thành công ^^  
Tuy nhiên 1 số ứng dụng sẽ áp dụng thêm 1 số cách để ngăn chặn bắt request nên ta sẽ phải sử dụng các tools như: `Frida`, `Objection`, …  

## Nội dung tham khảo

Nội dung bài viết này được mình tìm hiểu, dịch, tham khảo, đúc kết và tổng hợp lại từ nhiều nguồn. Mọi người có thể xem thêm các bài viết sau:

* [Root Android 12.0 API Level 31 and add BurpSuite CA Certificate](https://hackmd.io/@antoinenguyen09/SJEFPs9Fh)

* [How to Root Android Phone & Install AlwaysTrustUserCert.zip Module?](https://hackmd.io/nAJIgt13TjSZ5nqLR4-BiQ)

* [Làm quen cùng pentest Android 😎](https://hackmd.io/@janlele91/BJ20xGWFn)
