Kye0m's Security

[Diva] -Insecure Logging 본문

앱 모의해킹/Diva

[Diva] -Insecure Logging

Kye0m 2022. 9. 29. 12:42

Diva - Insecure Logging

 

환경구성


https://github.com/tjunxiang92/Android-Vulnerabilities

 

GitHub - tjunxiang92/Android-Vulnerabilities: Covers Top 10 OWASP Mobile Vulnerabilities

Covers Top 10 OWASP Mobile Vulnerabilities. Contribute to tjunxiang92/Android-Vulnerabilities development by creating an account on GitHub.

github.com

Diva 역시도 안드로이드 취약점 분석을 위한 모바일 어플리케이션이다.

위 깃허브 링크에서 Diva를 다운받도록 한다.

 

Diva를 다운 후, adb install을 이용하여 설치하려고 하면, 설치가 되지 않는다.

어플리케이션에 대한 서명이 되지 않았기 때문인데, apk easy tool을 통해서 어플리케이션에 서명해주면, 설치할 수 있다.

APK Easy Tool을 통한 서명 진행
성공적으로 설치가 완료되었다.

 

1. Insecure Logging

힌트 : insecure logging은 개발자가 의도적으로 또는 의도적이지 않게 자격증명, 세션 , ID, 제무 세부 정보등과 같은 중요한 정보를 기록할 때 발생합니다.

목적 : 로그가 어디서찍히는지 코드를 찾아내라

 

이 문제는 옳바른 카드 번호를 맞추는 것이 아니라 어느 코드에서 로그가 찍히는 것을 알아내는 것이 목표이다.

 

우선 ps명령어를 통해서 어플리케이션의 설치경로를 알아낸다.

 

 

 

힌트에서 로그를 확인해보라고 했으니, 로그를 먼저 확인해보자.

 

 logcat | grep "diva"

텍스트에 123123을 넣고 입력했을 때, 다음과 같은 로그가 찍히는 것을 확인할 수 있다.

 

로그에 찍힌 내용을 바탕으로 어떤 메소드에서 실행되는지 찾아가 보았다.

jadx를 통해서 로그문을 검색했다.

에러로그로 검색

    public void checkout(View view) {
        EditText cctxt = (EditText) findViewById(R.id.ccText);
        try {
            processCC(cctxt.getText().toString());
        } catch (RuntimeException e) {
            Log.e("diva-log", "Error while processing transaction with credit card: " + cctxt.getText().toString());
            Toast.makeText((Context) this, (CharSequence) "An error occured. Please try again later", 0).show();
        }
    }

jakhar.aseem.diva.LogActivity.checkout()을 통해서 로그가 찍히고 있음을 알 수 있다.

'앱 모의해킹 > Diva' 카테고리의 다른 글

[Diva] Access control issues(Part3)  (0) 2022.10.02
[Diva] Hardcoding issues(Part2)  (0) 2022.10.01
[Diva] - Hardcoding issues(Part1)  (1) 2022.09.29