被動掃描框架Recon-ng

目錄

  • 基礎(chǔ)使用步驟
    • 啟動
    • 菜單
    • 使用模塊
    • 查看結(jié)果
  • 具體模塊
    • 偵查
    • 發(fā)現(xiàn)
    • 攻擊
    • 報告
  • 自行構(gòu)建模塊

基礎(chǔ)使用步驟

  1. 啟動

recon-ng -h
recon-ng -w [name] #新建工作區(qū)
help

  1. 菜單

show modules

  1. 使用模塊

search [modulename]
use [path]
show info
set ...
run

  1. 結(jié)果

show <tables> #show profiles

具體模塊

  1. 偵查
  • 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)域名查詢(子域名)
  1. 發(fā)現(xiàn)
  • Interesting_files模塊:查找某網(wǎng)站的敏感文件
  1. 攻擊
  • 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

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • Spring Cloud為開發(fā)人員提供了快速構(gòu)建分布式系統(tǒng)中一些常見模式的工具(例如配置管理,服務(wù)發(fā)現(xiàn),斷路器,智...
    卡卡羅2017閱讀 136,616評論 19 139
  • Ubuntu的發(fā)音 Ubuntu,源于非洲祖魯人和科薩人的語言,發(fā)作 oo-boon-too 的音。了解發(fā)音是有意...
    螢火蟲de夢閱讀 100,725評論 9 468
  • linux資料總章2.1 1.0寫的不好抱歉 但是2.0已經(jīng)改了很多 但是錯誤還是無法避免 以后資料會慢慢更新 大...
    數(shù)據(jù)革命閱讀 13,269評論 2 33
  • 中文翻譯 ng help ng build 構(gòu)建您的應(yīng)用程序并將其放入輸出路徑(dist /默認(rèn)情況下)。 別名:...
    4ea0af17fd67閱讀 2,141評論 0 0
  • 4.2.3 我怕…… 我常常用……方式攻擊/防御 其實我投射了…… 4.2.4 我因為……而導(dǎo)致現(xiàn)在的結(jié)局 就是因...
    兮兮AX閱讀 373評論 0 1

友情鏈接更多精彩內(nèi)容