官术网_书友最值得收藏!

Setting up a wired connection

In the default Kali Linux VMware image or ISO configuration, Kali Linux uses Network Address Translation (NAT) as the network's connection type. In this connection mode, the Kali Linux machine will be able to connect to the outside world through the host operating system, whereas the outside world, including the host operating system, will not be able to connect to the Kali Linux virtual machine.

For the penetration testing task, you might need to change this networking method to Bridged Adapter. The following are the steps to change it:

  1. First, make sure you have already powered off the virtual machine.
  2. Then, open up the VirtualBox Manager, select the appropriate virtual machine—in this case we are using the Kali Linux virtual machine—and then click on the Network icon on the right-hand side and change the Attached to drop-down box from NAT to Bridged Adapter in Adapter 1. In the Name field, you can select the network interface that is connected to the network you want to test, as shown in the following screenshot:

To be able to use the bridge network connection, the host machine needs to connect to a network device that can give you an IP address via DHCP, such as a router or a switch.

As you may be aware, a DHCP IP address is not a permanent IP address; it's just a lease IP address. After several times (as defined in the DHCP lease time), the Kali Linux virtual machine will need to get a lease IP address again. This IP address might be the same as the previous one or might be a different one.

If you want to make the IP address permanent, you can do so by saving the IP address in the /etc/network/interfaces file.

The following is the default content of this file in Kali Linux:

  • auto lo
  • iface lo inet loopback

In the default configuration, all of the network cards are set to use DHCP to get the IP address. To make a network card bind to an IP address permanently, we have to edit that file and change the content to the following:

  • auto eth0
  • iface eth0 inet static
  • address 10.0.2.15
  • netmask 255.255.255.0
  • network 10.0.2.0
  • broadcast 10.0.2.255
  • gateway 10.0.2.2

Here, we set the first network card (eth0) to bind to the IP address of 10.0.2.15. You may need to adjust this configuration according to the network environment you want to test.

主站蜘蛛池模板: 突泉县| 洪泽县| 丰都县| 方城县| 秦皇岛市| 宣城市| 沙河市| 广丰县| 崇文区| 广汉市| 平和县| 民乐县| 甘南县| 庆安县| 噶尔县| 中阳县| 凌云县| 科技| 赣州市| 西安市| 普兰县| 阿合奇县| 绍兴县| 绵竹市| 永福县| 九龙城区| 抚顺市| 敖汉旗| 克拉玛依市| 黄山市| 深水埗区| 木里| 安福县| 光泽县| 如皋市| 石楼县| 韩城市| 华池县| 桓台县| 峨山| 三穗县|