<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Archiwa Network - soban</title>
	<atom:link href="https://soban.pl/category/network/feed/" rel="self" type="application/rss+xml" />
	<link>https://soban.pl/category/network/</link>
	<description>IT, Linux, Servers, Security</description>
	<lastBuildDate>Thu, 26 Feb 2026 13:49:39 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.1</generator>
	<item>
		<title>Proxy through nginx frontend to the second virtual server wordpress</title>
		<link>https://soban.pl/proxy-through-nginx-frontend-to-the-second-virtual-server-wordpress/</link>
		
		<dc:creator><![CDATA[soban]]></dc:creator>
		<pubDate>Sun, 07 Nov 2021 11:48:33 +0000</pubDate>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[Nginx]]></category>
		<category><![CDATA[Proxy]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">https://soban.pl/?p=315</guid>

					<description><![CDATA[<p>In a situation where we have one public IP address and we have many domains directed to that IP address, it is worth considering spreading the traffic to other servers. Proxmox, which allows you to create a pair of virtual machines, is perfect in such a situation. In my case, each virtual machine is separated [&#8230;]</p>
<p>Artykuł <a href="https://soban.pl/proxy-through-nginx-frontend-to-the-second-virtual-server-wordpress/">Proxy through nginx frontend to the second virtual server wordpress</a> pochodzi z serwisu <a href="https://soban.pl">soban</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>In a situation where we have one public IP address and we have many domains directed to that IP address, it is worth considering spreading the traffic to other servers. Proxmox, which allows you to create a pair of virtual machines, is perfect in such a situation. In my case, each virtual machine is separated and the traffic is broken down by nginx, which distributes the traffic to other servers. The virtual machine on my website will redirect traffic, I have the IP address for wordpress: <strong>10.10.11.105 </strong>on port <strong>80</strong>. In this case, no encryption is required, but the frontend itself, which manages the traffic, will present itself with encryption and security on port <strong>443</strong>.</p>



<p>Two machines with the following configuration will participate throughout the process:<br><strong>up-page</strong> IP: <strong>10.10.14.200</strong><br><strong>soban-pl</strong> IP: <strong>10.10.11.105</strong></p>



<p>So let&#8217;s move on to the frontend that distributes traffic to other machines.<br>The frontend is done by linux debian 11 (bullseye), in addition, I have the following entry in the repository (<strong>/etc/apt/sources.list</strong>):</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">#...
deb http://nginx.org/packages/debian/ bullseye nginx
deb-src http://nginx.org/packages/debian/ bullseye nginx</pre></div>



<p>To install nginx, run the following commands:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag"># apt update
# apt install nginx</pre></div>



<p>You should make sure that the traffic from the frontend has the appropriate port 80 transitions. You can read how to check the network transitions here: <strong><a href="https://soban.pl/check-network-connection-and-open-tcp-port-via-netcat/" target="_blank" rel="noreferrer noopener">Check network connection and open TCP port via netcat</a></strong>.</p>



<figure class="wp-block-image size-full"><img fetchpriority="high" decoding="async" width="469" height="154" src="https://soban.pl/wp-content/uploads/2021/11/image-18.png" alt="Screenshot of a terminal window showing a successful telnet connection to the IP address 10.10.11.105 on port 80, followed by the user exiting the telnet session with the 'quit' command." class="wp-image-317" srcset="https://soban.pl/wp-content/uploads/2021/11/image-18.png 469w, https://soban.pl/wp-content/uploads/2021/11/image-18-300x99.png 300w" sizes="(max-width: 469px) 100vw, 469px" /></figure>



<p>The configuration of the frontend that distributes the traffic is as follows (<strong>/etc/nginx/conf.d/soban.pl.ssl.conf</strong>):</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">upstream soban-pl-webservers {
    server 10.10.11.105:80;
}

server {
    if ($host = www.soban.pl) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


    if ($host = soban.pl) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


        listen 80;
        server_name soban.pl www.soban.pl;
        return 301 https://soban.pl$request_uri;
}

server {
    listen 443 ssl http2;
    server_name  www.soban.pl;
    ssl_certificate /etc/letsencrypt/live/www.soban.pl/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/www.soban.pl/privkey.pem; # managed by Certbot
    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_prefer_server_ciphers on;
    ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
    return 301 https://soban.pl$request_uri;
}

server {
    listen 443 ssl http2;
    server_name  soban.pl _;
    ssl_certificate /etc/letsencrypt/live/soban.pl/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/soban.pl/privkey.pem; # managed by Certbot
    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_prefer_server_ciphers on;
    ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
}

    location / {
        access_log /var/log/nginx/access-soban.pl.log;
        error_log /var/log/nginx/error-soban.pl.log;
        proxy_pass http://soban-pl-webservers;
        proxy_redirect https://soban-pl-webservers http://soban-pl-webservers;
        expires off;

        proxy_read_timeout       3500;
        proxy_connect_timeout    3250;

        proxy_set_header   X-Real-IP          $remote_addr;
        proxy_set_header   Host               $host;
        proxy_set_header   X-Forwarded-For    $proxy_add_x_forwarded_for;
        proxy_set_header   X-Forwarded-Proto  https;
        proxy_set_header   SSL_PROTOCOL $ssl_protocol;
        proxy_set_header   SSL_CLIENT_CERT $ssl_client_cert;
        proxy_set_header   SSL_CLIENT_VERIFY $ssl_client_verify;
        proxy_set_header   SSL_SERVER_S_DN $ssl_client_s_dn;

                proxy_set_header X-Scheme $scheme;
                proxy_ssl_session_reuse off;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";
    }
      location ~ ^/(wp-admin|wp-login\.php) {
            auth_basic "Restricted";
            auth_basic_user_file /etc/nginx/conf.d/htpasswd;
           proxy_pass http://soban-pl-webservers;
           proxy_redirect https://soban-pl-webservers http://soban-pl-webservers;
           expires off;
           proxy_next_upstream error timeout invalid_header http_500 http_502 http_503;
           proxy_set_header        Host            $host;
           proxy_set_header        X-Real-IP       $remote_addr;
           proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
      }

}</pre></div>



<p>Configuration of the above-mentioned wordpress, additional authorization is also set when you try to log in to wp-admin, you can read about it here: <strong><a href="https://soban.pl/more-security-wp-admin-in-nginx/" target="_blank" rel="noreferrer noopener">More security wp-admin in nginx</a></strong>. </p>



<p>In the next step, check if the nginx configuration is correct by: </p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag"># service nginx configtest</pre></div>



<figure class="wp-block-image size-full"><img decoding="async" width="808" height="76" src="https://soban.pl/wp-content/uploads/2021/11/image-17.png" alt="Terminal output displaying a successful nginx configuration test with the messages: 'nginx: the configuration file /etc/nginx/nginx.conf syntax is ok' and 'nginx: configuration file /etc/nginx/nginx.conf test is successful'." class="wp-image-316" srcset="https://soban.pl/wp-content/uploads/2021/11/image-17.png 808w, https://soban.pl/wp-content/uploads/2021/11/image-17-300x28.png 300w, https://soban.pl/wp-content/uploads/2021/11/image-17-768x72.png 768w" sizes="(max-width: 808px) 100vw, 808px" /></figure>



<p>If everything is fine, restart nginx:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag"># service nginx restart</pre></div>



<p>In a virtual machine with nginx it should also be installed. This is the same as debian linux 11 (bullseye), so the respository should look like this:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">#...
deb http://nginx.org/packages/debian/ bullseye nginx
deb-src http://nginx.org/packages/debian/ bullseye nginx</pre></div>



<p>Just installing nginx looks the same as on a machine that acts as a proxy.</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag"># apt update
# apt install nginx</pre></div>



<p>All configuration is in <strong>/etc/nginx/conf.d/soban.pl.conf</strong>:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">server {
    listen   80;

   client_max_body_size 20M;

    server_name soban.pl www.soban.pl;
    access_log /var/log/nginx/access-soban.pl.log; #access logi
    error_log /var/log/nginx/error-soban.log; # error logi
    port_in_redirect off;
    set_real_ip_from  10.10.11.105;
    real_ip_header    X-Forwarded-For;
    real_ip_recursive on;
       root /home/produkcja/wordpress/;
       index index.html index.php;

if ($host ~* ^www\.(.*))
{
    set $host_without_www $1;
    rewrite ^/(.*)$ $scheme://$host_without_www/$1 permanent;
}

    error_page 404 /index.php;


        location ~ \.php$ {
                root /home/produkcja/wordpress/; # dir where is wordpress
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_pass unix:/var/run/php/php-fpm.sock;
                fastcgi_index index.php;
                include fastcgi_params;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

        }

        location / {
                try_files $uri $uri/ /index.php?$args;
        }
        location = /sitemap.xml {
                rewrite ^/sitemap(-+([a-zA-Z0-9_-]+))?\.xml$ "/index.php?xml_sitemap=params=$2" last;
                rewrite ^/sitemap(-+([a-zA-Z0-9_-]+))?\.xml\.gz$ "/index.php?xml_sitemap=params=$2;zip=true" last;
                rewrite ^/sitemap(-+([a-zA-Z0-9_-]+))?\.html$ "/index.php?xml_sitemap=params=$2;html=true" last;
                rewrite ^/sitemap(-+([a-zA-Z0-9_-]+))?\.html.gz$ "/index.php?xml_sitemap=params=$2;html=true;zip=true" last;
       }

location = /favicon.ico {
  return 204;
  access_log     off;
  log_not_found  off;
}

location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ {
expires 365d;
        }location ~* \.(pdf)$ {
expires 30d;
}

}</pre></div>



<p>Also in this case, check the correctness of the nginx service configuration:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag"># service nginx configtest</pre></div>



<figure class="wp-block-image size-full"><img decoding="async" width="802" height="66" src="https://soban.pl/wp-content/uploads/2021/11/image-19.png" alt="" class="wp-image-318" srcset="https://soban.pl/wp-content/uploads/2021/11/image-19.png 802w, https://soban.pl/wp-content/uploads/2021/11/image-19-300x25.png 300w, https://soban.pl/wp-content/uploads/2021/11/image-19-768x63.png 768w" sizes="(max-width: 802px) 100vw, 802px" /></figure>



<p>Everything looks fine, so let&#8217;s move on to restarting the service:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag"># service nginx restart</pre></div>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="806" height="71" src="https://soban.pl/wp-content/uploads/2021/11/image-20.png" alt="" class="wp-image-319" srcset="https://soban.pl/wp-content/uploads/2021/11/image-20.png 806w, https://soban.pl/wp-content/uploads/2021/11/image-20-300x26.png 300w, https://soban.pl/wp-content/uploads/2021/11/image-20-768x68.png 768w" sizes="auto, (max-width: 806px) 100vw, 806px" /></figure>



<p>If the whole configuration was done correctly, the page should be directed without encrypted traffic to the virtual machine with wordpress. A wordpress service with nginx is not the only one that can be hosted or proxied. We can direct traffic from nginx to e.g. jboss, apacha and all other web services. Of course, this requires a corresponding modification of the configuration presented above, but the general outline of the concept as an nginx proxy has been presented. You should also remember about the appropriate configuration of keys and certificates. In my case let&#8217;s encrypt works perfectly for this.</p>
<p>Artykuł <a href="https://soban.pl/proxy-through-nginx-frontend-to-the-second-virtual-server-wordpress/">Proxy through nginx frontend to the second virtual server wordpress</a> pochodzi z serwisu <a href="https://soban.pl">soban</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Improving encryption on old red hat 5 by new Oracle Linux 7 using apache mod_proxy</title>
		<link>https://soban.pl/improving-encryption-on-old-red-hat-5-by-new-oracle-linux-7-using-apache-mod_proxy/</link>
		
		<dc:creator><![CDATA[soban]]></dc:creator>
		<pubDate>Sat, 06 Nov 2021 13:54:17 +0000</pubDate>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[Oracle Linux]]></category>
		<category><![CDATA[Proxy]]></category>
		<category><![CDATA[Red Hat 5]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[SSL]]></category>
		<guid isPermaLink="false">https://soban.pl/?p=308</guid>

					<description><![CDATA[<p>There are situations when we need to increase the encryption level on the old system &#8211; according to the PCI audit requirements. However, the old system is no longer supported, so updating the encryption level is not possible. This is not a recommended solution, because we should try to transfer the application to a new [&#8230;]</p>
<p>Artykuł <a href="https://soban.pl/improving-encryption-on-old-red-hat-5-by-new-oracle-linux-7-using-apache-mod_proxy/">Improving encryption on old red hat 5 by new Oracle Linux 7 using apache mod_proxy</a> pochodzi z serwisu <a href="https://soban.pl">soban</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>There are situations when we need to increase the encryption level on the old system &#8211; according to the PCI audit requirements. However, the old system is no longer supported, so updating the encryption level is not possible. This is not a recommended solution, because we should try to transfer the application to a new system. After all, when we have little time, it is possible to hide the old version of the system and allow only the new machine to move to it. In this particular example, we will use mod_proxy as a proxy to redirect traffic to the old machine, while using iptables we will only allow communication with the new machine. It is not a recommended solution, but it works and I would like to present it here. The systems that I will be basing on in this example are the old <strong>red hat 5</strong> and the new <strong>oracle linux 7</strong>. Recently, it has become very important to use a minimum of <strong>tls 1.2</strong> and none below for banking transactions. Let&#8217;s start with the proxy server configuration <strong>oracle linux 7</strong>.</p>



<p>As of this writing, the addressing is as follows:<br><strong>new_machine</strong> IP: <strong>10.10.14.100</strong><br><strong>old_machine</strong> IP: <strong>10.10.14.101</strong><br>Traffic will be routed on port 443 from new_machine to old_machine.</p>



<p>Before we go to proxy configuration, please make sure there are network transitions from new_machine (10.10.14.100) to old_machine (10.10.14.101) to port 443. You can read how to verify network connections here: <strong><a href="https://soban.pl/check-network-connection-and-open-tcp-port-via-netcat/" target="_blank" rel="noreferrer noopener">check network connection and open tcp port via netcat</a></strong>.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="544" height="51" src="https://soban.pl/wp-content/uploads/2021/11/image-13.png" alt="" class="wp-image-309" srcset="https://soban.pl/wp-content/uploads/2021/11/image-13.png 544w, https://soban.pl/wp-content/uploads/2021/11/image-13-300x28.png 300w" sizes="auto, (max-width: 544px) 100vw, 544px" /></figure>



<p>We go to the installation of apache and mod_proxy:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag"># yum install httpd mod_proxy</pre></div>



<p>After installing apache, go to the edition:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag"># vi /etc/httpd/conf.d/ssl.conf</pre></div>



<p>Below are the news on the check level, what are the updates, and ip on the next service update:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">&lt;VirtualHost _default_:443&gt;
SSLProtocol -all +TLSv1.2
SSLCipherSuite ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:!NULL:!RC4:!RC2:!DES:!3DES:!SHA:!SHA256:!SHA384:!MD5+HIGH:+MEDIUM:!KRB5
#…
&lt;IfModule mod_proxy.c&gt;
SSLProxyProtocol all
SSLProxyEngine on
SSLProxyCheckPeerCN off
SSLProxyCheckPeerName off
SSLProxyCheckPeerExpire off
ProxyRequests On
    &lt;Proxy *&gt;
        Require all granted
    &lt;/Proxy&gt;
    # backend server and forwarded path
    ProxyPass / https://10.10.14.101/
    ProxyPassReverse / https://10.10.14.101/
&lt;/IfModule&gt;
&lt;/VirtualHost&gt;</pre></div>



<p>In order to verify the correctness of apache configuration, you can issue a command that will check it:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag"># service httpd configtest</pre></div>



<p>If the apache configuration is correct, we can proceed to reloading apache:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag"># service httpd restart</pre></div>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="621" height="50" src="https://soban.pl/wp-content/uploads/2021/11/image-14.png" alt="" class="wp-image-310" srcset="https://soban.pl/wp-content/uploads/2021/11/image-14.png 621w, https://soban.pl/wp-content/uploads/2021/11/image-14-300x24.png 300w" sizes="auto, (max-width: 621px) 100vw, 621px" /></figure>



<p>At this point, we have a configured proxy connection. Before we move on to limiting traffic with iptables, I suggest you go to the site &#8211; with the new mod_proxy configured and test if everything is working properly and if there are any problems with the application.</p>



<p>Once everything is working fine, the network transitions are there, we can go to the iptables configuration for red hat 5. Let&#8217;s start by checking the system version:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag"># cat /etc/redhat-release</pre></div>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="663" height="48" src="https://soban.pl/wp-content/uploads/2021/11/image-15.png" alt="" class="wp-image-311" srcset="https://soban.pl/wp-content/uploads/2021/11/image-15.png 663w, https://soban.pl/wp-content/uploads/2021/11/image-15-300x22.png 300w" sizes="auto, (max-width: 663px) 100vw, 663px" /></figure>



<p>Now we are going to prepare iptables so that the network traffic is available on port 443 from the new_machine (10.10.14.100). To do this, edit the file <strong>/etc/sysconfig/iptables</strong>:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag"># Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp --dport 443 -s 10.10.14.100 -j ACCEPT
-A INPUT -p tcp --dport 443 -j DROP
-A INPUT -p tcp --dport 80 -j DROP
-A INPUT -j ACCEPT
COMMIT</pre></div>



<p>After iptables settings are correct, we can reload the service:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag"># /etc/init.d/iptables restart</pre></div>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="886" height="153" src="https://soban.pl/wp-content/uploads/2021/11/image-16.png" alt="" class="wp-image-313" srcset="https://soban.pl/wp-content/uploads/2021/11/image-16.png 886w, https://soban.pl/wp-content/uploads/2021/11/image-16-300x52.png 300w, https://soban.pl/wp-content/uploads/2021/11/image-16-768x133.png 768w" sizes="auto, (max-width: 886px) 100vw, 886px" /></figure>



<p>In this way, we managed to cover up the weak encryption by proxying and diverting traffic to the new machine. This is not a recommended solution and you should try to transfer the application to a new environment compatible with the new system. However, in crisis situations, we can use this solution. Network traffic is not allowed by other IP addresses, so scanners will not be able to detect weak encryption on the old machine, and users using the old environment will not be able to use it. This does not change the fact that weak encryption is still set in the old environment and needs to be corrected. The example I gave is for the old <strong>red hat 5</strong> and the new <strong>oracle linux 7</strong>, but it can be assumed that a similar solution and configuration is possible for other versions of the system.</p>
<p>Artykuł <a href="https://soban.pl/improving-encryption-on-old-red-hat-5-by-new-oracle-linux-7-using-apache-mod_proxy/">Improving encryption on old red hat 5 by new Oracle Linux 7 using apache mod_proxy</a> pochodzi z serwisu <a href="https://soban.pl">soban</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>iftop as a good network traffic monitoring tool</title>
		<link>https://soban.pl/iftop-as-a-good-network-traffic-monitoring-tool/</link>
		
		<dc:creator><![CDATA[soban]]></dc:creator>
		<pubDate>Thu, 04 Nov 2021 15:47:42 +0000</pubDate>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[iftop]]></category>
		<category><![CDATA[Kali]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[Security]]></category>
		<guid isPermaLink="false">https://soban.pl/?p=285</guid>

					<description><![CDATA[<p>iftop is a command-line tool for real-time network bandwidth monitoring. It displays a continuously updated list of network connections along with the amount of data transferred between them. Connections are shown in a table format and can be sorted by bandwidth usage. iftop provides various filtering options, allowing you to limit the output to specific [&#8230;]</p>
<p>Artykuł <a href="https://soban.pl/iftop-as-a-good-network-traffic-monitoring-tool/">iftop as a good network traffic monitoring tool</a> pochodzi z serwisu <a href="https://soban.pl">soban</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p><strong>iftop</strong> is a command-line tool for real-time network bandwidth monitoring. It displays a continuously updated list of network connections along with the amount of data transferred between them. Connections are shown in a table format and can be sorted by bandwidth usage.</p>



<p>iftop provides various filtering options, allowing you to limit the output to specific hosts, networks, or ports. It supports IPv6 and can display source and destination IP addresses, port numbers, and protocols.</p>



<p>It is particularly useful for monitoring traffic in real time and identifying which services or hosts consume the most bandwidth. It can also help detect network performance issues and assist in troubleshooting.</p>



<p>Overall, iftop is a lightweight yet powerful tool and a valuable addition to any network administrator’s toolkit.</p>



<p>One of the most useful network monitoring tools I use is <strong>iftop</strong>. It becomes especially helpful when the network link is saturated. In practice, it can also help detect abnormal traffic patterns, including DoS attacks. In the example below, I will transfer a large file to a remote machine with a bandwidth limit and observe the traffic using iftop.</p>



<p>First, install iftop on the local machine (in this case, Kali Linux):</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block">
<pre class="urvanov-syntax-highlighter-plain-tag"># apt install iftop</pre>
</div>



<figure class="wp-block-image size-full">
<img loading="lazy" decoding="async" width="904" height="422" src="https://soban.pl/wp-content/uploads/2021/11/image-4.png" alt="iftop installation on kali linux" class="wp-image-286" srcset="https://soban.pl/wp-content/uploads/2021/11/image-4.png 904w, https://soban.pl/wp-content/uploads/2021/11/image-4-300x140.png 300w, https://soban.pl/wp-content/uploads/2021/11/image-4-768x359.png 768w" sizes="auto, (max-width: 904px) 100vw, 904px" />
</figure>



<p>The distribution does not matter — iftop is available in most Linux repositories, including Debian.</p>



<p>Now install iftop on the remote machine (Debian Linux):</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block">
<pre class="urvanov-syntax-highlighter-plain-tag"># apt install iftop</pre>
</div>



<figure class="wp-block-image size-full">
<img loading="lazy" decoding="async" width="928" height="396" src="https://soban.pl/wp-content/uploads/2021/11/image-6.png" alt="iftop installation on debian linux" class="wp-image-288" srcset="https://soban.pl/wp-content/uploads/2021/11/image-6.png 928w, https://soban.pl/wp-content/uploads/2021/11/image-6-300x128.png 300w, https://soban.pl/wp-content/uploads/2021/11/image-6-768x328.png 768w" sizes="auto, (max-width: 928px) 100vw, 928px" />
</figure>



<p>To start monitoring network traffic, run iftop with the parameters <code>-PpNn</code>:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block">
<pre class="urvanov-syntax-highlighter-plain-tag"># iftop -PpNn</pre>
</div>



<figure class="wp-block-image size-full">
<img loading="lazy" decoding="async" width="963" height="509" src="https://soban.pl/wp-content/uploads/2021/11/image-9.png" alt="iftop running example" class="wp-image-292" srcset="https://soban.pl/wp-content/uploads/2021/11/image-9.png 963w, https://soban.pl/wp-content/uploads/2021/11/image-9-300x159.png 300w, https://soban.pl/wp-content/uploads/2021/11/image-9-768x406.png 768w" sizes="auto, (max-width: 963px) 100vw, 963px" />
</figure>



<p>Since I am connected to the remote machine via SSH, I can see my active SSH session in the traffic list.</p>



<p>Now let’s go back to the local machine and create a large file:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block">
<pre class="urvanov-syntax-highlighter-plain-tag"># truncate -s 1G 1G-file.txt</pre>
</div>



<p>After creating the 1GB file, let’s transfer it to the remote machine with a bandwidth limit:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block">
<pre class="urvanov-syntax-highlighter-plain-tag"># scp -l 800 -P2222 1G-file.txt soban@soban.pl:~</pre>
</div>



<figure class="wp-block-image size-full">
<img loading="lazy" decoding="async" width="960" height="128" src="https://soban.pl/wp-content/uploads/2021/11/image-10.png" alt="scp transfer with bandwidth limit" class="wp-image-293" srcset="https://soban.pl/wp-content/uploads/2021/11/image-10.png 960w, https://soban.pl/wp-content/uploads/2021/11/image-10-300x40.png 300w, https://soban.pl/wp-content/uploads/2021/11/image-10-768x102.png 768w" sizes="auto, (max-width: 960px) 100vw, 960px" />
</figure>



<p>In this example, the <code>-l 800</code> option limits the transfer rate to 800 Kbit/s. To convert this to KB/s, divide by 8. That gives approximately 100 KB/s (800 / 8 = 100).</p>



<p>To learn more about <code>scp</code> and secure file transfers over SSH, see: <a href="https://soban.pl/securely-copy-files-scp-tool-to-copying-files-by-ssh/" target="_blank" rel="noreferrer noopener"><strong>Securely Copy Files (scp) tool for copying files via SSH</strong></a>.</p>



<p>When sending the file, the traffic on the local machine (outgoing traffic) looks like this:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block">
<pre class="urvanov-syntax-highlighter-plain-tag"># iftop -PpNn</pre>
</div>



<figure class="wp-block-image size-full">
<img loading="lazy" decoding="async" width="957" height="354" src="https://soban.pl/wp-content/uploads/2021/11/image-11.png" alt="iftop outgoing traffic" class="wp-image-294" srcset="https://soban.pl/wp-content/uploads/2021/11/image-11.png 957w, https://soban.pl/wp-content/uploads/2021/11/image-11-300x111.png 300w, https://soban.pl/wp-content/uploads/2021/11/image-11-768x284.png 768w" sizes="auto, (max-width: 957px) 100vw, 957px" />
</figure>



<p>At the same time, on the remote machine (incoming traffic) it looks like this:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block">
<pre class="urvanov-syntax-highlighter-plain-tag"># iftop -PpNn</pre>
</div>



<figure class="wp-block-image size-full">
<img loading="lazy" decoding="async" width="964" height="501" src="https://soban.pl/wp-content/uploads/2021/11/image-12.png" alt="iftop incoming traffic" class="wp-image-295" srcset="https://soban.pl/wp-content/uploads/2021/11/image-12.png 964w, https://soban.pl/wp-content/uploads/2021/11/image-12-300x156.png 300w, https://soban.pl/wp-content/uploads/2021/11/image-12-768x399.png 768w" sizes="auto, (max-width: 964px) 100vw, 964px" />
</figure>



<p>As you can see, this approach allows you to observe both outgoing and incoming traffic in real time. Although iftop is simple, it provides powerful visibility into live network activity.</p>



<p>During brute-force attempts, you will usually observe many short-lived connections. In contrast, a DoS attack aims to saturate the bandwidth, which results in high incoming traffic. However, there are situations where traffic spikes are legitimate. In such cases, you may consider limiting connection speed — tools like iptables can help manage that effectively.</p>
<p>Artykuł <a href="https://soban.pl/iftop-as-a-good-network-traffic-monitoring-tool/">iftop as a good network traffic monitoring tool</a> pochodzi z serwisu <a href="https://soban.pl">soban</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Check network connection and open TCP port via netcat</title>
		<link>https://soban.pl/check-network-connection-and-open-tcp-port-via-netcat/</link>
		
		<dc:creator><![CDATA[soban]]></dc:creator>
		<pubDate>Thu, 21 Oct 2021 10:40:49 +0000</pubDate>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[Security]]></category>
		<guid isPermaLink="false">https://soban.pl/?p=197</guid>

					<description><![CDATA[<p>Netcat, also known as &#8220;nc,&#8221; is a versatile networking tool that is commonly used in Linux and other Unix-like operating systems. It is a command-line utility that can be used for various network-related tasks, such as port scanning, file transfer, and even as a lightweight web server. The primary function of Netcat is to create [&#8230;]</p>
<p>Artykuł <a href="https://soban.pl/check-network-connection-and-open-tcp-port-via-netcat/">Check network connection and open TCP port via netcat</a> pochodzi z serwisu <a href="https://soban.pl">soban</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Netcat, also known as &#8220;nc,&#8221; is a versatile networking tool that is commonly used in Linux and other Unix-like operating systems. It is a command-line utility that can be used for various network-related tasks, such as port scanning, file transfer, and even as a lightweight web server.</p>



<p>The primary function of Netcat is to create network connections between two hosts, allowing data to be transferred between them. It can establish a connection as a client or a server, and it supports both TCP and UDP protocols. This makes it useful for testing network services, troubleshooting network issues, and performing security assessments.</p>



<p>Netcat can be used to scan for open ports on a remote host, allowing system administrators to identify potential security vulnerabilities. It can also be used to transfer files between hosts, similar to the way that the &#8220;cp&#8221; command works in Linux. Additionally, it can be used to create a simple web server, allowing files to be served over HTTP.</p>



<p>One of the key features of Netcat is its ability to operate in both interactive and non-interactive modes. In interactive mode, it acts like a chat program, allowing users to communicate with each other in real-time. In non-interactive mode, it can be used as a background process that quietly sends or receives data without any user interaction.</p>



<p>Overall, Netcat is a powerful and flexible tool that can be used for a wide range of networking tasks. Its simplicity and ease of use make it a popular choice among system administrators, network engineers, and security professionals.</p>



<p>Sometimes network connections are blocked by various network devices. In the verification of the connection over TCP, we can use, for example, telnet. After all, before we start a server-side service like jboss, we can use a simple utility like netcat to open the port.</p>



<p>In this example we will be using two machines. However, one of them is &#8220;<strong>host-soban-pl</strong>&#8221; with the IP address: <strong>10.10.14.100</strong>:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">$ ip a</pre></div>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="241" src="https://soban.pl/wp-content/uploads/2021/10/image-66-1024x241.png" alt="" class="wp-image-208" srcset="https://soban.pl/wp-content/uploads/2021/10/image-66-1024x241.png 1024w, https://soban.pl/wp-content/uploads/2021/10/image-66-300x71.png 300w, https://soban.pl/wp-content/uploads/2021/10/image-66-768x181.png 768w, https://soban.pl/wp-content/uploads/2021/10/image-66.png 1249w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p> The second is &#8220;<strong>soban-pl</strong>&#8221; with the IP address: <strong>10.10.11.105</strong>:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag"># ip a</pre></div>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="235" src="https://soban.pl/wp-content/uploads/2021/10/image-67-1024x235.png" alt="" class="wp-image-209" srcset="https://soban.pl/wp-content/uploads/2021/10/image-67-1024x235.png 1024w, https://soban.pl/wp-content/uploads/2021/10/image-67-300x69.png 300w, https://soban.pl/wp-content/uploads/2021/10/image-67-768x176.png 768w, https://soban.pl/wp-content/uploads/2021/10/image-67.png 1246w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>Below, for example, I will show you how to check an already open tcp connection and one that is closed. On the other side, on port 80, I have an open port with nginx:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">$ telnet 10.10.11.105 80</pre></div>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="558" height="157" src="https://soban.pl/wp-content/uploads/2021/10/image-56.png" alt="" class="wp-image-198" srcset="https://soban.pl/wp-content/uploads/2021/10/image-56.png 558w, https://soban.pl/wp-content/uploads/2021/10/image-56-300x84.png 300w" sizes="auto, (max-width: 558px) 100vw, 558px" /></figure>



<p>Nmap below confirms port opening, additionally identified the service as http:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">$ nmap 10.10.11.105 -p 80</pre></div>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="787" height="204" src="https://soban.pl/wp-content/uploads/2021/10/image-57.png" alt="" class="wp-image-199" srcset="https://soban.pl/wp-content/uploads/2021/10/image-57.png 787w, https://soban.pl/wp-content/uploads/2021/10/image-57-300x78.png 300w, https://soban.pl/wp-content/uploads/2021/10/image-57-768x199.png 768w" sizes="auto, (max-width: 787px) 100vw, 787px" /></figure>



<p>The conclusion is that the service has network transitions and you can correctly connect over TCP. Now it will try to open a connection that does not exist, e.g. on port 81.</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">$ telnet 10.10.11.105 81</pre></div>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="744" height="72" src="https://soban.pl/wp-content/uploads/2021/10/image-58.png" alt="" class="wp-image-200" srcset="https://soban.pl/wp-content/uploads/2021/10/image-58.png 744w, https://soban.pl/wp-content/uploads/2021/10/image-58-300x29.png 300w" sizes="auto, (max-width: 744px) 100vw, 744px" /></figure>



<p>As you can see, the connection is not possible because the port is closed. The assumption is that the port may be open, but for example the firewall blocks it. Then you need to set the appropriate rules on it.</p>



<p>After all, in this case I know that the firewall does not block anything, so it will try to open the port with netcat. First we need to install netcat in debian, it is done like this:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag"># apt install netcat-traditional</pre></div>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="350" src="https://soban.pl/wp-content/uploads/2021/10/image-59-1024x350.png" alt="" class="wp-image-201" srcset="https://soban.pl/wp-content/uploads/2021/10/image-59-1024x350.png 1024w, https://soban.pl/wp-content/uploads/2021/10/image-59-300x103.png 300w, https://soban.pl/wp-content/uploads/2021/10/image-59-768x263.png 768w, https://soban.pl/wp-content/uploads/2021/10/image-59.png 1175w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>Now let&#8217;s move on to running netcat on port 81:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag"># netcat -l -p 81 &amp;</pre></div>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="427" height="45" src="https://soban.pl/wp-content/uploads/2021/10/image-60.png" alt="" class="wp-image-202" srcset="https://soban.pl/wp-content/uploads/2021/10/image-60.png 427w, https://soban.pl/wp-content/uploads/2021/10/image-60-300x32.png 300w" sizes="auto, (max-width: 427px) 100vw, 427px" /></figure>



<p>In this case, I specially gave the command &#8216;&amp;&#8217; at the end to leave the netcat process in the background. At this point, netcat is listening on port 81.</p>



<p>Now we can proceed to checking the correctness of the connection with the use of telnet:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">$ telnet 10.10.11.105 81</pre></div>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="648" height="90" src="https://soban.pl/wp-content/uploads/2021/10/image-61.png" alt="" class="wp-image-203" srcset="https://soban.pl/wp-content/uploads/2021/10/image-61.png 648w, https://soban.pl/wp-content/uploads/2021/10/image-61-300x42.png 300w" sizes="auto, (max-width: 648px) 100vw, 648px" /></figure>



<p>In the meantime, on the server machine, we can use the netstat tool to verify the connection and check from which machine the traffic is coming:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="92" src="https://soban.pl/wp-content/uploads/2021/10/image-68-1024x92.png" alt="" class="wp-image-210" srcset="https://soban.pl/wp-content/uploads/2021/10/image-68-1024x92.png 1024w, https://soban.pl/wp-content/uploads/2021/10/image-68-300x27.png 300w, https://soban.pl/wp-content/uploads/2021/10/image-68-768x69.png 768w, https://soban.pl/wp-content/uploads/2021/10/image-68.png 1026w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>As you can see, a correct connection from the 10.10.14.100 host has been established with the server on 10.10.11.105 on port 81.</p>



<p>To end the call, hit &#8216;<strong>^]</strong>&#8216; (<strong>ctrl +]</strong>), then type quit and enter.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="560" height="157" src="https://soban.pl/wp-content/uploads/2021/10/image-65.png" alt="" class="wp-image-207" srcset="https://soban.pl/wp-content/uploads/2021/10/image-65.png 560w, https://soban.pl/wp-content/uploads/2021/10/image-65-300x84.png 300w" sizes="auto, (max-width: 560px) 100vw, 560px" /></figure>



<p>In this way, we can verify the correctness of the network connection and whether any firewall or other network problem is an obstacle to its correct establishment. Netcat is a very powerful and useful tool, you can use it to transfer files etc. Netstat is also very useful in situations where network congestion occurs and one of the hosts is attacked. It is then easy to notice that a large number of network connections are made.</p>
<p>Artykuł <a href="https://soban.pl/check-network-connection-and-open-tcp-port-via-netcat/">Check network connection and open TCP port via netcat</a> pochodzi z serwisu <a href="https://soban.pl">soban</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
