(url)
| 24 | |
| 25 | |
| 26 | def poc(url): |
| 27 | url = url.split('://')[-1] |
| 28 | host = url.split(':')[0] |
| 29 | port = url.split(':')[-1] if ':' in url else 873 |
| 30 | res = initialisation(host, port) |
| 31 | |
| 32 | # (True, '@RSYNCD:', ' 31.0', ['share', '@RSYNCD:EXIT']) |
| 33 | if res[0]: |
| 34 | if float(res[2]) < 30.0: # 判断版本,不兼容低版本的登录方式 |
| 35 | return False |
| 36 | |
| 37 | msg = '' |
| 38 | for i in range(len(res[3]) - 1): |
| 39 | _msg = ClientCommand(host, port, res[3][i]) |
| 40 | if 'Module:' in _msg: |
| 41 | msg += _msg |
| 42 | return url + ' version:' + res[2].strip() + ' ' + msg if msg else False |
| 43 | else: |
| 44 | return False # exit |
| 45 | |
| 46 | |
| 47 | def initialisation(host, port): |
nothing calls this directly
no test coverage detected