AUTOMATE TASKS IN BETTERCAP USING CAPLETS

·

0 min read

Bettercap contains various tools and each tool has different options that we often define manually before using them. Try to imagine that you want to perform an attack and you have to set up different options. Obviously you open bettercap and type it as you want. But the problem is as soon as you will relaunch bettercap you will have to retype these commands again. IT can be tiring at a certain moment. If you are in this situation, you may probably asked yourself , how can we automate those settings? Well by using caplets.

A caplet is a file (with extension .cap) containing all your commands that you should have typed one by one in bettercap. Its objective is to make your life easier (^_^) to gain time and productivity.

For example, in our previous article on how to perform ARP spoof using bettercap, we had to enable some modules such as net.recon, net.probeand define some options before launching our arp.spoof module.

Guess what? We can get all that ready while starting bettercap by specifying a caplet at the start of bettercap.

For this scenario, let’s us write a script to perform arp spoof

First let’s create and open a file named arpspoof.cap, for example you can rename as you want but it must have the extension .cap. Assuming that we know our targets are 192.168.177.132 & 192.168.177.136 let’s write in the caplet, all the commands needed to do arp spoof on those targets:

 net.recon on
 net.probe on
 set arp.spoof.fullduplex true
 set arp.spoof.targets 192.168.177.132,192.168.177.136
 arp.spoof on

These are the essential to perform arp spoof. Lets save it and launch bettercap by specifying this caplet file. To do so:

bettercap -caplet <PATH_OF_CAPLET>

In my case, I am in the directory containing myc aplet, so:

bettercap -caplet arpsoof.cap

caplet.png

We can see that the modules specified in the caplets are running at startup.

This is how simple to write a bettercap script. For more details, I invite you checking the official documentation of bettercap.

Thanks for reading, if you struggle make sure to comment bellow and I will be glad to help.

Feel free to check the tutorials I have posted about bettercap tools. Have fun.