mirror of
https://github.com/nmap/nmap.git
synced 2026-11-30 11:31:04 +00:00
Add PocketBase detection script
Detects the PocketBase service and its default admin panel.
This commit is contained in:
parent
0bbc35410f
commit
756f5d5b5f
1 changed files with 39 additions and 0 deletions
39
scripts/pocketbase-detect.nse
Normal file
39
scripts/pocketbase-detect.nse
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
local http = require "http"
|
||||
local shortport = require "shortport"
|
||||
local stdnse = require "stdnse"
|
||||
|
||||
description = [[
|
||||
Detects the PocketBase (Go-based backend) service and its default admin panel.
|
||||
]]
|
||||
|
||||
---
|
||||
-- @usage
|
||||
-- nmap -p 8090 --script pocketbase-detect <target>
|
||||
--
|
||||
-- @output
|
||||
-- PORT STATE SERVICE
|
||||
-- 8090/tcp open http
|
||||
-- |_pocketbase-detect: PocketBase Backend detected! Admin panel: /_/
|
||||
---
|
||||
|
||||
author = "Aykut Gokbulut"
|
||||
license = "Same as Nmap--See https://nmap.org/book/man-legal.html"
|
||||
categories = {"discovery", "safe"}
|
||||
|
||||
-- PocketBase uses 8090 by default, but it can also run on standard HTTP ports
|
||||
portrule = shortport.port_or_service({80, 443, 8080, 8090}, "http")
|
||||
|
||||
action = function(host, port)
|
||||
local path = "/_/" -- Default PocketBase admin panel path
|
||||
local response = http.get(host, port, path)
|
||||
|
||||
-- Check if the page is accessible and contains PocketBase-specific patterns
|
||||
if (response.status == 200 and response.body) then
|
||||
-- Look for 'pocketbase' string or 'pb-' variable prefixes in the response body
|
||||
if response.body:match("pocketbase") or response.body:match("pb%-") then
|
||||
return "PocketBase Backend detected! Admin panel: " .. path
|
||||
end
|
||||
end
|
||||
|
||||
return nil
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue