Skip to content

theodorosploumis/apache-log-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Apache2 access log generator

A simple php file that can generate fake apache2 access log files.

Usage

You can add your own .settings.php.

git clone git@github.com:theodorosploumis/apache-log-generator.git
cd apache-log-generator

Execute using php:

// Generate date limited files starting from '19 May 2019' (timestamp '1558137601') 
// with offset '1 Day' (86400) and row limit 10k rows by file
php -r "require 'index.php'; generateLogsByDates(1558137601, 86400, 10000);"

// Generate date limited files starting from 'now' (timestamp '0') 
// with offset '1 Day' and row limit 10k rows by file
php -r "require 'index.php'; generateLogsByDates(0, 86400, 10000);"


Log formats

See apache2 mod_log_config for more details.

LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

Log analyzers for security problems

python scalp/scalp.py -l logs/combined-generated-logs.log.1 --html --output ~/scalp/export
./lorg -d phpids -i combined logs/combined-generated-logs.log.1
python src/parse_logs.py -c get_sql_injections -F logs/combined-access.log
TBD
cat logs/combined-access.log | ./kataribe
# Example of one file apache logs at webserver_log.conf settings file

---
reporting:
  - Std:
      verbose: false
xss_level: Intelligent
services:
  - Apache:
      path: logs/combined-generated-logs.log.1

// Add your settings at secutity-log.yaml
./webserver_log -c webserver_log.conf
python hansipy.py
// For a more current version please check "lorg" tool above
./webforensik.php -o html -i combined logs/combined-generated-logs.log.1
http-logs-analyzer -f logs/combined-generated-logs.log.1
php parser.php logs/combined-generated-logs.log.1
./detect-http-attack.rb -s 8 < /var/log/apache/access_log
php parser.php logs/combined-generated-logs.log.1
python access-log-analizer.py

Visualize logs examples

request-log-analyzer --apache-format combined logs/combined-generated-logs.log.1
request-log-analyzer --apache-format common /etc/log/all.log --output HTML --file ~/ruby-apache-log-analyzer.html
goaccess --log-format=COMBINED -o myreport.html --real-time-html -f logs/combined-generated-logs.log.1
goaccess -o goaccess-report.html -f ~/logs/all.log -p goaccess.conf
// See examples at http://www.hping.org/visitors
./visitors -f myreport.html logs/combined-generated-logs.log.1
logan
logswan -g logs/combined-access.log
webalizer -c clf logs/combined-generated-logs.log.1

License

MIT 2019