Metasploit从文件中读取目标地址
本文简单介绍如何使用Metasploit从文件中读取目标地址,来执行检测。
以检测MS17-010漏洞为例,在设定RHOSTS参数时,可设定目标地址范围和CIDR地址块,设定单个IP的目标也是可以的。
msf > use auxiliary/scanner/smb/smb_ms17_010
msf auxiliary(smb_ms17_010) > show options Module options (auxiliary/scanner/smb/smb_ms17_010): Name Current Setting Required Description
---- --------------- -------- -----------
CHECK_DOPU true yes Check for DOUBLEPULSAR on vulnerable hosts
RHOSTS yes The target address range or CIDR identifier
RPORT yes The SMB service port (TCP)
SMBDomain . no The Windows domain to use for authentication
SMBPass no The password for the specified username
SMBUser no The username to authenticate as
THREADS yes The number of concurrent threads
但如何设定从文件中读取目标地址呢?
其实可以使用file指定读取的目标文件...如下:
msf auxiliary(smb_ms17_010) > set rhosts file:/root/pentest/-all.txt # 设置读取的文件
rhosts => file:/root/pentest/-all.txt
msf auxiliary(smb_ms17_010) > show options Module options (auxiliary/scanner/smb/smb_ms17_010): Name Current Setting Required Description
---- --------------- -------- -----------
CHECK_DOPU true yes Check for DOUBLEPULSAR on vulnerable hosts
RHOSTS file:/root/pentest/-all.txt yes The target address range or CIDR identifier
RPORT yes The SMB service port (TCP)
SMBDomain . no The Windows domain to use for authentication
SMBPass no The password for the specified username
SMBUser no The username to authenticate as
THREADS yes The number of concurrent threads msf auxiliary(smb_ms17_010) > set threads
threads =>
msf auxiliary(smb_ms17_010) > show options Module options (auxiliary/scanner/smb/smb_ms17_010): Name Current Setting Required Description
---- --------------- -------- -----------
CHECK_DOPU true yes Check for DOUBLEPULSAR on vulnerable hosts
RHOSTS file:/root/pentest/-all.txt yes The target address range or CIDR identifier
RPORT yes The SMB service port (TCP)
SMBDomain . no The Windows domain to use for authentication
SMBPass no The password for the specified username
SMBUser no The username to authenticate as
THREADS yes The number of concurrent threads
设置完成之后,就可以执行扫描了。
msf auxiliary(smb_ms17_010) > spool ms17-.txt # 输出记录写入到文件
[*] Spooling to file ms17-.txt...
msf auxiliary(smb_ms17_010) > exploit # 执行检测 [-] 10.0.0.17: - An SMB Login Error occurred while connecting to the IPC$ tree.
[-] 10.0.0.13: - Host does NOT appear vulnerable.
[-] 10.0.0.14: - Host does NOT appear vulnerable.
[-] 10.0.0.2: - Host does NOT appear vulnerable.
[-] 10.0.0.11: - Host does NOT appear vulnerable. [-] 10.2.2.25: - Host does NOT appear vulnerable.
[-] 10.2.3.160: - Host does NOT appear vulnerable.
[-] 10.2.3.162: - Host does NOT appear vulnerable.
[-] 10.5.0.2: - An SMB Login Error occurred while connecting to the IPC$ tree.
[-] 10.5.0.11: - Host does NOT appear vulnerable.
[-] 10.5.0.13: - Host does NOT appear vulnerable.
[-] 10.5.0.24: - Host does NOT appear vulnerable.
[+] 10.5.0.25: - Host is likely VULNERABLE to MS17-! (Windows Server R2 Standard )
扫描结束之后,使用spool off,即可停止记录。
ms17-010.txt文件中将会保存所有的检测记录。
Metasploit从文件中读取目标地址的更多相关文章
- 【Python】从文件中读取数据
从文件中读取数据 1.1 读取整个文件 要读取文件,需要一个包含几行文本的文件(文件PI_DESC.txt与file_reader.py在同一目录下) PI_DESC.txt 3.1415926535 ...
- 条形码的应用三-----------从Excel文件中读取条形码
条形码的应用三------从Excel文件中读取条形码 介绍 上一篇文章,我向大家展示了生成多个条形码并存储到Excel文件中的一个方法.后来我又有了个想法:既然条码插入到excel中了,我可不可以从 ...
- Servlet从本地文件中读取图片,并显示在页面中
import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpSer ...
- 文件_ _android从资源文件中读取文件流并显示的方法
======== 1 android从资源文件中读取文件流并显示的方法. 在android中,假如有的文本文件,比如TXT放在raw下,要直接读取出来,放到屏幕中显示,可以这样: private ...
- 在C#中用Linq从属性文件中读取键值对Key-Value Pair
博客搬到了fresky.github.io - Dawei XU,请各位看官挪步.最新的一篇是:在C#中用Linq从属性文件中读取键值对Key-Value Pair.
- Python3 将configparser从ini文件中读取的内容转换成字典格式
因为写脚本的用到了,所以研究了下怎么将configparser从ini文件中读取的内容转换成字典格式. 整理一下,希望能对大家有帮助. 从http://stackoverflow.com/questi ...
- macOS下利用dSYM文件将crash文件中的内存地址转换为可读符号
一.使用流程 Windows下的程序运行崩溃时,往往可以利用pdb文件快速解析出程序崩溃的具体位置,甚至可以对应到源代码的具体行数.macOS下的symbolicatecrash也具备相应的功能.对应 ...
- Python3实现从文件中读取指定行的方法
from:http://www.jb51.net/article/66580.htm 这篇文章主要介绍了Python3实现从文件中读取指定行的方法,涉及Python中linecache模块操作文件的使 ...
- Java将对象保存到文件中/从文件中读取对象
1.保存对象到文件中 Java语言只能将实现了Serializable接口的类的对象保存到文件中,利用如下方法即可: public static void writeObjectToFile(Obje ...
随机推荐
- 后端程序猿标配之linux命令
超清图片,可放大查看. 来源:https://www.cnblogs.com/ryanlamp/p/7511883.html
- js打乱数组排序
用到的知识点:Math.random()//用于打乱数组索引 random() 方法可返回介于 0(包含) ~ 1(不包含) 之间的一个随机数. var arr=[1,2,3,4,5,6]; for( ...
- .NET Core环境变量和用户秘钥实现开发中的数据安全
目录 一.注入 IConfiguration 二.从配置文件 appsettings.json 中获取环境变量 三.从项目中获取环境变量 四.用户秘钥设置环境变量 前言:有很多人将秘钥,数据库连接字符 ...
- LeetCode 11月第2周题目汇总
开源地址:点击该链接 前言 最近比较忙,这周几乎没有刷题,只刷了6道题~ 题目汇总 0387_first_unique_character_in_a_string类似的题目比较多了,字符串中找出特别的 ...
- python函数编程-偏函数partial function
一般的,通过设定函数参数的默认值,可以减低函数调用的难度.比如:int()函数可以把字符串转换成整数: >>> int(') 123 事实上,int()函数还提供额外的base参数, ...
- css3 伪类实现右箭头→
css3 实现右箭头→ <!DOCTYPE html> <html lang="en"> <head> <meta charset=&qu ...
- Hadoop2.8分布式集群安装与测试
1.hadoop2.x 概述 个).每一个都有相同的职能.一个是active状态的,一个是standby状态的.当集群运行时,只有active状态的NameNode是正常工作的,standby状态的N ...
- 【杭研大咖说】温正湖:6年,从不会写SQL到数据库专家
他是业界主流数据库技术会议的明星讲师,开源社区各种分享活动的活跃分子:他累计申请了10多个技术发明专利,已授权8个:他近一年发布60多篇高质量技术博客文章,阅读量数十万:他和团队对MyRocks的优化 ...
- Password Management:Hardcoded Password 密码管理:硬编码密码
- js 注意事项使用误区
1.加法注意事项 2.浮点数注意事项 3.js,数组需使用数字作为下标索引,不支持关联数组的用法.对象不能混淆使用数组的length方法,并且不能使用数字作为下标,得使用属性值作为下标使用,否则会返回 ...