<?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 anon5123 on Medium]]></title>
        <description><![CDATA[Stories by anon5123 on Medium]]></description>
        <link>https://medium.com/@anon5123?source=rss-f71c384704d7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*-vQvfNbc9VUHo_s5uzLFuw.jpeg</url>
            <title>Stories by anon5123 on Medium</title>
            <link>https://medium.com/@anon5123?source=rss-f71c384704d7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 08:18:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@anon5123/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[Zabbix Installation]]></title>
            <link>https://medium.com/@anon5123/zabbix-installation-e635cd87e936?source=rss-f71c384704d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/e635cd87e936</guid>
            <category><![CDATA[zabbix]]></category>
            <category><![CDATA[ubuntu]]></category>
            <dc:creator><![CDATA[anon5123]]></dc:creator>
            <pubDate>Tue, 10 Sep 2019 14:28:12 GMT</pubDate>
            <atom:updated>2019-09-10T14:28:12.522Z</atom:updated>
            <content:encoded><![CDATA[<h3>Environment</h3><p>I will describe how I installed Zabbix in the following environment.</p><pre>| No | Package name | Version            |<br>| 1  | Zabbix       | 3.4.10             |<br>| 2  | PHP          | 7.0.30             |<br>| 3  | Apache       | Apache/2.4.18      |<br>| 4  | OS           | Ubuntu 16.04.4 LTS |</pre><h3>PHP Installation</h3><pre>sudo apt-get update<br>sudo apt-get install php7.0-xml php7.0-bcmath php7.0-mbstring</pre><h3>Zabbix Installation</h3><pre>wget <a href="http://repo.zabbix.com/zabbix/3.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.4-1%2Bxenial_all.deb">http://repo.zabbix.com/zabbix/3.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.4-1%2Bxenial_all.deb</a><br>sudo dpkg -i zabbix-release_3.4–1+xenial_all.deb<br>sudo apt-get update<br>sudo apt-get install zabbix-server-mysql zabbix-frontend-php<br>sudo apt-get install zabbix-agent</pre><p>Apache and MySQL will be also installed by the previous commands.</p><h3>Database configuration</h3><pre>sudo su<br>mysql</pre><p>I created a database user by the following SQL query.</p><pre>create database zabbix character set utf8 collate utf8_bin;<br>grant all privileges on zabbix.* to zabbix@localhost identified by ‘zabbix’;<br>flush privileges;</pre><pre>cat /usr/share/doc/zabbix-server-mysql/create.sql.gz | mysql -uzabbix -p zabbix</pre><pre>vi /etc/zabbix/zabbix_server.conf</pre><p>I modified zabbix_server.conf as follows.</p><pre> 89 # Mandatory: no<br> 90 # Default:<br>-91 # DBHost=localhost<br>+91 DBHost=localhost<br> 92<br> 93 ### Option: DBName<br> 94 # Database name.<br> 95 # For SQLite3 path to database file must be provided. DBUser and DBPassword are ignored.<br> 96 #<br> 97 # Mandatory: yes<br> 98 # Default:<br> 99 # DBName=<br> 100<br> 101 DBName=zabbix<br> 102<br> 103 ### Option: DBSchema<br> 104 # Schema name. Used for IBM DB2 and PostgreSQL.<br> 105 #<br> 106 # Mandatory: no<br> 107 # Default:<br> 108 # DBSchema=<br> 109<br> 110 ### Option: DBUser<br> 111 # Database user. Ignored for SQLite.<br> 112 #<br> 113 # Mandatory: no<br> 114 # Default:<br> 115 # DBUser=<br> 116<br> 117 DBUser=zabbix<br> 118<br> 119 ### Option: DBPassword<br> 120 # Database password. Ignored for SQLite.<br> 121 # Comment this line if no password is used.<br> 122 #<br> 123 # Mandatory: no<br> 124 # Default:<br>-125 # DBPassword=zabbix<br>+125 DBPassword=zabbix<br> 126<br> 127 ### Option: DBSocket<br> 128 # Path to MySQL socket.<br></pre><h3>Timezone settings</h3><pre>vi /etc/apache2/conf-enabled/zabbix.conf</pre><pre><br> 21 &lt;IfModule mod_php7.c&gt;<br> 22 php_value max_execution_time 300<br> 23 php_value memory_limit 128M<br> 24 php_value post_max_size 16M<br> 25 php_value upload_max_filesize 2M<br> 26 php_value max_input_time 300<br> 27 php_value always_populate_raw_post_data -1<br>-28 php_value date.timezone Europe/Riga<br>+28 php_value date.timezone Asia/Tokyo<br> 29 &lt;/IfModule&gt;<br>```</pre><p>We should restart Apache.</p><pre>sudo service zabbix-server start<br>sudo update-rc.d zabbix-server enable<br>sudo service apache2 restart</pre><h3>Setting up Zabbix</h3><p>You should check status by accessing the following url. If all status are OK, then you can proceed installation by clicking “Next”.</p><pre>http://&lt;Zabbix IP Address&gt;/zabbix/</pre><p>In the process of installation, you should enter database username and password.</p><h3>HTTPS Configuration</h3><p>We should create ssl-cert and change setting.</p><pre>sudo make-ssl-cert generate-default-snakeoil<br>sudo vi /etc/apache2/sites-available/000-default.conf</pre><p>I modified 000-defualt.conf as follows.</p><pre><br>-1 &lt;VirtualHost *:80&gt;<br>+1 &lt;VirtualHost *:443&gt;<br> 2 # The ServerName directive sets the request scheme, hostname and port that<br> 3 # the server uses to identify itself. This is used when creating<br> 4 # redirection URLs. In the context of virtual hosts, the ServerName<br> 5 # specifies what hostname must appear in the request’s Host: header to<br> 6 # match this virtual host. For the default virtual host (this file) this<br> 7 # value is not decisive as it is used as a last resort host regardless.<br> 8 # However, you must set it for any further virtual host explicitly.<br> 9 #ServerName <a href="http://www.example.com/">www.example.com</a><br> 10</pre><pre> 23 # For most configuration files from conf-available/, which are<br> 24 # enabled or disabled at a global level, it is possible to<br> 25 # include a line for only one particular virtual host. For example the<br> 26 # following line enables the CGI configuration for this host only<br> 27 # after it has been globally disabled with “a2disconf”.<br> 28 #Include conf-available/serve-cgi-bin.conf<br> 29<br> 30<br>+31 SSLEngine on<br>+32 SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem<br>+33 SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key<br></pre><p>We should enable ssl and restart Apache.</p><pre>sudo a2enmod ssl<br>sudo a2ensite default-ssl<br>sudo service apache2 restart</pre><h3>Login</h3><p>You can login to Zabbix by accessing URL below and entering default credential.</p><pre>https://&lt;Zabbix IP Address&gt;/zabbix/<br>Username : Admin<br>Password : zabbix</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e635cd87e936" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Remote acquisition to obtain Ec2 instance image.]]></title>
            <link>https://medium.com/@anon5123/remote-acquisition-to-obtain-ec2-instance-image-2b1a222020e1?source=rss-f71c384704d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/2b1a222020e1</guid>
            <category><![CDATA[forensics]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[acquisition]]></category>
            <dc:creator><![CDATA[anon5123]]></dc:creator>
            <pubDate>Tue, 27 Aug 2019 11:01:58 GMT</pubDate>
            <atom:updated>2019-08-27T11:03:21.238Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>How to acquire remote disk</strong></h3><p>These days, I encountered a situation in which i had to acquire an ec2 instance. All information I had about the target server was a ssh login account, so I executed the command below after ssh logging in and create a disk image.</p><blockquote>sudo fdisk -l</blockquote><blockquote>sudo ssh -i &lt;pem file fullpath on local&gt; centos@&lt;target server ip&gt; “sudo dd if=/dev/xvda” | dd of=&lt;output dd image file fullpath on local&gt;</blockquote><p>Some articles told me almost the same technique to acquire by using netcat command. In my case, however, it didn’t work fine. It stopped before completing acquisition of entire disk.</p><h3><strong>Reference</strong></h3><ul><li><a href="https://unix.stackexchange.com/questions/132797/how-to-dd-a-remote-disk-using-ssh-on-local-machine-and-save-to-a-local-disk">How to dd a remote disk using SSH on local machine and save to a local disk</a></li><li><a href="http://blog.hakzone.info/posts-and-articles/windows/just-another-netcat-tutorial/">Just another NetCat tutorial</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2b1a222020e1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Splunk sometimes doesn’t index logs entirely]]></title>
            <link>https://medium.com/@anon5123/splunk-sometimes-doesnt-index-logs-entirely-e611efe55eca?source=rss-f71c384704d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/e611efe55eca</guid>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[anon5123]]></dc:creator>
            <pubDate>Tue, 20 Aug 2019 17:42:55 GMT</pubDate>
            <atom:updated>2019-08-20T17:42:55.282Z</atom:updated>
            <content:encoded><![CDATA[<p>I often use Splunk to aggregate logs from multiple linux servers and investigate logs. I sometimes see that Splunk doesn’t index logs entirely. Only some of the files are indexed as expected, but the others are completely ignored. The phenomena occur under the following situations.</p><ol><li>When indexing multiple logs (more than 100 files)</li><li>There are multiple files with the same filename (but in different directories)</li></ol><p>When I tried Splunk to restart, Splunk sometimes started indexing. But this method didn’t work all the time.</p><p>I am not still sure this workaround is the best way, but I could avoid this not-indexing situation by chaging <strong>crcSalt </strong>attribute in inputs.conf. Sample inputs.conf setting is as below.</p><blockquote>[monitor://&lt;path&gt;]<br>disabled = false<br>index = index-name<br>sourcetype = your-sourcetype<br><strong>crcSalt = &lt;SOURCE&gt;</strong></blockquote><p>crcSalt is set to &lt;SOURCE&gt; (angle brackets). According to official Splunk documentation, this setting to force the input to consume files that have matching CRCs (cyclic redundancy checks).</p><p>The full file path to the source file is now added to the CRC. This ensures that each file being monitored has a unique CRC.</p><p>After changing the inputs.conf file, I delete a current index and create a new index. Then I refresh splunk by accessing the following url.</p><blockquote><a href="https://localhost:8000/debug/refresh">https://localhost:8000/debug/refresh</a></blockquote><p>It makes Splunk starts indexing all logs as expected.</p><p><strong>Reference</strong></p><p><a href="https://docs.splunk.com/Documentation/Splunk/7.3.1/Admin/Inputsconf">https://docs.splunk.com/Documentation/Splunk/7.3.1/Admin/Inputsconf</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e611efe55eca" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to add a user to ec2 Linux instances]]></title>
            <link>https://medium.com/@anon5123/how-to-add-a-user-to-ec2-linux-instances-cdb575c25e04?source=rss-f71c384704d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/cdb575c25e04</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[ssh]]></category>
            <dc:creator><![CDATA[anon5123]]></dc:creator>
            <pubDate>Mon, 24 Jun 2019 12:55:13 GMT</pubDate>
            <atom:updated>2019-06-24T12:56:07.499Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/839/1*Y96apPyQRewfNgvWGp329g.png" /></figure><h3>Introduction</h3><p>These days, I came across a following situation.</p><ol><li>Uploading an image to a server though web application which is hosted on a web server (primary server).</li><li>The web application uploads the image to another web server (secondary sever).</li></ol><p>In this situation, the web application on the primary server automatically logs into the secondary server through scp and puts the image. Then, how should we make the primary server log into the secondary server? We wanted to locate a private key of the secondary server on the primary server and the primary server will log into the secondary server.</p><p>From the point of cybersecurity, it is not preferable to locate a private key for a default user in an ec2 instance. So I created an additional linux user and a key pair for the user in the following procedure.</p><h3>Procedure</h3><p>Adding a user</p><p>CentOS</p><pre>sudo adduser newuser</pre><p>Ubuntu</p><pre>sudo adduser newuser — disabled-password</pre><p>You can see no password is set for the user by viewing a shadow file. The second column shows !! which means no password is set.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/501/1*QfhjpAo-lFPfO6fDXnuT3g.png" /></figure><p><a href="https://unix.stackexchange.com/questions/26153/second-field-in-etc-shadow">https://unix.stackexchange.com/questions/26153/second-field-in-etc-shadow</a></p><p>Generating a key pair</p><p>You can generate a key pair on AWS Console and download a private key. After downloading a private key, you can create a public key for the private key by ssh-keygen command.</p><pre>anon5123@anon-pc:/mnt/c/Users/anon5123/Downloads$ ssh-keygen -y<br>Enter file in which the key is (/home/anon5123/.ssh/id_rsa): /mnt/c/Users/anon5123/sftp.pem</pre><p>The preceding command outputs the public key</p><pre>ssh-rsa XXXX...</pre><p>Configuring a key pair</p><pre>[ec2-user ~]$ sudo su - newuser<br>[newuser ~]$ mkdir .ssh<br>[newuser ~]$ chmod 700 .ssh<br>[newuser ~]$ touch .ssh/authorized_keys<br>[newuser ~]$ chmod 600 .ssh/authorized_keys<br>[newuser ~]$ vi .ssh/authorized_keys</pre><p>Paste the public key which we have created before on .ssh/authorized_keysand save.</p><p>Checking if the key pair is working.</p><p>Now we can login using the key pair. A new user not a member of wheel group and not a sudoer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/577/1*pgVJdtH4F5IDA8Mrcu-kAQ.png" /></figure><p>joining to apache group.</p><p>We want to upload an image to Document Root in secondary server, so we make the user be a member of apache group.</p><pre>sudo usermod -a -G apache newuser</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/1*-nJwVF-CfuMb4XrPqVpSKQ.png" /></figure><p>If you don’t need the user anymore, you can delete the user by the follwoing command. The command deletes both home directory and mail spool for the user.</p><pre>sudo userdel -r newuser</pre><h3>Reference</h3><p><a href="https://docs.aws.amazon.com/ja_jp/AWSEC2/latest/UserGuide/managing-users.html">https://docs.aws.amazon.com/ja_jp/AWSEC2/latest/UserGuide/managing-users.html</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cdb575c25e04" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>