scapy.layers.bluetooth

蓝牙层,套接字和发送/接收功能.

class scapy.layers.bluetooth.ATT_Error_Response

Bases: scapy.packet.Packet

aliastypes
fields_desc
ATT_Error_Response字段

request

XByteField

0

handle

LEShortField

0

ecode

ByteEnumField

0

class scapy.layers.bluetooth.ATT_Exchange_MTU_Request

Bases: scapy.packet.Packet

aliastypes
fields_desc
ATT_Exchange_MTU_Request字段

mtu

LEShortField

0

class scapy.layers.bluetooth.ATT_Exchange_MTU_Response

Bases: scapy.packet.Packet

aliastypes
fields_desc
ATT_Exchange_MTU_Response字段

mtu

LEShortField

0

class scapy.layers.bluetooth.ATT_Execute_Write_Request

Bases: scapy.packet.Packet

aliastypes
fields_desc
ATT_Execute_Write_Request fields

flags

ByteEnumField

1

class scapy.layers.bluetooth.ATT_Execute_Write_Response

Bases: scapy.packet.Packet

aliastypes
class scapy.layers.bluetooth.ATT_Find_By_Type_Value_Request

Bases: scapy.packet.Packet

aliastypes
fields_desc
ATT_Find_By_Type_Value_Request字段

start

XLEShortField

1

end

XLEShortField

65535

uuid

XLEShortField

None

data

StrField

b''

class scapy.layers.bluetooth.ATT_Find_By_Type_Value_Response

Bases: scapy.packet.Packet

aliastypes
fields_desc
ATT_Find_By_Type_Value_Response字段

handles

PacketListField

[]

class scapy.layers.bluetooth.ATT_Find_Information_Request

Bases: scapy.packet.Packet

aliastypes
fields_desc
ATT_Find_Information_Request字段

start

XLEShortField

0

end

XLEShortField

65535

class scapy.layers.bluetooth.ATT_Find_Information_Response

Bases: scapy.packet.Packet

aliastypes
fields_desc
ATT_Find_Information_Response字段

format

XByteField

1

handles

PacketListField (Cond)

[]

handles

PacketListField (Cond)

[]

class scapy.layers.bluetooth.ATT_Handle

Bases: scapy.packet.Packet

aliastypes
extract_padding(s)
fields_desc
ATT_Handle字段

handle

XLEShortField

0

value

XLEShortField

0

class scapy.layers.bluetooth.ATT_Handle_UUID128

Bases: scapy.packet.Packet

aliastypes
extract_padding(s)
fields_desc
ATT_Handle_UUID128字段

handle

XLEShortField

0

value

UUIDField

None

class scapy.layers.bluetooth.ATT_Handle_Value_Indication

Bases: scapy.packet.Packet

aliastypes
fields_desc
ATT_Handle_Value_Indication字段

gatt_handle

XLEShortField

0

value

StrField

b''

class scapy.layers.bluetooth.ATT_Handle_Value_Notification

Bases: scapy.packet.Packet

aliastypes
fields_desc
ATT_Handle_Value_Notification字段

gatt_handle

XLEShortField

0

value

StrField

b''

class scapy.layers.bluetooth.ATT_Handle_Variable(_pkt=b'', val_length=2, **kwargs)

Bases: scapy.packet.Packet

aliastypes
extract_padding(s)
fields_desc
ATT_Handle_Variable字段

handle

XLEShortField

0

value

XStrLenField

0

val_length
class scapy.layers.bluetooth.ATT_Hdr

Bases: scapy.packet.Packet

aliastypes
fields_desc
ATT_Hdr字段

opcode

XByteField

None

payload_guess

可能的子层: ATT_Error_ResponseATT_Exchange_MTU_RequestATT_Exchange_MTU_ResponseATT_Execute_Write_RequestATT_Execute_Write_ResponseATT_Find_By_Type_Value_RequestATT_Find_By_Type_Value_ResponseATT_Find_Information_RequestATT_Find_Information_ResponseATT_Handle_Value_IndicationATT_Handle_Value_NotificationATT_Prepare_Write_RequestATT_Prepare_Write_ResponseATT_Read_Blob_RequestATT_Read_Blob_ResponseATT_Read_By_Group_Type_RequestATT_Read_By_Group_Type_ResponseATT_Read_By_Type_Request_128bitATT_Read_By_Type_RequestATT_Read_By_Type_ResponseATT_Read_Multiple_RequestATT_Read_Multiple_ResponseATT_Read_RequestATT_Read_ResponseATT_Write_CommandATT_Write_RequestATT_Write_Response

class scapy.layers.bluetooth.ATT_Prepare_Write_Request

Bases: scapy.packet.Packet

aliastypes
fields_desc
ATT_Prepare_Write_Request字段

gatt_handle

XLEShortField

0

offset

LEShortField

0

data

StrField

b''

class scapy.layers.bluetooth.ATT_Prepare_Write_Response

