diff --git a/_includes/footer.html b/_includes/footer.html index 661fb93..4b99830 100644 --- a/_includes/footer.html +++ b/_includes/footer.html @@ -82,4 +82,7 @@ particlesJS.load('particles-js', '/assets/js/particles.json', function () { console.log('callback - particles.js config loaded'); }); - \ No newline at end of file + + + + \ No newline at end of file diff --git a/_posts/2019-09-11-Buildingimgfrombin.md b/_posts/2019-09-11-Buildingimgfrombin.md new file mode 100644 index 0000000..bf38180 --- /dev/null +++ b/_posts/2019-09-11-Buildingimgfrombin.md @@ -0,0 +1,54 @@ +--- +layout: post +title: "Building images from binary data" +description: "Simple, yet fun" +date: 2019-09-11 12:41:00 +categories: python images +--- + +During a computer science class today, we were talking about embedding code and metadata in *jpg* and *bmp* files. @SilasBartha was showing off a program he wrote that watched a directory for new image files, and would display them on a canvas. He then showed us a special image. In this image, he had injected some metadata into the last few pixels, which were not rendered, but told his program where to position the image on the canvas, and it's size. + +This demo got @hyperliskdev and I thinking about what else we can do with image data. After some talk, the idea of converting application binaries to images came up. I had seen a blog post about visually decoding [OOK data](https://en.wikipedia.org/wiki/On%E2%80%93off_keying) by converting an [IQ capture](http://www.ni.com/tutorial/4805/en/) to an image. With a little adaptation, I did the same for a few binaries on my laptop. + + + +

I present: "Parts of @GIMP_Official's binary, represented as a bitmap" pic.twitter.com/iLljdE4nlK

— Evan Pratten (@ewpratten) September 11, 2019
+ +## Program design +Like all ideas I have, I wrote some code to test this idea out. Above is a small sample of the interesting designs found in the [gimp]() binary. The goals for this script were to: + + - Accept any file of any type or size + - Allow the user to select the file dimensions + - Generate an image + - Write the data in a common image format + +If you would like to see how the code works, read "*check out the script*". + +## A note on data wrapping +By using a [generator](https://wiki.python.org/moin/Generators), and the [range function](https://docs.python.org/3/library/functions.html#func-range)'s 3rd argument, any list can be easily split into a 2d list at a set interval. + +```python +# Assuming l is a list of data, and n is an int that denotes the desired split location +for i in range(0, len(l), n): + yield l[i:i + n] +``` + +### Binaries have a habit of not being rectangular +Unlike photos, binaries are not generated from rectangular image sensors, but instead from compilers and assemblers (and sometimes hand-written binary). These do not generate perfect rectangles. Due to this, my script simply removes the last line from the image to "reshape" it. I may end up adding a small piece of code to pad the final line instead of stripping it in the future. + +## Other file types +I also looked at other file types. Binaries are very interesting because they follow very strict ordering rules. I was hoping that a `wav` file would do something similar, but that does not appear to be the case. This is the most interesting pattern I could find in a `wav` file: + +

Following up my previous post with a tiny segment of an audio file. This one is little less interesting pic.twitter.com/u9EFloxnK5

