<?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 codeshare.co.uk on Medium]]></title>
        <description><![CDATA[Stories by codeshare.co.uk on Medium]]></description>
        <link>https://medium.com/@PRJSeal?source=rss-58812ed49366------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Btkz5btD0NLMGnrQ.jpg</url>
            <title>Stories by codeshare.co.uk on Medium</title>
            <link>https://medium.com/@PRJSeal?source=rss-58812ed49366------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 15:13:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@PRJSeal/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[The day I hacked Troy Hunt’s website to delete my data]]></title>
            <link>https://medium.com/@PRJSeal/the-day-i-hacked-troy-hunts-website-to-delete-my-data-e1c11e38b16c?source=rss-58812ed49366------2</link>
            <guid isPermaLink="false">https://medium.com/p/e1c11e38b16c</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[owasp]]></category>
            <category><![CDATA[sql-injection]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[codeshare.co.uk]]></dc:creator>
            <pubDate>Thu, 03 Aug 2017 09:21:01 GMT</pubDate>
            <atom:updated>2017-08-03T09:21:01.524Z</atom:updated>
            <content:encoded><![CDATA[<p>I was listening to one of my favourite podcasts that morning, <a href="http://msdevshow.com/">MS DEV Show</a>. They interviewed Troy Hunt about internet security. Everything from password security to data breaches and even how IOT is now in adult toys. One thing that did pique my interest was the site which Troy has built to allow you to hack it. It’s called <a href="http://hackyourselffirst.troyhunt.com/">hackyourselffirst.troyhunt.com</a> It’s got about 50 vulnerabilities and bad practices on it. He challenged us to try to spot the vulnerabilities and see if we could hack it ourselves.</p><h3>Challenge accepted</h3><p>I’ve not done much hacking myself, but I recognise that as a web developer I should know about the hacking vulnerabilities my sites could face. Therefore I need to be able to defend against them. Troy has a <a href="http://www.shareasale.com/r.cfm?u=1239084&amp;b=611266&amp;m=53701&amp;afftrack=&amp;urllink=www.pluralsight.com/courses/hack-yourself-first">pluralsight course</a> which guides you through all of the vulnerabilities in if you want to find out all of them.</p><h3>Let’s do some mob programming</h3><p>I showed it to my colleagues and we had a team meeting to see what we could spot. We saw basic errors like storing passwords and emails as cookies, and changing url values to see other user details etc. I won’t mention too many of them because I think it is valuable to go through it yourself. We were looking at it for a while and most of the vulnerabilities were pretty basic and we didn’t think it reflected real life, but we have to remember that these are examples of the errors people really do make. We were at least pleased that our sites didn’t have any of these vulnerabilities.</p><h3>Here’s where I went wrong</h3><p>I was testing out the registration form so I put my name and work email address in and there wasn’t a way to edit it in the user profile screen. I was able to hack the site to give myself admin permissions. I could see a full list of all users and their passwords, including mine. Which meant that other hackers could see my work email address too. I was worried it might make me a target to hackers. So it was in our interest to learn SQL Injection in order to remove the email address I had entered.</p><h3>We needed to do some proper hacking</h3><p>The only way we could think of removing my email address was by using SQL Injection. <a href="https://www.owasp.org/index.php/SQL_Injection">SQL Injection</a> has been the top vulnerability in websites for a long time. Surely Troy must have left this site open to SQL Injection, otherwise what is the point to this site if it can’t demonstrate the biggest problem. We weren’t getting very far. We started by changing a URL to make it return all the results instead of just by the value in the query string. We tried several different variations and finally managed to get it to work, which meant we were in.</p><h3>Now we can use SQL Injection, we needed to clear my data</h3><p>To be able to update my email address, we first needed to know what the table was called. With a bit of SQL knowledge and googling we managed to get it to list out all of the table names in the database. <strong>This felt amazing. We were becoming l33t hackers.</strong> Next we needed to work out which table my email address was stored in. We tried a few of the membership tables but didn’t get any luck with the username or email colmumn. Then we realised it must be stored in the user profile table. We wrote a query to tell us what the column names were in the user profile table and sure enough it had an email column. Bingo. We wrote a query to update my email address to something different. It was such a good feeleing when we queried the table to see the email addresses and mine was no longer there, but my new one was.</p><h3>Okay what next?</h3><p>Did we leave it at that? Of course not. When do you ever get the chance to break someone else’s real website without them getting mad at you? After all that was his challenge. We tried to truncate and drop some tables and it didn’t let us. So we changed to just deleting records. We managed to delete all records from the main table in the site. It worked. After that the data had gone. The site didn’t work properly anymore and we felt so proud of ourselves.</p><h3>Conclusion</h3><p>This was a great team exercise to do as a group of developers. We all chipped in with ideas and we all learned a lot. You should definitely take a look at the site to see what vulnerabilities you can spot. I’ve purposely not given you the details on how we did what we did because it was a learning exercise and I think you won’t learn if I just give you the answers. If you are struggling to spot the vulnerabilities or you want to find out how to do SQL Injection, you might want to do the <a href="http://www.shareasale.com/r.cfm?u=1239084&amp;b=611266&amp;m=53701&amp;afftrack=&amp;urllink=www.pluralsight.com/courses/hack-yourself-first">Pluralsight course</a>, you can get a free 10 day trial.</p><p><em>Originally published at </em><a href="http://www.codeshare.co.uk/blog/the-day-i-hacked-troy-hunts-website-to-delete-my-data/"><em>www.codeshare.co.uk</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e1c11e38b16c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is .NET Core? 7 Things you should know.]]></title>
            <link>https://medium.com/@PRJSeal/what-is-net-core-7-things-you-should-know-296659b51294?source=rss-58812ed49366------2</link>
            <guid isPermaLink="false">https://medium.com/p/296659b51294</guid>
            <category><![CDATA[dotnet-core]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[csharp]]></category>
            <category><![CDATA[microsoft]]></category>
            <category><![CDATA[dotnet]]></category>
            <dc:creator><![CDATA[codeshare.co.uk]]></dc:creator>
            <pubDate>Mon, 23 Jan 2017 13:11:20 GMT</pubDate>
            <atom:updated>2017-01-23T13:11:20.612Z</atom:updated>
            <content:encoded><![CDATA[<p>This post explains to you what .NET Core is, what it is used for and tells you whether you need to use it or not.</p><h3>1. What is .NET Core?</h3><p>.NET Core is a new platform from Microsoft made up of a new runtime and a set of libraries. The main reason for it existing is to make .NET run <strong>cross-platform </strong>which means it will run on Windows, Linux and macOS.</p><h3>2. What language do you write .NET Core applications in?</h3><p>.NET Core applications are written in C#, F# and VB. This means you can write C# code on Linux and Mac now, this is why applications like Visual Studio Code and Visual Studio for Mac have been made.</p><h3>3. What type of applications would you use .NET Core for?</h3><p>You can write Console applications, Web APIs, and ASP.NET websites right now with .NET Core. It’s not fully written yet, so the tooling is limited at the moment.</p><h3>4. Do I need to learn .NET Core?</h3><p>You only need to learn .NET Core if you want to write .NET applications which need to run cross-platform. If you are just building applications which are going to be hosted on Azure or on a Windows server somewhere you can continue to write them in the full .NET Framework.</p><h3>5. Will it replace the full .NET Framework?</h3><p>No it’s not going to replace the full .NET framework. The full framework continues to exist and be improved alongside .NET Core.</p><h3>6. Is it compatible with the full .NET Framework?</h3><p>Yes, .NET Core is compatible with certain versions of the full framework as well as Xamarin’s Mono framework. It can be confusing to understand which version of one is compatible with the other versions. To help with this they have created the <strong>.NET Standard</strong>.</p><h3>7. What is .NET Standard?</h3><p>.NET Standard was created to help you know what version of the .NET framework you need to target if you want your code to be compatible with other different types of .NET framework. Currently there are 3 types. Full .NET Framework, Mono (used for Xamarin) and .NET Core. It is hard to know which version of which framework is compatible with others.</p><p>.NET Standard isn’t anything physical and it’s not even code itself, its just a set of features which a version of a .NET Framework needs to have to be compatible with others targeting it. This means even if you are try to talk to code from a different version of the .NET Framework it will have the necessary features to be compatible if it targets the same version of .NET Standard.</p><p>To help you understand this, try to think of it like this:</p><p>TVs, Videos, Satellite and freeview player/recorders all communicate with each other via cables. Over the years there have been many different cables to the TV, such as RF, Scart, Component and HDMI.</p><p>Think of each of these different <strong>cables</strong> as a version of the <strong>.NET Standard</strong>, so the latest version of .NET standard is represented by HDMI.</p><p>Think of the <strong>devices</strong> that connect together as different versions of the different <strong>.NET frameworks</strong>.</p><p>It is possible to get the different devices (frameworks) to talk to each other because they’ve been made to work with the necessary cable (Standard) HDMI, or Scart etc.</p><h3>How can I learn more about .NET Core?</h3><p>You can find out more about .NET Core by reading Jamie Taylor’s blog <a href="https://dotnetcore.gaprogman.com/">A Journey in .NET Core</a></p><p><em>Originally published at </em><a href="http://www.codeshare.co.uk/blog/what-is-net-core-7-things-you-should-know/"><em>www.codeshare.co.uk</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=296659b51294" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[10 golden rules for becoming a better programmer]]></title>
            <link>https://medium.com/@PRJSeal/10-golden-rules-for-becoming-a-better-programmer-a92112a1eaa4?source=rss-58812ed49366------2</link>
            <guid isPermaLink="false">https://medium.com/p/a92112a1eaa4</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[advice]]></category>
            <category><![CDATA[best-practices]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[codeshare.co.uk]]></dc:creator>
            <pubDate>Fri, 06 Jan 2017 13:04:53 GMT</pubDate>
            <atom:updated>2017-01-06T13:04:53.411Z</atom:updated>
            <content:encoded><![CDATA[<p>Here are my top 10 rules to follow which will enable you to become a better programmer</p><h4>1. Don’t repeat yourself</h4><p>This is a great principle to follow. I really enjoy going back through my code after I have written it and refactoring parts that are used more than once. I get a buzz from reducing a long method down to several short methods. Ctrl+R+M works great in Visual Studio to help you refactor code into separate methods. This makes the code more reusable and testable.</p><h4>2. Name your variables to say what they are for, not what data type they are</h4><p>The only exception to this is if you are picking up someone else’s code and are continuing with that, you should carry on with their naming convention.</p><h4>3. Give your methods a clear name for what they are going to do.</h4><p>If you do this well, it reduces the need for comments. You shouldn’t need comments if your code is clear enough to read.</p><h4>4. Don’t use magic numbers or string literals</h4><p>There shouldn’t be any numbers or string values in your code that when someone comes to read later wonders what they are. Create constants, enums or private variables to give them a name so it is easier to understand.</p><h4>5. Write your methods so they can be tested without having any dependencies on other parts of the application, where possible.</h4><p>Write it in a way that it doesn’t matter where it was called from. It makes the code far more testable and reusable.<br>If you are using session values or app setting values, pass them in as variables instead and get the session and config values at the point you call the method. This makes it far more testable.</p><h4>6. Don’t be afraid to ask for help</h4><p>I’m not saying you should ask for help with everything and not learn for yourself, I mean have a good go yourself, but if you are stuck ask someone for help. They may have already had this problem and know how to solve it. Also the process of telling someone about what you are doing, what you are expecting and what the problem is, can bring you to solving it yourself.</p><h4>7. Follow the boy scout rule</h4><p>If you see some buggy or messy code, fix it while you are there and move on. Don’t leave it for someone else to do, but don’t rewrite the whole program either.</p><h4>8. Share knowledge with others</h4><p>Don’t be selfish by keeping your knowledge to yourself. Try to create a culture of helping others. You’ll find that you will work better as a team and you can help each other to improve. You’re not giving away knowledge and putting your job in danger if your colleagues improve. You are making yourself more valuable as you are someone who not only has the knowledge, but can also help other around them improve.</p><h4>9. Don’t interrupt your colleagues whilst they are in the flow</h4><p>Think about it, when you are programming you have all of these pieces that you are putting together in your mind, like a house of cards you are carefully trying to build. If someone interrupts you to ask a question, then you lose concentration and that house of cards could easily fall down. It may take them 5 or 10 minutes to get that concentration and pieces back together in their mind, when you could have googled it or asked someone else. If you give your colleagues this respect and let them know, they will do the same for you, which in turn will make you more productive.</p><h4>10. Use criticism as a positive instead of a negative.</h4><p>To me, criticism is a chance for me to improve. If there is another way of doing something that I haven’t thought of then I want to know about it as it will help me to improve.</p><p><em>Originally published at </em><a href="http://www.codeshare.co.uk/blog/10-golden-rules-for-becoming-a-better-programmer/"><em>www.codeshare.co.uk</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a92112a1eaa4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>