Bases: scapy.layers.bluetooth.ATT_Prepare_Write_Request

aliastypes
fields_desc
ATT_Prepare_Write_Response字段

gatt_handle

XLEShortField

0

offset

LEShortField

0

data

StrField

b''

class scapy.layers.bluetooth.ATT_Read_Blob_Request

Bases: scapy.packet.Packet

aliastypes
fields_desc
ATT_Read_Blob_Request字段

gatt_handle

XLEShortField

0

offset

LEShortField

0

class scapy.layers.bluetooth.ATT_Read_Blob_Response

Bases: scapy.packet.Packet

aliastypes
fields_desc
ATT_Read_Blob_Response fields

value

StrField

b''

class scapy.layers.bluetooth.ATT_Read_By_Group_Type_Request

Bases: scapy.packet.Packet

aliastypes
fields_desc
ATT_Read_By_Group_Type_Request字段

start

XLEShortField

0

end

XLEShortField

65535

uuid

XLEShortField

0

class scapy.layers.bluetooth.ATT_Read_By_Group_Type_Response

Bases: scapy.packet.Packet

aliastypes
fields_desc
ATT_Read_By_Group_Type_Response字段

length

XByteField

0

data

StrField

b''

class scapy.layers.bluetooth.ATT_Read_By_Type_Request

Bases: scapy.packet.Packet

aliastypes
fields_desc
ATT_Read_By_Type_Request字段

start

XLEShortField

1

end

XLEShortField

65535

uuid

XLEShortField

None

class scapy.layers.bluetooth.ATT_Read_By_Type_Request_128bit

Bases: scapy.packet.Packet

aliastypes
classmethod dispatch_hook(_pkt=None, *args, **kargs)
fields_desc
ATT_Read_By_Type_Request_128bit字段

start

XLEShortField

1

end

XLEShortField

65535

uuid1

XLELongField

None

uuid2

XLELongField

None

class scapy.layers.bluetooth.ATT_Read_By_Type_Response

Bases: scapy.packet.Packet

aliastypes
fields_desc
ATT_Read_By_Type_Response字段

len

ByteField

4

handles

PacketListField

[]

class scapy.layers.bluetooth.ATT_Read_Multiple_Request

Bases: scapy.packet.Packet

aliastypes
fields_desc
ATT_Read_Multiple_Request字段

handles

FieldListField

[]

class scapy.layers.bluetooth.ATT_Read_Multiple_Response

Bases: scapy.packet.Packet

aliastypes
fields_desc
ATT_Read_Multiple_Response字段

values

StrField

b''

class scapy.layers.bluetooth.ATT_Read_Request

Bases: scapy.packet.Packet

aliastypes
fields_desc
ATT_Read_Request字段

gatt_handle

XLEShortField

0

class scapy.layers.bluetooth.ATT_Read_Response

Bases: scapy.packet.Packet

aliastypes
fields_desc
ATT_Read_Response字段

value

StrField

b''

class scapy.layers.bluetooth.ATT_Write_Command

Bases: scapy.packet.Packet

aliastypes
fields_desc
ATT_Write_Command字段

gatt_handle

XLEShortField

0

data

StrField

b''

class scapy.layers.bluetooth.ATT_Write_Request

Bases: scapy.packet.Packet

aliastypes
fields_desc
ATT_Write_Request字段

gatt_handle

XLEShortField

0

data

StrField

b''

class scapy.layers.bluetooth.ATT_Write_Response

Bases: scapy.packet.Packet

aliastypes
exception scapy.layers.bluetooth.BluetoothCommandError

Bases: BaseException

class scapy.layers.bluetooth.BluetoothHCISocket(iface=65536, type=None)

Bases: scapy.supersocket.SuperSocket

desc = 'read/write on a BlueTooth HCI socket'
recv(x=65535)
class scapy.layers.bluetooth.BluetoothL2CAPSocket(bt_address)

Bases: scapy.supersocket.SuperSocket

desc = 'read/write packets on a connected L2CAP socket'
recv(x=65535)
class scapy.layers.bluetooth.BluetoothRFCommSocket(bt_address, port=0)

Bases: scapy.layers.bluetooth.BluetoothL2CAPSocket

在连接的RFCOMM套接字上读/写数据包

exception scapy.layers.bluetooth.BluetoothSocketError

Bases: BaseException

class scapy.layers.bluetooth.BluetoothUserSocket(adapter_index=0)

Bases: scapy.supersocket.SuperSocket

close()
desc = 'read/write H4 over a Bluetooth user channel'
flush()
readable(timeout=0)
recv(x=65535)
send_command(cmd)
class scapy.layers.bluetooth.EIR_CompleteList128BitServiceUUIDs

Bases: scapy.layers.bluetooth.EIR_Element

aliastypes
fields_desc
EIR_CompleteList128BitServiceUUIDs字段

svc_uuids

FieldListField

[]

class scapy.layers.bluetooth.EIR_CompleteList16BitServiceUUIDs

