Infiltrating Unix/Linux
π§ Infiltrating Unix/Linux
π Why Focus on Unix/Linux?
Over 70% of websites run on Unix-based systems.
Commonly used for hosting web applications on-premises.
Gaining a shell allows potential pivoting within the network.
π§ Key Considerations Before Attacking
Ask yourself:
What Linux distribution is running?
What shells & languages are available (e.g., bash, python, php)?
What is the systemβs role (web server, database, etc.)?
What applications are hosted?
Are there known vulnerabilities?
π Enumeration with Nmap
π§Ύ Services Detected:
FTP on port 21:
vsftpd 2.0.8 or later
SSH on port 22:
OpenSSH 7.4
HTTP on port 80 & HTTPS on 443:
Apache/2.4.6 (CentOS) + PHP/7.2.34
MySQL on port 3306
rpcbind on port 111
System is likely CentOS
π» Web App Analysis
Visited
http(s)://10.129.201.101
in a browserDiscovered rConfig 3.9.6 (network device config tool)
π Vulnerability Research
Search for:
Discovered RCE vulnerabilities
Use Metasploit to search:
Found Modules:
If a module isnβt listed, download from GitHub:
Place .rb
exploit file into the correct Metasploit folder.
π― Exploiting rConfig with Metasploit
Load the Exploit:
Run the Exploit:
Output:
π₯οΈ Interacting with the Shell
Non-TTY shell with limited commands
π Spawning a TTY Shell with Python
Check if Python is available:
Spawn TTY shell:
Example Output:
Last updated