본문 바로가기

웹해킹

webhacking.kr(old) 6번

반응형

6번 문제에 들어가면 이렇게 view-source와

ID, PW가 적혀 있다.

일단 소스를 보도록 한다.

일단 php코드를 보니, id, pw를 base64_encode해야 하는데, 이를 20번 반복해야 함을 확인할 수 있다.

또한 1id와 pw에서 ~8을 각각 다른 문자로 대체함을 확인할 수 있다.

decode또한 20번 반복함을 확인할 수 있고,

일단 id가 admin이어야 하고 pw가 nimda여야을 확인할 수 있다.

이렇게 온라인 컴파일러로 코드를 작성해 인코딩한다.

 

user와 password에서 setcookie함을 확인할 수 있다.

id와 pw는 명시되어 있으니 20번 인코딩해보도록 한다.

php코드를 그대로 사용해도 될 것 같아

코드를 사용한다.

id를 20번 인코딩한 결과는 아래와 같다.

Vm0wd2QyUXlVWGxWV0d4V1YwZDRWMVl3WkRSV01WbDNXa1JTVjAxV2JETlhhMUpUVmpBeFYySkVUbGhoTVVwVVZtcEJlRll5U2tWVWJHaG9UVlZ3VlZadGNFSmxSbGw1VTJ0V1ZXSkhhRzlVVmxaM1ZsWmFjVkZ0UmxSTmJFcEpWbTEwYTFkSFNrZGpSVGxhVmpOU1IxcFZXbUZrUjA1R1UyMTRVMkpIZHpGV1ZFb3dWakZhV0ZOcmFHaFNlbXhXVm1wT1QwMHhjRlpYYlVaclVqQTFSMWRyV25kV01ERkZVbFJHVjFaRmIzZFdha1poVjBaT2NtRkhhRk5sYlhoWFZtMXdUMVF3TUhoalJscFlZbGhTV0ZSV2FFTlNiRnBZWlVaT1ZXSlZXVEpWYkZKRFZqQXhkVlZ1V2xaaGExcFlXa1ZhVDJOc2NFZGhSMnhUVFcxb2IxWXhaREJaVmxsM1RVaG9hbEpzY0ZsWmJGWmhZMnhXY1ZGVVJsTk5WMUo1VmpKNFQxWlhTbFpYVkVwV1lrWktTRlpxUm1GU2JVbDZXa1prYUdFeGNHOVdha0poVkRKT2RGSnJhR2hTYXpWeldXeG9iMWRHV25STldHUlZUVlpHTTFSVmFHOWhiRXB6WTBac1dtSk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JVVm1SVFpXeHNWbGRzVG1oU1ZFWjZWVEkxYjFZeFdYcFZiR2hZVm14d1lWcFZXbXRrVmtwelZtMXNWMUl6YURWV01XUXdXVmRSZVZaclpGZGliRXB5Vld0V1MySXhiRmxqUldSc1ZteEtlbFp0TURWWFIwcEhZMFpvV2sxSGFFeFdNbmhoVjBaV2NscEhSbGROTW1oSlYxUkplRk14U1hoalJXUmhVbXMxV0ZZd1ZrdE5iRnAwWTBWa1dsWXdWalJXYkdodlYwWmtTR0ZHV2xwaVdHaG9WbTE0YzJOc1pISmtSM0JUWWtad05GWlhNVEJOUmxsNFYyNU9hbEpYYUZoV2FrNVRWRVpzVlZGWWFGTldhM0I2VmtkNFlWVXlTa1pYV0hCWFZsWndSMVF4V2tOVmJFSlZUVVF3UFE9PQ==<br>

 

엄청나게 길다,,

f12를 눌러 application의 cookie를 본다.

value값을 눌러 위의 값을 넣어준다.

그 후에 사이트를 새로고침한다.

풀렸음을 확인할 수 있다.

이렇게 풀렸음을 확인할 수 있다.

반응형

'웹해킹' 카테고리의 다른 글

webhacking.kr(old) 19번  (0) 2020.05.24
webhacking.kr(old) 10번  (0) 2020.05.21
webhacking.kr (old) 36번  (0) 2020.05.17
webhacking.kr 35번  (0) 2020.05.17
webhacking.kr(old)46번  (0) 2020.05.13