<?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 Marinos Agapiou on Medium]]></title>
        <description><![CDATA[Stories by Marinos Agapiou on Medium]]></description>
        <link>https://medium.com/@minosagap?source=rss-4c9f21a264e4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*3hr0I_d6DdIlN-VRYRSkNg.jpeg</url>
            <title>Stories by Marinos Agapiou on Medium</title>
            <link>https://medium.com/@minosagap?source=rss-4c9f21a264e4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 07:53:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@minosagap/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[Communication skills ?]]></title>
            <link>https://medium.com/@minosagap/communication-skills-e78749c29a32?source=rss-4c9f21a264e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/e78749c29a32</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[communication]]></category>
            <dc:creator><![CDATA[Marinos Agapiou]]></dc:creator>
            <pubDate>Sat, 09 Feb 2019 20:19:03 GMT</pubDate>
            <atom:updated>2019-02-09T20:32:57.133Z</atom:updated>
            <content:encoded><![CDATA[<h3>Communication skills ?</h3><p>The ability to explain something efficiently is probably the number one skill that is missing a lot from the tech world.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NEHw6sbKAo0opP6u" /><figcaption>A typical team meeting</figcaption></figure><p>I realized in a team meeting months ago that human communication sucks!</p><p>I remember we were trying to come up with a solution to a problem that everyone had a different understanding and everyone had assumed something different about.</p><p>The fun part was that the project managers, that assigned that specific task to us(engineers), had interpreted the problem differently from one another.</p><p>In other words everyone had a different opinion about what “had to be done” and what really is the problem.</p><p>Guess what happens when the managers tried to explain the problem to the team.</p><p>Confusion and Chaos</p><p>After that, we needed 2 more hours figuring out stuff.</p><p>After that, I was perfectly sure that <strong>efficient communication is a skill.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Mkrvj7wMs0fxUC_g" /><figcaption>A kid yelling because why not</figcaption></figure><p>Probably you have been in the situation where one person tries to explain something and you can’t get a word.</p><p>Then a second person, that is better at communicating, explains it so much better that you understood every single word he said.</p><p>A great example is whenever I google something that I want to understand (recently that thing was “the difference between forward proxy and reverse proxy” :P )and I read 1, 2 maybe 3 blog posts and I still don’t get it and I keep searching until I find the one that explains it better.</p><p>In other words I was searching for the person is a better communicator for the specific thing.</p><p>You still don’t get it ?</p><p>Let me try something else.</p><p>Whenever I am talking with other undergrad students about our university professors, the main thing that separates a great professor from a bad one is his ability to communicate.</p><p>If a professor is good at communicating and expressing himself in a way that everything is easy to understand, students are going to love him.</p><p>On the other hand, if a professor sucks at communicating and most of the things he talks about are really complicated, students will kind of hate him :P</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SyihoU2wVdDJe8T2" /><figcaption>Some class of maybe Physics :P</figcaption></figure><p>It has nothing to do with the professors knowledge or technical or research level and background.</p><p>He can be the greatest researcher on earth but he is really bad at teaching which means he is bad at communicating with his students.</p><p>If you thing about it teaching is actually the process of knowledge transfer from a the professor/teacher to the student.</p><p>And by teaching at University I mean all written and verbal words and sentences that the professor outputs.</p><p>Now let me give you an example of sentence that is not so simple to understand and an example of a sentence that the meaning is crystal clear:</p><p>A <strong>bad answer</strong> to the Question <strong>“What is the difference between a forward and a reverse proxy”</strong> would be:</p><blockquote>While a <strong><em>forward proxy</em></strong> proxies in behalf of clients <strong>(</strong> or requesting hosts <strong>)</strong>, a <strong><em>reverse proxy</em></strong> proxies in behalf of servers. In effect, whereas a <strong><em>forward proxy</em></strong> hides the identities of clients, a <strong><em>reverse proxy</em></strong> hides the identities of servers</blockquote><p>A <strong>good answer</strong> to the Question <strong>“What is the difference between a forward and a reverse proxy”</strong> would be:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/277/0*6zD18BOlaVLZzC_p.png" /></figure><blockquote><strong>Forward Proxy : It is making the request on behalf of the client</strong>. So, the server will return the response to the proxy and the proxy will forward the response to the client. In fact, the server will never “learn” who the client was (client’s IP), it will only know the proxy. However, the client definitely knows the server, since it essentially formats the HTTP request destined for the server, but it just hands it to the proxy.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*CZv96_30Z_Ic30wT.png" /></figure><blockquote><strong>Reverse Proxy : It is receiving the request on behalf of the server</strong>. It forwards the request to the server, receives the response and then returns the response to the client. In this case, the client will never “learn” who was the actual server (server’s IP) (with some exceptions), it will only know the proxy. The server will or won’t know the actual client, depending on the configurations of the reverse proxy.</blockquote><p>Probably you can see the difference.</p><p>Both the answers are saying the same thing.</p><p>The first answer, the bad one, is so brief that doesn’t explain things properly.</p><p>The second answer, the good one, is so clear I would sent an email to the person that wrote it and thank him :P</p><p>Bad examples, like above, is something I see everyday on stack-overflow.</p><p>The skill of expressing yourself efficiently is really the number one skill that is missing from a lot of people in the tech industry.</p><p>Last but not least, I hope I communicated my ideas on this as simply as possible :P</p><p><em>Thanks for reading!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e78749c29a32" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CERN Summer Internship]]></title>
            <link>https://medium.com/@minosagap/cern-summer-internship-2b0dc5f1463f?source=rss-4c9f21a264e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/2b0dc5f1463f</guid>
            <category><![CDATA[internships]]></category>
            <dc:creator><![CDATA[Marinos Agapiou]]></dc:creator>
            <pubDate>Sun, 03 Feb 2019 17:03:36 GMT</pubDate>
            <atom:updated>2019-02-05T17:51:23.661Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gMS3EAV2P5GwpbD7v8urSA.jpeg" /><figcaption>A little bit of Physics, because why not :P</figcaption></figure><p>It was almost two years ago, when I saw on a Facebook group that CERN, the Largest Research Center on Earth, is accepting undergraduate students for summer internship.</p><p>Of course I knew about CERN but I thought that only Physicists can go there.</p><p>Then I read that CERN accepts people with different backgrounds from mechanical engineers to physicists to computer scientists… etc.</p><p>And there it hit me “I have to apply”.</p><p>The reasons?…. many :P</p><p>I mean who doesn’t want to apply for a summer internship in the place where the <strong>“World Wide Web”</strong> was born.</p><p>At the time I was finishing my third year of Bachelor degree at my University and I was feeling ready for an internship in a big organization like CERN, considering the fact that I had done another summer internship in another tech company.</p><p>So, I applied and as you have probably guessed, I got accepted.</p><p>I still remember the day that I saw the last email from CERN human resources team with something like: “Congratulations, you are accepted for the summer student program”.</p><p>I didn’t feel real.</p><p>I was jumping all around.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgfycat.com%2Fifr%2Fflakydentalaldabratortoise&amp;url=https%3A%2F%2Fgfycat.com%2Fflakydentalaldabratortoise&amp;image=https%3A%2F%2Fthumbs.gfycat.com%2FFlakyDentalAldabratortoise-size_restricted.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=gfycat" width="844" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/07c2f0e63712c8efe732fcfa13c231a6/href">https://medium.com/media/07c2f0e63712c8efe732fcfa13c231a6/href</a></iframe><p>So the day came to fly to Geneva because CERN is located close the boarders of Geneva with France.</p><p>From the airport to CERN was a 20 minute ride by bus.</p><p>While you are arriving at CERN the first thing you observe is the CERN Globe.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/0*z3G9qB9R03rxRmDk.jpg" /><figcaption>CERN Globe</figcaption></figure><p>Here, I have to say that CERN has three hotels inside the campus and another another one outside(maybe it has more but that is what I remember).</p><p>I was staying at hotel 38 inside the campus because I am a little lazy in the morning and I didn’t want take the bus or ride a bike for ten minutes to office but that is just me, you can stay wherever you want.</p><p>So, here came the first day where all the summer students of the same period gathered in a huge hall where people from HR showed us around and told us the basics about CERN facilities.</p><p>After that we were ready to start our Internship.</p><h3><strong>The work part :</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xCnyAD88wkqtWEIG" /></figure><p>Every summer intern has his own project inside a team of scientists and engineers.</p><p>Also as a summer intern you have a supervisor, which is great because he/she will guide you all the way to the end of your project.</p><p>Your supervisor will make sure that you are both learning new interesting things and having fun at the same time.</p><p>I had the opportunity to have a supervisor that was a real master in his field and he taught me many things.</p><p>Above all the things my supervisor taught me, he gave me a real important lesson:</p><blockquote><strong>“Don’t wait too much to ask for help”</strong></blockquote><p>That time, I preferred to struggle with a problem for a day by myself other than asking for help and solving it in less than an hour.</p><p>Now I have a different mindset and I believe that it is really important to accept the fact that you don’t know all and it is really important to ask for help whenever you need it.</p><p>If you get accepted as an Intern at CERN try to take with you as much as possible from your supervisor because the fact is that he/she is going to be a lot more advanced than the average engineer/scientist.</p><p>The great thing about CERN culture is that everyone is working for the team and the team is working for everyone.</p><p>If you are an intern this kind of culture is great because you are just starting out and guess what, you are going to need all the help you can get.</p><p>I remember that everyone is open to questions and ready to give you info about a problem that you are struggling to solve.</p><p>So let’s get back on track.</p><p>Your project at CERN is probably something that needs around 4-5 weeks of study followed by 4-5 weeks of work (at least that was my project structure).</p><p>So, you don’t have to worry that your supervisor is going to assign you something extremely difficult (that was something I was a little bit scared to be honest :p).</p><p>Remember it is an internship, so they are going to assign you something that you are going to learn new things that you can apply to solve something in a months work.</p><p>Oh, I almost forgot to tell you about my project.</p><p>Well, I had to create a monitoring tool, for a couple of Infiniband Switches in CERN Data Center using Python and SNMP protocol.</p><p>At that time I didn’t even know how a professional network switch works let alone monitoring the switch with SNMP.</p><p>But I had all the help and guidance from my supervisor and team so I managed to finish it on time.</p><p>There are also other great interesting stuff like the morning lectures on physics and engineering that every intern can attend.</p><p>Trust me they are worthy because they are going to teach you a lot about physics and you will have a better understanding what are CERN scientists working on and more importantly what is CERN mission.</p><p>During the lectures you also get to meet other interns that are attending, so you can also see it as an opportunity to make new friends.</p><h3><strong>The fun part :</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pIn3ezjQ6c5LaHAH" /></figure><p>During my stay at CERN I met a lot of people from every place on earth.</p><p>CERN is attracting people from all over the world.</p><p>I didn’t feel like a foreigner, not even a second.</p><p>Every day after office hours we were chilling either outside or inside the campus (most of the time at Restaurant1).</p><p>There are a lot of places for a drink either in France (well now that I think about it in France we were only going in two :P ) or in Geneva.</p><p>We also organized a welcome party inside the campus to get to meet each other with a couple of drinks.</p><p>The one thing I remember we were doing every Wednesday is going for BBQ near the lake of Geneva where there was also an open Latin dance party nearby and everyone was more than welcome.</p><p>Geneva during the summer is great.</p><p>There is also this Festival near the Lake “Fetes de Geneve” where amazing fireworks take place along with great music.</p><p>Well apart from If you are staying in Switzerland you have to visit the wonderful Swiss Alps.</p><p>So, we traveled to Swiss Alps to reach the highest top of Europe : <a href="https://en.wikipedia.org/wiki/Mont_Blanc">Mont Blanc</a><strong>.</strong></p><p>Well to be honest we didn’t exactly reach the top :P but as high as the teleferic got us.</p><p>It was really amazing. The view up there is beyond compare.</p><p>We also made a trip to Paris! Oh, I forgot to say that Switzerland is a perfect place to live if you enjoy traveling in other European countries because Switzerland is kind of located in the middle of Europe and you have the opportunity to travel by car or bus or train (in case you don’t really enjoy airplanes).</p><p>I have to admit it was one hell of a summer.</p><p><em>Thanks for reading!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2b0dc5f1463f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Same Origin Policy and ways to Bypass]]></title>
            <link>https://medium.com/@minosagap/same-origin-policy-and-ways-to-bypass-250effdc4a12?source=rss-4c9f21a264e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/250effdc4a12</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Marinos Agapiou]]></dc:creator>
            <pubDate>Sun, 13 Jan 2019 21:35:24 GMT</pubDate>
            <atom:updated>2019-01-14T21:08:42.562Z</atom:updated>
            <content:encoded><![CDATA[<p>This is something that really got my attention when I started with Web Security.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qW5yKgTf5kpCB5gkq2uw3Q.jpeg" /><figcaption>Learning Same Origin Policy…</figcaption></figure><p>I am the type of Software Engineer that when I find something fascinating, I want to learn how it really works and I hope you do too.</p><p>Let’s start by saying a little bit about Same Origin Policy and why we need it.</p><p>Same Origin Policy (or SOP), to keep this simple, prevents JavaScript code from one origin like “website1.example” to access private data on another origin “website2.example”.</p><p>Same Origin Policy == JavaScript code can access/read data that come<strong> ONLY </strong>from the Same Origin.</p><p>In other words Cross-Origin <em>reads</em> are not allowed.</p><p>Here I have to make clear that Same Origin Policy doesn’t block a Request from one origin to reach its destination, all it does is to hide the Response.</p><p>For example JavaScript from “website1.example” cannot access my profile data in “website2.example/myprofile” because again Same Origin Policy doesn’t allow Cross Origin reads.</p><p>Another example would be that JavaScript coming from “website1.example” cannot access the JavaScript code and also the DOM of “mywebbanking.example” page.</p><p>By now you probably get it, we can’t live without SOP.</p><p>But wait, what if I need the JavaScript code in my website to access some data like pictures, personal information of my users from another API or even some other JavaScript code from another origin? Can I do that ?</p><p>Or what if I want my Restful API to be consumed by applications running on different origins ?</p><p>So, sometimes you need to bypass SOP because you need a certain functionality to your application.</p><p>So, here are 2 simple ways to bypass Same Origin Policy :</p><h3>1) JSONP</h3><p>JSONP enables sharing of data bypassing SOP.</p><p>When I first saw this “hack” my brain almost explode, by the elegance and beauty of the way it works.</p><p>Can’t wait to explain this to you :P</p><p>Of course you all know the &lt;script&gt; element that allows us to add JavaScript code to an HTML.</p><p>This famous &lt;script&gt; element is allowed to execute JavaScript code that is retrieved from foreign origins. Pretty obvious, right?</p><p>Everyone has already done it with including some JavaScript library like with Bootstrap for example.</p><p>That means that SOP doesn’t block &lt;script&gt; element from retrieving content of another origin.</p><p>Great!, so What about JSONP? What is JSONP?</p><p>JSONP ==JSON with Padding</p><p>So &lt;script src=”website1.example/static/JavaScriptLib.js”&gt; retrieves JavaScript code by performing a GET Request to the value of src.</p><p>But what if I want to retrieve some JSON objects and get some data.</p><p>That would be really helpful.</p><p>In order to accomplish this you need to have a JavaScript function like</p><pre>mycallback = function(data){<br>  console.log(data)<br>};</pre><p>Now let’s say that I have this URI : <a href="http://www.example.net/s">https://www.myexampleuri.net/data</a></p><p>that when you perform a GET Request to it, you will get some JSON data like:</p><pre>{name: &quot;John&quot;, numberOfPosts:12, numberOfLikes:61}</pre><p>Now imagine that this endpoint in our server is JSONP enabled which means that when I perform a GET Request to :</p><p><a href="http://www.example.net/s">https://www.myexampleuri.net/data?callback=mycallback</a></p><p>I receive back something like :</p><pre>mycallback({name: “John”, numberOfPosts:12, numberOfLikes:61});</pre><p>Now lets say that in my front end code I have something like</p><pre>&lt;script src=<a href="http://www.example.net/s">https://www.myexampleuri.net/data?callback=mycallback</a>&gt;&lt;/script&gt;</pre><p>The above element will perform a GET Request to our server and it will look something like this :</p><pre>&lt;script&gt;<br>     mycallback({name: “John”, numberOfPosts:12, numberOfLikes:61});<br>&lt;/script&gt;</pre><p>This will trigger the function “mycallback” with the above parameters.</p><p>BOOM we retrieved some JSON data and we are ready to process it!!!</p><h3><strong>2) CORS</strong></h3><p>CORS or Cross Origin Resource Sharing is a mechanism to tell the browser to allow some data to be accessed from a different origin.</p><p>If you are developing single page applications you have already come across CORS mechanism.</p><p>The way CORS work is for example when JavaScript from origin “website1.example” Requests data from another origin “website2.example” the browser blocks the Response so that it doesn’t reach the JavaScript code in “website1.example”.</p><p>Now, what if the application server in “website2.example” wants to ask the browser to allow the Response to reach the JavaScript code of “website1.example” ?</p><p>This can be easily solved by adding the following Header in our server-side Response:</p><p>Access-Control-Allow-Origin: <a href="http://foo.example/">https://website1.example</a></p><p>This way most single page applications and Restful APIs work.</p><p>Nowadays a huge number of Restful Services are available for developers to use.</p><p>Let’s say for example that you have created a small app in Angular6 and you want to add some Google analytics functionality because you want to monitor how your users interact with your application.</p><p>Now Google, in order to allow your application to consume the Google analytics API, has added this extra Header to every Response.</p><p>Also if you are in the process of creating a Restful API you are going to have to enable some kind of CORS in order for it to be consumable by applications running on different origins.</p><p>Here you have to be careful about which applications you allow to have access to your content and also what kind of access.</p><p>I am saying this because many developers without understanding how CORS work, are just allowing every foreign application under the sun to consume their API by adding the following Header: Access-Control-Allow-Origin: *</p><p>A good practice would be to specify the Request methods that you want to allow cross origin like POST or DELETE, with a Header like :</p><pre>Access-Control-Allow-Methods: POST, DELETE, OPTIONS</pre><p>Sometimes you don’t want to allow an application with different origin to execute POST Requests and retrieve the Response of such Requests.</p><p>Last but not least, for more security, try to keep a whitelist of every origin/application that you want to allow to consume your API along with the appropriate methods.</p><p><em>Thanks for reading!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=250effdc4a12" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to protect against CSRF ?]]></title>
            <link>https://medium.com/@minosagap/how-to-protect-against-csrf-26ba7172c0c8?source=rss-4c9f21a264e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/26ba7172c0c8</guid>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Marinos Agapiou]]></dc:creator>
            <pubDate>Sun, 06 Jan 2019 11:59:52 GMT</pubDate>
            <atom:updated>2019-01-06T12:06:09.695Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to protect against CSRF ?</h3><p>It is time for you to apply some security to your apps!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BtWr4YMDfWeZycDIm5Vkag.jpeg" /><figcaption>Please make your Web apps secure :P</figcaption></figure><p>I assume that you already know about the CSRF vulnerability, probably because you have already read about it, in my other post <a href="https://medium.com/@minosagap/understanding-the-csrf-vulnerability-be26a660382b">here</a>. If you haven’t please do, I can wait……<a href="https://medium.com/@minosagap/understanding-the-csrf-vulnerability-be26a660382b">:P</a></p><p>Did you finish reading it ?</p><p>Great, let’s start!</p><p>So, in my opinion the best way to defend against CSRF would be to use CSRF tokens.</p><p>For example every time you perform a HTTP POST Request submitting a form, add a CSRF token inside the Request, so that you can be sure that this is a valid “form submission”.</p><p>Form Example:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5939fe85b976e2d5dc46fe812d8ab0cd/href">https://medium.com/media/5939fe85b976e2d5dc46fe812d8ab0cd/href</a></iframe><p>So as you can see I added the following input to my form :</p><pre>&lt;input type=”hidden” name=”csrf_token” value = “lD6cB4sIZoJjTtM1F8H0TGE_pBwkvN_F3WwnE4ZeNoGDmHFNX0QAnhRcYNHB4zY7xa7tfSNqlrtl4451WW_J11OZRS-rkfGb46GSNeiomTY1”&gt;</pre><p>Some frameworks like Spring Security manage stuff like that pretty easily.</p><p>Now every time this POST Request reaches our Back-end application, the token is first validated and if it is not a valid token then the Request will not go through. Only if the token is valid, the Request will be handled as a valid Request.</p><p>The CSRF token must be a random set of characters. As you have already guessed you must NOT use the same token for every form every time because this way an attacker would just find one token and include it in every malicious Request.</p><p>Don’t forget to save it somewhere in your Back-end implementation(Memcache, Redis etc).</p><p>Also this token must be associated with the <strong>specific</strong> form and the <strong>specific</strong> sessionID/userID of the user.</p><p>Don’t try to implement your own generator for CSRF tokens, use one that is already implemented like <a href="https://github.com/expressjs/csurf">middleware for Node.js</a> (in case you are a Node.js geek).</p><p>Someone could say : “So what?… if an attacker can inject JavaScript in another website, he can perform a GET Request to our page, apply some web scraping, retrieve the validation token and afterwards implement the CSRF attack using it.</p><p>Right?</p><p>Well, not so easily :P</p><p>Thanks to something called <a href="https://en.wikipedia.org/wiki/Same-origin_policy">Same Origin Policy,</a> a script from one origin cannot access the data of another origin.</p><p>Let me give you an example to make this clear:</p><p>I will try from one page in the browser(github.com) to perform an Ajax Request to another page(google.com), to see if we can get the content of the Response.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ktCAbL75nOvzuIKHTsuBcw.png" /><figcaption>Ajax HTTP GET Request from one origin to another</figcaption></figure><p><strong>Content Security Policy…</strong> as you can see in the developers console we can’t read the response of the Request.</p><p>But here let me make crystal clear that Same Origin Policy doesn’t block the Request from reaching google.com, all it does is hide the Response.</p><p>Maybe now you are wondering, why do we even need same origin policy ?</p><p>Well simply because otherwise a JavaScript code from one origin A.example could access private data from a second origin B.example</p><p>That means that JavaScript from origin A.example can read the DOM of the JavaScript of origin B.example.</p><p>Now imagine B.example is your banks website and the JavaScript from origin A.example can read your username and password of B.example :P .</p><p>But don’t worry Same Origin Policy is probably here to stay, so all you have to do from now on is to make your forms CSRF safe!!!</p><p><em>Thanks for reading!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=26ba7172c0c8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[3 tips to Kick-Ass on an Interview]]></title>
            <link>https://medium.com/@minosagap/3-tips-to-kick-ass-on-an-interview-198199f75b28?source=rss-4c9f21a264e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/198199f75b28</guid>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Marinos Agapiou]]></dc:creator>
            <pubDate>Sun, 30 Dec 2018 12:43:15 GMT</pubDate>
            <atom:updated>2019-01-05T15:36:02.778Z</atom:updated>
            <content:encoded><![CDATA[<p>So finally they ask you for a face to face interview to their offices.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*46sRz17TOE1HBrsFIL5Zjg.jpeg" /></figure><p>You applied for the Job in the company you want so bad, to be part of.</p><p>They analyzed your CV and you got accepted because you took the time to make a CV worth of reading.</p><p>Great!!… after that, probably they sent you some coding assignments to test your programming skills and you killed it!!!</p><p>You prepared a whole summer to improve your programming and problem solving skills and the outcome is obvious.</p><p>So you go to their offices, they talk to you and they ask you more personal questions like “Why you applied?” and “Why you want to be a part of our organization?”.</p><p>They want to see if you share the same values or even they want to see if you are good with people and a team player and the list goes on and on.</p><p>So here are my personal 3 tips to kick-ass on a Face to Face Job Interview(btw this does not apply to Software Engineers only):</p><h3>1)The “Why you want to work with us?” Question</h3><p>So it comes to a point and the interviewer asks “Why you want to join our organization?”</p><p>And you answer something like “I heard that you offer 30 days of paid leave per year” or “It is an opportunity to meet people from all over the world and improve my communication skills”.</p><p>The interviewers respond to that, would be something like:</p><p>“You can also work at a Bakery and do that” :P</p><p>Trust me on this one, it is better to say something simple like:</p><p>“The reason I chose to apply to your company is that not only I really like the products you create but also the fact that these products create positive impact to other people and other organizations”</p><p>Or maybe even a little bit more spicy like:</p><p>“I chose your organization because I believe in what you believe, I believe in shaping a future that technology serves human factor”</p><h3>2) Be more confident</h3><p>You are on the way to their offices and thoughts like “Maybe I am not ready yet” or “What if I am not good enough for the job” are the worst thing your mind should focus on.</p><p>Imagine that you go there with a doubt that you are not good enough and guess what, your confidence is going to be destroyed and you are are going to be stressed like hell.</p><p>So when you start talking, only fear and self-doubt comes out of your mouth.</p><p>I don’t know about you but if I was interviewing you for a mid level role on Front end JavaScript and I would ask something like “How confident you feel with writing JavaScript ?” and your answer is something like ”it depends on the projeeeeect…. and maybe on the JavaScript framework I am working on” or maybe “So I am confident but I will need also help from tutorials or other colleagues”.</p><p>That right there stop, you destroyed it!</p><p>That doesn’t mean that you will not get the Job for sure but it means that you are not a confident Developer that can come up with a solution and can take matters at hand when he has to.</p><p>On the other hand if I would prefer your answer was something full of Confidence like :</p><p>“Yes!! I feel confident in writing JavaScript” simple and easy</p><p>Also maybe something like:</p><p>“I am really confident with writing JavaScript not only because of the time invested on learning but also by the fact that JavaScript is a programming language that fascinates me and makes me want to dive even deeper every single time”</p><p>So invest time to learn how to be more confident, make your mind to think that you are a great problem solver and an expert in your field and you will sound like one.</p><blockquote>Fake it till you make it!</blockquote><h3>3) The “Do you want to ask as anything about our company?” Question</h3><p>So the interview comes to an end and most of the time they interviewer is saying something like :</p><p>“OK i think we are done, maybe we have 2 minutes for a quick question from you about out organization”.</p><p>A total disaster would be to ask something like:</p><p>“How much am I going to get paid?” considering the fact that an offer is not yet on the table.</p><p>A simple question would be to ask something about the future of the company like:</p><p>“What are the goals of your organization in the near future?”,</p><p>or even ask something like:</p><p>“How is it to work for a company that affects the lives of so many people?”.</p><p>It is also bad if you say something like “I don’t really have anything to ask, everything is clear to me”</p><p>This shows that you are not really interested in the organization.</p><p><em>Thanks for reading.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=198199f75b28" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[1 Tip to Secure and Simple Αuthentication]]></title>
            <link>https://medium.com/@minosagap/1-tip-to-secure-and-simple-%CE%B1uthentication-588a3afe713d?source=rss-4c9f21a264e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/588a3afe713d</guid>
            <category><![CDATA[authentication]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Marinos Agapiou]]></dc:creator>
            <pubDate>Fri, 28 Dec 2018 00:01:45 GMT</pubDate>
            <atom:updated>2018-12-28T00:01:45.284Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0xN-I8KUkXHf_PKs-UpdEA.jpeg" /></figure><p>You, are creating apps that rock!!</p><p>That’s for sure.</p><p>But one day somehow you observe something weird, like someone is trying to brute-force your login page and gain admin access.</p><p>Or maybe your Server logs indicate that someone is playing around with SQL injection to your sign-up page.</p><p>Or maybe you heard somewhere on Medium that there was a data breach with many usernames and passwords leaked.</p><p>Guess what ,most of your users are going to have the same username and password across the whole web.</p><p>So what are you going to do?</p><p>Probably you are already googling trying to find ways to make your authentication more secure.</p><p>I believe that this, happened to every Developer that was in the process of creating and shipping an app with login/sign-up functionality.</p><p>So here is my advice to make your authentication process more secure:</p><h3>Third Party Αuthentication</h3><p>Third Party Authentication is when you use the user base of another service, like Google, Facebook etc, to authenticate your users.</p><p>Trust me these tech giants are investing every year millions of dollars to keep their systems secure, up and running smoothly.</p><p>So probably their systems are more secure than your 6-month mobile app.</p><p>This way from a Developers perspective you don’t have to worry about anything like :</p><ol><li>how to store your passwords</li><li>how prevent brute force attacks</li><li>what kind of hash to use</li><li>what kind of messages to show when a username is already taken</li><li>how to recover a forgotten password and the list goes on and on and on.</li></ol><p>Also for Third Party you can use an Email with a link or even the users phone number, sending an SMS with a secret code.</p><p>Creating your own login/sign-up is really time consuming and dangerous.</p><p>Currently there are a dozen tutorials on how to use Third Party Authentication that you can find.</p><p>From a user’s perspective this approach is so simple and fast.</p><p>Imagine the face of a user when he has to sign-up to every service he wants to use.</p><p>This means to choose a password, to save the password somewhere in order not to lose it(or just use the same password everywhere :P ), to choose a username that is not already taken and then your user is bored to death and already discouraged to sign-up.</p><p><em>Thanks for reading.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=588a3afe713d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding the CSRF Vulnerability]]></title>
            <link>https://medium.com/@minosagap/understanding-the-csrf-vulnerability-be26a660382b?source=rss-4c9f21a264e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/be26a660382b</guid>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Marinos Agapiou]]></dc:creator>
            <pubDate>Tue, 25 Dec 2018 17:27:15 GMT</pubDate>
            <atom:updated>2018-12-25T18:04:17.303Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YNNi0BjugGN3ouENt2g-Dw.jpeg" /></figure><p>You are a developer that makes great apps, easy to use, with real value for your users… Good keep it up.</p><blockquote>But how secure are your apps ?</blockquote><blockquote>Are you someone that is trying to keep your web apps secure ?</blockquote><blockquote>Are you someone that believes in providing a better security for your users ?</blockquote><p>Then you must learn what a Cross Site Request Forgery(CSRF) is.</p><p>This is one of the <a href="https://www.owasp.org/index.php/Main_Page">OWASP</a> top 10 silent attacks.</p><p>This attack happens when the browser executes a Request in other webpages using your credentials (Session-ID / Cookies ) without you knowing it.</p><p>A good example to understand this better is when you submit a form in a website that should for example perform something legitimate in a system but what it really does is to change your password in another website.</p><p>Here is an example of such a form :</p><pre>&lt;h1&gt;Click the Link bellow&lt;/h1&gt;</pre><pre>&lt;form name=&quot;Vulnform&quot; method=&quot;post&quot; action=&quot;https://mysecretbank1234.com/change_password/&quot;&gt;<br>      &lt;input type=&quot;hidden&quot; name=&quot;newpassword&quot; value=&quot;attackers_pass&quot; /&gt;</pre><pre>      &lt;input type=&quot;hidden&quot; name=&quot;newpassword-confirm&quot; value=&quot;attackers_pass&quot; /&gt;</pre><pre>       &lt;input type=&quot;submit&quot; value=&quot;Click Here!!!&quot;&gt;</pre><pre>&lt;/form&gt;</pre><p>The above HTML form has hidden prefilled input for updating your password with the attackers chosen password for the website “<a href="https://mysecretbank1234.com/">https://mysecretbank1234.com</a>” .</p><p>Hope you don’t check from now on every HTML form you submit :P</p><p>Also if you think same origin policy prevents this, trust me it is not!</p><p>Same origin policy, to keep this simple, prevents scripts from one origin “websiteA.com” to access private data from another origin “websiteB.com”.</p><p>When the form is submitted, it will perform an Authenticated HTTP POST Request ( this means that Request will include the users Session-ID/Cookies ) so the website “<a href="https://mysecretbank1234.com/">https://mysecretbank1234.com</a>” will think that the real user is just changing his password.</p><p>And after that lets just pray that “<a href="https://mysecretbank1234.com/">https://mysecretbank1234.com</a>” is secure against CSRF attacks :P</p><p>To try this and see it yourself, just use a simple form like the one bellow and add it to another page (I hope you know how to use Mozilla/Chrome developer tools ).</p><p>The bellow form is just a simple form that performs a POST Request to wikipedia.org</p><pre>&lt;form action=<a href="https://www.w3schools.com/">&quot;https://www.wikipedia.org/</a>&quot; method=&quot;POST&quot; &gt;</pre><pre>First name:&lt;br&gt;</pre><pre>&lt;input type=&quot;text&quot; name=&quot;firstname&quot; value=”Mickey”&gt;</pre><pre>&lt;br&gt;</pre><pre>Last name:&lt;br&gt;</pre><pre>&lt;input type=”text” name=”lastname” value=”Mouse”&gt;</pre><pre>&lt;br&gt;&lt;br&gt;</pre><pre>&lt;input type=”submit” value=”Submit”&gt;</pre><pre>&lt;/form&gt;</pre><p>Next embed this form to a webpage of different origin :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-JLIAgttrwcKhkPb6yhamg.png" /></figure><p>Next hit the Submit button and open the Request:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*twvAIkYnXIzlgnTCI8HYrA.png" /></figure><p>You see the Cookies are sent along the Request !!!</p><p><em>Thanks for reading.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=be26a660382b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Gain root access using $PATH Variable !]]></title>
            <link>https://medium.com/@minosagap/gain-root-access-using-path-variable-3607fbf19315?source=rss-4c9f21a264e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/3607fbf19315</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[information-security]]></category>
            <dc:creator><![CDATA[Marinos Agapiou]]></dc:creator>
            <pubDate>Fri, 21 Dec 2018 16:17:25 GMT</pubDate>
            <atom:updated>2018-12-21T16:17:25.656Z</atom:updated>
            <content:encoded><![CDATA[<h3>Gain root access using $PATH Variable !</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zsLH39mennEfQeDhE1JAWQ.jpeg" /></figure><p>This is an attack that I came across in a small security assessment and it is <strong><em>BEEEAUUUTIFUL</em></strong>.</p><p>So let’s begin by saying what is the $PATH variable.</p><p>The $PATH variable is an environmental variable that Linux and Unix use to determine where are all the executable programs (for example where is the executable for the command “cd”). Most of the time this directory is “<em>/bin</em>” or “<em>/sbin</em>”.</p><p>So I was given a small executable file named “<em>foo” </em>that was running something like ‘<em>system(“ls -la /tmp”)</em>’ ( system(char*) is a C library function for running Linux commands).</p><p>Also this executable file has SUID root, which means that whenever is executed, has root privileges ( Now is getting more interesting :P ).</p><p>So what the executable “<em>foo” </em>is doing, is printing everything inside the<em> “/tmp” </em>directory. Really simple, nothing to worry about. Wright ???</p><p>Well not exactly.</p><p>So “<em>foo” </em>finds the executable file for the “<em>ls</em>” command from $PATH variable and executes it.</p><p>The question is, can we execute something instead of “<em>ls</em>” ?</p><p>Yes we do, if we create another executable with the name “<em>ls</em>” in “<em>~/Downloads/</em>” ( or wherever you want ) like so:</p><p>$ echo “/bin/bash” &gt; ~/Downloads/ls</p><p>$ chmod 755 ~/Downloads/ls</p><p>This new executable file “<em>~/Downloads/ls</em>” opens a shell.</p><p>Next we change a little bit the $PATH variable :</p><p>$ export PATH = ~/Downloads : $PATH</p><p>Now the $PATH variable points first to the Directory “<em>~/Downloads</em>” that contains our malicious “<em>ls</em>” , and boy we are ready to EXPLOIT this :P</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/755/1*k45RLVcqESpRGbCj4A-9GA.png" /></figure><p>Gained root access!!!</p><p><em>Thanks for reading.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3607fbf19315" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Save time as a Software Engineer]]></title>
            <link>https://medium.com/@minosagap/save-time-as-a-software-engineer-a42efae85c7e?source=rss-4c9f21a264e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/a42efae85c7e</guid>
            <category><![CDATA[time]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[productivity]]></category>
            <dc:creator><![CDATA[Marinos Agapiou]]></dc:creator>
            <pubDate>Tue, 18 Dec 2018 21:12:50 GMT</pubDate>
            <atom:updated>2018-12-18T22:05:12.928Z</atom:updated>
            <content:encoded><![CDATA[<h3>Save More Time as a Software Engineer</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U5exCz3cRM-blywECqLzXw.jpeg" /></figure><p>The first couple of years at my university I realized that my coding time was not as productive as it could and I was not really focused.</p><p>So here are some tricks I applied on a daily basis that made my coding time more efficient.</p><h3><strong>1) </strong>Get back on track faster when someone disrupts you</h3><p>If someone disrupts your focus the moment you were in the middle of writing code to solve something, ask him/her to give you a minute to write in a comment (or anywhere you prefer to keep notes) your thoughts about how you would continue with the specific task.</p><p>You never know how long someone is going to need your attention.</p><p>If you apply this method and write your thoughts somewhere before you respond to your colleague, you will see that afterwards you need less time to regain your initial focus.</p><h3><strong>2) Apply deadlines to your daily tasks</strong></h3><p>Maybe you are working for a project of yours or maybe of a university class, if you are applying small daily deadlines you will see that you become more disciplined and consistent in getting more stuff done.</p><p>So try to divide a project to daily tasks and try to finish them on time (this one helped me a lot with a lot of university assignments).</p><h3><strong>3) </strong>Stop multitasking</h3><p>Maybe you think you can multitask but trust me, you are not, you are just going back and forth from Slack to your code and back to Slack.</p><p>When you are writing code you want to be as focused as you can possibly be. Close all the apps that will take your mind off, like Messenger, Email etc, because you can’t code efficiently, respond to an email or chat with a friend at the same time.</p><p>Another thing that worked for me is switching the notifications off on my phone and specifying a time period to check every notification-message-email that I receive.</p><p><em>Thanks for reading.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a42efae85c7e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[3 tips to Boost your productivity as a Junior Software Developer]]></title>
            <link>https://medium.com/@minosagap/3-tips-to-boost-your-productivity-as-a-junior-software-developer-5eee059f631b?source=rss-4c9f21a264e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/5eee059f631b</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[junior-developer]]></category>
            <dc:creator><![CDATA[Marinos Agapiou]]></dc:creator>
            <pubDate>Tue, 11 Dec 2018 13:14:35 GMT</pubDate>
            <atom:updated>2018-12-11T22:42:59.036Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-za8S8j0FQi1qTsRI8MvXA.jpeg" /></figure><p>Did you just finish with the University or College Degree and started to work as a Junior Software Developer?</p><p>If that sounds like you Enjoy the following and if that doesn’t sound like you, Enjoy the following also :P</p><p>Congrats my friend Good for you!!</p><p>A year I go I also started my first job as a Junior Software Developer. I was really excited that I was going to be part of something bigger but apart from that excitement I wasn’t for some reason feeling really good for the first couple of months.</p><p>I was feeling that I had to prove I can get stuff done myself from the very first day. The problem was that first I had to get used to the code that was already written from my team (we are talking about thousands lines of code here).</p><p>So here are the mistakes I did that kept my productivity down, and the things I would change.</p><h3>1. Don’t feel bad if you don’t know all</h3><p>Lets face it here you don’t even know the 30% of your tech stack and maybe you are not even familiar with all the programming languages used for the product.</p><p>Trust me on this one. It is absolutely normal to feel that way.</p><p>Ask for Help from others that are working on this code months and years now. Don’t be shy and Ask. Keep notes about specific code segments that are most important and try to dive deep.</p><p>Don’t struggle in front of a bug for more than one hour, Ask for help, maybe the person next to you already knows the answer.</p><h3>2. Allocate more time in understanding the code that is already implemented</h3><p>You can’t just start writing code for a product that other people are working for months or years.</p><p>Imagine that you write a new Class to extend a functionality (200 lines of code let’s say ) and afterwards someone says that you could use a function the team created 7 months ago that is doing almost the same thing.</p><p>So give yourself more time reading the code that your team has implemented and ask whenever you don’t get something. Ask Ask Ask ;P.</p><p>I mean it, because software developers like you and me most of the time prefer to struggle and find something on their own in two hours rather than try hard for one hour, ask for help and save time.</p><h3>3. Socialize more</h3><p>Make friends, the sooner you get comfortable to the new environment the better. Stop talking with your colleagues only for Tech stuff.</p><p>The office environment can be a lot more fun and enjoyable after you realize that the people in your team are your friends and not just colleagues.</p><p>When you are among friends you are happier, more comfortable and guess what?? → more productive.</p><p><em>Thanks for reading.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5eee059f631b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>