> For the complete documentation index, see [llms.txt](https://sayonara.gitbook.io/writeups/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sayonara.gitbook.io/writeups/ctf/cyber-heroines-ctf-2023/web/radia-perlman.md).

# &#x20;Radia Perlman

### <mark style="color:blue;">Challenge Description</mark>

<div align="left"><figure><img src="https://1410593648-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYI2noEqPw69jd0hR7Prp%2Fuploads%2FPuF9Kkp5DrNrZqTiTQwV%2Fimage.png?alt=media&amp;token=0c51beaf-74bd-43ad-8dc8-db29fc3e51dd" alt=""><figcaption></figcaption></figure></div>

<div align="left"><figure><img src="https://1410593648-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYI2noEqPw69jd0hR7Prp%2Fuploads%2Fb17u74XZXXHaxedeD5hY%2Fimage.png?alt=media&amp;token=51fe76ed-09b6-4374-97ee-2e521114a02b" alt=""><figcaption></figcaption></figure></div>

<div align="left"><figure><img src="https://1410593648-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYI2noEqPw69jd0hR7Prp%2Fuploads%2FXMhWSUSJ64ZhNAazsnQu%2Fimage.png?alt=media&amp;token=c38840b5-bc8b-4edf-85ab-1d1c1f1237f3" alt=""><figcaption></figcaption></figure></div>

### <mark style="color:blue;">Command Injection Vulnerability</mark>

let's try and put a random value in the ip parameter and see if we can generate any errors that help us to identify what we are dealing with

<div align="left"><figure><img src="https://1410593648-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYI2noEqPw69jd0hR7Prp%2Fuploads%2FJf9NDbQ9jjLs71HM7nuN%2Fimage.png?alt=media&amp;token=8817a203-7d42-44f8-827b-c358dc5d72fb" alt=""><figcaption></figcaption></figure></div>

so the application gets the dns host and trys to query the corresponding ip using nslookup command, so the vulnerability here will be a command injection by injecting other command in the ip parameter

nslookup cyberheroines.ctfd.io 2>&1 ; ls ;

<div align="left"><figure><img src="https://1410593648-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYI2noEqPw69jd0hR7Prp%2Fuploads%2FJL7C99PikpKh9A7rS7Cv%2Fimage.png?alt=media&amp;token=be80d49b-a783-4cb5-8575-04662aa0d80f" alt=""><figcaption></figcaption></figure></div>

we can see that the app have executed the command ls by using the separator ;

after listing the files we find a file called flag.txt, let's try to read it using the command cat

nslookup cyberheroines.ctfd.io 2>&1 ; ls ; cat flag.txt ;

<div align="left"><figure><img src="https://1410593648-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYI2noEqPw69jd0hR7Prp%2Fuploads%2FQHR3rmWk4p8XqgcJdwWc%2Fimage.png?alt=media&amp;token=fbc025cd-bba5-4ca0-915d-cac5339b3a1c" alt=""><figcaption></figcaption></figure></div>

the command cat is blocked so we will bypass the restriction by using backslashes or double quote

#### <mark style="color:red;">bypass using backslashes</mark>

<div align="left"><figure><img src="https://1410593648-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYI2noEqPw69jd0hR7Prp%2Fuploads%2FmNEZu1q5MhLtkuMO7rAj%2Fimage.png?alt=media&amp;token=2a036b8d-5141-4f7c-9092-c35b92b6310f" alt=""><figcaption></figcaption></figure></div>

#### <mark style="color:red;">bypass using double quote</mark>

<div align="left"><figure><img src="https://1410593648-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYI2noEqPw69jd0hR7Prp%2Fuploads%2FLQyH8SX7gsxUAZqNTku6%2Fimage.png?alt=media&amp;token=ddaf5d29-5077-4969-9642-2c831e131f97" alt=""><figcaption></figcaption></figure></div>

### <mark style="color:blue;">Flag</mark>

```
chctf{1_l0v3_5p4wn1n6_n0d3_ch1ld_pr0c355}
```
