Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Fraunhofer-AISEC/gallia
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 236ef41c94e440c274a578e7c70d4827b58df216
Choose a base ref
..
head repository: Fraunhofer-AISEC/gallia
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: d5f62cad9a7cbca9998e96c9175a66f7057df708
Choose a head ref
Showing with 3,302 additions and 1,193 deletions.
  1. +4 −0 .github/CODEOWNERS
  2. +4 −0 .github/dependabot.yml
  3. +53 −0 .github/workflows/codeql-analysis.yml
  4. +4 −0 .github/workflows/docs.yml
  5. +7 −0 .github/workflows/linters.yml
  6. +4 −0 .github/workflows/python-publish.yml
  7. +25 −20 .github/workflows/tests.yml
  8. +4 −0 .gitignore
  9. +4 −0 .mailmap
  10. +21 −0 CHANGELOG.md
  11. +6 −0 CONTRIBUTING.md
  12. +0 −202 LICENSE
  13. +73 −0 LICENSES/Apache-2.0.txt
  14. +121 −0 LICENSES/CC0-1.0.txt
  15. +117 −0 LICENSES/GPL-2.0-only.txt
  16. +304 −0 LICENSES/LGPL-3.0-only.txt
  17. +4 −0 Makefile
  18. +9 −2 README.md
  19. +4 −0 bin/.gitignore
  20. +4 −0 bin/penrun
  21. +4 −0 docs/.gitignore
  22. +4 −0 docs/Makefile
  23. +8 −2 docs/{internal.md → architecture.md}
  24. +9 −2 docs/{power_supply.md → automation.md}
  25. +5 −1 docs/conf.py
  26. +59 −0 docs/index.md
  27. +0 −38 docs/index.rst
  28. +0 −51 docs/introduction.md
  29. +4 −0 docs/penlog.7.rst
  30. +0 −243 docs/penrun.1.rst
  31. +7 −10 docs/setup.md
  32. +3 −0 docs/tooling-architecture.odg.license
  33. +3 −0 docs/tooling-architecture.png.license
  34. +6 −0 docs/transports.md
  35. +6 −0 docs/{ → uds}/database.md
  36. +134 −0 docs/uds/scan_modes.md
  37. +6 −0 docs/{ → uds}/virtual_ecu.md
  38. +4 −0 misc/penrun.config
  39. +4 −0 misc/penrun.fish
  40. +70 −45 misc/release.py
  41. +664 −223 poetry.lock
  42. +3 −0 poetry.lock.license
  43. +20 −7 pyproject.toml
  44. +4 −0 setup.cfg
  45. +3 −0 src/cursed_hr/__init__.py
  46. +6 −1 src/cursed_hr/cursed_hr.py
  47. +3 −0 src/gallia/__init__.py
  48. +0 −1 src/gallia/analyzer/__init__.py
  49. +11 −14 src/gallia/analyzer/analyzer.py
  50. +1 −4 src/gallia/analyzer/arg_help.py
  51. +8 −9 src/gallia/analyzer/categorizer.py
  52. +0 −3 src/gallia/analyzer/config.py
  53. +0 −3 src/gallia/analyzer/constants.py
  54. +0 −3 src/gallia/analyzer/db_handler.py
  55. +2 −5 src/gallia/analyzer/exceptions.py
  56. +21 −24 src/gallia/analyzer/extractor.py
  57. +0 −3 src/gallia/analyzer/failure.py
  58. +118 −122 src/gallia/analyzer/main.py
  59. +0 −3 src/gallia/analyzer/mode_config.py
  60. +0 −2 src/gallia/analyzer/name_config.py
  61. +19 −41 src/gallia/analyzer/operator.py
  62. +4 −7 src/gallia/analyzer/reporter.py
  63. +0 −3 src/gallia/analyzer/time_analyzer.py
  64. +34 −46 src/gallia/analyzer/xl_generator.py
  65. +4 −0 src/gallia/cli.py
  66. +3 −0 src/gallia/db/__init__.py
  67. +6 −1 src/gallia/db/db_handler.py
  68. +4 −0 src/gallia/penlab.py
  69. +6 −1 src/gallia/penlog.py
  70. +3 −0 src/gallia/services/__init__.py
  71. +11 −8 src/gallia/services/{xcp.py → xcp/__init__.py}
  72. +890 −0 src/gallia/services/xcp/types.py
  73. +3 −0 src/gallia/transports/__init__.py
  74. +4 −0 src/gallia/transports/base.py
  75. +4 −0 src/gallia/transports/can.py
  76. +22 −5 src/gallia/transports/doip.py
  77. +4 −0 src/gallia/transports/tcp.py
  78. +4 −0 src/gallia/uds/__init__.py
  79. +3 −0 src/gallia/uds/core/__init__.py
  80. +5 −1 src/gallia/uds/core/client.py
  81. +17 −2 src/gallia/uds/core/constants.py
  82. +4 −0 src/gallia/uds/core/exception.py
  83. +4 −0 src/gallia/uds/core/service.py
  84. +4 −0 src/gallia/uds/core/utils.py
  85. +36 −15 src/gallia/uds/ecu.py
  86. +4 −0 src/gallia/uds/helpers.py
  87. +4 −0 src/gallia/uds/nrv.py
  88. +13 −4 src/gallia/uds/{core → }/server.py
  89. +3 −0 src/gallia/udscan/__init__.py
  90. +27 −1 src/gallia/udscan/core.py
  91. +3 −0 src/gallia/udscan/scanner/__init__.py
  92. +17 −13 src/gallia/udscan/scanner/discover_doip.py
  93. +4 −0 src/gallia/udscan/scanner/find_can_ids.py
  94. +4 −0 src/gallia/udscan/scanner/find_xcp.py
  95. +4 −0 src/gallia/udscan/scanner/scan_identifiers.py
  96. +4 −0 src/gallia/udscan/scanner/scan_memory_functions.py
  97. +4 −0 src/gallia/udscan/scanner/scan_reset.py
  98. +4 −0 src/gallia/udscan/scanner/scan_sa_dump_seeds.py
  99. +4 −0 src/gallia/udscan/scanner/scan_services.py
  100. +15 −0 src/gallia/udscan/scanner/scan_sessions.py
  101. +4 −0 src/gallia/udscan/scanner/simple_dtc.py
  102. +4 −0 src/gallia/udscan/scanner/simple_ecu_reset.py
  103. +4 −0 src/gallia/udscan/scanner/simple_get_vin.py
  104. +4 −0 src/gallia/udscan/scanner/simple_iocbi.py
  105. +4 −0 src/gallia/udscan/scanner/simple_ping.py
  106. +4 −0 src/gallia/udscan/scanner/simple_read_by_identifier.py
  107. +4 −0 src/gallia/udscan/scanner/simple_read_error_log.py
  108. +4 −0 src/gallia/udscan/scanner/simple_rmba.py
  109. +4 −0 src/gallia/udscan/scanner/simple_rtcl.py
  110. +4 −0 src/gallia/udscan/scanner/simple_send_pdu.py
  111. +4 −0 src/gallia/udscan/scanner/simple_test_xcp.py
  112. +4 −0 src/gallia/udscan/scanner/simple_wmba.py
  113. +4 −0 src/gallia/udscan/scanner/simple_write_by_identifier.py
  114. +4 −0 src/gallia/utils.py
  115. +5 −1 src/gallia/virtual_ecu.py
  116. +4 −0 src/opennetzteil/__init__.py
  117. +30 −0 src/opennetzteil/cli.py
  118. +7 −1 src/penlog/__init__.py
  119. +4 −0 tests/cli/0001-penrun.bats
  120. +4 −0 tests/python/test_help.py
  121. +4 −0 tests/python/test_helpers.py
  122. +4 −0 tests/python/test_logrecord.py
