Git Product home page Git Product logo

padcheck's Introduction

Padcheck: A TLS CBC Padding Oracle Scanner

This tool tests how a server responds to various CBC padding errors.

The tool makes a series of connections where the TLS record containing an HTTP request is malformed. Servers should respond uniformly to all malformed records. If the server responds differently to certain types of errors, an attacker may be able to construct a padding oracle for use in an adaptive chosen ciphertext attack.

There are currently five malformed record test cases:

  1. Invalid MAC with Valid Padding (0-length pad)
  2. Missing MAC with Incomplete Padding (255-length pad)
  3. Valid MAC with Inconsistent Padding (SSLv3 style padding)
  4. Missing MAC with Valid Padding (Entire record is padding)
  5. Invalid MAC with Valid Padding (0-length record)

Background

This tool was created to help identify lingering TLS CBC padding oracles. The research was originally presented at Black Hat Asia in March 2019. The slides are available for review.

For further reading on the topic, refer to the following links:

Disclosures related to modern TLS CBC padding oracles are being tracked on GitHub. This also includes oracles identified by TLS-Scanner

Usage

-h Show help
-hosts string Filename containing hosts to query
-iterations int Number of iterations required to confirm oracle (default 3)
-keylog string Path to a file NSS key log export (needed to decrypt pcap files) (default "/dev/null")
-v int Specify verboseness level (default: 1, max: 5) (default 1)
-workerCount int Desired number of workers for testing lists (default 32)

The basic usage is to run padcheck hostname A list of hosts can also be read from a file padcheck -hosts hostnames.txt

Vulnerable hosts are indicated in the tool output with a line similar to:

Hostname (ip:443) is VULNERABLE with a Observable MAC Validity (Zombie POODLE) oracle when using cipher 0xc027 with TLS 0x0303. The fingerprint is 6867b5

The fingerprint produced by this tool is a hash of the server responses. These values are subject to change with changes to the tool or with environmental variation which may influence the error message text. The fingerprint value should therefore be primarily used for correlating similar vulnerabilities within a specific environment.

Obtaining padcheck

The easiest way to get started with padcheck is by downloading the latest Linux binary release

Users can alternatively build it locally for cross-platform or development testing.

Building on Linux

  1. Install Go - Distro packages (e.g. sudo apt install golang-go) are fine.
  2. Run ./build.sh

Upon success, ./padcheck will be available as a portable/standalone executable.

Building on Docker

Building with Docker is easier and cross-platform.

Run docker build . -t padcheck to build the patched Go toolchain and the padcheck tool in a container.

Run with: docker run --rm -it padcheck [args]

If you want to use a hosts file or keylog file, you will need to mount them in the container:

docker run --rm -it \
    -v /path/to/hosts:/tmp/hosts \
    -v /path/to/keylog:/tmp/keylog \
    padcheck -hosts /tmp/hosts -keylog /tmp/keylog

Credits

The original idea for this padding check tool was a very simple tool for checking for POODLE issues in TLS servers, by Adam Langley (agl AT imperialviolet DOT org). See:

Additional Resources

More information about scanning for TLS CBC padding oracles on the Internet can be found in this repo: https://github.com/RUB-NDS/TLS-Padding-Oracles

License

Original tool copyright 2014 Adam Langley, released under a BSD license.

Copyright 2019 Tripwire, Inc. All rights reserved. Released under a BSD 2-Clause License.

padcheck's People

Contributors

cy1337 avatar dexxtreme avatar dgarske avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

padcheck's Issues

Unclear explanation of GOLDENDOODLE

The exact definition of GOLDENDOODLE in this tool and the associated blog posts is unclear. I can't seem to determine what distinct vulnerability GOLDENDOODLE represents and how we can prevent it.

In padcheck.go, the comment above the check for GOLDENPOODLE says "Distinct error for valid padding with invalid MAC" whereas Zombie Poodle says "Unique error on invalid padding with valid MAC" but as you can see, these definitions are identical (A != B | B != A).

In this blog post it says "GOLDENDOODLE is the name I’ve given for exploiting modern TLS stacks using the classic CBC padding oracle technique described by Serge Vaudenay in 2002" which seems to imply that GOLDENDOODLE is a pet name for Vaudenay's research. It continues by saying that by reducing the set of characters guessed to application-specific characteristics, the attack can be performed faster. This is true of any padding oracle attack.

In the blog post describing how GOLDENDOODLE was found it talks about there needing to be a lack of MAC validation but doesn't describe how this is relevant to a padding oracle. Some implementations of TLS (like in OpenSSL) check the MAC after padding, which, for the purposes of a padding oracle, is the same as not validating the MAC.

It would be great if further clarification could be provided on what GOLDENDOODLE is and how it can be exploited. For example, could a toy example of the script used to exploit the Cisco ASA bug (described here) be provided to demonstrate GOLDENDOODLE?

Doesn't seem to report on check properly?

Hi when I look at:

		if isVulnerable != true {
			if iteration > 0 {
				if *verboseLevel > 0 {
					fmt.Printf("%s (%s) exhibited an oracle which did not appear on iteration %d. (Not exploitable)\n", serverName, hostname, iteration)
				}
				return errors.New("Oracle disappeared")
			}
			return nil
		}

In padcheck.go, it leaves the line which says:

fmt.Printf("%s (%s) behaves securely\n", serverName, hostname)

As dead code.

.\padcheck.go:134:4: unknown field 'PaddingMode' in struct literal of type tls.Config

Hi Tripwire,

I tried build it using "go build", but unfortunately I got this error message as below.

.\padcheck.go:134:4: unknown field 'PaddingMode' in struct literal of type tls.Config

I googled but got nothing useful. I also checked the definition of tls.Config, it does not have a member named "PaddingMode". anything recommend? thanks.

btw, I comment that line and built an exe, but seems it does not work well for me.

Add more ciphers

Please add more CBC ciphers to padcheck as the current list is very limited and far away from complete. This would make the tool more useful.

please delete

I am testing against a server where every test errors out with i/o timeout. Packet analysis shows that the server responds to each test immediately with an Alert (Level: Warning, Description: Close Notify). For whatever reason, the server response is not read by the TLS connector.

Edit: never mind. The close notify is sent by the client, not server. Please delete this issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.