Skip to content

Commit

Permalink
Merge branch 'doom/2991-e2e-runner' of https://github.com/flipperdevi…
Browse files Browse the repository at this point in the history
…ces/flipperzero-firmware into doom/2991-e2e-runner
  • Loading branch information
doomwastaken committed Oct 10, 2023
2 parents 0be323d + c31f733 commit 76a7fc4
Show file tree
Hide file tree
Showing 11 changed files with 1,072 additions and 0 deletions.
14 changes: 14 additions & 0 deletions scripts/flippigator/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
FlipperProtoException,
)
from flipperzero_protobuf_py.flipperzero_protobuf.flipper_proto import FlipperProto
from flippigator.extensions.proxmark_wrapper import proxmark_wrapper
from flippigator.flippigator import (
FlippigatorException,
Gator,
Expand Down Expand Up @@ -84,6 +85,13 @@ def pytest_addoption(parser):
default=False,
help="use this flag for skip setup cycle",
)
parser.addoption(
"--px3_path",
action="store",
default="C:\\Users\\User\\Desktop\\proxmark3\\client\\proxmark3.exe",
help="path to proxmark3 executable file",
type=str,
)


def pytest_configure(config):
Expand Down Expand Up @@ -340,6 +348,12 @@ def nav(flipper_serial, request):
return nav


@pytest.fixture(scope="session")
def px(request):
px = proxmark_wrapper(request.config.getoption("--px3_path"))
return px


