Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
353 commits
Select commit Hold shift + click to select a range
5b024bf
Update module.yml
Jfar97 Aug 23, 2025
b4ffed8
Create README.md
Jfar97 Aug 23, 2025
f18d5fb
Create DESCRIPTION.md
Jfar97 Aug 23, 2025
ed2e119
Create DESCRIPTION.md
Jfar97 Aug 23, 2025
6f20adf
Create DESCRIPTION.md
Jfar97 Aug 23, 2025
612f743
Create DESCRIPTION.md
Jfar97 Aug 23, 2025
57a56d8
Create DESCRIPTION.md
Jfar97 Aug 23, 2025
56374f8
Update module.yml
Jfar97 Aug 23, 2025
fe9cc29
Create DESCRIPTION.md
Jfar97 Aug 23, 2025
57fc7cf
Create DESCRIPTION.md
Jfar97 Aug 23, 2025
f04617d
Update module.yml
Jfar97 Aug 23, 2025
ea014ff
Update module.yml
Jfar97 Aug 23, 2025
d18eecc
Update RunTest.py
Jfar97 Aug 23, 2025
430e684
Update RunTest.py
Jfar97 Aug 23, 2025
f861a1c
Update RunTest.py
Jfar97 Aug 23, 2025
578246d
Update RunTest.py
Jfar97 Aug 23, 2025
f254edb
Add files via upload
Jfar97 Aug 23, 2025
b73965b
Add files via upload
Jfar97 Aug 23, 2025
d8c29c9
Add files via upload
Jfar97 Aug 23, 2025
16e233e
Add files via upload
Jfar97 Aug 23, 2025
e1c06c2
Add files via upload
Jfar97 Aug 23, 2025
327a95e
Rename FuncCallFlow.o to challenge.o
Jfar97 Aug 23, 2025
86a5eb4
Rename ExamineElf.o to challenge.o
Jfar97 Aug 23, 2025
ef03362
Rename challenge.o to challenge
Jfar97 Aug 23, 2025
43cf811
Rename challenge.o to challenge
Jfar97 Aug 23, 2025
26f0d28
Rename Patching.o to challenge
Jfar97 Aug 23, 2025
f5a9ba2
Rename StringsCheck.o to challenge
Jfar97 Aug 23, 2025
520c7a6
Rename Tracing.o to challenge
Jfar97 Aug 23, 2025
c42ec12
Delete re-intro/string-check/challenge
Jfar97 Aug 23, 2025
72ceece
Add files via upload
Jfar97 Aug 23, 2025
c73bedd
Add files via upload
Jfar97 Aug 23, 2025
51446f1
Rename StringsCheck.py to Questions.py
Jfar97 Aug 23, 2025
0751100
Add files via upload
Jfar97 Aug 23, 2025
cd2ca98
Update and rename FuncCallFlow.py to Questions.py
Jfar97 Aug 23, 2025
829a087
Update Questions.py
Jfar97 Aug 23, 2025
9821d6c
Delete re-intro/call-flow/challenge
Jfar97 Aug 24, 2025
4dbd5e7
Add files via upload
Jfar97 Aug 24, 2025
708941c
Rename FuncCallFlow to challenge
Jfar97 Aug 24, 2025
b720c15
Update Questions.py
Jfar97 Aug 24, 2025
ab14e22
Create get_flag
Jfar97 Aug 24, 2025
10dcef2
Add files via upload
Jfar97 Aug 24, 2025
7243adb
Rename RandAndAddress to Level5
Jfar97 Aug 24, 2025
e038d68
Rename RandAndAddress.py to RunTest.py
Jfar97 Aug 24, 2025
6097e40
Update RunTest.py
Jfar97 Aug 24, 2025
111368a
Update RunTest.py
Jfar97 Aug 24, 2025
cf429ae
Update RunTest.py
Jfar97 Aug 24, 2025
3cb5949
Delete re-intro/level-5-rand/Level5
Jfar97 Aug 24, 2025
f4bc6f3
Add files via upload
Jfar97 Aug 24, 2025
77fbed8
Rename RandAndAddress to Level5
Jfar97 Aug 24, 2025
8fcaadb
Update RunTest.py
Jfar97 Aug 24, 2025
0540e67
Add files via upload
Jfar97 Aug 24, 2025
b802427
Create get_flag
Jfar97 Aug 24, 2025
b6136cd
Rename Special.py to RunTest.py
Jfar97 Aug 24, 2025
c4b3496
Create DESCRIPTION.md
Jfar97 Aug 24, 2025
6a3710a
Add files via upload
Jfar97 Aug 24, 2025
c87dd20
Rename Server-1 to server
Jfar97 Aug 24, 2025
3997968
Rename Server-2 to receiver
Jfar97 Aug 24, 2025
7a5bdf7
Rename Server.py to RunTest.py
Jfar97 Aug 24, 2025
c31f647
Update module.yml
Jfar97 Aug 24, 2025
039e28f
Create get_flag
Jfar97 Aug 24, 2025
aa83bd5
Update module.yml
Jfar97 Aug 24, 2025
6591cd4
Update RunTest.py
Jfar97 Aug 24, 2025
1316d3c
Update dojo.yml
Jfar97 Aug 24, 2025
080e6e4
Delete demo directory
Jfar97 Aug 24, 2025
3b529c9
Delete world directory
Jfar97 Aug 24, 2025
009633b
Delete hello directory
Jfar97 Aug 24, 2025
cc9616b
Update dojo.yml
Jfar97 Aug 24, 2025
9ff9f2a
Update dojo.yml
Jfar97 Aug 24, 2025
b826921
Update dojo.yml
Jfar97 Aug 24, 2025
61dcdd1
Create DESCRIPTION.md
Jfar97 Aug 24, 2025
478a5d4
Add files via upload
Jfar97 Aug 24, 2025
cb13f89
Create get_flag
Jfar97 Aug 24, 2025
c7dd15a
Rename ThirdDuo.py to RunTest.py
Jfar97 Aug 24, 2025
139f612
Delete re-intro/level-1/examine.c
Jfar97 Aug 24, 2025
89b0e7a
Update module.yml
Jfar97 Aug 24, 2025
1779dcd
Update dojo.yml
Jfar97 Aug 24, 2025
d53b61d
Add files via upload
Jfar97 Aug 24, 2025
8626e99
Create DESCRIPTION.md
Jfar97 Aug 24, 2025
9c4d7e1
Create simple-file.c
Jfar97 Aug 24, 2025
d13cd75
Update simple-file.c
Jfar97 Aug 24, 2025
b927511
Add files via upload
Jfar97 Aug 24, 2025
8d6b916
Rename simple-hex to gen-env
Jfar97 Aug 24, 2025
7e06cc4
Rename gen-env to gen-environment
Jfar97 Aug 24, 2025
09ecf35
Create .init
Jfar97 Aug 24, 2025
cd4ab56
Update module.yml
Jfar97 Aug 24, 2025
76f74c5
Renamed DiffEnv to diff-env
Jfar97 Aug 24, 2025
4649e19
Update module.yml
Jfar97 Aug 24, 2025
2de815a
Update .init
Jfar97 Aug 24, 2025
1db1f64
Update .init
Jfar97 Aug 24, 2025
c996354
Update .init
Jfar97 Aug 24, 2025
103964e
Update .init
Jfar97 Aug 24, 2025
c2f9fd0
Update .init
Jfar97 Aug 24, 2025
be76efa
Update .init
Jfar97 Aug 24, 2025
d391673
Create DESCRIPTION.md
Jfar97 Aug 24, 2025
f847664
Create .init
Jfar97 Aug 24, 2025
c2db199
Update module.yml
Jfar97 Aug 24, 2025
f35fdbe
Update module.yml
Jfar97 Aug 25, 2025
38eaa28
Delete re-intro/duo-level-3-header/main
Jfar97 Aug 25, 2025
2b50bc3
Add files via upload
Jfar97 Aug 25, 2025
f57e7ea
Rename ThirdDuo to main
Jfar97 Aug 25, 2025
d8852f0
Update RunTest.py
Jfar97 Aug 25, 2025
e94a40d
Add files via upload
Jfar97 Aug 25, 2025
1b62d8d
Update and rename ExamineElf.py to Questions.py
Jfar97 Aug 25, 2025
b78eda1
Add files via upload
Jfar97 Aug 25, 2025
b7958a2
Update and rename Tracing.py to Questions.py
Jfar97 Aug 25, 2025
bd569bd
Delete re-intro/patching/challenge
Jfar97 Aug 25, 2025
b305ef9
Add files via upload
Jfar97 Aug 25, 2025
5ce7ed4
Update and rename Patching.py to RunTest.py
Jfar97 Aug 25, 2025
2133398
Rename patching to challenge
Jfar97 Aug 25, 2025
a5a7783
Add files via upload
Jfar97 Aug 25, 2025
4e09cdc
Update and rename DiffEnv.py to Questions.py
Jfar97 Aug 25, 2025
49050fb
Update Questions.py
Jfar97 Aug 25, 2025
cfe526e
Rename server to sender
Jfar97 Aug 26, 2025
13314b5
Update module.yml
Jfar97 Aug 26, 2025
2867d80
Create .init
Jfar97 Aug 26, 2025
70e2510
Update Questions.py
Jfar97 Aug 26, 2025
588d84f
Update Questions.py
Jfar97 Aug 26, 2025
011b69c
Create DESCRIPTION.md
Jfar97 Sep 21, 2025
b1cecf2
Create .init
Jfar97 Sep 22, 2025
ac05489
Add files via upload
Jfar97 Sep 22, 2025
7ede3f1
Create RunTest.py
Jfar97 Sep 22, 2025
1552b18
Update .init
Jfar97 Sep 22, 2025
a5ce2b2
Update module.yml
Jfar97 Sep 22, 2025
f0fe47d
Update .init
Jfar97 Sep 22, 2025
73923cd
Update RunTest.py
Jfar97 Sep 22, 2025
35bda5c
Update .init
Jfar97 Sep 22, 2025
cd12533
Update RunTest.py
Jfar97 Sep 22, 2025
ef5cc9d
Update .init
Jfar97 Sep 22, 2025
d17fab1
Update RunTest.py
Jfar97 Sep 22, 2025
0de181e
Update RunTest.py
Jfar97 Sep 22, 2025
f45040f
Update RunTest.py
Jfar97 Sep 22, 2025
6fdc019
Create README.md
Jfar97 Dec 15, 2025
4e2d7ee
Add files via upload
Jfar97 Dec 15, 2025
dd2d8c1
Create .init
Jfar97 Dec 15, 2025
7486f35
Add new challenge 'Problem 1' to module.yml
Jfar97 Dec 15, 2025
fd22e41
Update .init
Jfar97 Dec 15, 2025
b968b63
Implement random word generation and C compilation
Jfar97 Dec 15, 2025
b9d2816
Refactor .init script for better path handling
Jfar97 Dec 15, 2025
9323067
Refactor Python script for C compilation and key generation
Jfar97 Dec 15, 2025
a82a779
Add GCC variable for compiler path
Jfar97 Dec 15, 2025
bc6182f
Fix GCC command concatenation in .init file
Jfar97 Dec 15, 2025
8535198
Update check.py
Jfar97 Dec 15, 2025
d9cd06f
Update check.py
Jfar97 Dec 15, 2025
1b47d9a
Refactor executable.c and remove unnecessary functions
Jfar97 Dec 15, 2025
0f6d2fc
Delete re-intro/1-prob/executable.c
Jfar97 Jan 8, 2026
a1a5246
Rename C file from 'executable.c' to 'challenge.c'
Jfar97 Jan 8, 2026
2b8a3d5
Add files via upload
Jfar97 Jan 8, 2026
6e5076a
Modify main function to accept command-line arguments
Jfar97 Jan 8, 2026
b7fe769
Create README.md
Jfar97 Jan 10, 2026
35845e1
Add files via upload
Jfar97 Jan 10, 2026
2d9b8df
Delete re-intro/1-prob/challenge.c
Jfar97 Jan 10, 2026
e25dd11
Update .init
Jfar97 Jan 10, 2026
e9ea07b
Delete re-intro/1-prob/challenge_files/README.md
Jfar97 Jan 10, 2026
de77d0a
Update .init
Jfar97 Jan 10, 2026
2e74808
Create .init
Jfar97 Jan 26, 2026
847c5d0
Add shebang to .init file
Jfar97 Jan 26, 2026
7fd1385
Add script file handling in .init
Jfar97 Jan 27, 2026
798475d
Add files via upload
Jfar97 Jan 27, 2026
477a052
Update module.yml
Jfar97 Jan 27, 2026
83c4c3e
Update .init
Jfar97 Jan 27, 2026
f16dd50
Rename script_file to script and update file operations
Jfar97 Jan 27, 2026
dfe7dcb
Create README.md
Jfar97 Feb 2, 2026
bd31eec
Update module.yml
Jfar97 Feb 2, 2026
dca9964
Create .init
Jfar97 Feb 2, 2026
1cc93fa
Add script to copy and set permissions for rename.py
Jfar97 Feb 2, 2026
083ab82
Add script to rename variables and functions
Jfar97 Feb 2, 2026
8869c7b
Comment out variable renaming instructions
Jfar97 Feb 2, 2026
3f5a7f1
Update .init
Jfar97 Feb 2, 2026
ad2c6c5
Uncomment variable renaming instructions
Jfar97 Feb 2, 2026
8bf93e8
Update rename.py
Jfar97 Feb 2, 2026
e09d89a
Refactor variable and function renaming logic
Jfar97 Feb 2, 2026
83587fd
Update rename.py
Jfar97 Feb 3, 2026
e1757ab
Clarify print statement for rename detection
Jfar97 Feb 3, 2026
729d49c
Update rename.py
Jfar97 Feb 3, 2026
7591b3e
Create CheckXML.py
Jfar97 Feb 9, 2026
93730ea
Change file permissions and remove script after copy
Jfar97 Feb 9, 2026
f179d52
Update rename.py
Jfar97 Feb 9, 2026
d70f7ef
Add subprocess import to rename.py
Jfar97 Feb 9, 2026
8f994fd
Update rename.py
Jfar97 Feb 9, 2026
884c23d
Update rename.py
Jfar97 Feb 9, 2026
8c79283
Change permissions for CheckXML.py to 0111
Jfar97 Feb 9, 2026
c00a268
Change permissions for CheckXML.py to 0o511
Jfar97 Feb 9, 2026
d1d163c
Refactor CheckXML.py to remove correct_edits variable
Jfar97 Feb 11, 2026
dbda5b7
Refactor output printing in rename.py
Jfar97 Feb 11, 2026
dfbfb0d
Comment out flag file access
Jfar97 Feb 11, 2026
22ed410
Comment out chmod for CheckXML.py
Jfar97 Feb 11, 2026
dd15ef5
Update CheckXML.py
Jfar97 Feb 11, 2026
b011e68
Fix file opening mode in CheckXML.py
Jfar97 Feb 11, 2026
6c920a1
Add print statement for euid before reading flag
Jfar97 Feb 11, 2026
3e5331a
Add imports and edited variable declarations
Jfar97 Feb 11, 2026
b818ce5
Print error output to Ghidra console
Jfar97 Feb 11, 2026
450fcbc
Update CheckXML.py
Jfar97 Mar 2, 2026
5d55d65
Update .init
Jfar97 Mar 2, 2026
f17cb48
Add source.c with a simple target function
Jfar97 Mar 2, 2026
6c45fa7
Update .init
Jfar97 Mar 2, 2026
f6a1ca6
Read target addresses from addresses.txt
Jfar97 Mar 2, 2026
98134c3
Rename addresses_file_path variable assignment
Jfar97 Mar 2, 2026
1d37669
Create README.md
Jfar97 Mar 2, 2026
27b050c
Create .init
Jfar97 Mar 2, 2026
9a9e94f
Create script.py
Jfar97 Mar 2, 2026
855eeaf
Update module.yml
Jfar97 Mar 2, 2026
a5fbecc
Add shebang to .init script
Jfar97 Mar 2, 2026
fe69139
Delete re-intro/auto-script-test/README.md
Jfar97 Mar 2, 2026
7195160
Delete re-intro/auto-script-test/.init
Jfar97 Mar 3, 2026
fc97a8a
Add Ghidra category and description to rename.py
Jfar97 Mar 3, 2026
6623f0c
Remove unnecessary metadata from rename.py
Jfar97 Mar 3, 2026
d16cca5
Rename rename.py to 1-rename.py
Jfar97 Mar 3, 2026
7eda09b
Update .init
Jfar97 Mar 3, 2026
8f89d5c
Add run script for GHIDRA analysis
Jfar97 Mar 3, 2026
8817fba
Rename GHIDRA_HOME and update subprocess calls
Jfar97 Mar 3, 2026
0a5f93d
Refactor Ghidra path handling and subprocess calls
Jfar97 Mar 3, 2026
064403c
Add files via upload
Jfar97 Mar 12, 2026
9be7974
Create .init
Jfar97 Mar 12, 2026
bdf1197
Update .init
Jfar97 Mar 12, 2026
2bc4a2c
Update script initialization and directory creation
Jfar97 Mar 12, 2026
5458d6f
Update and rename script.py to Autoscript.py
Jfar97 Mar 12, 2026
3075479
Fix formatting issues in .init file
Jfar97 Mar 12, 2026
f36224f
Refactor unzip command in auto-script-test init
Jfar97 Mar 12, 2026
9e2a608
Update .init
Jfar97 Mar 12, 2026
be34946
Refactor extension directory setup in init script
Jfar97 Mar 12, 2026
2a4e822
Add files via upload
Jfar97 Mar 12, 2026
574a53a
Update .init
Jfar97 Mar 12, 2026
e6cde00
Enhance script with tool paths and commands
Jfar97 Mar 12, 2026
b0be680
Add source.c with a simple target function
Jfar97 Mar 12, 2026
6ecbfde
Enhance auto-script setup with path and command updates
Jfar97 Mar 12, 2026
1276327
Add auto-script-test/run for Ghidra analysis
Jfar97 Mar 12, 2026
7cd3d0b
Update Ghidra paths and subprocess commands
Jfar97 Mar 12, 2026
04f875e
Update Autoscript.py
Jfar97 Mar 12, 2026
873e1dc
Update module.yml
Jfar97 Mar 12, 2026
fdbff6c
Fix casing of '1-Rename-Lesson' to '1-rename-lesson'
Jfar97 Mar 12, 2026
6c36d52
Add .init file for Rename Lesson section
Jfar97 Mar 12, 2026
c0320f0
Add files via upload
Jfar97 Mar 13, 2026
7a8f93e
Create CheckXML.py
Jfar97 Mar 13, 2026
593a40f
Create source.c
Jfar97 Mar 13, 2026
b777c15
Add Autoscript.py for renaming binary components
Jfar97 Mar 13, 2026
f1ba626
Update module.yml
Jfar97 Mar 13, 2026
44e133f
Fix case of 'Rename-Lesson' to 'rename-lesson'
Jfar97 Mar 13, 2026
145d955
Add .init file for 1-rename-lesson
Jfar97 Mar 13, 2026
48c8003
Add files via upload
Jfar97 Mar 13, 2026
7e142cb
Initialize script for challenge setup and file handling
Jfar97 Mar 13, 2026
e39c16e
Add Autoscript.py for renaming challenge
Jfar97 Mar 13, 2026
fc4110f
Add CheckXML.py for address and flag processing
Jfar97 Mar 13, 2026
b4ddefe
Add source.c with a simple function and global variable
Jfar97 Mar 13, 2026
21fa28f
Fix YAML syntax for Ghidra Rename entry
Jfar97 Mar 13, 2026
9dce09d
Update Autoscript.py
Jfar97 Mar 24, 2026
27f1e6c
Enhance CheckXML.py to validate renaming
Jfar97 Mar 24, 2026
858e688
Delete re-intro/1-rename-lesson/ghidra_11.4.2_PUBLIC_20260312_AutoScr…
Jfar97 Mar 25, 2026
f3d6fcb
Add files via upload
Jfar97 Mar 25, 2026
e5baf1c
Update .init
Jfar97 Mar 25, 2026
f256f53
Added 11.4.2 Ghidra to /challenge
Jfar97 Apr 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
Binary file added .DS_Store
Binary file not shown.
1 change: 0 additions & 1 deletion demo/DESCRIPTION.md

