2017-01-11 3 views

답변

0

Android 용 'Facebook'앱은 Android 계정 관리자로 계정을 만듭니다. 전화 번호를 입력하여 FB 앱에 로그인 한 사용자의 경우 Facebook 등록 전화 번호를 계정 이름으로 저장할 수 있습니다.

안드로이드에서 페이스 북 앱에 로그인하는 데 사용>

1) 이메일 ID -

이동하기> 계정 -> 페이스 북 여기

을 설정 - 위해, 다음과 같은 3 중 하나를 볼 수 있습니다

2) Android에서 Facebook 앱에 로그인하는 데 사용되는 전화 번호

3) 사용자 ID - 각 사용자의 고유 ID입니다. 예를 들어 Mark Zuckerberg의 ID는 'zuck'입니다 (https://www.facebook.com/zuck).

이제 트릭은 사용자가 '연락처'권한을 수락하도록하는 것입니다. '연락처'권한 (매니페스트에도 '계정'권한을 추가하는 것을 잊지 마세요.)을 사용하면 android.accounts.AccountManager 클래스를 사용하여 모든 계정 데이터 (Facebook 포함)에 액세스 할 수 있습니다.

AccountManager am = AccountManager.get(this); 
    Account[] accounts = am.getAccounts(); 
    for (Account ac : accounts) { 
     String accountType = ac.type; 
     if (accountType.equals("com.facebook.auth.login")) { 
      String usrDataStr = accountType + "-->" + ac.name; 
      Toast.makeText(this, usrDataStr, Toast.LENGTH_LONG).show(); 
     } 
    } 

위의 코드를 사용하면 Android 기기의 계정을 반복 할 수 있습니다. 위의 코드는 기본적으로 기기에 Facebook 계정이 있는지 확인하고 연결된 데이터를 가져옵니다.

약간의 연구 끝에 Facebook이 로그인 페이지에 전화 번호를 입력하면 사용자의 전화 번호가 계정 이름으로 설정된다는 것을 알았습니다. 그러나 이메일을 사용하거나 사용자 ID를 사용하면 계정 이름으로 설정됩니다.

내 경험에 비추어 볼 때 대다수의 사람들이 전화 번호로 로그인하는 경향이 있습니다. 따라서이 기술을 사용하여 사용자의 전화 번호를 알 수 있습니다.

따라서 사용자의 연락처 정보를 얻기 위해 부적절한 방법으로 앱을 개발하는 경우 (즉, 전화 번호를 가져 오는 것이 의무가 아닌 경우)이 방법이 유용합니다. 이것은 사용자의 전화 번호를 얻을 수있는 보장 된 방법은 아니며, Facebook은 보안 결함 일 수 있다는 사실을 알게되면 그러한 사용자 정보 노출을 중단 할 수 있습니다. 또한 번호는 다른 장치에 속할 수 있습니다.

나는이 문제를 Facebook에보고했지만 보안 팀으로부터 "이것은 예상되는 동작이며 응용 프로그램 간 통신/중요한 정보가 아닌 경우에만 사용됩니다"라는 회신을 받았습니다.

체크 아웃시 샘플 코드 : 당신은 구글의 'FusedLocationApi'를 사용하여 좌표를 사용자의 위치를 ​​고려하여 사용자의 주소를 얻을 수있는 질문의 두 번째 부분에 대한 https://github.com/umangmathur92/FacebookVulnerabilityProof

...

서비스를 재생 한 다음 위치 요청의 결과 즉 지리적 좌표를 사용하여 '지오 코더'클래스를 사용하여 가능한 주소 목록을 얻습니다.

GoogleApiClient mGoogleApiClient = return new GoogleApiClient.Builder(getContext()) 
       .addConnectionCallbacks(new GoogleApiClient.ConnectionCallbacks() { 
        @Override 
        public void onConnected(@Nullable Bundle bundle) { 
        } 

        @Override 
        public void onConnectionSuspended(int i) { 
        } 
       }) 
       .addOnConnectionFailedListener(new GoogleApiClient.OnConnectionFailedListener() { 
        @Override 
        public void onConnectionFailed(@NonNull ConnectionResult connectionResult) { 
        } 
       }) 
       .addApi(LocationServices.API) 
       .build(); 
      mGoogleApiClient.connect(); 
       LocationRequest mLocationRequest = new LocationRequest(); 
       LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder(); 
       builder.addLocationRequest(mLocationRequest); 
       LocationSettingsRequest mLocationSettingsRequest = builder.build(); 

       PendingResult<LocationSettingsResult> result = LocationServices.SettingsApi.checkLocationSettings(mGoogleApiClient, mLocationSettingsRequest); 
       result.setResultCallback(new ResultCallback<LocationSettingsResult>() { 
        @Override 
        public void onResult(@NonNull LocationSettingsResult locationSettingsResult) { 
         final Status status = locationSettingsResult.getStatus(); 
         switch (status.getStatusCode()) { 
          case LocationSettingsStatusCodes.SUCCESS: 
           Log.i(MY_LOG, "All location settings are satisfied."); 
           getLocation(); 
           break; 
          case LocationSettingsStatusCodes.RESOLUTION_REQUIRED: 
           Log.i(MY_LOG, "Location settings are not satisfied. Show the user a dialog to upgrade location settings "); 
           break; 
          case LocationSettingsStatusCodes.SETTINGS_CHANGE_UNAVAILABLE: 
           Log.i(MY_LOG, "Location settings are inadequate, and cannot be fixed here. Dialog not created."); 
           break; 
         } 
        } 
       }); 

2) '의 getLocation'기능 :

private void getLocation() { 
     mLastLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient); 
     if (mLastLocation != null) { 
      userProfile.setLatitude(mLastLocation.getLatitude()); 
      userProfile.setLongitude(mLastLocation.getLongitude()); 
      AsyncTask<Location, String, List<Address>> reverseGeoCodeTask = getReverseGeoCodeAsyncTask(); 
      reverseGeoCodeTask.execute(mLastLocation); 
     } 
    } 

3) 역 지오 코딩 AsyncTask를 :

private AsyncTask<Location, String, List<Address>> getReverseGeoCodeAsyncTask() { 
     return new AsyncTask<Location, String, List<Address>>() { 

      @Override 
      protected List<Address> doInBackground(Location... locations) { 
       Geocoder geocoder = new Geocoder(getContext(), Locale.getDefault()); 
       try { 
        return geocoder.getFromLocation(locations[0].getLatitude(), locations[0].getLongitude(), 1); 
       } catch (IOException e) { 
        e.printStackTrace(); 
       } 
       return null; 
      } 

      @Override 
      protected void onPostExecute(List<Address> addresses) { 
       super.onPostExecute(addresses); 
       if (Utils.notNullOrEmpty(addresses)) { 
        Address address = addresses.get(0); 
        address.getPostalCode(); 
        address.getLocality(); 
        address.getAdminArea(); 
       } 
      } 
     }; 
    } 

주 당신에서 onCreate/onCreateView 기능 내부

1 ) : 권한 검사, 간결성을위한 오류 처리와 관련된 코드의 특정 부분을 건너 뛰었습니다. .

+0

이메일이나 전화 번호 대신이 문제가 발생합니다. :( https://k50.kn3.net/E74B28C18.png – karique

관련 문제