Re:SSH Backdoor found in Fortinet firewalls
by zymhan on Tuesday January 12, 2016 @11:51AM
(#10888470)
Can someone provide some context? A python script alone is kind of hard to decipher.
[ Parent
| on HN ]
Re:SSH Backdoor found in Fortinet firewalls
by coldpie on Tuesday January 12, 2016 @11:56AM
(#10888526)
Just reading the code, it looks like it connects to an SSH session with the name Fortimanager_Access and does some special handling of the password request (see custom_handler) which grants access. Once that's complete, it turns control over to you to type and run commands on the firewall.
I don't quite understand the special handling. Looks like it takes a byte from the server's output, hashes a special string containing that byte, and passes that back to the server. This is the backdoor.
Edit: Maybe that "special handling" is just standard protocol and it's just sending a plaintext password. I dunno.
Re:SSH Backdoor found in Fortinet firewalls
by 001spartan on Tuesday January 12, 2016 @12:04PM
(#10888589)
It uses a kind of challenge/response, where the device provides a salt that is used with a hardcoded password for that account. It seems to look like 'AK1' + base64(salt|SHA1(salt|password|Fortinet magic)) according to http://fossies.org/linux/john/src/FGT_fmt_plug.c, a cracker for Fortigate passwords.
Re:SSH Backdoor found in Fortinet firewalls
by 001spartan on Tuesday January 12, 2016 @11:54AM
(#10888507)
There is a hard coded SSH password, 'FGTAbc11*xy+Qqz27', in Fortigate devices < v5.0.7. You can use this script to access any device before that version.
EDIT: 5.0.7, not 5.0.2
Re:SSH Backdoor found in Fortinet firewalls
by zokier on Tuesday January 12, 2016 @12:03PM
(#10888587)
It's bit more complex than that; it uses challenge-response system, the "FGTA..." string is used as a "key"
Re:SSH Backdoor found in Fortinet firewalls
by 001spartan on Tuesday January 12, 2016 @12:12PM
(#10888655)
Correct, you can't use the password alone, but the challenge/response method used is readily available online, and easy to implement.
Re:SSH Backdoor found in Fortinet firewalls
by stcredzero on Tuesday January 12, 2016 @12:37PM
(#10888852)
Apparently, some people who make firewalls believe in security by obscurity. (They could at least have used an RSA key to verify. Though that would still have been bad.)
Re:SSH Backdoor found in Fortinet firewalls
by mistaken on Tuesday January 12, 2016 @01:08PM
(#10889116)
I've worked at a large telco testing CPE devices (routers and whatnot) and it was common place to find backdoors like this. The devices were made by a third party vendor and most of them had hardcoded passwords and hidden debug features.