Land #11107, double negative logic cleanup

GSoC/Meterpreter_Web_Console
William Vu 2018-12-11 20:29:53 -06:00
commit aa0c206b4b
No known key found for this signature in database
GPG Key ID: 68BD00CE25866743
4 changed files with 3 additions and 9 deletions

View File

@ -49,7 +49,7 @@ class Console::CommandDispatcher::Automotive
# #
def cmd_supported_buses def cmd_supported_buses
buses = client.automotive.get_supported_buses buses = client.automotive.get_supported_buses
unless !buses.empty? if buses.empty?
print_line("none") print_line("none")
return return
end end

View File

@ -92,12 +92,6 @@ class MetasploitModule < Msf::Auxiliary
return data return data
end end
def valid_response?(data)
return false unless !!data
return false unless data =~ /500 'yyparse error': command not understood/
return true
end
def on_client_connect(c) def on_client_connect(c)
if action.name == 'STOR' if action.name == 'STOR'
contents = "" contents = ""

View File

@ -65,7 +65,7 @@ class MetasploitModule < Msf::Auxiliary
def get_sessions(response) def get_sessions(response)
session_nos = response.scan(/([0-9]{2,})/) session_nos = response.scan(/([0-9]{2,})/)
unless !session_nos.empty? if session_nos.empty?
print_status("Could not detect any sessions") print_status("Could not detect any sessions")
print("\n") print("\n")
return return

View File

@ -93,7 +93,7 @@ class MetasploitModule < Msf::Exploit::Remote
%Q|sed -e s/NETMASK=.*/NETMASK=#{@netmask_eth0}/ ifcfg-eth0 > ifcfg-eth0.bak|, %Q|sed -e s/NETMASK=.*/NETMASK=#{@netmask_eth0}/ ifcfg-eth0 > ifcfg-eth0.bak|,
%Q|mv -f ifcfg-eth0.bak ifcfg-eth0|, %Q|mv -f ifcfg-eth0.bak ifcfg-eth0|,
%Q|/etc/init.d/network restart| %Q|/etc/init.d/network restart|
] unless not @netmask_eth0 ] if @netmask_eth0
cmds << %Q|rm /tmp/#{@elfname}.elf| unless target.name =~ /CMD/ cmds << %Q|rm /tmp/#{@elfname}.elf| unless target.name =~ /CMD/
print_status("Restoring Network Information and Cleanup...") print_status("Restoring Network Information and Cleanup...")