-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex3.html
More file actions
135 lines (129 loc) · 6.75 KB
/
Copy pathindex3.html
File metadata and controls
135 lines (129 loc) · 6.75 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
<!DOCTYPE html>
<html lang="en">
<head>
<title>aufarg:/var/log $ _</title>
<link href='https://fonts.googleapis.com/css?family=Inconsolata' rel='stylesheet' type='text/css'>
<link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Open+Sans+Condensed:300" rel="stylesheet">
<link rel="stylesheet" href="https://aufarg.github.io/theme/css/main.css" type="text/css" />
<link rel="stylesheet" href="https://aufarg.github.io/theme/css/pygments.css" type="text/css" />
<link rel="stylesheet" href="https://aufarg.github.io/theme/css/font-awesome.min.css" type="text/css" />
<meta charset="utf-8" />
</head>
<body id="index" class="home">
<header id="banner" class="body">
<div class="banner"><a href="https://aufarg.github.io">aufarg:/var/log $ _ <strong></strong></a></div>
<nav>
<ol class="nav">
<li><a href="https://aufarg.github.io/categories.html">categories</a> </li>
<li><a href="https://aufarg.github.io/tags.html">tags</a> </li>
<li><a href="https://aufarg.github.io/archives.html">archive</a></li>
</ol>
<ul>
</ul>
</nav>
</header>
<div class="box">
<section id="content">
<div class="posts">
<ol id="post-list">
<li>
<article class="archive">
<header class="post">
<h1 class="archive-post-title">
<a href="https://aufarg.github.io/meepwn-ctf-2017-t-100.html" rel="bookmark" title="permalink to MeePwn CTF 2017: |\/|/-\T|-| (100)">MeePwn CTF 2017: |\/|/-\T|-| (100)</a>
</h1>
</header>
<div class="post-info">
<div class="post-date">
<abbr>Tue 18 July 2017</abbr> ·
2 min read </div>
</div> <div class="post-summary"> <p>We are given a file, <code>hack.py</code>, which looks as follows.</p>
<div class="highlight"><pre><span class="code-line"><span></span><span class="kn">from</span> <span class="nn">Crypto.Util.number</span> <span class="kn">import</span> <span class="o">*</span></span>
<span class="code-line"><span class="kn">from</span> <span class="nn">hashlib</span> <span class="kn">import</span> <span class="n">md5</span></span>
<span class="code-line"></span>
<span class="code-line"><span class="n">flag</span> <span class="o">=</span> <span class="s2">"XXX"</span></span>
<span class="code-line"><span class="k">assert</span> <span class="nb">len</span><span class="p">(</span><span class="n">flag</span><span class="p">)</span> <span class="o">==</span> <span class="mi">4</span></span>
<span class="code-line"><span class="n">pad</span> <span class="o">=</span> <span class="n">bytes_to_long</span><span class="p">(</span><span class="n">md5</span><span class="p">(</span><span class="n">flag</span><span class="p">)</span><span class="o">.</span><span class="n">digest</span><span class="p">())</span></span>
<span class="code-line"></span>
<span class="code-line"><span class="n">hack</span> <span class="o">=</span> <span class="mi">0</span></span>
<span class="code-line"></span>
<span class="code-line"><span class="k">for</span> <span class="n">char</span> <span class="ow">in</span> <span class="n">flag</span><span class="p">:</span></span>
<span class="code-line"> <span class="n">hack</span><span class="o">+=</span> <span class="n">pad</span></span>
<span class="code-line"> <span class="n">hack</span><span class="o">*=</span> <span class="nb">ord</span><span class="p">(</span><span class="n">char</span><span class="p">)</span></span>
<span class="code-line"></span>
<span class="code-line"><span class="k">print</span> <span class="n">hack</span></span>
<span class="code-line"><span class="k">print</span> <span class="n">pad</span></span>
<span class="code-line"><span class="k">print</span> <span class="n">hack</span> <span class="o">%</span> <span class="n">pad</span></span>
<span class="code-line"><span class="c1">#hack …</span></span></pre></div>
<a href="https://aufarg.github.io/meepwn-ctf-2017-t-100.html">read more</a></div>
</article>
</li>
<li>
<article class="archive">
<header class="post">
<h1 class="archive-post-title">
<a href="https://aufarg.github.io/btrfs-access-beyond-end-of-device.html" rel="bookmark" title="permalink to BTRFS: Access Beyond End of Device">BTRFS: Access Beyond End of Device</a>
</h1>
</header>
<div class="post-info">
<div class="post-date">
<abbr>Fri 10 February 2017</abbr> ·
5 min read </div>
</div> <div class="post-summary"> <p>TL;DR: There's a problem in my filesystem and it made my important
file corrupted.</p>
<hr>
<h5><em>What's the scariest thing that happened in your life?</em></h5>
<p>In this post I want to share one of the scariest thing that happened to me:
BTRFS filesystem suddenly attempt to access beyond end of device …</p>
<a href="https://aufarg.github.io/btrfs-access-beyond-end-of-device.html">read more</a></div>
</article>
</li>
<li>
<article class="archive">
<header class="post">
<h1 class="archive-post-title">
<a href="https://aufarg.github.io/implementation-vs-design.html" rel="bookmark" title="permalink to Implementation vs Design">Implementation vs Design</a>
</h1>
</header>
<div class="post-info">
<div class="post-date">
<abbr>Fri 10 February 2017</abbr> ·
3 min read </div>
</div> <div class="post-summary"> <p>In my school, there's a common dogma that software implementation is easy,
the hard part is designing. This dogma emerge as I take software engineering
classes. The lecturers keep a big emphasize on how cool to design a software
and how lame to implement a software. For me, I always …</p>
<a href="https://aufarg.github.io/implementation-vs-design.html">read more</a></div>
</article>
</li>
</ol>
</div>
<p class="pagination">
<a href="https://aufarg.github.io/index2.html"><i class="fa fa-angle-left direction" aria-hidden="true"></i></a>
page 3 / 3
</p>
</section>
<hr/>
</div>
<footer id="siteinfo" class="footer">
<div>
<a href="https://aufarg.github.io">Aufar Gilbran</a> (2012)
</div>
<div>
powered by <a href="http://getpelican.com/">Pelican</a>
and <a href="http://python.org">Python</a>.
Theme based on <a href="http://github.com/slok/iris">iris</a>
</div>
<div>
Icons from Font Awesome by <a href="http://fontawesome.io/"> font awesome</a>.
<a href="https://fonts.google.com/specimen/Open+Sans+Condensed">Title & headers</a>, <a href="https://fonts.google.com/specimen/Lato">body</a> and <a href="https://fonts.google.com/specimen/Inconsolata">source code</a> fonts by google fonts
</div>
<div class="social">
<a href="https://github.com/aufarg"><i class="fa fa-github-square"></i></a>
<a href="#"><i class="fa fa-Another social link-square"></i></a>
<a href="mailto:aufargilbran@gmail.com"><i class="fa fa-envelope-square"></i></a>
</div>
</footer>
</body>
</html>