Skip to content

Commit 0031913

Browse files
committed
Fix nil accesses
1 parent 8945f04 commit 0031913

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/exploits/multi/http/jboss_bshdeployer.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ def query_serverinfo
236236

237237
# Try to autodetect the target platform
238238
def detect_platform(res)
239-
if (res.body =~ /<td.*?OSName.*?(Linux|FreeBSD|Windows).*?<\/td>/m)
239+
if res && res.body =~ /<td.*?OSName.*?(Linux|FreeBSD|Windows).*?<\/td>/m
240240
os = $1
241241
if (os =~ /Linux/i)
242242
return 'linux'
@@ -252,7 +252,7 @@ def detect_platform(res)
252252

253253
# Try to autodetect the target architecture
254254
def detect_architecture(res)
255-
if (res.body =~ /<td.*?OSArch.*?(x86|i386|i686|x86_64|amd64).*?<\/td>/m)
255+
if res && res.body =~ /<td.*?OSArch.*?(x86|i386|i686|x86_64|amd64).*?<\/td>/m
256256
arch = $1
257257
if (arch =~ /(x86|i386|i686)/i)
258258
return ARCH_X86

0 commit comments

Comments
 (0)