This file was deleted.

28 changes: 0 additions & 28 deletions demo/desktop-auto-launch/.init

This file was deleted.

1 change: 0 additions & 1 deletion demo/desktop-auto-launch/DESCRIPTION.md

This file was deleted.

4 changes: 0 additions & 4 deletions demo/module.yml

This file was deleted.

8 changes: 3 additions & 5 deletions dojo.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
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
Comment on lines 1 to +8

Copilot AI Apr 8, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
1 change: 0 additions & 1 deletion hello/DESCRIPTION.md

This file was deleted.

1 change: 0 additions & 1 deletion hello/apple/DESCRIPTION.md

This file was deleted.

10 changes: 0 additions & 10 deletions hello/apple/README.md

This file was deleted.

4 changes: 0 additions & 4 deletions hello/apple/apple

This file was deleted.

1 change: 0 additions & 1 deletion hello/banana/DESCRIPTION.md

This file was deleted.

14 changes: 0 additions & 14 deletions hello/banana/README.md

This file was deleted.

1 change: 0 additions & 1 deletion hello/banana/_0/.config

This file was deleted.

1 change: 0 additions & 1 deletion hello/banana/_1/.config

This file was deleted.

1 change: 0 additions & 1 deletion hello/banana/_2/.config

This file was deleted.

