This is an Exploit App I made when solving the DocumentViewer challenge (CVE-2021-40724) from MobileHackingLab. It will download a libdocviewe_pro.so library from your local machine unto the vulnerable app's internal storage, load it upon relaunch and achieve an RCE.## DocViewerExploit App - CVE-2021-40724
This is the source code to exploiting the [Document Viewer](https://www.mobilehackinglab.com/course/lab-document-viewer-rce) by [MobileHackingLab](https://www.mobilehackinglab.com/).
## About the Vulnerable App
This is an exploit app for the [MobileHackingLab DocumentViewer Abdroid App Dynamic Code Loading RCE challenge](https://www.mobilehackinglab.com/course/lab-document-viewer-rce).
This challenge emulates `CVE-2021-40724` vulnerability identified in Adobe Acrobat Reader Android app.

The app dynamically loads code from a library file but there exist an LFI vulnerability due to how the app handles incoming URIs with getLastPathSegment().
 
## About the Exploit App
This LFI vulnerability can be abused to write our own library files into the vulnerable app which gets loaded upon app launch.
 

When our malicious library file gets loaded, our remote command gets executed

##
Reach Out to me:
[](https://x.com/tinopreter)
[](https://www.linkedin.com/in/tinopreter)
[](mailto:osei.somuah771@gmail.com)
[4.0K] /data/pocs/2775a19bc94b4d612abbda1755b78a90f886e438
├── [4.0K] app
│ ├── [1.0K] build.gradle.kts
│ ├── [ 750] proguard-rules.pro
│ └── [4.0K] src
│ ├── [4.0K] androidTest
│ │ └── [4.0K] java
│ │ └── [4.0K] com
│ │ └── [4.0K] tino
│ │ └── [4.0K] badsploit
│ │ └── [ 750] ExampleInstrumentedTest.java
│ ├── [4.0K] main
│ │ ├── [1.4K] AndroidManifest.xml
│ │ ├── [4.0K] java
│ │ │ └── [4.0K] com
│ │ │ └── [4.0K] tino
│ │ │ └── [4.0K] badsploit
│ │ │ └── [1.6K] MainActivity.java
│ │ └── [4.0K] res
│ │ ├── [4.0K] drawable
│ │ │ ├── [5.5K] ic_launcher_background.xml
│ │ │ └── [1.7K] ic_launcher_foreground.xml
│ │ ├── [4.0K] layout
│ │ │ └── [1.5K] activity_main.xml
│ │ ├── [4.0K] mipmap-anydpi
│ │ │ ├── [ 343] ic_launcher_round.xml
│ │ │ └── [ 343] ic_launcher.xml
│ │ ├── [4.0K] mipmap-hdpi
│ │ │ ├── [2.8K] ic_launcher_round.webp
│ │ │ └── [1.4K] ic_launcher.webp
│ │ ├── [4.0K] mipmap-mdpi
│ │ │ ├── [1.7K] ic_launcher_round.webp
│ │ │ └── [ 982] ic_launcher.webp
│ │ ├── [4.0K] mipmap-xhdpi
│ │ │ ├── [3.8K] ic_launcher_round.webp
│ │ │ └── [1.9K] ic_launcher.webp
│ │ ├── [4.0K] mipmap-xxhdpi
│ │ │ ├── [5.8K] ic_launcher_round.webp
│ │ │ └── [2.8K] ic_launcher.webp
│ │ ├── [4.0K] mipmap-xxxhdpi
│ │ │ ├── [7.6K] ic_launcher_round.webp
│ │ │ └── [3.8K] ic_launcher.webp
│ │ ├── [4.0K] values
│ │ │ ├── [ 147] colors.xml
│ │ │ ├── [ 71] strings.xml
│ │ │ └── [ 399] themes.xml
│ │ ├── [4.0K] values-night
│ │ │ └── [ 329] themes.xml
│ │ └── [4.0K] xml
│ │ ├── [ 478] backup_rules.xml
│ │ └── [ 551] data_extraction_rules.xml
│ └── [4.0K] test
│ └── [4.0K] java
│ └── [4.0K] com
│ └── [4.0K] tino
│ └── [4.0K] badsploit
│ └── [ 379] ExampleUnitTest.java
├── [ 167] build.gradle.kts
├── [4.0K] gradle
│ ├── [ 940] libs.versions.toml
│ └── [4.0K] wrapper
│ ├── [ 58K] gradle-wrapper.jar
│ └── [ 233] gradle-wrapper.properties
├── [1.2K] gradle.properties
├── [5.6K] gradlew
├── [2.6K] gradlew.bat
├── [1.8K] README.md
└── [ 534] settings.gradle.kts
31 directories, 36 files