<?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 Pritam Dash on Medium]]></title>
        <description><![CDATA[Stories by Pritam Dash on Medium]]></description>
        <link>https://medium.com/@pritamdash1997?source=rss-c3176b89b863------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*8VfatrFcUPGtFsA-MQSezw.jpeg</url>
            <title>Stories by Pritam Dash on Medium</title>
            <link>https://medium.com/@pritamdash1997?source=rss-c3176b89b863------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 02:02:30 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@pritamdash1997/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[What is Cross-Site Scripting (XSS) attack?]]></title>
            <link>https://medium.com/@pritamdash1997/what-is-cross-site-scripting-xss-attack-b6003455bc93?source=rss-c3176b89b863------2</link>
            <guid isPermaLink="false">https://medium.com/p/b6003455bc93</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[cross-site-scripting]]></category>
            <category><![CDATA[xss-attack]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[it-security]]></category>
            <dc:creator><![CDATA[Pritam Dash]]></dc:creator>
            <pubDate>Thu, 25 Jun 2020 14:21:19 GMT</pubDate>
            <atom:updated>2020-06-25T14:21:19.730Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uGYxtj0-6cx16JzeJ7af7Q.png" /><figcaption>Credit: <a href="https://techism101.com/what-is-cross-site-scripting-xss-attack/">Techism 101</a></figcaption></figure><p>Cross-site scripting attacks is commonly known as XSS, are a type of attack in which malicious scripts are injected into the websites or web applications and run on an end user’s browser. XSS attacks are a common and widespread type of attack, using unsanitized or unvalidated rogue user inputs, aimed at the generated output on execution.</p><p>At its most basic, an XSS attack involves an attacker entering malicious code into a web input form or a web app URL to trick the application into doing something which they are not supposed to do. Suppose we have a web application containing the search bar for searching the web and instead you enter with script tag:</p><pre>&lt;script&gt;alert;(&quot;I am vulnerable to XSS attack!&quot;)&lt;/script&gt;</pre><p>You click enter and see a alert pop-up message that says, “I am vulnerable to XSS attack!” Now you know that its vulnerable and the gates are wide open for you to get in.</p><h3>What are the consequences of cross-site scripting (XSS) attacks?</h3><p>Cross-site scripting attacks, regardless of its type, lead to the same set of consequences. The difference in the attack vector affects only the way of delivery methods.</p><p>Severe XSS attacks can result in the user’s session cookie being disclosed, which will allow an attacker to take over the user’s account and hijack their session. There can also lead to the disclosure of user’s files, installing of malware, unexpected site redirection, and content presentation modification. XSS attacks can also lead to compromise of sensitive data, and theft of confidential or trade secrets.</p><p>XSS attacks can allow attackers to modify the contents, allowing them to create falsified information that can impact or harm the target individuals; this is known as content spoofing.</p><h3>What Are the Types of Cross-Site Scripting Attacks?</h3><p>XSS exploits can take a number of forms, which makes them very difficult for website users to detect. Let’s take a look of different types of XSS attacks.</p><h3>Stored (persistent) XSS</h3><p>Stored or persistent XSS attacks occur when the malicious scripts are permanently stored on the compromised server(s); this can occur in a database, on a message board, in comment fields, or on other user text input pages. Victims receive a malicious script when the information is requested from the server. This is one of the most dangerous as well as most commonly employed type of cross-site scripting.</p><h3>Reflected XSS</h3><p>A reflected attack occurs when the malicious script is not stored on the server but is included in the data sent to the server from a website’s search or contact form. Errors messages and search results are two commonly used medium.</p><p>These attacks are often delivered to the target via an email or on another site, often by tricking the target into choosing a link containing the malicious script or through user submitting the malicious form. The malicious code then reflects to the user’s browser. This reflection causes the browser to believe that the script is trustworthy and prompts the browser to execute the script.</p><h3>DOM based attacks</h3><p>There is a third type of attack, known as a DOM-based attack, which is not common but can occur. The document object model, or DOM, is the application programming interface (API) used for valid HTML and XML documents. A DOM-based attack occurs when the DOM environment is modified in the target’s <strong>web browser</strong>. This modification causes the client-side code to run in unexpected ways. In simple, DOM-based cross-site scripting attacks occur when the server itself isn’t the one vulnerable to XSS, but rather the JavaScript on the page is.</p><p>To learn more about XSS attacks and its types, Visit <a href="https://techism101.com/what-is-cross-site-scripting-xss-attack/"><strong>TECHISM 101</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b6003455bc93" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build A Python App That Tracks Online Prices And Sends Email Notifications.]]></title>
            <link>https://medium.com/analytics-vidhya/build-a-python-app-that-tracks-online-prices-and-sends-email-notifications-d7dd5a840f0b?source=rss-c3176b89b863------2</link>
            <guid isPermaLink="false">https://medium.com/p/d7dd5a840f0b</guid>
            <category><![CDATA[beautifulsoup]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[email]]></category>
            <category><![CDATA[application]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Pritam Dash]]></dc:creator>
            <pubDate>Thu, 26 Mar 2020 17:49:15 GMT</pubDate>
            <atom:updated>2020-06-04T13:54:17.942Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UmJoZfBXqKYxvCY5KqgscQ.jpeg" /><figcaption>Courtesy: <a href="http://rawpixel.com/">RawPixel</a></figcaption></figure><p>Well, It was around mid of 2018 and i was going crazy to buy a new smartphone and it was too costly (Not gonna mention the brand !). So i came up with an idea to build a small python app that tracks the prices and if that price falls down it gonna send me an email notification.</p><p>In this blog, I am going to take you through a step by step guided tutorial on <strong><em>Build A Python App That Tracks Online Prices And Sends Email Notifications</em></strong>. Let’s code together. It gonna be fun !</p><p>But if you already know the whole thing and just want to take a look at the code. <a href="https://github.com/iampritam97/Price-Tracker/blob/master/Price_Tracker.py">Here you go</a>.</p><p>First we are going to install two necessary libraries namely requests and bs4. In short the requests library is going to help us in accessing the web and bs4 is going to help pull the data from the website. So fire up your terminal and type the below command.</p><pre>pip install requests bs4</pre><p>Now let’s import the libraries that we installed and another necessary library that we will use for sending e-mail and routing e-mail between mail servers.</p><pre>import requests<br>from bs4 import BeautifulSoup<br>import smtplib</pre><p>Every time your web browser makes a request to a website, it sends a HTTP Header called the “<strong>User Agent</strong>”. The User Agent string contains information about your web browser name, operating system, device type and lots of other useful bits of information.In order to know your User Agent just google “My user agent”. You will get something like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/702/1*qNBvIwQEwfpEauTWHycgVA.png" /></figure><p>Now let’s define the URL of the product (For which we are going to track the price) and the user agent.</p><pre>URL = &#39;producturl.com/xyz&#39;<br>headers = {&quot;User-Agent&quot;: &#39;YOUR USER AGENT&#39;}</pre><p>It’s time to write the function that is going to fulfil the first purpose of our Python app. We are going to define a function check_price() which will include accessing the URL, extract the information of the webpage(which includes the product name and its price) and parse them using BeautifulSoup class. We have also defined a if condition which is going to compare the price and if the comparison gets output as true the bingo ! We are going to receive the email.</p><pre>def check_price():    <br>     page= requests.get(URL, headers=headers)     <br>     soup = BeautifulSoup(page.content, &#39;html.parser&#39;)     <br>     title = soup.find(id = &quot;ebooksProductTitle&quot;).get_text()     <br>     for price in soup.findAll(attrs={&#39;class&#39; : &#39;a-size-medium a-color-price&#39;}):<br>        price = price.text.strip()     <br>     converted_price =  float(price[0:5])     <br>     if(converted_price &lt; 179):        <br>        send_email()     <br>    </pre><p>In the above function we have used id as our locator for extracting the title and class for extracting the price of the product. To explore more about BeautifulSoup you can go to their <a href="https://www.crummy.com/software/BeautifulSoup/bs4/doc/">crummy site</a>.</p><p>Now we are ready to define the function that is going to fulfil the second purpose of our Python app. We will be defining a function send_email(). But before that we need to generate password for the senders mail as some devices does not support 2 factor authentication. In order to generate that just navigate to Google Account’s Apps Passwords. You will be getting a screen just like the below image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/761/1*KRwGmUOuwuT1HNNW6YrkWg.png" /></figure><p>Select app as “Mail” and Select devices according to your requirement. Click generate ! Well you can clearly see your password now. Now lets’s code up the send_email() function.</p><pre>def send_email():     <br>     server = smtplib.SMTP(&#39;smtp.gmail.com&#39;, 587)    <br>     server.ehlo()    <br>     server.starttls()    <br>     server.ehlo()    <br>     server.login(&#39;sender&#39;s email&#39;, &#39;#password&#39;)     <br>     subject = &#39;Write your subject here&#39;     <br>     body = &#39;Write your mail content here&#39;     <br>     msg = f&quot;Subject: {subject} \n\n {body}&quot;<br>     server.sendmail(&#39;sender&#39;s email&#39;, &#39;receiver&#39;s email&#39;, msg)     <br>     print(&#39;Email sent !&#39;)     <br>     server.quit()</pre><p>So in the above function we are sending mail using Python’s smtplib using an SMTP (Simple Mail Transfer Protocol) server. SMTP object which is going to be used for connection with the server. EHLO command will be used to identify the domain name of the sending host to SMTP before we issue a MAIL. Finally let’s call our check_price() function. Bingo !</p><pre>check_price()</pre><p>For more such projects visit <a href="https://www.techism101.com/">Techism101</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d7dd5a840f0b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/build-a-python-app-that-tracks-online-prices-and-sends-email-notifications-d7dd5a840f0b">Build A Python App That Tracks Online Prices And Sends Email Notifications.</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>