10 changes: 0 additions & 10 deletions hello/banana/banana

This file was deleted.

6 changes: 0 additions & 6 deletions hello/module.yml

This file was deleted.

Binary file added re-intro/.DS_Store
Binary file not shown.
89 changes: 89 additions & 0 deletions re-intro/1-Rename-Lesson/.init
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
#!/usr/local/bin/python

# IMPORTS
import os
import shutil
import subprocess


# DECLARATIONS
# challenge/ Files Declarations
c_file = "source.c"
script = "Autoscript.py"
executable = "executable"
check_xml = "CheckXML.py"
addresses_file = "addresses.txt"
zip_name = "ghidra_11.4.2_PUBLIC_20260324_AutoScripting.zip"
tool_config = "_auto_start.tcd"

# Directory Declarations
curr_dir = os.path.dirname(os.path.abspath(__file__))
script_dir = "/home/hacker/ghidra_scripts"
ext_dir = "/home/hacker/.config/ghidra/ghidra_11.4.2_NIX/Extensions"
tools_dir = "/home/hacker/.config/ghidra/ghidra_11.4.2_NIX/tools"

# challenge/ Files Path Declarations
c_path = os.path.join(curr_dir, c_file)
script_path = os.path.join(curr_dir, script)
executable_path = os.path.join(curr_dir, executable)
check_xml_path = os.path.join(curr_dir, check_xml)
addresses_file_path = os.path.join(curr_dir, addresses_file)
zip_path = os.path.join(curr_dir, zip_name)
tool_path = os.path.join(curr_dir, tool_config)

