Browse Source

[Fix] Phishing: Deal with phishing + redirected URL

tags/3.2
Vsevolod Stakhov 2 years ago
parent
commit
857e16e930
1 changed files with 19 additions and 3 deletions
  1. 19
    3
      src/plugins/lua/phishing.lua

+ 19
- 3
src/plugins/lua/phishing.lua View File

end end


local urls = task:get_urls() or {} local urls = task:get_urls() or {}
for _,url in ipairs(urls) do
for _,url_iter in ipairs(urls) do
local function do_loop_iter() -- to emulate continue local function do_loop_iter() -- to emulate continue
local url = url_iter
if generic_service_hash then if generic_service_hash then
check_phishing_map(generic_service_data, url, generic_service_symbol) check_phishing_map(generic_service_data, url, generic_service_symbol)
end end
check_phishing_dns(phishtank_suffix, url, phishtank_symbol) check_phishing_dns(phishtank_suffix, url, phishtank_symbol)
end end


if url:is_phished() and not url:is_redirected() then
local purl = url:get_phished()
if url:is_phished() then
local purl

if url:is_redirected() then
local rspamd_url = require "rspamd_url"
-- Examine the real redirect target instead of the url
local redirected_url = url:get_redirected()
if not redirected_url then
return
end

purl = rspamd_url.create(task:get_mempool(), url:get_visible())
url = redirected_url
else
purl = url:get_phished()
end



if not purl then if not purl then
return return

Loading…
Cancel
Save