land #11617 ssh library unifi cleanup

master
h00die 2019-03-23 07:12:23 -04:00
commit 759dbc86b1
No known key found for this signature in database
GPG Key ID: C5A9D25D1457C971
1 changed files with 5 additions and 5 deletions

View File

@ -122,16 +122,16 @@ module Metasploit
proof = ssh_socket.exec!("cli show version\n").split("\n")[2..4].join(", ").to_s
elsif (proof =~ /Linux USG /)
# Ubiquiti Unifi USG
proof << ssh_socket.exec!("cat /etc/version\n").to_s
proof << ssh_socket.exec!("cat /etc/version\n").to_s.rstrip
end
temp_proof << ssh_socket.exec!("grep unifi.version /tmp/system.cfg\n").to_s
if (temp_proof =~ /unifi.version/)
temp_proof = ssh_socket.exec!("grep unifi.version /tmp/system.cfg\n").to_s.rstrip
if (temp_proof =~ /unifi\.version/)
proof << temp_proof
# Ubiquiti Unifi device (non-USG), possibly a switch. Tested on US-24
# Ubiquiti Unifi device (non-USG), possibly a switch. Tested on US-24, UAP-nanoHD
# The /tmp/*.cfg files don't give us device info, however the info command does
# we dont call it originally since it doesnt say unifi/ubiquiti in it and info
# is a linux command as well
proof << ssh_socket.exec!("grep board.name /etc/board.info\n").to_s
proof << ssh_socket.exec!("grep board.name /etc/board.info\n").to_s.rstrip
end
else
# Cisco IOS