⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 robots.nse

📁 Overview是Linux,FreeBSD,UNIX,Windows下的网络扫描和嗅探工 具包,其基本功能有三个,一是探测一组主机是否在线 其次是扫描 主机端口,嗅探所提供的网络服务 还可以推断主机
💻 NSE
字号:
require('shortport')require('strbuf')require('listop')id = "robots.txt"author = "Eddie Bell <ejlbell@gmail.com>"description = "Download a http servers robots.txt file and display all disallowed entries"license = "See nmaps COPYING for licence"categories = {"safe"}runlevel = 1.0portrule = shortport.port_or_service(80, "http")local last_len = 0-- split the output in 40 character lines local function buildOutput(output, w)	local len = string.len(w)	for i,v in ipairs(output) do		if w == v then return nil end	end		if last_len == 0 or last_len + len <= 40 then		last_len = last_len + len	else		output = output .. '\n'		last_len = 0	end	output = output .. w 	output = output .. ' 'endaction = function(host, port)	local soc, lines, status	local catch = function() soc:close() end	local try = nmap.new_try(catch)	-- connect to webserver 	soc = nmap.new_socket()	soc:set_timeout(4000)	try(soc:connect(host.ip, port.number))	local query = strbuf.new()	query = query .. "GET /robots.txt HTTP/1.1"	query = query .. "Accept: */*"	query = query .. "Accept-Language: en"	query = query .. "User-Agent: Nmap NSE"	query = query .. "Host: " .. host.ip .. ":" .. port.number	query = query .. '\r\n\r\n';	try(soc:send(strbuf.dump(query, '\r\n')))	local response = strbuf.new()	while true do		status, lines = soc:receive_lines(1)		if not status then break end		response = response .. lines	end	if not string.find(strbuf.dump(response), "HTTP/1.1 200 OK") then		return nil	end	-- parse all disallowed entries and remove comments	local output = strbuf.new()	for w in string.gmatch(strbuf.dump(response, '\n'), "Disallow:%s*([^\n]*)\n") do			w = w:gsub("%s*#.*", "")			buildOutput(output, w)	end	if not listop.is_empty(output) then		return strbuf.dump(output)	end	return nilend

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -