Pentesting Tools

Redirector Installation – A Comprehensive Guide For Red Team Operations

Installing and configuring redirectors as part of your red team infrastructure. Follow these step-by-step instructions to deploy and optimize redirectors using tools like Filebeat and RedELK, enhancing your ability to manage logs and security measures effectively.

Learn how to tackle common installation challenges and modify logging formats for different server types to suit your operational needs.

In Short

  1. extract redirs.tgz
  2. Run: install-redir.sh $FilebeatID $ScenarioName $IP/DNS:PORT
  3. Modify the logging format of your reverse proxy

In Detail

Copy and extract the redirs.tgz you generated in the previous step on your redirector as part of your red team infra deployment procedures. Run: install-redir.sh $FilebeatID $ScenarioName $IP/DNS:PORT

  • $FilebeatID is the identifier of this redirector within filebeat.
  • $ScenarioName is the name of the attack scenario this redirector is used for.
  • $IP/DNS:PORT is the IP or DNS name and port where filebeat logs are shipped to, this would be the IP/DNS of your RedELK server. Even if you use the default port (TCP/5044) you need to provide this as a parameter.

This script will set install filebeat and dependencies, install the required certificates, adjust the filebeat configuration and start filebeat.

Debugging

Having issues? Check the following:

  • The installer output in redelk-install.log.
  • Filebeat errors in its log file (/var/log/filebeat or filebeat mentioned in /var/log/syslog depending on your Linux flavour used). You want to make sure it is tracking the right log files. And you want to make sure it can connect to the RedELK server. If no connection is established, this is often due to firewall issues, or due to incorrect SSL parameters given in the certs/config.cfg file.

Modify Logging Format

The applications used for redirection still need manual tuning in order to get the most out of them. This is done differently for Apache, Nginx and HAProxy. Details of each can be found below, and example configuration files are shipped with the RedELK package in the example-data-and-configs folder

See Naming requirements for detailed info on naming requirements.

Apache Specifics

RedELK requires:

  1. Enabling of Apache specific modules. Run a2enmod rewrite proxy proxy_http proxy_connect ssl proxy_html deflate headers to do so.
  2. modification to the default Apache configuration in order to log more details. Most importantly are the ‘LogFormat’ and ‘CustomLog’ directives:
  • LogFormat "%t %{hostname}e apache[%P]: frontend:%{frontend_name}e/%A:%{local}p backend:%{backend_name}e client:%h:%{remote}p xforwardedfor:%{X-Forwarded-For}i headers:{%{User-Agent}i|%{Host}i|%{X-Forwarded-For}i|%{X-Forwarded-Proto}i|%{X-Host}i|%{Forwarded}i|%{Via}i|} statuscode:%s request:%r" redelklogformat
  • CustomLog ${APACHE_LOG_DIR}/access-redelk.log redelklogformat

An example Apache config file can be found here

By default Filebeat on the redirector will look at the log file /var/log/apache2/access-redelk.log. You can change these manually in the filebeat config file.

For more information click here.

Tamil S

Tamil has a great interest in the fields of Cyber Security, OSINT, and CTF projects. Currently, he is deeply involved in researching and publishing various security tools with Kali Linux Tutorials, which is quite fascinating.

Recent Posts

Bomber : Navigating Security Vulnerabilities In SBOMs

bomber is an application that scans SBOMs for security vulnerabilities. So you've asked a vendor…

14 hours ago

EmbedPayloadInPng : A Guide To Embedding And Extracting Encrypted Payloads In PNG Files

Embed a payload within a PNG file by splitting the payload across multiple IDAT sections.…

14 hours ago

Exploit Street – Navigating The New Terrain Of Windows LPEs

Exploit-Street, where we dive into the ever-evolving world of cybersecurity with a focus on Local…

3 days ago

ShadowDumper – Advanced Techniques For LSASS Memory Extraction

Shadow Dumper is a powerful tool used to dump LSASS (Local Security Authority Subsystem Service)…

4 days ago

Shadow-rs : Harnessing Rust’s Power For Kernel-Level Security Research

shadow-rs is a Windows kernel rootkit written in Rust, demonstrating advanced techniques for kernel manipulation…

2 weeks ago

ExecutePeFromPngViaLNK – Advanced Execution Of Embedded PE Files via PNG And LNK

Extract and execute a PE embedded within a PNG file using an LNK file. The…

3 weeks ago