<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Python on Locus Solus | Nagi's Blog</title><link>https://x-nagi.com/tags/python.html</link><description>Recent content in Python on Locus Solus | Nagi's Blog</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Tue, 19 Jan 2021 09:02:47 +0800</lastBuildDate><atom:link href="https://x-nagi.com/tags/python/index.xml" rel="self" type="application/rss+xml"/><item><title>*CTF 2021 Reverse*5</title><link>https://x-nagi.com/post/starctf2021.html</link><pubDate>Tue, 19 Jan 2021 09:02:47 +0800</pubDate><guid>https://x-nagi.com/post/starctf2021.html</guid><description>&lt;p&gt;The endless exams finally ended, and after half a year I returned to competing with my AAA teammates—and to staying up all night. We solved five of the six reverse-engineering challenges. The remaining one, &lt;code&gt;RL_Env&lt;/code&gt;, appeared to involve machine learning; I did not even understand what it was asking us to do.&lt;/p&gt;</description></item><item><title>SECCON 2019 Finals Writeup: bad mouse &amp; 四.3</title><link>https://x-nagi.com/post/seccon-2019.html</link><pubDate>Fri, 27 Dec 2019 12:52:57 +0800</pubDate><guid>https://x-nagi.com/post/seccon-2019.html</guid><description>&lt;h1 id="bad-mouse"&gt;bad mouse&lt;/h1&gt;&#10;&lt;p&gt;The challenge provided a small USB circuit board. Once connected, it behaved like an emulated mouse and drew the flag one character at a time. Its drawing speed continually decreased, so it clearly could not finish before the competition ended.&lt;/p&gt;&#10;&lt;p&gt;First convert the supplied firmware to binary with a tool such as &lt;a href="http://hex2bin.sourceforge.net/"&gt;hex2bin&lt;/a&gt;. Open it in IDA, select Atmel AVR as the processor and ATmega32 (or another suitable model) as the device, and the firmware can be disassembled.&lt;/p&gt;</description></item><item><title>ZJUWLAN auto connect</title><link>https://x-nagi.com/post/zjuwlan-autoconnect.html</link><pubDate>Sat, 10 Nov 2018 10:36:52 +0800</pubDate><guid>https://x-nagi.com/post/zjuwlan-autoconnect.html</guid><description>&lt;div class="admonition success"&gt;&lt;p class="admonition-title"&gt;success&lt;/p&gt;&#10;&lt;p&gt;ZJU finally deployed WPA2 and 802.1X, so browser-based authentication is no longer necessary.&lt;/p&gt;&#10;&lt;/div&gt;&#10;&lt;p&gt;Recently, ZJUWLAN kept disconnecting for no apparent reason. The campus network required opening a browser to log in and then displayed a small “login successful” window—which i3wm tiled like an ordinary window. This was unbearable for a would-be perfectionist, so I wondered whether a script could perform the login directly and opened Chrome&amp;rsquo;s developer tools to investigate.&lt;/p&gt;</description></item><item><title>The 5th USTC Information Security Contest</title><link>https://x-nagi.com/post/ustc-5.html</link><pubDate>Wed, 17 Oct 2018 22:45:30 +0800</pubDate><guid>https://x-nagi.com/post/ustc-5.html</guid><description>&lt;h2 id="check-in"&gt;Check-in&lt;/h2&gt;&#10;&lt;p&gt;Press F12 in Chrome to open Developer Tools. The input field has the following attribute:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-html" data-lang="html"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Key: &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;input&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;text&amp;#34;&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;key&amp;#34;&lt;/span&gt; &lt;span class="na"&gt;maxlength&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;13&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;/&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;p&gt;Remove the &lt;code&gt;maxlength&lt;/code&gt; attribute, then enter &lt;code&gt;hackergame2018&lt;/code&gt;.&lt;/p&gt;&#10;&lt;p&gt;flag: &lt;code&gt;flag{Hackergame2018_Have_Fun!}&lt;/code&gt;&lt;/p&gt;</description></item><item><title>MeePwn 2018: image-crackme</title><link>https://x-nagi.com/post/meepwn2018.html</link><pubDate>Wed, 17 Oct 2018 22:43:16 +0800</pubDate><guid>https://x-nagi.com/post/meepwn2018.html</guid><description>&lt;h2 id="image-crackme"&gt;image-crackme&lt;/h2&gt;&#10;&lt;p&gt;I tried to reverse the challenge with IDA Pro, but IDA crashed halfway through loading it, so I had to work by inference. After running &lt;code&gt;image-crackme.exe&lt;/code&gt; several times, I found that it always generated a &lt;code&gt;MeePwn.ascii&lt;/code&gt; containing a 160×160 block of seemingly random characters. The directory also contained a 160×160 &lt;code&gt;MeePwn.jpg&lt;/code&gt;, without which the program would not run. I suspected a relationship between the image pixels and the output. I replaced the original with a completely white 160×160 image so every pixel was identical, then entered &lt;code&gt;0123456789:;&amp;lt;=&amp;gt;?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}&lt;/code&gt; (ASCII 48–126) as the key. The output had a very regular pattern:&lt;/p&gt;</description></item></channel></rss>