<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: iraj zahedi</title>
    <description>The latest articles on DEV Community by iraj zahedi (@irajzahedi).</description>
    <link>https://dev.to/irajzahedi</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3536675%2F20fc05a2-5d38-454f-81b6-a302a33f7baa.jpg</url>
      <title>DEV Community: iraj zahedi</title>
      <link>https://dev.to/irajzahedi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/irajzahedi"/>
    <language>en</language>
    <item>
      <title>server log analyzer tools</title>
      <dc:creator>iraj zahedi</dc:creator>
      <pubDate>Mon, 29 Sep 2025 08:01:29 +0000</pubDate>
      <link>https://dev.to/irajzahedi/server-log-analyzer-tools-2k4j</link>
      <guid>https://dev.to/irajzahedi/server-log-analyzer-tools-2k4j</guid>
      <description>&lt;p&gt;A powerful, lightweight, single-file PHP script for real-time analysis of Linux server logs. This tool helps you quickly identify attacks, system errors, and security events through an interactive, graphical dashboard.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://blueserver.ir/blueserver-php-log-analyzer" rel="noopener noreferrer"&gt;server-log-analyzer-tools&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This analyzer works without a database, Composer, or any external dependencies, making it ideal for server administrators, web developers, and security specialists.&lt;/p&gt;

&lt;p&gt;✨ Key Features&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Interactive &amp;amp; Smart Dashboard
Tab-based Interface: Cleanly separates reports into "Live Events," "Statistics," and "Top Attackers."
Powerful Global Search: Instantly search for any term (like an IP address or error message) across all configured log files.
Graphical Charts (Google Charts): Visualize your data, including a geo-map of attack origins, an event timeline for the last 24 hours, and a breakdown of event types.
Smart, Clickable Links: Click directly on an attacker's IP to view a comprehensive list of all their logged activities.
Advanced Filtering: Easily toggle the visibility of specific log types to focus on what matters.&lt;/li&gt;
&lt;li&gt;Comprehensive Security Analysis
Web Server (Apache): Detects access errors, SSL negotiation issues, and PHP-FPM-related faults.
Web Application Firewall (ModSecurity): Displays attacks that have been identified and blocked by the WAF.
Services (SSH, Email): Identifies Brute-Force attacks against SSH and email servers (Dovecot/Exim).
Security Software (Fail2ban): Monitors Fail2ban's performance, showing banned/unbanned IPs and any operational errors.
Web Attacks: Detects common attack attempts like SQL Injection, XSS, Path Traversal, and Command Injection.&lt;/li&gt;
&lt;li&gt;System Health Monitoring
Critical Kernel Errors: Identifies Kernel Panics and hardware I/O errors that may indicate serious server issues.
Resource Management: Detects out-of-memory problems (OOM Killer) and processes that were forcibly terminated.
System Events: Logs server reboots and the use of privileged commands (Sudo).
🚀 Installation &amp;amp; Setup
Setup is incredibly simple. Just upload and configure a single file.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Prerequisites&lt;br&gt;
A Linux server (VPS or Dedicated).&lt;br&gt;
PHP version 7.0 or higher.&lt;br&gt;
SSH access to the server.&lt;br&gt;
Installation Steps&lt;br&gt;
Upload the Script: Upload the log_analyzer.php file to your desired path on the server (e.g., within a subdomain like analyzer.yourdomain.com).&lt;/p&gt;

&lt;p&gt;Configure Log Paths: Open the script and, in the configuration section, edit the $logFiles array to match your server's operating system. Uncomment the lines corresponding to the logs that exist on your server:&lt;/p&gt;

&lt;p&gt;$logFiles = [&lt;br&gt;
    // Example for a CentOS/RHEL server with Apache&lt;br&gt;
    '/var/log/httpd/access_log',&lt;br&gt;
    '/var/log/httpd/error_log',&lt;br&gt;
    '/var/log/secure',&lt;br&gt;
    '/var/log/messages',&lt;br&gt;
    '/var/log/maillog',&lt;br&gt;
    '/var/log/fail2ban.log',&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Example for a Debian/Ubuntu server with Apache
// '/var/log/apache2/access.log',
// '/var/log/apache2/error.log',
// '/var/log/auth.log',
// '/var/log/syslog',
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;];&lt;br&gt;
Set Permissions (Crucial Step): Your web server user (typically apache on CentOS or www-data on Ubuntu) needs permission to read these files. Run the following commands via SSH:&lt;/p&gt;

&lt;p&gt;Note: If setfacl is not installed, use sudo yum install acl or sudo apt-get install acl.&lt;/p&gt;

&lt;h1&gt;
  
  
  Example for CentOS/RHEL (apache user)
&lt;/h1&gt;

&lt;p&gt;sudo setfacl -m u:apache:r /var/log/messages /var/log/secure /var/log/maillog /var/log/fail2ban.log&lt;/p&gt;

&lt;h1&gt;
  
  
  Example for Debian/Ubuntu (www-data user)
&lt;/h1&gt;

&lt;p&gt;sudo setfacl -m u:www-data:r /var/log/syslog /var/log/auth.log /var/log/mail.log /var/log/fail2ban.log&lt;br&gt;
🔒 Secure the Script (Very Important!): This script displays sensitive information. You must restrict access to it with a password.&lt;/p&gt;

