dreamhack simple_sqli (함께 실습)
/login 엔드 포인트를 보면
res = query_db(f'select * from users where userid="{userid}" and userpassword="{userpassword}"')
userid와 userpassword를 인자로 받아서 검증없이 query를 생성하고 있다.
userid의 인자를 admin” —
으로 입력할 경우 최종적인 SQL은
select * from users where userid=”admin” - - “ and usrpassword=”{userpassword}”
주석처리를 통해 and조건이 사라지므로 admin으로 로그인 가능하게된다.
dreamhack Mango (함께 실습)
noSQL + BlindSQL문제이다.