<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Ujjawal Saini</title>
    <link>https://write.tedomum.net/spignelon/</link>
    <description></description>
    <pubDate>Tue, 21 Apr 2026 13:47:25 +0000</pubDate>
    <item>
      <title>PicoCTF 2022 Forensics walkthrough – Part 2</title>
      <link>https://write.tedomum.net/spignelon/picoctf-2022-forensics-walkthrough-part-2</link>
      <description>&lt;![CDATA[In this article, we will attempt to solve picoCTF 2022 Forensics challenges 4 to 9.&#xA;&#xA;!--more--&#xA;Challenges&#xA;&#xA;Link to Part - 1&#xA;&#xA;Let&#39;s get started!&#xA;&#xA;Challenge 4 - Packets Primer&#xA;Challenge 4&#xA;&#xA;The description says to download the linked packet capture file and analyse it. Let&#39;s start by opening up our terminal and download the file.&#xA;&#xA;pcap download&#xA;&#xA;Let&#39;s now use Wireshark to open our downloaded packet capture. Wireshark is a free and open-source packet analyser.&#xA;To open it, I simply typed wireshark followed by our file name.&#xA;Wireshark open&#xA;&#xA;Wireshark opened&#xA;&#xA;While I was scrolling through the packets, in packet No. 4 I found the flag&#xA;Wireshark Flag&#xA;&#xA;Hexdump:&#xA;0000   08 00 27 93 ce 73 08 00 27 af 39 9f 08 00 45 00   ..&#39;..s..&#39;.9...E.&#xA;0010   00 70 50 c2 40 00 40 06 d1 b3 0a 00 02 0f 0a 00   .pP.@.@.........&#xA;0020   02 04 be 6e 23 28 27 ec d4 b7 bd 26 99 bc 80 18   ...n#(&#39;....&amp;....&#xA;0030   01 f6 18 75 00 00 01 01 08 0a 8d cf e9 65 68 f0   ...u.........eh.&#xA;0040   f1 c3 70 20 69 20 63 20 6f 20 43 20 54 20 46 20   ..p i c o C T F &#xA;0050   7b 20 70 20 34 20 63 20 6b 20 33 20 37 20 5f 20   { p 4 c k 3 7  &#xA;0060   35 20 68 20 34 20 72 20 6b 20 5f 20 62 20 39 20   5 h 4 r k  b 9 &#xA;0070   64 20 35 20 33 20 37 20 36 20 35 20 7d 0a         d 5 3 7 6 5 }.&#xA;&#xA;Flag: &#xA;Challenge 5 - Redaction gone wrong&#xA;&#xA;Challenge 5&#xA;&#xA;Let&#39;s start this challenge by downloading the linked PDF file.&#xA;&#xA;When opened the PDF:&#xA;redacted PDF&#xA;&#xA;The hint says:&#xA;hint 5&#xA;&#34;How can you be sure of the redaction?&#34;&#xA;&#xA;I opened the file in LibreOffice Draw, and I was able to move the black boxes, which revealed the flag. If you are on Windows, you can also use MS Word.&#xA;Revealed 5&#xA;&#xA;Flag: &#xA;Challenge 6 - Sleuthkit Intro&#xA;&#xA;Challenge 6&#xA;&#xA;Let&#39;s start by downloading the disk image.&#xA;Disk image 1&#xA;&#xA;Since it is extracted image&#xA;&#xA;Using mmls on mmls on disk&#xA;The Linux partition size is: &#xA;Now let&#39;s connect to the access checker program using netcat.&#xA;netcat checker&#xA;&#xA;After I entered the Linux partition size, it gave me the flag.&#xA;Partition flag&#xA;&#xA;Flag: &#xA;Challenge 7 - Sleuthkit Apprentice&#xA;&#xA;challenge 7&#xA;&#xA;First, we downloaded the file&#xA;download image 2&#xA;&#xA;Extracted the file&#xA;extracted gzip&#xA;&#xA;To make things a little easier, I opened Thunar File Manager by simply typing Thunar 1&#xA;&#xA;Under devices, I see these two new partitions mounted:&#xA;Thunar 2&#xA;&#xA;After meandering for a while, in 130 MB Volume, I found a folder named So I escalated my privilege and then tried to run root&#xA;&#xA;Inside it, I found a folder named flag 7&#xA;&#xA;Flag: &#xA;Alternative:&#xA;You can also use Autopsy to analyse the image.&#xA;&#xA;  Autopsy is a digital forensics platform and graphical interface to The Sleuth Kit and other digital forensics tools. It is used by law enforcement, military, and corporate examiners to investigate what happened on a computer. You can even use it to recover photos from your camera&#39;s memory card.&#xA;&#xA;Challenge 8 - Eavesdrop&#xA;&#xA;Eavesdrop&#xA;&#xA;The hint says:&#xA;hint 8&#xA;&#xA;Let&#39;s start by downloading the linked packet capture.&#xA;pcap 2&#xA;&#xA;And open it in wireshark&#xA;wireshark capture.flag.pcap&#xA;wireshark 8&#xA;&#xA;After going through a bunch of packets, I found something interesting&#xA;wireshark 9&#xA;&#xA;Then I right-clicked on the packet and clicked on follow TCP Stream&#xA;follow stream&#xA;&#xA;After I followed the TCP stream, I am able to see the conversation between them.&#xA;conversation&#xA;Here we found something interesting,&#xA;A command to decrypt a file named &#xA;I then cleared our current filter and applied salted file&#xA;&#xA;I then right-clicked on the packet and clicked on Follow Stream&#xA;follow 2&#xA;&#xA;Changed the raw 3&#xA;&#xA;Then I ran file command on the file that we just exported:&#xA;file 8&#xA;And it turned out to be &#xA;Let&#39;s run the command we found earlier on this file, which already has the password in it after k tag which is &#34;supersecretpassword123&#34;.&#xA;openssl&#xA;It gave us a warning, but it also successfully created a new file.txt file, let&#39;s now cat flag&#xA;And we found the flag.&#xA;&#xA;Flag: &#xA;Challenge 9 - Operation Oni&#xA;&#xA;challenge 9&#xA;&#xA;Let&#39;s start this challenge by downloading the linked disk image file.&#xA;download 9&#xA;&#xA;The challenge in the above image also gives us a command to connect to the remote machine.&#xA;&#xA;As it is a gzip file, let&#39;s extract it.&#xA;gunzip 2&#xA;After extracting it, we got the &#xA;To analyse this image, again I would recommend using Autopsy, but in this article we&#39;re going to use binwalk.&#xA;binwalk extract&#xA;&#xA;After cd&#xA;&#xA;After running find 1&#xA;&#xA;Let&#39;s try to key&#xA;&#xA;So, now we have a ssh private key.&#xA;Let&#39;s try to use it to connect to our remote machine.&#xA;&#xA;By simply replacing the ssh error&#xA;&#xA;The error says:&#xA;&#xA;Let&#39;s try to modify its permission and re-run the command.&#xA;permission&#xA;I ran &#xA;After this, I re-ran the command and connected successfully to the remote machine&#xA;connection successful&#xA;&#xA;I ran the completed ssh&#xA;&#xA;Flag: &#xA;~ a href=&#34;https://spignelon.github.io/&#34;spignelon/a | Ujjawal Saini]]&gt;</description>
      <content:encoded><![CDATA[<p>In this article, we will attempt to solve <a href="https://play.picoctf.org/practice?category=4&amp;originalEvent=70&amp;page=1" rel="nofollow">picoCTF 2022 Forensics</a> challenges 4 to 9.</p>



<p><img src="https://imgur.com/1gFhFUs.png" alt="Challenges"></p>

<p><a href="https://paper.wf/spignelon/picoctf-2022-forensics-walkthrough-part-1" rel="nofollow">Link to Part – 1</a></p>

<p>Let&#39;s get started!</p>

<h2 id="challenge-4-packets-primer">Challenge 4 – Packets Primer</h2>

<p><img src="https://imgur.com/LUmmisW.png" alt="Challenge 4"></p>

<p>The description says to download the linked packet capture file and analyse it. Let&#39;s start by opening up our terminal and download the file.</p>

<p><img src="https://imgur.com/oInXyQ8.png" alt="pcap download">
<code>curl -LO &#34;https://artifacts.picoctf.net/c/200/network-dump.flag.pcap&#34;</code></p>

<p>Let&#39;s now use <a href="https://en.wikipedia.org/wiki/Wireshark" rel="nofollow">Wireshark</a> to open our downloaded packet capture. Wireshark is a free and open-source packet analyser.
To open it, I simply typed wireshark followed by our file name.
<img src="https://imgur.com/k86whFd.png" alt="Wireshark open">
<code>wireshark network-dump.flag.pcap</code></p>

<p><img src="https://imgur.com/z01EDyx.png" alt="Wireshark opened"></p>

<p>While I was scrolling through the packets, in packet No. 4 I found the flag
<img src="https://imgur.com/TDvlRKL.png" alt="Wireshark Flag"></p>

<p>Hexdump:</p>

<pre><code>0000   08 00 27 93 ce 73 08 00 27 af 39 9f 08 00 45 00   ..&#39;..s..&#39;.9...E.
0010   00 70 50 c2 40 00 40 06 d1 b3 0a 00 02 0f 0a 00   .pP.@.@.........
0020   02 04 be 6e 23 28 27 ec d4 b7 bd 26 99 bc 80 18   ...n#(&#39;....&amp;....
0030   01 f6 18 75 00 00 01 01 08 0a 8d cf e9 65 68 f0   ...u.........eh.
0040   f1 c3 70 20 69 20 63 20 6f 20 43 20 54 20 46 20   ..p i c o C T F 
0050   7b 20 70 20 34 20 63 20 6b 20 33 20 37 20 5f 20   { p 4 c k 3 7 _ 
0060   35 20 68 20 34 20 72 20 6b 20 5f 20 62 20 39 20   5 h 4 r k _ b 9 
0070   64 20 35 20 33 20 37 20 36 20 35 20 7d 0a         d 5 3 7 6 5 }.
</code></pre>

<p>Flag: <code>picoCTF{p4ck37_5h4rk_b9d53765}</code></p>

<h2 id="challenge-5-redaction-gone-wrong">Challenge 5 – Redaction gone wrong</h2>

<p><img src="https://imgur.com/VPqAmug.png" alt="Challenge 5"></p>

<p>Let&#39;s start this challenge by downloading the linked PDF file.
<code>curl -LO &#34;https://artifacts.picoctf.net/c/264/Financial_Report_for_ABC_Labs.pdf&#34;</code></p>

<p>When opened the PDF:
<img src="https://imgur.com/htqRXe2.png" alt="redacted PDF"></p>

<p>The hint says:
<img src="https://imgur.com/52fZJYx.png" alt="hint 5">
“How can you be sure of the redaction?”</p>

<p>I opened the file in <a href="https://en.wikipedia.org/wiki/LibreOffice_Draw" rel="nofollow">LibreOffice Draw</a>, and I was able to move the black boxes, which revealed the flag. If you are on Windows, you can also use MS Word.
<img src="https://imgur.com/CGZenuG.png" alt="Revealed 5"></p>

<p>Flag: <code>picoCTF{C4n_Y0u_S33_m3_fully}</code></p>

<h2 id="challenge-6-sleuthkit-intro">Challenge 6 – Sleuthkit Intro</h2>

<p><img src="https://imgur.com/aM0JCC9.png" alt="Challenge 6"></p>

<p>Let&#39;s start by downloading the disk image.
<img src="https://imgur.com/OuB432r.png" alt="Disk image 1">
<code>curl -LO &#34;https://artifacts.picoctf.net/c/114/disk.img.gz&#34;</code></p>

<p>Since it is <code>gzip compressed data</code> I used binwalk to extract it which created a folder <code>_disk.img.gz.extracted</code>. You can also use <code>gunzip</code>:
<img src="https://imgur.com/Ogc4RdE.png" alt="extracted image">
<code>binwalk -e disk.img.gz</code></p>

<p>Using mmls on <code>disk.img</code> to find the size of Linux partition, as instructed in the challenge description:
<img src="https://imgur.com/qGWua9m.png" alt="mmls on disk">
<code>mmls disk.img</code>
The Linux partition size is: <code>0000202752</code></p>

<p>Now let&#39;s connect to the access checker program using netcat.
<img src="https://imgur.com/EFsXa2x.png" alt="netcat checker">
<code>nc saturn.picoctf.net 52279</code></p>

<p>After I entered the Linux partition size, it gave me the flag.
<img src="https://imgur.com/V4c0nY8.png" alt="Partition flag"></p>

<p>Flag: <code>picoCTF{mm15_f7w!}</code></p>

<h2 id="challenge-7-sleuthkit-apprentice">Challenge 7 – Sleuthkit Apprentice</h2>

<p><img src="https://imgur.com/MeVVPoe.png" alt="challenge 7"></p>

<p>First, we downloaded the file
<img src="https://imgur.com/PIzEwS4.png" alt="download image 2">
<code>curl -LO &#34;https://artifacts.picoctf.net/c/331/disk.flag.img.gz&#34;</code></p>

<p>Extracted the file
<img src="https://imgur.com/J7OlqPl.png" alt="extracted gzip">
<code>gzip -d disk.flag.img.gz</code></p>

<p>To make things a little easier, I opened <a href="https://en.wikipedia.org/wiki/Thunar" rel="nofollow">Thunar File Manager</a> by simply typing <code>thunar</code> in my current working directory and then right-clicked on the <code>disk.flag.img</code> file and clicked on “Disk Image Mounter” to mount it.
<img src="https://imgur.com/tdZFRSM.png" alt="Thunar 1"></p>

<p>Under devices, I see these two new partitions mounted:
<img src="https://imgur.com/dVBiLto.png" alt="Thunar 2"></p>

<p>After meandering for a while, in 130 MB Volume, I found a folder named <code>root</code> which I was unable to open <code>cd: Permission denied: “root/”</code>.
So I escalated my privilege and then tried to run <code>cd</code> as root.
<img src="https://imgur.com/S5pecZH.png" alt="root"></p>

<p>Inside it, I found a folder named <code>my_folder</code> which had a file named <code>flag.uni.txt</code> inside. I ran <code>cat</code> on the file and found the flag.
<img src="https://imgur.com/KRWXrxA.png" alt="flag 7"></p>

<p>Flag: <code>picoCTF{by73_5urf3r_adac6cb4}</code></p>

<p>Alternative:
You can also use <a href="https://www.sleuthkit.org/autopsy/" rel="nofollow">Autopsy</a> to analyse the image.</p>

<blockquote><p>Autopsy is a digital forensics platform and graphical interface to The Sleuth Kit and other digital forensics tools. It is used by law enforcement, military, and corporate examiners to investigate what happened on a computer. You can even use it to recover photos from your camera&#39;s memory card.</p></blockquote>

<h2 id="challenge-8-eavesdrop">Challenge 8 – Eavesdrop</h2>

<p><img src="https://imgur.com/r7214cx.png" alt="Eavesdrop"></p>

<p>The hint says:
<img src="https://imgur.com/Ca0PDVR.png" alt="hint 8"></p>

<p>Let&#39;s start by downloading the linked packet capture.
<img src="https://imgur.com/CrNccGT.png" alt="pcap 2">
<code>curl -LO &#34;https://artifacts.picoctf.net/c/359/capture.flag.pcap&#34;</code></p>

<p>And open it in wireshark
<img src="https://imgur.com/MLMsGRs.png" alt="wireshark capture.flag.pcap">
<img src="https://imgur.com/aGqYvZF.png" alt="wireshark 8"></p>

<p>After going through a bunch of packets, I found something interesting
<img src="https://imgur.com/eUNllVe.png" alt="wireshark 9"></p>

<p>Then I right-clicked on the packet and clicked on follow TCP Stream
<img src="https://imgur.com/JSsbZil.png" alt="follow stream"></p>

<p>After I followed the TCP stream, I am able to see the conversation between them.
<img src="https://imgur.com/CyG4Z7M.png" alt="conversation">
Here we found something interesting,
<code>openssl des3 -d -salt -in file.des3 -out file.txt -k supersecretpassword123</code>
A command to decrypt a file named <code>file.des3</code> which was transmitted over port <code>9002</code></p>

<p>I then cleared our current filter and applied <code>tcp.port == 9002</code> filter  and found an interesting “Salted” packet, which is likely the file they were talking about in their conversation.
<img src="https://imgur.com/Z55WQdN.png" alt="salted file"></p>

<p>I then right-clicked on the packet and clicked on Follow Stream
<img src="https://imgur.com/B1sT2zj.png" alt="follow 2"></p>

<p>Changed the <code>Show data as:</code> to <code>Raw</code> and clicked on Save as and saved the file as <code>file.des3</code> in our current directory.
<img src="https://imgur.com/JAxz7uL.png" alt="raw 3"></p>

<p>Then I ran file command on the file that we just exported:
<img src="https://imgur.com/XKJUkkg.png" alt="file 8">
<code>file file file.des3</code>
And it turned out to be <code>openssl enc&#39;d data with salted password</code></p>

<p>Let&#39;s run the command we found earlier on this file, which already has the password in it after k tag which is “supersecretpassword123”.
<img src="https://imgur.com/rCLjOmd.png" alt="openssl">
It gave us a warning, but it also successfully created a new file.txt file, let&#39;s now <code>cat</code> the file to see the content within it.
<img src="https://imgur.com/4MbaqKk.png" alt="cat flag">
And we found the flag.</p>

<p>Flag: <code>picoCTF{nc_73115_411_dd54ab67}</code></p>

<h2 id="challenge-9-operation-oni">Challenge 9 – Operation Oni</h2>

<p><img src="https://imgur.com/a73FTry.png" alt="challenge 9"></p>

<p>Let&#39;s start this challenge by downloading the linked disk image file.
<img src="https://imgur.com/Kt7Wbsg.png" alt="download 9">
<code>curl -LO &#34;https://artifacts.picoctf.net/c/374/disk.img.gz&#34;</code></p>

<p>The challenge in the above image also gives us a command to connect to the remote machine.
<code>ssh -i key_file -p 55949 ctf-player@saturn.picoctf.net</code></p>

<p>As it is a gzip file, let&#39;s extract it.
<img src="https://imgur.com/zXSSJaK.png" alt="gunzip 2">
<code>gunzip disk.img.gz</code>
After extracting it, we got the <code>disk.img</code> file.</p>

<p>To analyse this image, again I would recommend using <a href="https://www.sleuthkit.org/autopsy/" rel="nofollow">Autopsy</a>, but in this article we&#39;re going to use <a href="https://github.com/ReFirmLabs/binwalk" rel="nofollow">binwalk</a>.
<img src="https://imgur.com/U26BKWA.png" alt="binwalk extract">
<code>binwalk -e disk.img</code></p>

<p>After <code>cd</code>-ing into <code>_disk.img.extracted</code> we found two folders.
<img src="https://imgur.com/J0STQ0f.png" alt="cd"></p>

<p>After running <code>find</code> in the current directory, I found some interesting results
<img src="https://imgur.com/TJi1Lk5.png" alt="find 1">
<code>find . | grep &#34;ssh&#34;</code></p>

<p>Let&#39;s try to <code>cat</code> the first private key in our result
<img src="https://imgur.com/wCG6CH2.png" alt="key">
<code>cat ./ext-root-0/root/.ssh/id_ed25519</code></p>

<p>So, now we have a ssh private key.
Let&#39;s try to use it to connect to our remote machine.</p>

<p>By simply replacing the <code>key_file</code> to key path we found, I ran the given command, but encountered an error.
<img src="https://imgur.com/kbM7d4Y.png" alt="ssh error">
<code>ssh -i ./ext-root-0/root/.ssh/id_ed25519 -p 55949 ctf-player@saturn.picoctf.net</code></p>

<p>The error says:
<code>Permissions 0644 for &#39;./ext-root-0/root/.ssh/id_ed25519&#39; are too open.</code></p>

<p>Let&#39;s try to modify its permission and re-run the command.
<img src="https://imgur.com/gvim2zE.png" alt="permission">
I ran <code>ls -l ./ext-root-0/root/.ssh/id_ed25519</code> to check the permission of our key, and it turned out that it was world readable, so then I ran <code>chmod 600 ./ext-root-0/root/.ssh/id_ed25519</code> to <a href="https://en.wikipedia.org/wiki/Chmod#Numerical_permissions" rel="nofollow">change its permission</a>.</p>

<p>After this, I re-ran the command and connected successfully to the remote machine
<img src="https://imgur.com/n4sH0lt.png" alt="connection successful"></p>

<p>I ran the <code>ls</code> and found a file named <code>flag.txt</code>, I <code>cat</code>-ed it, and found the key.
<img src="https://imgur.com/6292VUd.png" alt="completed ssh"></p>

<p>Flag: <code>picoCTF{k3y_5l3u7h_af277f77}</code></p>

<p>~ <a href="https://spignelon.github.io/" rel="nofollow">spignelon</a> | Ujjawal Saini</p>
]]></content:encoded>
      <guid>https://write.tedomum.net/spignelon/picoctf-2022-forensics-walkthrough-part-2</guid>
      <pubDate>Sat, 08 Oct 2022 13:59:49 +0000</pubDate>
    </item>
    <item>
      <title>PicoCTF 2022 Forensics walkthrough - Part 1</title>
      <link>https://write.tedomum.net/spignelon/picoctf-2022-forensics-walkthrough-part-1</link>
      <description>&lt;![CDATA[In this article, we will attempt to solve picoCTF 2022 Forensics challenges 1 to 3.&#xA;!--more--&#xA;Challenges&#xA;&#xA;This post assumes you are familiar with what CTF is, if not then feel free to check out this introduction to CTF video by LiveOverFlow:&#xA;Intro to CTF&#xA;&#xA;So, let&#39;s get started.&#xA;&#xA;Challenge 1 - Enhance&#xA;Enhance&#xA;&#xA;As we can see in the description that we are provided with a download link of an image file and no hints.&#xA;&#xA;Let&#39;s start by firing up our terminal and grabbing the image using curl and open it.&#xA;&#xA;imagedl1&#xA;&#xA;When opened:&#xA;imageopen1&#xA;&#xA;It looks like there&#39;s nothing here. Let&#39;s try something else. Let&#39;s try to cat this image file.&#xA;&#xA;Cat&#xA;&#xA;Output:&#xA;?xml version=&#34;1.0&#34; encoding=&#34;UTF-8&#34; standalone=&#34;no&#34;?&#xA;!-- Created with Inkscape (http://www.inkscape.org/) --&#xA;&#xA;&lt;svg&#xA;   xmlns:dc=&#34;http://purl.org/dc/elements/1.1/&#34;&#xA;   xmlns:cc=&#34;http://creativecommons.org/ns#&#34;&#xA;   xmlns:rdf=&#34;http://www.w3.org/1999/02/22-rdf-syntax-ns#&#34;&#xA;   xmlns:svg=&#34;http://www.w3.org/2000/svg&#34;&#xA;   xmlns=&#34;http://www.w3.org/2000/svg&#34;&#xA;   xmlns:sodipodi=&#34;http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd&#34;&#xA;   xmlns:inkscape=&#34;http://www.inkscape.org/namespaces/inkscape&#34;&#xA;   width=&#34;210mm&#34;&#xA;   height=&#34;297mm&#34;&#xA;   viewBox=&#34;0 0 210 297&#34;&#xA;   version=&#34;1.1&#34;&#xA;   id=&#34;svg8&#34;&#xA;   inkscape:version=&#34;0.92.5 (2060ec1f9f, 2020-04-08)&#34;&#xA;   sodipodi:docname=&#34;drawing.svg&#34;  &lt;defs&#xA;     id=&#34;defs2&#34; /  &lt;sodipodi:namedview&#xA;     id=&#34;base&#34;&#xA;     pagecolor=&#34;#ffffff&#34;&#xA;     bordercolor=&#34;#666666&#34;&#xA;     borderopacity=&#34;1.0&#34;&#xA;     inkscape:pageopacity=&#34;0.0&#34;&#xA;     inkscape:pageshadow=&#34;2&#34;&#xA;     inkscape:zoom=&#34;0.69833333&#34;&#xA;     inkscape:cx=&#34;400&#34;&#xA;     inkscape:cy=&#34;538.41159&#34;&#xA;     inkscape:document-units=&#34;mm&#34;&#xA;     inkscape:current-layer=&#34;layer1&#34;&#xA;     showgrid=&#34;false&#34;&#xA;     inkscape:window-width=&#34;1872&#34;&#xA;     inkscape:window-height=&#34;1016&#34;&#xA;     inkscape:window-x=&#34;48&#34;&#xA;     inkscape:window-y=&#34;27&#34;&#xA;     inkscape:window-maximized=&#34;1&#34; /  &lt;metadata&#xA;     id=&#34;metadata5&#34;  rdf:RDF&#xA;      &lt;cc:Work&#xA;         rdf:about=&#34;&#34;  dc:formatimage/svg+xml/dc:format&#xA;        &lt;dc:type&#xA;           rdf:resource=&#34;http://purl.org/dc/dcmitype/StillImage&#34; /  dc:title/dc:title&#xA;      /cc:Work&#xA;    /rdf:RDF&#xA;  /metadata&#xA;  &lt;g&#xA;     inkscape:label=&#34;Layer 1&#34;&#xA;     inkscape:groupmode=&#34;layer&#34;&#xA;     id=&#34;layer1&#34;  &lt;ellipse&#xA;       id=&#34;path3713&#34;&#xA;       cx=&#34;106.2122&#34;&#xA;       cy=&#34;134.47203&#34;&#xA;       rx=&#34;102.05357&#34;&#xA;       ry=&#34;99.029755&#34;&#xA;       style=&#34;stroke-width:0.26458332&#34; /  &lt;circle&#xA;       style=&#34;fill:#ffffff;stroke-width:0.26458332&#34;&#xA;       id=&#34;path3717&#34;&#xA;       cx=&#34;107.59055&#34;&#xA;       cy=&#34;132.30211&#34;&#xA;       r=&#34;3.3341289&#34; /  &lt;ellipse&#xA;       style=&#34;fill:#000000;stroke-width:0.26458332&#34;&#xA;       id=&#34;path3719&#34;&#xA;       cx=&#34;107.45217&#34;&#xA;       cy=&#34;132.10078&#34;&#xA;       rx=&#34;0.027842503&#34;&#xA;       ry=&#34;0.031820003&#34; /  &lt;text&#xA;       xml:space=&#34;preserve&#34;&#xA;       style=&#34;font-style:normal;font-weight:normal;font-size:0.00352781px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332;&#34;&#xA;       x=&#34;107.43014&#34;&#xA;       y=&#34;132.08501&#34;&#xA;       id=&#34;text3723&#34;  &lt;tspan&#xA;         sodipodi:role=&#34;line&#34;&#xA;         x=&#34;107.43014&#34;&#xA;         y=&#34;132.08501&#34;&#xA;         style=&#34;font-size:0.00352781px;line-height:1.25;fill:#ffffff;stroke-width:0.26458332;&#34;&#xA;         id=&#34;tspan3748&#34;  p /tspan&lt;tspan&#xA;         sodipodi:role=&#34;line&#34;&#xA;         x=&#34;107.43014&#34;&#xA;         y=&#34;132.08942&#34;&#xA;         style=&#34;font-size:0.00352781px;line-height:1.25;fill:#ffffff;stroke-width:0.26458332;&#34;&#xA;         id=&#34;tspan3754&#34;  i /tspan&lt;tspan&#xA;         sodipodi:role=&#34;line&#34;&#xA;         x=&#34;107.43014&#34;&#xA;         y=&#34;132.09383&#34;&#xA;         style=&#34;font-size:0.00352781px;line-height:1.25;fill:#ffffff;stroke-width:0.26458332;&#34;&#xA;         id=&#34;tspan3756&#34;  c /tspan&lt;tspan&#xA;         sodipodi:role=&#34;line&#34;&#xA;         x=&#34;107.43014&#34;&#xA;         y=&#34;132.09824&#34;&#xA;         style=&#34;font-size:0.00352781px;line-height:1.25;fill:#ffffff;stroke-width:0.26458332;&#34;&#xA;         id=&#34;tspan3758&#34;  o /tspan&lt;tspan&#xA;         sodipodi:role=&#34;line&#34;&#xA;         x=&#34;107.43014&#34;&#xA;         y=&#34;132.10265&#34;&#xA;         style=&#34;font-size:0.00352781px;line-height:1.25;fill:#ffffff;stroke-width:0.26458332;&#34;&#xA;         id=&#34;tspan3760&#34;  C /tspan&lt;tspan&#xA;         sodipodi:role=&#34;line&#34;&#xA;         x=&#34;107.43014&#34;&#xA;         y=&#34;132.10706&#34;&#xA;         style=&#34;font-size:0.00352781px;line-height:1.25;fill:#ffffff;stroke-width:0.26458332;&#34;&#xA;         id=&#34;tspan3762&#34;  T /tspan&lt;tspan&#xA;         sodipodi:role=&#34;line&#34;&#xA;         x=&#34;107.43014&#34;&#xA;         y=&#34;132.11147&#34;&#xA;         style=&#34;font-size:0.00352781px;line-height:1.25;fill:#ffffff;stroke-width:0.26458332;&#34;&#xA;         id=&#34;tspan3764&#34;  F { 3 n h 4 n /tspan&lt;tspan&#xA;         sodipodi:role=&#34;line&#34;&#xA;         x=&#34;107.43014&#34;&#xA;         y=&#34;132.11588&#34;&#xA;         style=&#34;font-size:0.00352781px;line-height:1.25;fill:#ffffff;stroke-width:0.26458332;&#34;&#xA;         id=&#34;tspan3752&#34;  c 3 d _ 2 4 3 7 4 6 7 5 }/tspan/text&#xA;  /g&#xA;/svg&#xA;&#xA;Upon looking closely at the end of the output, we see that before every, Flag: &#xA;Challenge 2 - File types&#xA;File types&#xA;&#xA;Let&#39;s begin this challenge by downloading the linked PDF file.&#xA;Downloading PDF&#xA;&#xA;When I tried to open the linked Flag.pdf, I faced an error:&#xA;error&#xA;&#xA;When I clicked on hint it said:&#xA;hint 1&#xA;&#xA;It is possible for this file to not be a PDF, let us now check it using the &#34;file&#34; command in our Linux terminal. file command is used to determine file type.&#xA;&#xA;File Flag&#xA;&#xA;Running this command revealed that this is not a PDF file, but it&#39;s a &#34;shell archive text&#34;. Let us now try to rename it to Executed 1&#xA;&#xA;It threw an error After doing a quick internet search I found Arch Linux&#39;s manual for uudecode and under package information found the package name: &#34;extra/sharutils&#34;&#xA;package sharutils&#xA;&#xA;Let us now install it:&#xA;Installing sharutils&#xA;&#xA;Now after I re-executed the Executed 2&#xA;&#xA;After again running &#xA;To extract it I then used binwalk: binwalk&#xA;&#xA;Which then created a folder named 64&#xA;&#xA;Again, we can use 64 flag&#xA;&#xA;I tried extracting the lzip&#xA;&#xA;Then I extracted the LZ4&#xA;&#xA;Then the to extract the But it gave me an error:&#xA;So I renamed the Which successfully executed and created a new file named LZMA&#xA;&#xA;To extract the After changing the name of the file Which then created the file named Which created lzip xz&#xA;&#xA;Then after renaming &#xA;xz&#xA;file 4&#xA;&#xA;After running cat flag4&#xA;6630725f3062326375723137795f37396230316332367d0a&#xA;So to decode it from hex I went over to CyberChef which gave me the flag:&#xA;CyberChef flag&#xA;&#xA;Challenge 3 - Lookey here&#xA;Lookey here&#xA;&#xA;Let&#39;s begin this challenge by downloading the linked &#xA;C3 download&#xA;This time it is what it says, a text file.&#xA;&#xA;After viewing it in using less I realised it&#39;s a very long text file, so I ran Output:&#xA;lines&#xA;&#xA;So I ran grep&#xA;&#xA;And we&#39;ve found the flag:&#xA;&#xA;~ a href=&#34;https://spignelon.github.io/&#34;spignelon/a | Ujjawal Saini]]&gt;</description>
      <content:encoded><![CDATA[<p>In this article, we will attempt to solve <a href="https://play.picoctf.org/practice?category=4&amp;originalEvent=70&amp;page=1" rel="nofollow">picoCTF 2022 Forensics</a> challenges 1 to 3.

<img src="https://imgur.com/LLSd4vB.png" alt="Challenges"></p>

<p>This post assumes you are familiar with what CTF is, if not then feel free to check out this introduction to CTF video by LiveOverFlow:
<a href="https://www.youtube.com/watch?v=8ev9ZX9J45A" rel="nofollow"><img src="https://img.youtube.com/vi/8ev9ZX9J45A/0.jpg" alt="Intro to CTF"></a></p>

<p>So, let&#39;s get started.</p>

<h2 id="challenge-1-enhance">Challenge 1 – Enhance</h2>

<p><img src="https://imgur.com/JxjMD2E.png" alt="Enhance"></p>

<p>As we can see in the description that we are provided with a download link of an image file and no hints.</p>

<p>Let&#39;s start by firing up our terminal and grabbing the image using curl and open it.</p>

<p><img src="https://imgur.com/VQr9CH3.png" alt="imagedl1">
<code>curl -LO &#34;https://artifacts.picoctf.net/c/137/drawing.flag.svg&#34;</code></p>

<p>When opened:
<img src="https://imgur.com/DKlvH4x.png" alt="imageopen1"></p>

<p>It looks like there&#39;s nothing here. Let&#39;s try something else. Let&#39;s try to cat this image file.</p>

<p><img src="https://imgur.com/ylgAEfx.png" alt="Cat">
<code>cat drawing.flag.svg</code></p>

<p>Output:</p>

<pre><code>&lt;?xml version=&#34;1.0&#34; encoding=&#34;UTF-8&#34; standalone=&#34;no&#34;?&gt;
&lt;!-- Created with Inkscape (http://www.inkscape.org/) --&gt;

&lt;svg
   xmlns:dc=&#34;http://purl.org/dc/elements/1.1/&#34;
   xmlns:cc=&#34;http://creativecommons.org/ns#&#34;
   xmlns:rdf=&#34;http://www.w3.org/1999/02/22-rdf-syntax-ns#&#34;
   xmlns:svg=&#34;http://www.w3.org/2000/svg&#34;
   xmlns=&#34;http://www.w3.org/2000/svg&#34;
   xmlns:sodipodi=&#34;http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd&#34;
   xmlns:inkscape=&#34;http://www.inkscape.org/namespaces/inkscape&#34;
   width=&#34;210mm&#34;
   height=&#34;297mm&#34;
   viewBox=&#34;0 0 210 297&#34;
   version=&#34;1.1&#34;
   id=&#34;svg8&#34;
   inkscape:version=&#34;0.92.5 (2060ec1f9f, 2020-04-08)&#34;
   sodipodi:docname=&#34;drawing.svg&#34;&gt;
  &lt;defs
     id=&#34;defs2&#34; /&gt;
  &lt;sodipodi:namedview
     id=&#34;base&#34;
     pagecolor=&#34;#ffffff&#34;
     bordercolor=&#34;#666666&#34;
     borderopacity=&#34;1.0&#34;
     inkscape:pageopacity=&#34;0.0&#34;
     inkscape:pageshadow=&#34;2&#34;
     inkscape:zoom=&#34;0.69833333&#34;
     inkscape:cx=&#34;400&#34;
     inkscape:cy=&#34;538.41159&#34;
     inkscape:document-units=&#34;mm&#34;
     inkscape:current-layer=&#34;layer1&#34;
     showgrid=&#34;false&#34;
     inkscape:window-width=&#34;1872&#34;
     inkscape:window-height=&#34;1016&#34;
     inkscape:window-x=&#34;48&#34;
     inkscape:window-y=&#34;27&#34;
     inkscape:window-maximized=&#34;1&#34; /&gt;
  &lt;metadata
     id=&#34;metadata5&#34;&gt;
    &lt;rdf:RDF&gt;
      &lt;cc:Work
         rdf:about=&#34;&#34;&gt;
        &lt;dc:format&gt;image/svg+xml&lt;/dc:format&gt;
        &lt;dc:type
           rdf:resource=&#34;http://purl.org/dc/dcmitype/StillImage&#34; /&gt;
        &lt;dc:title&gt;&lt;/dc:title&gt;
      &lt;/cc:Work&gt;
    &lt;/rdf:RDF&gt;
  &lt;/metadata&gt;
  &lt;g
     inkscape:label=&#34;Layer 1&#34;
     inkscape:groupmode=&#34;layer&#34;
     id=&#34;layer1&#34;&gt;
    &lt;ellipse
       id=&#34;path3713&#34;
       cx=&#34;106.2122&#34;
       cy=&#34;134.47203&#34;
       rx=&#34;102.05357&#34;
       ry=&#34;99.029755&#34;
       style=&#34;stroke-width:0.26458332&#34; /&gt;
    &lt;circle
       style=&#34;fill:#ffffff;stroke-width:0.26458332&#34;
       id=&#34;path3717&#34;
       cx=&#34;107.59055&#34;
       cy=&#34;132.30211&#34;
       r=&#34;3.3341289&#34; /&gt;
    &lt;ellipse
       style=&#34;fill:#000000;stroke-width:0.26458332&#34;
       id=&#34;path3719&#34;
       cx=&#34;107.45217&#34;
       cy=&#34;132.10078&#34;
       rx=&#34;0.027842503&#34;
       ry=&#34;0.031820003&#34; /&gt;
    &lt;text
       xml:space=&#34;preserve&#34;
       style=&#34;font-style:normal;font-weight:normal;font-size:0.00352781px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332;&#34;
       x=&#34;107.43014&#34;
       y=&#34;132.08501&#34;
       id=&#34;text3723&#34;&gt;&lt;tspan
         sodipodi:role=&#34;line&#34;
         x=&#34;107.43014&#34;
         y=&#34;132.08501&#34;
         style=&#34;font-size:0.00352781px;line-height:1.25;fill:#ffffff;stroke-width:0.26458332;&#34;
         id=&#34;tspan3748&#34;&gt;p &lt;/tspan&gt;&lt;tspan
         sodipodi:role=&#34;line&#34;
         x=&#34;107.43014&#34;
         y=&#34;132.08942&#34;
         style=&#34;font-size:0.00352781px;line-height:1.25;fill:#ffffff;stroke-width:0.26458332;&#34;
         id=&#34;tspan3754&#34;&gt;i &lt;/tspan&gt;&lt;tspan
         sodipodi:role=&#34;line&#34;
         x=&#34;107.43014&#34;
         y=&#34;132.09383&#34;
         style=&#34;font-size:0.00352781px;line-height:1.25;fill:#ffffff;stroke-width:0.26458332;&#34;
         id=&#34;tspan3756&#34;&gt;c &lt;/tspan&gt;&lt;tspan
         sodipodi:role=&#34;line&#34;
         x=&#34;107.43014&#34;
         y=&#34;132.09824&#34;
         style=&#34;font-size:0.00352781px;line-height:1.25;fill:#ffffff;stroke-width:0.26458332;&#34;
         id=&#34;tspan3758&#34;&gt;o &lt;/tspan&gt;&lt;tspan
         sodipodi:role=&#34;line&#34;
         x=&#34;107.43014&#34;
         y=&#34;132.10265&#34;
         style=&#34;font-size:0.00352781px;line-height:1.25;fill:#ffffff;stroke-width:0.26458332;&#34;
         id=&#34;tspan3760&#34;&gt;C &lt;/tspan&gt;&lt;tspan
         sodipodi:role=&#34;line&#34;
         x=&#34;107.43014&#34;
         y=&#34;132.10706&#34;
         style=&#34;font-size:0.00352781px;line-height:1.25;fill:#ffffff;stroke-width:0.26458332;&#34;
         id=&#34;tspan3762&#34;&gt;T &lt;/tspan&gt;&lt;tspan
         sodipodi:role=&#34;line&#34;
         x=&#34;107.43014&#34;
         y=&#34;132.11147&#34;
         style=&#34;font-size:0.00352781px;line-height:1.25;fill:#ffffff;stroke-width:0.26458332;&#34;
         id=&#34;tspan3764&#34;&gt;F { 3 n h 4 n &lt;/tspan&gt;&lt;tspan
         sodipodi:role=&#34;line&#34;
         x=&#34;107.43014&#34;
         y=&#34;132.11588&#34;
         style=&#34;font-size:0.00352781px;line-height:1.25;fill:#ffffff;stroke-width:0.26458332;&#34;
         id=&#34;tspan3752&#34;&gt;c 3 d _ 2 4 3 7 4 6 7 5 }&lt;/tspan&gt;&lt;/text&gt;
  &lt;/g&gt;
&lt;/svg&gt;
</code></pre>

<p>Upon looking closely at the end of the output, we see that before every, <code>&lt;/tspan&gt;</code> there&#39;s a little fragment of the flag. Let us now concatenate this and remove the spaces from between:
Flag: <code>picoCTF{3nh4nc3d_24374675}</code></p>

<h2 id="challenge-2-file-types">Challenge 2 – File types</h2>

<p><img src="https://imgur.com/m79p4NT.png" alt="File types"></p>

<p>Let&#39;s begin this challenge by downloading the linked PDF file.
<img src="https://imgur.com/IisOLSJ.png" alt="Downloading PDF">
<code>curl -LO &#34;https://artifacts.picoctf.net/c/324/Flag.pdf&#34;</code></p>

<p>When I tried to open the linked Flag.pdf, I faced an error:
<img src="https://imgur.com/QBxD9Ms.png" alt="error"></p>

<p>When I clicked on hint it said:
<img src="https://imgur.com/lpzQUNt.png" alt="hint 1"></p>

<p>It is possible for this file to not be a PDF, let us now check it using the “file” command in our Linux terminal. <a href="https://www.man7.org/linux/man-pages/man1/file.1.html" rel="nofollow">file</a> command is used to determine file type.</p>

<p><img src="https://imgur.com/spH67zL.png" alt="File Flag">
<code>file Flag.pdf</code></p>

<p>Running this command revealed that this is not a PDF file, but it&#39;s a “shell archive text”. Let us now try to rename it to <code>.sh</code> extension, give it executable permission and then try to execute it.
<img src="https://imgur.com/RnUKcYU.png" alt="Executed 1">
<code>mv Flag.pdf Flag.sh</code>
<code>chmod +x Flag.sh</code>
<code>./Flag.sh</code></p>

<p>It threw an error <code>uudecode: command not found</code>
After doing a quick internet search I found <a href="https://man.archlinux.org/man/uudecode.1.en" rel="nofollow">Arch Linux&#39;s manual for uudecode</a> and under package information found the package name: “extra/sharutils”
<img src="https://imgur.com/XQDts4H.png" alt="package sharutils"></p>

<p>Let us now install it:
<img src="https://imgur.com/NWI8rG0.png" alt="Installing sharutils">
<code>sudo pacman -S sharutils</code></p>

<p>Now after I re-executed the <code>Flag.sh</code> did <code>ls</code>, I found a new file named <code>flag</code> in my directory.
<img src="https://imgur.com/F3BipY6.png" alt="Executed 2"></p>

<p>After again running <code>file</code> command on our new <code>flag</code>, it is revealed that it is <code>current ar archive</code>.</p>

<p>To extract it I then used <a href="https://github.com/ReFirmLabs/binwalk" rel="nofollow">binwalk</a>: <code>binwalk -e</code>
<img src="https://imgur.com/5sGovkR.png" alt="binwalk"></p>

<p>Which then created a folder named <code>_flag.extracted</code> which then contained a file named <code>64</code> which turned out to be <code>gzip compressed data</code>
<img src="https://imgur.com/AFN7yeQ.png" alt="64"></p>

<p>Again, we can use <code>binwalk</code> to extract this file. Upon doing so, we got a folder <code>_64.extracted</code> which contained two files <code>flag</code> and <code>flag.gz</code>, both compressed data, one lzip and the other one gzip.
<img src="https://i.imgur.com/opA2bs4.png" alt="64 flag"></p>

<p>I tried extracting the <code>flag</code> lzip file using <code>binwalk -e flag</code>, but it didn&#39;t work. So I tried extracting it using <code>lzip</code> command, and the output file <code>flag.out</code> turned out to be <code>LZ4 compressed data</code>
<img src="https://imgur.com/rGCpOMI.png" alt="lzip">
<code>lzip -k -d flag</code></p>

<p>Then I extracted the <code>lz4</code> data and then ran <code>file</code> command on the output <code>file2.out</code>, and it turned out to be <code>LZMA compressed data</code>
<img src="https://imgur.com/H6n08K2.png" alt="LZ4">
<code>lz4 -d flag.out flag2.out</code></p>

<p>Then the to extract the <code>lzma</code> file I executed
<code>lzma -d -k flag2.out</code>
But it gave me an error:
<code>lzma: flag2.out: No such file or directory</code>
So I renamed the <code>flag2.out</code> to <code>flag2.lzma</code> and ran the command again:
<code>lzma -d -k flag2.lzma</code>
Which successfully executed and created a new file named <code>flag2</code> which then turned out to be <code>lzop compressed data</code> upon running <code>file</code> command.
<img src="https://imgur.com/sqC5uM9.png" alt="LZMA"></p>

<p>To extract the <code>lzop</code> file, I then installed the <code>lzop</code> package using <code>sudo pacman -S lzop</code>.
After changing the name of the file <code>flag2</code> to <code>flag2.lzop</code> I ran:
<code>lzop -d -k flag2.lzop -o flag3</code>
Which then created the file named <code>flag3</code> which turned out to be <code>lzip compressed data</code> and then again, to extract it I ran:
<code>lzip -k -d flag3</code>
Which created <code>flag3.out</code>, <code>XZ compressed data</code>
<img src="https://imgur.com/AvhjElH.png" alt="lzip xz"></p>

<p>Then after renaming <code>flag3.out</code> to <code>flag4.xz</code>, I extracted <code>flag4.xz</code> using the <code>xz</code> command, which created <code>flag4</code> which turned out to be an ASCII text.
<code>mv flag3.out flag4.xz</code>
<code>xz -d -k flag4.xz</code></p>

<p><img src="https://imgur.com/IW3lxfa.png" alt="xz">
<img src="https://imgur.com/SBcL8ho.png" alt="file 4"></p>

<p>After running <code>cat</code> on <code>flag4</code> which is an ASCII file, I got:
<img src="https://imgur.com/eYWLJIb.png" alt="cat flag4">
<code>7069636f4354467b66316c656e406d335f6d406e3170756c407431306e5f
6630725f3062326375723137795f37396230316332367d0a</code></p>

<p>So to decode it from hex I went over to <a href="https://is.gd/bb1xes" rel="nofollow">CyberChef</a> which gave me the flag:
<img src="https://imgur.com/Gh0HYmB.png" alt="CyberChef flag"></p>

<p><code>picoCTF{f1len@m3_m@n1pul@t10n_f0r_0b2cur17y_79b01c26}</code></p>

<h2 id="challenge-3-lookey-here">Challenge 3 – Lookey here</h2>

<p><img src="https://imgur.com/7sfgDM7.png" alt="Lookey here"></p>

<p>Let&#39;s begin this challenge by downloading the linked <code>anthem.flag.txt</code> file.</p>

<p><img src="https://imgur.com/hBRZUTZ.png" alt="C3 download">
This time it is what it says, a text file.</p>

<p>After viewing it in using less I realised it&#39;s a very long text file, so I ran <code>wc</code> to count the lines:
<code>wc -l anthem.flag.txt</code>
Output:
<code>2146 anthem.flag.txt</code>
<img src="https://imgur.com/P7c6Hc8.png" alt="lines"></p>

<p>So I ran <code>grep</code> to search through it if it contains our flag or not.
<img src="https://imgur.com/gTiryR2.png" alt="grep">
<code>grep pico anthem.flag.txt</code></p>

<p>And we&#39;ve found the flag:
<code>picoCTF{gr3p_15_@w3s0m3_58f5c024}</code></p>

<p>~ <a href="https://spignelon.github.io/" rel="nofollow">spignelon</a> | Ujjawal Saini</p>
]]></content:encoded>
      <guid>https://write.tedomum.net/spignelon/picoctf-2022-forensics-walkthrough-part-1</guid>
      <pubDate>Fri, 30 Sep 2022 08:02:14 +0000</pubDate>
    </item>
    <item>
      <title>Termbin - Netcat-based command line pastebin.</title>
      <link>https://write.tedomum.net/spignelon/termbin-netcat-based-command-line-pastebin</link>
      <description>&lt;![CDATA[Today we will learn how we can share the output of a command from our terminal using nothing but netcat.&#xA;!--more--&#xA;&#xA;What is pastebin?&#xA;A pastebin or text storage site is a type of online content-hosting service where users can store plain text (e.g. source code snippets for code review via Internet Relay Chat (IRC))&#xA;Source: Wikipedia&#xA;&#xA;How to use termbin?&#xA;Using termbin is really simple. As you head over to https://termbin.com/ you will see:&#xA;&#xA;Usage&#xA;&#xA;So the format is:&#xA;&#xA;When &#34;command&#34; executes, &#34;|&#34; will redirect its output to &#34;termbin.com&#34; on port &#34;9999&#34; via &#34;nc&#34; (netcat).&#xA;&#xA;Installing netcat&#xA;Most linux distributions come with netcat preinstalled, for in case you&#39;re using Termux or a linux distribution which doesn&#39;t come with netcat preinstalled then you can install it using yourm package manager.&#xA;On Debian/Ubuntu:&#xA;On Fedora&#xA;On Arch Linux:&#xA;&#xA;Demonstration&#xA;Let&#39;s try to create a termbin of manpage of netcat.&#xA;Output:&#xA;&#xA;Alias&#xA;For more ease, you can also create an alias of the command and simply pipe the output to it.&#xA;Then to use it, simply type:&#xA;&#xA;Now you can share the above URL with anyone you like, post it on a forum asking for help with an error, or sharing your code with your colleagues.&#xA;&#xA;~ a href=&#34;https://spignelon.github.io/&#34;spignelon/a | Ujjawal Saini]]&gt;</description>
      <content:encoded><![CDATA[<p>Today we will learn how we can share the output of a command from our terminal using nothing but netcat.
</p>

<h2 id="what-is-pastebin">What is pastebin?</h2>

<p><em>A pastebin or text storage site is a type of online content-hosting service where users can store plain text (e.g. source code snippets for code review via Internet Relay Chat (IRC))</em>
Source: <a href="https://en.wikipedia.org/wiki/Pastebin" rel="nofollow">Wikipedia</a></p>

<h2 id="how-to-use-termbin">How to use termbin?</h2>

<p>Using <a href="https://termbin.com/" rel="nofollow">termbin</a> is really simple. As you head over to <a href="https://termbin.com/" rel="nofollow">https://termbin.com/</a> you will see:</p>

<h2 id="usage">Usage</h2>

<p><code>echo just testing!  | nc termbin.com 9999</code>
<code>cat ~/some_file.txt | nc termbin.com 9999</code>
<code>ls -la | nc termbin.com 9999</code></p>

<p>So the format is:
<code>command | nc termbin.com 9999</code></p>

<p>When “command” executes, “|” will redirect its output to “termbin.com” on port “9999” via “nc” (netcat).</p>

<h2 id="installing-netcat">Installing netcat</h2>

<p>Most linux distributions come with netcat preinstalled, for in case you&#39;re using Termux or a linux distribution which doesn&#39;t come with netcat preinstalled then you can install it using yourm package manager.
On Debian/Ubuntu:
<code>sudo apt-get install netcat</code>
On Fedora
<code>sudo dnf install nc</code>
On Arch Linux:
<code>sudo pacman -S gnu-netcat</code></p>

<h2 id="demonstration">Demonstration</h2>

<p>Let&#39;s try to create a termbin of manpage of netcat.
<code>man nc | nc termbin.com 9999</code>
Output:
<code>https://termbin.com/sln3</code></p>

<h2 id="alias">Alias</h2>

<p>For more ease, you can also create an alias of the command and simply pipe the output to it.
<code>echo &#39;alias tb=&#34;nc termbin.com 9999&#34;&#39; &gt;&gt; .bashrc</code>
Then to use it, simply type:
<code>command | tb</code></p>

<p>Now you can share the above URL with anyone you like, post it on a forum asking for help with an error, or sharing your code with your colleagues.</p>

<p>~ <a href="https://spignelon.github.io/" rel="nofollow">spignelon</a> | Ujjawal Saini</p>
]]></content:encoded>
      <guid>https://write.tedomum.net/spignelon/termbin-netcat-based-command-line-pastebin</guid>
      <pubDate>Fri, 30 Sep 2022 08:01:45 +0000</pubDate>
    </item>
    <item>
      <title>Uploading files from terminal on file hosting service, and unlimited cloud storage</title>
      <link>https://write.tedomum.net/spignelon/uploading-files-from-terminal-on-file-hosting-service-and-unlimited-cloud</link>
      <description>&lt;![CDATA[In this post I will show you how you can upload files anonymously  directly from your terminal, and can have unlimited cloud storage all for free.&#xA;!--more--&#xA;&#xA;BayFiles is a website and file hosting service created by two of the founders of The Pirate Bay.&#xA;BayFiles works by letting users upload files to its servers and share them online. Users are provided with a link to access their files, which can be shared with anyone on the internet so that they can download the files associated with the particular link. A unique aspect of this file hosting service is that it does not provide a search function for its users or any sort of file directory that could be used to navigate its online file base. BayFiles can be used and accessed by people without requiring them to sign up for it.&#xA;Source: Wikipedia&#xA;Another similar popular service is anonfiles.&#xA;&#xA;Searching for the API&#xA;As you can see when you open the anonfiles.com, there is an option of API at the bottom of the page.&#xA;https://anonfiles.com/docs/api&#xA;&#xA;Understanding the API&#xA;The request example under upload in the aforementioned link is:&#xA;So as we can see in the above command they&#39;re using curl. curl  is  a  tool  for transferring data from or to a server. We also need to replace test.txt with the name of the file we want to upload.&#xA;&#xA;Installing curl&#xA;You can use package manager on the distro of your choice to install curl.&#xA;For Ubuntu/Debian based distros:&#xA;For Arch Linux:&#xA;&#xA;Many linux distros comes with curl preinstalled. To check the version of curl installed on your system type:&#xA;&#xA;Uploading files&#xA;For demonstration I am going to upload a file named &#34;26bugc.jpg&#34;&#xA;You would also need to change the current directory to the directory where the file you want to upload is stored.&#xA;The file I am uploading is stored in my home directory.&#xA;&#xA;Replacing the test.txt with the file name:&#xA;Output:&#xA;&#xA;screenshot&#xA;&#xA;The full and short URL above are the link to our uploaded file.&#xA;Full: https://anonfiles.com/f7LaKftby3/26bugc_jpg&#xA;Short: https://anonfiles.com/f7LaKftby3&#xA;&#xA;Frequently Asked Questions:&#xA;How long will my files be online?&#xA;For as long as possible unless the file violates our Terms of Use.&#xA;&#xA;What are the limit of uploads?&#xA;You are free to upload as long as you don&#39;t exceed the following restrictions:&#xA;Max 20 GB per file&#xA;Max 500 files or 50 GB per hour.&#xA;Max 5,000 files or 100 GB per day.&#xA;&#xA;Any restrictions on downloads?&#xA;No. We do not enforce any form of bandwidth limitations on downloads.&#xA;&#xA;Similar / Alternatives&#xA;I have curated similar websites, which works exactly like the one we saw above:&#xA;&#xA;anonfiles:&#xA;BayFiles:&#xA;openload:&#xA;Lolabits:&#xA;vShare:&#xA;hotfile:&#xA;Rapidshare:&#xA;Upvid:&#xA;Letsupload:&#xA;Megaupload:&#xA;MYfile:&#xA;filechan:&#xA;&#xA;Each of these privacy oriented file hosting service is absolutely free, has no time limit, provides unlimited bandwidth, 20GB filesize limit, and unlimited file storage. You can also upload files on these websites directly from your browser of use your terminal like we&#39;ve learnt above. Although these files are not listed anywhere and cannot be accessed by anyone on the internet without the link, if you want to upload some private and personal files consider encrypting them before uploading so only you can access them.&#xA;&#xA;~ a href=&#34;https://spignelon.github.io/&#34;spignelon/a | Ujjawal Saini]]&gt;</description>
      <content:encoded><![CDATA[<p>In this post I will show you how you can upload files anonymously  directly from your terminal, and can have unlimited cloud storage all for free.
</p>

<p><em>BayFiles is a website and file hosting service created by two of the founders of The Pirate Bay.
BayFiles works by letting users upload files to its servers and share them online. Users are provided with a link to access their files, which can be shared with anyone on the internet so that they can download the files associated with the particular link. A unique aspect of this file hosting service is that it does not provide a search function for its users or any sort of file directory that could be used to navigate its online file base. BayFiles can be used and accessed by people without requiring them to sign up for it.</em>
Source: <a href="https://en.wikipedia.org/wiki/BayFiles" rel="nofollow">Wikipedia</a>
Another similar popular service is <a href="https://anonfiles.com/" rel="nofollow">anonfiles</a>.</p>

<h2 id="searching-for-the-api">Searching for the API</h2>

<p>As you can see when you open the <a href="https://anonfiles.com/" rel="nofollow">anonfiles.com</a>, there is an option of API at the bottom of the page.
<a href="https://anonfiles.com/docs/api" rel="nofollow">https://anonfiles.com/docs/api</a></p>

<h2 id="understanding-the-api">Understanding the API</h2>

<p>The request example under upload in the aforementioned link is:
<code>curl -F &#34;file=@test.txt&#34; https://api.anonfiles.com/upload</code>
So as we can see in the above command they&#39;re using curl. curl  is  a  tool  for transferring data from or to a server. We also need to replace test.txt with the name of the file we want to upload.</p>

<h2 id="installing-curl">Installing curl</h2>

<p>You can use package manager on the distro of your choice to install curl.
For Ubuntu/Debian based distros:
<code>sudo apt-get install curl</code>
For Arch Linux:
<code>sudo pacman -S curl</code></p>

<p>Many linux distros comes with curl preinstalled. To check the version of curl installed on your system type:
<code>curl -V</code></p>

<h2 id="uploading-files">Uploading files</h2>

<p>For demonstration I am going to upload a file named “26bugc.jpg”
You would also need to change the current directory to the directory where the file you want to upload is stored.
The file I am uploading is stored in my home directory.</p>

<p>Replacing the test.txt with the file name:
<code>curl -F &#34;file=@26bugc.jpg&#34; https://api.anonfiles.com/upload</code>
Output:
<code>{&#34;status&#34;:true,&#34;data&#34;:{&#34;file&#34;:{&#34;url&#34;:{&#34;full&#34;:&#34;https://anonfiles.com/f7LaKftby3/26bugc_jpg&#34;,&#34;short&#34;:&#34;https://anonfiles.com/f7LaKftby3&#34;},&#34;metadata&#34;:{&#34;id&#34;:&#34;f7LaKftby3&#34;,&#34;name&#34;:&#34;26bugc.jpg&#34;,&#34;size&#34;:{&#34;bytes&#34;:97116,&#34;readable&#34;:&#34;97.12 KB&#34;}}}}}</code></p>

<p><img src="https://i.imgur.com/joHGYx8.png" alt="screenshot"></p>

<p>The full and short URL above are the link to our uploaded file.
Full: <a href="https://anonfiles.com/f7LaKftby3/26bugc_jpg" rel="nofollow">https://anonfiles.com/f7LaKftby3/26bugc_jpg</a>
Short: <a href="https://anonfiles.com/f7LaKftby3" rel="nofollow">https://anonfiles.com/f7LaKftby3</a></p>

<h2 id="frequently-asked-questions-https-anonfiles-com-faq"><a href="https://anonfiles.com/faq" rel="nofollow">Frequently Asked Questions</a>:</h2>

<p><strong>How long will my files be online?</strong>
For as long as possible unless the file violates our Terms of Use.</p>

<p><strong>What are the limit of uploads?</strong>
You are free to upload as long as you don&#39;t exceed the following restrictions:
Max 20 GB per file
Max 500 files or 50 GB per hour.
Max 5,000 files or 100 GB per day.</p>

<p><strong>Any restrictions on downloads?</strong>
No. We do not enforce any form of bandwidth limitations on downloads.</p>

<h2 id="similar-alternatives">Similar / Alternatives</h2>

<p>I have curated similar websites, which works exactly like the one we saw above:</p>
<ul><li><a href="https://anonfiles.com/" rel="nofollow">anonfiles</a>:
<code>curl -F &#34;file=@test.txt&#34; https://api.anonfiles.com/upload</code></li>
<li><a href="https://bayfiles.com/" rel="nofollow">BayFiles</a>:
<code>curl -F &#34;file=@test.txt&#34; https://api.bayfiles.com/upload</code></li>
<li><a href="https://openload.cc/" rel="nofollow">openload</a>:
<code>curl -F &#34;file=@test.txt&#34; https://api.openload.cc/upload</code></li>
<li><a href="https://lolabits.se/" rel="nofollow">Lolabits</a>:
<code>curl -F &#34;file=@test.txt&#34; https://api.lolabits.se/upload</code></li>
<li><a href="https://vshare.is/" rel="nofollow">vShare</a>:
<code>curl -F &#34;file=@test.txt&#34; https://api.vshare.is/upload</code></li>
<li><a href="https://hotfile.io/" rel="nofollow">hotfile</a>:
<code>curl -F &#34;file=@test.txt&#34; https://api.hotfile.io/upload</code></li>
<li><a href="https://rapidshare.nu/" rel="nofollow">Rapidshare</a>:
<code>curl -F &#34;file=@test.txt&#34; https://api.rapidshare.nu/upload</code></li>
<li><a href="https://upvid.cc/" rel="nofollow">Upvid</a>:
<code>curl -F &#34;file=@test.txt&#34; https://api.upvid.cc/upload</code></li>
<li><a href="https://letsupload.cc/" rel="nofollow">Letsupload</a>:
<code>curl -F &#34;file=@test.txt&#34; https://api.letsupload.cc/upload</code></li>
<li><a href="https://megaupload.nz/" rel="nofollow">Megaupload</a>:
<code>curl -F &#34;file=@test.txt&#34; https://api.megaupload.nz/upload</code></li>
<li><a href="https://myfile.is/" rel="nofollow">MYfile</a>:
<code>curl -F &#34;file=@test.txt&#34; https://api.myfile.is/upload</code></li>
<li><a href="https://filechan.org/" rel="nofollow">filechan</a>:
<code>curl -F &#34;file=@test.txt&#34; https://api.filechan.org/upload</code></li></ul>

<p>Each of these privacy oriented file hosting service is absolutely free, has no time limit, provides unlimited bandwidth, 20GB filesize limit, and unlimited file storage. You can also upload files on these websites directly from your browser of use your terminal like we&#39;ve learnt above. Although these files are not listed anywhere and cannot be accessed by anyone on the internet without the link, if you want to upload some private and personal files consider encrypting them before uploading so only you can access them.</p>

<p>~ <a href="https://spignelon.github.io/" rel="nofollow">spignelon</a> | Ujjawal Saini</p>
]]></content:encoded>
      <guid>https://write.tedomum.net/spignelon/uploading-files-from-terminal-on-file-hosting-service-and-unlimited-cloud</guid>
      <pubDate>Fri, 30 Sep 2022 08:00:41 +0000</pubDate>
    </item>
    <item>
      <title>Auto-updating hosts file using cronjob</title>
      <link>https://write.tedomum.net/spignelon/auto-updating-hosts-file-using-cronjob</link>
      <description>&lt;![CDATA[In this post I will show you how you can easily set your hosts file in &#34;/etc/hosts&#34; to automatically update with the help of cron.&#xA;!--more--&#xA;&#xA;What is cron?&#xA;cron is the time-based job scheduler in Unix-like computer operating systems. cron enables users to schedule jobs (commands or shell scripts) to run periodically at certain times, dates or intervals. It is commonly used to automate system maintenance or administration.&#xA;&#xA;Installing Cron on Your System&#xA;You can use package manager on the distro of your choice to install cron.&#xA;For Ubuntu/Debian based distros:&#xA;For Arch Linux:&#xA;For Fedora:&#xA;&#xA;Enabling cron daemon to run on boot&#xA;For Ubuntu/Debian based:&#xA;&#xA;Crontab format&#xA;The basic format for a crontab is:&#xA;&#xA;Now if we want to run a command every Monday at 5:00pm we use:&#xA;You can use cron.help for more help to understand the syntax.&#xA;&#xA;Setting up your cronjob using crontab&#xA;We will use sudo for this since it requires root privilege to edit &#34;/etc/hosts&#34; file.&#xA;I personally use StevenBlack&#39;s hosts file to block advertisements and malicious domains so I would use:&#xA;The above command will fetch the updated hosts file every Monday at 5:00pm using curl from the above URL and overwrite the current &#34;/etc/hosts&#34; file.&#xA;After adding the above command, save and exit crontab editor.&#xA;&#xA;~ a href=&#34;https://spignelon.github.io/&#34;spignelon/a | Ujjawal Saini]]&gt;</description>
      <content:encoded><![CDATA[<p>In this post I will show you how you can easily set your hosts file in “/etc/hosts” to automatically update with the help of cron.
</p>

<h2 id="what-is-cron">What is cron?</h2>

<p><em>cron is the time-based job scheduler in Unix-like computer operating systems. cron enables users to schedule jobs (commands or shell scripts) to run periodically at certain times, dates or intervals. It is commonly used to automate system maintenance or administration.</em></p>

<h2 id="installing-cron-on-your-system">Installing Cron on Your System</h2>

<p>You can use package manager on the distro of your choice to install cron.
For Ubuntu/Debian based distros:
<code>sudo apt install cron</code>
For Arch Linux:
<code>sudo pacman -S cronie</code>
For Fedora:
<code>sudo dnf install cronie</code></p>

<h2 id="enabling-cron-daemon-to-run-on-boot">Enabling cron daemon to run on boot</h2>

<p><code>sudo systemctl enable cronie</code>
For Ubuntu/Debian based:
<code>sudo systemctl enable cron</code></p>

<h2 id="crontab-format">Crontab format</h2>

<p>The basic format for a crontab is:
<code>minute hour day_of_month month day_of_week command</code></p>
<ul><li><code>minute</code> values can be from 0 to 59.</li>
<li><code>hour</code> values can be from 0 to 23.</li>
<li><code>day_of_month</code> values can be from 1 to 31.</li>
<li><code>month</code> values can be from 1 to 12.</li>
<li><code>day_of_week</code> values can be from 0 to 6, with 0 denoting Sunday.</li></ul>

<p>Now if we want to run a command every Monday at 5:00pm we use:
<code>0 17 * * 1 command</code> ( 17 is 5pm in 24 hour clock format ).
You can use <a href="https://cron.help/" rel="nofollow">cron.help</a> for more help to understand the syntax.</p>

<h2 id="setting-up-your-cronjob-using-crontab">Setting up your cronjob using crontab</h2>

<p>We will use sudo for this since it requires root privilege to edit “/etc/hosts” file.
<code>sudo crontab -e</code>
I personally use <a href="https://github.com/StevenBlack/hosts" rel="nofollow">StevenBlack</a>&#39;s hosts file to block advertisements and malicious domains so I would use:
<code>0 17 * * 1 curl https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts &gt; /etc/hosts</code>
The above command will fetch the updated hosts file every Monday at 5:00pm using curl from the above URL and overwrite the current “/etc/hosts” file.
After adding the above command, save and exit crontab editor.</p>

<p>~ <a href="https://spignelon.github.io/" rel="nofollow">spignelon</a> | Ujjawal Saini</p>
]]></content:encoded>
      <guid>https://write.tedomum.net/spignelon/auto-updating-hosts-file-using-cronjob</guid>
      <pubDate>Fri, 30 Sep 2022 08:00:15 +0000</pubDate>
    </item>
  </channel>
</rss>