@pytest.fixture(scope="session")
def nav_reader(flipper_reader_serial, request):
proto = FlipperProto(serial_port=flipper_reader_serial, debug=True)
Expand Down
346 changes: 346 additions & 0 deletions scripts/flippigator/flippigator/extensions/CMD_READ.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,346 @@
{
"ASCII_MIRROR_UID_0":
{
"tag":"ASCII_MIRROR_UID",
"Card":"NTAG213.nfc",
"Description":"Set ascii mirror page = 36, byte = 0, mode = UID. Then read data",
"Cmds": [
{
"cmd":"hf 14a raw -sc A229440024FF",
"result":"0A"
},
{
"cmd": "hf 14a raw -sc 3024",
"result": "30 34 42 41 46 46 43 41 34 44 35 44 38 30 00 00 [ E9 19 ]"
},
{
"cmd": "hf 14a raw -sc 3023",
"result": "00 00 00 00 30 34 42 41 46 46 43 41 34 44 35 44 [ 1C AC ]"
},
{
"cmd": "hf 14a raw -sc 3025",
"result": "46 46 43 41 34 44 35 44 38 30 00 00 00 AA AA BD [ 32 A3 ]"
}
]
},
"ASCII_MIRROR_UID_1" :{
"tag":"ASCII_MIRROR_UID",
"Card":"NTAG213.nfc",
"Description":"Set ascii mirror page = 36, byte = 1, mode = UID. Then read data",
"Cmds": [
{
"cmd":"hf 14a raw -sc A229540024FF",
"result":"0A"
},
{
"cmd": "hf 14a raw -sc 3024",
"result": "00 30 34 42 41 46 46 43 41 34 44 35 44 38 30 00 [ 45 02 ]"
},
{
"cmd": "hf 14a raw -sc 3023",
"result": "00 00 00 00 00 30 34 42 41 46 46 43 41 34 44 35 [ B1 7C ]"
},
{
"cmd": "hf 14a raw -sc 3025",
"result": "41 46 46 43 41 34 44 35 44 38 30 00 00 AA AA BD [ 36 2A ]"
}
]
},
"ASCII_MIRROR_UID_2" : {
"tag":"ASCII_MIRROR_UID",
"Card":"NTAG213.nfc",
"Description":"Set ascii mirror page = 36, byte = 2, mode = UID. Then read data",
"Cmds": [
{
"cmd":"hf 14a raw -sc A229640024FF",
"result":"0A"
},
{
"cmd": "hf 14a raw -sc 3024",
"result": "00 00 30 34 42 41 46 46 43 41 34 44 35 44 38 30 [ EE 77 ]"
},
{
"cmd": "hf 14a raw -sc 3023",
"result": "00 00 00 00 00 00 30 34 42 41 46 46 43 41 34 44 [ 76 6C ]"
},
{
"cmd": "hf 14a raw -sc 3025",
"result": "42 41 46 46 43 41 34 44 35 44 38 30 00 AA AA BD [ 4A D4 ]"
}
]
},
"ASCII_MIRROR_UID_3" : {
"tag":"ASCII_MIRROR_UID",
"Card":"NTAG213.nfc",
"Description":"Set ascii mirror page = 36, byte = 3, mode = UID. Then read data",
"Cmds": [
{
"cmd":"hf 14a raw -sc A229740024FF",
"result":"0A"
},
{
"cmd": "hf 14a raw -sc 3024",
"result": "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 37 49 ]"
},
{
"cmd": "hf 14a raw -sc 3023",
"result": "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 37 49 ]"
},
{
"cmd": "hf 14a raw -sc 3025",
"result": "00 00 00 00 00 00 00 00 00 00 00 00 00 AA AA BD [ 7B 09 ]"
}
]
},
"ASCII_COUNTER_0" : {
"tag":"ASCII_COUNTER",
"Card":"NTAG213.nfc",
"Description":"Disable counter -> set ascii mirror page = 38, byte = 0, mode = COUNTER -> \nread data -> Enable counter -> read data",
"Cmds": [
{
"cmd": "hf 14a raw -sc A22A00050000",
"result": "0A"
},
{
"cmd":"hf 14a raw -sc A229840026FF",
"result":"0A"
},
{
"cmd": "hf 14a raw -sc 3025",
"result": "00 00 00 00 00 00 00 00 00 00 00 00 00 AA AA BD [ 7B 09 ]"
},
{
"cmd": "hf 14a raw -sc 3026",
"result": "00 00 00 00 00 00 00 00 00 AA AA BD 84 00 26 FF [ DB E9 ]"
},
{
"cmd": "hf 14a raw -sc 3027",
"result": "00 00 00 00 00 AA AA BD 84 00 26 FF 00 05 00 00 [ E3 5C ]"
},
{
"cmd": "hf 14a raw -sc A22A10050000",
"result": "0A"
},
{
"cmd": "hf 14a raw -sc 3025",
"result": "00 00 00 00 30 30 30 30 30 30 00 00 00 AA AA BD [ 54 E9 ]"
},
{
"cmd": "hf 14a raw -sc 3025",
"result": "00 00 00 00 30 30 30 30 30 31 00 00 00 AA AA BD [ 81 76 ]"
},
{
"cmd": "hf 14a raw -sck 3025",
"result": "00 00 00 00 30 30 30 30 30 32 00 00 00 AA AA BD [ EF DE ]"
},
{
"cmd": "hf 14a raw -ac 3025",
"result": "00 00 00 00 30 30 30 30 30 33 00 00 00 AA AA BD [ 3A 41 ]"
},
{
"cmd": "hf 14a raw -sc 3026",
"result": "30 30 30 30 30 33 00 00 00 AA AA BD 84 00 26 FF [ 63 23 ]"
},
{
"cmd": "hf 14a raw -sc 3027",
"result": "30 34 00 00 00 AA AA BD 84 00 26 FF 10 05 00 00 [ 4F B2 ]"
},
{
"cmd": "hf 14a raw -sc A22A00050000",
"result": "0A"
}
]
},
"ASCII_COUNTER_1" : {
"tag":"ASCII_COUNTER",
"Card":"NTAG213.nfc",
"Description":"Disable counter -> set ascii mirror page = 38, byte = 1, mode = COUNTER -> \nread data -> Enable counter -> read data",
"Cmds": [
{
"cmd": "hf 14a raw -sc A22A00050000",
"result": "0A"
},
{
"cmd":"hf 14a raw -sc A229940026FF",
"result":"0A"
},
{
"cmd": "hf 14a raw -sc 3025",
"result": "00 00 00 00 00 00 00 00 00 00 00 00 00 AA AA BD [ 7B 09 ]"
},
{
"cmd": "hf 14a raw -sc 3026",
"result": "00 00 00 00 00 00 00 00 00 AA AA BD 84 00 26 FF [ DB E9 ]"
},
{
"cmd": "hf 14a raw -sc 3027",
"result": "00 00 00 00 00 AA AA BD 84 00 26 FF 00 05 00 00 [ E3 5C ]"
},
{
"cmd": "hf 14a raw -sc A22A10050000",
"result": "0A"
},
{
"cmd": "hf 14a raw -sc 3025",
"result": "00 00 00 00 30 30 30 30 35 39 00 00 00 AA AA BD [ 0C 3F ]"
},
{
"cmd": "hf 14a raw -sc 3026",
"result": "30 30 30 30 35 41 00 00 00 AA AA BD 84 00 26 FF [ A8 56 ]"
},
{
"cmd": "hf 14a raw -sc 3027",
"result": "35 42 00 00 00 AA AA BD 84 00 26 FF 10 05 00 00 [ 5F D8 ]"
},
{
"cmd": "hf 14a raw -sc A22A00050000",
"result": "0A"
}
]
},
"ASCII_COUNTER_2" : {
"tag":"ASCII_COUNTER",
"Card":"NTAG213.nfc",
"Description":"Disable counter -> set ascii mirror page = 38, byte = 2, mode = COUNTER -> \nread data -> Enable counter -> read data",
"Cmds": [
{
"cmd": "hf 14a raw -sc A22A00050000",
"result": "0A"
},
{
"cmd":"hf 14a raw -sc A229A40026FF",
"result":"0A"
},
{
"cmd": "hf 14a raw -sc 3025",
"result": "00 00 00 00 00 00 00 00 00 00 00 00 00 AA AA BD [ 7B 09 ]"
},
{
"cmd": "hf 14a raw -sc 3026",
"result": "00 00 00 00 00 00 00 00 00 AA AA BD 84 00 26 FF [ DB E9 ]"
},
{
"cmd": "hf 14a raw -sc 3027",
"result": "00 00 00 00 00 AA AA BD 84 00 26 FF 00 05 00 00 [ E3 5C ]"
},
{
"cmd": "hf 14a raw -sc A22A10050000",
"result": "0A"
},
{
"cmd": "hf 14a raw -sc 3025",
"result": "00 00 00 00 30 30 30 30 35 39 00 00 00 AA AA BD [ 0C 3F ]"
},
{
"cmd": "hf 14a raw -sc 3026",
"result": "30 30 30 30 35 41 00 00 00 AA AA BD 84 00 26 FF [ A8 56 ]"
},
{
"cmd": "hf 14a raw -sc 3027",
"result": "35 42 00 00 00 AA AA BD 84 00 26 FF 10 05 00 00 [ 5F D8 ]"
},
{
"cmd": "hf 14a raw -sc A22A00050000",
"result": "0A"
}
]
},
"ASCII_COUNTER_3" : {
"tag":"ASCII_COUNTER",
"Card":"NTAG213.nfc",
"Description":"Disable counter -> set ascii mirror page = 38, byte = 3, mode = COUNTER -> \nread data -> Enable counter -> read data -> Result: ignore",
"Cmds": [
{
"cmd": "hf 14a raw -sc A22A00050000",
"result": "0A"
},
{
"cmd":"hf 14a raw -sc A229B40026FF",
"result":"0A"
},
{
"cmd": "hf 14a raw -sc 3025",
"result": "00 00 00 00 00 00 00 00 00 00 00 00 00 AA AA BD [ 7B 09 ]"
},
{
"cmd": "hf 14a raw -sc 3026",
"result": "00 00 00 00 00 00 00 00 00 AA AA BD B4 00 26 FF [ 29 A5 ]"
},
{
"cmd": "hf 14a raw -sc 3027",
"result": "00 00 00 00 00 AA AA BD B4 00 26 FF 00 05 00 00 [ 6B B1 ]"
},
{
"cmd": "hf 14a raw -sc A22A10050000",
"result": "0A"
},
{
"cmd": "hf 14a raw -sc 3025",
"result": "00 00 00 00 00 00 00 00 00 00 00 00 00 AA AA BD [ 7B 09 ]"
},
{
"cmd": "hf 14a raw -sc 3026",
"result": "00 00 00 00 00 00 00 00 00 AA AA BD B4 00 26 FF [ 29 A5 ]"
},
{
"cmd": "hf 14a raw -sc 3027",
"result": "00 00 00 00 00 AA AA BD B4 00 26 FF 10 05 00 00 [ CA 72 ]"
},
{
"cmd": "hf 14a raw -sc A22A00050000",
"result": "0A"
}
]
},
"ASCII_COUNTER_0_PWD" : {
"tag":"ASCII_COUNTER",
"Card":"NTAG213.nfc",
"Description":"Disable counter -> set ascii mirror page = 38, byte = 0, mode = COUNTER ->\nread data -> CNT_ENABLE = 1 PSWD_CNT = 1 -> read data",
"Cmds": [
{
"cmd": "hf 14a raw -sc A22A00050000",
"result": "0A"
},
{
"cmd":"hf 14a raw -sc A229840026FF",
"result":"0A"
},
{
"cmd": "hf 14a raw -sc 3025",
"result": "00 00 00 00 00 00 00 00 00 00 00 00 00 AA AA BD [ 7B 09 ]"
},
{
"cmd": "hf 14a raw -sc 3026",
"result": "00 00 00 00 00 00 00 00 00 AA AA BD 84 00 26 FF [ DB E9 ]"
},
{
"cmd": "hf 14a raw -sc 3027",
"result": "00 00 00 00 00 AA AA BD 84 00 26 FF 00 05 00 00 [ E3 5C ]"
},
{
"cmd": "hf 14a raw -sc A22A18050000",
"result": "0A"
},
{
"cmd": "hf 14a raw -sck 1BFFFFFFFF",
"result": "00 00 00 00 30 30 30 30 35 39 00 00 00 AA AA BD [ 0C 3F ]"
},
{
"cmd": "hf 14a raw -ack 3025",
"result": "00 00 00 00 30 30 30 30 35 39 00 00 00 AA AA BD [ 0C 3F ]"
},
{
"cmd": "hf 14a raw -ack 3026",
"result": "30 30 30 30 35 41 00 00 00 AA AA BD 84 00 26 FF [ A8 56 ]"
},
{
"cmd": "hf 14a raw -ack 3027",
"result": "35 42 00 00 00 AA AA BD 84 00 26 FF 10 05 00 00 [ 5F D8 ]"
},
{
"cmd": "hf 14a raw -ac A22A00050000",
"result": "0A"
}
]
}
}
14 changes: 14 additions & 0 deletions scripts/flippigator/flippigator/extensions/CMD_READ.nfctests
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#Some test cases for nfc
#this is one line comment

'''
Multiline
comment
'''

[Scenario=1, Card=NTAG213.nfc, Description="Describes what scenario does"]
hf 14a raw -sc 3000 -> 04 BA FF C9 CA 4D 5D 80 5A 48 00 00 E1 10 12 00 [ F5 67 ]

[Scenario=2, Card=NTAG213.nfc, Description="Reading password protected data"]
hf 14a raw -sck 1BDEADBEAF -> 00 00 [ A0 1E ] //Authentication with pwd = DEADBEAF
hf 14a raw -sc 300A -> 04 BA FF C9 CA 4D 5D 80 5A 48 00 00 E1 10 12 00 [ F5 67 ] //Read pages 0x0A - 0x0D
Loading

0 comments on commit 76a7fc4

Please sign in to comment.