Skip to content

Commit

Permalink
Raw packet bytes in Packet info and comment updates
Browse files Browse the repository at this point in the history
Added the raw packet bytes to the Packet.info() output in the new 'rawpkt' key. This allows pcapout to function as intended. Also minor updates to some doc strings.
  • Loading branch information
dev195 authored Mar 6, 2023
1 parent b11ac38 commit 8fed00c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dshell/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,7 @@ def __init__(self, plugin, pktlen, pkt, ts):
Attributes:
ts: timestamp of packet
dt: datetime of packet
frame: sequential packet number as read from data stream
pkt: pypacker object for the packet
rawpkt: raw bytestring of the packet
pktlen: length of packet
Expand Down Expand Up @@ -1052,6 +1053,7 @@ def info(self):
"""
d = {k: v for k, v in self.__dict__.items() if not k.startswith('_')}
d['byte_count'] = self.byte_count
d['rawpkt'] = self.pkt.bin()
del d['pkt']
return d

Expand Down Expand Up @@ -1783,7 +1785,7 @@ def reassemble(self, allow_padding=True, allow_overlap=True, padding=b'\x00'):
def info(self):
"""
Provides a dictionary with information about a blob. Useful for
calls to a plugin's write() function, e.g. self.write(\\*\\*conn.info())
calls to a plugin's write() function, e.g. self.write(\\*\\*blob.info())
Returns:
Dictionary with information
Expand Down

0 comments on commit 8fed00c

Please sign in to comment.