-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Traffic captures collection #31
Comments
Dump
Paper info{
"uuid": "881d7e4fd9970000",
"barCode": "10262260",
"serialNumber": "PZ1G221322004205",
"allPaper": 276,
"usedPaper": 4,
"consumablesType": 1
} |
Dump
Dump
|
Captures from PR #10 by @mentlerd
pattern.zip
diagonal6.zip |
Capture from #17 by @aprosvetova (comment)
d101.csv |
Rename Just connected the printer Print a diagonal line Print some rectangles Print complex image |
Python helper scripts to convert wireshark capture to text format. Uses tshark executable. Output example:
For usb dumpsimport sys
import subprocess
TSHARK_PATH = "C:\\Program Files\\Wireshark\\tshark.exe"
if len(sys.argv) < 2:
print(f'Usage: {sys.argv[0]} <filename>')
exit(-1)
result = subprocess.run([
TSHARK_PATH,
"-2",
"-r",
sys.argv[1],
"-R", "usb.capdata",
"-T", "fields",
"-e", "frame.time_relative",
"-e", "usb.dst",
"-e", "usb.capdata"
], stdout=subprocess.PIPE)
if result.returncode != 0:
print(result.stdout.decode('ascii'))
exit(-1)
output = result.stdout.decode('ascii')
lines = output.splitlines()
for line in lines:
if not line:
break
parts = line.split('\t')
time = parts[0][:-6].rjust(7)
direction = '<<' if parts[1] == 'host' else '>>'
data = parts[2]
print(f'[{time}] {direction} {data}') For btsnoop dumpsimport sys
import subprocess
TSHARK_PATH = "C:\\Program Files\\Wireshark\\tshark.exe"
if len(sys.argv) < 2:
print(f'Usage: {sys.argv[0]} <filename>')
exit(-1)
result = subprocess.run([
TSHARK_PATH,
"-2",
"-r",
sys.argv[1],
"-R", "btspp.data",
"-T", "fields",
"-e", "frame.time_relative",
"-e", "hci_h4.direction",
"-e", "btspp.data"
], stdout=subprocess.PIPE)
if result.returncode != 0:
print(result.stdout.decode('ascii'))
exit(-1)
output = result.stdout.decode('ascii')
lines = output.splitlines()
for line in lines:
if not line:
break
parts = line.split('\t')
time = parts[0][:-6].rjust(7)
direction = '<<' if parts[1] == '0x01' else '>>'
data = parts[2]
print(f'[{time}] {direction} {data}') |
Dump```[ 10.523] >> 035555c10101c1aaaa
|
This is a meta-issue for collecting traffic captures of an official app communication with various printer models. Preferred export format is JSON (if you're using wireshark: file > export packet dissections > as json), however plain text data is also fine. Don't forget to ensure your traffic capture does not contain any sensitive data: e.g. if you capturing USB traffic, don't forget to set a filter to only export printer packets, and exclude other USB devices.
Please share your captures using the following template:
General recommendations for capture scenarios (work in progress):
TODO:
The text was updated successfully, but these errors were encountered: