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

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:

主站蜘蛛池模板: 客服| 临沧市| 昔阳县| 万盛区| 北流市| 浮梁县| 太保市| 章丘市| 巩留县| 周口市| 呼图壁县| 凤山县| 乌鲁木齐市| 潢川县| 徐闻县| 孟村| 海伦市| 曲靖市| 两当县| 眉山市| 儋州市| 夹江县| 弥渡县| 揭东县| 乡宁县| 阳江市| 台南市| 洮南市| 水富县| 海口市| 酉阳| 茶陵县| 龙江县| 博湖县| 郎溪县| 新和县| 酒泉市| 镶黄旗| 定远县| 山丹县| 都江堰市|