<?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 Kaviru Samarasekera on Medium]]></title>
        <description><![CDATA[Stories by Kaviru Samarasekera on Medium]]></description>
        <link>https://medium.com/@kaviru.mihisara?source=rss-721bc943ca5a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*dOqWLD0spBsz6XoDiCmHaw.jpeg</url>
            <title>Stories by Kaviru Samarasekera on Medium</title>
            <link>https://medium.com/@kaviru.mihisara?source=rss-721bc943ca5a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 03:51:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kaviru.mihisara/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[How to Prevent Online Payments Fraud]]></title>
            <link>https://medium.com/swlh/how-to-prevent-online-payments-fraud-67aef326050d?source=rss-721bc943ca5a------2</link>
            <guid isPermaLink="false">https://medium.com/p/67aef326050d</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[online-fraud]]></category>
            <category><![CDATA[pci-dss]]></category>
            <category><![CDATA[information-technology]]></category>
            <dc:creator><![CDATA[Kaviru Samarasekera]]></dc:creator>
            <pubDate>Sat, 02 Sep 2023 16:00:10 GMT</pubDate>
            <atom:updated>2023-09-02T16:00:10.887Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is online payment fraud?</h3><p>Online payment fraud is any type of false or illegal transaction completed by a cybercriminal Via the Internet, the attacker deprives the victim of funds, personal property, desires, or classified details.</p><h4>Payment fraud is characterized in three ways:</h4><ul><li>Transactions that are illegal or unauthorized.</li><li>Missing merchandise or robbed.</li><li>Fake claims for refunds, returns, or bounced checks.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KEdMj8_ZhzQBYQ8tvEF6Jg.jpeg" /></figure><h4><strong>What Types of Online Fraud Are There?</strong></h4><ul><li><strong>Card Not Present (CNP) Fraud</strong>:</li></ul><p>This occurs when a criminal uses stolen or fake payment information to make a purchase online or over the phone.</p><ul><li><strong>Phishing</strong>:</li></ul><p>Phishing involves deceptive techniques employed by scammers to make fake websites, emails, or messages, resembling genuine sources. Their objective is to deceive users into sensitive personal details like login credentials, credit card information, or National Identity card numbers. These attacks often rely on urgency or fear, compelling users to respond hastily without confirming the legitimacy of the solicitation.</p><ul><li><strong>Identity theft:</strong></li></ul><p>Identity theft refers to the act of illicitly acquiring an individual’s personal information, such as name, address, National identity number, or financial particulars, with the intention of perpetrating fraud. This pilfered data is subsequently utilized to initiate deceitful accounts, apply for unauthorized loans, make illicit purchases, or engage in other unlawful activities.</p><ul><li><strong>Pagejacking:</strong></li></ul><p>In the online world, hackers have the ability to reroute traffic from your e-commerce site by hijacking a portion of it and leading visitors to an entirely different website. This malicious site may harbor harmful content that hackers can exploit to breach your network security system. As e-commerce business owners, it is crucial to stay vigilant and promptly address any suspicious online activity to safeguard your operations.</p><ul><li><strong>Online shopping frauds:</strong></li></ul><p>Online shopping fraud takes place when individuals with malicious intent establish bogus online stores or employ deceitful payment methods to defraud shoppers. Consequently, victims may make payments for products or services that are never delivered, receive fake items, or have their credit card details compromised during the transaction process.</p><ul><li><strong>Lottery fraud:</strong></li></ul><p>Scammers may inform victims that they have won a lottery or prize, asking for payment or personal information to claim the prize. In reality, there is no prize, and scammers aim to steal money or sensitive data.</p><ul><li><strong>Investment and Financial Scam</strong>s:</li></ul><p>These scams attract victims into fraudulent investment schemes promising high returns, pyramid schemes, or get-rich-quick schemes. Additionally, financial scams may involve offering fake loans or requiring upfront fees to access non-existent funds.</p><ul><li><strong>Tech Support Scams:</strong></li></ul><p>In tech support scams, fraudsters impersonate tech support representatives and contact users claiming there is an issue with their computer or software. They may try to gain remote access to the victim’s computer or ask for payment to fix non-existent problems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vxb_gWj1Pbdjgekx8oE7Yg.jpeg" /></figure><h3>Preventing Payment Fraud.</h3><ul><li><strong>Strong Passwords:</strong></li></ul><p>It is important to encourage individuals to come up with distinctive passwords, for their accounts. By doing we can minimize the chances of individuals gaining access, to their payment details.</p><ul><li><strong>Multi-Factor Authentication (MFA):</strong></li></ul><p>Whenever feasible it is recommended to utilize Multi-Factor Authentication (MFA). This additional security measure enhances protection by necessitating users to provide verification like a code sent to their mobile device, email, or authenticator apps.</p><ul><li><strong>Secure Payment Gateways:</strong></li></ul><p>Make sure that the website or platform you’re using has secure payment gateways, in place. These payment gateways encrypt information to ensure it remains protected during transmission.</p><ul><li><strong>PCI Compliance:</strong></li></ul><p>If you deal with credit card details it is important to follow the Payment Card Industry Data Security Standard (PCI DSS), in order to ensure an environment, for the information of cardholders.</p><ul><li><strong>Monitoring and Fraud Detection:</strong></li></ul><p>Use fraud detection tools and systems to keep an eye on transactions, for any activities or patterns. Set up alerts in time to catch instances of fraud.</p><ul><li><strong>Educate Customers:</strong></li></ul><p>Make sure to educate your customers about the schemes that can occur online such as phishing emails or deceptive websites. It’s essential to provide them with tips, on how they can identify and steer clear of these scams.</p><ul><li><strong>Account Verification</strong></li></ul><p>Make sure to verify user accounts before granting access, to payment features. This can include verifying their email confirming their phone number or validating their identity.</p><ul><li><strong>Implement IP Geolocation:</strong></li></ul><p>Analyze the geographic location of customers’ IP addresses to detect and prevent fraudulent transactions from high-risk regions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=67aef326050d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/how-to-prevent-online-payments-fraud-67aef326050d">How to Prevent Online Payments Fraud</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Credential Harvester Attack]]></title>
            <link>https://medium.com/@kaviru.mihisara/credential-harvester-attack-73335c4a5bb8?source=rss-721bc943ca5a------2</link>
            <guid isPermaLink="false">https://medium.com/p/73335c4a5bb8</guid>
            <category><![CDATA[social-engineering]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Kaviru Samarasekera]]></dc:creator>
            <pubDate>Thu, 26 Mar 2020 05:17:47 GMT</pubDate>
            <atom:updated>2020-03-26T05:55:09.485Z</atom:updated>
            <content:encoded><![CDATA[<h3>Social Engineering Toolkit</h3><p>Social engineering toolkit has played and is playing an important role in the field of information security and ethical hacking, social engineering means to take advantages of human weakness to hack a computer system or a server.</p><p>The credential harvester attack method is used when you don’t want to specifically get a shell but perform phishing attacks in order to obtain usernames and passwords from the system. In this attack vector, a website will be cloned, and when the victim enters the user credentials, the usernames and passwords will be posted back to your machine and then the victim will be redirected back to the legitimate site.</p><p>In this post, we will see how we can use the Credential Harvester Attack Vector of Social Engineering Toolkit in order to obtain valid passwords.</p><h3>How it’s done</h3><p>we can type the following command in a terminal to open the social engineering toolkit</p><p><strong>setoolkit</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/623/1*4_9-UqL2RtQZHA7xHtRTRQ.png" /><figcaption>setoolkit command input</figcaption></figure><p>We can see the Social-Engineering Attacks in the top of the menu</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/970/1*eehV1NYTTbS-fTizHqx5XQ.png" /><figcaption>menu of social engineering tool kit</figcaption></figure><p>We want to select Social Engineering Attacks, so choose number 1.<br>And then you will be displayed the next options and choose number 2. <strong>Website Attack Vectors</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/516/1*2POBfl4mmvJzardEOh9PYg.png" /><figcaption>attack menu of social engineering tool kit</figcaption></figure><p>Next, we choose number 3. <strong>Credential Harvester Attack Method</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/548/1*bdMDMAcw35lrWCHmF55lcw.png" /><figcaption>select menu in attack vectors</figcaption></figure><p>Then we choose number 2. <strong>Site Cloner</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/534/1*1oillHnCTTm3XVYsVJMX1g.png" /><figcaption>select menu in credential harvester attack</figcaption></figure><p>Because, my Kali Linux PC and test PC were in the same Wi-Fi network, so just input the attacker (my PC) local IP address. if you are executing the attack on WAN then you must provide your external IP address</p><p>PS: To check your device IP address, type: <strong>ifconfig</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/559/1*4wLzBUzdgZJMEb2TfwtuUQ.png" /><figcaption>IP address input</figcaption></figure><p>Now Enter URL of site which you want to clone we are cloning <em>https://www.facebook.com/</em> this will take a little bit time……</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/919/1*86Q99T5wrMoDZQXYdqA_aw.png" /><figcaption>Facebook clone page create</figcaption></figure><p>So, we opened in our Windows 10 machine chrome browser and type our VM IP address. (Because the attacker host page from attacker’s PC)</p><p>Our clone site load like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WlW3NZbEEGm-FKFqafUntg.jpeg" /><figcaption>Facebook clone site</figcaption></figure><p>So, we put details in here</p><p>Now I will go back to Kali Linux and check if we have successfully harvested the login details.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/1*WkwPmiHUDyiud-iVyM40aA.png" /><figcaption>harvested the login details.</figcaption></figure><p>We have successfully stolen the Facebook credentials from the target machine.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=73335c4a5bb8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Synchronizer Token Pattern]]></title>
            <link>https://medium.com/@kaviru.mihisara/synchronizer-token-pattern-e6b23f53518e?source=rss-721bc943ca5a------2</link>
            <guid isPermaLink="false">https://medium.com/p/e6b23f53518e</guid>
            <category><![CDATA[secuity]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[csrf-token]]></category>
            <category><![CDATA[synchronizer-token]]></category>
            <category><![CDATA[csrf]]></category>
            <dc:creator><![CDATA[Kaviru Samarasekera]]></dc:creator>
            <pubDate>Fri, 11 Oct 2019 05:25:55 GMT</pubDate>
            <atom:updated>2019-10-11T05:25:55.081Z</atom:updated>
            <content:encoded><![CDATA[<p>I Discussed Cross-Site Request Forgery and about the Double Submit Cookie Pattern in the <a href="https://medium.com/@kaviru.mihisara/double-submit-cookie-pattern-820fc97e51f2">previous blog</a>. Refer to this blog, if you want more information about CSRF and Double Submit Cookie Pattern</p><p>in this blog, I am going to discuss the Synchronizer Token Pattern</p><h3>What is Synchronizer token pattern?</h3><p><strong>Synchronizer token pattern</strong> (STP) is a technique where a <strong>token</strong>, secret and unique value for each request, is embedded by the web application in all HTML forms and verified on the server side. SPT is using to preventing CSRF attacks from the attackers. Cross-Site Request Forgery (<strong>CSRF</strong>) is an attack that forces an end user to execute unwanted actions on a web application in which they’re currently authenticated. <strong>CSRF</strong> attacks specifically target state-changing requests, not theft of data since the attacker has no way to see the response to the forged request.</p><p><strong>Let’s understand Synchronizer token pattern with a flow diagram,</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/682/1*3ThqoNNg54oOMqu0RtHXNQ.jpeg" /></figure><ul><li>User sends GET request to a server</li><li>Server sets the cookie with session_id, and saving session data with the token</li><li>Server returns HTML with a form containing token in a hidden field.</li><li>User submits form, along with a hidden field.</li><li>Server compares token from the submitted form (hidden field) with the token saved in the session storage. If they match, it means that form is submitted by a user.</li></ul><h3>Implementation</h3><p>Let’s look a sample project,</p><p>This application is developed using PHP &amp; JS. ( Github link — <a href="https://github.com/kaviruSam/Synchronizer-Token-Pattern"><strong><em>click here</em></strong></a>)</p><p>First, you need to login to the application by entering username and password. For the demo, I have hardcoded the credentials (username: <strong>kaviru,</strong> password:<strong>Kaviru98</strong>)</p><p>Upon successful login, a user can submit something including Account Number,Name and amount.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/641/1*mvWubDPxB6-VKCMtnPqDJQ.jpeg" /><figcaption>login.php</figcaption></figure><p>There is a function generate token, it will be a create a random number (it can be anything unique) and it will be saved in the session variable call token. that will be save in the server side. that token will generate for only that person who logged in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/804/1*WNGntsKRchyfBMKH7BObZg.jpeg" /><figcaption>login.php(generateToken())</figcaption></figure><p>After validating the credentials and if the user is authenticated, the user will be redirected to <strong><em>syncronizer_csrf_token.php </em></strong>where you can add a transaction details to the application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H7r5maAfS7AQlvbpWbeMlA.jpeg" /><figcaption><em>syncronizer_csrf_token.php</em></figcaption></figure><p>To retrieve the CSRF token an AJAX call should be executed. The retrieved CSRF token will be stored in a hidden field in application from which is in <strong><em>syncronizer_csrf_token.php</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*gaVUu-1q-NUdL99MQlIVeg.jpeg" /><figcaption>AJAX call</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E0DFTjJybIH6NQbIHAcVrg.jpeg" /><figcaption>Hidden field to store the CSRF Token</figcaption></figure><p>The CSRF token will be validated by the function called <strong><em>validateToken () </em></strong>When a user adds account number, name and amount to the application, the request contains the generated CSRF token. Then the server validates session-id which is in the request header using the one that is stored in the server-side, and it compares the CSRF token in the body with the token in the request header.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/478/1*wSZoBBYD15MQ_8wp2u8tzQ.jpeg" /><figcaption>valid fuction</figcaption></figure><p>Finally, if the POST request had the valid CSRF token then the server will return a success message.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/665/1*szgXHVUlud440-kYfKy5MA.jpeg" /><figcaption>Transaction Successfully</figcaption></figure><p>Otherwise, it will show an error</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R_26cQjDQ_8TXK86BZ0jcg.jpeg" /><figcaption>When the CSRF tokens are not matching</figcaption></figure><p>Thank you. See you soon</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e6b23f53518e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Double Submit Cookie Pattern]]></title>
            <link>https://medium.com/swlh/double-submit-cookie-pattern-820fc97e51f2?source=rss-721bc943ca5a------2</link>
            <guid isPermaLink="false">https://medium.com/p/820fc97e51f2</guid>
            <category><![CDATA[csrf]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Kaviru Samarasekera]]></dc:creator>
            <pubDate>Thu, 10 Oct 2019 23:38:13 GMT</pubDate>
            <atom:updated>2019-10-12T01:20:56.816Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is the CSRF attack?</h3><p>Cross-Site Request Forgery (CSRF) is an attack that forces an end user to execute unwanted actions on a web application in which they’re currently authenticated. CSRF attacks specifically target state-changing requests, not theft of data since the attacker has no way to see the response to the forged request. With a little help of social engineering (such as sending a link via email or chat), an attacker may trick the users of a web application into executing actions of the attacker’s choosing. If the victim is a normal user, a successful CSRF attack can force the user to perform state-changing requests like transferring funds, changing their email address, and so forth. If the victim is an administrative account, CSRF can compromise the entire web application.</p><h3>What does it mean?</h3><p>This blog post will discuss Double Submit Cookie Pattern. Double submitting cookies is defined as sending a random value in both a cookie and as a request parameter, with the server verifying if the cookie value and request value are equal.</p><h3>How does it work?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/648/1*WP_VXYjJxUyqfrul8K-4uw.png" /></figure><p>When a user logs into the site, a session is created, and the session ID is set as a cookie in the browser. At the same time, another cookie is set for the CSRF token</p><p>Next, when the user submits a secure form, this token is extracted from the cookie and is set as a hidden input field in the HTML. This cookie cannot be set as Http Only as the client-side script requires to access this because in this scenario, the token endpoint does not exist, and the server has no record of the generated token for this session.</p><p>The server will validate the token sent as a form parameter against the cookie value and authorize the action to be completed. A cross origin attacker cannot read any data sent from the server or modify cookie values, per the same-origin policy.</p><p>I have developed this simple web application using PHP and JavaScript. You can find the source code<em> </em><a href="https://github.com/kaviruSam/Double-Submit-Token-Pattern"><em>here</em></a></p><p>First, you need to login to the application by entering the username and password. For the demo, I have hardcoded the credentials</p><p><strong>username:kaviru</strong></p><p><strong>password: Kaviru98</strong></p><h3>How to implement it?</h3><p>This login form submits user credentials using a POST method. if the user is authenticated successfully, the server-side will creates a unique Session-Id and the CSRF token but the server only stores the Session-Id. Importantly server doesn’t store CSRF token in this scenario.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/771/1*SyNa4X7a07L3UBaSHiJQ4Q.jpeg" /><figcaption>login.php</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/1*Ls5savtVMWwZvwp0mMXkhg.jpeg" /><figcaption>Login page (login.php)</figcaption></figure><p>illustrates the setting of the CSRF cookie to the browser whenever the user is logged in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*WKnj4ZbtstWzPJAXSHxggw.jpeg" /><figcaption>Generate CSRF Token</figcaption></figure><p>After setting CSRF token to a cookie, then when transaction page loads, stored CSRF token will assign to the hidden form field value using below JavaScript (AJAX call(self-call))</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/1*OTFzywgU6Z-6GwlSECakLQ.jpeg" /><figcaption>double_submit_csrf_token.php</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*EqZ9qliD6iAwRQHRZHLxaQ.jpeg" /><figcaption>AJAX call adding</figcaption></figure><p>illustrate the value after setting the token to the hidden form field.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/679/1*CPEYso-uYhIuyQbXtYrYyw.jpeg" /><figcaption>Hidden field to store the CSRF Token</figcaption></figure><p>When the form is submitted with the details back end will receive the request from the client. Then the server will validate the form details and validate CSRF cookie token with retrieved CSRF cookie token from the client</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/843/1*HArCfRLWdfUzclAylFC6Aw.jpeg" /></figure><p>Finally, if the cookie is validated success message will be displayed</p><p>I will be discussing the Synchronizer Token pattern CSRF prevention method in the next blog post <a href="https://medium.com/@kaviru.mihisara/synchronizer-token-pattern-e6b23f53518e"><em>here</em></a></p><p>thank you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=820fc97e51f2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/double-submit-cookie-pattern-820fc97e51f2">Double Submit Cookie Pattern</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>