• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here:Home » WordPress Security : Apache2 Module to Log HTTP POST Method

By Abhishek Ghosh March 14, 2019 6:18 pm Updated on March 14, 2019

WordPress Security : Apache2 Module to Log HTTP POST Method

Advertisement

Earlier we discussed about the HTTP POST method. Technically We Should Log HTTP Request Methods. Here is How to Apache Module to Log HTTP POST Method, As Example For WordPress Installation. After examination of few weeks log, we can block the malicious HTTP POST requests. This guide is for those who have installed Apache HTTPD server using our method.

Apache2 Module to Log HTTP POST Method

We say apache2 instead of apache to remind that some of the commands are with apache2 since first version of Apache 2.x. We are talking about Debian (Ubuntu) system. CentOS, REHL will have different commands.

 

How to Install Apache Module to Log HTTP POST Method

 

We have few modules for consideration. Two of them are official and has some documentation. First is mod_dumpio :

Advertisement

---

Vim
1
https://httpd.apache.org/docs/2.4/en/mod/mod_dumpio.html

Second is forensic log module (for other needs in depth) :

Vim
1
https://httpd.apache.org/docs/2.4/mod/mod_log_forensic.html

Third is mod_security, we already discussed about mod_security with fail2ban. With mod_security mudule we can use this format of config to catch POST :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# Enable the module.
SecRuleEngine On
SecAuditEngine on
 
# Setup logging in a dedicated file.
SecAuditLog /var/log/httpd/website-audit.log
# Allow it to access requests body.
SecRequestBodyAccess on
SecAuditLogParts ABIFHZ
 
# Setup default action.
SecDefaultAction "nolog,noauditlog,allow,phase:2"
 
# Define the rule that will log the content of POST requests.
SecRule REQUEST_METHOD "^POST$" "chain,allow,phase:2,id:123"
SecRule REQUEST_URI ".*" "auditlog

Forth is this module on GitHub :

Vim
1
https://github.com/danghvu/mod_dumpost

Normally Apache’s mod_dumpio. But it may conflict with other modules. Be careful for obvious reasons.
Note that mod_dumpio stops logging binary payloads at the first null character. For a multipart/form-data upload of a gzip’d file will probably only show the first few bytes with mod_dumpio. Also note that Apache might not mention this module even when it’s present in the modules folder. Just manually adding LoadModule will work fine.

SSH to your server. You can list, get info of the modules with these commands :

Vim
1
2
3
4
5
6
7
8
#
apache2ctl -M
#
sudo apache2ctl -M | sort
# Enabled modules
ls /etc/apache2/mods-enabled/
#  Available modules
ls /etc/apache2/mods-available/

We can install the official modules with the below format of command :

Vim
1
2
3
#
sudo apt-get install [module-name]
#

To enable the mod_dumpio module, it should be loaded in to your running Apache configuration. Logging can then be enabled or disabled separately for input and output via the officially written directives. mod_dumpio needs to be configured to LogLevel trace7 (commonly used is default warn), here is info on LogLevel :

Vim
1
https://httpd.apache.org/docs/2.4/en/mod/core.html#loglevel

Our directive will be :

Vim
1
LogLevel dumpio:trace7

We can enable module with the command :

Vim
1
sudo a2enmod [module-name]

We can disble module with the command :

Vim
1
sudo a2dismod [module-name]

a2 enable and a2 diable. Easy to remember.

Our directives for config are :

Vim
1
2
DumpIOInput On
DumpIOOutput On

This is all about logging HTTP POST request. The mod_dumpio module infamously disturb and you must carefully test on dev server.

Tagged With apache php version , apache post module , Apache POST_MODULE , how to install dumpio module in apaches server
Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to WordPress Security : Apache2 Module to Log HTTP POST Method

  • Nginx WordPress Installation Guide (All Steps)

    This is a Full Nginx WordPress Installation Guide With All the Steps, Including Some Optimization and Setup Which is Compatible With WordPress DOT ORG Example Settings For Nginx.

  • Join/Merge Multiple Log Files For Big Data Analysis

    Here Are The Ways To Join/Merge Multiple Log Files For Big Data Analysis, Store Them To OpenStack Based Cloud Storage And Delete Old Files.

  • WordPress & PHP : Different AdSense Units on Mobile Devices

    Here is How To Serve Different AdSense Units on Mobile Devices on WordPress With PHP. WordPress Has Function Which Can Be Used In Free Way.

  • How To Install Apache2 on Ubuntu 18.04 With Let’s Encrypt, HTTP/2, HSTS

    Here is Detailed Guide on How To Install Apache2 on Ubuntu 18.04 With Let’s Encrypt, HTTP/2, HSTS With Commands and Configurations For Most Secured Setup.

performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Hybrid Multi-Cloud Environments Are Becoming UbiquitousJuly 12, 2023
  • Data Protection on the InternetJuly 12, 2023
  • Basics of BJT TransistorJuly 11, 2023
  • What is Confidential Computing?July 11, 2023
  • How a MOSFET WorksJuly 10, 2023
PC users can consult Corrine Chorney for Security.

Want to know more about us?

Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy