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

  • Applied Network Security
  • Arthur Salmon Warun Levesque Michael McLafferty
  • 367字
  • 2021-07-02 23:31:02

Output to a file

If we are scanning multiple IP addresses, we probably want to save the output to a file for later reference. Although Nmap has many ways and formats in which to save the output, I prefer the output normal (-oN) switch.

Simply add the -oN switch at the end of the command with the name of the file you want to save the output to. Here, I have used a file named portscan.txt.

Type nmap -sS 192.168.10.70 -oN portscan:

When I run the command, I get the same output displayed in the preceding screenshot, but I also get that output saved to a file. I can view the contents of that file by using the cat, more, and less commands. Here I have used the cat command. Type cat portscan.txt:

As you can see, the output that always appears on the screen with an Nmap scan is now saved to a file for later reference and for the sake of record-keeping.

Next, we will demonstrate a lab using Metasploit. Now that we know how to scan a network using tools such as Nmap, we can use that information to send a payload to a victim. The following lab uses Kali Linux and Windows Server 2012 for this demonstration. We recommend running this lab using virtual machines if you wish to follow along.

Open your terminal (CTRL + ALT + T) and type msfvenom -h to view the available options for this Tool:

I think the information provided in this screenshot makes the use of msfvenom pretty clear.

In this lab, I want to create an exploit generated by msfvenom with a meterpreter payload, and I also want to encode it using the shikata_ga_nai encoder. To get to know the available options to set up this exploit, you can use --payload-options after you set up your payload:

Yep, there it is. We need to set up the LHOST and LPORT to make this exploit work. My IP address is 192.168.10.50, so I set the LHOST to that IP. I also want to set the LPORT to 8080 so that I will receive a connection from the victim on port 8080 if the exploit succeeds:

主站蜘蛛池模板: 正蓝旗| 郯城县| 安阳市| 昌图县| 抚州市| 盐城市| 磐石市| 宁波市| 河池市| 资中县| 阳山县| 沅陵县| 南通市| 望城县| 保康县| 台安县| 武山县| 宁河县| 吴桥县| 曲麻莱县| 广元市| 平度市| 于田县| 奉新县| 西藏| 德庆县| 介休市| 璧山县| 遂溪县| 武邑县| 临泉县| 收藏| 寿宁县| 安岳县| 安国市| 连州市| 三台县| 龙陵县| 宁武县| 沈阳市| 黄冈市|