# Tool Path Declarations
gcc_path = "/run/dojo/bin/gcc"
nm_path = "/run/dojo/bin/nm"
unzip_path = "/run/dojo/bin/unzip"

# Destination Path Declarations
script_destination = os.path.join(script_dir, script)
tool_destination = os.path.join(tools_dir, tool_config)

# Command Declarations
c_compile = [gcc_path, c_path, "-o", executable_path]
nm_command = [nm_path, executable_path]
unzip_command = [unzip_path, "-o", zip_path, "-d", ext_dir]


# CHALLENGE SETUP
# Create extensions/ if it does not exist in user settings and then unzip extension into it to install extension and plugin
os.makedirs(ext_dir, exist_ok=True)
subprocess.run(unzip_command, check=True)

# Copy the script into ghidra_scripts
shutil.copy2(script_path, script_destination)
os.chmod(script_destination, 0o444)

# Copy the tool config into tools
shutil.copy2(tool_path, tool_destination)

# Compile the C file to get the executable
subprocess.run(c_compile, check=True)

# Use nm to get the addresses of the variable and function that need to be renamed, and write those to a file for the script to read
nmOutput = subprocess.run(nm_command, check=True, capture_output=True, text=True)
nmStdout = nmOutput.stdout

targets = {"global_target", "functiontarget"}
nm_addresses = {}