&lt;p&gt;Create a .htaccess file in the same directory as your script and add the following content (adjust the path to your password file):&lt;br&gt;
AuthType Basic&lt;br&gt;
AuthName "Restricted Area"&lt;br&gt;
AuthUserFile /path/to/your/.htpasswd&lt;br&gt;
Require valid-user&lt;br&gt;
Use the htpasswd command to create a password file (replace your_username with a username of your choice):&lt;br&gt;
htpasswd -c /path/to/your/.htpasswd your_username&lt;br&gt;
View the Report: Open the PHP file in your browser and log in with the username and password you just created.&lt;/p&gt;

</description>
      <category>tooling</category>
      <category>security</category>
      <category>php</category>
      <category>linux</category>
    </item>
    <item>
      <title>How to Automatically Detect Unauthorized File Changes in WordPress</title>
      <dc:creator>iraj zahedi</dc:creator>
      <pubDate>Mon, 29 Sep 2025 07:56:14 +0000</pubDate>
      <link>https://dev.to/irajzahedi/how-to-automatically-detect-unauthorized-file-changes-in-wordpress-1a5l</link>
      <guid>https://dev.to/irajzahedi/how-to-automatically-detect-unauthorized-file-changes-in-wordpress-1a5l</guid>
      <description>&lt;p&gt;I'd like to propose a how-to guide focused on a critical aspect of WordPress security: file integrity monitoring. The article will explain why it's important, the common pitfalls of manual checks, and provide a practical, automated solution using a lightweight, open-source tool.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Introduction: The Silent Threat to Your Website&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Briefly explain the problem: Hackers and malware often work by silently modifying core files, theme files, or plugin files to inject backdoors, SEO spam, or redirect users.&lt;/p&gt;

&lt;p&gt;Emphasize that many site owners don't realize they've been compromised until it's too late.&lt;/p&gt;

&lt;p&gt;State the goal of the article: To show how to set up an automated "early warning system" that alerts you the moment a file is changed.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Why File Integrity Monitoring is Essential&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Explain that it's a fundamental security practice, acting like a motion detector for your server.&lt;/p&gt;

&lt;p&gt;Quickly mention what types of changes are suspicious (e.g., a modified wp-config.php, a new .php file in wp-content/uploads, or changes to an inactive theme).&lt;/p&gt;

&lt;p&gt;Contrast this with other security measures like firewalls (which prevent entry) vs. monitoring (which detects if entry has already happened).&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The Challenge with Manual Checks&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Explain why manually checking files via FTP or File Manager is impractical.&lt;/p&gt;

&lt;p&gt;It's time-consuming, error-prone, and most importantly, it's not real-time. You might only check once a week, which gives an attacker plenty of time.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Automating the Process: A Practical Solution&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Introduce the concept of using an automated tool that runs on a schedule (e.g., via WP-Cron).&lt;/p&gt;

&lt;p&gt;Explain the core logic: The tool should scan the WordPress directory and identify files that have a "last modified" timestamp newer than the last scan.&lt;/p&gt;

&lt;p&gt;The crucial next step: Notification. Finding the change is only half the battle; you need to be told about it immediately.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;implementing a Real-Time Alert System with Telegram&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Explain why Telegram is a great channel for these alerts (it's free, fast, mobile-first, and has a simple Bot API).&lt;/p&gt;

&lt;p&gt;Introduce the open-source plugin as a ready-made solution that implements this exact logic: File Change Scanner with Telegram Notification.&lt;/p&gt;

&lt;p&gt;Mention that it's a lightweight, focused tool available on &lt;a href="https://blueserver.ir/blueserver-file-change-scanner-telegram-notifi-wp-plugin" rel="noopener noreferrer"&gt;wordpress File Change Scanner plugin&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Provide a step-by-step guide on how to set it up. This section will be the core "how-to" part of the article:&lt;/p&gt;

&lt;p&gt;Installation: How to install the plugin from the zip file.&lt;/p&gt;

&lt;p&gt;Getting Telegram Credentials (The Easy Way):&lt;/p&gt;

&lt;p&gt;Creating a bot with @ BotFather to get the Bot Token.&lt;/p&gt;

&lt;p&gt;Finding your Chat ID using a helper bot like @ userinfobot.&lt;/p&gt;

&lt;p&gt;Configuration: Showing where to paste these credentials in the plugin settings and how to use the "Send Test Message" button to verify it works.&lt;/p&gt;

&lt;p&gt;Scheduling: Setting the scan frequency (Hourly, Twice Daily, or Daily).&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What to Do When You Get an Alert&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Provide brief, actionable advice for the reader.&lt;/p&gt;

&lt;p&gt;Don't panic.&lt;/p&gt;

&lt;p&gt;Check the filename and path in the alert.&lt;/p&gt;

&lt;p&gt;Did you or another admin recently update a plugin or theme? If so, the change is likely legitimate.&lt;/p&gt;

&lt;p&gt;If the change was unexpected, investigate immediately. Check the file contents, revert it from a clean backup, and consider further security scans.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Summarize the main point: Proactive monitoring is far better than reactive cleanup.&lt;/p&gt;

&lt;p&gt;Reiterate that setting up a simple, automated system like this provides immense peace of mind for any WordPress site administrator.&lt;/p&gt;

</description>
      <category>wordpress</category>
      <category>monitoring</category>
      <category>security</category>
      <category>automation</category>
    </item>
  </channel>
</rss>
