{"id":37,"date":"2013-03-20T21:31:36","date_gmt":"2013-03-21T05:31:36","guid":{"rendered":"http:\/\/www.android-decompiler.com\/blog\/?p=37"},"modified":"2018-12-19T13:42:54","modified_gmt":"2018-12-19T21:42:54","slug":"japanese-contact-stealer","status":"publish","type":"post","link":"https:\/\/www.pnfsoftware.com\/blog\/japanese-contact-stealer\/","title":{"rendered":"Japanese Contact Stealer"},"content":{"rendered":"<p>Let&#8217;s have a quick look at a variant of <a href=\"http:\/\/www.symantec.com\/connect\/blogs\/android-malware-spams-victim-s-contacts\">Android.Uracto<\/a>, an app that steals (and potentially spams) contacts from Android devices. There is nothing particularly interesting about this piece of malware, but it&#8217;s the occasion to demonstrate some of JEB less-known and forthcoming abilities.<\/p>\n<p>Upon startup, the app displays the following spinner, that translates to &#8220;Reading the articles&#8230;&#8221;:<\/p>\n<p><a href=\"http:\/\/www.android-decompiler.com\/blog\/wp-content\/uploads\/2013\/03\/21.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-39\" alt=\"2\" src=\"http:\/\/www.android-decompiler.com\/blog\/wp-content\/uploads\/2013\/03\/21.png\" width=\"390\" height=\"220\" srcset=\"https:\/\/www.pnfsoftware.com\/blog\/wp-content\/uploads\/2013\/03\/21.png 390w, https:\/\/www.pnfsoftware.com\/blog\/wp-content\/uploads\/2013\/03\/21-300x169.png 300w\" sizes=\"auto, (max-width: 390px) 100vw, 390px\" \/><\/a><\/p>\n<p>The onCreate() method for the main activity displays the above spinner, and also starts a new Thread, that will create and run a Progress object. Here it is:<\/p>\n<p><a href=\"http:\/\/www.android-decompiler.com\/blog\/wp-content\/uploads\/2013\/03\/31.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-40\" alt=\"3\" src=\"http:\/\/www.android-decompiler.com\/blog\/wp-content\/uploads\/2013\/03\/31.png\" width=\"714\" height=\"366\" srcset=\"https:\/\/www.pnfsoftware.com\/blog\/wp-content\/uploads\/2013\/03\/31.png 714w, https:\/\/www.pnfsoftware.com\/blog\/wp-content\/uploads\/2013\/03\/31-300x153.png 300w, https:\/\/www.pnfsoftware.com\/blog\/wp-content\/uploads\/2013\/03\/31-624x319.png 624w\" sizes=\"auto, (max-width: 714px) 100vw, 714px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/www.android-decompiler.com\/blog\/wp-content\/uploads\/2013\/03\/41.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-41\" alt=\"4\" src=\"http:\/\/www.android-decompiler.com\/blog\/wp-content\/uploads\/2013\/03\/41.png\" width=\"726\" height=\"324\" srcset=\"https:\/\/www.pnfsoftware.com\/blog\/wp-content\/uploads\/2013\/03\/41.png 726w, https:\/\/www.pnfsoftware.com\/blog\/wp-content\/uploads\/2013\/03\/41-300x133.png 300w, https:\/\/www.pnfsoftware.com\/blog\/wp-content\/uploads\/2013\/03\/41-624x278.png 624w\" sizes=\"auto, (max-width: 726px) 100vw, 726px\" \/><\/a><\/p>\n<p>The run() method will call postMailList(). This method gets the ContentResolver for the app, and enumerates all entries having the\u00a0<strong>&#8220;vnd.android.cursor.item\/name&#8221;<\/strong> MIME type. According to the\u00a0<a href=\"http:\/\/developer.android.com\/reference\/android\/provider\/ContactsContract.CommonDataKinds.StructuredName.html\">documentation<\/a>, these entries represent &#8220;contacts&#8217; proper names&#8221;.<\/p>\n<p><a href=\"http:\/\/www.android-decompiler.com\/blog\/wp-content\/uploads\/2013\/03\/52.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-45\" alt=\"5\" src=\"http:\/\/www.android-decompiler.com\/blog\/wp-content\/uploads\/2013\/03\/52.png\" width=\"1097\" height=\"334\" srcset=\"https:\/\/www.pnfsoftware.com\/blog\/wp-content\/uploads\/2013\/03\/52.png 1097w, https:\/\/www.pnfsoftware.com\/blog\/wp-content\/uploads\/2013\/03\/52-300x91.png 300w, https:\/\/www.pnfsoftware.com\/blog\/wp-content\/uploads\/2013\/03\/52-1024x311.png 1024w, https:\/\/www.pnfsoftware.com\/blog\/wp-content\/uploads\/2013\/03\/52-624x189.png 624w\" sizes=\"auto, (max-width: 1097px) 100vw, 1097px\" \/><\/a><\/p>\n<p>A buffer representing the <em>data1<\/em>, <em>data2<\/em>, and <em>data3<\/em> fields (respectively, <em>Display Name<\/em>, <em>Given Name<\/em>, and <em>Family Name<\/em>) is dynamically created.<\/p>\n<p><strong>[JEB specific]<\/strong><\/p>\n<p><strong><\/strong><span style=\"line-height: 1.714285714; font-size: 1rem;\">Notice the optimizations that allowed the creation of that compact construct:<\/span><\/p>\n<ul>\n<li>for-loop optimization<\/li>\n<li>string concatenation<\/li>\n<li><span style=\"font-size: 1rem; line-height: 1.714285714;\">aggressive variable substitution<\/span><\/li>\n<\/ul>\n<p><em id=\"__mceDel\" style=\"line-height: 1.714285714; font-size: 1rem;\"><em id=\"__mceDel\" style=\"line-height: 1.714285714; font-size: 1rem;\"><em id=\"__mceDel\"><em id=\"__mceDel\" style=\"line-height: 1.714285714; font-size: 1rem;\"><em id=\"__mceDel\"><em id=\"__mceDel\"><em id=\"__mceDel\"><em id=\"__mceDel\" style=\"line-height: 1.714285714; font-size: 1rem;\"><em id=\"__mceDel\"><em id=\"__mceDel\"><em id=\"__mceDel\"><em id=\"__mceDel\"><span style=\"line-height: 1.714285714; font-size: 1rem;\">Some of these optimizations are already present in 1.0.x, others will be included in the 1.1 versions.<\/span><\/em><\/em><\/em><\/em><\/em><\/em><\/em><\/em><\/em><\/em><\/em><\/em><\/p>\n<p><em id=\"__mceDel\"><em id=\"__mceDel\"><em id=\"__mceDel\" style=\"line-height: 1.714285714; font-size: 1rem;\"><em id=\"__mceDel\"><em id=\"__mceDel\"><em id=\"__mceDel\"><em id=\"__mceDel\" style=\"line-height: 1.714285714; font-size: 1rem;\"><em id=\"__mceDel\"><em id=\"__mceDel\"><em id=\"__mceDel\"><em id=\"__mceDel\"><em id=\"__mceDel\" style=\"line-height: 1.714285714; font-size: 1rem;\"><em id=\"__mceDel\"><em id=\"__mceDel\"><em id=\"__mceDel\"><em id=\"__mceDel\"><em id=\"__mceDel\"><span style=\"line-height: 1.714285714; font-size: 1rem;\"><strong>[\/JEB specific]<\/strong><\/span><\/em><\/em><\/em><\/em><\/em><\/em><\/em><\/em><\/em><\/em><\/em><\/em><\/em><\/em><\/em><\/em><\/em><\/p>\n<p>The final data (&#8220;contact1, contact2, &#8230;&#8221;) is dumped on the external memory storage, encoded and POST&#8217;ed to\u00a0hxxp:\/\/jap2012.com\/data\/main.php.<\/p>\n<p><em id=\"__mceDel\" style=\"line-height: 1.714285714; font-size: 1rem;\"><a href=\"http:\/\/www.android-decompiler.com\/blog\/wp-content\/uploads\/2013\/03\/6.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-46\" alt=\"6\" src=\"http:\/\/www.android-decompiler.com\/blog\/wp-content\/uploads\/2013\/03\/6.png\" width=\"962\" height=\"594\" srcset=\"https:\/\/www.pnfsoftware.com\/blog\/wp-content\/uploads\/2013\/03\/6.png 962w, https:\/\/www.pnfsoftware.com\/blog\/wp-content\/uploads\/2013\/03\/6-300x185.png 300w, https:\/\/www.pnfsoftware.com\/blog\/wp-content\/uploads\/2013\/03\/6-624x385.png 624w\" sizes=\"auto, (max-width: 962px) 100vw, 962px\" \/><\/a><\/em><\/p>\n<p>Find the decompiled activity here:\u00a0<a href=\"http:\/\/www.android-decompiler.com\/blog\/wp-content\/uploads\/2013\/03\/solution.newsandroid.MainviewActivity.txt\">solution.newsandroid.MainviewActivity<\/a><\/p>\n<p>Sample MD5:\u00a0ba73e96caa95999321c1cdd766bdf58b<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Let&#8217;s have a quick look at a variant of Android.Uracto, an app that steals (and potentially spams) contacts from Android devices. There is nothing particularly interesting about this piece of malware, but it&#8217;s the occasion to demonstrate some of JEB less-known and forthcoming abilities. Upon startup, the app displays the following spinner, that translates to &hellip; <a href=\"https:\/\/www.pnfsoftware.com\/blog\/japanese-contact-stealer\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Japanese Contact Stealer<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15,3,2],"tags":[],"class_list":["post-37","post","type-post","status-publish","format-standard","hentry","category-android","category-decompilation","category-malware"],"_links":{"self":[{"href":"https:\/\/www.pnfsoftware.com\/blog\/wp-json\/wp\/v2\/posts\/37","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pnfsoftware.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pnfsoftware.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pnfsoftware.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pnfsoftware.com\/blog\/wp-json\/wp\/v2\/comments?post=37"}],"version-history":[{"count":0,"href":"https:\/\/www.pnfsoftware.com\/blog\/wp-json\/wp\/v2\/posts\/37\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.pnfsoftware.com\/blog\/wp-json\/wp\/v2\/media?parent=37"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pnfsoftware.com\/blog\/wp-json\/wp\/v2\/categories?post=37"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pnfsoftware.com\/blog\/wp-json\/wp\/v2\/tags?post=37"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}