Unsafe extraction of data storage through malicious applications.

I am a cybersecurity student and I want to know how I can extract unsafe data from the third application on a rooted phone. I want to know how I can create an application that can be used to extract the data from the third application. What kind of malicious application can I use to extract data? I have used the metasploit application but it does not work.

Thank you
Dhananjay