Dear viewer, these subtitles were generated by a machine via the service Trint and therefore are (very) buggy. If you are capable, please help us to create good quality subtitles: https://c3subtitles.de/talk/427 Thanks!
OK, so welcome to my dog.
My name is Angel Brittanie.
I'm the author. I'm doing reverse
engineer visual documentation.
And the title of this talk comes
from my work in
the procedure for publication
of the file for Funky File Format
Polyglot.
So that's where the title of the talk
comes from.
OK, so
this talk is about files and what are the
usual file categories?
It depends if you're a newbie, a user,
a dev or a hacker.
But in general we
typically people are just interested in
exploiting, exploiting
with file formats and typically
valid files are considered boring.
But I
still think the important point
is that the limits between
can you see the top Colosio is valid
written here. The colors are real.
No.
It's supposed to be read here.
OK, weird colors,
so the
the problem is that the frontier between
valid files and corrupted is not
clearly defined and I play with it.
So just let's take an example and
here is a valid file.
So to just to show the kind of valid
files that I like to try, it's not
exploiting everything, but it's maybe
not a standard file.
So this is a JPEG
picture that might ring a bell.
And if you.
Yeah, it's also a Jamma fine
because. Why not.
That's not really complex.
But you can play further if you
apply a yes on this picture.
It's a jpg picture, then you
get a picture.
So it was encryption with a yes, if you
decrypt it with triple digits, then
you get a PDF.
If you include the same file, the same
file once again, but with the different
key, with a yes, again, you get
a flash video.
I could go on and on and on getting
crazy with the proof of concept.
I thought I could do a whole talk
on the with a single file, but
maybe that won't be a real talk.
So at least I hope that by now you're
convinced that I'm just a normal guy and
I just like to play with binary,
although I like to explain
or represent binaries.
And maybe you've seen my posters
in the building. So this is a picture
of them at the top floor.
So it's printed thanks record.
And so I also I play with
binary eyes or light to represent
forces visually for everybody.
And yet all these posters are free to
download and talk about coming, if you
want to get to order a print
on a pillow, if
iPhone case or whatever it is, print out.
OK, so
oops, no, it doesn't work anymore.
What's wrong?
Yeah, so.
Let's not go too deep into to the
technical details and let's go back to
the fundamentals and let's talk about
cows.
So how do you identify
a cow? How would be the possible
ways to identify a cow?
And of course, we can apply the same
model to file somehow.
Is it my head?
Is it my body shape
or is it by the sound?
Well, you can see that identifying
a file could be done by different
way, the same way in a similar
way in practice.
Here is an early file to identify from
French technology.
So basically, you look at the head.
I had fun drawing Guillotine myself,
and so basically, typically the file
type is identified by a signature called
magic that is fixed and forced
and offset.
Some have a meaning, some don't have
most file formats have a magic
signature of Seijiro.
Some don't like the song
archive formats as
particularly the zip, which is also used
in many other formats as AP, Kjaer
and and others.
Some compressor's actually enforce
signature of said zero and
PDF, which I like to abuse
theoretically has to start out of said
zero, but in practice only within
the first first copy
of the file. So that's how I could abuse
it. We'll see that later.
I could have used PDF files.
A lot of important
point for Zipp is that ZIP
does it and it's not a zip and forces
a signature anywhere.
It's actually zip's are written backward
from the from the end.
This is for all good reasons.
When you are writing a zip file on
the fly on multiple floppies, it will
write the last information on the last
disk and it would minimize the floppy
swaps. So basically zip
it enforces. That is sort of the
signature.
I mean, the start the first
structure to be checked is near the end
of the file.
The thing is it's actually not so
respected all the time.
And I did a talk on Zipf schizophrenia.
If you want more details, you can check
it later.
A few hardware, a few formats
are where bound to hardware.
And usually when you have a memory
wrench to be executed by a special chip,
then they don't they don't want a header
there. So basically to ISIL
and B-R, even TGA did start
directly with the data and optionally
they have a header that is later
in the memory space.
So those hardware, those
formats have an excuse because they are
bound to some hardware not to have a
magical tattoff, said zero.
So but in general, a good magic signature
should be enforced of zero and
unique. And if you create a new file
format, please respect this rule because
otherwise it can lead to a few abuse
that will see now.
So if you think how a standard
tool, a standard passing to
act, it just checks the magic.
Then it chooses a path and it
will never return and try something else.
It found the signature. Oh, I chose this
path. It must be just file type and it
will ignore any other file that could
be included in the same file.
So another common, yet important
property that is useful for abuses.
You see a cow.
There is something coming next, but you
definitely see a cow, so it's like
because you can see a complete cow,
then there is a cow, there's something
coming next. It's still a cow.
It's still a valid call.
Right.
Means whatever you put after
it was, you see the full cow.
So you think it's in some fingers
and file formats typically
define a Terminator that
says this is the end of my file format.
And once the Terminator is
you, when the Terminator does nothing
left to pass.
So with this abuse of file formats
and are forced out of said zero and some
files format, allowing
something that comes next, then you can
just stack them up like the
animals of Bremnes and you can end up
doing a file that has several
file types.
So this is an example of a Jahjah being
polyglots.
So Abbink is a special game oriented
video format and I chose a random picture
to display via video.
So you just
create your Behnken. Then you opened
OJARS file, which are just zip.
And as we saw, ZIP does enforce
the starting gate of Z zero.
So that's why judger being polyglot
is possible.
Now another kind of file polyglots
is when you have a host and the parasite.
So if your Frogh,
if you call Swallow's keeps a frog in its
mouth, then it can speak from in.
So the outer space
for the inner wok, a more realistic
example here is our call with
the value of our use data chunks.
And if you call Swallow's a mycorrhiza,
then it's still a valid call, even if it
contains foreign data that is tolerated
by the stomach.
So as an example, I did
this file, which was so it was
a change of Windows
executable and a PDF in the same file.
So it's interesting because you actually
dropping a launching a Java, dropping a P
or a PDF, exploiting and dropping
a B R to valid infection chains.
And those two infection's chains
are present in the same file.
And because I built it entirely
to find myself here you have that the PDF
part of the document is actually inside
of Java.
So it's not just stacking
stuff together, but you put some
one format inside the other.
You have some real life example in the
Wall Street, another example
with a that's actually used for
testing.
Basically, it's a valid picture
here. You see the black line, which is a
picture and it's also a valid JavaScript.
You abuse the header so that it starts a
JavaScript comment and you close the
comment and then you put your JavaScript.
So it's a valid JavaScript and picture.
You can break a lot of stuff with that.
It's also available in vampy flavor
for pen testing purposes.
So they say this kind of
host parasite exploitation tricks
already exists in the wild.
It was represented in some famous movies.
It is just that inappropriate use of
unallocated space left or
made possible inside the outer
file format.
So as I said, I worked on
the.
If you're not familiar with this very
nice publication.
It's really interesting to read, but also
the file itself.
So the issue, too, was bootable, booting
much Bangalore's.
It's also a zip and a valid PDF.
The issue tree.
I got a bit crazy.
It was a valid radio
message and a jpeg and if
you are encrypted you get a plug
in a zip issue
for was a valid true crit container
pdf and a zip.
And I just created this and two days
after to discontinuity
it.
The issue five was isoprene
and a flush, so that's
isoButane, a Tetris game.
Would you just explain it in the article
and you have the flash, which was
rickrolling the audience.
An issue six is the latest
issue that was out last month is also
atah a PDF and zip.
And this is one of the example.
If you open with a lot of PDF readers to
just see, oh, it starts with the tar,
like the picture outturn picture.
The reader says it's a tar.
I open it as a term.
They never see the PDF.
You imagine that was a security tool and
you maybe you got to win or lose
depending on your side.
So a few interesting
other polyglots over Java, JavaScript,
so it's two sources of JavaScript, you
are using the source parser of the Java
compiler. I mean, compiler.
Yeah, so that's it's a
Java and JavaScript in the same source
file. Or you can do the same at
a binary level so that you can
tell your friends that Java is equal to
JavaScript and. Yes.
Now it's proved,
OK, so not polyglots anymore,
but still worth playing with
because they always have funny results,
if you do extreme fast, like way too
small a way too big, they tend to bypass
filter. So an analogy that's
actually a hoax. So the farmer got denied
a permit to build a whole shelter.
So he just built a giant table to protect
his horse and he doesn't need a permit.
So that's actually a hoax.
But you can feel it's almost really
right. And if you do it the other way,
if you make a valid PDF file for
Adobe Reader, so that's a complete file
that is usually too small for
software to consider.
It can be valid then to just reject
it and they will not pass it as a PDF.
So you can bypass scanners
and security to feature
predictions by creating a file
that is too small to be likely
uncorrected, valid, or you can do the
opposite. You can do a huge file.
So here with a 64 K of S.P.,
it was crushing directly
only debug and other tools because you
just if they were trying to allocate
everything even worse, the whole every
section was fully executed, even though
they are physically empty.
They were taking a lot of all
of them, some space in memory and they
were all executed.
And it takes actually a few seconds on
the modern computer to run, even though
it does nothing but a lot of
nothing.
So you crash not only not only slow to
execute directly natively,
but also you crush a lot of analysis
tools with similar files.
So now which saw the how to combine
files types, but you can also
object to passing.
How do you pass a cow?
This is how a user sees a cow.
So how do people pass cars?
Well, you all know you have
an image of cows passing.
This is how they could
pass a cow.
But it turns out that not everybody
agrees. And this is how another Dev
sees a cow. So this is French
beef cuts of a cow, the official
beef cuts of a cow.
And these are the Brazilian ones.
So you see it's the same
data and different parts are different
interpretation for different
implementation of cow passing.
It would have been too easy like mankind
really, not just sex with computers,
but also with cow crossing.
So as you see, the
same cow can be seen in
completely different ways.
I mean, OK, the head is still the head,
luckily, but still the parts are
different because the standards are
different.
So if you abuse that, you can, for
example, create a PDF that
has three different trailers.
The trailer is the defining the root
element of a PDF.
So this is the same file.
And with three different viewers, it
gives you the three random pictures.
And because two readers
are not so chrome and
new PDF readers
are not respecting the standard
like Adobe, then they see a different
route document and they see a completely
different document to be passed.
So basically one file,
but three different document and the
other readers don't see
the other document, the two other
two documents at all.
It's not a trick in a conditional if
by detecting the reader version or
anything or another
one a bit different here, but it's
actually using a feature.
But you have the PDF that shows something
and when it's time to print it chose
something completely different.
And here, it's not lack of
respecting the standard, it's actually a
part of the standard, but unknown to
most people because, yeah,
it's a security, but oh, no
obfuscation by yourself.
Not security by obscurity.
But yeah, basically the standard is
complex with a lot of unusual, not so
useful for everybody.
Are not security oriented features, I'd
say.
Or this is a presentation I did
that last year.
So this was my presentation, it was my
first binary inceptions and it was the
same file was the PDF.
You were in the PDF slide.
So basically the the file
was viewing itself.
And at the time the people were watching
the slides, but they were actually
already watching the demo because it was
the file running on itself
and it was also a Java file
and a JavaScript with Mario.
OK, because why not
in the same file if you run it
into different viewers, you have it
was also schizophrenic.
So you would have a different document
with open with a different view.
So a bit combining everything
in one proof of concept.
And this time it was not written by hand.
It was like really generated.
And that's now what we do for.
It's it's it's a make file that
combines everything. It's not me crafting
manually the file
until the end. And although we care
about compatibility, that's the problem.
OK, so another
problem that for security in general is
that you have unexpected passes
and that's not mine.
But that's I don't
know how to say l came tough.
Who basically found the
expectation with the strings comment.
So that's a CV and basically you would
expect that strings to come on line
two. Yeah.
Is doesn't pass anything but just looks
fostering, even though it's actually
calling parsers and it's actually it was
exploitable and it's a civilian.
And now he also did that with less.
So the problem is that not only you have
different passwords, but also you have
partners in an unexpected place.
So don't run
strings on a known file, don't run
less on unknown file, don't do anything
basically because you never
know, especially if the file comes from
you.
Who my.
OK, just a little parenthesis
on metadata. But, you know, people like
to attribute oh there's a Chinese string
here. Oh it must be China or North Korea.
Yeah. Why not.
Yes, of course.
And metadata and metadata.
Because you cannot see the head in
easily then you just brand
the cattle with a branding.
And the problem is this. Running errands
can also be faked or patched
into another symbols like you extend
the sign on the cow to look like
something else.
And the conclusion is that attribution is
hard. And the
important thing for us, I don't really
care about cows, but still we need a
proof of concept of a real
branding Irun that we didn't have a cow
to just check about metadata
modification life.
But just for a few careful sake
we did. I asked Munin to actually forge
a branding iron just for the sake of the
presentation. That's me.
I'm a normal guy.
OK, now let's change a bit
from five types and let's move a bit
to crypto stuff.
And the important thing is that
usually when you encrypt file, you
think that the result is encrypted
in the terms of it looks random.
So the operation of encrypting a file
is usually thought
as being random.
But it's wrong, as you saw in the
introduction, and they're
the result of encryption can be valid.
So I try to introduce that quickly
without all the advanced details.
I did another presentation on that
before.
So basically, let's take two fake
I mean, yeah, fake file
formats. And so we have
a data file format and we have a text
file format. And the properties that are
important is that data and
the Terminator and what
comes after this intermediator is
ignored.
So that data is tolerating
a penny. Data and text also
tolerates a comment like we just
take the normal comments so you
can as soon as the source format
tolerates upended data and the
target format tolerates has a way to
to do to have a host parasite
polyglots data, then this is
you can you can apply that.
So basically, if you encrypt with
a yes, you get something random in
general, you cannot control
what you have in input and
what you have in output because that's
yeah. Encryption is still
not broken to my standard here, atest.
But the thing is a yes is a block cipher.
It just works with block and
if you work with the file then
it needs to work with the mode of
operation.
Usually what people think no about this
is that if you use the ECB
mode, then you can still see the pinguin
and you know that this is bad encryption.
So if you use
a mode of encryption that just takes
every rock and
keep them independently, then
each identical block will get this gives
you the same results.
So you can it's not good encryption,
basically. So one of the mode, the CBC
mode is actually
using an extra parameter, the
initialization vector that you initially
are with the first plaintext block.
So basically this is
an extra parameter.
And then after encryption
by A-S with a given key,
then you get the first cipher block.
The thing is this operation is you can
do it backward, you can decrypt and
also you can decrypt.
So basically, if you define the first
plaintext block and the first cipher
block, then you can.
You can. And the key is
the defined once for all.
Then you can craft initialization
vector that will actually
make this block and create into this
block.
So now we control.
We can control one block
of outputs and then the rest we can
don't control that anymore.
OK, but at least now
we can craft an
initialization vector so that the first
block is something that makes
it valid and we still have control of
something. OK, now what about the random
wrist? What comes next?
We don't control it anymore because it's
a result of a yes.
We don't control any parameters anymore.
We cannot do we cannot manipulate that.
So basically, we just
here we use a a
feature of the text format of the target
format so that our initialization
vector starts a comment.
So this will be ignored.
OK, now we have chosen initialization
vectors so that this encrypt text start
equipment.
So the magic signatures start comment and
this is ignored.
Now, if we take this file and we actually
close the comments, we just append data
and the original data, then this
file, this file is.
Correct, and it's equivalent
to the initial file we wanted to have as
a result of our encryption.
Now, the thing is, if we
actually just decrypt with the same
initialization vector, we get
the initial blocks, because these blocks
here, we're just depending on the first
block, not on the next blocks.
So we get we we get
back to the original data file
and we have something random
that we don't control. But it's after the
end term Terminator.
So this is ignored and this is still a
valid data file as we wanted.
And this is the text file which has the
content that we want.
It's not exactly the original file, but
for parsing perspective, it's exactly the
same file, just using a comment on
something garbage.
So that's basically the trick of what was
called encryption.
And that's what I used in different ways
with PDF flash videos in the
introduction.
So now, because
a CBC only works
what comes from the previous block, then
this will indeed encrypt correctly as
what we wanted. So now we have we
can encrypt this file with a yes
into this file because we control the
initialization vector.
But it's perfectly normal.
A yes and a CBC
is seen as secure.
So it's not a problem.
It's not that it's broken.
It's not that CBC is bad.
Like ECB is just
stender normal.
It's a part of the specs all along
because the file format tolerates extra
data and appended data.
So that's the layout of the files
before and after encryption and all of
you.
And you can even try it at home with just
openness. For example, if you
want to entertain your kids or your
friends, you don't need much and
you should try. It's very good.
Go to bed now.
OK, I'll let you try.
OK, another kind of polyglots that is a
bit autistic, but it's interesting
because sometimes
the advance file process just look
for the body because they saw this
ahead. They saw a JPEG header
and it's oh here is my JPEG data.
Now let's skip forward and
this is a jpeg,
a zip and a PDF and
the PDF shows the image to
the JPEG is the image and the zip
contains the image, but the image is
present only once.
So basically you put three hedges and you
make them point to the same data.
So if by any chance an advanced tool
was just checking the bodies,
then it will just see one file type
and it will ignore the others.
So this is a layout.
I'm not sure it's really visible now, but
basically you have the layout of the file
and JPEG pdf and zip.
So JPEG starts first because it enforce
the magic at zero, then PDF and zip
and the image data is only seen once.
You still need to abuse the format
of. So for example, you have a part of
the PDF structure into the zip comments
because it was not made
to to be done.
So initially tough problems.
OK, a different one.
This is a picture of a cat or a proof of
concept, and it's a BNP that is
not compressed.
BNP has a funny
characteristic that enables to define
the bitterness of each color,
and if you might be to a 32 bit, then
you can have bits of free space.
So you have for each other.
So you have for each W.L.
You have six, sixteen bits that you can
control. What can you do with that?
Well, you can put some sound
so that you can play the picture
seriously.
And I know you can.
I won't make the demo because that would
explode your ears. I mean.
Well I could but you will not like me for
that. But OK, you have sound.
So initially we put some natural music
into the amp that was playable.
It's not steganography because you can
play directly from the sound player,
it's just roll PKM.
But we went we went further.
So if you consider the BNP Arabism
and you uncowed a picture into
sound, so that is viewable via Sock's
as a spectrogram, then you can
have another picture in the picture when
they buy sound.
So I'll never forget to.
So never forget to open your favorite
picture in the sunflower
and you have all the gels here, and
Philip DOEN actually did further and
he did with three channels, including
each RGV picture, and
he could represent that's the actual
spectrograms view of the day.
Did some data that is integrated in this
picture. So with represented with
borderline. So this is image and this is
sound.
OK, another kind of artistic
file. So this time it's you have
to do twice
to two to two heads with the same
type fall the same body.
And of course, it's not steganography
once again, because the data doesn't need
any extra instruction.
It's usable directly.
And but it's it's interesting.
So I just want to do it live.
So this is RGV picture
in his work, his
boots with small.
So words were
that this is his picture, so it's a
it's a picture and this
is RGV picture, so let's
show it again. So basically the data
is made of triplets of
bites and four red, green and
blue colors.
OK, the trick with that picture
is that we
Wolds.
Does it work? Yes, that works, we
added the palette, the random palette,
and basically
the trick is that when you have.
When you have a picture data for a
pallette, then each byte is an index in
the palette.
So the idea is that
you adjust each RGV
value red green room so that
it actually maps to a different.
The color in the palette
so that it's a valid argue, it's also
a valid picture you probably won't do.
And so basically you have a second
picture that is stored in the same data
via the palette.
And in this case, this is the picture
and this is a barcode inception
because you have a QR code and a data
matrix code inside.
So depending on your reader, then
you you will see one on the other.
The danger is also, if you can directly
or if you just swipe, because if you
swipe, it will see the smaller one first.
So just it's usually you can
see it. You can see the data matrix here.
It works better with a white line.
So you can notice it if you
are trained.
But if you didn't know, then maybe check
twice. I mean, feel free to scan it.
You can trust me.
No worries.
OK,
I also worked with a
famous cryptographers and they created
a collision of a modified version
of Sean.
So this is the full show on all
the rounds. But it's just that Sean has
five constants, internal constant, and
you just modify four of them so
that it looks secure like Sean.
But we actually can control
something and get a collision.
OK, the collision rules are complex
and it gives you this.
OK, so you have these two blocks that
collide like
a really impressive and the rules are a
bit complex at most three consecutive
bytes without a difference in everyday
world, only the middle two bytes have no
differences. OK,
and this takes like between
15 and 30 hours to compute
on 80 cores.
So this is a modified Shewan
collision, but it's not exactly super
impressive. Right.
OK, so my my task was to abuse
that in the valley with a valid file
format and JPEG has
the nice ability to have several.
So it has a very short signature and
then it has the several markers e0
you into each way that we can
that are all valid.
And then we just abuse the lens so that
we can combine two pictures and
then we this
question marks, we don't control them,
but at least we know we can put
something at the end of the all the good
things that the length is not too long is
just on the word, not a double word.
So you can at the end of
this length that was generated
by the cluster. So we don't control you
can put back the start of the next image.
The result is a bit more visual to random
pictures.
So that's actually collide with a
modified Sean.
And it will just work with the
most jpeg sighs
I think with any GPG, and
that was just before the final.
So yeah, just a coincidence.
And of course, because the problem is
that the backdoor only gives you one
collision block, not as many collision of
you as you wish.
It's also interesting to actually turn
this collision into a military type of
polyglot collision so that we could
actually make not only a collision
with value various file types, but also
with us.
So we have the collision, but also with
time so that the battering is more
efficient. Potentially, it doesn't mean
Xiaochuan is broken, but it was certainly
an interesting experience from the file
format perspective.
OK, this one is a real demo,
you know, the probably the phony award
and Tony Awards has different categories.
And one of the categories, the best song,
which I'm not sure is boning a lot of
things. Exactly.
So Melissa
won the award.
That's really true.
You can, you know,
use can you get
that? I made a PDF with her picture with
the pony and the lyrics.
OK, but
Melissa, also a bad idea also
can.
Yeah, well, I'm not sure if I should
disclose this yet.
What happened. I do.
I hope I have some.
Oops. Were you?
So this is a new kind of
music of the polyglot.
So you have the music, the movie.
Why did it stop? I don't know.
Now you have a good proof of concept,
you have the picture, the song,
the lyrics and the song.
I don't know why they so.
So obviously, never forget to open your
PDF in your favorite consolingly leader.
Actually, I went further and maybe
you remember that this picture,
if you're old enough, I mean, I'm young,
but and
in the similar way I use this
is as you can expect to once again,
this is a PDF document and
the document is a valid
Super Nintendo and make a driver on.
With the funding logos of their.
OK, so
I still have plenty of time, do I?
Yeah, I would love.
Oh, I don't know.
Well, yeah, I do, I do the
news first.
I mean, we still have a lot of time,
right? Yeah.
Oh yeah. So another one.
I'll go back to this.
Oh yeah.
I love the conclusion. I can draw the
conclusion in the book.
So the conclusion.
Don't forget what you learned today.
Open in the Senate, are your
pictures in a song player or a console
emulator, just apply any cipher
in case and double check what you
printed.
So a more serious
advice for today, for security
reasons, don't do anything
and for resarch reason, try everything.
And especially if you say that you got
something to stop the marketing
and just stop blaming people.
Oh, they got owned because usually people
blaming the other oh, they got on are
usually people who just want to sell a
security solution and
see proof of profit or get the fuck out
because that's annoying to see all the
people earlier we heard this, but we
we cannot prove it or anything.
That's really annoying. I think as you
can see, I like to open up say all the
proof of concept of this deck are
public and everything on they will be on
the website a
bit more seriously.
So for the file formats,
there are many abuses of the specs in
many ways, as you can see, but
the specs itself are often wrong
or misleading.
The thing is, there is no one
who steps in and
says, OK, now we want to have like
a secure zipf, secure,
zip secure.
We just leave the people who originally
created the spec maybe update
them and then we follow them blindly.
And there is we have
had, you say, reaction of the infosec
community when there is an expectation.
But because the specs suck,
there is nothing like say, OK, now let's
enforce, I don't know, something like
zip secure a new aura
or something that
would be more restricted to security
and not keep it in
control of the company that is just
marketing their professional product.
But it's still not really secure.
You know, a bit like a public
reviewing look, exactly like for crypto
cyphers.
Format specs don't have this.
And it's the
the um, the specs usually
are really misleading
and there are very few public
passes and even fewer detectors
like Postle that really understand what
the file format is about, not just the
structure and the world and everything.
And now it's
humanity goes in the wrong way, as
usually mankind.
And for example, standard tools like
Office, Adobe,
Adobe Reader, they
have a they had a secondary of
passing mode where they say, oh, this is
detect is looks like it's cartoon.
Maybe I could recover it.
And they have a site.
You can see that they have a secondary
mode that is even more lax than the
official one and just it
really puts back together.
Oh no, it's valid. OK, executed and
suddenly you have something that
shouldn't be valid at all.
This is just recovered.
Thankfully, it's good for user,
but for security it's not.
Or sometimes it's actually
annoying. Like, for example, Windorah has
a different parsing mode when it's
viewing the file in which extracting.
So, yeah, what you see is not
what you paid, what you what you list
is not what you extract and everything.
Yeah, very difficult.
And once again, this was a kind of
overall talk on the possibilities.
But for the technical details, check my
previous stocks because I went in
transcription with details to create
and everything or my articles in.
Thanks a lot to everybody
in.
I have some bad news, but maybe first.
Oh, yeah, so that's.
So do you have any questions?
So if you got any questions, please line
up at the microphones
and, uh, yeah, let's stuff
my phone to, um,
from your experience, do you think it is
possible to write a
file parser that will
will properly decode something
as seemingly easy as a
file?
Because Google a couple of years ago
decided they couldn't do it and
they decided, like for Gmail, when they
want to display pictures, images,
they they wanted to sanitize
the bitstream.
And finally they decided they couldn't do
it. So they changed their model.
So it runs in a different security
context. So do you think it's
possible to write a parser that
is clean and can produce a cleaned
up version of a file of
people? People are trying that.
I'm not trying personally.
I would first like the specs to be
a bit more reasonable,
but I don't know about the formerly
possibility of this and everything.
But it's what I see is that
when they say this buffer should be null,
the pastors are never saying, oh, if
there is an internal right here, let's
return.
If I am in secure mode and say no,
it should be null. So let's be a bit
German and strict and.
OK, then, microphone one, please.
So what would your concise
advice be for someone, say, designing a
new binary file format?
I mean, seems to me it start with a
simple header.
Make sure you check how you know that
there's no garbage at the end and then
that's at.
Well, first, it depends if your file
format is like made of pointers, like
it's made to be executable, executed by
anois or if it's like a structure,
there's a sequence of structure
like images.
But, uh, yeah, for those OS formats,
you should it's difficult
to enforce that because the loader
evolves and
you.
And then people have
their own interpretation with the
compiler, but at least I was thinking,
when I'm enforcing the actual content,
it's more with data file format and yet
OS at least the thing is with the OS,
usually you have one standard louder than
no one knows fully, but it's like
really defining the standard because it's
not like everybody likes to write his own
fladell for no reason.
And it's like we need to have two.
Thanks.
OK, microphone three.
Well, first of all, thanks for the talk
and also thanks for your work in your
ETFO.
I have one question. First of all, where
can I download this presentation?
And secondly, how many programs should I
try it with?
I need to find out.
OK, yeah, all of your extra spoilers
full, but I have my secret.
Thanks for this microphone. Well, yeah,
you mentioned that in the press pack.
There are basically two separate parts of
us, kind of one for viewing and one for
printing.
But that sounds like a really bad idea.
Do you know why that is?
Is it for historical reasons or.
No, it's not actually the same in
this case. It's not kind of two Pasos is
just you.
You use
it for what you do are the requirements
of the screen or the requirements of the
printer.
So it's actually you enabled or disabled
some content here.
It's not a discrepancy.
It's a part of the specs.
So the printing, the schizophrenia's
actually the only one that is
it's official.
Yeah, it's layers, and you make one
layer appear on by default for
printing and the other for viewing,
and it's because people are not used to
enable or disable layers, then you can
abuse that. But to me, I accidentally
found a few days ago with the manually
edited PDF, a different schizophrenic
from Chrome printing under Linux,
where suddenly a perimeter was ignoring.
You could have that, but I didn't have
the time to experiment that further.
And this time it was true schizophrenic.
Like what was what was on the screen
was different and it wasn't a feature
on its a feature for me, but
thank you.
Want free and thanks again for the talk
and I have a question, how did you find
out about all the possibilities,
about the different puzzles?
How did you find out what
you can exploit?
Did you just read the specs
and see, OK, I can come in there
and I can open there and it's still valid
and then I can combine these two formats
or that you just did exhaustive
testing. So it's a part of my workflow.
When I'm doing a poster, I'm reading
the specs a bit, but just enough
so that I can create a file manually.
But to be able to explain it in a
clear way and make it small,
I need to be sure that I know
what each byte, how each
byte is there, just in case I could
remove those bytes and make the file
smaller so that it fits on the poster and
then in the end actually created most of
this file manually.
So I have a good
I have total control of the file.
That's why I could mix the Java in PDF
all together, because they are all
written in Assembly 686.
But and
and then I can easily experiment, say,
what happens if I change a pointer here?
If I suddenly add buffer and
I get a blue screen or different result
or everything. So it's not
the differently
exploitation research, but it's because
I study because I want to make sure what
each byte is for, for the clarity,
for the final result of the clarity of
the poster. Then consequently I
can manipulate every structure of the
file freely.
And this happens sometimes.
But many of those were discovered by
accident, like OpenNet in different
viewer. And you get a crash or something.
OK, but it's not active fuzzing
exploitation. And I
just read the part of the specs that I
need to for my
limited understanding and I don't go
through the whole specs myself.
OK, thanks.
OK then we've got a question from the
Internet. Yeah, this question is actually
two questions are kind of a combined
question. Somebody wants to know
what are there any like countermeasures
and if they are, and how
could you detect that somebody that like
this advanced binary magic.
What are the countermeasures and sorry,
and if you can detect if somebody
did this stuff to a fire.
Well, you can still check if there is
something a day after the data,
you can still see it's
a problem that you
can you could check if a buffer
is big and it's not used, it's not a
reference anywhere in the source I'm
thinking about of fix a little later,
work on Flash.
And as far as I saw, it was a sanitizer
for flash files.
So it was really rewriting the flash
files in a clean way.
And as far as I know, no one was
really interested.
So even though it was fully
working tool. So not not
a people just want to open the files
anyway. It's it's so this work
should be done really at the specs level
and not as an extra tool.
So there are countermeasures, but when
they are well done then people don't use
them.
OK, I want to hi,
I would like to know whether you have
ever tested how your pilots
behave in a forensic environment like
X-rays and Case STK
or something like that?
Oh, not really.
I heard of funny results with the various
security tools, but I'm not trying
actively.
And you.
Yeah, I expect the
surprises, especially if
you see my previous talk on news
that was focused on schizophrenia,
where you have a zip file that was passed
in four different ways, different
depending on the tools.
But I don't try that a lack of time.
OK, thanks.
We've got another question from the
Internet. Yeah.
The question is, do you think we need to
return to raw and plaintext
ASCII and ask you outfought
textual representation?
No, but no, absolutely not.
But it's just that
if you think about it when you have the
specs and it says this is reserved and
should be zero one, how many parcels are
actually saying there's something wrong
because it's not zero?
Maybe I'm old fashioned, but definitely
as soon as you such a field and I can
write some whatever in there
and as long as I can allocate a buffer,
I can put whatever in there.
So no,
not going back, but at least
not being afraid to enforce a few things
like you have for like say go
them where people have public reviews
before things are going public housing.
OK, ever any more questions?
Not just a few of the bonds that I
had.
OK, OK, so
bond stage,
yeah, the the abstract
of that all that talk was
initially ASCII only because an abstract
needs to be asked and a PDF polyglot
with some mascot.
So that's probably why people were afraid
to actually check my abstract in the
first place. But
the far plan removed
all the new lines. So I went back to a
standard abstract.
But that was that's that's a file name of
the archive of the
a solar
designer did a great keynote
a few months ago and his keynote
was is the title was is InfoSec
again. And the keynote was a game
that he for which he used an old engine
and he used some very nice graphics with
that can ring a bell, including
a DeLorean.
And he the whole keynote
was a game that he played through and he
made all the interactions
you have.
I don't know if you go to fail
peak exploit patch
sites, really, but it's a bit difficult
for people to just enjoy his
game because it would have to run it into
the Xbox and everything and go through
the game without knowing really what to
do. Not everybody has the time.
So he created screenshots of all
the games and I just
I just wrote it by hand.
The PDF that contains all the screenshots
in the original resolution with Bundall,
the actual games so that you can run the
game from the PDF because why not?
So that's a good way to distribute it as
a single file with everything without
any huddle.
Judges, Quine, Quine, people you
see artistic, valid, Feisal's, Quine,
I don't do that much, but just in
case.
So Quine is just a file of Prichard's
outsource.
So basically this is a file that
prints is on source.
But once again, I don't use linkers.
I create the whole header
structure myself.
Then you can do that.
Yeah, you are very sexy
using the Campanello chip to my Stener
or Linko.
So you have Quantrill's and basically
you have an elf that creates the
source of a P and P
when you create the source of an elf.
But I'm really a little player
here because there's a Japanese guy who
did that with 50 languages.
Oh, yeah, a few other anti-corruption
proof of concept, the initial one saw you
encrypt these into these and etcetera.
So I had fun with random pictures once
again.
Uh, then you can also combine.
So this is a polyglot with the
hash collision and schizophrenic, because
if you think about it, it's always
possible. It's more artistic
and that's about it for today.
Thanks for your attention.