< Return to Video

36C3 - Identifying Multi-Binary Vulnerabilities in Embedded Firmware at Scale

  • Not Synced
    *preroll music*
    [filler, please remove in amara]
  • Not Synced
    Herald: Our next speaker for today is a
    computer science PhD student at UC Santa
  • Not Synced
    Barbara. He is a member of the Shellfish
    Hacking Team and he's also the organizer
  • Not Synced
    of the IECTF Hacking Competition. Please
    give a big round of applause to Nilo
  • Not Synced
    Redini.
    [filler, please remove in amara]
  • Not Synced
    *applause*
    [filler, please remove in amara]
  • Not Synced
    Nilo: Thanks for the introduction, hello
    to everyone. My name is Nilo, and today
  • Not Synced
    I'm going to present you my work Koronte:
    identifying multi-binary vulnerabilities
  • Not Synced
    in embedded firmware at scale. This work
    is a co-joint effort between me and
  • Not Synced
    several of my colleagues at University of
    Santa Barbara and ASU. This talk is going
  • Not Synced
    to be about IoT devices. So before
    starting, let's see an overview about IoT
  • Not Synced
    devices. IoT devices are everywhere. As
    the research suggests, they will reach the
  • Not Synced
    20 billion units by the end of the next
    year. And a recent study conducted this
  • Not Synced
    year in 2019 on 16 million households
    showed that more than 70 percent of homes
  • Not Synced
    in North America already have an IoT
    network connected device. IoT devices make
  • Not Synced
    everyday life smarter. You can literally
    say "Alexa, I'm cold" and Alexa will
  • Not Synced
    interact with the thermostat and increase
    the temperature of your room. Usually the
  • Not Synced
    way we interact with the IoT devices is
    through our smartphone. We send a request
  • Not Synced
    to the local network, to some device,
    router or door lock, or we might send the
  • Not Synced
    same request through a cloud endpoint,
    which is usually managed by the vendor of
  • Not Synced
    the IoT device. Another way is through the
    IoT hubs, smartphone will send the request
  • Not Synced
    to some IoT hub, which in turn will send
    the request to some other IoT devices. As
  • Not Synced
    you can imagine, IoT devices use and
    collect our data and some data is more
  • Not Synced
    sensitive than other. For instance, think
    of all the data that is collected by my
  • Not Synced
    lightbulb or data that is collected by our
    security camera. As such, IoT devices can
  • Not Synced
    compromise people's safety and privacy.
    Things, for example, about the security
  • Not Synced
    implication of a faulty smartlock or the
    brakes of your smart car. So the question
  • Not Synced
    that we asked is: Are IoT devices secure?
    Well, like everything else, they are not.
  • Not Synced
    OK, in 2016 the Mirai botnet compromised
    and leveraged millions of IoT devices to
  • Not Synced
    disrupt core Internet services such as
    Twitter, GitHub and Netflix. And in 2018,
  • Not Synced
    154 vulnerabilities affecting IoT devices
    were published, which represented an
  • Not Synced
    increment of 15% compared to 2017 and an
    increase of 115% compared to 2016. So then
  • Not Synced
    we wonder: So why is it hard to secure IoT
    devices? To answer this question we have
  • Not Synced
    to look up how IoT devices work and they
    are made. Usually when you remove all the
  • Not Synced
    plastic and peripherals IoT devices look
    like this. A board with some chips laying
  • Not Synced
    on it. Usually you can find the big chip,
    the microcontroller which runs the
  • Not Synced
    firmware and one or more peripheral
    controllers which interact with external
  • Not Synced
    peripherals such as the motor of, your
    smart lock or cameras. Though the design
  • Not Synced
    is generic, implementations are very
    diverse. For instance, firmware may run on
  • Not Synced
    several different architectures such as
    ARM, MIPS, x86, PowerPC and so forth. And
  • Not Synced
    sometimes they are even proprietary, which
    means that if a security analyst wants to
  • Not Synced
    understand what's going on in the
    firmware, he'll have a hard time if he
  • Not Synced
    doesn't have the vendor specifics. Also,
    they're operating in environments with
  • Not Synced
    limited resources, which means that they
    run small and optimized code. For
  • Not Synced
    instance, vendors might implement their
    own version of some known algorithm in an
  • Not Synced
    optimized way. Also, IoT devices manage
    external peripherals that often use custom
  • Not Synced
    code. Again, with peripherals we mean like
    cameras, sensors and so forth. The
  • Not Synced
    firmware of IoT devices can be either
    Linux based or a blob firmware, Linux
  • Not Synced
    based are by far the most common. A study
    showed that 86% of firmware are based on
  • Not Synced
    Linux and on the other hand, blobs
    firmware are usually operating systems and
  • Not Synced
    user applications packaged in a single
    binary. In any case, firmware samples are
  • Not Synced
    usually made of multiple components. For
    instance, let's say that you have your
  • Not Synced
    smart phone and you send a request to your
    IoT device. This request will be received
  • Not Synced
    by a binary which we term as body binary,
    which in this example is an webserver. The
  • Not Synced
    request will be received, parsed, and then
    it might be sent to another binary code,
  • Not Synced
    the handler binary, which will take the
    request, work on it, produce an answer,
  • Not Synced
    send it back to the webserver, which in
    turn would produce a response to send to
  • Not Synced
    the smartphone. So to come back to the
    question why is it hard to secure IoT
  • Not Synced
    devices? Well, the answer is because IoT
    devices are in practice very diverse. Of
  • Not Synced
    course, there have been various work that
    have been proposed to analyze and secure
  • Not Synced
    firmware for IoT devices. Some of them
    using static analysis. Others using
  • Not Synced
    dynamic analysis and several others using
    a combination of both. Here I wrote
  • Not Synced
    several of them. Again at the end of the
    presentation there is a bibliography with
  • Not Synced
    the title of these works. Of course, all
    these approaches have some problems. For
  • Not Synced
    instance, the current dynamic analysis are
    hard to apply to scale because of the
  • Not Synced
    customized environments that IoT devices
    work on. Usually when you try to
  • Not Synced
    dynamically execute a firmware, it's gonna
    check if the peripherals are connected and
  • Not Synced
    are working properly. In a case where you
    can't have the peripherals, it's gonna be
  • Not Synced
    hard to actually run the firmware. Also
    current static analysis approaches are
  • Not Synced
    based on what we call the single binary
    approach, which means that binaries from a
  • Not Synced
    firmware are taken individually and
    analysed. This approach might produce many
  • Not Synced
    false positives. For instance, so let's
    say again that we have our two binaries.
  • Not Synced
    This is actually an example that we found
    on one firmware, so the web server will
  • Not Synced
    take the user request, will parse the
    request and produce some data, will set
  • Not Synced
    this data to an environment variable and
    eventually will execute the handle binary.
  • Not Synced
    Now, if you see the parsing function
    contains a string compare which checks if
  • Not Synced
    some keyword is present in the request.
    And if so, it just returns the whole
  • Not Synced
    request. Otherwise, it will constrain the
    size of the request to 128 bytes and
  • Not Synced
    return it. The handler binary in turn when
    spawned will receive the data by doing a
  • Not Synced
    getenv on the query string, but also will
    getenv on another environment variable
  • Not Synced
    which in this case is not user controlled
    and they user cannot influence the content
  • Not Synced
    of this variable. Then it's gonna call
    function process_request. This function
  • Not Synced
    eventually will do two string copies. One
    from the user data, the other one from the
  • Not Synced
    log path on two different local variables
    that are 128 bytes long. Now in the first
  • Not Synced
    case, as we have seen before, the data can
    be greater than 128 bytes and this string
  • Not Synced
    copy may result in a bug. While in the
    second case it will not. Because here we
  • Not Synced
    assume that the system handles its own
    data in a good manner. So throughout this
  • Not Synced
    work, we're gonna call the first type of
    binary, the setter binary, which means
  • Not Synced
    that it is the binary that takes the data
    and set the data for another binary to be
  • Not Synced
    consumed. And the second type of binary we
    called them the getter binary. So the
  • Not Synced
    current bug finding tools are inadequate
    because other bugs are left undiscovered
  • Not Synced
    if the analysis only consider those
    binaries that received network requests or
  • Not Synced
    they're likely to produce many false
    positives if the analysis considers all of
  • Not Synced
    them individually. So then we wonder how
    these different components actually
  • Not Synced
    communicate. They communicate through what
    are called interprocess communication,
  • Not Synced
    which basically it's a finite set of
    paradigms used by binaries to communicate
  • Not Synced
    such as files, environment variables, MMIO
    and so forth. All these pieces are
  • Not Synced
    represented by data keys, which are file
    names, or in the case of the example
  • Not Synced
    before here on the right, it's the query
    string environment variable. Each binary
  • Not Synced
    that relies on some shared data must know
    the endpoint where such data will be
  • Not Synced
    available, for instance, again, like a
    file name or like even a socket endpoint
  • Not Synced
    or the environment variable. This means
    that usually, data keys are coded in the
  • Not Synced
    program itself, as we saw before. To find
    bugs in firmware, in a precise manner, we
  • Not Synced
    need to track how user data is introduced
    and propagated across the different
  • Not Synced
    binaries. Okay, let's talk about our work.
    Before you start talking about Karonte, we
  • Not Synced
    define our threat model. We hypotesized
    that attacker sends arbitrary requests
  • Not Synced
    over the network, both LAN and WAN
    directly to the IoT device. Though we said
  • Not Synced
    before that sometimes IoT device can
    communicate through the clouds, research
  • Not Synced
    showed that some form of local
    communication is usually available, for
  • Not Synced
    instance, during the setup phase of the
    device. Karonte is defined as a static
  • Not Synced
    analysis tool that tracks data flow across
    multiple binaries, to find
  • Not Synced
    vulnerabilities. Let's see how it works.
    So the first step, Karonte find those
  • Not Synced
    binaries that introduce the user input
    into the firmware. We call these border
  • Not Synced
    binaries, which are the binaries, that
    basically interface the device to the
  • Not Synced
    outside world. Which in the example is our
    web server. Then it tracks how a data is
  • Not Synced
    shared with other binaries within the
    firmware sample. Which we'll understand in
  • Not Synced
    this example, the web server communicates
    with the handle binary, and builds what we
  • Not Synced
    call the BDG. BDG which stands for binary
    dependency graph. It's basically a graph
  • Not Synced
    representation of the data dependencies
    among different binaries. Then we detect
  • Not Synced
    vulnerabilities that arise from the misuse
    of the data using the BDG. This is an
  • Not Synced
    overview of our system. We start by taking
    a packed firmware, we unpack it. We find
  • Not Synced
    the border binaries. Then we build the
    binary dependency graph, which relies on a
  • Not Synced
    set of CPFs, as we will see soon. CPF
    stands for Communication Paradigm Finder.
  • Not Synced
    Then we find the specifics of the
    communication, for instance, like the
  • Not Synced
    constraints applied to the data that is
    shared through our module multi-binary
  • Not Synced
    data-flow analysis. Eventually we run our
    insecure interaction detection module,
  • Not Synced
    which basically takes all the information
    and produces alerts. Our system is
  • Not Synced
    completely static and relies on our static
    taint engine. So let's see each one of
  • Not Synced
    these steps, more in details. The
    unpacking procedure is pretty easy, we use
  • Not Synced
    the off-the-shelf firmware unpacking tool
    binwalk. And then we have to find the
  • Not Synced
    border binaries. Now we see that border
    binaries basically are binaries that
  • Not Synced
    receive data from the network. And we
    hypotesize that will contain parsers to
  • Not Synced
    validate the data that they received. So
    in order to find them, we have to find
  • Not Synced
    parsers which accept data from network and
    parse this data. To find parsers we rely
  • Not Synced
    on related work, which basically uses a
    few metrics and define through a number
  • Not Synced
    the likelihood for a function to contain
    parsing capabilities. These metrics that
  • Not Synced
    we used are number of basic blocks, number
    of memory comparison operations and number
  • Not Synced
    of branches. Now while these define
    parsers, we also have to find if a binary
  • Not Synced
    takes data from the network. As such, we
    define two more metrics. The first one, we
  • Not Synced
    check if binary contains any network
    related keywords as SOAP, http and so
  • Not Synced
    forth. And then we check if there exists a
    data flow between read from socket and a
  • Not Synced
    memory comparison operation. Once for each
    function, we got all these metrics, we
  • Not Synced
    compute what is called a parsing score,
    which basically is just a sum of products.
  • Not Synced
    Once we got a parsing score for each
    function in a binary, we represent the
  • Not Synced
    binary with its highest parsing score.
    Once we got that for each binary in the
  • Not Synced
    firmware we cluster them using the DBSCAN
    density based algorithm and consider the
  • Not Synced
    cluster with the highest parsing score as
    containing the set of border binaries.
  • Not Synced
    After this, we build the binary dependency
    graph. Again the binary dependency graph
  • Not Synced
    represents the data dependency among the
    binaries in a firmware sample. For
  • Not Synced
    instance, this simple graph will tell us
    that a binary A communicates with binary C
  • Not Synced
    using files and the same binary A
    communicates with another binary B using
  • Not Synced
    environment variables. Let's see how this
    works. So we start from the identified
  • Not Synced
    border binaries and then we taint the data
    compared against network related keywords
  • Not Synced
    that we found and run a static analysis,
    static taint analysis to detect whether
  • Not Synced
    the binary relies on any IPC paradigm to
    share the data. If we find that it does,
  • Not Synced
    we establish if the binary is a setter or
    a getter, which again means that if the
  • Not Synced
    binary is setting the data to be consumed
    by another binary, or if the binary
  • Not Synced
    actually gets the data and consumes it.
    Then we retrieve the employed data key
  • Not Synced
    which in the example before was the
    keyword QUERY_STRING. And finally we scan
  • Not Synced
    the firmware sample to find other binaries
    that may rely on the same data keys and
  • Not Synced
    schedule them for further analysis. To
    understand whether a binary relies on any
  • Not Synced
    IPC, we use what we call CPFs, which again
    means communication paradigm finder. We
  • Not Synced
    design a CPF for each IPC. And the CPFs
    are also used to find the same data keys
  • Not Synced
    within the firmware sample. We also
    provide Karonte with a generic CPF to
  • Not Synced
    cover those cases where the IPC is
    unknown. Or those cases were the vendor
  • Not Synced
    implemented their own versions of some
    IPC. So for example they don't use the
  • Not Synced
    setenv. But they implemented their own
    setenv. The idea behind this generic CPF
  • Not Synced
    that we call the semantic CPF is that data
    keys has to be used as index to set, or to
  • Not Synced
    get some data in this simple example. So
    let's see how the BDG algorithm works. We
  • Not Synced
    start from the body binary, which again
    will start from the server request and
  • Not Synced
    will pass the URI and we see that here. it
    runs a string comparison against some
  • Not Synced
    network related keyword. As such, we taint
    the variable P. And we see that the
  • Not Synced
    variable P is returned from the function
    to these two different points. As such, we
  • Not Synced
    continue. And now we see that data gets
    tainted and the variable data, it's passed
  • Not Synced
    to the function setenv. At this point, the
    environment CPF will understand that
  • Not Synced
    tainted data is passed, is set to an
    environment variable and will understand
  • Not Synced
    that this binary is indeed the setter
    binary that uses the environment. Then we
  • Not Synced
    retrieve the data key QUERY_STRING and
    we'll search within the firmware sample
  • Not Synced
    all the other binaries that rely on the
    same data key. And it will find that this
  • Not Synced
    binary relies on the same data key and
    will schedule this for further analysis.
  • Not Synced
    After this algorithm we build the BDG by
    creating edges between setters and getters
  • Not Synced
    for each data key. The multi binary data
    flow analysis uses the BDG to find and
  • Not Synced
    propagate the data constraints from a
    setter to a getter. Now, through this we
  • Not Synced
    apply only the least three constraints,
    which means that ideally between two
  • Not Synced
    program points, there might be an infinite
    number of parts and ideally in theory an
  • Not Synced
    infinite amount of constraints that we can
    propagate to the setter binary to the
  • Not Synced
    getter binary. But since our goal here is
    to find bugs, we only propagate the least
  • Not Synced
    strict set of constraints. Let's see an
    example. So again, we have our two
  • Not Synced
    binaries and we see that the variable that
    is passed to the setenv function is data,
  • Not Synced
    which comes from two different parts from
    the parse URI function. In the first case,
  • Not Synced
    the data that its passed is unconstrained
    one in the second case, a line 8 is
  • Not Synced
    constrained to be at most 128 bytes. As
    such, we only propagate the constraints of
  • Not Synced
    the first guy. In turn, the getter binary
    will retrieve this variable from the
  • Not Synced
    environment and set the variable query.
    Oh, sorry. Which in this case will be
  • Not Synced
    unconstrained. Insecure interaction
    detection run a static taint analysis and
  • Not Synced
    check whether tainted data can reach a
    sink in an unsafe way. We consider as
  • Not Synced
    sinks memcpy like functions which are
    functions that implement semantically
  • Not Synced
    equivalent memcyp, strcpy and so forth. We
    raise alert if we see that there is a
  • Not Synced
    dereference of a tainted variable and if
    we see there are comparisons of tainted
  • Not Synced
    variables in loop conditions to detect
    possible DoS vulnerabilities. Let's see an
  • Not Synced
    example again. So we got here. We know
    that our query variable is tainted and
  • Not Synced
    it's unconstrained. And then we follow the
    taint in the function process_request,
  • Not Synced
    which we see will eventually copy the data
    from q to arg. Now we see that arg is 128
  • Not Synced
    bytes long while q is unconstrained and
    therefore we generate an alert here. Our
  • Not Synced
    static taint engine is based on BootStomp
    and is completely based on symbolic
  • Not Synced
    execution, which means that the taint is
    propagated following the program data
  • Not Synced
    flow. Let's see an example. So assuming
    that we have this code, the first
  • Not Synced
    instruction takes the result from some
    seed function that might return for
  • Not Synced
    instance, some user input. And in a
    symbolic world, what we do is we create a
  • Not Synced
    symbolic variable ty and assign to it a
    tainted variable that we call TAINT_ty,
  • Not Synced
    which is the taint target. The next
    destruction X takes the value ty plus 5
  • Not Synced
    and a symbolic word. We just follow the
    data flow and x gets assigned TAINT_ty
  • Not Synced
    plus 5 which effectively taints also X. If
    at some point X is overwritten with some
  • Not Synced
    constant data, the taint is automatically
    removed. In its original design,
  • Not Synced
    BootStomp, the taint is removed also when
    data is constrained. For instance, here we
  • Not Synced
    can see that the variable n is tainted but
    then is constrained between two values 0
  • Not Synced
    and 255. And therefore, the taint is
    removed. In our taint engine we have two
  • Not Synced
    additions. We added a path prioritization
    strategy and we add taint dependencies.
  • Not Synced
    The path prioritization strategy valorizes
    paths that propagate the taint and
  • Not Synced
    deprioritizes those that remove it. For
    instance, say again that some user input
  • Not Synced
    comes from some function and the variable
    user input gets tainted. Gets tainted and
  • Not Synced
    then is passed to another function called
    parse. Here, if you see there are possibly
  • Not Synced
    an infinite number of symbolic parts in
    this while. But only 1 will return tainted
  • Not Synced
    data. While the others won't. So the path
    prioritization strategy valorizes this
  • Not Synced
    path instead of the others. This has been
    implemented by finding basic blocks within
  • Not Synced
    a function that return a nonconstant data.
    And if one is found, we follow its return
  • Not Synced
    before considering the others. Taint
    dependencies allows smart untaint
  • Not Synced
    strategies. Let's see again the example.
    So we know that user input here is
  • Not Synced
    tainted, is then parsed and then we see
    that it's length is checked and stored in
  • Not Synced
    a variable n. Its size is checked and if
    it's higher than 512 bytes, the function
  • Not Synced
    will return. Otherwise it copies the data.
    Now in this case, it might happen that if
  • Not Synced
    this strlen function is not analyzed
    because of some static analysis input
  • Not Synced
    decisions, the taint tag of cmd might be
    different from the taint tag of n and in
  • Not Synced
    this case, though, and gets untainted, cmd
    is not untainted and the strcpy can raise,
  • Not Synced
    sorry, carries a false positive. So to fix
    this problem. Basically we create a
  • Not Synced
    dependency between the taint tag of n and
    the taint tag of cmd. And when n gets
  • Not Synced
    untainted, cmd gets untainted as well. So
    we don't have more false positives. This
  • Not Synced
    procedure is automatic and we find
    functions that implement streamlined
  • Not Synced
    semantically equivalent code and create
    taint tag dependencies. OK. Let's see our
  • Not Synced
    evaluation. We ran 3 different evaluations
    on 2 different data sets. The first one
  • Not Synced
    composed by 53 latest firmware samples
    from seven vendors and a second one 899
  • Not Synced
    firmware gathered from related work. In
    the first case, we can see that the total
  • Not Synced
    number of binaries considered are 8.5k,
    few more than that. And our system
  • Not Synced
    generated 87 alerts of which 51 were found
    to be true positive and 34 of them were
  • Not Synced
    multibinary vulnerabilities, which means
    that the vulnerability was found by
  • Not Synced
    tracking the data flow from the setter to
    the getter binary. We also ran a
  • Not Synced
    comparative evaluation, which basically we
    tried to measure the effort that an
  • Not Synced
    analyst would go through in analyzing
    firmware using different strategies. In
  • Not Synced
    the first one, we consider each and every
    binary in the firmware sample
  • Not Synced
    independently and run the analysis for up
    to seven days for each firmware. The
  • Not Synced
    system generated almost 21000 alerts.
    Considering only almost 2.5k binaries. In
  • Not Synced
    the second case we found the border
    binaries, the parsers and we statically
  • Not Synced
    analyzed only them, and the system
    generated 9.3k alerts. Notice that in this
  • Not Synced
    case, since we don't know how the user
    input is introduced, like in this
  • Not Synced
    experiment, we consider every IPC that we
    find in the binary as a possible source of
  • Not Synced
    user input. And this is true for all of
    them. In the third case we ran the BDG but
  • Not Synced
    we consider each binaries independently.
    Which means that we don't propagate
  • Not Synced
    constraints and we run a static single
    corner analysis on each one of them. And
  • Not Synced
    the system generated almost 15000 alerts.
    Finally, we run Karonte and the generated
  • Not Synced
    alerts were only 74. We also run a larger
    scale analysis on 899 firmware samples.
  • Not Synced
    And we found that almost 40% of them were
    multi binary, which means that the network
  • Not Synced
    functionalities were carried on by more
    than one binary. And the system generated
  • Not Synced
    1000 alerts. Now, there is a lot going on
    in this table, like details are on the
  • Not Synced
    paper. Here in this presentation I just go
    through some as I'll motivate. So we found
  • Not Synced
    that on average, a firmware contains 4
    border binaries. A BDG contains 5 binaries
  • Not Synced
    and some BDG have more than 10 binaries.
    Also, we plot some statistics and we found
  • Not Synced
    that 80% of the firmware were analysed
    within a day, as you can see from the top
  • Not Synced
    left figure. However, experiments
    presented a great variance which we found
  • Not Synced
    was due to implementation details. For
    instance we found that angr would take
  • Not Synced
    more than seven hours to build some CFGs.
    And sometimes they were due to a high
  • Not Synced
    number of data keys. Also, we found that
    the number of paths, as you can see from
  • Not Synced
    this second picture from the top, the
    number of paths do not have an impact on
  • Not Synced
    the total time. And as you can see from
    the bottom two pictures, performance not
  • Not Synced
    heavily affected by firmware size.
    Firmware size here we mean the number of
  • Not Synced
    binaries in a firmware sample and the
    total number of basic blocks. So let's see
  • Not Synced
    how to run Karonte. The procedure is
    pretty straightforward. So first you get a
  • Not Synced
    firmware sample. You create a
    configuration file containing information
  • Not Synced
    of the firmware sample and then you run
    it. So let's see how. So this is an
  • Not Synced
    example of a configuration file. It
    contains the information, but most of them
  • Not Synced
    are optional. The only ones that are not
    are this one: Firmware path, that is the
  • Not Synced
    path to your firmware. And this too, the
    architecture of the firmware and the base
  • Not Synced
    address if the firmware is a blob, is a
    firmware blob. All the other fields are
  • Not Synced
    optional. And you can set them if you have
    some information about the firmware. A
  • Not Synced
    detailed explanation of all of these
    fields are on our GitHub repo. Once you
  • Not Synced
    set the configuration file, you can run
    Karonte. Now we provide a Docker
  • Not Synced
    container, you can find the link on our
    GitHub repo. And I'm gonna run it, but
  • Not Synced
    it's not gonna finish because it's gonna
    take several hours. But all you have to do
  • Not Synced
    is merely... *typing noises* just run it
    on the configuration file and it's gonna
  • Not Synced
    do each step that we saw. Eventually I'm
    going to stop it because it's going to
  • Not Synced
    take several hours anyway. Eventually it
    will produce a result file that... I ran
  • Not Synced
    this yesterday so you can see it here.
    There is a lot going on here. I'm just
  • Not Synced
    gonna go through some important like
    information. So one thing that you can see
  • Not Synced
    is that these are the border binaries that
    Karonte found. Now, there might be some
  • Not Synced
    false positives. I'm not sure how many
    there are here. But as long as there are
  • Not Synced
    no false negatives or the number is very
    low, it's fine. It's good. In this case,
  • Not Synced
    wait. Oh, I might have removed something.
    All right, here, perfect. In this case,
  • Not Synced
    this guy httpd is a true positive, which
    is the web server that we were talking
  • Not Synced
    before. Then we have the BDG. In this
    case, we can see that Karonte found that
  • Not Synced
    httpd communicates with two different
    binaries, fileaccess.cgi and cgibin. Then
  • Not Synced
    we have information about the CPFs. For
    instance, here we can see that. Sorry. So
  • Not Synced
    we can see here that httpd has 28 data
    keys. And that the semantics CPF found 27
  • Not Synced
    of them and then there might be one other
    here or somewhere that I don't see .
  • Not Synced
    Anyway. And then we have a list of alerts.
    Now, thanks. Now, some of those may be
  • Not Synced
    duplicates because of loops, so you can go
    ahead and inspect all of them manually.
  • Not Synced
    But I wrote a utility that you can use,
    which is basically it's gonna filter out
  • Not Synced
    all the loops for you. Now to remember how
    I called it. This guy? Yeah. And you can
  • Not Synced
    see that in total it generated, the system
    generated 6... 7... 8 alerts. So let's see
  • Not Synced
    one of them. Oh, and I recently realized
    that the path that I'm reporting on the
  • Not Synced
    log. It's not the path from the setter
    binary to the getter binary, to the sink.
  • Not Synced
    But it's only related to the getter binary
    up to the sink. I'm gonna fix this in the
  • Not Synced
    next days and report the whole paths.
    Anyway. So here we can see that the key
  • Not Synced
    content type contains user input and it's
    passed in an unsafe way to the sink
  • Not Synced
    address at this address. Now. And the
    binary in question is called
  • Not Synced
    fileaccess.cgi. So we can see what happens
    there. *keyboard noises* If you see here,
  • Not Synced
    we have a string copy that copies the
    content of haystack to destination,
  • Not Synced
    haystack comes basically from this getenv.
    And if you see destination comes as
  • Not Synced
    parameter from this function and return
    and these and this by for it's as big as
  • Not Synced
    0x68 bytes. And this turned out to be
    actually a positive. OK. So in summary, we
  • Not Synced
    presented a strategy to track data flow
    across different binaries. We evaluated
  • Not Synced
    our system on 952 firmware samples and
    some takeaways. Analyzing firmware is not
  • Not Synced
    easy and vulnerabilities persist. We found
    out that firmware are made of
  • Not Synced
    interconnected components and static
    analysis can still be used to efficiently
  • Not Synced
    find vulnerabilities at scale and finding
    that communication is key for precision.
  • Not Synced
    Here's a list of bibliography that I use
    throughout the presentation and I'm gonna
  • Not Synced
    take questions.
    [filler, please remove in amara]
  • Not Synced
    *applause*
    [filler, please remove in amara]
  • Not Synced
    Herald: So thank you, Nilo, for a very
    interesting talk. If you have questions,
  • Not Synced
    we have three microphones one, two and
    three. If you have a question, please go
  • Not Synced
    head to the microphone and we'll take your
    question. Yes. Microphone number two.
  • Not Synced
    Q: Do you rely on imports from libc or
    something like that or do you have some
  • Not Synced
    issues with like statically linked
    binaries, stripped binaries or is it all
  • Not Synced
    semantic analysis of a function?
    Nilo: So. Okay. We use angr. So for
  • Not Synced
    example, if you have an indirect call, we
    use angr to figure out, what's the target?
  • Not Synced
    And to answer your question like if you
    use libc some CPFs do, for instance, then
  • Not Synced
    environment CPF do any checks, if the
    setenv or getenv functions are called. But
  • Not Synced
    also we use the semantic CPF, which
    basically in cases where information are
  • Not Synced
    missing like there is no such thing as
    libc or some vendors reimplemented their
  • Not Synced
    own functions. We use the CPF to actually
    try to understand the semantics of the
  • Not Synced
    function and understand if it's, for
    example, a custom setenv.
  • Not Synced
    Q: Yeah, thanks.
    Herald: Microphone number three.
  • Not Synced
    Q: In embedded environments you often have
    also that the getter might work on a DMA,
  • Not Synced
    some kind of vendor driver on a DMA. Are
    you considering this? And second part of
  • Not Synced
    the question, how would you then
    distinguish this from your generic IPC?
  • Not Synced
    Because I can imagine that they look very
    similar in the actual code.
  • Not Synced
    Nilo: So if I understand correctly your
    question, you mention a case of MMIO where
  • Not Synced
    some data is retrieved directly from some
    address in memory. So what we found is
  • Not Synced
    that these addresses are usually hardcoded
    somewhere. So the vendor knows that, for
  • Not Synced
    example, from this address A to this
    address B if some data is some data from
  • Not Synced
    this peripheral. So when we find that some
    hardcoded address, like we think that this
  • Not Synced
    is like some read from some interesting
    data.
  • Not Synced
    Q: Okay. And this would be also
    distinguishable from your sort of CPF, the
  • Not Synced
    generic CPF would be distinguishable...
    Nilo: Yeah. Yeah, yeah.
  • Not Synced
    Q: ...from a DMA driver by using this
    fixed address assuming.
  • Not Synced
    Nilo: Yeah. That's what the semantic CPF
    does, among the other things.
  • Not Synced
    Q: Okay. Thank you.
    Nilo: Sure.
  • Not Synced
    Herald: Another question for microphone
    number 3.
  • Not Synced
    Q: What's the license for Karonte?
    Nilo: Sorry?
  • Not Synced
    Q: I checked the software license, I
    checked the git repository and there is no
  • Not Synced
    license like at all.
    Nilo: That is a very good question. I
  • Not Synced
    haven't thought about it yet. I will.
    Herald: Any more questions from here or
  • Not Synced
    from the Internet? Okay. Then a big round
    of applause to Nilo again for your talk.
  • Not Synced
    *postroll music*
    [filler, please remove in amara]
  • Not Synced
    Subtitles created by many many volunteers and
    the c3subtitles.de team. Join us, and help us!
Title:
36C3 - Identifying Multi-Binary Vulnerabilities in Embedded Firmware at Scale
Description:

more » « less
Video Language:
English
Duration:
36:36

English subtitles

Incomplete

Revisions Compare revisions