Tags: programming warmups rex regina 

Rating: 5.0

# Regina


I first tried SSH-ing with no profile but failed.


However, a strange banner that I haven't seen before comes up mentioning REXX-Regina. The challenge description also makes a reference to Rex. After some googling around, it turns out it's a programming language. I have found an example code to run linux commands on the link below:


I created a `list_files.rex` file first because I first wanted to run a simple `ls` command without any redirections. I saw that it worked so I read the flag using the code below:

/* rexx */
address syscall 'pipe p.' /* make a pipe */
'cat flag.txt' /* cat the flag */

address syscall 'close' p.2 /* close output side */
address mvs 'execio * diskr' p.1 '(stem s.' /* read data in pipe */
do i=1 to s.0 /* process the data */
say s.i
As it can be seen in the picture below, I'm sending the output of the .rex file directly into the SSH pty to run the code and it spits out the flag. It's messy but it works.



I was very happy to get `1st blood` on this challenge.


Original writeup (https://github.com/LazyTitan33/CTF-Writeups/blob/main/Nahamcon2023/Warmups/Regina.md).