News and blog
NXLog main page
  • Products
    NXLog Platform
    Log collection
    Log management and analytics
    Log storage
    NXLog Community Edition
    Integrations
    Professional Services
  • Solutions
    Use cases
    Specific OS support
    SCADA/ICS
    Windows event log
    DNS logging
    MacOS logging
    Solutions by industry
    Financial Services
    Government & Education
    Entertainment & Gambling
    Telecommunications
    Medical & Healthcare
    Military & Defense
    Law Firms & Legal Counsel
    Industrial & Manufacturing
  • Plans
  • Partners
    Find a Reseller
    Partner Program
  • Resources
    Documentation
    Blog
    White papers
    Videos
    Webinars
    Case Studies
    Community Program
    Community Forum
  • About
    Company
    Careers
  • Support
    Support portals
    Contact us

NXLog Platform
Log collection
Log management and analytics
Log storage
NXLog Community Edition
Integrations
Professional Services

Use Cases
Specific OS support
SCADA/ICS
Windows event log
DNS logging
MacOS logging
Solutions by industry
Financial Services
Government & Education
Entertainment & Gambling
Telecommunications
Medical & Healthcare
Military & Defense
Law Firms & Legal Counsel
Industrial & Manufacturing


Find a Reseller
Partner Program

Documentation
Blog
White papers
Videos
Webinars
Case Studies
Community Program
Community Forum

Company
Careers

Support portals
Contact us
Let's Talk Start free
NXLog search
  • Loading...
Let's Talk Start free
May 9, 2023 security

BROP attacks - What is it and how to defend yourself?

By Jonathan King

Share
ALL SIEM STRATEGY SECURITY ANNOUNCEMENT DEPLOYMENT COMPLIANCE COMPARISON RSS

Have you ever locked yourself out of your car? After calling for roadside service, your tow truck driver forces the internal locking mechanism open with a slim-jim. Car thieves quickly discovered this technique and began using it to steal cars. Digital thieves have devised a similar attack called a Blind Return-Oriented Programming (Blind ROP, or just BROP) attack. It’s as quiet as a jackhammer on cement, but an attacker can open a remote shell and gain remote code execution on your server if the conditions are right.

ROP Gadgets and Chains

brop

When building a program, the developer doesn’t write in a language that the CPU natively understands, so we need a compiler or interpreter that’ll turn Ruby, Python, and Rust programs into a language the does CPU understand. Every compiler has basic programs that allow additional functionality, like 'compare these two strings' or 'execute this command'. These programs are called return-oriented programming (ROP) gadgets, getting their name from the RET instruction at the end of the statement, short for RETURN. ROP gadgets are juicy targets for attackers, allowing them to take over argument calls for ANY function within the compiler. For the attacker to succeed, the attacker needs to control these gadgets, which are used to inject and control program flow on a remote system. Since these basic functions already exist within the victim’s system, it’s less code the attacker needs to load onto the system. A compiler translates a program into something the CPU understands and has small, elementary 'functions' that allow it further functionality.

Attackers try and call these gadgets by manually loading up the address space from which they reside and loading them into their script. If they know the version of the operating system, then they can reverse engineer the gadget’s location within their environment. ROP gadgets enable essential functions to work, and when attackers can call them sequentially, that’s called developing an ROP Chain. An attacker can trick a CPU into running their code by chaining ROP gadgets together instead of what’s next in the pipeline. Once they put everything together in a script and run it against your server, they can gain remote shell access to your system to do as they wish.

Overflowing breadcrumbs

When an input receives more data than it can handle, this is called an overflow event. Think of trying to push a watermelon through a garden hose. Somewhere along the line, the restrictions will fail, and that hose will split. The idea is to try and cram as much data as you can into one request in the hope that the data at the end will land in an address space, which is typically reserved for system processes like the CPU compiler. Attackers will then try and re-write what is in the address space, as that contains a special value that tells the compiler where to send the flow of the program. When this happens, the compiler’s first line of defense is to halt the execution of the program.

When the CPU reaches a branch in coding logic, for example, 'if X happens, do Y, or else, do Z,' it places a value between the function variables and the branch point, like a breadcrumb called the stack canary. After the CPU finishes the instruction and returns, the compiler compares the value in the returning function with the stack canary, which is intended to be the same. Two different values indicate a buffer overflow situation exists, and halting the execution of the program is the CPUs way to defend against attackers. However, with enough attempts, an attacker can place the correct canary value at the end of the enlarged packet. This is because there’s a finite number of fields that the canary can be, so an attacker will just brute-force all possible values. If the values match, the attacker can control the CPU pipeline remotely. Once they have discovered the overflow size and stack canary, they can begin working on locating the system ROP gadgets.

