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 ...
随机推荐
- 深入探索Java设计模式(三)之装饰器模式
装饰器模式使你可以在运行时使用类似于对象组成的技术来装饰类.这在我们希望实例化具有新职责的对象而无需对基础类进行任何代码更改的情况下尤其有用.本文是在学习完优锐课JAVA架构VIP课程—[框架源码专题 ...
- ceph安装
使用ceph-deploy部署部署版本ceph-luminous 一,下载安装包,制作yum源,yum将挂载到192.168.100.100 (1)下载安装包 mkdir ceph-luminou ...
- Ubuntu 18.04 美化配置
网上很多关于Ubuntu 18.04 美化的配置,但每个人遇见的问题都有些不太一样, 现将本人配置的过程整理如下 更新源为阿里云 找到Software & Updates,将源更新为阿里云的源 ...
- Android Studio 中java 文件报错红色J
用常用的方法清除Android Studio的缓存然后重启,"File" -> "Invalidate Cashes / Restart" -> & ...
- CCF-CSP题解 201809-4 再卖菜
碎碎念..近视加老花,还以为第二天除了第二家范围在100以内别的都不确定,于是x**算的记搜复杂度超时了.还鼓捣着什么差分区间最长路,虽然有大神用差分区间做出来了,然而自己并没有看懂. 其实就是一个记 ...
- 开源WAF工具ModSecurity
0 前言 ModSecurity是一个开源的跨平台Web应用程序防火墙(WAF)引擎,用于Apache,IIS和Nginx,由Trustwave的SpiderLabs开发.作为WAF产品,ModSec ...
- conda pip 安装 dgl 并运行demo 出现:Segmentation fault (core dumped) 错误
安装dgl 并运行的时候,出现了如上错误,很是郁闷:使用 gdb python; run train.py 进行调试,发现是torch的问题:我猜测估计是torch 安装的版本过于新:于是重新安装 1 ...
- 相机位姿求解——P3P问题
1.位姿求解是计算机视觉中经常遇到的,Perspective-n-Points, PnP(P3P)提供了一种解决方案,它是一种由3D-2D的位姿求解方式,即需要已知匹配的3D点和图像2D点.目前遇到的 ...
- Ansible-playbook之循环判断
1.循环 (loop) # 使用循环创建硬连接:x连接到y:z连接到k: - hosts: web - name: Create two hard links file: src: "{{ ...
- Linux.centos安装mysql5.7.18
一:删除已有的mysql步骤 1 卸载旧的mysql 1.1 查询有哪些mysql文件 [root@zookeeper init.d]# find / -name mysql /var/lock/su ...