Fix case of 'Rename-Lesson' to 'rename-lesson' - #6
Conversation
Added paths for tools and updated commands for compiling and copying tools.
Added setup for extension installation and script management.
Added checks to ensure variables are renamed before printing flag content. Added an error message for incorrect renaming.
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR appears to restructure the dojo content (removing the sample hello/demo modules and introducing a re-intro module), while also vendoring in a large set of Ghidra-related GPL modules/extensions and adding new reverse-engineering challenge scaffolding.
Changes:
- Replaces the dojo’s module list/configuration to point at
re-introinstead of the sample modules. - Adds Ghidra GPL modules (DemanglerGnu + DMG) and multiple Ghidra extension artifacts/scripts.
- Adds new challenge content/scripts (e.g., rename lesson + key-check challenges) and supporting init scripts.
Reviewed changes
Copilot reviewed 118 out of 6312 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/GPL/DemanglerGnu/src/demangler_gnu_v2_24/README.txt | Adds documentation about binutils source modifications for demangler build. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/GPL/DemanglerGnu/build.gradle | Adds Gradle build + zip task for native demangler sources/binaries. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/GPL/DemanglerGnu/README.md | Adds minimal module README. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/GPL/DemanglerGnu/README.html | Adds minimal HTML README. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/GPL/DemanglerGnu/Module.manifest | Declares licensing for shipped demangler binaries. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/GPL/DemanglerGnu/LICENSE.txt | Adds licensing inventory for DemanglerGnu module inputs/outputs. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/GPL/DMG/src/dmg/java/mobiledevices/dmg/zlib/ZLIB.java | Adds zlib compression/decompression helper used by DMG parsing. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/GPL/DMG/src/dmg/java/mobiledevices/dmg/xattr/XattrConstants.java | Adds xattr constant names used in HFS parsing. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/GPL/DMG/src/dmg/java/mobiledevices/dmg/server/DmgServer.java | Adds a DMG “server” process that reads commands and streams results. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/GPL/DMG/src/dmg/java/mobiledevices/dmg/reader/DmgInputStream.java | Adds InputStream wrapper for ReadableRandomAccessStream. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/GPL/DMG/src/dmg/java/mobiledevices/dmg/reader/DmgInfoGenerator.java | Adds info extraction for DMG filesystem entries. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/GPL/DMG/src/dmg/java/mobiledevices/dmg/reader/DmgFileReader.java | Adds DMG reader + filesystem traversal + decompression logic. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/GPL/DMG/src/dmg/java/mobiledevices/dmg/hfsplus/AttributesFileParser.java | Adds HFS+ attributes file extraction/parsing for decmpfs headers. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/GPL/DMG/src/dmg/java/mobiledevices/dmg/ghidra/GSystemUtilities.java | Adds small utility helpers for DMG support code. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/GPL/DMG/src/dmg/java/mobiledevices/dmg/ghidra/GStringUtilities.java | Adds hex/string conversion helpers for DMG support code. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/GPL/DMG/src/dmg/java/mobiledevices/dmg/ghidra/GRandomAccessFile.java | Adds buffered RandomAccessFile wrapper used by GByteProvider. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/GPL/DMG/src/dmg/java/mobiledevices/dmg/ghidra/GFileUtilityMethods.java | Adds temp-file utilities used for extracted DMG data streams. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/GPL/DMG/src/dmg/java/mobiledevices/dmg/ghidra/GDataConverterLE.java | Adds little-endian primitive conversion utilities. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/GPL/DMG/src/dmg/java/mobiledevices/dmg/ghidra/GDataConverterBE.java | Adds big-endian primitive conversion utilities. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/GPL/DMG/src/dmg/java/mobiledevices/dmg/ghidra/GDataConverter.java | Adds converter interface used by BE/LE implementations. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/GPL/DMG/src/dmg/java/mobiledevices/dmg/ghidra/GConv.java | Adds numeric conversion helpers that avoid sign extension. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/GPL/DMG/src/dmg/java/mobiledevices/dmg/ghidra/GByteProvider.java | Adds file-backed byte provider used by DMG parsing code. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/GPL/DMG/src/dmg/java/mobiledevices/dmg/decmpfs/DecmpfsStates.java | Adds decmpfs-related constants. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/GPL/DMG/src/dmg/java/mobiledevices/dmg/decmpfs/DecmpfsHeader.java | Adds decmpfs header parser used for compressed files. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/GPL/DMG/src/dmg/java/mobiledevices/dmg/decmpfs/DecmpfsConstants.java | Adds decmpfs magic/constants. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/GPL/DMG/src/dmg/java/mobiledevices/dmg/decmpfs/DecmpfsCompressionTypes.java | Adds decmpfs compression type constants. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/GPL/DMG/src/dmg/java/mobiledevices/dmg/btree/BTreeUserDataRecord.java | Adds B-tree record parsing class. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/GPL/DMG/src/dmg/java/mobiledevices/dmg/btree/BTreeTypes.java | Adds B-tree type constants. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/GPL/DMG/src/dmg/java/mobiledevices/dmg/btree/BTreeRootNodeDescriptor.java | Adds root node + node enumeration logic for B-tree parsing. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/GPL/DMG/src/dmg/java/mobiledevices/dmg/btree/BTreeNodeRecord.java | Adds parsing logic for B-tree node records (+ decmpfs header extraction). |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/GPL/DMG/src/dmg/java/mobiledevices/dmg/btree/BTreeNodeKinds.java | Adds node kind definitions for B-tree parsing. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/GPL/DMG/src/dmg/java/mobiledevices/dmg/btree/BTreeNodeDescriptor.java | Adds parsing for node descriptors + record tables. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/GPL/DMG/src/dmg/java/mobiledevices/dmg/btree/BTreeMapRecord.java | Adds bitmap-based node allocation record parsing. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/GPL/DMG/src/dmg/java/mobiledevices/dmg/btree/BTreeHeaderRecordAttributes.java | Adds header attribute bit masks. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/GPL/DMG/src/dmg/java/mobiledevices/dmg/btree/BTreeHeaderRecord.java | Adds B-tree header record parsing. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/GPL/DMG/data/server_memory.cfg | Adds DMG server runtime memory config. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/GPL/DMG/build.gradle | Adds Gradle build for DMG jar from a custom sourceSet. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/GPL/DMG/README.md | Adds minimal module README. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/GPL/DMG/README.html | Adds minimal HTML README. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/GPL/DMG/Module.manifest | Declares DMG jar licensing. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/GPL/DMG/LICENSE.txt | Adds licensing inventory for DMG module dependencies. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/Extensions/IDAPro/README.html | Adds HTML documentation for IDA exporters. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/Extensions/IDAPro/Python/7xx/plugins/xml_importer.py | Adds IDA7 XML importer plugin script. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/Extensions/IDAPro/Python/7xx/plugins/xml_exporter.py | Adds IDA7 XML exporter plugin script. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/Extensions/IDAPro/Python/7xx/loaders/xml_loader.py | Adds IDA7 XML loader script. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/Extensions/IDAPro/Python/7xx/README.html | Adds IDA7 exporter/importer/loader documentation. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/Extensions/IDAPro/Python/6xx/README.html | Adds IDA6 exporter/loader documentation. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/Extensions/Ghidra/Skeleton/src/main/resources/images/README.txt | Adds skeleton extension resource directory note. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/Extensions/Ghidra/Skeleton/src/main/java/skeleton/SkeletonPlugin.java | Adds skeleton plugin example source. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/Extensions/Ghidra/Skeleton/src/main/java/skeleton/SkeletonLoader.java | Adds skeleton loader example source. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/Extensions/Ghidra/Skeleton/src/main/java/skeleton/SkeletonFileSystem.java | Adds skeleton filesystem example source. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/Extensions/Ghidra/Skeleton/src/main/java/skeleton/SkeletonExporter.java | Adds skeleton exporter example source. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/Extensions/Ghidra/Skeleton/src/main/java/skeleton/SkeletonAnalyzer.java | Adds skeleton analyzer example source. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/Extensions/Ghidra/Skeleton/src/main/help/help/topics/skeleton/help.html | Adds skeleton extension help topic. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/Extensions/Ghidra/Skeleton/src/main/help/help/TOC_Source.xml | Adds skeleton TOC scaffolding. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/Extensions/Ghidra/Skeleton/os/win_x86_64/README.txt | Adds skeleton extension OS-binary directory note (Windows). |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/Extensions/Ghidra/Skeleton/os/mac_x86_64/README.txt | Adds skeleton extension OS-binary directory note (macOS). |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/Extensions/Ghidra/Skeleton/os/linux_x86_64/README.txt | Adds skeleton extension OS-binary directory note (Linux). |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/Extensions/Ghidra/Skeleton/lib/README.txt | Adds skeleton extension libs directory note. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/Extensions/Ghidra/Skeleton/ghidra_scripts/README.txt | Adds skeleton extension scripts directory note. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/Extensions/Ghidra/Skeleton/extension.properties | Adds skeleton extension properties template. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/Extensions/Ghidra/Skeleton/data/sleighArgs.txt | Adds Sleigh compiler args placeholder. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/Extensions/Ghidra/Skeleton/data/languages/skel.slaspec | Adds skeleton language Sleigh spec. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/Extensions/Ghidra/Skeleton/data/languages/skel.sinc | Adds skeleton instruction include file. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/Extensions/Ghidra/Skeleton/data/languages/skel.pspec | Adds processor spec for skeleton language. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/Extensions/Ghidra/Skeleton/data/languages/skel.opinion | Adds commented example loader opinions. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/Extensions/Ghidra/Skeleton/data/languages/skel.ldefs | Adds commented-out language definition. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/Extensions/Ghidra/Skeleton/data/languages/skel.cspec | Adds compiler spec for skeleton language. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/Extensions/Ghidra/Skeleton/data/buildLanguage.xml | Adds Ant build for Sleigh language compilation. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/Extensions/Ghidra/Skeleton/data/README.txt | Adds skeleton extension data directory documentation. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/Extensions/Ghidra/Skeleton/buildTemplate.gradle | Adds extension build template for external Ghidra install. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/Extensions/Ghidra/Skeleton/README.md | Adds minimal README for skeleton extension. |
| re-intro/auto-script-test/ghidra_11.4-2.2_PUBLIC/Extensions/Eclipse/GhidraSleighEditor/README.md | Adds full documentation for Sleigh editor Eclipse plugin. |
| re-intro/auto-script-test/Autoscript.py | Adds a simple DomainObject listener script for Ghidra. |
| re-intro/auto-script-test/.init | Adds init script to install extensions, copy scripts, compile a sample binary, and deploy tool config. |
| re-intro/README.md | Adds planning notes / TODO list / progress log for the reverse engineering intro module. |
| re-intro/1-rename-lesson/source.c | Adds a small C program used in rename lesson challenge. |
| re-intro/1-rename-lesson/CheckXML.py | Adds a SUID checker script that validates XML symbol changes and prints flag. |
| re-intro/1-rename-lesson/Autoscript.py | Adds Ghidra autoscript to guide renaming and export an XML snapshot for validation. |
| re-intro/1-rename-lesson/.init | Adds init script to install autoscripting assets and compute target addresses via nm. |
| re-intro/1-prob/check.py | Adds a key-check script that prints flag when key matches expected. |
| re-intro/1-prob/challenge_files/2.c | Adds a randomized-string C challenge variant for key construction. |
| re-intro/1-prob/challenge_files/1.c | Adds a randomized-string C challenge variant for key construction. |
| re-intro/1-prob/challenge_files/0.c | Adds a randomized-string C challenge variant for key construction. |
| re-intro/1-prob/README.md | Adds an (empty) README placeholder. |
| re-intro/1-prob/.init | Adds init script to compile a random C variant and write expected key/version. |
| re-intro/1-Rename-Lesson/source.c | Adds a duplicate copy of rename lesson C program under different-cased directory. |
| re-intro/1-Rename-Lesson/CheckXML.py | Adds a duplicate copy of rename lesson checker under different-cased directory. |
| re-intro/1-Rename-Lesson/Autoscript.py | Adds a duplicate copy of rename lesson autoscript under different-cased directory. |
| re-intro/1-Rename-Lesson/.init | Adds a duplicate copy of rename lesson init script under different-cased directory. |
| hello/module.yml | Removes sample “hello” module definition. |
| hello/banana/banana | Removes sample suid “banana” challenge script. |
| hello/banana/_2/.config | Removes sample banana instance config. |
| hello/banana/_1/.config | Removes sample banana instance config. |
| hello/banana/_0/.config | Removes sample banana instance config. |
| hello/banana/README.md | Removes sample banana README. |
| hello/banana/DESCRIPTION.md | Removes sample banana description. |
| hello/apple/apple | Removes sample suid “apple” challenge script. |
| hello/apple/README.md | Removes sample apple README. |
| hello/apple/DESCRIPTION.md | Removes sample apple description. |
| hello/DESCRIPTION.md | Removes sample module description. |
| dojo.yml | Renames dojo and changes module list to only include re-intro. |
| demo/module.yml | Removes sample “demo” module definition. |
| demo/desktop-auto-launch/DESCRIPTION.md | Removes demo challenge description. |
| demo/desktop-auto-launch/.init | Removes demo auto-launch init script. |
| demo/DESCRIPTION.md | Removes demo module description. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| id: example | ||
| name: Example Dojo | ||
| name: Introduction to Reverse Engineering | ||
| type: example | ||
| award: | ||
| emoji: 😀 | ||
| emoji: 🔓 | ||
| image: pwncollege/challenge-simple | ||
| modules: | ||
| - id: hello | ||
| - id: world | ||
| - id: demo | ||
| - id: re-intro |
There was a problem hiding this comment.
The PR title/intent suggests a case-only rename of a single lesson directory, but the diff shows a major dojo restructuring (module list rewired, sample modules removed) plus large third-party/vendor drops. If the intent really is only the case normalization, this PR should be split so the case rename is isolated from dojo/module and vendored Ghidra content changes.
| from (project.projectDir.toString() + "/" + srcVersion41 + "c") { | ||
| into "/" + srcVersion41 | ||
| } |
There was a problem hiding this comment.
The zip task source paths are missing a path separator before the c directory (they currently resolve to src/demangler_gnu_v2_41c / src/demangler_gnu_v2_24c). This will omit the C sources from the produced zip. Change these to srcVersionXX + \"/c\".
| from (project.projectDir.toString() + "/" + srcVersion24 + "c") { | ||
| into "/" + srcVersion24 | ||
| } |
There was a problem hiding this comment.
The zip task source paths are missing a path separator before the c directory (they currently resolve to src/demangler_gnu_v2_41c / src/demangler_gnu_v2_24c). This will omit the C sources from the produced zip. Change these to srcVersionXX + \"/c\".
| * If the entry is actually a directory, then -1 is returned. | ||
| */ | ||
| public long getLength( FSEntry entry ) { | ||
| if ( entry != null & entry.isFile() ) { |
There was a problem hiding this comment.
This uses bitwise & instead of short-circuiting logical &&. As written, entry.isFile() will always be evaluated (and it also reads oddly for a boolean guard). Replace & with &&.
| if ( entry != null & entry.isFile() ) { | |
| if ( entry != null && entry.isFile() ) { |
| Inflater inflater = new Inflater( noWrap ); | ||
|
|
||
| inflater.setInput( compressedBytes, offset, compressedBytes.length - offset ); | ||
|
|
||
| int nDecompressed = inflater.inflate( tempDecompressedBytes ); |
There was a problem hiding this comment.
Inflater/Deflater instances allocate native resources and should be released via end() (ideally in a finally block). In both decompress() and compress(), new Inflater/Deflater objects are created repeatedly without calling end(), which can leak native memory and destabilize long-running processes.
| input.skip( startDistance - 8 );//skip to the start of the zlib compressed file | ||
|
|
||
| File tempCompressedFile = GFileUtilityMethods.writeTemporaryFile( input, size - startDistance ); | ||
| InputStream inputStream = new FileInputStream( tempCompressedFile ); | ||
|
|
||
| ZLIB zlib = new ZLIB( ); | ||
| ByteArrayOutputStream uncompressedByteStream = zlib.decompress( inputStream, expectedLength ); |
There was a problem hiding this comment.
This method opens multiple InputStreams but never closes them (input and inputStream), which will leak file descriptors. Also, skip() and read() are used without checking the returned counts; skip() is not guaranteed to skip the full requested number of bytes. Use try-with-resources for all streams and a readFully/looped-skip approach to ensure the correct offsets are reached.
| result = subprocess.Popen( | ||
| ['/challenge/CheckXML.py'], | ||
| stdout=subprocess.PIPE, | ||
| stderr=subprocess.PIPE | ||
| ) | ||
| out, err = result.communicate() | ||
| out = out.strip() | ||
|
|
||
| if out == "INCORRECT": |
There was a problem hiding this comment.
The subprocess output from communicate() is typically bytes-like; comparing out to a Python string (\"INCORRECT\") will fail and can cause incorrect success reporting. Decode out (or run the process in text/universal-newlines mode) before stripping and comparing.
| function_edited = False | ||
| param_edited = False | ||
|
|
||
| with open("/tmp/rename_challenge_completed.xml", "r", encoding="UTF-8") as file: |
There was a problem hiding this comment.
This SUID-root checker trusts a fixed path in /tmp, which is attacker-controlled. A user can pre-create /tmp/rename_challenge_completed.xml with the expected lines and bypass the intended Ghidra renaming steps to read /flag. Use a root-owned, non-world-writable directory for the exported XML (or create a secure temp file with restrictive permissions), and validate ownership/permissions (and avoid following symlinks) before reading.
| if global_edited and function_edited and param_edited: | ||
| with open("/flag", "r") as flag: | ||
| print(flag.read()) |
There was a problem hiding this comment.
This SUID-root checker trusts a fixed path in /tmp, which is attacker-controlled. A user can pre-create /tmp/rename_challenge_completed.xml with the expected lines and bypass the intended Ghidra renaming steps to read /flag. Use a root-owned, non-world-writable directory for the exported XML (or create a secure temp file with restrictive permissions), and validate ownership/permissions (and avoid following symlinks) before reading.
| char[] charArray = s.toCharArray(); | ||
| for (char c : charArray) { | ||
| if (c == 11) { | ||
| encoded.append(c);// tab |
There was a problem hiding this comment.
Character code 11 is vertical-tab (\\u000B), not tab (\\t is 9). Either change the condition to c == '\\t' if the intent is to preserve tabs, or update the comment to reflect that this is preserving vertical-tab.
| encoded.append(c);// tab | |
| encoded.append(c);// vertical-tab |
No description provided.