Bases: scapy.layers.bluetooth.EIR_Element

aliastypes
fields_desc
EIR_CompleteList16BitServiceUUIDs字段

svc_uuids

FieldListField

[]

class scapy.layers.bluetooth.EIR_CompleteLocalName

Bases: scapy.layers.bluetooth.EIR_Element

aliastypes
fields_desc
EIR_CompleteLocalName字段

local_name

StrLenField

b''

class scapy.layers.bluetooth.EIR_Device_ID

Bases: scapy.layers.bluetooth.EIR_Element

aliastypes
fields_desc
EIR_Device_ID字段

vendor_id_source

XLEShortField

0

vendor_id

XLEShortField

0

product_id

XLEShortField

0

version

XLEShortField

0

class scapy.layers.bluetooth.EIR_Element

Bases: scapy.packet.Packet

aliastypes
extract_padding(s)
static length_from(pkt)
class scapy.layers.bluetooth.EIR_Flags

Bases: scapy.layers.bluetooth.EIR_Element

aliastypes
fields_desc
EIR_Flags字段

flags

FlagsField (8位)

<Flag 2 (general_disc_mode)>

class scapy.layers.bluetooth.EIR_Hdr

Bases: scapy.packet.Packet

aliastypes
fields_desc
EIR_Hdr字段

len

LenField

None

type

ByteEnumField

0

mysummary()
payload_guess

可能的子层: EIR_CompleteList128BitServiceUUIDsEIR_CompleteList16BitServiceUUIDsEIR_CompleteLocalNameEIR_Device_IDEIR_FlagsEIR_IncompleteList128BitServiceUUIDsEIR_IncompleteList16BitServiceUUIDsEIR_Manufacturer_Specific_DataEIR_RawEIR_ServiceData16BitUUIDEIR_ShortenedLocalNameEIR_TX_Power_Level

class scapy.layers.bluetooth.EIR_IncompleteList128BitServiceUUIDs

Bases: scapy.layers.bluetooth.EIR_CompleteList128BitServiceUUIDs

aliastypes
fields_desc
EIR_IncompleteList128BitServiceUUIDs字段

svc_uuids

FieldListField

[]

class scapy.layers.bluetooth.EIR_IncompleteList16BitServiceUUIDs

Bases: scapy.layers.bluetooth.EIR_CompleteList16BitServiceUUIDs

aliastypes
fields_desc
EIR_IncompleteList16BitServiceUUIDs字段

svc_uuids

FieldListField

[]

class scapy.layers.bluetooth.EIR_Manufacturer_Specific_Data

Bases: scapy.layers.bluetooth.EIR_Element

aliastypes
default_payload_class(payload)
extract_padding(s)
fields_desc
EIR_Manufacturer_Specific_Data字段

company_id

XLEShortField

None

payload_guess

可能的子层: Apple_BLE_Frame

classmethod register_magic_payload(payload_cls, magic_check=None)

注册使用魔术数据的有效载荷类型.

传统的有效负载需要注册蓝牙公司ID(需要蓝牙SIG的公司成员)或蓝牙短UUID(需要一次性付款).

有些替代方案不需要注册(例如128位UUID),但是信标中最大的能源消耗是无线电–因此,信标的能量消耗与信标帧中的字节数成正比.

某些信标格式通过使用其信标硬件制造商的公司ID,并在"制造商特定数据"字段的开头添加"魔术数据序列"来回避此问题.

例如,AltBeacon和GeoBeacon.

有关使用此方法的示例,请参见scapy.contrib.altbeacon .

Parameters
  • payload_clsType [ scapy.packet.Packet ] )–对要注册为有效负载的Packet子类的引用.

  • bool ] magic_checkCallable [ [ bytes ] )–(可选)可调用,用于将有效负载与此类型相关联. 如果未提供,则改用payload_cls.magic_check .

Raises

TypeError –如果未指定magic_check ,并且未实现payload_cls.magic_check .

registered_magic_payloads = {<class 'scapy.contrib.altbeacon.AltBeacon'>: <bound method AltBeacon.magic_check of <class 'scapy.contrib.altbeacon.AltBeacon'>>}
class scapy.layers.bluetooth.EIR_Raw

Bases: scapy.layers.bluetooth.EIR_Element

aliastypes
fields_desc
EIR_Raw字段

data

StrLenField

b''

class scapy.layers.bluetooth.EIR_ServiceData16BitUUID

Bases: scapy.layers.bluetooth.EIR_Element

aliastypes
extract_padding(s)
fields_desc
EIR_ServiceData16BitUUID字段

svc_uuid

XLEShortField

None

payload_guess

可能的子层: Eddystone_Frame

class scapy.layers.bluetooth.EIR_ShortenedLocalName

Bases: scapy.layers.bluetooth.EIR_CompleteLocalName

aliastypes
fields_desc
EIR_ShortenedLocalName字段

local_name

StrLenField

b''

class scapy.layers.bluetooth.EIR_TX_Power_Level

