-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.html
745 lines (301 loc) · 29.5 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
<!DOCTYPE html>
<!--[if IEMobile 7 ]><html class="no-js iem7"><![endif]-->
<!--[if lt IE 9]><html class="no-js lte-ie8"><![endif]-->
<!--[if (gt IE 8)|(gt IEMobile 7)|!(IEMobile)|!(IE)]><!--><html class="no-js" lang="en"><!--<![endif]-->
<head>
<meta charset="utf-8">
<title>Diary of a reverse-engineer</title>
<meta name="author" content="Axel Souchet, Jonathan Salwan, Jérémy Fetiveau">
<meta name="description" content="Introduction The main goal of today’s post is to show a bit more of what is now possible with the latest Windbg (currently branded “ …">
<!-- http://t.co/dKP3o1e -->
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="canonical" href="http://doar-e.github.io">
<link href="/favicon.png" rel="icon">
<link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css">
<link href="/atom.xml" rel="alternate" title="Diary of a reverse-engineer" type="application/atom+xml">
<script src="/javascripts/modernizr-2.0.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>!window.jQuery && document.write(unescape('%3Cscript src="./javascripts/lib/jquery.min.js"%3E%3C/script%3E'))</script>
<script src="/javascripts/octopress.js" type="text/javascript"></script>
<script src="/javascripts/jquery.tableofcontents.min.js" type="text/javascript"></script>
<script src="/javascripts/generate-toc.js" type="text/javascript"></script>
<!--Fonts from Google"s Web font directory at http://google.com/webfonts -->
<link href="https://fonts.googleapis.com/css?family=PT+Serif:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=PT+Sans:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
<link href='https://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Fjalla+One' rel='stylesheet' type='text/css'>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-43481215-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<style>
p { text-align: justify; }
</style>
</head>
<body class="collapse-sidebar sidebar-footer" >
<header role="banner"><img src="/images/sigle-blanc-250px.jpg"></img>
<div class="header-title"><a href="/">Diary of a reverse-engineer</a></div>
<br><div class="header-subtitle">Because we like to play with weird things.</div>
</header>
<nav role="navigation"><ul class="subscription" data-subscription="rss">
<li><a href="/atom.xml" rel="subscribe-rss" title="subscribe via RSS">RSS</a></li>
</ul>
<form action="https://google.com/search" method="get">
<fieldset role="search">
<input type="hidden" name="q" value="site:doar-e.github.io" />
<input class="search" type="text" name="q" results="0" placeholder="Search"/>
</fieldset>
</form>
<ul class="main-navigation">
<li><a href="/">Blog</a></li>
<li><a href="/blog/archives">Archives</a></li>
<li><a href="/about">About</a></li>
<li><a href="/presentations">Presentations</a></li>
</ul>
</nav>
<div id="main">
<div id="content">
<div class="blog-index">
<article>
<header>
<h1 class="entry-title"><a href="/blog/2017/12/01/debugger-data-model/">Debugger Data Model, Javascript & X64 Exception Handling</a></h1>
<p class="meta">
<time datetime="2017-12-01T06:59:00-08:00" pubdate data-updated="true">Dec 1<span>st</span>, 2017</time>
</p>
</header>
<div class="entry-content"><h1>Introduction</h1>
<p>The main goal of today’s post is to show a bit more of what is now possible with the latest Windbg (currently branded <a href="https://blogs.windows.com/buildingapps/2017/08/28/new-windbg-available-preview/">“WinDbg Preview”</a> in the Microsoft store) and the time travel debugging tools that Microsoft released a few months ago. When these finally got released, a bit after <a href="https://cppcon2017.sched.com/">cppcon2017</a> this year, I expected a massive pick-up from the security / reverse-engineering industry with a bunch of posts, tools, scripts, etc. To my surprise, this has not happened yet so I have waited patiently for my vacation to write a little something about it myself. So, here goes!</p>
<p>Obviously, one of the most <em>noticeable</em> change in this debugger is the new UI.. but this is not something we will talk about. The <em>second</em> big improvement is .. a decent scripting engine! Until recently, I always had to use <a href="https://pykd.codeplex.com/">pyKD</a> to write automation scripts. This has worked <em>fairly</em> well for years, but I’m glad to move away from it and embrace the new extension model provided by Windbg & Javascript (yes, you read this right). One of the biggest pain point I’ve to deal with with pyKD (aside from the installation process!) is that you had to evaluate many commands and then parse their outputs to extract the bits and pieces you needed. Thankfully, the new <em>debugger data model</em> solves this (or part of this anyway). The third new change is the integration of the time travel debugging (TTD) features discussed in this presentation: <a href="https://cppcon2017.sched.com/event/Bgsj/time-travel-debugging-root-causing-bugs-in-commercial-scale-software">Time Travel Debugging: Root Causing Bugs in Commercial Scale Software
</a>.</p>
<p>The goal of this post is to leverage all the nifty stuff we will learn to enumerate x64 <a href="https://docs.microsoft.com/fr-fr/cpp/cpp/try-except-statement">try/except</a> handlers in Javascript.</p>
<p>So grab yourself a cup of fine coffee and read on :).</p>
<div class='entry-content-toc'></div>
</div>
<footer>
<a rel="full-article" href="/blog/2017/12/01/debugger-data-model/">Read on →</a>
</footer>
</article>
<article>
<header>
<h1 class="entry-title"><a href="/blog/2017/08/05/binary-rewriting-with-syzygy/">Binary Rewriting With Syzygy, Pt. I</a></h1>
<p class="meta">
<time datetime="2017-08-05T16:08:00-07:00" pubdate data-updated="true">Aug 5<span>th</span>, 2017</time>
</p>
</header>
<div class="entry-content"><h1>Introduction</h1>
<p>Binary instrumentation and analysis have been subjects that I have always found fascinating. At compile time via <a href="http://doar-e.github.io/blog/2016/11/27/clang-and-passes/">clang</a>, or at runtime with dynamic binary instrumentation frameworks like <a href="https://software.intel.com/en-us/articles/pin-a-dynamic-binary-instrumentation-tool">Pin</a> or <a href="http://www.dynamorio.org/">DynamoRIO</a>. One thing I have always looked for though, is a framework able to statically instrument a PE image. A framework designed a bit like <a href="https://clang.llvm.org/">clang</a> where you can write ‘passes’ doing various things: transformation of the image, analysis of code blocks, etc. Until a couple of months ago, I wasn’t aware of any public and robust projects providing this capability (as in, able to instrument real-world scale programs like Chrome or similar).</p>
<p>In this post (it’s been a while I know!), I’ll introduce the <a href="https://github.com/google/syzygy">syzygy</a> transformation tool chain with a focus on its <a href="https://github.com/google/syzygy/tree/master/syzygy/instrument">instrumenter</a>, and give an overview of the framework, its capabilities, its limitations, and how you can write transformations yourself. As examples, I’ll walk through two simple examples: an analysis pass generating a call-graph, and a transformation pass rewriting the function <code>__report_gsfailure</code> in <a href="https://msdn.microsoft.com/en-us/library/8dbf701c.aspx">/GS</a> protected binaries.</p>
<div class='entry-content-toc'></div>
</div>
<footer>
<a rel="full-article" href="/blog/2017/08/05/binary-rewriting-with-syzygy/">Read on →</a>
</footer>
</article>
<article>
<header>
<h1 class="entry-title"><a href="/blog/2016/12/21/happy-unikernels/">Happy Unikernels</a></h1>
<p class="meta">
<time datetime="2016-12-21T18:59:00-08:00" pubdate data-updated="true">Dec 21<span>st</span>, 2016</time>
</p>
</header>
<div class="entry-content"><h1>Intro</h1>
<p>Below is a collection of notes regarding unikernels. I had originally prepared this stuff to submit to EkoParty’s CFP, but ended up not wanting to devote time to stabilizing PHP7’s heap structures and I lost interest in the rest of the project before it was complete. However, there are still some cool takeaways I figured I could write down. Maybe they’ll come in handy? If so, please let let me know.</p>
<p>Unikernels are a continuation of turning everything into a container or VM. Basically, as many VMs currently just run one userland application, the idea is that we can simplify our entire software stack by removing the userland/kernelland barrier and essentially compiling our usermode process into the kernel. This is, in the implementation I looked at, done with a NetBSD kernel and a variety of either <a href="https://github.com/rumpkernel/rumprun-packages">native or lightly-patched POSIX applications</a> (bonus: there is significant lag time between upstream fixes and rump package fixes, just like every other containerized solution).</p>
<p>While I don’t necessarily think that conceptually unikernels are a good idea (attack surface reduction vs mitigation removal), I do think people will start more widely deploying them shortly and I was curious what memory corruption exploitation would look like inside of them, and more generally what your payload options are like.</p>
<p>All of the following is based off of two unikernel programs, nginx and php5 and only makes use of public vulnerabilities. I am happy to provide all referenced code (in varying states of incompleteness), on request.</p>
<div class='entry-content-toc'></div>
</div>
<footer>
<a rel="full-article" href="/blog/2016/12/21/happy-unikernels/">Read on →</a>
</footer>
</article>
<article>
<header>
<h1 class="entry-title"><a href="/blog/2016/11/27/clang-and-passes/">Token Capture via an Llvm-based Analysis Pass</a></h1>
<p class="meta">
<time datetime="2016-11-27T20:43:00-08:00" pubdate data-updated="true">Nov 27<span>th</span>, 2016</time>
</p>
</header>
<div class="entry-content"><h1>Introduction</h1>
<p>About three years ago, the LLVM framework started to pique my interest for a lot of different reasons. This collection of industrial strength compiler technology, as <a href="http://llvm.org/pubs/2008-10-04-ACAT-LLVM-Intro.pdf">Latner</a> said in 2008, was designed in a very modular way. It also looked like it had a lot of interesting features that could be used in a lot of (different) domains: code-optimization (think <a href="https://github.com/JonathanSalwan/Tigress_protection">deobfuscation</a>), (architecture independent) <a href="https://github.com/0vercl0k/articles/blob/master/Obfuscation%20of%20steel%20meet%20Kryptonite.pdf">code obfuscation</a>, static code instrumentation (think <a href="https://github.com/google/sanitizers/wiki">sanitizers</a>), <a href="http://clang-analyzer.llvm.org/index.html">static analysis</a>, for runtime software exploitation mitigations (think <a href="http://clang.llvm.org/docs/ControlFlowIntegrity.html">cfi</a>, <a href="http://clang.llvm.org/docs/SafeStack.html">safestack</a>), power a fuzzing framework (think <a href="http://llvm.org/docs/LibFuzzer.html">libFuzzer</a>), ..you name it.</p>
<p>A lot of the power that came with this giant library was partly because it would operate in mainly three stages, and you were free to hook your code in any of those: front-end, mid-end, back-end. Other strengths included: the high number of back-ends, the documentation, the C/C++ APIs, the community, ease of use compared to gcc (see below from kcc’s <a href="https://gcc.gnu.org/wiki/cauldron2012?action=AttachFile&do=get&target=kcc.pdf">presentation</a>), etc.</p>
<p><img class="center" src="/images/token_capture_via_llvm_based_static_analysis_pass/llvmvsgcc.png" title="GCC from a newcomer's perspective" ></p>
<p>The front-end part takes as input source code and generates LLVM IL code, the middle part operates on LLVM IL and finally the last one receives LLVM IL in order to output assembly code and or an executable file.</p>
<p><img class="center" src="/images/token_capture_via_llvm_based_static_analysis_pass/llvm_architecture.png" title="Major components in a three phase compiler" ></p>
<p>In this post we will walk through a simple LLVM pass that does neither optimization, nor obfuscation; but acts more as a token finder for fuzzing purposes.</p>
<div class='entry-content-toc'></div>
</div>
<footer>
<a rel="full-article" href="/blog/2016/11/27/clang-and-passes/">Read on →</a>
</footer>
</article>
<article>
<header>
<h1 class="entry-title"><a href="/blog/2015/08/18/keygenning-with-klee/">Keygenning With KLEE</a></h1>
<p class="meta">
<time datetime="2015-08-18T22:12:00-07:00" pubdate data-updated="true">Aug 18<span>th</span>, 2015</time>
</p>
</header>
<div class="entry-content"><h1>Introduction</h1>
<p>In the past weeks I enjoyed working on reversing a piece of software (don’t ask me the name), to study how serial numbers are validated. The story the user has to follow is pretty common: download the trial, pay, get the serial number, use it in the annoying nag screen to get the fully functional version of the software.</p>
<p>Since my purpose is to not damage the company developing the software, I will not mention the name of the software, nor I will publish the final key generator in binary form, nor its source code. My goal is instead to study a real case of serial number validation, and to highlight its weaknesses.</p>
<p>In this post we are going to take a look at the steps I followed to reverse the serial validation process and to make a key generator using <a href="http://klee.github.io/">KLEE</a> symbolic virtual machine. We are not going to follow all the details on the reversing part, since you cannot reproduce them on your own. We will concentrate our thoughts on the key-generator itself: that is the most interesting part.</p>
<div class='entry-content-toc'></div>
</div>
<footer>
<a rel="full-article" href="/blog/2015/08/18/keygenning-with-klee/">Read on →</a>
</footer>
</article>
<article>
<header>
<h1 class="entry-title"><a href="/blog/2015/02/08/spotlight-on-an-unprotected-aes128-whitebox-implementation/">Spotlight on an Unprotected AES128 White-box Implementation</a></h1>
<p class="meta">
<time datetime="2015-02-08T22:59:00-08:00" pubdate data-updated="true">Feb 8<span>th</span>, 2015</time>
</p>
</header>
<div class="entry-content"><h1>Introduction</h1>
<p>I think it all began when I’ve worked on the <a href="https://github.com/0vercl0k/stuffz/tree/master/NoSuchCon2013">NSC2013</a> crackme made by <a href="https://twitter.com/elvanderb">@elvanderb</a>, long story short you had an AES128 heavily obfuscated white-box implementation to break. The thing was you could actually solve the challenge in different ways:</p>
<ol>
<li>the first one was the easiest one: you didn’t need to know anything about white-box, crypto or even AES ; you could just see the function as a black-box & try to find “design flaws” in its inner-workings</li>
<li>the elite way: this one involved to understand & recover the entire design of the white-box, then to identify design weaknesses that allows the challenger to directly attack & recover the encryption key. A really nice write-up has been recently written by <a href="https://twitter.com/doegox">@doegox</a>, check it out, really :): <a href="http://wiki.yobi.be/wiki/NSC_Writeups">Oppida/NoSuchCon challenge</a>.</li>
</ol>
<p>The annoying thing is that you don’t have a lot of understandable available C code on the web that implement such things, nevertheless you do have quite some nice academic references ; they are a really good resource to build your own.</p>
<p>This post aims to present briefly, in a simple way what an AES white-box looks like, and to show how its design is important if you want to not have your encryption key extracted :). The implementation I’m going to talk about today is not my creation at all, I just followed the first part (might do another post talking about the second part? Who knows) of a really <a href="https://github.com/0vercl0k/stuffz/raw/master/wbaes_attack/docs/a_tutorial_on_whitebox_aes.pdf">nice paper</a> (even for non-mathematical / crypto guys like me!) written by James A. Muir.</p>
<p>The idea is simple: we will start from a clean AES128 encryption function in plain C, we will modify it & transform it into a white-box implementation in several steps.
As usual, all the code are available on my github account; you are encourage to break & hack them!</p>
<p>Of course, we will use this post to briefly present what is the white-box cryptography, what are the goals & why it’s kind of cool.</p>
<p>Before diving deep, here is the table of contents:</p>
<div class='entry-content-toc'></div>
</div>
<footer>
<a rel="full-article" href="/blog/2015/02/08/spotlight-on-an-unprotected-aes128-whitebox-implementation/">Read on →</a>
</footer>
</article>
<article>
<header>
<h1 class="entry-title"><a href="/blog/2014/10/11/taiming-a-wild-nanomite-protected-mips-binary-with-symbolic-execution-no-such-crackme/">Taming a Wild Nanomite-protected MIPS Binary With Symbolic Execution: No Such Crackme</a></h1>
<p class="meta">
<time datetime="2014-10-11T21:35:00-07:00" pubdate data-updated="true">Oct 11<span>th</span>, 2014</time>
</p>
</header>
<div class="entry-content"><p>As last year, the French conference <a href="http://www.nosuchcon.org/#challenge">No Such Con</a> returns for its second edition in Paris from the 19th of November until the 21th of November. And again, the brilliant <a href="https://twitter.com/elvanderb">Eloi Vanderbeken</a> & his mates at <a href="http://synacktiv.fr/en/index.html">Synacktiv</a> put together a series of three security challenges especially for this occasion.
Apparently, the three tasks have already been <a href="https://twitter.com/Synacktiv/status/515174845844582401">solved</a> by awesome <a href="https://twitter.com/0xf4b">@0xfab</a> which won the competition, hats off :).</p>
<p>To be honest I couldn’t resist to try at least the first step, as I know that <a href="https://twitter.com/elvanderb">Eloi</a> always builds <a href="http://0vercl0k.tuxfamily.org/bl0g/?p=253">really twisted</a> and <a href="http://www.nosuchcon.org/2013/#challenge">nice binaries</a> ; so I figured I should just give it a go!</p>
<p>But this time we are trying something different though: this post has been co-authored by both <em>Emilien Girault</em> (<a href="https://twitter.com/emiliengirault">@emiliengirault</a>) and I. As we have slightly different solutions, we figured it would be a good idea to write those up inside a single post. This article starts with an introduction to the challenge and will then fork, presenting my solution and his.</p>
<p>As the article is quite long, here is the complete table of contents:</p>
<div class='entry-content-toc'></div>
</div>
<footer>
<a rel="full-article" href="/blog/2014/10/11/taiming-a-wild-nanomite-protected-mips-binary-with-symbolic-execution-no-such-crackme/">Read on →</a>
</footer>
</article>
<article>
<header>
<h1 class="entry-title"><a href="/blog/2014/09/06/dissection-of-quarkslabs-2014-security-challenge/">Dissection of Quarkslab’s 2014 Security Challenge</a></h1>
<p class="meta">
<time datetime="2014-09-06T20:37:00-07:00" pubdate data-updated="true">Sep 6<span>th</span>, 2014</time>
</p>
</header>
<div class="entry-content"><h1>Introduction</h1>
<p>As the blog was a bit silent for quite some time, I figured it would be cool to put together a post ; so here it is folks, dig in!</p>
<p>The French company <a href="http://blog.quarkslab.com/you-like-python-security-challenge-and-traveling-win-a-free-ticket-to-hitb-kul.html">Quarkslab</a> <a href="https://twitter.com/quarkslab/status/507457671386394624">recently</a> <a href="https://twitter.com/HITBSecConf/status/507458788522094592">released</a> a security challenge to win a free entrance to attend the upcoming <a href="https://conference.hitb.org/hitbsecconf2014kul/">HITBSecConf</a> conference in Kuala Lumpur from the 13th of October until the 16th.</p>
<p>The challenge has been written by <a href="http://blog.quarkslab.com/author/serge-guelton.html">Serge Guelton</a>, a R&D engineer specialized in compilers/parallel computations. At the time of writing, already eight different people manage to solve the challenge, and one of the ticket seems to have been won by <code>hackedd</code>, so congrats to him!</p>
<p><img class="center" src="/images/dissection_of_quarkslab_s_2014_security_challenge/woot.png"></p>
<p>According to the description of the challenge Python is heavily involved, which is a good thing for at least two reasons:</p>
<ul>
<li>first because I already had <a href="https://doar-e.github.io/blog/2014/04/17/deep-dive-into-pythons-vm-story-of-load_const-bug/">the occasion</a> to look at its source code in the past,</li>
<li>and because I so am a <a href="https://github.com/0vercl0k/stuffz/tree/master/Python's%20internals">big fan of Python</a>.</li>
</ul>
<p>In this post I will describe how I tackled this problem, how I managed to solve it. And to make up for me being slow at solving it I tried to make it fairly detailed.</p>
<p>At first it was supposed to be quite short though, but well..I decided to analyze fully the challenge even if it wasn’t needed to find the key unfortunately, so it is a bit longer than expected :–).</p>
<p>Anyway, sit down, make yourself at home and let me pour you a cup of tea before we begin :–).</p>
<div class='entry-content-toc'></div>
</div>
<footer>
<a rel="full-article" href="/blog/2014/09/06/dissection-of-quarkslabs-2014-security-challenge/">Read on →</a>
</footer>
</article>
<article>
<header>
<h1 class="entry-title"><a href="/blog/2014/04/30/corrupting-arm-evt/">Corrupting the ARM Exception Vector Table</a></h1>
<p class="meta">
<time datetime="2014-04-30T21:01:00-07:00" pubdate data-updated="true">Apr 30<span>th</span>, 2014</time>
</p>
</header>
<div class="entry-content"><h1>Introduction</h1>
<p>A few months ago, I was writing a Linux kernel exploitation challenge on ARM in an attempt to learn about kernel exploitation and I thought I’d explore things a little. I chose the ARM architecture mainly because I thought it would be fun to look at. This article is going to describe how the ARM Exception Vector Table (EVT) can aid in kernel exploitation in case an attacker has a write what-where primitive. It will be covering a local exploit scenario as well as a remote exploit scenario. Please note that corrupting the EVT has been mentioned in the paper “Vector Rewrite Attack”<a href="http://cansecwest.com/slides07/Vector-Rewrite-Attack.pdf">[1]</a>, which briefly talks about how it can be used in NULL pointer dereference vulnerabilities on an ARM RTOS.</p>
<p>The article is broken down into two main sections. First a brief description of the ARM EVT and its implications from an exploitation point of view (please note that a number of things about the EVT will be omitted to keep this article relatively short). We will go over two examples showing how we can abuse the EVT.</p>
<p>I am assuming the reader is familiar with Linux kernel exploitation and knows some ARM assembly (seriously).</p>
<div class='entry-content-toc'></div>
</div>
<footer>
<a rel="full-article" href="/blog/2014/04/30/corrupting-arm-evt/">Read on →</a>
</footer>
</article>
<article>
<header>
<h1 class="entry-title"><a href="/blog/2014/04/17/deep-dive-into-pythons-vm-story-of-load_const-bug/">Deep Dive Into Python’s VM: Story of LOAD_CONST Bug</a></h1>
<p class="meta">
<time datetime="2014-04-17T23:22:00-07:00" pubdate data-updated="true">Apr 17<span>th</span>, 2014</time>
</p>
</header>
<div class="entry-content"><h1>Introduction</h1>
<p>A year ago, I’ve written a Python script to leverage a bug in Python’s virtual machine: the idea was to fully control the Python virtual processor and after that to instrument the VM to execute native codes. The <a href="https://github.com/0vercl0k/stuffz/blob/master/Python's%20internals/python27_abuse_vm_to_execute_x86_code.py">python27_abuse_vm_to_execute_x86_code.py</a> script wasn’t really self-explanatory, so I believe only a few people actually took some time to understood what happened under the hood. The purpose of this post is to give you an explanation of the bug, how you can control the VM and how you can turn the bug into something that can be more useful. It’s also a cool occasion to see how works the Python virtual machine from a low-level perspective: what we love so much right?</p>
<p>But before going further, I just would like to clarify a couple of things:</p>
<ul>
<li>I haven’t found this bug, this is quite old and <strong>known</strong> by the Python developers (trading safety for performance), so don’t panic this is <strong>not</strong> a 0day or a new bug ; can be a cool CTF trick though</li>
<li>Obviously, YES I know we can also “escape” the virtual machine with the <a href="http://docs.python.org/2/library/ctypes.html">ctypes</a> module ; but this is a feature not a bug. In addition, ctypes is always “removed” from sandbox implementation in Python</li>
</ul>
<p>Also, keep in mind I will focus Python 2.7.5 x86 on Windows ; but obviously this is adaptable for other systems and architectures, so this is left as an exercise to the interested readers.
All right, let’s move on to the first part: this one will focus the essentials about the VM, and Python objects.</p>
<div class='entry-content-toc'></div>
</div>
<footer>
<a rel="full-article" href="/blog/2014/04/17/deep-dive-into-pythons-vm-story-of-load_const-bug/">Read on →</a>
</footer>
</article>
<div class="pagination">
<a class="prev" href="/blog/page/2/">← Older</a>
<a href="/blog/archives">Blog Archives</a>
</div>
</div>
<aside class="sidebar">
<section>
<h1>Recent Posts</h1>
<ul id="recent_posts">
<li class="post">
<a href="/blog/2017/12/01/debugger-data-model/">Debugger data model, Javascript & x64 exception handling</a>
</li>
<li class="post">
<a href="/blog/2017/08/05/binary-rewriting-with-syzygy/">Binary rewriting with syzygy, Pt. I</a>
</li>
<li class="post">
<a href="/blog/2016/12/21/happy-unikernels/">happy unikernels</a>
</li>
<li class="post">
<a href="/blog/2016/11/27/clang-and-passes/">Token capture via an llvm-based analysis pass</a>
</li>
<li class="post">
<a href="/blog/2015/08/18/keygenning-with-klee/">Keygenning with KLEE</a>
</li>
</ul>
</section>
</aside>
</div>
</div>
<footer role="contentinfo"><p>
Copyright © 2018 - Axel Souchet, Jonathan Salwan, Jérémy Fetiveau <br/>
<span class="credit">Powered by <a href="http://octopress.org">Octopress</a> + <a href="https://github.com/ioveracker/mnml">mnml</a>.
</span>
</p>
</footer>
</body>
</html>