4 changes: 4 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: AISEC Pentesting Team
#
# SPDX-License-Identifier: CC0-1.0

* @rumpelsepp @peckto

src/gallia/db @fkglr
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: AISEC Pentesting Team
#
# SPDX-License-Identifier: CC0-1.0

version: 2
updates:
- package-ecosystem: "pip"
53 changes: 53 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# SPDX-FileCopyrightText: AISEC Pentesting Team
#
# SPDX-License-Identifier: CC0-1.0

name: "CodeQL"

on:
push:
branches: [ "master", "1.0-maint" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "master", "1.0-maint" ]
schedule:
- cron: '37 17 * * 5'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
python-version: ['3.10']

steps:
- name: Checkout repository
uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
4 changes: 4 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: AISEC Pentesting Team
#
# SPDX-License-Identifier: CC0-1.0

# https://github.com/actions/setup-python/issues/374

name: docs
7 changes: 7 additions & 0 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: AISEC Pentesting Team
#
# SPDX-License-Identifier: CC0-1.0

# https://github.com/actions/setup-python/issues/374

name: linters
@@ -49,3 +53,6 @@ jobs:
- name: Run black
run: |
poetry run black --check --verbose src
- name: Run reuse lint
run: |
poetry run reuse lint
4 changes: 4 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: AISEC Pentesting Team
#
# SPDX-License-Identifier: CC0-1.0