Blind ROP basics

To conduct a successful BROP attack, the attacker needs to find two properties that exist within the target system:

  • a vulnerability that impacts the pipeline of the server, and

  • the vulnerability must exist in a service set to automatically restart if it crashes.

In summary, the attacker will be looking to determine the following:

  • the buffer overflow size

  • the stack canary and stop gadget location

  • the address location of the procedure linking table (PLT)

  • assembly gadgets accessible within the target system

After sending enough requests, they can increment through all potential values to determine the value of the stack canary. When the attacker sends an overrun condition, they append the stack canary value to the end of their payload. Since the stack canary is the same, it doesn’t cause the program to crash. The attacker uses this information to determine a 'stop ROP gadget' address location, which can be called upon when searching for other gadgets and allows the attacker to halt ROP chains so that more gadgets can be discovered. Once the address of the stop ROP gadget is known, the attacker uses this information to find the procedure linking table (PLT), which links process calls to lower-level gadgets. Armed with address locations of the PLT and stop gadgets, the attacker begins locating the address locations for ROP gadgets.

After the address locations of these gadgets have been discovered, the attacker can begin their main attack. The attacker will send a malicious payload, which includes the buffer overflow, stack canary, and PLT table locations. This payload will have a few calls to ROP gadgets within the system, complete with their precise address locations. The script will overflow an input, discover the gadgets, and use those to inject a remote shell command into a third argument, giving the attacker control over your system.

How to defend yourself against a BROP attack

An average BROP attack takes about 4000 requests. Just like a brute-force attack, BROP attacks should generate a decent number of alerts while the attack occurs. Basic logging and monitoring could detect these requests, along with an appropriate intrusion prevention system (IPS) and other detection means. This attack also requires a specific configuration to be in place within the victim’s environment. The best defense is limiting the information gathered during the attacker’s reconnaissance phase and ensuring your systems are patched and up-to-date. Turn off default banners for services that require port access on your firewall. Banners are the first message you see when pinging a port’s service. These can display important information, such as the version and model of the server you’re running. Running updated versions of your software is also recommended, as newer versions have better memory and heap management.

OS manufacturers have also pondered this question, with the result coming in the form of Address Space Layout Randomization (ASLR). This built-in feature in your operating system will randomize the address spaces within the operating system. So, if the attacker knows your server’s operating system, they’ll already know the location of your write and read ROP gadgets. If they know the location of ROP gadgets ahead of time, they can put together ROP Chains with a smaller number of requests, expediting the attack. This doesn’t protect against exposing the stack canary, but it will make it more difficult for the attacker to know where in your address space specific ROP gadgets exist. This would have a cascading effect of increasing the requests the attacker must make to discover the necessary gadgets. You can enable ASLR in Windows, and here you can enable it on Linux; for MacOS, ASLR is enabled by default.

Conclusion

Attackers use Blind ROP attacks against target systems with an existing vulnerability against the CPUs pipeline and against a service that restarts automatically. They aren’t quiet but can be effective in the right situation. By creating an overflow condition in the environment and determining the address location of specific functions within the victim’s system, an attacker can perform a control hijacking by taking control of the CPU’s instruction pipeline remotely. They can direct program flow to their specially crafted instruction set by taking over control, leading them to a remote shell on the victim’s server. Typical defenses against this include keeping your programs, services, and servers patched and updated. It also includes performing essential log monitoring and examination to ensure attackers aren’t trying to infiltrate the system. With a bit of setup initially, detecting and thwarting BROP attacks can be included in your standard security policy.

NXLog Platform is an on-premises solution for centralized log management with
versatile processing forming the backbone of security monitoring.

With our industry-leading expertise in log collection and agent management, we comprehensively
address your security log-related tasks, including collection, parsing, processing, enrichment, storage, management, and analytics.

Start free Contact us
  • security
  • BROP
  • Blind Return-Oriented Programming
Share

Facebook Twitter LinkedIn Reddit Mail
Related Posts

Assertive compliance - using frameworks to extend your coverage
4 minutes | September 30, 2022
NXLog in an industrial control security context
9 minutes | August 10, 2022

