UNDERCODE COMMUNITY
2.67K subscribers
1.23K photos
31 videos
2.65K files
79.8K links
🦑 Undercode Cyber World!
@UndercodeCommunity


1️⃣ World first platform which Collect & Analyzes every New hacking method.
+ AI Pratice
@Undercode_Testing

2️⃣ Cyber & Tech NEWS:
@Undercode_News

3️⃣ CVE @Daily_CVE

Web & Services:
Undercode.help
Download Telegram
Forwarded from Exploiting Crew (Pr1vAt3)
#######

Mobile

Hacking

#######
Forwarded from Exploiting Crew (Pr1vAt3)
🦑 Drozer is a security assessment framework for Android apps, developed by MWR InfoSecurity (now part of F-Secure). It's used by penetration testers to assess Android applications for vulnerabilities. Here's a hacking tutorial for using Drozer to identify vulnerabilities in Android apps.

---

## Prerequisites
1. Install Drozer:
Drozer consists of two components:
- Agent (installed on the Android device)
- Console (run on your host machine)

Download the Drozer agent APK from [official GitHub](https://github.com/FSecureLABS/drozer) and install it on your Android device. Install the Drozer console using:
   sudo apt install python3-pip
pip3 install drozer


2. Setup ADB:
Install Android Debug Bridge (ADB) to connect your Android device to your computer.
   sudo apt install adb


3. Rooted Device (Optional but Recommended):
Drozer can operate on non-rooted devices but works best with root privileges.

4. Enable USB Debugging:
Go to Settings > Developer Options > USB Debugging on your Android device.

---

## Step 1: Setting Up the Environment
1. Connect the Android Device:
Use ADB to ensure your device is detected:
   adb devices


2. Forward the Drozer Port:
Drozer communicates with the agent over port 31415. Forward this port using ADB:
   adb forward tcp:31415 tcp:31415


3. Start the Drozer Agent:
Launch the Drozer agent app on your Android device and click "Start Server".

4. Launch Drozer Console:
On your host machine, open the Drozer console:
   drozer console connect


---

## Step 2: Reconnaissance
Drozer has a modular design, with commands categorized into packages. Start by gathering basic information.

1. List Installed Packages:
   run app.package.list


2. Find Specific Apps:
Search for apps by keyword, e.g., for "vulnerable":
   run app.package.list -f vulnerable


3. Get Detailed App Information:
Get information about an app, such as permissions and activities:
   run app.package.info -a com.example.vulnerableapp


---

## Step 3: Exploit Common Vulnerabilities
Drozer can be used to test various vulnerabilities, including exported activities, insecure file storage, and SQL injection.

### 1. Test Exported Components
Exported components can be accessed by any app on the device. Drozer identifies and interacts with these components.

#### Activities:
List exported activities:
run app.activity.info -a com.example.vulnerableapp

Launch an exported activity:
run app.activity.start --component com.example.vulnerableapp com.example.vulnerableapp.MainActivity


#### Services:
List exported services:
run app.service.info -a com.example.vulnerableapp

Interact with a service:
run app.service.send --component com.example.vulnerableapp com.example.vulnerableapp.MyService


#### Content Providers:
Identify content providers and their permissions:
run app.provider.info -a com.example.vulnerableapp

Query content providers for data:
run app.provider.query content://com.example.vulnerableapp.provider/data


### 2. SQL Injection
Test content providers for SQL injection by manipulating query inputs:
run app.provider.query content://com.example.vulnerableapp.provider/data --projection "' OR '1'='1"


### 3. Insecure Data Storage
Check for sensitive data in app directories:
run scanner.misc.filebrowser -a com.example.vulnerableapp


### 4. Check for Debuggable Apps
Some apps are left in debuggable mode, exposing them to reverse engineering:
run app.package.debuggable


---

## Step 4: Automation and Exploit Modules
### Use Drozer's built-in exploit modules:
1. Scan for Known Vulnerabilities:
   run scanner.provider.injection -a com.example.vulnerableapp

2. Check for World-Readable Files:
   run scanner.misc.world_readable_files


---

## Step 5: Generate Reports
Keep logs of your findings for documentation:
drozer console connect > output.log


---
Forwarded from Exploiting Crew (Pr1vAt3)
### Note:
This tutorial is intended for educational purposes only. Testing applications without explicit permission is illegal and unethical. Always adhere to your organization's policies or get consent from app owners before performing assessments.

---

Let me know if you'd like help with specific Drozer commands or use cases!
Forwarded from Exploiting Crew (Pr1vAt3)
🦑 Mobile Security Framework (MobSF) Hacking Tutorial

MobSF (Mobile Security Framework) is an open-source automated pen-testing framework used for analyzing Android, iOS, and Windows apps. It supports both static and dynamic analysis, making it an essential tool for app security assessments.

---

## Prerequisites
1. Install MobSF:
- Clone the MobSF repository:
     git clone https://github.com/MobSF/Mobile-Security-Framework-MobSF.git
cd Mobile-Security-Framework-MobSF

- Install dependencies and start the server:
     ./setup.sh  # For Linux/Mac
python3 -m pip install -r requirements.txt
python3 manage.py runserver


Access MobSF via http://127.0.0.1:8000.

2. Java Environment:
Ensure Java is installed for decompiling Android APKs:
   sudo apt install openjdk-11-jdk


3. Dynamic Analysis (Optional):
For dynamic analysis, you'll need:
- A VirtualBox VM or a rooted Android device.
- Genymotion (Android emulator).

---

## Step 1: Static Analysis
Static analysis examines the app's source code for vulnerabilities.

### Analyze an APK
1. Upload the APK file:
Drag and drop the APK onto the MobSF web interface.

2. Wait for processing:
MobSF will decompile the APK and display a detailed report.

### Review the Report
The report is divided into sections:
1. App Information:
Includes package name, version, permissions, and components.

2. Permissions Analysis:
Flags excessive or dangerous permissions like READ_SMS, WRITE_EXTERNAL_STORAGE, etc.

3. Manifest Analysis:
Examines the AndroidManifest.xml file for:
- Exported activities, services, and receivers.
- Insecure configurations.

4. Code Analysis:
Identifies potential vulnerabilities in the app's source code:
- Hardcoded API keys
- Weak encryption
- Unprotected credentials

5. Cryptographic Analysis:
Highlights insecure cryptographic practices, e.g., MD5 or hardcoded keys.

---

## Step 2: Dynamic Analysis
Dynamic analysis evaluates the app's behavior during runtime.

### Set Up Dynamic Analysis
1. Configure Emulator/Device:
- Install the MobSF dynamic analysis APK on the device.
- Set up ADB forwarding:
     adb forward tcp:5000 tcp:5000


2. Launch Dynamic Analysis:
Start the dynamic analysis module in MobSF and connect your device.

3. Monitor Runtime Behavior:
- Inspect API calls, file system access, and network traffic.
- Use MobSF's built-in proxy for traffic analysis.

---

## Step 3: Advanced Features
1. Binary Analysis:
MobSF can analyze binaries (.so files) for vulnerabilities.

2. Memory Dump Analysis:
Inspect memory dumps for sensitive information like passwords or keys.

3. Malware Analysis:
Identify malicious patterns in APKs:
- Suspicious API usage
- Embedded malware signatures

---

## Step 4: Automation with REST API
MobSF provides an API for automation. Here's how to analyze an APK using the API:

1. Start MobSF API Server:
Enable the API server in settings.py.

2. Submit an APK:
   curl -F "file=@app.apk" http://127.0.0.1:8000/api/v1/upload -H "Authorization: <your_api_key>"


3. Retrieve Results:
   curl http://127.0.0.1:8000/api/v1/report_json -H "Authorization: <your_api_key>"


---

## Step 5: Report Findings
Export the analysis report in various formats (PDF, HTML, JSON) for documentation.

---

### Common Use Cases
1. Testing Exported Components:
- Identify insecure exported activities, services, or receivers.

2. Analyzing Network Security:
- Check for plaintext HTTP traffic.
- Identify hardcoded server IPs or API keys.

3. Hardcoded Credentials:
- MobSF flags sensitive information like passwords embedded in the code.

---

### Important Notes
1. This tutorial is for ethical purposes. Ensure you have permission to test the app.
2. Use MobSF as part of a comprehensive app security assessment strategy.

---

Let me know if you'd like to explore specific features of MobSF!
Forwarded from Exploiting Crew (Pr1vAt3)
🦑 Tool: SQLmap

SQLmap is an automated penetration testing tool for detecting and exploiting SQL injection vulnerabilities in databases.

---

### Basic Usage Command:
sqlmap -u "http://example.com/index.php?id=1"


### Explanation:
- sqlmap: Invokes the SQLmap tool.
- -u: Specifies the target URL.
- "http://example.com/index.php?id=1": Target URL with a parameter (id=1) to test for SQL injection.

---

### Advanced Example: Dumping a Database
sqlmap -u "http://example.com/index.php?id=1" --dbs


Explanation:
- --dbs: Enumerates all databases on the vulnerable server.

---

### Example: Dump Tables from a Specific Database
sqlmap -u "http://example.com/index.php?id=1" -D mydatabase --tables


Explanation:
- -D mydatabase: Specifies the database (mydatabase).
- --tables: Lists all tables in the specified database.

---

### Use Case: Extracting Data from a Table
sqlmap -u "http://example.com/index.php?id=1" -D mydatabase -T users --dump


Explanation:
- -T users: Specifies the table (users).
- --dump: Dumps all data from the specified table.

---

### Important Notes:
1. Always obtain proper authorization before testing a website or application.
2. Misuse of SQLmap for unauthorized activities is illegal and unethical. Use it responsibly for educational or security testing purposes only.
Forwarded from Exploiting Crew (Pr1vAt3)
🦑 Tool: Nmap (Network Mapper)

Nmap is a powerful tool for network discovery and security auditing.

---

### Basic Usage Command:
nmap 192.168.1.1


Explanation:
- nmap: Invokes the Nmap tool.
- 192.168.1.1: Target IP address for scanning.

---

### Advanced Example: Scanning All Open Ports
nmap -p- 192.168.1.1


Explanation:
- -p-: Scans all 65,535 TCP ports instead of the default 1,000.

---

### Example: Service and Version Detection
nmap -sV 192.168.1.1


Explanation:
- -sV: Enables service version detection to identify software running on open ports.

---

### Example: OS Detection
nmap -O 192.168.1.1


Explanation:
- -O: Attempts to determine the operating system of the target.

---

### Use Case: Full Network Scan
nmap -A 192.168.1.0/24


Explanation:
- -A: Enables OS detection, version detection, script scanning, and traceroute.
- 192.168.1.0/24: Scans all devices in the subnet.

---

### Important Notes:
1. Use Nmap only on networks or systems where you have explicit permission to scan.
2. Unauthorized scanning can be illegal. Always ensure compliance with ethical guidelines.