Bases: scapy.layers.bluetooth.EIR_Element

aliastypes
fields_desc
EIR_TX_Power_Level字段

level

SignedByteField

0

class scapy.layers.bluetooth.HCI_ACL_Hdr

Bases: scapy.packet.Packet

aliastypes
fields_desc
HCI_ACL_Hdr字段

BC

BitField (2位)

0

PB

BitField (2位)

0

handle

BitField (12位)

0

len

LEShortField

None

payload_guess

可能的子层: L2CAP_Hdr

post_build(p, pay)
post_dissect(s)
pre_dissect(s)
class scapy.layers.bluetooth.HCI_Cmd_Complete_LE_Read_White_List_Size

Bases: scapy.packet.Packet

aliastypes
fields_desc
HCI_Cmd_Complete_LE_Read_White_List_Size字段

status

ByteField

0

size

ByteField

0

class scapy.layers.bluetooth.HCI_Cmd_Complete_Read_BD_Addr

Bases: scapy.packet.Packet

aliastypes
fields_desc
HCI_Cmd_Complete_Read_BD_Addr字段

addr

LEMACField

None

class scapy.layers.bluetooth.HCI_Cmd_Connect_Accept_Timeout

Bases: scapy.packet.Packet

aliastypes
fields_desc
HCI_Cmd_Connect_Accept_Timeout字段

timeout

LEShortField

32000

class scapy.layers.bluetooth.HCI_Cmd_Disconnect

Bases: scapy.packet.Packet

aliastypes
fields_desc
HCI_Cmd_Disconnect字段

handle

XLEShortField

0

reason

ByteField

19

class scapy.layers.bluetooth.HCI_Cmd_LE_Add_Device_To_White_List

Bases: scapy.packet.Packet

aliastypes
fields_desc
HCI_Cmd_LE_Add_Device_To_White_List字段

atype

ByteEnumField

0

address

LEMACField

None

class scapy.layers.bluetooth.HCI_Cmd_LE_Clear_White_List

Bases: scapy.packet.Packet

aliastypes
class scapy.layers.bluetooth.HCI_Cmd_LE_Connection_Update

Bases: scapy.packet.Packet

aliastypes
fields_desc
HCI_Cmd_LE_Connection_Update字段

handle

XLEShortField

0

min_interval

XLEShortField

0

max_interval

XLEShortField

0

latency

XLEShortField

0

timeout

XLEShortField

0

min_ce

LEShortField

0

max_ce

LEShortField

65535

class scapy.layers.bluetooth.HCI_Cmd_LE_Create_Connection

Bases: scapy.packet.Packet

aliastypes
fields_desc
HCI_Cmd_LE_Create_Connection字段

interval

LEShortField

96

window

LEShortField

48

filter

ByteEnumField

0

patype

ByteEnumField

0

paddr

LEMACField

None

atype

ByteEnumField

0

min_interval

LEShortField

40

max_interval

LEShortField

56

latency

LEShortField

0

timeout

LEShortField

42

min_ce

LEShortField

0

max_ce

LEShortField

0

class scapy.layers.bluetooth.HCI_Cmd_LE_Create_Connection_Cancel

Bases: scapy.packet.Packet

aliastypes
class scapy.layers.bluetooth.HCI_Cmd_LE_Host_Supported

Bases: scapy.packet.Packet

aliastypes
fields_desc
HCI_Cmd_LE_Host_Supported字段

supported

ByteField

1

simultaneous

ByteField

1

class scapy.layers.bluetooth.HCI_Cmd_LE_Long_Term_Key_Request_Negative_Reply

Bases: scapy.packet.Packet

aliastypes
fields_desc
HCI_Cmd_LE_Long_Term_Key_Request_Negative_Reply字段

handle

LEShortField

0

class scapy.layers.bluetooth.HCI_Cmd_LE_Long_Term_Key_Request_Reply

Bases: scapy.packet.Packet

aliastypes
fields_desc
HCI_Cmd_LE_Long_Term_Key_Request_Reply字段

handle

LEShortField

0

ltk

StrFixedLenField

b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'

class scapy.layers.bluetooth.HCI_Cmd_LE_Read_Buffer_Size

Bases: scapy.packet.Packet

aliastypes
class scapy.layers.bluetooth.HCI_Cmd_LE_Read_Remote_Used_Features

Bases: scapy.packet.Packet

aliastypes
fields_desc
HCI_Cmd_LE_Read_Remote_Used_Features字段

handle

LEShortField

64

class scapy.layers.bluetooth.HCI_Cmd_LE_Read_White_List_Size

Bases: scapy.packet.Packet

aliastypes
class scapy.layers.bluetooth.HCI_Cmd_LE_Remove_Device_From_White_List

Bases: scapy.layers.bluetooth.HCI_Cmd_LE_Add_Device_To_White_List

aliastypes
fields_desc
HCI_Cmd_LE_Remove_Device_From_White_List字段

