[Android] Nox와 burp suite 연동
[Nox 안드로이드 7버전을 기준으로 작성되었습니다.]
burp suite
burp suite는 MITM(Man In The Middle: 중간자 공격)의 원리를 이용해 클라이언트와 서버가 통신하는 요청, 응답을 분석할 수 있습니다.
네트워크 동작을 동적으로 분석하여 취약점을 찾을 수 있습니다.
Nox
안드로이드 앱을 PC 환경에서 실행할 수 있게 해주는 애뮬레이터입니다.
openssl
openssl은 데이터 통신을 위한 TSL, SSL같은 암호화를 이용할 수 있게 해주는 오픈소스라이브러리 입니다.
0. burp suite, Nox, openssl 설치하기
해당 사이트에서 무료버전인 community edition을 설치해주시면 됩니다.
https://portswigger.net/burp/communitydownload
Download Burp Suite Community Edition - PortSwigger
Burp Suite Community Edition is PortSwigger's essential manual toolkit for learning about web security testing. Free download.
portswigger.net
Nox의 경우 이 사이트에서 안드로이드 5 버전이나 7버전을 다운로드 해주시면 됩니다.
Noxplayer – Fastest and Smoothest Android Emulator for PC & Mac – Free and Safe
Play the most popular mobile games and run apps on PC with NoxPlayer, the best Android Emulator. Supports Android 9. Compatible with Windows & Mac. Much faster and more stable.
www.bignox.com
openssl은 해당 사이트에서 자신의 PC환경에 맞는 프로그램을 설치해 주시면 됩니다.
https://slproweb.com/products/Win32OpenSSL.html
Win32/Win64 OpenSSL Installer for Windows - Shining Light Productions
Minimum system requirements: Windows XP or later 32MB RAM 200MHz CPU 30MB hard drive space Recommended system requirements: Windows XP or later 128MB RAM 500MHz CPU 300MB hard drive space March 14, 2023 - OpenSSL 3.1 is available. Also, Happy Pi Day. Users
slproweb.com
1. burp suite 설정
우선 burp suite를 실행해 줍니다.
community edition이라 따로 설정해줄 것 없이 그대로 넘기시면 됩니다.
이후 proxy setting에서 proxy listener를 설정해 줍니다.
port는 기본포트 8080으로 설정하고 address는 현재 PC의 Ipv4 주소를 입력합니다.
2. Nox 설정
Nox proxy설정을 해줍니다.
호스트 이름과 포트는 burp suite와 동일하게 설정합니다.
3. 인증서 설정
위의 설정을 마치고 인터넷에 접속하면 인증서 문제가 발생하게 됩니다.
기존에는 SD카드에 직접 인증서를 설치해 주면 인증서 문제가 해결되었지만 현재는 불가능합니다.
안드로이드 7버전 이상부터는 시스템 인증서에 넣어주어야 합니다.
아까 proxy setting로 돌아와서 인증서를 다운로드 해줍니다.
이대로 체크하고 인증서를 다운로드 받습니다.
그 다음 openssl을 이용해 다음과 같이 명령어를 입력해줍니다.
openssl x509 -inform DER -in 인증서이름.der -out 저장할 인증서 이름.pem
openssl x509 -inform PEM -subject_hash_old -in 인증서이름.pem
그 다음 추출한 해시값을 이용해 .der에서 .pem으로 변경한 인증서를 추출한 해시값을 이용해
해시값.0 형태로 파일명을 변경해 줍니다.
변경한 인증서를 Nox 경로에 있는 bin 폴더에 저장합니다.
그 다음 adb를 이용해 다음 명령어를 입력합니다.
adb root
adb remount
adb push 9a5ba575.0 /system/etc/security/cacerts/
chmod 644 /system/etc/security/cacerts/ 9a5ba575.0
명령어 입력이 완료되면 Nox를 재부팅 해줍니다.
시스템 부분에 인증서가 정상적으로 등록되었는지 확인 해줍니다.
이제 인터넷을 접속하여 정상적으로 연결이 되었는지 확인해 줍니다.