File tree Expand file tree Collapse file tree 1 file changed +1
-9
lines changed
modules/auxiliary/spoof/cisco Expand file tree Collapse file tree 1 file changed +1
-9
lines changed Original file line number Diff line number Diff line change @@ -71,23 +71,15 @@ def run
71
71
def do_spoof
72
72
print_status ( "Sending CDP message on #{ interface } " )
73
73
p = prep_cdp # Preparation of the CDP content
74
- dst_mac = "\x01 \x00 \x0C \xCC \xCC \xCC " # CDP multicast
75
-
76
- # Source Mac Address Preparation
77
- src_mac = mac_to_bytes ( smac )
78
74
79
75
# Injecting packet to the network
80
76
l = PacketFu ::Inject . new ( iface : interface )
81
77
cdp_length = [ "%04X" % ( p . length + 8 ) . to_s ] . pack ( 'H*' )
82
- dot3 = dst_mac + src_mac + cdp_length
78
+ dot3 = PacketFu :: EthHeader . mac2str ( "01:00:0C:CC:CC:CC" ) + PacketFu :: EthHeader . mac2str ( smac ) + cdp_length
83
79
llc = "\xAA \xAA \x03 \x00 \x00 \x0c \x20 \x00 "
84
80
l . array_to_wire ( array : [ dot3 + llc + p ] )
85
81
end
86
82
87
- def mac_to_bytes ( mac )
88
- [ mac . gsub ( ':' , '' ) ] . pack ( 'H*' )
89
- end
90
-
91
83
def prep_cdp
92
84
# device ID
93
85
p = tlv ( 1 , datastore [ 'DEVICE_ID' ] )
You can’t perform that action at this time.
0 commit comments