Stay connected:

Sign up

Keep up to date with our monthly digest of articles.

By clicking singing up, I agree to the use of my personal data in accordance with NXLog Privacy Policy.

Featured posts

Announcing NXLog Platform 1.6
April 22, 2025
Announcing NXLog Platform 1.5
February 27, 2025
Announcing NXLog Platform 1.4
December 20, 2024
NXLog redefines log management for the digital age
December 19, 2024
2024 and NXLog - a review
December 19, 2024
Announcing NXLog Platform 1.3
October 25, 2024
NXLog redefines the market with the launch of NXLog Platform: a new centralized log management solution
September 24, 2024
Welcome to the future of log management with NXLog Platform
August 28, 2024
Announcing NXLog Enterprise Edition 5.11
June 20, 2024
Raijin announces release of version 2.1
May 31, 2024
Ingesting log data from Debian UFW to Loki and Grafana
May 21, 2024
Announcing NXLog Enterprise Edition 6.3
May 13, 2024
Raijin announces release of version 2.0
March 14, 2024
NXLog Enterprise Edition on Submarines
March 11, 2024
The evolution of event logging: from clay tablets to Taylor Swift
February 6, 2024
Migrate to NXLog Enterprise Edition 6 for our best ever log collection experience
February 2, 2024
Raijin announces release of version 1.5
January 26, 2024
2023 and NXLog - a review
December 22, 2023
Announcing NXLog Enterprise Edition 5.10
December 21, 2023
Raijin announces release of version 1.4
December 12, 2023
Announcing NXLog Enterprise Edition 6.2
December 4, 2023
Announcing NXLog Manager 5.7
November 3, 2023
Announcing NXLog Enterprise Edition 6.1
October 20, 2023
Raijin announces release of version 1.3
October 6, 2023
Upgrading from NXLog Enterprise Edition 5 to NXLog Enterprise Edition 6
September 11, 2023
Announcing NXLog Enterprise Edition 6.0
September 11, 2023
The cybersecurity challenges of modern aviation systems
September 8, 2023
Raijin announces release of version 1.2
August 11, 2023
The Sarbanes-Oxley (SOX) Act and security observability
August 9, 2023
Log Management and PCI DSS 4.0 compliance
August 2, 2023
Detect threats using NXLog and Sigma
July 27, 2023
HIPAA compliance logging requirements
July 19, 2023
Announcing NXLog Enterprise Edition 5.9
June 20, 2023
Industrial cybersecurity - The facts
June 8, 2023
Raijin announces release of version 1.1
May 30, 2023
CISO starter pack - Security Policy
May 2, 2023
Announcing NXLog Enterprise Edition 5.8
April 24, 2023
CISO starter pack - Log collection fundamentals
April 3, 2023
Raijin announces release of version 1.0
March 9, 2023
Avoid vendor lock-in and declare SIEM independence
February 13, 2023
Announcing NXLog Enterprise Edition 5.7
January 20, 2023
NXLog - 2022 in review
December 22, 2022
Need to replace syslog-ng? Changing to NXLog is easier than you think
November 23, 2022
The EU's response to cyberwarfare
November 22, 2022
Looking beyond Cybersecurity Awareness Month
November 8, 2022
GDPR compliance and log data
September 23, 2022
NXLog in an industrial control security context
August 10, 2022
Raijin vs Elasticsearch
August 9, 2022
NXLog provides native support for Google Chronicle
May 11, 2022
Aggregating macOS logs for SIEM systems
February 17, 2022
How a centralized log collection tool can help your SIEM solutions
April 1, 2020

Categories

  • SIEM
  • STRATEGY
  • SECURITY
  • ANNOUNCEMENT
  • DEPLOYMENT
  • COMPLIANCE
  • COMPARISON
logo

Subscribe to our newsletter to get the latest updates, news, and products releases. 

© Copyright 2024 NXLog FZE.

Privacy Policy. General Terms of Use

Follow us

  • Product
  • NXLog Platform 
  • Log collection
  • Log management and analysis
  • Log storage
  • Integration
  • Professional Services
  • Plans
  • Resources
  • Documentation
  • Blog
  • White papers
  • Videos
  • Webinars
  • Case studies
  • Community Program
  • Community forum
  • Support
  • Getting started guide
  • Support portals
  • About NXLog
  • About us
  • Careers
  • Find a reseller
  • Partner program
  • Contact us