atype

ByteEnumField

0

address

LEMACField

None

class scapy.layers.bluetooth.HCI_Cmd_LE_Set_Advertise_Enable

Bases: scapy.packet.Packet

aliastypes
fields_desc
HCI_Cmd_LE_Set_Advertise_Enable字段

enable

ByteField

0

class scapy.layers.bluetooth.HCI_Cmd_LE_Set_Advertising_Data

Bases: scapy.packet.Packet

aliastypes
fields_desc
HCI_Cmd_LE_Set_Advertising_Data字段

len

FieldLenField

None

data

PadField

[]

class scapy.layers.bluetooth.HCI_Cmd_LE_Set_Advertising_Parameters

Bases: scapy.packet.Packet

aliastypes
fields_desc
HCI_Cmd_LE_Set_Advertising_Parameters字段

interval_min

LEShortField

2048

interval_max

LEShortField

2048

adv_type

ByteEnumField

0

oatype

ByteEnumField

0

datype

ByteEnumField

0

daddr

LEMACField

None

channel_map

ByteField

7

filter_policy

ByteEnumField

0

class scapy.layers.bluetooth.HCI_Cmd_LE_Set_Random_Address

Bases: scapy.packet.Packet

aliastypes
fields_desc
HCI_Cmd_LE_Set_Random_Address字段

address

LEMACField

None

class scapy.layers.bluetooth.HCI_Cmd_LE_Set_Scan_Enable

Bases: scapy.packet.Packet

aliastypes
fields_desc
HCI_Cmd_LE_Set_Scan_Enable字段

enable

ByteField

1

filter_dups

ByteField

1

class scapy.layers.bluetooth.HCI_Cmd_LE_Set_Scan_Parameters

Bases: scapy.packet.Packet

aliastypes
fields_desc
HCI_Cmd_LE_Set_Scan_Parameters字段

type

ByteEnumField

1

interval

XLEShortField

16

window

XLEShortField

16

atype

ByteEnumField

0

policy

ByteEnumField

0

class scapy.layers.bluetooth.HCI_Cmd_LE_Set_Scan_Response_Data

Bases: scapy.packet.Packet

aliastypes
fields_desc
HCI_Cmd_LE_Set_Scan_Response_Data字段

len

FieldLenField

None

data

StrLenField

b''

class scapy.layers.bluetooth.HCI_Cmd_LE_Start_Encryption_Request

Bases: scapy.packet.Packet

aliastypes
fields_desc
HCI_Cmd_LE_Start_Encryption_Request字段

handle

LEShortField

0

rand

StrFixedLenField

None

ediv

XLEShortField

0

ltk

StrFixedLenField

b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'

class scapy.layers.bluetooth.HCI_Cmd_Read_BD_Addr

Bases: scapy.packet.Packet

aliastypes
class scapy.layers.bluetooth.HCI_Cmd_Reset

Bases: scapy.packet.Packet

aliastypes
class scapy.layers.bluetooth.HCI_Cmd_Set_Event_Filter

Bases: scapy.packet.Packet

aliastypes
fields_desc
HCI_Cmd_Set_Event_Filter字段

type

ByteEnumField

0

class scapy.layers.bluetooth.HCI_Cmd_Set_Event_Mask

Bases: scapy.packet.Packet

aliastypes
fields_desc
HCI_Cmd_Set_Event_Mask字段

mask

StrFixedLenField

b'\xff\xff\xfb\xff\x07\xf8\xbf='

class scapy.layers.bluetooth.HCI_Cmd_Write_Extended_Inquiry_Response

Bases: scapy.packet.Packet

aliastypes
fields_desc
HCI_Cmd_Write_Extended_Inquiry_Response字段

fec_required

ByteField

0

eir_data

PacketListField

[]

class scapy.layers.bluetooth.HCI_Cmd_Write_Local_Name

Bases: scapy.packet.Packet

aliastypes
fields_desc
HCI_Cmd_Write_Local_Name字段

name

StrField

'Write Local Name'

class scapy.layers.bluetooth.HCI_Command_Hdr

Bases: scapy.packet.Packet

aliastypes
answers(other)
fields_desc
HCI_Command_Hdr字段

opcode

XLEShortField

0

len

LenField

None

payload_guess

