Skip to content

Commit 67c0fe8

Browse files
carlospolopgitbook-bot
authored andcommitted
GitBook: [master] 2 pages modified
1 parent 1b4526a commit 67c0fe8

File tree

2 files changed

+26
-6
lines changed

2 files changed

+26
-6
lines changed

mobile-apps-pentesting/android-app-pentesting/react-native-application.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
React Native is a **mobile application framework** that is most commonly used to develop applications for **Android** and **iOS** by enabling the use of React and native platform capabilities. These days, it’s become increasingly popular to use React across platforms.
66
But most of the time, the core logic of the application lies in the React Native **JavaScript that can be obtained** without needing to use dex2jar.
77

8-
#### **Step-1**: Let’s confirm whether the application was built on React Native framework.
8+
### **Step-1**: Let’s confirm whether the application was built on React Native framework.
99

1010
To check this, rename the APK with zip extension and then extract the APK to a new folder using the following command
1111

@@ -18,21 +18,21 @@ Browse to the newly created `ReactNative` folder, and find the `assets` folder.
1818

1919
![Image for post](https://miro.medium.com/max/1559/1*enjF2H7PclRAIcNCxDIOJw.png)
2020

21-
#### **Step-2**: Creating a file named `index.html` in the same directory with the following code in it.
21+
### **Step-2**: Creating a file named `index.html` in the same directory with the following code in it.
22+
23+
You can upload the file to [https://spaceraccoon.github.io/webpack-exploder/](https://spaceraccoon.github.io/webpack-exploder/) or proceed with the following steps:
2224

2325
```markup
2426
<script src="./index.android.bundle"></script>
2527
```
2628

27-
React Native Reverse Engineering
28-
2929
![Image for post](https://miro.medium.com/max/1526/1*Qrg2jrXF8UxwbbRJJVWmRw.png)
3030

3131
Open the **index.html** file in **Google Chrome**. Open up the Developer Toolbar \(**Command+Option+J for OS X or Control+Shift+J for Windows**\), and click on “Sources”. You should see a JavaScript file, split up into folders and files that make up the main bundle.
3232

3333
> If you are able to find a file called `index.android.bundle.map`, you will be able to analyze the source code in an unminified format. `map` files contain the source mapping that allows you to map minified identifiers.
3434
35-
#### **Step-3**: search for sensitive credentials and endpoints
35+
### **Step-3**: search for sensitive credentials and endpoints
3636

3737
In this phase, you have to identify the **sensitive keywords** to analyze the **Javascript** code. A pattern that is popular with React Native applications, is the use of a third party services like such as Firebase, AWS s3 service endpoints, private keys etc.,
3838

pentesting/pentesting-web/buckets/firebase-database.md

+21-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,27 @@ python FirebaseScanner.py -f <commaSeperatedFirebaseProjectNames>
3030

3131
### Authenticated
3232

33-
If you have credentials to access the Firebase database you can use a tool such as [**Baserunner**](https://github.com/iosiro/baserunner) to access more easily the stored information.
33+
If you have credentials to access the Firebase database you can use a tool such as [**Baserunner**](https://github.com/iosiro/baserunner) to access more easily the stored information. Or a script like the following:
34+
35+
```python
36+
#Taken from https://blog.assetnote.io/bug-bounty/2020/02/01/expanding-attack-surface-react-native/
37+
import pyrebase
38+
39+
config = {
40+
"apiKey": "FIREBASE_API_KEY",
41+
"authDomain": "FIREBASE_AUTH_DOMAIN_ID.firebaseapp.com",
42+
"databaseURL": "https://FIREBASE_AUTH_DOMAIN_ID.firebaseio.com",
43+
"storageBucket": "FIREBASE_AUTH_DOMAIN_ID.appspot.com",
44+
}
45+
46+
firebase = pyrebase.initialize_app(config)
47+
48+
db = firebase.database()
49+
50+
print(db.get())
51+
```
52+
53+
To test other actions on the database, such as writing to the database, refer to the Pyrebase documentation which can be found [here](https://github.com/thisbejim/Pyrebase).
3454

3555
### Access info with APPID and API Key
3656

0 commit comments

Comments
 (0)