目錄
- 基礎(chǔ)使用步驟
- 啟動
- 菜單
- 使用模塊
- 查看結(jié)果
- 具體模塊
- 偵查
- 發(fā)現(xiàn)
- 攻擊
- 報告
- 自行構(gòu)建模塊
基礎(chǔ)使用步驟
- 啟動
recon-ng -h
recon-ng -w [name] #新建工作區(qū)
help
- 菜單
show modules
- 使用模塊
search [modulename]
use [path]
show info
set ...
run
- 結(jié)果
show <tables> #show profiles
具體模塊
- 偵查
- Profiler模塊: 查詢某個用戶名在那些網(wǎng)站(知名)有注冊。
- Hashes_org模塊:反查哈希加密(需要api key才能用)
- Metacrawler模塊:網(wǎng)站文件搜索(如pdf,xlsx文件等,其實就是google hack技術(shù))
- Dev_diver模塊:查找某個用戶是否存在某些代碼庫
- Ipinfodb模塊:查詢ip的相關(guān)信息,如地理位置(這個功能要api)
- Brute_hosts模塊:暴力破解子域名
- Google_site_web模塊:相關(guān)域名查詢(子域名)
- 發(fā)現(xiàn)
- Interesting_files模塊:查找某網(wǎng)站的敏感文件
- 攻擊
- command_injector模塊:命令注入,多用于木馬文件
Search command_injector
Use path-to/command_injector
Show info #可以看到具體的參數(shù)
set base_url http://1.1.1.1/other/a.php
Set parameters cmd=<rce>
run
4.報告
- search report,查看具體輸出格式模塊
自行構(gòu)建模塊
在home目錄下的’./recon-ng’下建立modules文件夾,然后在分別根據(jù)模塊屬性來建立文件,如建立偵查板塊,需要建立recon文件夾,構(gòu)建找代理模塊示例:
cd ~
cd .rcon-ng
mkdir modules
cd modules
mkdir recon
cd recon
mkdir findproxy
cd findproxy
vim find_proxy.py
模塊文件主要的格式:
from recon.core.module import BaseModule
class Module(BaseModule):
meta = {
'name': 'something...',
'author': ‘something...’,
'description': 'something...',
'query': something...' ##這個最好寫清楚,方便別人查看用法
}
def mudule_run(self[,type]):
some code,self參數(shù)可以用來獲取一些api key等, type含有source的數(shù)據(jù)
Pass
#-*- coding: utf-8 -*-
from recon.core.module import BaseModule
import re
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from bs4 import BeautifulSoup
import subprocess
import os
import urllib
import copy
import time
import jsbeautifier
class Module(BaseModule):
meta = {
'name': 'Find free proxy...',
'author': 'Cesign',
'description': 'find defferent proxy, there are four kinds of proxy,http,https,socks4 and socks5, and the code is h,s,4,5....Enjoy!!!',
'query': 'find defferent proxy, there are four kinds of proxy,http,https,socks4 and socks5, and the code is h,s,4,5....Enjoy!!!'
}
def module_run(self,type):
STYLE = {
'fore':
{ # 前景色
'black' : 30, # 黑色
'red' : 31, # 紅色
'green' : 32, # 綠色
'yellow' : 33, # 黃色
'blue' : 34, # 藍(lán)色
'purple' : 35, # 紫紅色
'cyan' : 36, # 青藍(lán)色
'white' : 37, # 白色
},
'back' :
{ # 背景
'black' : 40, # 黑色
'red' : 41, # 紅色
'green' : 42, # 綠色
'yellow' : 43, # 黃色
'blue' : 44, # 藍(lán)色
'purple' : 45, # 紫紅色
'cyan' : 46, # 青藍(lán)色
'white' : 47, # 白色
},
'mode' :
{ # 顯示模式
'mormal' : 0, # 終端默認(rèn)設(shè)置
'bold' : 1, # 高亮顯示
'underline' : 4, # 使用下劃線
'blink' : 5, # 閃爍
'invert' : 7, # 反白顯示
'hide' : 8, # 不可見
},
'default' :
{
'end' : 0,
},
}
def UseStyle(string, mode = '', fore = '', back = ''):
mode = '%s' % STYLE['mode'][mode] if STYLE['mode'].has_key(mode) else ''
fore = '%s' % STYLE['fore'][fore] if STYLE['fore'].has_key(fore) else ''
back = '%s' % STYLE['back'][back] if STYLE['back'].has_key(back) else ''
style = ';'.join([s for s in [mode, fore, back] if s])
style = '\033[%sm' % style if style else ''
end = '\033[%sm' % STYLE['default']['end'] if style else ''
return '%s%s%s' % (style, string, end)
print '[*] Please wait, it will take about 2 minutes...'
dcap = dict(DesiredCapabilities.PHANTOMJS)
dcap["phantomjs.page.settings.userAgent"] = (
"Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0"
)
driver = webdriver.PhantomJS(desired_capabilities=dcap,service_log_path=r"/home/cesign/watchlog.log")
driver.set_window_size(1920, 1080)
driver.get('https://hidemy.name/en/proxy-list/?type='+str(type[0])+'#list')
time.sleep(1)
soup=BeautifulSoup(driver.page_source,'html.parser')
allurl=soup.find_all(name='td')
result={
'h':lambda x:'http',
's':lambda x:'https',
'4':lambda x:'socks4',
'5':lambda x:'socks5',
}
i = 0
print UseStyle('[*] Search proxy: type:'+result[str(type[0])]('hello'),fore='blue')
print UseStyle('[*] IP adress---Port---Country,City---Speed---Type---Anonymity---Last check',fore='blue')
while True:
try:
part = []
part = allurl[i:i+7]
i = i+7
print UseStyle('[*]'+part[0].text+'---'+part[1].text+'---'+part[2].text+'---'+part[3].text+'---'+part[4].text+'---'+part[5].text+'---'+part[6].text,fore='green')
except:
break
driver.quit()
調(diào)用模塊
Reload
Search find_proxy
Use path-to/find_proxy
Show info
Set source h
Run