devDNS
This commit is contained in:
parent
4d73b8c586
commit
c9b53149be
38
_posts/2019-07-01-devDNS.md
Normal file
38
_posts/2019-07-01-devDNS.md
Normal file
@ -0,0 +1,38 @@
|
||||
---
|
||||
layout: post
|
||||
title: "devDNS"
|
||||
description: "The DNS over devRant service"
|
||||
date: 2019-07-01 22:13:00
|
||||
categories: projects
|
||||
---
|
||||
|
||||
Over the past year and a half, I have been hacking my way around the undocumented [devRant](https://devrant.com) 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](https://devrant.com/collabs/2163502) over the past few days that uses this undocumented API. Why must I be so bad at writing intros?
|
||||
|
||||
## What is devDNS
|
||||
devDNS is a devRant bot written in python. It will serve any valid DNS query from any user on the platform. A query is just a comment in one of the following forms:
|
||||
```
|
||||
@devDNS example.com
|
||||
```
|
||||
or
|
||||
```
|
||||
@devDNS MX example.com
|
||||
```
|
||||
Of course, `MX` and `example.com` are to be replaced with the domain and entry of your choosing.
|
||||
|
||||
devDNS was inspired by [@1111Resolver](https://twitter.com/1111resolver), and the source is available on [GitHub](https://github.com/Ewpratten/devDNS).
|
||||
|
||||
## How it works
|
||||
The Python script behind devDNS is very simple. devDNS does the following every 10 seconds:
|
||||
- Fetch all new notifs
|
||||
- Find only mentions
|
||||
- Spin off a thread for each mention that passes a basic parser (Is the message 2 or 3 words long)
|
||||
- In the thread, check if the message is a control message (allows me to view the status of the bot via devRant)
|
||||
- Check if the request matches a required pattern
|
||||
- Call `dnspython` with requested record and domain
|
||||
- Receive answer from a custom [PIHole](https://pi-hole.net/) server with caching and super low latency
|
||||
- Send a comment with the results to the requester
|
||||
|
||||
Thats it! Super simple, and only two days from concept to reality.
|
||||
|
||||
## Where is this hosted?
|
||||
This program is hosted on a raspberry pi laying in my room running docker. I also have [Portainer](https://www.portainer.io/) set up so I can easily monitor the bot from my phone over my VPN.
|
@ -92,6 +92,13 @@
|
||||
<ul>
|
||||
|
||||
|
||||
<!-- <header class="major"> -->
|
||||
<li><h3><a href="/projects/2019/07/01/devDNS.html" class="link" title="2019-07-01 18:13:00 -0400">devDNS</a></h3></li>
|
||||
<!-- </header> -->
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- <header class="major"> -->
|
||||
<li><h3><a href="/projects/2019/06/27/PWNlink.html" class="link" title="2019-06-27 13:16:00 -0400">I had some fun with a router</a></h3></li>
|
||||
<!-- </header> -->
|
||||
|
@ -1,4 +1,33 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.8.5">Jekyll</generator><link href="http://0.0.0.0:4000/feed.xml" rel="self" type="application/atom+xml" /><link href="http://0.0.0.0:4000/" rel="alternate" type="text/html" /><updated>2019-06-29T16:41:32-04:00</updated><id>http://0.0.0.0:4000/feed.xml</id><title type="html">Evan Pratten</title><subtitle>Computer wizard, student, <a href="https://github.com/frc5024">@frc5024</a> programming team lead, and radio enthusiast.</subtitle><entry><title type="html">I had some fun with a router</title><link href="http://0.0.0.0:4000/projects/2019/06/27/PWNlink.html" rel="alternate" type="text/html" title="I had some fun with a router" /><published>2019-06-27T13:16:00-04:00</published><updated>2019-06-27T13:16:00-04:00</updated><id>http://0.0.0.0:4000/projects/2019/06/27/PWNlink</id><content type="html" xml:base="http://0.0.0.0:4000/projects/2019/06/27/PWNlink.html"><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>
|
||||
<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.8.5">Jekyll</generator><link href="http://0.0.0.0:4000/feed.xml" rel="self" type="application/atom+xml" /><link href="http://0.0.0.0:4000/" rel="alternate" type="text/html" /><updated>2019-07-01T22:38:02-04:00</updated><id>http://0.0.0.0:4000/feed.xml</id><title type="html">Evan Pratten</title><subtitle>Computer wizard, student, <a href="https://github.com/frc5024">@frc5024</a> programming team lead, and radio enthusiast.</subtitle><entry><title type="html">devDNS</title><link href="http://0.0.0.0:4000/projects/2019/07/01/devDNS.html" rel="alternate" type="text/html" title="devDNS" /><published>2019-07-01T18:13:00-04:00</published><updated>2019-07-01T18:13:00-04:00</updated><id>http://0.0.0.0:4000/projects/2019/07/01/devDNS</id><content type="html" xml:base="http://0.0.0.0:4000/projects/2019/07/01/devDNS.html"><p>Over the past year and a half, I have been hacking my way around the undocumented <a href="https://devrant.com">devRant</a> 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 <a href="https://devrant.com/collabs/2163502">devDNS</a> over the past few days that uses this undocumented API. Why must I be so bad at writing intros?</p>
|
||||
|
||||
<h2 id="what-is-devdns">What is devDNS</h2>
|
||||
<p>devDNS is a devRant bot written in python. It will serve any valid DNS query from any user on the platform. A query is just a comment in one of the following forms:</p>
|
||||
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>@devDNS example.com
|
||||
</code></pre></div></div>
|
||||
<p>or</p>
|
||||
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>@devDNS MX example.com
|
||||
</code></pre></div></div>
|
||||
<p>Of course, <code class="highlighter-rouge">MX</code> and <code class="highlighter-rouge">example.com</code> are to be replaced with the domain and entry of your choosing.</p>
|
||||
|
||||
<p>devDNS was inspired by <a href="https://twitter.com/1111resolver">@1111Resolver</a>, and the source is available on <a href="https://github.com/Ewpratten/devDNS">GitHub</a>.</p>
|
||||
|
||||
<h2 id="how-it-works">How it works</h2>
|
||||
<p>The Python script behind devDNS is very simple. devDNS does the following every 10 seconds:</p>
|
||||
<ul>
|
||||
<li>Fetch all new notifs</li>
|
||||
<li>Find only mentions</li>
|
||||
<li>Spin off a thread for each mention that passes a basic parser (Is the message 2 or 3 words long)</li>
|
||||
<li>In the thread, check if the message is a control message (allows me to view the status of the bot via devRant)</li>
|
||||
<li>Check if the request matches a required pattern</li>
|
||||
<li>Call <code class="highlighter-rouge">dnspython</code> with requested record and domain</li>
|
||||
<li>Receive answer from a custom <a href="https://pi-hole.net/">PIHole</a> server with caching and super low latency</li>
|
||||
<li>Send a comment with the results to the requester</li>
|
||||
</ul>
|
||||
|
||||
<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></content><author><name></name></author><summary type="html">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?</summary></entry><entry><title type="html">I had some fun with a router</title><link href="http://0.0.0.0:4000/projects/2019/06/27/PWNlink.html" rel="alternate" type="text/html" title="I had some fun with a router" /><published>2019-06-27T13:16:00-04:00</published><updated>2019-06-27T13:16:00-04:00</updated><id>http://0.0.0.0:4000/projects/2019/06/27/PWNlink</id><content type="html" xml:base="http://0.0.0.0:4000/projects/2019/06/27/PWNlink.html"><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>
|
||||
@ -400,42 +429,4 @@ Your browser does not support audio players
|
||||
<h2 id="the-result">The result</h2>
|
||||
<p>Here is the resulting image. From left, to right: 5024, 254, 2224, 5406, 2056</p>
|
||||
|
||||
<p><img src="/assets/images/w2a.png" alt="Thr result" /></p></content><author><name></name></author><summary type="html">I was scrolling through reddit the other day, and came across this great post by u/MasterQuacks.</summary></entry><entry><title type="html">GitHub’s CSS is boring. So I refreshed the design</title><link href="http://0.0.0.0:4000/projects/2019/06/12/Styiling-GitHub.html" rel="alternate" type="text/html" title="GitHub's CSS is boring. So I refreshed the design" /><published>2019-06-12T09:09:00-04:00</published><updated>2019-06-12T09:09:00-04:00</updated><id>http://0.0.0.0:4000/projects/2019/06/12/Styiling-GitHub</id><content type="html" xml:base="http://0.0.0.0:4000/projects/2019/06/12/Styiling-GitHub.html"><p>I have been using GitHub since 2017, and have been getting tired of GitHub’s theme. I didn’t need a huge change, just a small refresh. So, to solve this, I whipped out <a href="https://addons.mozilla.org/en-CA/firefox/addon/styl-us/">Stylus</a> and made a nice little CSS file for it.</p>
|
||||
|
||||
<h2 id="the-css">The CSS</h2>
|
||||
<p>Here is the CSS. Feel free to play with it.</p>
|
||||
|
||||
<div class="language-css highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">@-moz-document</span> <span class="n">url-prefix</span><span class="p">(</span><span class="s1">"https://github.com/"</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="nc">.Header</span> <span class="p">{</span>
|
||||
<span class="nl">background-color</span><span class="p">:</span> <span class="m">#1a3652</span><span class="p">;</span>
|
||||
<span class="p">}</span>
|
||||
|
||||
<span class="nc">.repohead.experiment-repo-nav</span> <span class="p">{</span>
|
||||
<span class="nl">background-color</span><span class="p">:</span> <span class="m">#fff</span><span class="p">;</span>
|
||||
<span class="p">}</span>
|
||||
<span class="nc">.reponav-item.selected</span> <span class="p">{</span>
|
||||
<span class="nl">border-color</span><span class="p">:</span> <span class="m">#fff</span> <span class="m">#fff</span> <span class="m">#4a79a8</span><span class="p">;</span>
|
||||
<span class="p">}</span>
|
||||
|
||||
<span class="nc">.btn.hover</span><span class="o">,</span>
|
||||
<span class="nc">.btn</span><span class="nd">:hover</span><span class="o">,</span>
|
||||
<span class="nc">.btn</span><span class="o">,</span>
|
||||
<span class="nc">.btn</span> <span class="p">{</span>
|
||||
<span class="nl">background-color</span><span class="p">:</span> <span class="m">#fafafa</span><span class="p">;</span>
|
||||
<span class="nl">background-image</span><span class="p">:</span> <span class="n">linear-gradient</span><span class="p">(</span><span class="m">-180deg</span><span class="p">,</span> <span class="m">#fafafa</span><span class="p">,</span> <span class="m">#fafafa</span> <span class="m">90%</span><span class="p">);</span>
|
||||
<span class="p">}</span>
|
||||
|
||||
<span class="nc">.btn-primary.hover</span><span class="o">,</span>
|
||||
<span class="nc">.btn-primary</span><span class="nd">:hover</span><span class="o">,</span>
|
||||
<span class="nc">.btn-primary</span><span class="o">,</span>
|
||||
<span class="nc">.btn-primary</span> <span class="p">{</span>
|
||||
<span class="nl">background-color</span><span class="p">:</span> <span class="m">#1aaa55</span><span class="p">;</span>
|
||||
<span class="nl">background-image</span><span class="p">:</span> <span class="n">linear-gradient</span><span class="p">(</span><span class="m">-180deg</span><span class="p">,</span> <span class="m">#1aaa55</span><span class="p">,</span> <span class="m">#1aaa55</span> <span class="m">90%</span><span class="p">);</span>
|
||||
<span class="p">}</span>
|
||||
|
||||
<span class="nc">.overall-summary</span> <span class="p">{}</span>
|
||||
<span class="p">}</span>
|
||||
</code></pre></div></div>
|
||||
|
||||
<h2 id="use-it-yourself">Use it yourself</h2>
|
||||
<p>I put this theme on userstyles.org. You can download and install it by going to <a href="https://userstyles.org/styles/172679/ewpratten-s-githubtheme">my userstyles page</a>.</p></content><author><name></name></author><category term="projects" /><summary type="html">I have been using GitHub since 2017, and have been getting tired of GitHub’s theme. I didn’t need a huge change, just a small refresh. So, to solve this, I whipped out Stylus and made a nice little CSS file for it.</summary></entry></feed>
|
||||
<p><img src="/assets/images/w2a.png" alt="Thr result" /></p></content><author><name></name></author><summary type="html">I was scrolling through reddit the other day, and came across this great post by u/MasterQuacks.</summary></entry></feed>
|
@ -102,12 +102,12 @@
|
||||
|
||||
<ul>
|
||||
|
||||
<li><h3><a href="/projects/2019/07/01/devDNS.html" class="link" title="2019-07-01 18:13:00 -0400">devDNS</a></h3></li>
|
||||
|
||||
<li><h3><a href="/projects/2019/06/27/PWNlink.html" class="link" title="2019-06-27 13:16:00 -0400">I had some fun with a router</a></h3></li>
|
||||
|
||||
<li><h3><a href="/random/2019/06/27/Python.html" class="link" title="2019-06-27 03:00:00 -0400">Hunting snakes with a shotgun</a></h3></li>
|
||||
|
||||
<li><h3><a href="/projects/2019/06/26/BashSmash.html" class="link" title="2019-06-26 11:48:00 -0400">BashSmash</a></h3></li>
|
||||
|
||||
</ul>
|
||||
<a href="all_posts.html" class="button next">View All</a>
|
||||
|
||||
|
175
_site/projects/2019/07/01/devDNS.html
Normal file
175
_site/projects/2019/07/01/devDNS.html
Normal file
@ -0,0 +1,175 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>Evan Pratten</title>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
|
||||
<!--[if lte IE 8]><script src="/assets/js/ie/html5shiv.js"></script><![endif]-->
|
||||
<link rel="stylesheet" href="/assets/css/main.css" />
|
||||
<!-- <link rel="stylesheet" href="/assets/css/custom.css" /> -->
|
||||
<!--[if lte IE 9]><link rel="stylesheet" href="/assets/css/ie9.css" /><![endif]-->
|
||||
<!--[if lte IE 8]><link rel="stylesheet" href="/assets/css/ie8.css" /><![endif]-->
|
||||
|
||||
<!-- Syntax highlight -->
|
||||
<link rel="stylesheet" href="/assets/css/vs.css" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<!-- Wrapper -->
|
||||
<div id="wrapper">
|
||||
|
||||
<!-- Header -->
|
||||
<header id="header" >
|
||||
<a href="http://0.0.0.0:4000//" class="logo"><strong>Evan Pratten</strong> <span>retrylife</span></a>
|
||||
<nav>
|
||||
<!-- <a href="#menu">Menu</a> -->
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<!-- Menu -->
|
||||
<!-- <nav id="menu">
|
||||
<ul class="links">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="http://0.0.0.0:4000//">Home</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="http://0.0.0.0:4000/all_posts.html">All posts</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
<ul class="actions vertical">
|
||||
<li><a href="#" class="button special fit">Get Started</a></li>
|
||||
<li><a href="#" class="button fit">Log In</a></li>
|
||||
</ul>
|
||||
</nav> -->
|
||||
|
||||
<section id="banner" class="major" style="height:40vh">
|
||||
<div class="inner">
|
||||
<header class="major">
|
||||
<h1>devDNS</h1>
|
||||
</header>
|
||||
<div class="content">
|
||||
<p >The DNS over devRant service</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
<!-- Main -->
|
||||
<div id="main" class="alt">
|
||||
|
||||
<!-- One -->
|
||||
<section id="one">
|
||||
<div class="inner">
|
||||
|
||||
<p><p>Over the past year and a half, I have been hacking my way around the undocumented <a href="https://devrant.com">devRant</a> 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 <a href="https://devrant.com/collabs/2163502">devDNS</a> over the past few days that uses this undocumented API. Why must I be so bad at writing intros?</p>
|
||||
|
||||
<h2 id="what-is-devdns">What is devDNS</h2>
|
||||
<p>devDNS is a devRant bot written in python. It will serve any valid DNS query from any user on the platform. A query is just a comment in one of the following forms:</p>
|
||||
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>@devDNS example.com
|
||||
</code></pre></div></div>
|
||||
<p>or</p>
|
||||
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>@devDNS MX example.com
|
||||
</code></pre></div></div>
|
||||
<p>Of course, <code class="highlighter-rouge">MX</code> and <code class="highlighter-rouge">example.com</code> are to be replaced with the domain and entry of your choosing.</p>
|
||||
|
||||
<p>devDNS was inspired by <a href="https://twitter.com/1111resolver">@1111Resolver</a>, and the source is available on <a href="https://github.com/Ewpratten/devDNS">GitHub</a>.</p>
|
||||
|
||||
<h2 id="how-it-works">How it works</h2>
|
||||
<p>The Python script behind devDNS is very simple. devDNS does the following every 10 seconds:</p>
|
||||
<ul>
|
||||
<li>Fetch all new notifs</li>
|
||||
<li>Find only mentions</li>
|
||||
<li>Spin off a thread for each mention that passes a basic parser (Is the message 2 or 3 words long)</li>
|
||||
<li>In the thread, check if the message is a control message (allows me to view the status of the bot via devRant)</li>
|
||||
<li>Check if the request matches a required pattern</li>
|
||||
<li>Call <code class="highlighter-rouge">dnspython</code> with requested record and domain</li>
|
||||
<li>Receive answer from a custom <a href="https://pi-hole.net/">PIHole</a> server with caching and super low latency</li>
|
||||
<li>Send a comment with the results to the requester</li>
|
||||
</ul>
|
||||
|
||||
<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>
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Footer -->
|
||||
<footer id="footer">
|
||||
<div class="inner">
|
||||
<ul class="icons">
|
||||
|
||||
<li><a href="https://twitter.com/ewpratten" class="icon alt fa-twitter" target="_blank"><span class="label">Twitter</span></a></li>
|
||||
|
||||
<li><a href="https://gitlab.com/u/ewpratten" class="icon alt fa-gitlab" target="_blank"><span class="label">GitLab</span></a></li>
|
||||
|
||||
<li><a href="https://github.com/ewpratten" class="icon alt fa-github" target="_blank"><span class="label">GitHub</span></a></li>
|
||||
|
||||
|
||||
<li><a href="/feed.xml" class="icon alt fa-rss" target="_blank"><span class="label">RSS</span></a></li>
|
||||
</ul>
|
||||
<ul class="copyright">
|
||||
<li>© Evan Pratten retrylife</li>
|
||||
<li>Design: <a href="https://html5up.net" target="_blank">HTML5 UP</a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Scripts -->
|
||||
<script src="http://0.0.0.0:4000/assets/js/jquery.min.js"></script>
|
||||
<script src="http://0.0.0.0:4000/assets/js/jquery.scrolly.min.js"></script>
|
||||
<script src="http://0.0.0.0:4000/assets/js/jquery.scrollex.min.js"></script>
|
||||
<script src="http://0.0.0.0:4000/assets/js/skel.min.js"></script>
|
||||
<script src="http://0.0.0.0:4000/assets/js/util.js"></script>
|
||||
<!--[if lte IE 8]><script src="http://0.0.0.0:4000/assets/js/ie/respond.min.js"></script><![endif]-->
|
||||
<script src="http://0.0.0.0:4000/assets/js/main.js"></script>
|
||||
|
||||
<!-- Global site tag (gtag.js) - Google Analytics -->
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-74118570-2"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
|
||||
function gtag() {
|
||||
dataLayer.push(arguments);
|
||||
}
|
||||
gtag('js', new Date());
|
||||
|
||||
gtag('config', 'UA-74118570-2');
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
Loading…
x
Reference in New Issue
Block a user