From ac88c604fd0baeb3f1c3f6caca53d7a058740f22 Mon Sep 17 00:00:00 2001 From: bwatters Date: Tue, 11 Dec 2018 10:02:36 -0600 Subject: [PATCH 1/3] Remove copy/pasta'd funtion that was never called --- modules/auxiliary/admin/scada/yokogawa_bkbcopyd_client.rb | 6 ------ 1 file changed, 6 deletions(-) diff --git a/modules/auxiliary/admin/scada/yokogawa_bkbcopyd_client.rb b/modules/auxiliary/admin/scada/yokogawa_bkbcopyd_client.rb index f65288ee06..ffcbc1869d 100644 --- a/modules/auxiliary/admin/scada/yokogawa_bkbcopyd_client.rb +++ b/modules/auxiliary/admin/scada/yokogawa_bkbcopyd_client.rb @@ -92,12 +92,6 @@ class MetasploitModule < Msf::Auxiliary return data 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) if action.name == 'STOR' contents = "" From 0c9d5b7d51fb7ab31dcd73fc482115cfee183d4c Mon Sep 17 00:00:00 2001 From: bwatters Date: Tue, 11 Dec 2018 10:04:55 -0600 Subject: [PATCH 2/3] refactor `unless !` to `if` --- .../post/hwbridge/ui/console/command_dispatcher/automotive.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rex/post/hwbridge/ui/console/command_dispatcher/automotive.rb b/lib/rex/post/hwbridge/ui/console/command_dispatcher/automotive.rb index 961c42c3fe..bdb5779396 100644 --- a/lib/rex/post/hwbridge/ui/console/command_dispatcher/automotive.rb +++ b/lib/rex/post/hwbridge/ui/console/command_dispatcher/automotive.rb @@ -49,7 +49,7 @@ class Console::CommandDispatcher::Automotive # def cmd_supported_buses buses = client.automotive.get_supported_buses - unless !buses.empty? + if buses.empty? print_line("none") return end From b109321b44a6439eb9155e4d69376d5c385154a6 Mon Sep 17 00:00:00 2001 From: bwatters Date: Tue, 11 Dec 2018 10:16:16 -0600 Subject: [PATCH 3/3] Kill `unless not` --- modules/auxiliary/scanner/http/cisco_directory_traversal.rb | 2 +- modules/exploits/multi/http/mutiny_subnetmask_exec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/auxiliary/scanner/http/cisco_directory_traversal.rb b/modules/auxiliary/scanner/http/cisco_directory_traversal.rb index 21b0de879e..beb905a205 100644 --- a/modules/auxiliary/scanner/http/cisco_directory_traversal.rb +++ b/modules/auxiliary/scanner/http/cisco_directory_traversal.rb @@ -65,7 +65,7 @@ class MetasploitModule < Msf::Auxiliary def get_sessions(response) session_nos = response.scan(/([0-9]{2,})/) - unless !session_nos.empty? + if session_nos.empty? print_status("Could not detect any sessions") print("\n") return diff --git a/modules/exploits/multi/http/mutiny_subnetmask_exec.rb b/modules/exploits/multi/http/mutiny_subnetmask_exec.rb index d32bd69a1a..f0597c3c67 100644 --- a/modules/exploits/multi/http/mutiny_subnetmask_exec.rb +++ b/modules/exploits/multi/http/mutiny_subnetmask_exec.rb @@ -93,7 +93,7 @@ class MetasploitModule < Msf::Exploit::Remote %Q|sed -e s/NETMASK=.*/NETMASK=#{@netmask_eth0}/ ifcfg-eth0 > ifcfg-eth0.bak|, %Q|mv -f ifcfg-eth0.bak ifcfg-eth0|, %Q|/etc/init.d/network restart| - ] unless not @netmask_eth0 + ] if @netmask_eth0 cmds << %Q|rm /tmp/#{@elfname}.elf| unless target.name =~ /CMD/ print_status("Restoring Network Information and Cleanup...")