for line in nmStdout.splitlines():
parts = line.split()

if len(parts) == 3:
addr, sym_type, name = parts
if name in targets:
nm_addresses[name] = "0010" + format(int(addr, 16), "x")[-4:]

global_targ_address = nm_addresses.get("global_target")
func_targ_address = nm_addresses.get("functiontarget")


with open(addresses_file_path, "w") as f:
f.write(f"{global_targ_address}\n")
f.write(f"{func_targ_address}\n")




79 changes: 79 additions & 0 deletions re-intro/1-Rename-Lesson/Autoscript.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
#@runtime Jython

from ghidra.framework.model import DomainObjectListener
from ghidra.app.util.exporter import XmlExporter
from java.io import File
import subprocess

addresses_file_path = "/challenge/addresses.txt"

with open(addresses_file_path, "r") as f:
VAR_TARGET_ADDR = toAddr(int(f.readline().strip(), 16))
FUNC_TARGET_ADDR = toAddr(int(f.readline().strip(), 16))

VAR_EXPECTED_NAME = "pwned_var"
PARAM_EXPECTED_NAME = "pwned_param"
FUNC_EXPECTED_NAME = "pwnedfunction"

done_var = False
done_parameter = False
done_function = False

print("In this challenge, you will have to rename several parts of the binary in order to get the flag.")
print("The first portion of the executable you should rename is the variable 'global_target'. Locate this variable inside of main and rename it to 'pwned_var'.")

