Skip to content

Commit 0d51cf8

Browse files
added methods to arpspoofer
1 parent db96ad5 commit 0d51cf8

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

arpspoof/arpspoof.go

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ type ARPSpoofConfig struct {
5353

5454
// NewARPSpoofConfig creates ARPSpoofConfig from a list of options separated by semicolon and logger.
5555
//
56-
// Example: "targets 10.0.0.1,10.0.0.5-10,192.168.1.*,192.168.10.0/24;fullduplex false;debug true;interface eth0;gateway 192.168.1.1"`.
56+
// Example: "targets 10.0.0.1,10.0.0.5-10,192.168.1.*,192.168.10.0/24;fullduplex false;debug true;interface eth0;gateway 192.168.1.1".
5757
// All fields in configuration string are optional.
5858
func NewARPSpoofConfig(s string, logger *zerolog.Logger) (*ARPSpoofConfig, error) {
5959
asc := &ARPSpoofConfig{Logger: logger}
@@ -173,6 +173,30 @@ type ARPSpoofer struct {
173173
p *packet.Conn
174174
}
175175

176+
func (ar *ARPSpoofer) Interface() *net.Interface {
177+
return ar.iface
178+
}
179+
180+
func (ar *ARPSpoofer) GatewayIP() netip.Addr {
181+
return ar.gwIP
182+
}
183+
184+
func (ar *ARPSpoofer) GatewayMAC() net.HardwareAddr {
185+
return ar.gwMAC
186+
}
187+
188+
func (ar *ARPSpoofer) HostIP() netip.Addr {
189+
return ar.hostIP
190+
}
191+
192+
func (ar *ARPSpoofer) HostMAC() net.HardwareAddr {
193+
return ar.hostMAC
194+
}
195+
196+
func (ar *ARPSpoofer) ARPTable() *ARPTable {
197+
return ar.arpTable
198+
}
199+
176200
func NewARPSpoofer(conf *ARPSpoofConfig) (*ARPSpoofer, error) {
177201
arpspoofer := &ARPSpoofer{}
178202
// determining interface

0 commit comments

Comments
 (0)