How to Create Persistent Agent using Metasploit

Let's discuss Create persistent agent using Metasploit? Metasploit Framework additionally used to create a stand-alone executable that may persist on a compromised system and permit interactive communications. Benefit to create persistent agent utilizing metasploit is that it may be ready and examined prematurely to make sure connectivity and encoded to bypass native antivirus software program.

Create persistent agent using Metasploit

To make a easy stand-alone agent, launch msfconsole on a command immediate in Kali.

Use msfpayload to craft the persistence agent. Within the instance proven within the following screenshot, the agent is configured to make use of a reverse_tcp shell that may hook up with the native host at 192.168.forty three.a hundred thirty on port 4444. The agent, named attack1.exe, will use a win32 executable template.

The stand-alone agent will solely work on compromised techniques with no antivirus put in, or if the antivirus has first been disabled utilizing the suitable meterpreter command. To bypass the antivirus, the backdoor should be encoded. There are a number of totally different choices for encoding the payload, as proven within the following screenshot:

style="display:block; text-align:center;"
data-ad-layout="in-article"
data-ad-format="fluid"
data-ad-client="ca-pub-6851151556093185"
data-ad-slot="4254333841">


To see the accessible choices, use the present encoders command.

Metasploit makes use of roughly 30 completely different encoders; by default, it is going to choose essentially the most acceptable encoder if one just isn't specified.

An excellent common encoder to make use of is shikata_ga_nai. This encoder implements polymorphic XOR additive suggestions encoding in opposition to a four-byte key, and it's the solely encoder ranked as "wonderful" by Metasploit.

To encode the beforehand ready assault.exe agent, we use the next command:
msf>msfencode -i assault.exe -o encoded_attack.exe -e x86/shikata_ga_nai -c 5 -t exe

This encodes the assault.exe agent 5 instances utilizing the shikata_ga_nai protocol. Every time it's re-encoded, it turns into tougher to detect. Nevertheless, the executable additionally will increase in dimension. The total payload will be created straight from the command line in Kali. Not solely can it's encoded, however we are able to configure the encoding sample to keep away from sure characters. For instance, the next characters ought to be prevented when encoding a persistent agent as a result of they could lead to discovery and failure of the assault:

  • \x00 represents a zero-byte deal with

  • \xa0 represents a line feed

  • \xad represents a carriage return


To create a multiencoded payload, use the next command:
msf>msfpayload home windows/meterpreter/bind_tcp LPORT=444 R| msfencode -e x86/shikata_ga_nai -c 5 -t uncooked -a x86 -b '\x00\x0a\x0d' -c 5 -x /root/Desktop/assault.exe -o /root/Desktop/encoded_attack.exe

You may as well encode msfpayload to an present executable, and each the modified executable and the persistent agent will perform. To bind the persistent agent to an executable resembling a calculator (calc.exe), first copy the suitable calc.exe file into Metasploit's template folder positioned at /usr/share/metasploit-framework/ knowledge/templates.  When the template is in place, use the next command:
msf>msfpayload home windows/meterpreter/bind_tcp LPORT=444 R| msfencode -t exe -x calc.exe -okay -o encoded_calc_attack.exe -e x86/shikata_ga_nai -c 5

The agent could be positioned on the goal system, renamed calc.exe to switch the unique calculator, after which executed.

style="display:block; text-align:center;"
data-ad-layout="in-article"
data-ad-format="fluid"
data-ad-client="ca-pub-6851151556093185"
data-ad-slot="4254333841">


Sadly, practically all Metasploit-encoded executables could be detected by shopper antivirus software program. This has been attributed to penetration testers who've submitted encrypted payloads to websites corresponding to VirusTotal. Nevertheless, you possibly can create an executable after which encrypt it utilizing Veil-Evasion,

COMMENTS

Name

AC Milan,4,Arsenal,8,Atalanta,5,Atletico Madrid,6,Barcelona,15,Bayern München,5,Bundesliga,9,Business,1,Chelsea,12,Coronavirus,2,Cristiano Ronaldo,13,Dortmund,1,Ethical Hacking,46,Exploitation,35,FA Cup,2,Featured,196,Football,209,Footprinting,29,Google Adsense,2,Inter Milan,5,Juventus,15,Kali Linux,39,Kali NetHunter,3,LaLiga,39,Lazio,4,Leicester City,6,Ligue 1,26,Liverpool,11,Lyon,5,Make Money,3,Manchester City,14,Manchester United,13,Messi,2,Metasploit,1,Napoli,4,Offensive Security,17,Penetration Testing,15,Politics,2,Post Exploitation,19,Premier League,58,PSG,6,Real Madrid,13,Roma,3,Search Engine Optimization,4,Serie A,32,Sevilla,1,Sports,180,Technology,36,Tips,16,Tottenham Hotspur,9,Trending,424,UEFA Champions League,10,UEFA Europa League,11,United States,1,Windows,7,World News,7,
ltr
item
My Hack Stuff: How to Create Persistent Agent using Metasploit
How to Create Persistent Agent using Metasploit
My Hack Stuff
https://www.myhackstuff.com/2017/07/how-to-create-persistent-agent-using.html
https://www.myhackstuff.com/
https://www.myhackstuff.com/
https://www.myhackstuff.com/2017/07/how-to-create-persistent-agent-using.html
true
1336489415246004999
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy Table of Content