From 8a4c250ef9740fdc1ae86ff38d7706178f61f95f Mon Sep 17 00:00:00 2001 From: adfoster-r7 Date: Fri, 1 Oct 2021 00:43:35 +0100 Subject: [PATCH] Update gitea git hooks rce check method --- modules/exploits/multi/http/gitea_git_hooks_rce.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/exploits/multi/http/gitea_git_hooks_rce.rb b/modules/exploits/multi/http/gitea_git_hooks_rce.rb index ca580545e8dbc..384bc5cb7327d 100644 --- a/modules/exploits/multi/http/gitea_git_hooks_rce.rb +++ b/modules/exploits/multi/http/gitea_git_hooks_rce.rb @@ -131,8 +131,12 @@ def check end # Powered by Gitea Version: 1.12.5 - unless (match = res.body.match(/Powered by Gitea Version: (?[\d.]+)/)) - return CheckCode::Unsupported('Target does not appear to be running Gitea.') + unless (match = res.body.match(/Gitea Version: (?[\da-zA-Z.]+)/)) + return CheckCode::Unknown('Target does not appear to be running Gitea.') + end + + if match[:version].match /[a-zA-Z]/ + return CheckCode::Unknown("Unknown Gitea version #{match[:version]}.") end if Rex::Version.new(match[:version]) >= Rex::Version.new('1.13.0')