-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebRepportBinaryExp.htm
More file actions
5934 lines (5030 loc) · 315 KB
/
webRepportBinaryExp.htm
File metadata and controls
5934 lines (5030 loc) · 315 KB
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
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
---
---
<html>
<head>
<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
<meta name=Generator content="Microsoft Word 15 (filtered)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"Calibri Light";
panose-1:2 15 3 2 2 2 4 3 2 4;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:LinLibertineT;
panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:Inconsolatazi4-Regular;
panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:rtxmi;
panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:LinLibertineTI;
panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"\@rtxmi";
panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"\@LinLibertineTI";
panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin-top:0cm;
margin-right:0cm;
margin-bottom:8.0pt;
margin-left:0cm;
line-height:106%;
text-autospace:ideograph-other;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
h1
{mso-style-link:"Heading 1 Char";
margin-top:12.0pt;
margin-right:0cm;
margin-bottom:0cm;
margin-left:21.6pt;
text-indent:-21.6pt;
line-height:106%;
page-break-after:avoid;
text-autospace:ideograph-other;
border:none;
padding:0cm;
font-size:16.0pt;
font-family:"Times New Roman",serif;
font-weight:bold;}
h2
{mso-style-link:"Heading 2 Char";
margin-top:2.0pt;
margin-right:0cm;
margin-bottom:0cm;
margin-left:28.8pt;
text-indent:-28.8pt;
line-height:106%;
page-break-after:avoid;
text-autospace:ideograph-other;
font-size:14.0pt;
font-family:"Times New Roman",serif;
font-weight:bold;}
h3
{mso-style-link:"Heading 3 Char";
margin-top:2.0pt;
margin-right:0cm;
margin-bottom:0cm;
margin-left:36.0pt;
text-indent:-36.0pt;
line-height:106%;
page-break-after:avoid;
text-autospace:ideograph-other;
font-size:14.0pt;
font-family:"Calibri Light",sans-serif;
font-weight:bold;}
h4
{mso-style-link:"Heading 4 Char";
margin-top:2.0pt;
margin-right:0cm;
margin-bottom:0cm;
margin-left:43.2pt;
text-indent:-43.2pt;
line-height:106%;
page-break-after:avoid;
text-autospace:ideograph-other;
font-size:14.0pt;
font-family:"Calibri Light",sans-serif;
font-weight:bold;
font-style:italic;}
h5
{mso-style-link:"Heading 5 Char";
margin-top:2.0pt;
margin-right:0cm;
margin-bottom:0cm;
margin-left:50.4pt;
text-indent:-50.4pt;
line-height:106%;
page-break-after:avoid;
text-autospace:ideograph-other;
font-size:11.0pt;
font-family:"Calibri Light",sans-serif;
color:#2F5496;
font-weight:normal;}
h6
{mso-style-link:"Heading 6 Char";
margin-top:2.0pt;
margin-right:0cm;
margin-bottom:0cm;
margin-left:57.6pt;
text-indent:-57.6pt;
line-height:106%;
page-break-after:avoid;
text-autospace:ideograph-other;
font-size:11.0pt;
font-family:"Calibri Light",sans-serif;
color:#1F3763;
font-weight:normal;}
p.MsoHeading7, li.MsoHeading7, div.MsoHeading7
{mso-style-link:"Heading 7 Char";
margin-top:2.0pt;
margin-right:0cm;
margin-bottom:0cm;
margin-left:64.8pt;
text-indent:-64.8pt;
line-height:106%;
page-break-after:avoid;
text-autospace:ideograph-other;
font-size:11.0pt;
font-family:"Calibri Light",sans-serif;
color:#1F3763;
font-style:italic;}
p.MsoHeading8, li.MsoHeading8, div.MsoHeading8
{mso-style-link:"Heading 8 Char";
margin-top:2.0pt;
margin-right:0cm;
margin-bottom:0cm;
margin-left:72.0pt;
text-indent:-72.0pt;
line-height:106%;
page-break-after:avoid;
text-autospace:ideograph-other;
font-size:10.5pt;
font-family:"Calibri Light",sans-serif;
color:#272727;}
p.MsoHeading9, li.MsoHeading9, div.MsoHeading9
{mso-style-link:"Heading 9 Char";
margin-top:2.0pt;
margin-right:0cm;
margin-bottom:0cm;
margin-left:79.2pt;
text-indent:-79.2pt;
line-height:106%;
page-break-after:avoid;
text-autospace:ideograph-other;
font-size:10.5pt;
font-family:"Calibri Light",sans-serif;
color:#272727;
font-style:italic;}
p.MsoToc1, li.MsoToc1, div.MsoToc1
{margin-top:0cm;
margin-right:0cm;
margin-bottom:5.0pt;
margin-left:0cm;
line-height:106%;
text-autospace:ideograph-other;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
p.MsoToc2, li.MsoToc2, div.MsoToc2
{margin-top:0cm;
margin-right:0cm;
margin-bottom:5.0pt;
margin-left:11.0pt;
line-height:106%;
text-autospace:ideograph-other;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
p.MsoToc3, li.MsoToc3, div.MsoToc3
{margin-top:0cm;
margin-right:0cm;
margin-bottom:5.0pt;
margin-left:22.0pt;
line-height:106%;
text-autospace:ideograph-other;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
p.MsoHeader, li.MsoHeader, div.MsoHeader
{mso-style-link:"Header Char";
margin:0cm;
text-autospace:ideograph-other;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
p.MsoFooter, li.MsoFooter, div.MsoFooter
{mso-style-link:"Footer Char";
margin:0cm;
text-autospace:ideograph-other;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
p.MsoTitle, li.MsoTitle, div.MsoTitle
{mso-style-link:"Title Char";
margin:0cm;
text-autospace:ideograph-other;
font-size:28.0pt;
font-family:"Calibri Light",sans-serif;
letter-spacing:-.5pt;}
p.MsoTitleCxSpFirst, li.MsoTitleCxSpFirst, div.MsoTitleCxSpFirst
{mso-style-link:"Title Char";
margin:0cm;
text-autospace:ideograph-other;
font-size:28.0pt;
font-family:"Calibri Light",sans-serif;
letter-spacing:-.5pt;}
p.MsoTitleCxSpMiddle, li.MsoTitleCxSpMiddle, div.MsoTitleCxSpMiddle
{mso-style-link:"Title Char";
margin:0cm;
text-autospace:ideograph-other;
font-size:28.0pt;
font-family:"Calibri Light",sans-serif;
letter-spacing:-.5pt;}
p.MsoTitleCxSpLast, li.MsoTitleCxSpLast, div.MsoTitleCxSpLast
{mso-style-link:"Title Char";
margin:0cm;
text-autospace:ideograph-other;
font-size:28.0pt;
font-family:"Calibri Light",sans-serif;
letter-spacing:-.5pt;}
a:link, span.MsoHyperlink
{color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:#954F72;
text-decoration:underline;}
p
{margin-right:0cm;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
code
{font-family:"Courier New";}
pre
{mso-style-link:"HTML Preformatted Char";
margin:0cm;
font-size:10.0pt;
font-family:"Courier New";}
p.MsoNoSpacing, li.MsoNoSpacing, div.MsoNoSpacing
{mso-style-link:"No Spacing Char";
margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{margin-top:0cm;
margin-right:0cm;
margin-bottom:8.0pt;
margin-left:36.0pt;
line-height:106%;
text-autospace:ideograph-other;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
p.MsoListParagraphCxSpFirst, li.MsoListParagraphCxSpFirst, div.MsoListParagraphCxSpFirst
{margin-top:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:36.0pt;
line-height:106%;
text-autospace:ideograph-other;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
p.MsoListParagraphCxSpMiddle, li.MsoListParagraphCxSpMiddle, div.MsoListParagraphCxSpMiddle
{margin-top:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:36.0pt;
line-height:106%;
text-autospace:ideograph-other;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxSpLast
{margin-top:0cm;
margin-right:0cm;
margin-bottom:8.0pt;
margin-left:36.0pt;
line-height:106%;
text-autospace:ideograph-other;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
p.MsoTocHeading, li.MsoTocHeading, div.MsoTocHeading
{margin-top:12.0pt;
margin-right:0cm;
margin-bottom:0cm;
margin-left:0cm;
line-height:107%;
page-break-after:avoid;
font-size:16.0pt;
font-family:"Calibri Light",sans-serif;
color:#2F5496;}
span.Heading1Char
{mso-style-name:"Heading 1 Char";
mso-style-link:"Heading 1";
font-family:"Times New Roman",serif;
font-weight:bold;}
span.Heading2Char
{mso-style-name:"Heading 2 Char";
mso-style-link:"Heading 2";
font-family:"Times New Roman",serif;
font-weight:bold;}
span.Heading3Char
{mso-style-name:"Heading 3 Char";
mso-style-link:"Heading 3";
font-family:"Calibri Light",sans-serif;
font-weight:bold;}
span.Heading4Char
{mso-style-name:"Heading 4 Char";
mso-style-link:"Heading 4";
font-family:"Calibri Light",sans-serif;
font-weight:bold;
font-style:italic;}
span.Heading5Char
{mso-style-name:"Heading 5 Char";
mso-style-link:"Heading 5";
font-family:"Calibri Light",sans-serif;
color:#2F5496;}
span.Heading6Char
{mso-style-name:"Heading 6 Char";
mso-style-link:"Heading 6";
font-family:"Calibri Light",sans-serif;
color:#1F3763;}
span.Heading7Char
{mso-style-name:"Heading 7 Char";
mso-style-link:"Heading 7";
font-family:"Calibri Light",sans-serif;
color:#1F3763;
font-style:italic;}
span.Heading8Char
{mso-style-name:"Heading 8 Char";
mso-style-link:"Heading 8";
font-family:"Calibri Light",sans-serif;
color:#272727;}
span.Heading9Char
{mso-style-name:"Heading 9 Char";
mso-style-link:"Heading 9";
font-family:"Calibri Light",sans-serif;
color:#272727;
font-style:italic;}
span.HeaderChar
{mso-style-name:"Header Char";
mso-style-link:Header;}
span.FooterChar
{mso-style-name:"Footer Char";
mso-style-link:Footer;}
span.NoSpacingChar
{mso-style-name:"No Spacing Char";
mso-style-link:"No Spacing";
font-family:"Calibri",sans-serif;}
span.TitleChar
{mso-style-name:"Title Char";
mso-style-link:Title;
font-family:"Calibri Light",sans-serif;
letter-spacing:-.5pt;}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-link:"HTML Preformatted";
font-family:"Courier New";}
span.caps
{mso-style-name:caps;}
.MsoChpDefault
{font-family:"Calibri",sans-serif;}
.MsoPapDefault
{margin-bottom:8.0pt;
line-height:106%;
text-autospace:ideograph-other;}
/* Page Definitions */
@page WordSection1
{size:595.3pt 841.9pt;
margin:72.0pt 72.0pt 72.0pt 108.0pt;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
-->
</style>
</head>
<body lang=FR link="#0563C1" vlink="#954F72" style='word-wrap:break-word'>
<div class=WordSection1>
<p class=MsoNormal align=center style='text-align:center'><b><span lang=EN-US
style='font-size:18.0pt;line-height:106%;color:#262626'>Prepared by</span></b><span
lang=EN-US style='font-size:18.0pt;line-height:106%;color:#262626'>: ESSATAB
Achraf on 03/07/2024</span></p>
<p class=MsoNormal align=center style='text-align:center'><span lang=EN-US
style='font-size:18.0pt;line-height:106%;color:#262626'> </span></p>
<div style='border-top:solid windowtext 1.0pt;border-left:none;border-bottom:
solid windowtext 1.0pt;border-right:none;padding:1.0pt 0cm 1.0pt 0cm'>
<p class=MsoNormal align=center style='text-align:center;border:none;
padding:0cm'><span lang=EN-US style='font-size:26.0pt;line-height:106%;
color:#262626'>Binary Exploitation Technics, Evasion and Mitigation</span></p>
<p align="center">Understanding and statically patching stack based buffer-overflow caused by strcpy() standard function</p>
</div>
<p class=MsoNormal><span lang=EN-US style='font-size:36.0pt;line-height:106%;
color:#262626'> </span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:36.0pt;line-height:106%;
color:#262626'> </span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:36.0pt;line-height:106%;
color:#262626'> </span>
<p class=MsoNormal><b><span lang=EN-US style='font-size:14.0pt;line-height:
106%;color:#262626'>This document is the repport of my end-of-year dissertation at École Nationale des Sciences Appliquées of Oujda (ENSAO) specialized on Sécurité informatique et cybersécurité.
Attached to Université Mohammed Premier, a public university in Morocco, ENSAO is a government-recognized, public engineering school that delivers State Engineer's Degree diplomat after 5 years of study on wide range of fields.
</span></b>
<div style='border:none;border-bottom:solid windowtext 2.25pt;padding:0cm 0cm 1.0pt 0cm'>
<h1 style='margin-left:0cm;text-indent:0cm'><a name="_Toc170894098"><span
lang=EN-US>Contents</span></a></h1>
</div>
<p class=MsoToc1><span lang=EN-US><a href="#_Toc170894098">Contents<span
style='color:windowtext;display:none;text-decoration:none'>. </span><span
style='color:windowtext;display:none;text-decoration:none'>1</span></a></span></p>
<p class=MsoToc1><span lang=EN-US><a href="#_Toc170894099">Abstract<span
style='color:windowtext;display:none;text-decoration:none'>. </span><span
style='color:windowtext;display:none;text-decoration:none'>2</span></a></span></p>
<p class=MsoToc1><span lang=EN-US><a href="#_Toc170894100">List of Tables and Figures:<span
style='color:windowtext;display:none;text-decoration:none'> </span><span
style='color:windowtext;display:none;text-decoration:none'>3</span></a></span></p>
<p class=MsoToc1><span lang=EN-US><a href="#_Toc170894101">General Introduction<span
style='color:windowtext;display:none;text-decoration:none'>. </span><span
style='color:windowtext;display:none;text-decoration:none'>5</span></a></span></p>
<p class=MsoToc1><span lang=EN-US><a href="#_Toc170894102"><span
style='font-family:"Times New Roman",serif'>Chapter 1</span><span lang=FR
style='color:windowtext;text-decoration:none'> </span>Reducing the level of
abstraction<span style='color:windowtext;display:none;text-decoration:none'>. </span><span
style='color:windowtext;display:none;text-decoration:none'>6</span></a></span></p>
<p class=MsoToc2><span lang=EN-US><a href="#_Toc170894103"><span
style='font-family:"Times New Roman",serif'>1.1</span><span lang=FR
style='color:windowtext;text-decoration:none'> </span>Introduction<span
style='color:windowtext;display:none;text-decoration:none'>. </span><span
style='color:windowtext;display:none;text-decoration:none'>6</span></a></span></p>
<p class=MsoToc2><span lang=EN-US><a href="#_Toc170894104"><span
style='font-family:"Times New Roman",serif'>1.2</span><span lang=FR
style='color:windowtext;text-decoration:none'> </span>C as a Procedural
Language<span style='color:windowtext;display:none;text-decoration:none'>. </span><span
style='color:windowtext;display:none;text-decoration:none'>7</span></a></span></p>
<p class=MsoToc2><span lang=EN-US><a href="#_Toc170894105"><span
style='font-family:"Times New Roman",serif'>1.3</span><span lang=FR
style='color:windowtext;text-decoration:none'> </span>Compilers and
linkers roles in C softwares development process<span style='color:windowtext;
display:none;text-decoration:none'>. </span><span
style='color:windowtext;display:none;text-decoration:none'>8</span></a></span></p>
<p class=MsoToc3><span lang=EN-US><a href="#_Toc170894106"><span
style='font-family:"Times New Roman",serif'>1.3.1</span><span lang=FR
style='color:windowtext;text-decoration:none'> </span>What is the
compilers job?<span style='color:windowtext;display:none;text-decoration:none'>. </span><span
style='color:windowtext;display:none;text-decoration:none'>9</span></a></span></p>
<p class=MsoToc3><span lang=EN-US><a href="#_Toc170894107"><span
style='font-family:"Times New Roman",serif'>1.3.2</span><span lang=FR
style='color:windowtext;text-decoration:none'> </span>The linkers job<span
style='color:windowtext;display:none;text-decoration:none'>. </span><span
style='color:windowtext;display:none;text-decoration:none'>10</span></a></span></p>
<p class=MsoToc3><span lang=EN-US><a href="#_Toc170894108"><span
style='font-family:"Times New Roman",serif'>1.3.3</span><span lang=FR
style='color:windowtext;text-decoration:none'> </span>Summary<span
style='color:windowtext;display:none;text-decoration:none'>. </span><span
style='color:windowtext;display:none;text-decoration:none'>11</span></a></span></p>
<p class=MsoToc2><span lang=EN-US><a href="#_Toc170894109"><span
style='font-family:"Times New Roman",serif'>1.4</span><span lang=FR
style='color:windowtext;text-decoration:none'> </span>Function Calls:
From High-level Statement to Machine Instructions<span style='color:windowtext;
display:none;text-decoration:none'>. </span><span
style='color:windowtext;display:none;text-decoration:none'>12</span></a></span></p>
<p class=MsoToc3><span lang=EN-US><a href="#_Toc170894110"><span
style='font-family:"Times New Roman",serif'>1.4.1</span><span lang=FR
style='color:windowtext;text-decoration:none'> </span>Overview of
x86-64 Machine Architecture<span style='color:windowtext;display:none;
text-decoration:none'>. </span><span
style='color:windowtext;display:none;text-decoration:none'>14</span></a></span></p>
<p class=MsoToc3><span lang=EN-US><a href="#_Toc170894111"><span
style='font-family:"Times New Roman",serif'>1.4.2</span><span lang=FR
style='color:windowtext;text-decoration:none'> </span>Overview of the
Calling Conventions of System V ABI<span style='color:windowtext;display:none;
text-decoration:none'> </span><span
style='color:windowtext;display:none;text-decoration:none'>17</span></a></span></p>
<p class=MsoToc3><span lang=EN-US><a href="#_Toc170894112"><span
style='font-family:"Times New Roman",serif'>1.4.3</span><span lang=FR
style='color:windowtext;text-decoration:none'> </span>The Stack
Evolution During Function Calls<span style='color:windowtext;display:none;
text-decoration:none'>. </span><span
style='color:windowtext;display:none;text-decoration:none'>19</span></a></span></p>
<p class=MsoToc3><span lang=EN-US><a href="#_Toc170894113"><span
style='font-family:"Times New Roman",serif'>1.4.4</span><span lang=FR
style='color:windowtext;text-decoration:none'> </span>Concrete Example<span
style='color:windowtext;display:none;text-decoration:none'>. </span><span
style='color:windowtext;display:none;text-decoration:none'>23</span></a></span></p>
<p class=MsoToc2><span lang=EN-US><a href="#_Toc170894114"><span
style='font-family:"Times New Roman",serif'>1.5</span><span lang=FR
style='color:windowtext;text-decoration:none'> </span>Conclusion<span
style='color:windowtext;display:none;text-decoration:none'>. </span><span
style='color:windowtext;display:none;text-decoration:none'>32</span></a></span></p>
<p class=MsoToc1><span lang=EN-US><a href="#_Toc170894115"><span
style='font-family:"Times New Roman",serif'>Chapter 2</span><span lang=FR
style='color:windowtext;text-decoration:none'> </span>Functions Lacking
Bounds Checking<span style='color:windowtext;display:none;text-decoration:none'>. </span><span
style='color:windowtext;display:none;text-decoration:none'>33</span></a></span></p>
<p class=MsoToc2><span lang=EN-US><a href="#_Toc170894116"><span
style='font-family:"Times New Roman",serif'>2.1</span><span lang=FR
style='color:windowtext;text-decoration:none'> </span>Introduction<span
style='color:windowtext;display:none;text-decoration:none'>. </span><span
style='color:windowtext;display:none;text-decoration:none'>33</span></a></span></p>
<p class=MsoToc2><span lang=EN-US><a href="#_Toc170894117"><span
style='font-family:"Times New Roman",serif'>2.2</span><span lang=FR
style='color:windowtext;text-decoration:none'> </span>GNU C Library<span
style='color:windowtext;display:none;text-decoration:none'>. </span><span
style='color:windowtext;display:none;text-decoration:none'>33</span></a></span></p>
<p class=MsoToc2><span lang=EN-US><a href="#_Toc170894118"><span
style='font-family:"Times New Roman",serif'>2.3</span><span lang=FR
style='color:windowtext;text-decoration:none'> </span>Unsafe Functions:
an Example of strcpy()<span style='color:windowtext;display:none;text-decoration:
none'>. </span><span
style='color:windowtext;display:none;text-decoration:none'>34</span></a></span></p>
<p class=MsoToc3><span lang=EN-US><a href="#_Toc170894119"><span
style='font-family:"Times New Roman",serif'>2.3.1</span><span lang=FR
style='color:windowtext;text-decoration:none'> </span>The Bug in Detail<span
style='color:windowtext;display:none;text-decoration:none'> </span><span
style='color:windowtext;display:none;text-decoration:none'>35</span></a></span></p>
<p class=MsoToc3><span lang=EN-US><a href="#_Toc170894120"><span
style='font-family:"Times New Roman",serif'>2.3.2</span><span lang=FR
style='color:windowtext;text-decoration:none'> </span>Exploit:
Arbitrary Code Execution<span style='color:windowtext;display:none;text-decoration:
none'>. </span><span
style='color:windowtext;display:none;text-decoration:none'>42</span></a></span></p>
<p class=MsoToc3><span lang=EN-US><a href="#_Toc170894121"><span
style='font-family:"Times New Roman",serif'>2.3.3</span><span lang=FR
style='color:windowtext;text-decoration:none'> </span>Mitigation:
access restriction to the stack<span style='color:windowtext;display:none;
text-decoration:none'>. </span><span
style='color:windowtext;display:none;text-decoration:none'>43</span></a></span></p>
<p class=MsoToc3><span lang=EN-US><a href="#_Toc170894122"><span
style='font-family:"Times New Roman",serif'>2.3.4</span><span lang=FR
style='color:windowtext;text-decoration:none'> </span>Evasion: Code
Reuse Attack<span style='color:windowtext;display:none;text-decoration:none'>. </span><span
style='color:windowtext;display:none;text-decoration:none'>45</span></a></span></p>
<p class=MsoToc3><span lang=EN-US><a href="#_Toc170894123"><span
style='font-family:"Times New Roman",serif'>2.3.5</span><span lang=FR
style='color:windowtext;text-decoration:none'> </span>Mitigation: Stack
Canaries<span style='color:windowtext;display:none;text-decoration:none'>. </span><span
style='color:windowtext;display:none;text-decoration:none'>46</span></a></span></p>
<p class=MsoToc2><span lang=EN-US><a href="#_Toc170894124"><span
style='font-family:"Times New Roman",serif'>2.4</span><span lang=FR
style='color:windowtext;text-decoration:none'> </span>Alternative
Functions: an Example of strncpy()<span style='color:windowtext;display:none;
text-decoration:none'>. </span><span
style='color:windowtext;display:none;text-decoration:none'>53</span></a></span></p>
<p class=MsoToc3><span lang=EN-US><a href="#_Toc170894125"><span
style='font-family:"Times New Roman",serif'>2.4.1</span><span lang=FR
style='color:windowtext;text-decoration:none'> </span>A proposed
solution: Substituting the Flawed Function<span style='color:windowtext;
display:none;text-decoration:none'>. </span><span
style='color:windowtext;display:none;text-decoration:none'>54</span></a></span></p>
<p class=MsoToc2><span lang=EN-US><a href="#_Toc170894126"><span
style='font-family:"Times New Roman",serif'>2.5</span><span lang=FR
style='color:windowtext;text-decoration:none'> </span>Guidelines for
secure programming<span style='color:windowtext;display:none;text-decoration:
none'>. </span><span
style='color:windowtext;display:none;text-decoration:none'>68</span></a></span></p>
<p class=MsoToc2><span lang=EN-US><a href="#_Toc170894127"><span
style='font-family:"Times New Roman",serif'>2.6</span><span lang=FR
style='color:windowtext;text-decoration:none'> </span>Conclusion<span
style='color:windowtext;display:none;text-decoration:none'>. </span><span
style='color:windowtext;display:none;text-decoration:none'>72</span></a></span></p>
<p class=MsoToc1><span lang=EN-US><a href="#_Toc170894128">General conclusion
and perspectives<span style='color:windowtext;display:none;text-decoration:
none'>. </span><span
style='color:windowtext;display:none;text-decoration:none'>73</span></a></span></p>
<p class=MsoToc1><span lang=EN-US><a href="#_Toc170894129">References<span
style='color:windowtext;display:none;text-decoration:none'>. </span><span
style='color:windowtext;display:none;text-decoration:none'>74</span></a></span></p>
<p class=MsoNormal><span lang=EN-US> </span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:14.0pt;line-height:106%;
color:#262626'> </span></p>
<b><span lang=EN-US style='font-size:14.0pt;line-height:106%;font-family:"Times New Roman",serif;
color:#262626'><br clear=all style='page-break-before:always'>
</span></b>
<div style='border:none;border-bottom:solid windowtext 2.25pt;padding:0cm 0cm 1.0pt 0cm;
margin-left:21.6pt;margin-right:0cm'>
<h1 style='margin-left:0cm;text-indent:0cm'><a name="_Toc170894099"><span
lang=EN-US>Abstract</span></a></h1>
</div>
<p class=MsoNormal>
<table cellpadding=0 cellspacing=0 align=left>
<tr>
<td width=470 height=0></td>
</tr>
<tr>
<td></td>
<td><img width=554 height=674 src="webRepportBinaryExp_files/image001.png"
alt="The security of computer systems evolves over time through an ongoing conflict between designers and attackers. Whenever an attack is discovered, there is a great opportunity to enhance the security of computer systems by addressing the cause of the attack, thus fortifying future systems against similar vulnerabilities and implementing defenses in current systems. This work begins by eliminating unnecessary abstractions that hinder the understanding of software bugs threatening the safety of a memory region known as the stack. After gaining insights on how high-level C language statements, and especially the call construct, affect our memory region, this work will delve into low-level details (such as assembly language) to demonstrate how the absence of bounds checking in some glibcs functions can alter the control flow of a program, causing it to behave unexpectedly, when this flaw is exploited by malicious users. Using the function strcpy() from the C standard library as an example, it will be shown how careless usage of this function by programmers can lead to exploitable bugs. The exploitation process used by attackers will be discussed. Subsequently, the security measures designers implement to mitigate these exploits will be examined, along with how attackers bypass these mitigations and the subsequent countermeasures. This work offers a solution to strengthen programs afflicted with this bug when the source code of a vulnerable C program is unavailable. Additionally, guidelines provided by the CERT Coordination Center at Carnegie Mellon University will be presented to help prevent such vulnerabilities in the first place at the software development phase. "></td>
</tr>
</table>
<br clear=ALL>
</p>
<p class=MsoTitle><b><span lang=EN-US style='font-size:16.0pt'> </span></b></p>
<p class=MsoNormal><span lang=EN-US> </span></p>
<p class=MsoNormal><span lang=EN-US> </span></p>
<p class=MsoNormal><span lang=EN-US> </span></p>
<p class=MsoNormal><span lang=EN-US> </span></p>
<p class=MsoNormal><span lang=EN-US> </span></p>
<div style='border:none;border-bottom:solid windowtext 2.25pt;padding:0cm 0cm 1.0pt 0cm'>
<h1 style='margin-left:0cm;text-indent:0cm'><a name="_Toc170894100"><span
lang=EN-US>List of Tables and Figures:</span></a></h1>
</div>
<p class=MsoNormal><b><span lang=EN-US style='font-size:12.0pt;line-height:
106%'>Figure 1: Layers of abstraction</span><span lang=EN-US>
.
..</span></b><b><span
lang=EN-US style='font-size:12.0pt;line-height:106%'>5</span></b></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:12.0pt;line-height:
106%'>Figure 2: Function Prototype</span><span lang=EN-US>
.
.
</span></b><b><span
lang=EN-US style='font-size:12.0pt;line-height:106%'>6</span></b></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:12.0pt;line-height:
106%'>Figure 3: The compilers phases</span><span lang=EN-US>
.
..</span></b><b><span
lang=EN-US style='font-size:12.0pt;line-height:106%'>8</span></b></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:12.0pt;line-height:
106%'>Figure 4: C program life cycle </span><span lang=EN-US>
.
.</span></b><b><span
lang=EN-US style='font-size:12.0pt;line-height:106%'>11</span></b></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:12.0pt;line-height:
106%'>Figure 5: A function call </span><span lang=EN-US>
.
..</span></b><b><span
lang=EN-US style='font-size:12.0pt;line-height:106%'>12</span></b></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:12.0pt;line-height:
106%'>Table 6: User-controlled x86-64 registers</span><span lang=EN-US>
.
.
.
</span></b><b><span
lang=EN-US style='font-size:12.0pt;line-height:106%'>13</span></b></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:12.0pt;line-height:
106%'>Table 7: Commonly used x86-64 instructions</span><span lang=EN-US>
.
..
..</span></b><b><span
lang=EN-US style='font-size:12.0pt;line-height:106%'>15</span></b></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:12.0pt;line-height:
106%'>Figure 8.a: Stack allocation in memory</span><span lang=EN-US>
.
..</span></b><b><span
lang=EN-US style='font-size:12.0pt;line-height:106%'>18</span></b></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:12.0pt;line-height:
106%'>Figure 8: Multiple stack frames, each per function</span><span
lang=EN-US>
.
</span></b><b><span lang=EN-US
style='font-size:12.0pt;line-height:106%'>19</span></b></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:12.0pt;line-height:
106%'>Figure 9: the stack after the call</span><span lang=EN-US>
.</span></b><b><span
lang=EN-US style='font-size:12.0pt;line-height:106%'>20</span></b></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:12.0pt;line-height:
106%'>Figure 10: Function f calls function g</span><span lang=EN-US>
.......</span></b><b><span
lang=EN-US style='font-size:12.0pt;line-height:106%'>21</span></b></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:12.0pt;line-height:
106%'>Figure 11: The main function in assembly representation</span><span
lang=EN-US>
.</span></b><b><span lang=EN-US style='font-size:
12.0pt;line-height:106%'>23</span></b></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:12.0pt;line-height:
106%'>Figure 12: Function f in assembly representation
..23</span></b></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:12.0pt;line-height:
106%'>Figure 13: Function g in assembly representation
.
.23</span></b></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:12.0pt;line-height:
106%'>Figure 14: Passing one argument
24</span></b></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:12.0pt;line-height:
106%'>Figure 15: The call instruction
..</span><span
lang=EN-US>
.</span></b><b><span lang=EN-US style='font-size:12.0pt;
line-height:106%'>25</span></b></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:12.0pt;line-height:
106%'>Figure 16: RBP register saved by the callee
</span><span lang=EN-US>
.
.</span></b><b><span
lang=EN-US style='font-size:12.0pt;line-height:106%'>.26</span></b></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:12.0pt;line-height:
106%'>Figure 17: Indicating a new stack frame
..</span><span lang=EN-US>
.
..</span></b><b><span
lang=EN-US style='font-size:12.0pt;line-height:106%'>27</span></b></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:12.0pt;line-height:
106%'>Figure 18: Passing integer return value
..</span><span lang=EN-US>
.
</span></b><b><span
lang=EN-US style='font-size:12.0pt;line-height:106%'>28</span></b></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:12.0pt;line-height:
106%'>Figure 19: restoring the value of RBP
..</span><span lang=EN-US>
.
.</span></b><b><span
lang=EN-US style='font-size:12.0pt;line-height:106%'>29</span></b></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:12.0pt;line-height:
106%'>Figure 20: The ret instruction
</span><span lang=EN-US>
.
.
.</span></b><b><span
lang=EN-US style='font-size:12.0pt;line-height:106%'>30</span></b></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:12.0pt;line-height:
106%'>Figure 21: The end of the call sequence
</span><span lang=EN-US>
.
.
.</span></b><b><span
lang=EN-US style='font-size:12.0pt;line-height:106%'>30</span></b></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:12.0pt;line-height:
106%'>Table 22: Popular vulnerable functions
..</span><span lang=EN-US>
.
.</span></b><b><span
lang=EN-US style='font-size:12.0pt;line-height:106%'>33</span></b></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:12.0pt;line-height:
106%'>Figure 22: A program using strcpy
</span><span lang=EN-US>
.
</span></b><b><span
lang=EN-US style='font-size:12.0pt;line-height:106%'>36</span></b></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:12.0pt;line-height:
106%'>Figure 23: Corrupted callers stack frame
</span><span
lang=EN-US>
.
.</span></b><b><span lang=EN-US style='font-size:12.0pt;
line-height:106%'>37</span></b></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:12.0pt;line-height:
106%'>Figure 24: Linux man page of strcpy
.</span><span lang=EN-US>
.
.</span></b><b><span
lang=EN-US style='font-size:12.0pt;line-height:106%'>38</span></b></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:12.0pt;line-height:
106%'>Figure 25: A program invoking strcpy
</span><span lang=EN-US>
.
..</span></b><b><span
lang=EN-US style='font-size:12.0pt;line-height:106%'>39</span></b></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:12.0pt;line-height:
106%'>Figure 26: Normal execution
..</span><span lang=EN-US>
.
</span></b><b><span
lang=EN-US style='font-size:12.0pt;line-height:106%'>39</span></b></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:12.0pt;line-height:
106%'>Figure 27: An execution with unintended input
.</span><span
lang=EN-US>
.</span></b><b><span lang=EN-US style='font-size:12.0pt;
line-height:106%'>39</span></b></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:12.0pt;line-height:
106%'>Figure 28: Debugger view of the program
.</span><span lang=EN-US>
</span></b><b><span
lang=EN-US style='font-size:12.0pt;line-height:106%'>40</span></b></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:12.0pt;line-height:
106%'>Figure 29: The corrupted return address
.</span><span lang=EN-US>
.
.</span></b><b><span
lang=EN-US style='font-size:12.0pt;line-height:106%'>40</span></b></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:12.0pt;line-height:
106%'>Figure 30: Segmentation Fault exception
.</span><span lang=EN-US>
.
.</span></b><b><span
lang=EN-US style='font-size:12.0pt;line-height:106%'>40</span></b></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:12.0pt;line-height:
106%'>Figure 31: Inner workings of shellcode exploit
.</span><span
lang=EN-US>
.
</span></b><b><span lang=EN-US style='font-size:
12.0pt;line-height:106%'>41</span></b></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:12.0pt;line-height:
106%'>Figure 32: Stack allocation using mmap
</span><span lang=EN-US>
.
.</span></b><b><span
lang=EN-US style='font-size:12.0pt;line-height:106%'>43</span></b></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:12.0pt;line-height:
106%'>Figure 33: The memory layout of a running process
.</span><span
lang=EN-US>
</span></b><b><span lang=EN-US style='font-size:12.0pt;
line-height:106%'>44</span></b></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:12.0pt;line-height:
106%'>Figure 34: Code reuse attack
</span><span lang=EN-US>
.
.</span></b><b><span
lang=EN-US style='font-size:12.0pt;line-height:106%'>45</span></b></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:12.0pt;line-height:
106%'>Figure 35: Stack frame before the corruption
.</span><span
lang=EN-US>
.
.</span></b><b><span lang=EN-US style='font-size:12.0pt;
line-height:106%'>47</span></b></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:12.0pt;line-height:
106%'>Figure 36: Detected memory corruption
.</span><span lang=EN-US>
.
.</span></b><b><span
lang=EN-US style='font-size:12.0pt;line-height:106%'>48</span></b></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:12.0pt;line-height:
106%'>Figure 37: The vulnerable program
.</span><span lang=EN-US>
.
..</span></b><b><span
lang=EN-US style='font-size:12.0pt;line-height:106%'>63</span></b></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:12.0pt;line-height:
106%'>Figure 38: Trampoline implementation
</span><span lang=EN-US>
.
.</span></b><b><span
lang=EN-US style='font-size:12.0pt;line-height:106%'>63</span></b></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:12.0pt;line-height:
106%'>Figure 39: The main program before applying the patch process</span><span
lang=EN-US>
..</span></b><b><span lang=EN-US style='font-size:12.0pt;
line-height:106%'>
64</span></b></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:12.0pt;line-height:
106%'>Figure 40: The workings of the patched program
.</span><span
lang=EN-US>
.</span></b><b><span lang=EN-US style='font-size:12.0pt;
line-height:106%'>.65</span></b></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:12.0pt;line-height:
106%'>Figure 41: The assembly representation of printName before the patching
process</span></b><b><span
lang=EN-US style='font-size:12.0pt;line-height:106%'>.66</span></b></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:12.0pt;line-height:
106%'>Figure 42: A substituted call instruction
</span><span lang=EN-US>
.
..</span></b><b><span
lang=EN-US style='font-size:12.0pt;line-height:106%'>66</span></b></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:12.0pt;line-height:
106%'>Figure 43: Executing the flawed program
.</span><span lang=EN-US>
.
.</span></b><b><span
lang=EN-US style='font-size:12.0pt;line-height:106%'>67</span></b></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:12.0pt;line-height:
106%'>Figure 44: Executing the patched program
</span><span
lang=EN-US>
</span></b><b><span lang=EN-US style='font-size:12.0pt;
line-height:106%'>67</span></b></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:12.0pt;line-height:
106%'>Table 45: Deprecated functions and their alternative
.</span><span
lang=EN-US>
</span></b><b><span lang=EN-US style='font-size:12.0pt;
line-height:106%'>70<br clear=all style='page-break-before:always'>
</span></b></p>
<div style='border:none;border-bottom:solid windowtext 2.25pt;padding:0cm 0cm 1.0pt 0cm;
margin-left:21.6pt;margin-right:0cm'>
<h1 style='margin-left:0cm;text-indent:0cm'><a name="_Toc170894101"><span
lang=EN-US>General Introduction</span></a></h1>
</div>
<p class=MsoNormal style='text-indent:35.4pt'><span lang=EN-US
style='font-size:12.0pt;line-height:106%'>Abstractions are valuable tools in
computer science; they enhance creativity and accelerate the evolution of
computer systems. However, they obscure the underlying workings of computer
systems, making it nearly impossible to understand how software bugs are
exploited by attackers, and hence how to develop robust security
countermeasures. Therefore, this work begins by attempting to strip away
fundamental abstractions related to the stack memory region using simple
language. After delving into the details underlying those abstractions, it will
be easier to understand how functions lacking bounds checking can lead to
exploitation by malicious users. We will examine the exploitation techniques
used by attackers to exploit the strcpy() function, to give a concrete example.
The primary aim of an exploitation technique is to alter the behavior of a
program from its intended functionality. We will also present examples of the
countermeasures devised by designers to thwart these exploits, the strategies attackers
employ to bypass these mitigations, and how these bypassing methods are
countered by the development of new security measures. </span></p>
<p class=MsoNormal style='text-indent:35.4pt'><span lang=EN-US
style='font-size:12.0pt;line-height:106%'>Software constitutes an essential
component of any computer system, as it dictates to the hardware the tasks to
be performed. It can be executed directly on the hardware, with restrictions
[1], or interpreted by a specific runtime environment. It is almost impossible
to create software that contains no bugs; The number of bugs is at least
proportional to the size of the program [2], and not dependent on the programming
language choice. This project focuses on addressing bugs that compromise the
stack memory security in the context of applications developed in C language.</span></p>
<p class=MsoNormal><span lang=EN-US> </span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:12.0pt;line-height:106%'> </span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:12.0pt;line-height:106%'> </span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:12.0pt;line-height:106%'> </span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:12.0pt;line-height:106%'> </span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:12.0pt;line-height:106%'> </span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:12.0pt;line-height:106%'> </span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:12.0pt;line-height:106%'> </span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:12.0pt;line-height:106%'> </span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:12.0pt;line-height:106%'> </span></p>
<div style='border:none;border-bottom:solid windowtext 2.25pt;padding:0cm 0cm 1.0pt 0cm'>
<h1><span lang=EN-US>Chapter 1<span style='font:7.0pt "Times New Roman"'> </span></span><span
dir=LTR></span><span lang=EN-US> <a name="_Toc170894102">Reducing the level of abstraction</a></span></h1>
</div>
<h2><a name="_Toc170894103"><span lang=EN-US>1.1<span style='font:7.0pt "Times New Roman"'>
</span></span><span dir=LTR></span><span lang=EN-US>Introduction</span></a></h2>
<p class=MsoNormal style='text-indent:35.4pt'><span lang=EN-US
style='font-size:12.0pt;line-height:106%'>As C is a procedural language, C
applications are built of a set of functions. Before delving into the issues
surrounding the memory safety of a C program's stack, it is crucial to
comprehend the compilation process when functions call each other and the role
of the stack in this operation.</span></p>
<p class=MsoNormal style='text-indent:35.4pt'><span lang=EN-US
style='font-size:12.0pt;line-height:106%'>As computing hardware becomes faster
and more powerful, software applications become more complex and sophisticated.
New generations of computer systems spawn new generations of software that can
do more powerful things than previous generations. As the software gets more
sophisticated, the job of developing an application becomes more difficult. To
keep the programmer from being quickly overwhelmed, it is critical that the
process of programming be kept as simple as possible. Automating any part of
this process (i.e., having the computer do part of the work) is a welcomed
enhancement in the history of computer science.</span></p>
<p class=MsoNormal style='text-indent:35.4pt'><span lang=EN-US
style='font-size:12.0pt;line-height:106%'>C is a compiled high-level language,
the compilation is done by tools (prebuilt software), which makes the developer
more focused on his job, innovative, and comfortable than programming with an
assembler language.</span></p>
<p class=MsoNormal style='text-indent:35.4pt'><span lang=EN-US
style='font-size:12.0pt;line-height:106%'>The use of tools such as compilers
and linkers also aids developers in identifying and eliminating subtle
programming errors, serving as an additional line of defense against
exploitable programming bugs.</span></p>
<p class=MsoNormal style='text-indent:35.4pt'><span lang=EN-US
style='font-size:12.0pt;line-height:106%'><img width=344 height=303
id="Picture 34" src="webRepportBinaryExp_files/image002.png"></span><span
lang=EN-US style='font-size:12.0pt;line-height:106%'> </span></p>
<p class=MsoNormal style='text-indent:35.4pt'><a name="_Hlk170889816"><b><span
lang=EN-US style='font-size:12.0pt;line-height:106%'> Figure 1:
Layers of abstraction</span></b></a></p>