可能的子层: HCI_Cmd_Connect_Accept_TimeoutHCI_Cmd_DisconnectHCI_Cmd_LE_Add_Device_To_White_ListHCI_Cmd_LE_Clear_White_ListHCI_Cmd_LE_Connection_UpdateHCI_Cmd_LE_Create_Connection_CancelHCI_Cmd_LE_Create_ConnectionHCI_Cmd_LE_Host_SupportedHCI_Cmd_LE_Long_Term_Key_Request_Negative_ReplyHCI_Cmd_LE_Long_Term_Key_Request_ReplyHCI_Cmd_LE_Read_Buffer_SizeHCI_Cmd_LE_Read_Remote_Used_FeaturesHCI_Cmd_LE_Read_White_List_SizeHCI_Cmd_LE_Remove_Device_From_White_ListHCI_Cmd_LE_Set_Advertise_EnableHCI_Cmd_LE_Set_Advertising_DataHCI_Cmd_LE_Set_Advertising_ParametersHCI_Cmd_LE_Set_Random_AddressHCI_Cmd_LE_Set_Scan_EnableHCI_Cmd_LE_Set_Scan_ParametersHCI_Cmd_LE_Set_Scan_Response_DataHCI_Cmd_LE_Start_Encryption_RequestHCI_Cmd_Read_BD_AddrHCI_Cmd_ResetHCI_Cmd_Set_Event_FilterHCI_Cmd_Set_Event_MaskHCI_Cmd_Write_Extended_Inquiry_ResponseHCI_Cmd_Write_Local_Name

post_build(p, pay)
class scapy.layers.bluetooth.HCI_Event_Command_Complete

Bases: scapy.packet.Packet

aliastypes
answers(other)
fields_desc
HCI_Event_Command_Complete字段

number

ByteField

0

opcode

XLEShortField

0

status

ByteEnumField

0

payload_guess

可能的子层: HCI_Cmd_Complete_LE_Read_White_List_SizeHCI_Cmd_Complete_Read_BD_Addr

class scapy.layers.bluetooth.HCI_Event_Command_Status

Bases: scapy.packet.Packet

aliastypes
answers(other)
fields_desc
HCI_Event_Command_Status字段

status

ByteEnumField

0

number

ByteField

0

opcode

XLEShortField

None

class scapy.layers.bluetooth.HCI_Event_Disconnection_Complete

Bases: scapy.packet.Packet

aliastypes
fields_desc
HCI_Event_Disconnection_Complete字段

status

ByteEnumField

0

handle

LEShortField

0

reason

XByteField

0

class scapy.layers.bluetooth.HCI_Event_Encryption_Change

Bases: scapy.packet.Packet

aliastypes
fields_desc
HCI_Event_Encryption_Change字段

status

ByteEnumField

0

handle

LEShortField

0

enabled

ByteEnumField

0

class scapy.layers.bluetooth.HCI_Event_Hdr

Bases: scapy.packet.Packet

aliastypes
answers(other)
fields_desc
HCI_Event_Hdr字段

code

XByteField

0

len

LenField

None

payload_guess

可能的子层: HCI_Event_Command_CompleteHCI_Event_Command_StatusHCI_Event_Disconnection_CompleteHCI_Event_Encryption_ChangeHCI_Event_LE_MetaHCI_Event_Number_Of_Completed_Packets

class scapy.layers.bluetooth.HCI_Event_LE_Meta

Bases: scapy.packet.Packet

aliastypes
answers(other)
fields_desc
HCI_Event_LE_Meta字段

event

ByteEnumField

0

payload_guess

可能的子层: HCI_LE_Meta_Advertising_ReportsHCI_LE_Meta_Connection_CompleteHCI_LE_Meta_Connection_Update_CompleteHCI_LE_Meta_Long_Term_Key_Request

class scapy.layers.bluetooth.HCI_Event_Number_Of_Completed_Packets

Bases: scapy.packet.Packet

aliastypes
fields_desc
HCI_Event_Number_Of_Completed_Packets字段

number

ByteField

0

class scapy.layers.bluetooth.HCI_Hdr

Bases: scapy.packet.Packet

aliastypes
fields_desc
HCI_Hdr字段

type

ByteEnumField

2

mysummary()
payload_guess

可能的子层: HCI_ACL_HdrHCI_Command_HdrHCI_Event_HdrRaw

class scapy.layers.bluetooth.HCI_LE_Meta_Advertising_Report

Bases: scapy.packet.Packet

aliastypes
extract_padding(s)
fields_desc
HCI_LE_Meta_Advertising_Report字段

type

ByteEnumField

0

atype

ByteEnumField

0

addr

LEMACField

None

len

FieldLenField

None

data

PacketListField

[]

rssi

SignedByteField

0

class scapy.layers.bluetooth.HCI_LE_Meta_Advertising_Reports

Bases: scapy.packet.Packet

aliastypes
fields_desc
HCI_LE_Meta_Advertising_Reports字段

len

FieldLenField

None

reports

PacketListField

[]

class scapy.layers.bluetooth.HCI_LE_Meta_Connection_Complete

Bases: scapy.packet.Packet

aliastypes
answers(other)
fields_desc
HCI_LE_Meta_Connection_Complete字段

status

ByteEnumField

0

handle

LEShortField

0

role

ByteEnumField

0

patype

ByteEnumField

0

paddr

LEMACField

None

interval

LEShortField

54

latency

LEShortField

0

supervision

LEShortField

42

clock_latency

XByteField

5

class scapy.layers.bluetooth.HCI_LE_Meta_Connection_Update_Complete

Bases: scapy.packet.Packet