name: Upload Python Package

on:
45 changes: 25 additions & 20 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: AISEC Pentesting Team
#
# SPDX-License-Identifier: CC0-1.0

# https://github.com/actions/setup-python/issues/374
#
name: tests
@@ -68,43 +72,44 @@ jobs:
- name: Test scan-services
run: |
poetry run gallia scan-services --target "tcp-lines://127.0.0.1:20162" --no-dumpcap --sessions 1 2 --check-session
poetry run gallia scan-services --ecu-reset --target "tcp-lines://127.0.0.1:20162" --no-dumpcap --sessions 1 2 --check-session
- name: Test scan-sessions
run: |
poetry run gallia scan-sessions --target "tcp-lines://127.0.0.1:20162" --no-dumpcap --depth 2
poetry run gallia scan-sessions --ecu-reset --target "tcp-lines://127.0.0.1:20162" --no-dumpcap --depth 2
poetry run gallia scan-sessions --ecu-reset --target "tcp-lines://127.0.0.1:20162" --no-dumpcap --fast
- name: Test scan-identifiers
run: |
poetry run gallia scan-identifiers --target "tcp-lines://127.0.0.1:20162" --no-dumpcap --start 0 --end 100 --sid 0x22
poetry run gallia scan-identifiers --target "tcp-lines://127.0.0.1:20162" --no-dumpcap --start 0 --end 100 --sid 0x2e
poetry run gallia scan-identifiers --target "tcp-lines://127.0.0.1:20162" --no-dumpcap --start 0 --end 100 --sid 0x31
poetry run gallia scan-identifiers --ecu-reset --target "tcp-lines://127.0.0.1:20162" --no-dumpcap --start 0 --end 100 --sid 0x22
poetry run gallia scan-identifiers --ecu-reset --target "tcp-lines://127.0.0.1:20162" --no-dumpcap --start 0 --end 100 --sid 0x2e
poetry run gallia scan-identifiers --ecu-reset --target "tcp-lines://127.0.0.1:20162" --no-dumpcap --start 0 --end 100 --sid 0x31
- name: Test scan-reset
run: |
poetry run gallia scan-reset --target "tcp-lines://127.0.0.1:20162" --no-dumpcap
poetry run gallia scan-reset --ecu-reset --target "tcp-lines://127.0.0.1:20162" --no-dumpcap
- name: Test scan-dump-seeds
run: |
poetry run gallia scan-dump-seeds --target "tcp-lines://127.0.0.1:20162" --no-dumpcap --duration 0.01 --level 0x2f
poetry run gallia scan-dump-seeds --ecu-reset --target "tcp-lines://127.0.0.1:20162" --no-dumpcap --duration 0.01 --level 0x2f
- name: Test scan-memory-functions
run: |
for sid in 0x23 0x34 0x35 0x3d; do
poetry run gallia scan-memory-functions --target "tcp-lines://127.0.0.1:20162" --no-dumpcap --sid "$sid"
poetry run gallia scan-memory-functions --ecu-reset --target "tcp-lines://127.0.0.1:20162" --no-dumpcap --sid "$sid"
done
- name: Test UDS primitives
run: |
poetry run gallia simple-ecu-reset --target "tcp-lines://127.0.0.1:20162" --no-dumpcap
poetry run gallia simple-read-error-log --target "tcp-lines://127.0.0.1:20162" --no-dumpcap
poetry run gallia simple-get-vin --target "tcp-lines://127.0.0.1:20162" --no-dumpcap
poetry run gallia simple-ping --count 2 --target "tcp-lines://127.0.0.1:20162" --no-dumpcap
poetry run gallia simple-read-by-identifier --data-id 0x108d --target "tcp-lines://127.0.0.1:20162" --no-dumpcap
poetry run gallia simple-send-pdu 1001 --target "tcp-lines://127.0.0.1:20162" --no-dumpcap
poetry run gallia simple-write-by-identifier --data-id 0x2266 --data 00 --target "tcp-lines://127.0.0.1:20162" --no-dumpcap
poetry run gallia simple-dtc --target "tcp-lines://127.0.0.1:20162" --no-dumpcap read
poetry run gallia simple-dtc --target "tcp-lines://127.0.0.1:20162" --no-dumpcap clear
poetry run gallia simple-dtc --target "tcp-lines://127.0.0.1:20162" --no-dumpcap control --stop
poetry run gallia simple-dtc --target "tcp-lines://127.0.0.1:20162" --no-dumpcap control --resume
poetry run gallia simple-iocbi --target "tcp-lines://127.0.0.1:20162" --no-dumpcap 0x1000 reset-to-default
poetry run gallia simple-ecu-reset --ecu-reset --target "tcp-lines://127.0.0.1:20162" --no-dumpcap
poetry run gallia simple-read-error-log --ecu-reset --target "tcp-lines://127.0.0.1:20162" --no-dumpcap
poetry run gallia simple-get-vin --ecu-reset --target "tcp-lines://127.0.0.1:20162" --no-dumpcap
poetry run gallia simple-ping --ecu-reset --count 2 --target "tcp-lines://127.0.0.1:20162" --no-dumpcap
poetry run gallia simple-read-by-identifier --ecu-reset --data-id 0x108d --target "tcp-lines://127.0.0.1:20162" --no-dumpcap
poetry run gallia simple-send-pdu 1001 --ecu-reset --target "tcp-lines://127.0.0.1:20162" --no-dumpcap
poetry run gallia simple-write-by-identifier --ecu-reset --data-id 0x2266 --data 00 --target "tcp-lines://127.0.0.1:20162" --no-dumpcap
poetry run gallia simple-dtc --ecu-reset --target "tcp-lines://127.0.0.1:20162" --no-dumpcap read
poetry run gallia simple-dtc --ecu-reset --target "tcp-lines://127.0.0.1:20162" --no-dumpcap clear
poetry run gallia simple-dtc --ecu-reset --target "tcp-lines://127.0.0.1:20162" --no-dumpcap control --stop
poetry run gallia simple-dtc --ecu-reset --target "tcp-lines://127.0.0.1:20162" --no-dumpcap control --resume
poetry run gallia simple-iocbi --ecu-reset --target "tcp-lines://127.0.0.1:20162" --no-dumpcap 0x1000 reset-to-default
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: AISEC Pentesting Team
#
# SPDX-License-Identifier: CC0-1.0

