<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Dor Rondel on Medium]]></title>
        <description><![CDATA[Stories by Dor Rondel on Medium]]></description>
        <link>https://medium.com/@GallegoDor?source=rss-2a7c905e25bd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*EiKFjz7W8ndKiyWYyo3kTA.jpeg</url>
            <title>Stories by Dor Rondel on Medium</title>
            <link>https://medium.com/@GallegoDor?source=rss-2a7c905e25bd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 14:23:46 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@GallegoDor/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Python Exploitation #2: Encapsulation]]></title>
            <link>https://medium.com/@GallegoDor/python-exploitation-2-encapsulation-e9a91e7f8e0e?source=rss-2a7c905e25bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/e9a91e7f8e0e</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[computer-security]]></category>
            <dc:creator><![CDATA[Dor Rondel]]></dc:creator>
            <pubDate>Sun, 21 Jun 2015 07:21:24 GMT</pubDate>
            <atom:updated>2015-06-21T07:26:01.172Z</atom:updated>
            <content:encoded><![CDATA[<p>This week’s topic 6/21/15: Encapsulation</p><p>While other programming languages such as Java for example, enable the programmer to create private variables and attributes, Python does not currently have a built-in private type. Some have gone ahead and implemented a private type in C for CPython, but that isn’t frequently used. A more common attempt, which can easily be exploited is known as encapsulation. Where you attempt to conceal information within your classes from users. Encapsulation in Python, like a lot of the language’s features, is very easy to implement. You simply need to add two underscores(_) during attribute declaration. As I said in the previous Python Exploitation article, the best way to understand the exploitation, is to actually see it being done. So I’ll get right to it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/681/1*T1_OkJfFoMYcTNuOtsp_jw.png" /><figcaption>Written on REPL.it Example class, note that in other languages || is equivalent to “or” in Python ;-)</figcaption></figure><p>We make a class called Character, which doesn’t inherit anything from a parent class. We make three normal attributes, followed by three encapsulated versions, which again, can be seen from the preceding double underscore (or in Python jargon, simply <em>dunder</em>). So far so good, now lets see what happens when we try to access all the attributes from an outside object.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/643/1*_fs3WJLgzpNGi0tqm3drYQ.png" /><figcaption>No need to be embarrassed of your weight Dylan, or should I say Dean</figcaption></figure><p>As we can see, the normal attributes can be accessed from an outside object, ordinarily named character. But the encapsulated ones couldn’t be accessed. Bingo, we’ve hidden our attributes, mission complete. Wrong! Now for the fun part — the exploitation!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/697/1*9wL5TpOdr3pd3TlXZ7IHEg.png" /></figure><p>We check the directory for our object (character), and see that our encapsulated attributes have a longer name. Instead of <strong><em>__real_age</em></strong>, <strong><em>__real_name</em></strong>, and <strong><em>__real_weight</em></strong>, they are called <strong><em>_Character__real_age</em></strong>, <strong><em>_Character__real_name,</em></strong> and <strong><em>_Character__real_weight</em></strong>. Now we just need to call the extended attribute name to our object, and voilà, we have access to our so-called <em>encapsulated</em> <em>private</em> variables.</p><p>P.S. sorry for not keep these articles weekly haha I will try to write at least a few more of these at a greater frequency than before. Hope you enjoyed and learnt from the read.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e9a91e7f8e0e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Sababa Programming Language]]></title>
            <link>https://medium.com/@GallegoDor/the-sababa-programming-language-e995ed5af86e?source=rss-2a7c905e25bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/e995ed5af86e</guid>
            <dc:creator><![CDATA[Dor Rondel]]></dc:creator>
            <pubDate>Sun, 22 Feb 2015 11:24:44 GMT</pubDate>
            <atom:updated>2015-06-21T05:26:18.598Z</atom:updated>
            <content:encoded><![CDATA[<h3></h3><p>The Sababa programming language is a simple, light-weight, and minimalistic Lisp implementation created by Dor Rondel. As of 2015, the language is still in its creation process, and therefore, shouldn’t be used for non-experimentation purposes. The language does vary slightly from other Lisp dialects, for example with its symbolic expressions; however, it still retains Lisp-like features (such as Polish notation etc.) The language was created for fun and recreational use, largely following Daniel Holden’s <a href="http://www.buildyourownlisp.com/">http://www.buildyourownlisp.com/</a>. Aside from the guidance and knowledge, I’d like to thank him (and several others) for creating the Micro Parser Combinators (MPC), which Sababa utilizes.</p><p>The language is open source, and is therefore open to public contribution. It is licensed under the Apache License version 2.0! Sababa’s code can be found in its public repository here: <a href="https://github.com/GallegoDor/SababaLisp/blob/master/REPL/uniform/REPL.c">https://github.com/GallegoDor/SababaLisp/blob/master/REPL/uniform/REPL.c</a>.</p><p>For any questions regarding the language, or if you have any errors to report regarding the book or Sababa, you may use the contact feature built-in to the site.</p><p>For those interested in reading the ebook, follow the link below.</p><p>Enjoy the read :D</p><p><a href="http://gallegodor.gitbooks.io/the-sababa-programming-language/">http://gallegodor.gitbooks.io/the-sababa-programming-language/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e995ed5af86e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python Exploitation #1: Input()]]></title>
            <link>https://medium.com/@GallegoDor/python-exploitation-1-input-ac10d3f4491f?source=rss-2a7c905e25bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/ac10d3f4491f</guid>
            <category><![CDATA[computer-security]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Dor Rondel]]></dc:creator>
            <pubDate>Sun, 22 Feb 2015 10:55:01 GMT</pubDate>
            <atom:updated>2015-06-21T05:40:43.578Z</atom:updated>
            <content:encoded><![CDATA[<p>This week’s topic 22/2/15: Input()</p><p>Since this is the first article in this new series, I’ll begin by explaining what this experiment is all about. I decided to begin writing a collection of articles all about exploiting programming mishaps, which shall be known as <strong><em>Exploitation</em></strong><em>.</em> The main purpose of these articles, is to prevent security issues by informing readers who might’ve not been aware of these vulnerabilities prior to reading the article. Another motive would be promoting CTF (Capture the Flag) cybersecurity competitions. For the time being, I’ll try releasing these on a weekly basis. With that said, lets get started!</p><p><strong>Before we dive in, a quick notice.</strong></p><p>For those of you who are using Python version 3.x, this does NOT apply to you. For those who don’t know, in Python 3, the raw_input() function was erased, and it’s functionality was transferred to a new built-in function known as input(). As oppose to Python 2.x, which both the input() and raw_input() function exist. Therefore this article only applies to programs written in Python 2.x.</p><p>The eval() function in Python receives a lot of criticism for it’s potentially dangerous misuse. As a reminder, the eval() function evaluates a string of text which is passed as its parameter, accepting a possible second argument for the global values to use during evaluation. Furthermore, the input() function in Python 2.x, would be the same as writing eval(raw_input()). For those who haven’t caught on yet. This makes the input() function very vulnerable.</p><p>There’s no better way to understand its vulnerability, then by seeing the function exploited. Therefore, I’ll demonstrate input()’s exploitation by writing up a small guessing game script.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/1*oLi5Jvby9JKfykOTofBt_w.png" /><figcaption>Really simple guessing game in Python. And yes that’s Sublime Text!</figcaption></figure><p>The first two lines of the program can be ignored for our purposes, they’re comments. We begin by importing the random module, so that we can use random.randint(1, 10001) to generate a number in that range, and set it equal to variable <strong>lucky_num</strong>. In a potential infinite loop, we set variable <strong>res</strong> equivalent to the user’s input. And finally test if that input is equal to the random number which was randomly generated. If they’re equal, a message will be outputted, otherwise the loop will keep going. Now for the exploitation….</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/571/1*N7KNxxmzAAW2bAyfsWs0-g.png" /><figcaption>Running and exploiting the program in terminal.</figcaption></figure><p>From reading the the text in the image above, you can see that after I ran the program in terminal I was prompted for a number. After trying unsuccessfully several times, I decided to just use the variable name which stores the value of the random integer. In our case, this was <strong>lucky_num. </strong>Since input() is the same as eval(raw_input()), it evaluates the variable as if a number was directly entered, by which means it returns a <strong>True</strong> Boolean value and ends the game. Had I used raw_input() instead, this wouldn’t have been an issue.</p><p>The example above is just for a small and insignificant game. But imagine you used input() to obtain a user’s credentials and stored them in a database. That user is potentially vulnerable to identity theft or robbery among other things, if the perpetrator has access to your script. Therefore, word of the wise. If you insist on sticking to Python 2.x, stick to raw_input() as well. Also try to avoid misusing eval().</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac10d3f4491f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>