首页 > 其他分享 >hackthebox broker easy

hackthebox broker easy

时间:2023-12-01 16:35:41浏览次数:671  
标签:easy nginx -- broker hackthebox ssh file root

brief intruducton

1.The first breakthrouth is week password of admin at http://10.10.11.243/ website.

if we could utilize admin/admin successfully access the http://10.10.11.243/admin/

as the website title,this is the middleware named activemq with version 5.15.15

we can google the activemq version and vulnerability to search the loophole --keyword

activemq exploit github | activemq reverse shell github | activemq reddit | activemq attacktb etc.

REMEMBER ! Our attack statements must take into account the encoding of the url.such as poc-linux.xml

lookat the value : we take the exploit statement into html entity encode. Here is the website 

https://mothereff.in/html-entities

following the exploit step, we can get a reverse shell from box

2.The second breakthrough is sudo -l to find the suid perm command check

we can apply nginx command as root privilege 

breifly, we can modify the nginx conf and refresh the config source.

The default nginx config is locate at /etc/nginx/nginx.conf but we don't have the privilege to modify it at this directory.

so we need to use this reverse shell user and copy the file to /dev/shm that any user can write or read.

cp /etc/nginx/nginx.conf /dev/shm/nginx.conf 

there are two program to modify the config file 

 PROGRAM FIRST

at this picture have a critical error. The nginx config file require ';' at the end each line.

config instruction:

use root;    #run the web server as root user

events{worker_connections 768;}.  
#sets the maximum number of simultaneous connections that each worker process can handle.The value here doesn't matter so i just picked an arbitrary number.if this parameter isn't set,i'll get the error 'nginx:[emerg]no "events" section in configuration'

http{ server {}} --specifies i want an http web server

listen 1337 -- specifies the port that the web server will listen on.

location / {root / } -- sets the directory that the web server will be hosted from to the '/' directory of the root user.

usage: curl http://10.10.11.243:1337/location 

PROGRAM SECOND

we enable the dav_methods PUT and upload the files to the webdirectory

source the config file 

sudo nginx -c nginx.conf

pentest step

1.modify the nginx.conf file and enable the wabdav PUT allows file upload

2.create the ssh certificate ssh-keygen -f broker

3..using curl command to upload the ssh certificate to /root/.ssh/authorized_keys --upload-file broker.pub

curl 10.10.11.243:1338/root/.ssh/authorized_keys --upload-file broker.pub

tips: We don't need to add HTTP prefixes at the URL when we use PUT command with curl 

ssh -i [email protected]

标签:easy,nginx,--,broker,hackthebox,ssh,file,root
From: https://www.cnblogs.com/lisenMiller/p/17865430.html

相关文章

  • 智慧安防三大信息技术:云计算、大数据及人工智能在视频监控EasyCVR中的应用
    说到三大信息技术大家都很清楚,指的是云计算、大数据和人工智能,在人工智能(AI)快速发展的当下,例如常见的大数据分析、人工智能芯片生产的智能机器人等等,在工作、生活、教育、金融、科技、工业、农业、娱乐等各个领域随处可见,那么三大信息技术在智能监控中又有哪些应用呢?今天我们就结......
  • 为获取导入百分比,使用easyexcel获取导入excel表总行数
    背景分批读取大量数据的excel文件,每次读取1000行数据,然后插入数据库,并且去执行一个方法,执行完毕后更新此行数据的状态。需要获取已更新数据的占比,即计算百分比。因为是分批读取的,我们不可以直接用已更新状态数量/数据库中总数。因为可能一次读取的1000行数据更新状态很快,直接100......
  • 摄像头 推流打电视大屏集成 easydarwin 项目备忘
    EasyDarwin直播(推流、拉流)配置好像有点麻烦,不推荐使用开源的。用商用版本的配置简单一点。前后端分离,静态html页面集成大屏接口数据,这样不用安装编程工具,轻量。推流的视频容易断流(稳定性不太乐观)。  winform, wpf还是比较靠谱,集成海康dll,就是开发环境重量,不好现场......
  • 2023.11.29 日记 Take it easy
    很不想把文化课写到日记里。但今天有点烦了。考试考的内容是要通过刷题得知的,并非学习。我已经在别的平台抱怨过很多次当今教育现状了,无济于事是肯定的,反而会打消学习的积极性。由于训练原因欠了很多课,再加上两个学校的进度不同、考试时间不同,我的学习成果实在像是被虫蛀了一样......
  • Codeforces Round 829 (Div. 1)A1. Make Nonzero Sum (easy version)(思维找规律)
    先考虑无解的情况:当n为奇数时无解相邻的两个元素一定可以变成0\[a[i]!=a[i+1]时,分成[i,i],和[i+1,i+1]\]\[a[i]=a[i+1]时,分成[i,i+1]\]这两种情况对答案的贡献都是0,当n为奇数时我们总会有一个没办法凑成0.#include<bits/stdc++.h>#definelsp<<1#......
  • 智慧环保:视频监控平台EasyCVR与AI智能分析在环保领域的应用
    人工智能(AI)视频分析技术在环保领域有着广泛的应用,通过智能识别和跟踪技术,AI视频分析可以实时监测空气质量、水质和噪音等环境指标,帮助环保部门及时发现污染源并进行有效治理,提高监测、管理和保护环境的效率。今天我们就来介绍下AI视频智能分析识别技术以及EasyCVR视频监控技术在环......
  • AI视频智能分析识别技术的发展与EasyCVR智慧安防视频监控方案
    随着科技的不断进步,基于AI神经网络的视频智能分析技术已经成为了当今社会的一个重要组成部分。这项技术通过利用计算机视觉和深度学习等技术,实现对视频数据的智能分析和处理,从而为各个领域提供了广泛的应用。今天我们就来介绍下视频智能分析识别技术的发展以及EasyCVR视频技术的应......
  • 如何在安防视频监控平台EasyCVR首页增添统计设备每个小时的温度展示功能?细节如下
    安防视频监控/视频集中存储/云存储/磁盘阵列EasyCVR平台可拓展性强、视频能力灵活、部署轻快,可支持的主流标准协议有国标GB28181、RTSP/Onvif、RTMP等,以及支持厂家私有协议与SDK接入,包括海康Ehome、海大宇等设备的SDK等。平台既具备传统安防视频监控的能力,也具备接入AI智能分析的......
  • 智能监控平台/视频共享融合系统EasyCVR接入RTSP协议视频流无法播放原因是什么?
    视频集中存储/云存储/视频监控管理平台EasyCVR能在复杂的网络环境中,将分散的各类视频资源进行统一汇聚、整合、集中管理,实现视频资源的鉴权管理、按需调阅、全网分发、智能分析等。AI智能/大数据视频分析EasyCVR平台已经广泛应用在工地、工厂、园区、楼宇、校园、仓储等场景中。感......
  • 视频监控管理平台/智能监测/检测系统EasyCVR设备列表显示不全是什么原因?该如何解决?
    GB28181视频监控国标平台/视频云存储/安防监控EasyCVR视频汇聚平台,基于云边端智能协同,支持海量视频的轻量化接入与汇聚、转码与处理、全网智能分发、视频集中存储等。智慧安防视频平台EasyCVR拓展性强,视频能力丰富,具体可实现视频监控直播、视频轮播、视频录像、云存储、回放与检索......