— Evan Pratten (@ewpratten) September 11, 2019
+ +Back to executable data, these are small segments of a `dll` file: + +![Segment 1](/assets/images/dll.png) + +![Segment 2](/assets/images/dll2.png) + +## Check out the script +This script is hosted [on my GitHub account](https://github.com/Ewpratten/binmap) as a standalone file. Any version of python3 should work, but the following libraries are needed: + + - Pillow + - Numpy \ No newline at end of file diff --git a/_site/about/index.html b/_site/about/index.html index 0b4b2f1..d13407f 100644 --- a/_site/about/index.html +++ b/_site/about/index.html @@ -204,7 +204,7 @@ sub rsa4096/0xA61A2F1676E35144 2019-08-11 [] [expires: 2025-08-09] Site design by: Evan Pratten | - This site was last updated at: 2019-09-11 11:41:26 -0400 + This site was last updated at: 2019-09-11 17:12:28 -0400 @@ -283,6 +283,9 @@ sub rsa4096/0xA61A2F1676E35144 2019-08-11 [] [expires: 2025-08-09] }); + + + \ No newline at end of file diff --git a/_site/blog/2018/06/27/becomeranter.html b/_site/blog/2018/06/27/becomeranter.html index a236a5d..6102022 100644 --- a/_site/blog/2018/06/27/becomeranter.html +++ b/_site/blog/2018/06/27/becomeranter.html @@ -123,7 +123,7 @@ pip3 install tensorflow-gpu #for gpu processing Site design by: Evan Pratten | - This site was last updated at: 2019-09-11 11:41:26 -0400 + This site was last updated at: 2019-09-11 17:12:28 -0400 @@ -201,6 +201,9 @@ pip3 install tensorflow-gpu #for gpu processing console.log('callback - particles.js config loaded'); }); + + + \ No newline at end of file diff --git a/_site/blog/2019/04/30/frc-languages.html b/_site/blog/2019/04/30/frc-languages.html index 5b2bf9d..9779afa 100644 --- a/_site/blog/2019/04/30/frc-languages.html +++ b/_site/blog/2019/04/30/frc-languages.html @@ -87,7 +87,7 @@ Site design by: Evan Pratten | - This site was last updated at: 2019-09-11 11:41:26 -0400 + This site was last updated at: 2019-09-11 17:12:28 -0400 @@ -165,6 +165,9 @@ console.log('callback - particles.js config loaded'); }); + + + \ No newline at end of file diff --git a/_site/blog/2019/05/27/building-safe-vision-comms.html b/_site/blog/2019/05/27/building-safe-vision-comms.html index da00577..7c4cc7e 100644 --- a/_site/blog/2019/05/27/building-safe-vision-comms.html +++ b/_site/blog/2019/05/27/building-safe-vision-comms.html @@ -100,7 +100,7 @@ Site design by: Evan Pratten | - This site was last updated at: 2019-09-11 11:41:26 -0400 + This site was last updated at: 2019-09-11 17:12:28 -0400 @@ -178,6 +178,9 @@ console.log('callback - particles.js config loaded'); }); + + + \ No newline at end of file diff --git a/_site/blog/2019/06/12/styiling-github.html b/_site/blog/2019/06/12/styiling-github.html index 1408371..c1fa8be 100644 --- a/_site/blog/2019/06/12/styiling-github.html +++ b/_site/blog/2019/06/12/styiling-github.html @@ -111,7 +111,7 @@ Site design by: Evan Pratten | - This site was last updated at: 2019-09-11 11:41:26 -0400 + This site was last updated at: 2019-09-11 17:12:28 -0400 @@ -189,6 +189,9 @@ console.log('callback - particles.js config loaded'); }); + + + \ No newline at end of file diff --git a/_site/blog/2019/06/16/graphing-w2a.html b/_site/blog/2019/06/16/graphing-w2a.html index 437ffae..40b9a01 100644 --- a/_site/blog/2019/06/16/graphing-w2a.html +++ b/_site/blog/2019/06/16/graphing-w2a.html @@ -125,7 +125,7 @@ Site design by: Evan Pratten | - This site was last updated at: 2019-09-11 11:41:26 -0400 + This site was last updated at: 2019-09-11 17:12:28 -0400 @@ -203,6 +203,9 @@ console.log('callback - particles.js config loaded'); }); + + + \ No newline at end of file diff --git a/_site/blog/2019/06/17/amm2m1-release.html b/_site/blog/2019/06/17/amm2m1-release.html index 31081ee..b2ae01c 100644 --- a/_site/blog/2019/06/17/amm2m1-release.html +++ b/_site/blog/2019/06/17/amm2m1-release.html @@ -84,7 +84,7 @@ Your browser does not support audio players Site design by: Evan Pratten | - This site was last updated at: 2019-09-11 11:41:26 -0400 + This site was last updated at: 2019-09-11 17:12:28 -0400 @@ -162,6 +162,9 @@ Your browser does not support audio players console.log('callback - particles.js config loaded'); }); + + + \ No newline at end of file diff --git a/_site/blog/2019/06/21/robot-experiences.html b/_site/blog/2019/06/21/robot-experiences.html index 99c0f3c..54a64ca 100644 --- a/_site/blog/2019/06/21/robot-experiences.html +++ b/_site/blog/2019/06/21/robot-experiences.html @@ -124,7 +124,7 @@ Site design by: Evan Pratten | - This site was last updated at: 2019-09-11 11:41:26 -0400 + This site was last updated at: 2019-09-11 17:12:28 -0400 @@ -196,6 +196,9 @@ console.log('callback - particles.js config loaded'); }); + + + \ No newline at end of file diff --git a/_site/blog/2019/06/23/googlectf.html b/_site/blog/2019/06/23/googlectf.html index 03fbf2b..9ed7294 100644 --- a/_site/blog/2019/06/23/googlectf.html +++ b/_site/blog/2019/06/23/googlectf.html @@ -82,7 +82,7 @@ Site design by: Evan Pratten | - This site was last updated at: 2019-09-11 11:41:26 -0400 + This site was last updated at: 2019-09-11 17:12:28 -0400 @@ -160,6 +160,9 @@ console.log('callback - particles.js config loaded'); }); + + + \ No newline at end of file diff --git a/_site/blog/2019/06/24/languagehunt2.html b/_site/blog/2019/06/24/languagehunt2.html index 9eb1a3c..048b753 100644 --- a/_site/blog/2019/06/24/languagehunt2.html +++ b/_site/blog/2019/06/24/languagehunt2.html @@ -82,7 +82,7 @@ Site design by: Evan Pratten | - This site was last updated at: 2019-09-11 11:41:26 -0400 + This site was last updated at: 2019-09-11 17:12:28 -0400 @@ -160,6 +160,9 @@ console.log('callback - particles.js config loaded'); }); + + + \ No newline at end of file diff --git a/_site/blog/2019/06/26/bashsmash.html b/_site/blog/2019/06/26/bashsmash.html index 7879873..0e792b8 100644 --- a/_site/blog/2019/06/26/bashsmash.html +++ b/_site/blog/2019/06/26/bashsmash.html @@ -191,7 +191,7 @@ __() {/???/???/???n?f Site design by: Evan Pratten | - This site was last updated at: 2019-09-11 11:41:26 -0400 + This site was last updated at: 2019-09-11 17:12:28 -0400 @@ -269,6 +269,9 @@ __() {/???/???/???n?f + + + \ No newline at end of file diff --git a/_site/blog/2019/06/27/pwnlink.html b/_site/blog/2019/06/27/pwnlink.html index d754097..a795a76 100644 --- a/_site/blog/2019/06/27/pwnlink.html +++ b/_site/blog/2019/06/27/pwnlink.html @@ -112,7 +112,7 @@ Site design by: Evan Pratten | - This site was last updated at: 2019-09-11 11:41:26 -0400 + This site was last updated at: 2019-09-11 17:12:28 -0400 @@ -190,6 +190,9 @@ console.log('callback - particles.js config loaded'); }); + + + \ No newline at end of file diff --git a/_site/blog/2019/06/27/python.html b/_site/blog/2019/06/27/python.html index 703f8e3..cdcd08b 100644 --- a/_site/blog/2019/06/27/python.html +++ b/_site/blog/2019/06/27/python.html @@ -177,7 +177,7 @@ Site design by: Evan Pratten | - This site was last updated at: 2019-09-11 11:41:26 -0400 + This site was last updated at: 2019-09-11 17:12:28 -0400 @@ -255,6 +255,9 @@ console.log('callback - particles.js config loaded'); }); + + + \ No newline at end of file diff --git a/_site/blog/2019/07/01/devdns.html b/_site/blog/2019/07/01/devdns.html index 7818948..086fe69 100644 --- a/_site/blog/2019/07/01/devdns.html +++ b/_site/blog/2019/07/01/devdns.html @@ -101,7 +101,7 @@ Site design by: Evan Pratten | - This site was last updated at: 2019-09-11 11:41:26 -0400 + This site was last updated at: 2019-09-11 17:12:28 -0400 @@ -173,6 +173,9 @@ console.log('callback - particles.js config loaded'); }); + + + \ No newline at end of file diff --git a/_site/blog/2019/07/06/scrapingfrcgithub.html b/_site/blog/2019/07/06/scrapingfrcgithub.html index 7160899..17a11d8 100644 --- a/_site/blog/2019/07/06/scrapingfrcgithub.html +++ b/_site/blog/2019/07/06/scrapingfrcgithub.html @@ -174,7 +174,7 @@ Site design by: Evan Pratten | - This site was last updated at: 2019-09-11 11:41:26 -0400 + This site was last updated at: 2019-09-11 17:12:28 -0400 @@ -252,6 +252,9 @@ console.log('callback - particles.js config loaded'); }); + + + \ No newline at end of file diff --git a/_site/blog/2019/07/13/lookback-gmad.html b/_site/blog/2019/07/13/lookback-gmad.html index 4f58f44..f88d952 100644 --- a/_site/blog/2019/07/13/lookback-gmad.html +++ b/_site/blog/2019/07/13/lookback-gmad.html @@ -95,7 +95,7 @@ Site design by: Evan Pratten | - This site was last updated at: 2019-09-11 11:41:26 -0400 + This site was last updated at: 2019-09-11 17:12:28 -0400 @@ -173,6 +173,9 @@ console.log('callback - particles.js config loaded'); }); + + + \ No newline at end of file diff --git a/_site/blog/2019/07/15/mindmap.html b/_site/blog/2019/07/15/mindmap.html index 3f99747..be7c026 100644 --- a/_site/blog/2019/07/15/mindmap.html +++ b/_site/blog/2019/07/15/mindmap.html @@ -187,7 +187,7 @@ Site design by: Evan Pratten | - This site was last updated at: 2019-09-11 11:41:26 -0400 + This site was last updated at: 2019-09-11 17:12:28 -0400 @@ -265,6 +265,9 @@ console.log('callback - particles.js config loaded'); }); + + + \ No newline at end of file diff --git a/_site/blog/2019/08/10/why-i-carry-nfc.html b/_site/blog/2019/08/10/why-i-carry-nfc.html index b12849f..6a184f0 100644 --- a/_site/blog/2019/08/10/why-i-carry-nfc.html +++ b/_site/blog/2019/08/10/why-i-carry-nfc.html @@ -107,7 +107,7 @@ Site design by: Evan Pratten | - This site was last updated at: 2019-09-11 11:41:26 -0400 + This site was last updated at: 2019-09-11 17:12:28 -0400 @@ -179,6 +179,9 @@ console.log('callback - particles.js config loaded'); }); + + + \ No newline at end of file diff --git a/_site/blog/2019/08/12/setting-up-ja.html b/_site/blog/2019/08/12/setting-up-ja.html index 1844cad..16b50bf 100644 --- a/_site/blog/2019/08/12/setting-up-ja.html +++ b/_site/blog/2019/08/12/setting-up-ja.html @@ -152,7 +152,7 @@ ibus-daemon -drx Site design by: Evan Pratten | - This site was last updated at: 2019-09-11 11:41:26 -0400 + This site was last updated at: 2019-09-11 17:12:28 -0400 @@ -224,6 +224,9 @@ ibus-daemon -drx console.log('callback - particles.js config loaded'); }); + + + \ No newline at end of file diff --git a/_site/blog/2019/08/24/shift2.html b/_site/blog/2019/08/24/shift2.html index 22f2e03..72b332b 100644 --- a/_site/blog/2019/08/24/shift2.html +++ b/_site/blog/2019/08/24/shift2.html @@ -137,7 +137,7 @@ shift2 -h Site design by: Evan Pratten | - This site was last updated at: 2019-09-11 11:41:26 -0400 + This site was last updated at: 2019-09-11 17:12:28 -0400 @@ -209,6 +209,9 @@ shift2 -h console.log('callback - particles.js config loaded'); }); + + + \ No newline at end of file diff --git a/_site/blog/2019/08/27/github-cleanup.html b/_site/blog/2019/08/27/github-cleanup.html index b1f6654..3e8880c 100644 --- a/_site/blog/2019/08/27/github-cleanup.html +++ b/_site/blog/2019/08/27/github-cleanup.html @@ -108,7 +108,7 @@ Starting from the top, scroll through, and middle click on anything you want to Site design by: Evan Pratten | - This site was last updated at: 2019-09-11 11:41:26 -0400 + This site was last updated at: 2019-09-11 17:12:28 -0400 @@ -186,6 +186,9 @@ Starting from the top, scroll through, and middle click on anything you want to console.log('callback - particles.js config loaded'); }); + + + \ No newline at end of file diff --git a/_site/blog/2019/09/07/wrong-python.html b/_site/blog/2019/09/07/wrong-python.html index 5ed70f0..d3fc840 100644 --- a/_site/blog/2019/09/07/wrong-python.html +++ b/_site/blog/2019/09/07/wrong-python.html @@ -157,7 +157,7 @@ fn printMyNumber(MyClass* self){ Site design by: Evan Pratten | - This site was last updated at: 2019-09-11 11:41:26 -0400 + This site was last updated at: 2019-09-11 17:12:28 -0400 @@ -235,6 +235,9 @@ fn printMyNumber(MyClass* self){ console.log('callback - particles.js config loaded'); }); + + + \ No newline at end of file diff --git a/_site/blog/index.html b/_site/blog/index.html index d0467bd..6b67ee8 100644 --- a/_site/blog/index.html +++ b/_site/blog/index.html @@ -64,22 +64,22 @@ Featured Post
-
Doing Python OOP the wrong way +
Building images from binary data
-