.vscode
.idea

4 changes: 4 additions & 0 deletions .mailmap
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: AISEC Pentesting Team
#
# SPDX-License-Identifier: CC0-1.0

Dieter Schuster <dieter.schuster@aisec.fraunhofer.de>
Fabian Kügler <fabian.kuegler@aisec.fraunhofer.de>
Fabian Kügler <fabian.kuegler@aisec.fraunhofer.de> <104513847+fkglr@users.noreply.github.com>
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
<!--
SPDX-FileCopyrightText: AISEC Pentesting Team
SPDX-License-Identifier: CC0-1.0
-->

# Changelog

All notable changes to this project will be documented in this file.
@@ -7,4 +13,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]


## 1.0.1 (2022-06-27)

### Changed

* Make gallia [REUSE](https://reuse.software/) compliant (#175)

### Fixed

* Fixed failing CI by removing the pyxcp dependency and vendor the only relevant module (#187)
* Fixed bug causing leaking TCP connections in DoIP discover scanner (#165)
* Fixed missing recognition of `--oem default` in the cli (#171)

## 1.0.0 (2022-06-14)

Initial Release. 🎊
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
<!--
SPDX-FileCopyrightText: AISEC Pentesting Team
SPDX-License-Identifier: CC0-1.0
-->

# Contributing

Just create an [issue](https://docs.github.com/en/issues) or a [pull request](https://docs.github.com/en/pull-requests) on Github.
Loading