- 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:

- 網(wǎng)絡空間安全:管理者讀物
- 計算機使用安全與防護
- 網(wǎng)絡安全技術及應用(第3版)
- Python Penetration Testing Cookbook
- Building a Home Security System with BeagleBone
- API安全技術與實戰(zhàn)
- Kerberos域網(wǎng)絡安全從入門到精通
- 信息安全等級保護測評與整改指導手冊
- Mastering Metasploit
- 隱私保護機器學習
- 黑客攻防從入門到精通:黑客與反黑客工具篇(第2版)
- Metasploit 5.0 for Beginners
- 惡意軟件、Rootkit和僵尸網(wǎng)絡
- 深入探索區(qū)塊鏈
- 復雜網(wǎng)絡環(huán)境下訪問控制技術