In the name of science!

- View +

Simple, yet fun

+ View
--> - +
-
Doing Python OOP the wrong way +
Building images from binary data
-

In the name of science!

+

Simple, yet fun

@@ -92,6 +92,21 @@ + +
+
Doing Python OOP the wrong way
+ +
+

In the name of science!

+
+ + + + + + + +
I did some cleaning
@@ -400,7 +415,7 @@ Site design by:
Evan Pratten | - This site was last updated at: 2019-09-11 11:41:26 -0400 + This site was last updated at: 2019-09-11 17:12:28 -0400
@@ -479,5 +494,8 @@ }); + + + \ No newline at end of file diff --git a/_site/documentation.html b/_site/documentation.html index eef19fc..3d5bdfc 100644 --- a/_site/documentation.html +++ b/_site/documentation.html @@ -52,7 +52,7 @@ Site design by: Evan Pratten | - This site was last updated at: 2019-09-11 11:41:26 -0400 + This site was last updated at: 2019-09-11 17:12:28 -0400 @@ -131,5 +131,8 @@ }); + + + \ No newline at end of file diff --git a/_site/feed.xml b/_site/feed.xml index 94b0e89..7fbe13d 100644 --- a/_site/feed.xml +++ b/_site/feed.xml @@ -1,4 +1,51 @@ -Jekyll2019-09-11T11:41:26-04:00http://0.0.0.0:4000/feed.xmlEvan PrattenComputer wizard, student, <a href="https://frc5024.github.io">@frc5024</a> programming team lead, and radio enthusiast.Doing Python OOP the wrong way2019-09-07T09:13:00-04:002019-09-07T09:13:00-04:00http://0.0.0.0:4000/blog/2019/09/07/wrong-python<p>If you know me, you probably know of the many weird things I do with python. Most recent of which being this <a href="https://en.wikipedia.org/wiki/Fizz_buzz">FizzBuzz</a> implementation in one line of python code:</p> +Jekyll2019-09-11T17:12:28-04:00http://0.0.0.0:4000/feed.xmlEvan PrattenComputer wizard, student, <a href="https://frc5024.github.io">@frc5024</a> programming team lead, and radio enthusiast.Building images from binary data2019-09-11T08:41:00-04:002019-09-11T08:41:00-04:00http://0.0.0.0:4000/blog/2019/09/11/Buildingimgfrombin<p>During a computer science class today, we were talking about embedding code and metadata in <em>jpg</em> and <em>bmp</em> files. @SilasBartha was showing off a program he wrote that watched a directory for new image files, and would display them on a canvas. He then showed us a special image. In this image, he had injected some metadata into the last few pixels, which were not rendered, but told his program where to position the image on the canvas, and it’s size.</p> + +<p>This demo got @hyperliskdev and I thinking about what else we can do with image data. After some talk, the idea of converting application binaries to images came up. I had seen a blog post about visually decoding <a href="https://en.wikipedia.org/wiki/On%E2%80%93off_keying">OOK data</a> by converting an <a href="http://www.ni.com/tutorial/4805/en/">IQ capture</a> to an image. With a little adaptation, I did the same for a few binaries on my laptop.</p> + +<!-- Tweet embed --> +<blockquote class="twitter-tweet"><p lang="en" dir="ltr">I present: &quot;Parts of <a href="https://twitter.com/GIMP_Official?ref_src=twsrc%5Etfw">@GIMP_Official</a>&#39;s binary, represented as a bitmap&quot; <a href="https://t.co/iLljdE4nlK">pic.twitter.com/iLljdE4nlK</a></p>&mdash; Evan Pratten (@ewpratten) <a href="https://twitter.com/ewpratten/status/1171801959197794304?ref_src=twsrc%5Etfw">September 11, 2019</a></blockquote> + +<h2 id="program-design">Program design</h2> +<p>Like all ideas I have, I wrote some code to test this idea out. Above is a small sample of the interesting designs found in the <a href="">gimp</a> binary. The goals for this script were to:</p> + +<ul> + <li>Accept any file of any type or size</li> + <li>Allow the user to select the file dimensions</li> + <li>Generate an image</li> + <li>Write the data in a common image format</li> +</ul> + +<p>If you would like to see how the code works, read “<em>check out the script</em>”.</p> + +<h2 id="a-note-on-data-wrapping">A note on data wrapping</h2> +<p>By using a <a href="https://wiki.python.org/moin/Generators">generator</a>, and the <a href="https://docs.python.org/3/library/functions.html#func-range">range function</a>’s 3rd argument, any list can be easily split into a 2d list at a set interval.</p> + +<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1"># Assuming l is a list of data, and n is an int that denotes the desired split location +</span><span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="nb">len</span><span class="p">(</span><span class="n">l</span><span class="p">),</span> <span class="n">n</span><span class="p">):</span> + <span class="k">yield</span> <span class="n">l</span><span class="p">[</span><span class="n">i</span><span class="p">:</span><span class="n">i</span> <span class="o">+</span> <span class="n">n</span><span class="p">]</span> +</code></pre></div></div> + +<h3 id="binaries-have-a-habit-of-not-being-rectangular">Binaries have a habit of not being rectangular</h3> +<p>Unlike photos, binaries are not generated from rectangular image sensors, but instead from compilers and assemblers (and sometimes hand-written binary). These do not generate perfect rectangles. Due to this, my script simply removes the last line from the image to “reshape” it. I may end up adding a small piece of code to pad the final line instead of stripping it in the future.</p> + +<h2 id="other-file-types">Other file types</h2> +<p>I also looked at other file types. Binaries are very interesting because they follow very strict ordering rules. I was hoping that a <code class="highlighter-rouge">wav</code> file would do something similar, but that does not appear to be the case. This is the most interesting pattern I could find in a <code class="highlighter-rouge">wav</code> file:</p> + +<blockquote class="twitter-tweet"><p lang="en" dir="ltr">Following up my previous post with a tiny segment of an audio file. This one is little less interesting <a href="https://t.co/u9EFloxnK5">pic.twitter.com/u9EFloxnK5</a></p>&mdash; Evan Pratten (@ewpratten) <a href="https://twitter.com/ewpratten/status/1171883910827040774?ref_src=twsrc%5Etfw">September 11, 2019</a></blockquote> + +<p>Back to executable data, these are small segments of a <code class="highlighter-rouge">dll</code> file:</p> + +<p><img src="/assets/images/dll.png" alt="Segment 1" /></p> + +<p><img src="/assets/images/dll2.png" alt="Segment 2" /></p> + +<h2 id="check-out-the-script">Check out the script</h2> +<p>This script is hosted <a href="https://github.com/Ewpratten/binmap">on my GitHub account</a> as a standalone file. Any version of python3 should work, but the following libraries are needed:</p> + +<ul> + <li>Pillow</li> + <li>Numpy</li> +</ul>During a computer science class today, we were talking about embedding code and metadata in jpg and bmp files. @SilasBartha was showing off a program he wrote that watched a directory for new image files, and would display them on a canvas. He then showed us a special image. In this image, he had injected some metadata into the last few pixels, which were not rendered, but told his program where to position the image on the canvas, and it’s size.Doing Python OOP the wrong way2019-09-07T09:13:00-04:002019-09-07T09:13:00-04:00http://0.0.0.0:4000/blog/2019/09/07/wrong-python<p>If you know me, you probably know of the many weird things I do with python. Most recent of which being this <a href="https://en.wikipedia.org/wiki/Fizz_buzz">FizzBuzz</a> implementation in one line of python code:</p> <div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">_</span><span class="o">=</span><span class="p">[</span><span class="k">print</span><span class="p">(</span><span class="s">"FizzBuzz"</span><span class="p">[</span><span class="n">_</span><span class="o">*</span><span class="n">_</span><span class="o">%</span><span class="mi">3</span><span class="o">*</span><span class="mi">4</span><span class="p">:</span><span class="mi">8</span><span class="o">--</span><span class="n">_</span><span class="o">**</span><span class="mi">4</span><span class="o">%</span><span class="mi">5</span><span class="p">]</span> <span class="ow">or</span> <span class="n">_</span><span class="p">)</span> <span class="k">for</span> <span class="n">_</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">101</span><span class="p">)]</span> </code></pre></div></div> @@ -562,43 +609,4 @@ ibus-daemon <span class="nt">-drx</span> <p>Thats it! Super simple, and only two days from concept to reality.</p> <h2 id="where-is-this-hosted">Where is this hosted?</h2> -<p>This program is hosted on a raspberry pi laying in my room running docker. I also have <a href="https://www.portainer.io/">Portainer</a> set up so I can easily monitor the bot from my phone over my VPN.</p>Over the past year and a half, I have been hacking my way around the undocumented devRant auth/write API. At the request of devRant’s creators, this API must not be documented due to the way logins work on the platform. That is besides the point. I have been working on a little project called devDNS over the past few days that uses this undocumented API. Why must I be so bad at writing intros?I had some fun with a router2019-06-27T13:16:00-04:002019-06-27T13:16:00-04:00http://0.0.0.0:4000/blog/2019/06/27/PWNlink<p>I was playing around with some D-link routers today and remembered an <a href="https://www.exploit-db.com/exploits/33520">ExploitDB Entry</a> I read a while ago. Many D-link routers have a great feature that allows remote management and configuration queries. Interestingly, this cannot be disabled, and one of the pages contains a cleartext version of the admin password (yay!).</p> - -<h2 id="how-to-get-yourself-an-admin-password">How to get yourself an admin password</h2> -<p>On any supported router, make an HTTP request to <code class="highlighter-rouge">http://your.router.ip.addr/tools_admin.asp/</code>. This will return a pretty large XML file containing information about your router’s hardware and configuration.</p> - -<p>Notice the fact that you did not have to log in. This is due to the fact that this file seems to be used by a remote management service of some sort.</p> - -<p>The important thing to note here is that, when parsed with the regex pattern: <code class="highlighter-rouge">name="user_password_tmp" value="(.*)"&gt;</code>, you get a single string. This string is the admin password of the device.</p> - -<h2 id="supported-routers">Supported routers</h2> -<p>This is supported by many D-link routers. The ones I know about are:</p> -<ul> - <li>DIR-835</li> - <li>DIR-855L</li> - <li>DGL-5500</li> -</ul> - -<p>Some routers have this XML file, but it is restricted… By a user without a password. These are:</p> -<ul> - <li>DHP-1565</li> - <li>DIR-652</li> -</ul> - -<h2 id="pwnlink">PWNlink</h2> -<p>Like everything I play with, I made a script to do this all for me (and spent a large amount of time adding colours to the text).</p> - -<p>My script is called PWNlink (PWN + D-link), It automatically finds a router on your network by looking for a specific DNS entry created by many D-link routers, then checking your gateway. Next, PWNlink reads you router’s <code class="highlighter-rouge">hnap1</code> config to find it’s model number. If supported, the script will read and parse the appropriate configs to give you the admin credentials for your router.</p> - -<p>PWNlink can be installed on any *nix computer that has both <code class="highlighter-rouge">python3.7</code> and <code class="highlighter-rouge">python3-pip</code> installed. To install PWNlink, run:</p> -<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>pip3 install pwnlink -</code></pre></div></div> - -<p>Run the script without any arguments for automatic detection, or pass any IP address to use manual detection.</p> - -<h2 id="disclamier-thingy">Disclamier thingy</h2> -<p>I don’t see much point to these, but I should probably put one anyways.</p> - -<p><strong>Don’t be dumb with this script.</strong></p> - -<p>I have only used it on my own (or 5024’s) routers, and did not create PWNlink with any malicious intent.</p>I was playing around with some D-link routers today and remembered an ExploitDB Entry I read a while ago. Many D-link routers have a great feature that allows remote management and configuration queries. Interestingly, this cannot be disabled, and one of the pages contains a cleartext version of the admin password (yay!). \ No newline at end of file +<p>This program is hosted on a raspberry pi laying in my room running docker. I also have <a href="https://www.portainer.io/">Portainer</a> set up so I can easily monitor the bot from my phone over my VPN.</p>Over the past year and a half, I have been hacking my way around the undocumented devRant auth/write API. At the request of devRant’s creators, this API must not be documented due to the way logins work on the platform. That is besides the point. I have been working on a little project called devDNS over the past few days that uses this undocumented API. Why must I be so bad at writing intros? \ No newline at end of file diff --git a/_site/fossl-feeds.html b/_site/fossl-feeds.html index 622ee93..84ac8ec 100644 --- a/_site/fossl-feeds.html +++ b/_site/fossl-feeds.html @@ -88,7 +88,7 @@ https://blog.mrtnrdl.de/feed.xml Site design by: Evan Pratten | - This site was last updated at: 2019-09-11 11:41:26 -0400 + This site was last updated at: 2019-09-11 17:12:28 -0400 @@ -166,6 +166,9 @@ https://blog.mrtnrdl.de/feed.xml console.log('callback - particles.js config loaded'); }); + + + \ No newline at end of file diff --git a/_site/index.html b/_site/index.html index 28ec903..0b77a12 100644 --- a/_site/index.html +++ b/_site/index.html @@ -101,7 +101,7 @@ Site design by: Evan Pratten | - This site was last updated at: 2019-09-11 11:41:26 -0400 + This site was last updated at: 2019-09-11 17:12:28 -0400 @@ -180,4 +180,7 @@ }); + + + \ No newline at end of file diff --git a/_site/projects.html b/_site/projects.html index b884cb8..128c86e 100644 --- a/_site/projects.html +++ b/_site/projects.html @@ -256,7 +256,7 @@ Site design by: Evan Pratten | - This site was last updated at: 2019-09-11 11:41:26 -0400 + This site was last updated at: 2019-09-11 17:12:28 -0400 @@ -329,5 +329,8 @@ }); + + + \ No newline at end of file diff --git a/assets/images/dll.png b/assets/images/dll.png new file mode 100644 index 0000000..4f44908 Binary files /dev/null and b/assets/images/dll.png differ diff --git a/assets/images/dll2.png b/assets/images/dll2.png new file mode 100644 index 0000000..d867715 Binary files /dev/null and b/assets/images/dll2.png differ