aliastypes
fields_desc
HCI_LE_Meta_Connection_Update_Complete字段

status

ByteEnumField

0

handle

LEShortField

0

interval

LEShortField

54

latency

LEShortField

0

timeout

LEShortField

42

class scapy.layers.bluetooth.HCI_LE_Meta_Long_Term_Key_Request

Bases: scapy.packet.Packet

aliastypes
fields_desc
HCI_LE_Meta_Long_Term_Key_Request字段

handle

LEShortField

0

rand

StrFixedLenField

None

ediv

XLEShortField

0

class scapy.layers.bluetooth.HCI_PHDR_Hdr

Bases: scapy.packet.Packet

aliastypes
fields_desc
HCI_PHDR_Hdr字段

direction

IntField

0

payload_guess

可能的子层: HCI_Hdr

class scapy.layers.bluetooth.L2CAP_CmdHdr

Bases: scapy.packet.Packet

aliastypes
answers(other)
fields_desc
L2CAP_CmdHdr字段

code

ByteEnumField

8

id

ByteField

0

len

LEShortField

None

payload_guess

可能的子层: L2CAP_CmdRejL2CAP_ConfReqL2CAP_ConfRespL2CAP_ConnReqL2CAP_ConnRespL2CAP_Connection_Parameter_Update_RequestL2CAP_Connection_Parameter_Update_ResponseL2CAP_DisconnReqL2CAP_DisconnRespL2CAP_InfoReqL2CAP_InfoResp

post_build(p, pay)
class scapy.layers.bluetooth.L2CAP_CmdRej

Bases: scapy.packet.Packet

aliastypes
fields_desc
L2CAP_CmdRej字段

reason

LEShortField

0

class scapy.layers.bluetooth.L2CAP_ConfReq

Bases: scapy.packet.Packet

aliastypes
fields_desc
L2CAP_ConfReq字段

dcid

LEShortField

0

flags

LEShortField

0

class scapy.layers.bluetooth.L2CAP_ConfResp

Bases: scapy.packet.Packet

aliastypes
answers(other)
fields_desc
L2CAP_ConfResp字段

scid

LEShortField

0

flags

LEShortField

0

result

LEShortEnumField

0

class scapy.layers.bluetooth.L2CAP_ConnReq

Bases: scapy.packet.Packet

aliastypes
fields_desc
L2CAP_ConnReq字段

psm

LEShortEnumField

0

scid

LEShortField

0

class scapy.layers.bluetooth.L2CAP_ConnResp

Bases: scapy.packet.Packet

aliastypes
answers(other)
fields_desc
L2CAP_ConnResp字段

dcid

LEShortField

0

scid

LEShortField

0

result

LEShortEnumField

0

status

LEShortEnumField

0

class scapy.layers.bluetooth.L2CAP_Connection_Parameter_Update_Request

Bases: scapy.packet.Packet

aliastypes
fields_desc
L2CAP_Connection_Parameter_Update_Request字段

min_interval

LEShortField

0

max_interval

LEShortField

0

slave_latency

LEShortField

0

timeout_mult

LEShortField

0

class scapy.layers.bluetooth.L2CAP_Connection_Parameter_Update_Response

Bases: scapy.packet.Packet

aliastypes
fields_desc
L2CAP_Connection_Parameter_Update_Response字段

move_result

LEShortField

0

class scapy.layers.bluetooth.L2CAP_DisconnReq

Bases: scapy.packet.Packet

aliastypes
fields_desc
L2CAP_DisconnReq字段

dcid

LEShortField

0

scid

LEShortField

0

class scapy.layers.bluetooth.L2CAP_DisconnResp

Bases: scapy.packet.Packet

aliastypes
answers(other)
fields_desc
L2CAP_DisconnResp字段

dcid

LEShortField

0

scid

LEShortField

0

class scapy.layers.bluetooth.L2CAP_Hdr

Bases: scapy.packet.Packet

aliastypes
fields_desc
L2CAP_Hdr fields

len

LEShortField

None

cid

LEShortEnumField

0

payload_guess

可能的子层: ATT_HdrL2CAP_CmdHdrSM_Hdr

post_build(p, pay)
class scapy.layers.bluetooth.L2CAP_InfoReq

Bases: scapy.packet.Packet

aliastypes
fields_desc
L2CAP_InfoReq字段

type

LEShortEnumField

0

data

StrField

b''

class scapy.layers.bluetooth.L2CAP_InfoResp

Bases: scapy.packet.Packet

aliastypes
answers(other)
fields_desc
L2CAP_InfoResp字段

type

LEShortField

0

result

LEShortEnumField

0

data

StrField

b''

class scapy.layers.bluetooth.LEMACField(name, default)

Bases: scapy.fields.Field

any2i(pkt, x)
i2m(pkt, x)
i2repr(pkt, x)
m2i(pkt, x)
randval()
class scapy.layers.bluetooth.LowEnergyBeaconHelper

Bases: object

蓝牙低功耗信标构建数据包的助手.

