scapy.contrib.tacacs module

class scapy.contrib.tacacs.TacacsAccountingReply

Bases: scapy.packet.Packet

Tacacs accounting reply body from section 6.2 https://tools.ietf.org/html/draft-ietf-opsawg-tacacs-06#section-6.2

aliastypes = [<class 'scapy.contrib.tacacs.TacacsAccountingReply'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (TacacsAccountingReply).server_msg_len>, <Field (TacacsAccountingReply).data_len>, <Field (TacacsAccountingReply).status>, <Field (TacacsAccountingReply).server_msg>, <Field (TacacsAccountingReply).data>]
class scapy.contrib.tacacs.TacacsAccountingRequest

Bases: scapy.packet.Packet

Tacacs accounting request body from section 6.1 https://tools.ietf.org/html/draft-ietf-opsawg-tacacs-06#section-6.1

aliastypes = [<class 'scapy.contrib.tacacs.TacacsAccountingRequest'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (TacacsAccountingRequest).flags>, <Field (TacacsAccountingRequest).authen_method>, <Field (TacacsAccountingRequest).priv_lvl>, <Field (TacacsAccountingRequest).authen_type>, <Field (TacacsAccountingRequest).authen_service>, <Field (TacacsAccountingRequest).user_len>, <Field (TacacsAccountingRequest).port_len>, <Field (TacacsAccountingRequest).rem_addr_len>, <Field (TacacsAccountingRequest).arg_cnt>, <Field (TacacsAccountingRequest).arg_len_list>, <Field (TacacsAccountingRequest).user>, <Field (TacacsAccountingRequest).port>, <Field (TacacsAccountingRequest).rem_addr>]
guess_payload_class(pay)

DEV: Guesses the next payload class from layer bonds. Can be overloaded to use a different mechanism.

Parameters:payload (str) – the layer’s payload
Returns:the payload class
class scapy.contrib.tacacs.TacacsAuthenticationContinue

Bases: scapy.packet.Packet

Tacacs authentication continue body from section 4.3 https://tools.ietf.org/html/draft-ietf-opsawg-tacacs-06#section-4.3

aliastypes = [<class 'scapy.contrib.tacacs.TacacsAuthenticationContinue'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (TacacsAuthenticationContinue).user_msg_len>, <Field (TacacsAuthenticationContinue).data_len>, <Field (TacacsAuthenticationContinue).flags>, <Field (TacacsAuthenticationContinue).user_msg>, <Field (TacacsAuthenticationContinue).data>]
class scapy.contrib.tacacs.TacacsAuthenticationReply

Bases: scapy.packet.Packet

Tacacs authentication reply body from section 4.2 https://tools.ietf.org/html/draft-ietf-opsawg-tacacs-06#section-4.2

aliastypes = [<class 'scapy.contrib.tacacs.TacacsAuthenticationReply'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (TacacsAuthenticationReply).status>, <Field (TacacsAuthenticationReply).flags>, <Field (TacacsAuthenticationReply).server_msg_len>, <Field (TacacsAuthenticationReply).data_len>, <Field (TacacsAuthenticationReply).server_msg>, <Field (TacacsAuthenticationReply).data>]
class scapy.contrib.tacacs.TacacsAuthenticationStart

Bases: scapy.packet.Packet

Tacacs authentication start body from section 4.1 https://tools.ietf.org/html/draft-ietf-opsawg-tacacs-06#section-4.1

aliastypes = [<class 'scapy.contrib.tacacs.TacacsAuthenticationStart'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (TacacsAuthenticationStart).action>, <Field (TacacsAuthenticationStart).priv_lvl>, <Field (TacacsAuthenticationStart).authen_type>, <Field (TacacsAuthenticationStart).authen_service>, <Field (TacacsAuthenticationStart).user_len>, <Field (TacacsAuthenticationStart).port_len>, <Field (TacacsAuthenticationStart).rem_addr_len>, <Field (TacacsAuthenticationStart).data_len>, <scapy.fields.ConditionalField object>, <Field (TacacsAuthenticationStart).port>, <Field (TacacsAuthenticationStart).rem_addr>, <Field (TacacsAuthenticationStart).data>]
class scapy.contrib.tacacs.TacacsAuthorizationReply

Bases: scapy.packet.Packet

Tacacs authorization reply body from section 5.2 https://tools.ietf.org/html/draft-ietf-opsawg-tacacs-06#section-5.2