class ProgListener(DomainObjectListener):
def domainObjectChanged(self, ev):
global done_var
global done_parameter
global done_function
global listener

if not done_var:
sym = currentProgram.getSymbolTable().getPrimarySymbol(VAR_TARGET_ADDR)
if sym and sym.getName() == VAR_EXPECTED_NAME:
print("Correct! You can also rename functions just like with variables. Locate the function named 'functiontarget' and rename it to 'pwnedfunction'.")
done_var = True
return

if done_var and not done_function:
sym = currentProgram.getSymbolTable().getPrimarySymbol(FUNC_TARGET_ADDR)
if sym and sym.getName() == FUNC_EXPECTED_NAME:
print("Correct! Finally, just like with variables declared outside of functions, you can also rename function parameters. Locate the parameter of 'pwnedfunction' and rename it to 'pwned_param'.")
done_function = True
return

if done_function and not done_parameter:
func = currentProgram.getFunctionManager().getFunctionAt(FUNC_TARGET_ADDR)
if func:
params = func.getParameters()
if params and params[0].getName() == PARAM_EXPECTED_NAME:
print("Correct! You have successfully completed the rename challenge")
done_parameter = True

currentProgram.removeListener(listener)

program = getCurrentProgram()
exporter = XmlExporter()
output_file = File("/tmp/rename_challenge_completed.xml")
exporter.export(output_file, program, None, getMonitor())

