July 29, 2026
Building My First Android Penetration Testing Lab: Every Error Taught Me Something
Introduction
By Evans Emmanuel Davou
3 min read
๐ The Davou Codex
Introduction
One of the biggest misconceptions about cybersecurity is that it's all about running tools and getting instant results. In reality, most of the work happens when things don't work.
Over the past week, I challenged myself to build a controlled Android penetration testing lab using Ubuntu, Python, and the Metasploit Framework. My goal was simple: understand the workflow security professionals use to test Android devices in an authorised lab environment.
Setting Up the Lab
My environment consisted of:
- Ubuntu 26.04 LTS
- Python Virtual Environment
- Metasploit Framework
- PostgreSQL
- Android Test Device
- Local Wi-Fi Network
Everything looked straightforward until the errors started appearing.
Error #1 โ Port Already in Use
The first obstacle came when I tried to start a local Python web server.
Instead of serving files, the terminal responded with:
OSError: [Error 98] Address already in use
At first, I assumed something was wrong with Python, but after taking a closer look, I realised another process was already using port 8080.
Rather than stopping that process, I simply switched the server to another port.
The result?
Everything started working immediately.
Error #2 โ Missing Listener File
The next challenge came when I tried to execute a listener script.
Instead of launching, the terminal returned:
No such file or directory
Rather than assuming the project was broken, I explored the repository structure and realised I was using the wrong file.
That simple mistake reminded me that understanding a project's structure is just as important as following tutorials.
Error #3 โ PostgreSQL Wouldn't Start
The next obstacle involved Metasploit's database.
The framework refused to initialise because PostgreSQL wasn't configured correctly.
Instead of reinstalling everything, I rebuilt the database and restarted the required services.
This was probably the most valuable lesson of the project.
Cybersecurity isn't about avoiding problems.
It's about understanding how to solve them.
The Breakthrough
After resolving the configuration issues, I generated the Android test application, configured the reverse handler, and successfully established a Meterpreter session with my authorised test device.
Seeing that session connect felt incredibly rewarding โ not because I had completed an exploit, but because every previous error had forced me to understand the technology more deeply.
Verifying the Connection
Once the session was established, I verified the device information to confirm everything was working correctly inside the lab.
Final Thoughts
This project taught me far more than how to install and use cybersecurity tools.
It taught me the value of patience when troubleshooting unfamiliar problems, the importance of understanding systems before attempting to secure them, and the discipline to investigate instead of making assumptions.
One lesson stood out above all: every error message is an opportunity to learn. Every challenge solved strengthens both technical knowledge and problem-solving skills.
As my home lab continues to evolve, I plan to integrate additional technologies such as Wazuh, Docker-based security environments, and more intentionally vulnerable virtual machines to simulate increasingly realistic cybersecurity scenarios.
This is only the beginning of my journey, and I'm excited to continue building, experimenting, and documenting each step.
๐ About The Davou Codex
The Davou Codex is my personal technical publication documenting my journey through cybersecurity, artificial intelligence, robotics, and software engineering.
Each entry captures hands-on projects, technical experiments, research, and the lessons learned while building secure, intelligent, and resilient systems. My goal is to share practical knowledge, demonstrate continuous growth, and contribute to the wider technology community through real-world engineering experiences.
Thank you for reading. If you found this article helpful or have suggestions for future entries, I'd love to hear your thoughts. Connect with me here on Medium or through LinkedIn, and follow The Davou Codex as the journey continues. ๐