aliastypes = [<class 'scapy.contrib.tacacs.TacacsAuthorizationReply'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (TacacsAuthorizationReply).status>, <Field (TacacsAuthorizationReply).arg_cnt>, <Field (TacacsAuthorizationReply).server_msg_len>, <Field (TacacsAuthorizationReply).data_len>, <Field (TacacsAuthorizationReply).arg_len_list>, <Field (TacacsAuthorizationReply).server_msg>, <Field (TacacsAuthorizationReply).data>]
guess_payload_class(pay)

DEV: Guesses the next payload class from layer bonds. Can be overloaded to use a different mechanism.

Parameters:payload (str) – the layer’s payload
Returns:the payload class
class scapy.contrib.tacacs.TacacsAuthorizationRequest

Bases: scapy.packet.Packet

Tacacs authorization request body from section 5.1 https://tools.ietf.org/html/draft-ietf-opsawg-tacacs-06#section-5.1

aliastypes = [<class 'scapy.contrib.tacacs.TacacsAuthorizationRequest'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (TacacsAuthorizationRequest).authen_method>, <Field (TacacsAuthorizationRequest).priv_lvl>, <Field (TacacsAuthorizationRequest).authen_type>, <Field (TacacsAuthorizationRequest).authen_service>, <Field (TacacsAuthorizationRequest).user_len>, <Field (TacacsAuthorizationRequest).port_len>, <Field (TacacsAuthorizationRequest).rem_addr_len>, <Field (TacacsAuthorizationRequest).arg_cnt>, <Field (TacacsAuthorizationRequest).arg_len_list>, <Field (TacacsAuthorizationRequest).user>, <Field (TacacsAuthorizationRequest).port>, <Field (TacacsAuthorizationRequest).rem_addr>]
guess_payload_class(pay)

DEV: Guesses the next payload class from layer bonds. Can be overloaded to use a different mechanism.

Parameters:payload (str) – the layer’s payload
Returns:the payload class
class scapy.contrib.tacacs.TacacsClientPacket

Bases: scapy.packet.Packet

Super class for tacacs packet in order to get them unencrypted Obfuscation methodology from section 3.7 https://tools.ietf.org/html/draft-ietf-opsawg-tacacs-06#section-3.7

aliastypes = [<class 'scapy.contrib.tacacs.TacacsClientPacket'>, <class 'scapy.packet.Packet'>]
post_dissect(pay)

DEV: is called right after the current layer has been dissected

class scapy.contrib.tacacs.TacacsHeader

Bases: scapy.contrib.tacacs.TacacsClientPacket

Tacacs Header packet from section 3.8 https://tools.ietf.org/html/draft-ietf-opsawg-tacacs-06#section-3.8

aliastypes = [<class 'scapy.contrib.tacacs.TacacsHeader'>, <class 'scapy.contrib.tacacs.TacacsClientPacket'>, <class 'scapy.packet.Packet'>]
answers(other)

DEV: true if self is an answer from other

fields_desc = [<Field (TacacsHeader).version>, <Field (TacacsHeader).type>, <Field (TacacsHeader).seq>, <Field (TacacsHeader).flags>, <Field (TacacsHeader).session_id>, <Field (TacacsHeader).length>]
guess_payload_class(payload)

DEV: Guesses the next payload class from layer bonds. Can be overloaded to use a different mechanism.

Parameters:payload (str) – the layer’s payload
Returns:the payload class
hashret()

DEV: returns a string that has the same value for a request and its answer.

payload_guess = [({'type': 1, 'dport': 49}, <class 'scapy.contrib.tacacs.TacacsAuthenticationStart'>), ({'type': 1, 'sport': 49}, <class 'scapy.contrib.tacacs.TacacsAuthenticationReply'>)]
post_build(p, pay)

DEV: called right after the current layer is build.

Parameters:
  • pkt (str) – the current packet (build by self_buil function)
  • pay (str) – the packet payload (build by do_build_payload function)
Returns:

a string of the packet with the payload

class scapy.contrib.tacacs.TacacsPacketArguments

Bases: scapy.packet.Packet

Class defined to handle the arguments listed at the end of tacacs+ Authorization and Accounting packets.

aliastypes = [<class 'scapy.contrib.tacacs.TacacsPacketArguments'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (TacacsPacketArguments).data>]
guess_payload_class(pay)

DEV: Guesses the next payload class from layer bonds. Can be overloaded to use a different mechanism.

Parameters:payload (str) – the layer’s payload
Returns:the payload class
pre_dissect(s)

DEV: is called right before the current layer is dissected

scapy.contrib.tacacs.obfuscate(pay, secret, session_id, version, seq)

Obfuscation methodology from section 3.7 https://tools.ietf.org/html/draft-ietf-opsawg-tacacs-06#section-3.7