b1_网络漏洞扫描

利用一些自动化的工具来发现网络上各类主机设备的安全漏洞,即漏洞扫描器
使用Nmap具有狙击的效果,使用openvas具有扫射的效果

笔记主要寻求一种能结合sock5代理进行网络漏洞扫描的方案,因为进行攻击的电脑 与被攻击的电脑处于不同的网络,但被攻击的网络中存在攻击者阵营的mobile phone,借助其提供的sock5代理通道访问该被攻击网络。
那么,攻击者的电脑可以因此发起漏洞扫描吗?

openvas这类通用漏洞扫描器是一种高度自动化的工具,存在的问题:

  1. 扫描过程过于简单粗暴,对于隐秘渗透的任务会易于暴露
  2. 存在漏洞误报的情况
  3. 对一些特殊的环境具有杀伤性

1 Nmap

Nmap可以利用Nse脚本实现对某个漏洞的扫描,或者某一群漏洞的扫描

1.1 相关参考资料

1.2 namp中的proxy参数

官方文档引用:
–proxies (Relay TCP connections through a chain of proxies)

Asks Nmap to establish TCP connections with a final target through supplied 
chain of one or more HTTP or SOCKS4 proxies. Proxies can help hide the true 
source of a scan or evade certain firewall restrictions, but they can hamper 
scan performance by increasing latency. Users may need to adjust Nmap timeouts
and other scan parameters accordingly. In particular, a lower --max-parallelism
may help because some proxies refuse to handle as many concurrent connections
as Nmap opens by default.

This option takes a list of proxies as argument, expressed as URLs in the 
format proto://host:port. Use commas to separate node URLs in a chain. No
 authentication is supported yet. Valid protocols are HTTP and SOCKS4.

Warning: this feature is still under development and has limitations. It is
implemented within the nsock library and thus has no effect on the ping, port
scanning and OS discovery phases of a scan. Only NSE and version scan benefit
from this option so far—other features may disclose your true address. SSL
connections are not yet supported, nor is proxy-side DNS resolution 
(hostnames are always resolved by Nmap).

从这段话可以看出这个功能只支持http和socks4,或者说Nmap目前只支持这两种代理方式,
因此无论是使用proxychains的方式,还是使用Nmap自身的proxy参数
意图使用sock5代理来实现是无法成功的。
当然,对于局域网内使用nmap进行漏洞扫描还是可以的。

1.3 关于proxychains + nmap + sock4代理的问题

proxychains只会代理TCP连接,而ping使用的是ICMP,故而ping不能生效

The support for proxy with nmap is very limited. Especially you cannot  
do any kind of ICMP (ping) or UDP scans, no SYN stealth scan, no OS   
detection etc. This means that the default nmap commands you are using  
will not work with a proxy and depending on the implementation will   
either fail or will bypass the proxy. You have to limit yourself to  
only the kind of scanning which is supported through proxies,   
i.e. simple TCP connections.

其他相关评论:

  1. this is a known problem with the classic Proxychains program,which is not currently maintained. Proxychains_NG is a good alternative;it is actively maintained,and does not suffer from this particular crash.
    (此处提出改用Proxychains-NG版本可以解决,实际上是4.x以上版本,而kali linux自带的是3.1版本)
  2. For me,the solution was,that I disabled the DNS through socks:in /etc/proxychains.conf file,just add a # before the line “proxy_dns”

这些评论未做验证

2 OpenVAS

2.1 相关参考资料

2.2 OpenVAS的操作指引

命令行启动或停止openvas服务

openvas-start  
openvas-stop

配置IP地址,使其他客户端也能访问,但需要在该机器上安装openvas的客户端程序

vim /etc/default/greenbone-security-assistant

2.2.1 浏览器访问管理界面,图形界面进行操作

2.2.2 msf + OpenVAS,命令行进行操作

在msf中使用,需先启动openvas服务

$ openvas-start

加载openvas

$ msfconsole
msf > load openvas

帮助,使用help命令获取openvas的所有命令
直接输入该命令可以获得该命令的参数信息

连接Openvas的管理引擎

msf > openvas_connect admin password 127.0.0.1 9390 ok

列出当前服务中存在的目标

msf > openvas_target_list

列出当前服务中存在的任务

msf > openvas_task_list

其中在任务运行时,可以通过调用该指令查看progress字段得出当前进度信息,
-1代表完成,数值转化为百分比

其他命令:

  1. 使用openvas_target_create创建目标
  2. 使用openvas_config_list列出任务的所有可选配置
  3. 使用openvas_task_create创建任务
  4. 使用openvas_task_start开启任务
  5. 使用openvas_report_list列出所有可使用报告
  6. 使用openvas_format_list列出所有可使用的报告的文件格式
  7. 使用openvas_report_download下载报告

2.3 openVAS使用代理的问题

只找到http代理

3 使用Nmap-android进行漏洞扫描可行吗?

Nmap works on both rooted and non rooted phones. On non rooted phones you will be limited to functions which are possible as non-root user

At this point you can configure and compile just Nmap. This will be without LUA library support (–without -liblua) which will disable all of the NSE scripts that have been created for Nmap as well as the additional command line tools ncat, ndiff,
and nping.

NSE脚本依赖于lua库,anroid版还不支持,而Nmap的漏洞扫描用的就是NSE

4 根据已知开放的端口,进行自动攻击尝试

按照他的意思就是说:在手机端利用anroid-Nmap扫描出IP,此时IP已知,远端主机对这些IP进行漏洞扫描, 而这样问题还是回归到Nmap和OpenVas的漏洞扫描方案回去。那么可否将漏洞扫描直接转变为漏洞攻击呢?我们一开始的目标也是为了获取存在的漏洞,进而发起攻击。 但问题是我们不知道目标设备们存在哪些漏洞,但我们知道他们开放了哪些端口,可否让msf对这些端口
匹配的漏洞进行批量自动攻击?

转文档<自动攻击.md>

猜你喜欢

转载自blog.csdn.net/yeshankuangrenaaaaa/article/details/85993750