Skip to content

Commit

Permalink
add rtsp and portmap protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
ntestoc3 committed Oct 22, 2021
1 parent 07f75cd commit c73cf7e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ FaPro是一个服务端协议模拟工具,可以轻松启停多个网络服务
- [x] IMAP
- [x] POP3
- [x] NTP
- [x] RTSP
- [x] PORTMAP
- 使用TcpForward进行端口转发
- 支持tcp syn请求记录
- 支持ping请求记录
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ The goal is to support as many protocols as possible, and support as many deep i
- [x] IMAP
- [x] POP3
- [x] NTP
- [x] RTSP
- [x] PORTMAP
- Use TcpForward to forward network traffic
- Support tcp syn logging
- Support icmp ping logging
Expand Down
20 changes: 20 additions & 0 deletions scripts/ipclone.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,20 @@ def get_redis_version(data):
return r.group(1)
return "6.2.3"

def get_rtsp_server(data):
r = re.search("Server: (.*?)[\r\n]", data)
if r:
return r.group(1)
return ""

def get_port_mapping(data):
result = []
for row in data.split(','):
r = re.search("(\d+) v(\d) (\w+)\((\d+)\)", row)
if r:
result.append(f'{r.group(1)},{r.group(2)},{r.group(3).lower()},{r.group(4)}')
return result

def get_eip_info(banner):
ip = re.search("Device IP:\s+(\d+\.\d+\.\d+\.\d+)", banner)
product = re.search("Product:\s+(.+)[\r\n]?", banner)
Expand Down Expand Up @@ -120,6 +134,12 @@ def gen_handler(ip, port, service, banner, deep_dump=True):
elif service == "redis":
handler['handler'] = 'redis'
handler['params'] = {"server_version": get_redis_version(banner)}
elif service == "rtsp":
handler['handler'] = 'rtsp'
handler['params'] = {"server": get_rtsp_server(banner)}
elif service == "portmap":
handler['handler'] = 'portmap'
handler['params'] = {"mapping_table": get_port_mapping(banner)}
elif service == "elastic":
handler['handler'] = 'elasticsearch'
elif service == "mqtt":
Expand Down

0 comments on commit c73cf7e

Please sign in to comment.