实现者提供build_eir()实现.

它被设计为可混合使用–例如,请参见scapy.contrib.eddystonescapy.contrib.ibeacon .

base_eir = [<EIR_Hdr type=flags |<EIR_Flags flags=general_disc_mode+br_edr_not_supported |>>]
build_advertising_report()

构建包含此框架的HCI_LE_Meta_Advertising_Report.

Return type

scapy.bluetooth.HCI_LE_Meta_Advertising_Report

build_eir()

建立EIR消息列表以包装此框架.

此帮助程序的用户必须实现此方法.

Returns

HCI_Hdr列表,带有描述此信标类型的有效负载

Return type

list[scapy.bluetooth.HCI_Hdr]

build_set_advertising_data()

构建包含此框架的HCI_Cmd_LE_Set_Advertising_Data.

这包括HCI_HdrHCI_Command_Hdr层.

Return type

scapy.bluetooth.HCI_Hdr

class scapy.layers.bluetooth.SM_Confirm

Bases: scapy.packet.Packet

aliastypes
fields_desc
SM_确认字段

confirm

StrFixedLenField

b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'

class scapy.layers.bluetooth.SM_DHKey_Check

Bases: scapy.packet.Packet

aliastypes
fields_desc
SM_DHKey_Check字段

dhkey_check

StrFixedLenField

b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'

class scapy.layers.bluetooth.SM_Encryption_Information

Bases: scapy.packet.Packet

aliastypes
fields_desc
SM_Encryption_Information字段

ltk

StrFixedLenField

b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'

class scapy.layers.bluetooth.SM_Failed

Bases: scapy.packet.Packet

aliastypes
fields_desc
SM_Failed栏位

reason

XByteField

0

class scapy.layers.bluetooth.SM_Hdr

Bases: scapy.packet.Packet

aliastypes
fields_desc
SM_Hdr字段

sm_command

ByteField

None

payload_guess

Possible sublayers: SM_Confirm, SM_DHKey_Check, SM_Encryption_Information, SM_Failed, SM_Identity_Address_Information, SM_Identity_Information, SM_Master_Identification, SM_Pairing_Request, SM_Pairing_Response, SM_Public_Key, SM_Random, SM_Signing_Information

class scapy.layers.bluetooth.SM_Identity_Address_Information

Bases: scapy.packet.Packet

aliastypes
fields_desc
SM_Identity_Address_Information字段

atype

ByteEnumField

0

address

LEMACField

None

class scapy.layers.bluetooth.SM_Identity_Information

Bases: scapy.packet.Packet

aliastypes
fields_desc
SM_Identity_Information字段

irk

StrFixedLenField

b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'

class scapy.layers.bluetooth.SM_Master_Identification

Bases: scapy.packet.Packet

aliastypes
fields_desc
SM_Master_Identification fields

ediv

XLEShortField

0

rand

StrFixedLenField

b'\x00\x00\x00\x00\x00\x00\x00\x00'

class scapy.layers.bluetooth.SM_Pairing_Request

Bases: scapy.packet.Packet

aliastypes
fields_desc
SM_Pairing_Request字段

iocap

ByteEnumField

3

oob

ByteEnumField

0

authentication

BitField (8位)

0

max_key_size

ByteField

16

initiator_key_distribution

ByteField

0

responder_key_distribution

ByteField

0

class scapy.layers.bluetooth.SM_Pairing_Response

Bases: scapy.packet.Packet

aliastypes
fields_desc
SM_Pairing_Response字段

iocap

ByteEnumField

3

oob

ByteEnumField

0

authentication

BitField (8位)

0

max_key_size

ByteField

16

initiator_key_distribution

ByteField

0

responder_key_distribution

ByteField

0

class scapy.layers.bluetooth.SM_Public_Key

Bases: scapy.packet.Packet

aliastypes
fields_desc
SM_Public_Key字段

key_x

StrFixedLenField

b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'

key_y

StrFixedLenField

b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'

class scapy.layers.bluetooth.SM_Random

Bases: scapy.packet.Packet

aliastypes
fields_desc
SM_Random字段

random

StrFixedLenField

b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'

class scapy.layers.bluetooth.SM_Signing_Information

Bases: scapy.packet.Packet

aliastypes
fields_desc
SM_Signing_Information字段

csrk

StrFixedLenField

b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'

class scapy.layers.bluetooth.XLEShortField(name, default)

Bases: scapy.fields.LEShortField

i2repr(pkt, x)
class scapy.layers.bluetooth.sockaddr_hci

Bases: _ctypes.Structure

hci_channel

结构/工会成员

hci_dev

结构/工会成员

sin_family

结构/工会成员

scapy.layers.bluetooth.srbt(bt_address, pkts, inter=0.1, *args, **kargs)

使用蓝牙插座发送和接收

scapy.layers.bluetooth.srbt1(bt_address, pkts, *args, **kargs)

使用蓝牙插座发送和接收1个数据包