result = subprocess.Popen(
['/challenge/CheckXML.py'],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE
)
out, err = result.communicate()
out = out.strip()

if out == "INCORRECT":
print("Something was not renamed correctly. Please try again.")

else:
print(out)

return

listener = ProgListener()
currentProgram.addListener(listener)
print("Monitoring: " + currentProgram.getName())
44 changes: 44 additions & 0 deletions re-intro/1-Rename-Lesson/CheckXML.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/usr/bin/exec-suid -- /usr/local/bin/python -I
import os

curr_dir = os.path.dirname(os.path.abspath(__file__))
addresses_file_path = os.path.join(curr_dir, "addresses.txt")

global_target_addr = ""
function_target_addr = ""

with open(addresses_file_path, "r") as f:
global_target_addr = f.readline().strip()
function_target_addr = f.readline().strip()

edited_global = f"SYMBOL ADDRESS=\"{global_target_addr}\" NAME=\"pwned_var\" NAMESPACE=\"\" TYPE=\"global\" SOURCE_TYPE=\"USER_DEFINED\" PRIMARY=\"y\""
edited_function = f"SYMBOL ADDRESS=\"{function_target_addr}\" NAME=\"pwnedfunction\" NAMESPACE=\"\" TYPE=\"global\" SOURCE_TYPE=\"USER_DEFINED\" PRIMARY=\"y\""
edited_param = "REGISTER_VAR NAME=\"pwned_param\" REGISTER=\"EDI\" DATATYPE=\"undefined4\" DATATYPE_NAMESPACE=\"/\""

global_edited = False
function_edited = False
param_edited = False

with open("/tmp/rename_challenge_completed.xml", "r", encoding="UTF-8") as file:
for line in file:
if edited_global in line:
if(not global_edited):
print("Global variable renamed correctly!")
global_edited = True
if edited_function in line:
if(not function_edited):
print("Function renamed correctly!")
function_edited = True
if edited_param in line:
if(not param_edited):
print("Parameter renamed correctly!")
param_edited = True
if global_edited and function_edited and param_edited:
break

#print("euid:", os.geteuid())
if global_edited and function_edited and param_edited:
with open("/flag", "r") as flag:
print(flag.read())
else:
print("INCORRECT")
Loading