<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ashish R Bhandari</title>
    <description>The latest articles on DEV Community by Ashish R Bhandari (@aashishrbhandari).</description>
    <link>https://dev.to/aashishrbhandari</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F546817%2F1e0a969b-9c55-4b50-aa64-42a245a182e5.png</url>
      <title>DEV Community: Ashish R Bhandari</title>
      <link>https://dev.to/aashishrbhandari</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/aashishrbhandari"/>
    <language>en</language>
    <item>
      <title>SomeThing About CSS - Some CSS Things I Learnt</title>
      <dc:creator>Ashish R Bhandari</dc:creator>
      <pubDate>Mon, 22 Mar 2021 14:25:43 +0000</pubDate>
      <link>https://dev.to/aashishrbhandari/something-about-css-some-css-things-i-learnt-3p07</link>
      <guid>https://dev.to/aashishrbhandari/something-about-css-some-css-things-i-learnt-3p07</guid>
      <description>&lt;p&gt;Small-Small Things Like&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Box Shadow&lt;/strong&gt; &lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Good Font&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Border&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Border Only on One Side&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Hover Effect&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Transitions&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Transform&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Filter: Grayscale&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;can Actually Make your UI Look Really Good&lt;/p&gt;

&lt;p&gt;Few Things I Learnt (I will made more)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Making Div At Center (From Left Right) Mostly Used in Container&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.container&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;auto&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;500px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Run a Program(like App Server) like a SystemD Service</title>
      <dc:creator>Ashish R Bhandari</dc:creator>
      <pubDate>Mon, 22 Mar 2021 13:59:45 +0000</pubDate>
      <link>https://dev.to/aashishrbhandari/run-a-program-like-app-server-like-a-systemd-service-3f9f</link>
      <guid>https://dev.to/aashishrbhandari/run-a-program-like-app-server-like-a-systemd-service-3f9f</guid>
      <description>&lt;p&gt;A Very Simple Example of a SystemD COnfigured Service.&lt;br&gt;
Inorder to run a Program like a Service in Background in 2 SImple Steps&lt;/p&gt;

&lt;p&gt;Step1: Create a File inside Dir&lt;br&gt;
&lt;code&gt;/lib/systemd/system/&lt;/code&gt;&lt;br&gt;
wiith Extension as &lt;code&gt;.service&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Step 2: Add the Service Details and Behaviour Etc like creating a Setting File to Tell SystemD what to do&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#Section 1
# Provide Details like Description and After is Requried by Your Service i.e if it requires a Interface then below After is Helpfull.
[Unit]
Description=A Simple Poster App ( A Very Cheap Posting System like Twitter) User can Create Post, Delete Post, View Other Posts etc
Documentation=https://app.poster.com
After=network.target

# Section 2 
# ENV Variables can be created here
# Very VVV IMP `WorkingDirectory`
# Most Obvious Command How to Start the Program `ExecStart`
# `Restart` if the Program crashes due to some reason u have a failover.
# User Optional and Depending on Requirement.

[Service]
Environment=NODE_PORT=81
Type=simple
User=root
ExecStart=/usr/bin/node /usr/local/src/apps/app.poster_v2/app.js
WorkingDirectory=/usr/local/src/apps/app.poster_v2
Restart=on-failure

## When and Where this Service should Start
[Install]
WantedBy=multi-user.target
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
#File Content
[Unit]
Description=A Simple Poster App ( A Very Cheap Posting System like Twitter) User can Create Post, Delete Post, View Other Posts etc
Documentation=https://app.poster.com
After=network.target

[Service]
Environment=NODE_PORT=81
Type=simple
User=root
ExecStart=/usr/bin/node /usr/local/src/apps/app.poster_v2/app.js
WorkingDirectory=/usr/local/src/apps/app.poster_v2
Restart=on-failure

[Install]
WantedBy=multi-user.target
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>(My) Simple Home Wifi Router Login Session Management(Cookie)</title>
      <dc:creator>Ashish R Bhandari</dc:creator>
      <pubDate>Sat, 20 Feb 2021 07:28:24 +0000</pubDate>
      <link>https://dev.to/aashishrbhandari/need-to-be-added-242l</link>
      <guid>https://dev.to/aashishrbhandari/need-to-be-added-242l</guid>
      <description>&lt;p&gt;I saw this, while i was making a change in my Wifi Router Setting,&lt;/p&gt;

&lt;p&gt;If i think from a Security Perspective:&lt;br&gt;
Basically My Wifi Router Web Interface is very unsecure, well i think it should use a better approach, this is the worst possible,&lt;br&gt;
I know about JWT, this is PWT(Plain Web Tokens) 😬&lt;br&gt;
Let's see why...&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Snap1: Shows Cookie With Content containing Username and Password in Bas64&lt;/strong&gt;&lt;br&gt;
 &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nSl-UQZs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l5gyp4hvd7jk256mz5g1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nSl-UQZs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l5gyp4hvd7jk256mz5g1.png" alt="image"&gt;&lt;/a&gt;&lt;br&gt;
So Over here, we can see The Cookie Header contains a HTTP Header (Authorization) in form a Cookie name&amp;amp;value and the value contains the username&amp;amp;password that i just entered.&lt;/p&gt;

&lt;p&gt;Base64!!! Hmmm Nice&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Snap2: A Closer look at Cookie Containing Username and Password in Bas64&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--B4ofSXKd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kb9kdr13wrb61kl0blt7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--B4ofSXKd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kb9kdr13wrb61kl0blt7.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Snap3: Dev Tools are amazing the Network Tab has a Column Initiator Tells from where this the Request Originated, the whole Stack Trace (Beginning from the Click Event Fired)&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QiEHw5Va--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gkqkah4jylfiezubttqq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QiEHw5Va--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gkqkah4jylfiezubttqq.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Snap3: Finally the Code how cookie was set, Basically by Client JS&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DTOp4VHi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tam8romhqkxnm6mk7uvr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DTOp4VHi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tam8romhqkxnm6mk7uvr.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If i think from a Router's Actual Work:&lt;/strong&gt;&lt;br&gt;
Then in that case it has nothing to do with the Web Interface.&lt;br&gt;
Web Interface are for us to manage few things and that too mostly used in Internal Network&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Behind the Scenes (My Mind Conversation &amp;amp; Thoughts)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;But if someone who is part of the network but does not have access can SNIFF the Traffic and capture these details&lt;br&gt;
But this is totally contradictory, since he could have SNIFFED the Initial Login Traffic and received the details and Also the Web Interface is usually over Plain HTTP.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
    </item>
    <item>
      <title>Get Product Prices via JS</title>
      <dc:creator>Ashish R Bhandari</dc:creator>
      <pubDate>Sat, 23 Jan 2021 02:27:55 +0000</pubDate>
      <link>https://dev.to/aashishrbhandari/get-product-prices-via-js-25io</link>
      <guid>https://dev.to/aashishrbhandari/get-product-prices-via-js-25io</guid>
      <description>&lt;p&gt;&lt;strong&gt;Get the Amazon Product Price (&amp;amp; Highlight The Price)&lt;/strong&gt;&lt;br&gt;
A Quick One that I Figured Out&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;price_of_product&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`span[id*="priceblock_"][class*="a-size"][class*="priceBlock"]`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;price_of_product&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;backgroundColor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;blue&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;price_of_product&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerText&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;OutPut:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BhO5Kc2i--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/yd02ac0hbl8nhs6isa8m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BhO5Kc2i--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/yd02ac0hbl8nhs6isa8m.png" alt="Amazon Price Fetch 1 via JS"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A Bit More Styling&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Below i am using &lt;code&gt;cssText&lt;/code&gt;, This helps to Set the Style Attribute with Plain CSS way of Styling&lt;br&gt;
&lt;em&gt;Rather then using backgroundColor (JS way) as Normal CSS attr background-color (CSS way)&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;price_of_product&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`span[id*="priceblock_"][class*="a-size"][class*="priceBlock"]`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;price_of_product&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cssText&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;background-color: orange; padding: 5px; border-radius: 10px; font-size: 24px!important;&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;price_of_product&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerText&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--g1_CVtAM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/9ikju4s0fp6e8n5rsq9x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--g1_CVtAM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/9ikju4s0fp6e8n5rsq9x.png" alt="Amazon Price Fetch 2 via JS"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;+++ Added For Flipkart&lt;/p&gt;

&lt;h1&gt;
  
  
  Worst JS Snippet But Still
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;let&lt;/span&gt; &lt;span class="nt"&gt;price_el&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nt"&gt;document&lt;/span&gt;&lt;span class="nc"&gt;.querySelector&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;"#container&amp;gt;div&amp;gt;div:nth-child(3)&amp;gt;div:nth-child(1)&amp;gt;div:nth-child(2)&amp;gt;div:nth-child(2)&amp;gt;div:nth-child(1)&amp;gt;div:nth-child(3)&amp;gt;div:nth-child(1)&amp;gt;div:nth-child(1)&amp;gt;div:nth-child(1)"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="nt"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;price_el&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="err"&gt;price_el.style.backgroundColor&lt;/span&gt; &lt;span class="err"&gt;=&lt;/span&gt; &lt;span class="err"&gt;"red";&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nt"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="err"&gt;let&lt;/span&gt; &lt;span class="err"&gt;price_el2&lt;/span&gt; &lt;span class="err"&gt;=&lt;/span&gt; &lt;span class="err"&gt;document.querySelector("#container&amp;gt;div&amp;gt;&lt;/span&gt;&lt;span class="py"&gt;div&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;nth-child&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;div&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;nth-child&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;div&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;nth-child&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;div&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;nth-child&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;div&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;nth-child&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;div&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;nth-child&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;div&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;nth-child&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;div&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;nth-child&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;div&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;nth-child&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="s1"&gt;");
    price_el2.style.backgroundColor = "&lt;/span&gt;&lt;span class="no"&gt;red&lt;/span&gt;&lt;span class="err"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Copy this and add it in the console of any Flipkart Product Page it will highlight the Product Price...&lt;/p&gt;

&lt;p&gt;Later u can use it in Python Script&lt;br&gt;
Mainly the CSS Selector Path&lt;/p&gt;

&lt;p&gt;and then can automate the process...&lt;/p&gt;

</description>
      <category>cssselectors</category>
      <category>css</category>
    </item>
    <item>
      <title>A Small Wrong Doc Section (or Correct me if I am Wrong)</title>
      <dc:creator>Ashish R Bhandari</dc:creator>
      <pubDate>Sat, 16 Jan 2021 07:56:28 +0000</pubDate>
      <link>https://dev.to/aashishrbhandari/a-small-wrong-doc-section-or-correct-me-if-i-am-wrong-5eac</link>
      <guid>https://dev.to/aashishrbhandari/a-small-wrong-doc-section-or-correct-me-if-i-am-wrong-5eac</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Please Feel free to Comment or Point of Errors or Write your Own View Point&lt;br&gt;
Also Correct me if the Article is WRONG or a OLDER one&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;While I was reading this Article:&lt;br&gt;
(Nginx Doc) [&lt;a href="https://docs.nginx.com/nginx/admin-guide/security-controls/terminating-ssl-http/"&gt;https://docs.nginx.com/nginx/admin-guide/security-controls/terminating-ssl-http/&lt;/a&gt;]&lt;/p&gt;

&lt;p&gt;I Found a Wrong Description in the Doc at Section:&lt;br&gt;
(Nginx Name Based Https Servers) [&lt;a href="https://docs.nginx.com/nginx/admin-guide/security-controls/terminating-ssl-http/#name-based-https-servers"&gt;https://docs.nginx.com/nginx/admin-guide/security-controls/terminating-ssl-http/#name-based-https-servers&lt;/a&gt;]&lt;/p&gt;

&lt;p&gt;The Doc says that below Things&lt;br&gt;
(Doc Says) [&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LXDn3mbo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/8qer348uanht6k1zebwc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LXDn3mbo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/8qer348uanht6k1zebwc.png" alt="Alt Text"&gt;&lt;/a&gt;]&lt;/p&gt;

&lt;p&gt;According to me &lt;br&gt;
In Simple Words, the &lt;code&gt;server_name&lt;/code&gt; is the one which will basically checks the SNI as well as the Host Field.&lt;/p&gt;

&lt;p&gt;Is it a Old Doc then it should changed.&lt;/p&gt;

&lt;p&gt;I will add the Practical Setup to explain about the &lt;code&gt;server_name&lt;/code&gt; working and basic nginx setup soon...&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Error due to (.) in Domain Name End[www.ashish.com.]</title>
      <dc:creator>Ashish R Bhandari</dc:creator>
      <pubDate>Thu, 14 Jan 2021 07:02:40 +0000</pubDate>
      <link>https://dev.to/aashishrbhandari/error-due-to-in-domain-name-end-www-ashish-com-4n2f</link>
      <guid>https://dev.to/aashishrbhandari/error-due-to-in-domain-name-end-www-ashish-com-4n2f</guid>
      <description>&lt;p&gt;1) I saw a Very Interesting behavior today.&lt;br&gt;
Let me explain it with an example&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;https://www.google.com./&lt;/code&gt;&lt;br&gt;
&lt;code&gt;https://www.google.com/&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;Both URL are ALMOST Same the difference is a (.)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The Above Both URL will access the same Resource, Also If we do the DNS LOOKUP, we will GET the same IP [Yes it will change depending on DNS and it's config] [To Check it Please Use a Domain that Points to only one IP]&lt;/p&gt;

&lt;p&gt;A Quick Look [example.com]&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;C:\Users\@sh&amp;gt;nslookup example.com
Server:  dns.google
Address:  8.8.8.8

Non-authoritative answer:
Name:    example.com
Addresses:  2606:2800:220:1:248:1893:25c8:1946
          93.184.216.34


C:\Users\@ash&amp;gt;nslookup example.com.
Server:  dns.google
Address:  8.8.8.8

Non-authoritative answer:
Name:    example.com
Addresses:  2606:2800:220:1:248:1893:25c8:1946
          93.184.216.34
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So The Main Point to Focus, is yes a "." at End is accepted in DNS Query and So in Chrome or FireFox Browser.&lt;/p&gt;

&lt;p&gt;The Same Happens When the Browser tries to access such a URL.&lt;/p&gt;

&lt;p&gt;The Results were Hilarious.&lt;/p&gt;

&lt;p&gt;The Browser will Treat Both as 2 Different Domains [As per what i understood from it].&lt;br&gt;
Which means that if i Go to &lt;code&gt;https://www.google.com./&lt;/code&gt;&lt;br&gt;
Then Browser will not send any Cookie that is for "Google.com" or "&lt;a href="http://www.google.com"&gt;www.google.com&lt;/a&gt;"&lt;br&gt;
[i.e Any Cookie Set for google.com and it's subdomain]&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ALSO&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Browser will not send any Cookie when the Request is made to google.com and it's subdomain via a "&lt;a href="http://www.google.com."&gt;www.google.com.&lt;/a&gt;" [ending with a DOT(.)]&lt;br&gt;
&lt;em&gt;IF&lt;/em&gt; the Cookie &lt;code&gt;SameSite&lt;/code&gt; Attribute is Not None.&lt;br&gt;
Because it will treat it as a &lt;code&gt;CSR&lt;/code&gt; &lt;em&gt;[Cross Site Request]&lt;/em&gt;&lt;br&gt;
and only Cookies with &lt;code&gt;SameSite&lt;/code&gt; Attribute as &lt;code&gt;None&lt;/code&gt; are sent by the Browser &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;[Also if the Request is not a Top-Level Navigation, In Other words if the Link Accessed does not Show in Browser's URL Bar Cookies will not be Sent]&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Which Means if you are logged in to Google and then on the URL Bar you access&lt;/p&gt;

&lt;p&gt;This is the Result I Got&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--elPdUbdf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ffhyjmc3ctqwmx46ksml.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--elPdUbdf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ffhyjmc3ctqwmx46ksml.png" alt="Google.com with . at End"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's do some Debugging&lt;/p&gt;

&lt;p&gt;The Browser Says that it cannot set the New Cookie Received From "&lt;a href="http://www.google.com."&gt;www.google.com.&lt;/a&gt;" which is "&lt;a href="http://www.google.com"&gt;www.google.com&lt;/a&gt;", but the Browser will match it with "&lt;a href="http://www.google.com."&gt;www.google.com.&lt;/a&gt;" [Since this is what was requested by the user and this is what is shown in the Browser URL Bar]&lt;/p&gt;

&lt;p&gt;Therefore, No Cookie which was for "&lt;a href="http://www.google.com"&gt;www.google.com&lt;/a&gt;" was sent and the Received Cookies were also discarded as the domain or the URL Path (Hard to tell what!!) did not qualify for "&lt;a href="http://www.google.com."&gt;www.google.com.&lt;/a&gt;" [With a (.)]&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--f2QM20Ol--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/09ii2m6s6tq7b63m9csj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--f2QM20Ol--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/09ii2m6s6tq7b63m9csj.png" alt="Browser Rejects Sending Cookies and Receiving Cookies"&gt;&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;I am Already Logged in Therefore when I click on sign in&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MlibVlux--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/dzvft2bt1hzzocjd604m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MlibVlux--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/dzvft2bt1hzzocjd604m.png" alt='Google in "www.google.com" is Proper'&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note:&lt;br&gt;
&lt;em&gt;Please Feel Free to Comment your own View points and correct me&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
    </item>
    <item>
      <title>Notes on Proxies</title>
      <dc:creator>Ashish R Bhandari</dc:creator>
      <pubDate>Sat, 09 Jan 2021 14:27:01 +0000</pubDate>
      <link>https://dev.to/aashishrbhandari/notes-on-proxies-56ok</link>
      <guid>https://dev.to/aashishrbhandari/notes-on-proxies-56ok</guid>
      <description>&lt;p&gt;&lt;strong&gt;Reverse Proxy&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://cloud.google.com/load-balancing/docs/tcp"&gt;TCP Proxy&lt;/a&gt;
&lt;em&gt;&lt;a href="https://cloud.google.com/load-balancing/docs/tcp"&gt;https://cloud.google.com/load-balancing/docs/tcp&lt;/a&gt;&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://cloud.google.com/load-balancing/docs/ssl"&gt;SSL Proxy&lt;/a&gt;
&lt;em&gt;&lt;a href="https://cloud.google.com/load-balancing/docs/ssl"&gt;https://cloud.google.com/load-balancing/docs/ssl&lt;/a&gt;&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://cloud.google.com/load-balancing/docs"&gt;Load Balancing&lt;/a&gt;
&lt;em&gt;&lt;a href="https://cloud.google.com/load-balancing/docs"&gt;https://cloud.google.com/load-balancing/docs&lt;/a&gt;&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://blog.envoyproxy.io/introduction-to-modern-network-load-balancing-and-proxying-a57f6ff80236"&gt;Types of Load Balancing&lt;/a&gt;
&lt;em&gt;&lt;a href="https://blog.envoyproxy.io/introduction-to-modern-network-load-balancing-and-proxying-a57f6ff80236"&gt;https://blog.envoyproxy.io/introduction-to-modern-network-load-balancing-and-proxying-a57f6ff80236&lt;/a&gt;&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://aws.amazon.com/elasticloadbalancing/?elb-whats-new.sort-by=item.additionalFields.postDateTime&amp;amp;elb-whats-new.sort-order=desc"&gt;AWS Thoughts and Understanding on Load Balancing&lt;/a&gt;
&lt;em&gt;&lt;a href="https://aws.amazon.com/elasticloadbalancing/?elb-whats-new.sort-by=item.additionalFields.postDateTime&amp;amp;elb-whats-new.sort-order=desc"&gt;https://aws.amazon.com/elasticloadbalancing/?elb-whats-new.sort-by=item.additionalFields.postDateTime&amp;amp;elb-whats-new.sort-order=desc&lt;/a&gt;&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;** Some Good Quotes **&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Not all proxies are load balancers, but the vast majority of proxies perform load balancing as a primary function.&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>HTTP(S) Forward Proxy (🤔 Types)</title>
      <dc:creator>Ashish R Bhandari</dc:creator>
      <pubDate>Sat, 09 Jan 2021 02:42:05 +0000</pubDate>
      <link>https://dev.to/aashishrbhandari/forward-proxy-types-le2</link>
      <guid>https://dev.to/aashishrbhandari/forward-proxy-types-le2</guid>
      <description>&lt;p&gt;I am Keeping this Post as Simple as Possible.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Feel Free to Comment and Point Out Problems, Suggestions and Your Point of View.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So There are 3 Types we can Say&lt;br&gt;
1) &lt;strong&gt;HTTP Proxy&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;(Does Not Support &lt;code&gt;CONNECT Method&lt;/code&gt;, In Simple words it cannot connect to HTTPS Sites)&lt;/p&gt;

&lt;p&gt;Example: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://pypi.org/project/CherryProxy/"&gt;Cherry Proxy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.decalage.info/python/cherryproxy"&gt;Cherry Proxy Official Site&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;2) &lt;strong&gt;Connect Proxy&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;(Supports &lt;code&gt;CONNECT Method&lt;/code&gt;, Meaning they can Let user to connect to HTTPS Sites BUT cannot see anything as the data is Encrypted).&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/tinyproxy/tinyproxy"&gt;Tiny Proxy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://tinyproxy.github.io/"&gt;Tiny Proxy Official Site&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Tiny Proxy Have a Lot More Capability Then Just a CONNECT Proxy, it can be used as a &lt;code&gt;FORWARD PROXY&lt;/code&gt;, &lt;code&gt;REVERSE PROXY&lt;/code&gt;, &lt;code&gt;TRANSPARENT PROXY&lt;/code&gt;&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Proxy_servers_and_tunneling"&gt;Mozilla Docs for Proxy &amp;amp; Tunneling&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;3) &lt;strong&gt;HTTPS Proxy&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://mitmproxy.org/"&gt;MitmProxy&lt;/a&gt; is the Perfect Example Here.&lt;br&gt;
&lt;a href="https://portswigger.net/burp"&gt;BurpSuite&lt;/a&gt; The &lt;code&gt;All Time Favourite&lt;/code&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A Proxy that can Intercept &amp;amp; Inspect HTTPS Sites.&lt;/li&gt;
&lt;li&gt;It can See all the HTTPS Data as Plain HTTP Request, Response &lt;/li&gt;
&lt;li&gt;It is Also Called as&lt;/li&gt;
&lt;li&gt;SSL/TLS Termination Proxy&lt;/li&gt;
&lt;li&gt;HTTPS Inspection Proxy (Not Exactly, But &lt;code&gt;HTTPS Inspection&lt;/code&gt; is a Term)&lt;/li&gt;
&lt;li&gt;SSL Proxy
and many more...&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>LVM (Quick Snippet)</title>
      <dc:creator>Ashish R Bhandari</dc:creator>
      <pubDate>Tue, 05 Jan 2021 07:47:32 +0000</pubDate>
      <link>https://dev.to/aashishrbhandari/lvm-quick-snippet-2lfb</link>
      <guid>https://dev.to/aashishrbhandari/lvm-quick-snippet-2lfb</guid>
      <description>&lt;ol&gt;
&lt;li&gt;Physical Volume (PV)&lt;/li&gt;
&lt;li&gt;Volume Group (VG)&lt;/li&gt;
&lt;li&gt;Logical Volume (LV)&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  All PV COMMANDS
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pvcreate /dev/sdb2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  All VG COMMANDS
&lt;/h3&gt;

&lt;p&gt;Syntax: vgcreate NEW_VG_NAME PV_NAME&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;vgcreate ubuntu-vg /dev/sdb2 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Syntax: vgextend OLD_VG_NAME PV_NAME&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;vgextend ubuntu-vg /dev/sdb3 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  ALL LV COMMANDS
&lt;/h3&gt;

&lt;p&gt;Syntax: lvcreate -n NEW_LV_NAME -L SIZE(G,M) EXISITING_VG_NAME&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;lvcreate -n app-log-lv -L 12G ubuntu-vg 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Syntax: lvextend [LEFT TO ADD]&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[LEFT TO ADD]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;lvreduce&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Check First
lvs

LV   VG   Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
app-log-lv ubuntu-vg -wi-ao---- &amp;lt;12.00g


# Perform Reduce
lvreduce --resizefs -L -1G ubuntu-vg/app-log-lv


# Check Again
lvs

LV   VG   Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
app-log-lv ubuntu-vg -wi-ao---- &amp;lt;11.00g



&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  A Quick Setup
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Step1:&lt;/em&gt;&lt;/strong&gt;  Make Sure a Disk is Present or Create it using &lt;code&gt;pvcreate&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pvcreate /dev/sdb2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Note: Check all PVs&lt;br&gt;
commands: pvs , pvscan , pvdisplay&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Step2:&lt;/em&gt;&lt;/strong&gt;  Make Sure a Volume Group(VG) is Present or Create it using &lt;code&gt;vgcreate&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;vgcreate ubuntu-vg /dev/sdb2 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Note: Check all VGs&lt;br&gt;
commands: vgs , vgscan , vgdisplay&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Step3:&lt;/em&gt;&lt;/strong&gt;  Make Sure a Logical Volume(LV) is Present or Create it using &lt;code&gt;lvcreate&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;lvcreate -n app-log-lv -L 12G ubuntu-vg 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Note: Check all LVs&lt;br&gt;
commands: lvs , lvscan , lvdisplay&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Step4:&lt;/em&gt;&lt;/strong&gt;  Make Sure it has a File System(fs) else provide one using &lt;code&gt;mkfs.ext4 LV_PATH&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#Get the LV_PATH
lvdisplay
#OutPut [It will show the LV Path]

  --- Logical volume ---
  LV Path                /dev/ubuntu-vg/app-log-lv
  LV Name                app-log-lv
  VG Name                ubuntu-vg
  LV UUID                bGNxCm-Beki-UX3D-HSXm-NU3k-YWs0-1ru2Tp
  LV Write Access        read/write
  LV Creation host, time tester, 2020-11-04 10:52:02 +0530
  LV Status              available
  # open                 1
  LV Size                12 GiB
  Current LE             2092
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:8

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Give File System (fs)
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkfs.ext4 /dev/ubuntu-vg/app-log-lv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Note: Check all mkfs &lt;br&gt;
commands: &lt;code&gt;mkfs.ext4&lt;/code&gt;, &lt;code&gt;mkfs -t ext4&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Step5:&lt;/em&gt;&lt;/strong&gt;  Make Sure it is MOUNTED(mount) if NOT mount it to a DIRECTORY&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;code&gt;so that any changes made in directory is reflected in the Disk&lt;/code&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Syntax: mount LV_Path DIR_PATH&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Create Dir If You don't have: 
mkdir /var/log/app-logs
mount /dev/ubuntu-vg/app-log-lv /var/log/app-logs

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;Step6:&lt;/em&gt;&lt;/strong&gt;  Make Sure it is PERMANENTLY MOUNTED(fstab) if NOT mount it PERMANENTLY &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Quickest: Copy New Data from mtab to fstab&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cat /etc/mtab

/dev/mapper/ubuntu-vg-app-log-lv /var/log/app-logs ext4 rw,relatime,data=ordered 0 0

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Add some Here
vim fstab

/dev/mapper/ubuntu-vg-app-log-lv /var/log/app-logs ext4 rw,relatime,data=ordered 0 0

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Restart &amp;amp; Check
&lt;/h1&gt;

</description>
    </item>
    <item>
      <title>Simple Connect Proxy</title>
      <dc:creator>Ashish R Bhandari</dc:creator>
      <pubDate>Sun, 03 Jan 2021 01:57:09 +0000</pubDate>
      <link>https://dev.to/aashishrbhandari/simple-connect-proxy-13lp</link>
      <guid>https://dev.to/aashishrbhandari/simple-connect-proxy-13lp</guid>
      <description>&lt;p&gt;Over Here, we are Talking about Control that a Proxy Have (i.e Proxy used in a Internal Network to &lt;code&gt;APPLY RESTRICTIONS&lt;/code&gt;)&lt;/p&gt;

&lt;p&gt;Refer Here : &lt;a href="https://dev.to/asharry97/what-all-things-are-possible-in-a-proxy-forward-proxy-4ba1"&gt;What All Things are Possible in a Proxy(Forward Proxy)&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So A Connect Proxy basically means that yes it supports connecting to HTTPS Website, Because there were Proxies which did not Support &lt;code&gt;CONNECT Method&lt;/code&gt; i.e were not able to connect to HTTPS site.&lt;/p&gt;

&lt;p&gt;So we are talking about a Proxy that handles &lt;code&gt;CONNECT&lt;/code&gt; Method and then basically creates a TCP Socket to the Remove Server and then their are 2 TCP SOCKETS as shown below&lt;/p&gt;

&lt;p&gt;CLIENT    -----&amp;gt;    Proxy   ------&amp;gt;   SERVER&lt;br&gt;
   &lt;strong&gt;&lt;em&gt;TCP SOCKET&lt;/em&gt;&lt;/strong&gt;  =====&amp;gt;   &lt;strong&gt;&lt;em&gt;TCP SOCKET&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The Proxy is going to send any data received from client as it is to server socket. because after Successful TLS Connection it is encrypted, the Proxy cannot interpret the data.&lt;/p&gt;

&lt;p&gt;SO then What all things a CONNECT PROXY can do&lt;/p&gt;

&lt;p&gt;Let's look at the Data that it Has&lt;/p&gt;

&lt;p&gt;&lt;em&gt;All Possible Data&lt;/em&gt;&lt;br&gt;
1) Client IP&lt;br&gt;
2) Remote Server Domain, Port and After Resolution IP Address&lt;br&gt;
3) User-Agent&lt;br&gt;
4) Time [When The Request Came]&lt;br&gt;
5) Authentication Details [If Proxy Requires Authentication to Identify User and Then Allows]&lt;br&gt;
6) Web Category/URL Category [&lt;strong&gt;&lt;em&gt;I will later&lt;/em&gt;&lt;/strong&gt; Add a Link For Reference]&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;br&gt;
A Small Note on Web Category :&lt;br&gt;
But in Simple Words, There is a Database of Websites which are Added to a Group of Category&lt;br&gt;
Example:&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
A Simple Table&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Domain Name&lt;/th&gt;
&lt;th&gt;Category&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;google.com&lt;/td&gt;
&lt;td&gt;&lt;code&gt;SearchEngine&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;facebook.com&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Social Networking&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;porn.com&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;Pornography&lt;/code&gt;, &lt;code&gt;Adult Content&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A Quick View at Request By Client for &lt;a href="http://www.example.com"&gt;www.example.com&lt;/a&gt; via a &lt;code&gt;Corporate Proxy&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Client[192.168.0.167] Sends Header:

CONNECT www.example.com:443 HTTP/1.1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0
Proxy-Connection: keep-alive
Connection: keep-alive
Host: www.example.com:443

[WebCategory Check]: [Website:www.example.com] =&amp;gt; [Category List: Test Driven Sites, Safe Sites]

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now Let's Look at the Data that the Proxy Has or May or can Have&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Minimum Data&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;1) Client IP&lt;br&gt;
2) Remote Server Domain, Port and After Resolution IP Address&lt;br&gt;
3) Time [When The Request Came]&lt;/p&gt;

&lt;p&gt;Now Coming to What Can be done&lt;/p&gt;

&lt;p&gt;The Proxy Can Apply Rule as&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Allow/Block The Access If Request is From Certain Client IP Address&lt;/li&gt;
&lt;li&gt;Allow/Block The Access If Request is To Certain Remote Server Domain&lt;/li&gt;
&lt;li&gt;Allow/Block The Access If Request is To Certain Remote Server Port&lt;/li&gt;
&lt;li&gt;Allow/Block The Access If Remote Server Domain Resolved To a Certain IP or IP List or to a CNAME&lt;/li&gt;
&lt;li&gt;Allow/Block The Access If User-Agent is of a Certain Regex String&lt;/li&gt;
&lt;li&gt;Allow/Block The Access If User-Agent is NOT of a Certain Regex String&lt;/li&gt;
&lt;li&gt;Allow/Block The Access If The Time When the Request Came is Between a Range&lt;/li&gt;
&lt;li&gt;Allow/Block The Access If The Time When the Request Came is NOT in Between a Range Provided.&lt;/li&gt;
&lt;li&gt;Allow/Block The Access If Request is Authenticated&lt;/li&gt;
&lt;li&gt;Allow/Block The Access If Request is Authenticated and the User is Sam&lt;/li&gt;
&lt;li&gt;Allow/Block The Access If Request is Authenticated and the User is NOT Sam&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Their are Tremendous Amount Of Combination that can be done to Get what is Required&lt;/p&gt;

&lt;p&gt;Let me Give the Condition Pattern&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Fields&lt;/th&gt;
&lt;th&gt;Values&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Authentication&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AND or OR&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Client IP&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AND or OR&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Remote Server Domain&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AND or OR&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Remote Server Port&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AND or OR&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Remote Server IP&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AND or OR&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;WebCategory&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AND or OR&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;User-Agent&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AND or OR&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Time&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AND or OR&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Access&lt;/td&gt;
&lt;td&gt;ALLOW/BLOCK&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The Above Table Follows a AND and OR Condition&lt;br&gt;
Lets Take a Example&lt;/p&gt;

&lt;p&gt;Example 1:  Allow User: &lt;code&gt;Sam&lt;/code&gt; via IP : &lt;code&gt;192.168.0.156&lt;/code&gt; to access &lt;code&gt;Google.com&lt;/code&gt; via Modern Browsers [&lt;code&gt;Chrome&lt;/code&gt;, &lt;code&gt;Firefox&lt;/code&gt;, &lt;code&gt;Edge&lt;/code&gt;] only between &lt;code&gt;Office Time [9 To 5]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Well Now the Below Just Shows Allowing on Certain Condition, But it Also Depends if the Proxy has a Default Blocking Rule has another Rule to Just Cut off Access and then Create a Allow Rule, &lt;code&gt;A Lot of Possibility Possible&lt;/code&gt; .&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Fields&lt;/th&gt;
&lt;th&gt;Values&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Authentication&lt;/td&gt;
&lt;td&gt;Sam&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AND&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Client IP&lt;/td&gt;
&lt;td&gt;192.168.0.156&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AND&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Remote Server Domain&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Regex:google.com&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AND&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Remote Server Port&lt;/td&gt;
&lt;td&gt;443,80&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AND&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Remote Server IP&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ANY&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AND&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;WebCategory&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ANY&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AND&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;User-Agent&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;Chrome&lt;/code&gt;, &lt;code&gt;Firefox&lt;/code&gt;, &lt;code&gt;Edge&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AND&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Time&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Office Time [9 To 5]&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AND&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Access&lt;/td&gt;
&lt;td&gt;ALLOW&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;*** Regardless of Web Category i.e even if google.com falls in any Category it is not effects the Policy ***&lt;/p&gt;

&lt;p&gt;Example 2:  Block User: &lt;code&gt;ANY&lt;/code&gt; via IP : &lt;code&gt;ANY&lt;/code&gt; to access WebCategory &lt;code&gt;SearchEngine&lt;/code&gt; via Modern Browsers [&lt;code&gt;ANY&lt;/code&gt;] between &lt;code&gt;Office Time [9 To 5]&lt;/code&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Fields&lt;/th&gt;
&lt;th&gt;Values&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Authentication&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ANY&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AND&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Client IP&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ANY&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AND&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Remote Server Domain&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ANY&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AND&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Remote Server Port&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ANY&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AND&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Remote Server IP&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ANY&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AND&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;WebCategory&lt;/td&gt;
&lt;td&gt;&lt;code&gt;SearchEngine&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AND&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;User-Agent&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ANY&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AND&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Time&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Office Time [9 To 5]&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AND&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Access&lt;/td&gt;
&lt;td&gt;BLOCK&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;This is Where &lt;code&gt;WebCategory&lt;/code&gt; Help you, &lt;br&gt;
Now Here &lt;code&gt;ANY&lt;/code&gt; User is NOT ALLOWED to access &lt;code&gt;SearchEngine&lt;/code&gt; Sites like Google, Yahoo, Bing etc and many More.&lt;/p&gt;

&lt;p&gt;Now The Allow Rule Table Says To Block All Users, Depending on the Proxy Working &lt;code&gt;NEW Policy&lt;/code&gt; can be below to allow Access to Certain IP&lt;/p&gt;

&lt;p&gt;Quick Example:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Fields&lt;/th&gt;
&lt;th&gt;Values&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Authentication&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Bob&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AND&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Client IP&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ANY&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AND&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Remote Server Domain&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ANY&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AND&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Remote Server Port&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ANY&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AND&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Remote Server IP&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ANY&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AND&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;WebCategory&lt;/td&gt;
&lt;td&gt;&lt;code&gt;SearchEngine&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AND&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;User-Agent&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ANY&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AND&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Time&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Office Time [9 To 5]&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AND&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Access&lt;/td&gt;
&lt;td&gt;ALLOW&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Now Here User &lt;code&gt;Bob&lt;/code&gt; is allowed to access &lt;code&gt;SearchEngine&lt;/code&gt; Sites like Google, Yahoo, Bing etc and many More.&lt;/p&gt;

&lt;p&gt;Last and a Quick One For &lt;code&gt;OR&lt;/code&gt; Condition&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Fields&lt;/th&gt;
&lt;th&gt;Values&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Authentication&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Annie&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AND&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Client IP&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ANY&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AND&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Remote Server Domain&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;Regex:searchable.co.in&lt;/code&gt;, &lt;code&gt;Regex:facetime.com&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;OR&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;WebCategory&lt;/td&gt;
&lt;td&gt;&lt;code&gt;SearchEngine&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AND&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Remote Server Port&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ANY&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AND&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Remote Server IP&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ANY&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AND&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;User-Agent&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ANY&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AND&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Time&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Office Time [9 To 5]&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AND&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Access&lt;/td&gt;
&lt;td&gt;ALLOW&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;This one was to show that you can create a Rule to allow &lt;code&gt;SearchEngine&lt;/code&gt; as well as two more Websites Regardless in What WebCategory they fall in.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;*The Above Was a Glimpse and a Use Case and Illustration of How a Proxy Restriction Working can be. Feel Free to Interrupt and Correct me&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>connectproxy</category>
      <category>contentfiltering</category>
      <category>proxyrules</category>
      <category>proxyrulesrestrictions</category>
    </item>
    <item>
      <title>What All Things are Possible in a Proxy(Forward Proxy)</title>
      <dc:creator>Ashish R Bhandari</dc:creator>
      <pubDate>Fri, 01 Jan 2021 14:06:49 +0000</pubDate>
      <link>https://dev.to/aashishrbhandari/what-all-things-are-possible-in-a-proxy-forward-proxy-4ba1</link>
      <guid>https://dev.to/aashishrbhandari/what-all-things-are-possible-in-a-proxy-forward-proxy-4ba1</guid>
      <description>&lt;p&gt;Hello All,&lt;br&gt;
I am Trying to Express, Expand and Explain My Thoughts and Learning Through these &lt;code&gt;Posts&lt;/code&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  &amp;gt; &lt;em&gt;Feel Free to Point Out If I have made any mistakes&lt;/em&gt;
&lt;/h4&gt;

&lt;p&gt;Beginning With Proxy(If Said Only &lt;code&gt;Proxy&lt;/code&gt; then it mostly means &lt;code&gt;Forward Proxy&lt;/code&gt;)&lt;/p&gt;

&lt;p&gt;There are Lots of Explanation Covered Already about this and I will add links and resources that I have read and found very interesting.&lt;/p&gt;

&lt;p&gt;Coming Back as to what am I going to add in this post.&lt;br&gt;
It going to be all about &lt;br&gt;
What a Forward Proxy is &lt;/p&gt;

&lt;p&gt;Capable of doing, &lt;br&gt;
What it can do,&lt;br&gt;
What it cannot do (depending on Configuration, Use and Functionality)&lt;/p&gt;

&lt;p&gt;So Long Story Short, Since You have Gone Through My Above Links (^)&lt;br&gt;
Let's Start it&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Now The Proxy Works and Provides Features depends on where it is Placed.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Let's Break this down&lt;br&gt;
1) If the Proxy is inside the Network(Basically a Scenario of a School, Institute, Office(Could be Any Office)), Then the Reason it is used is to Let the Client Use the Proxy and do &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Caching&lt;/p&gt;

&lt;p&gt;Website Access Blocking (Well it Fall inside Filtering But There is a Reason Why I kept it over here)&lt;/p&gt;

&lt;p&gt;Filtering&lt;/p&gt;

&lt;p&gt;Identification (Basically Knowing Which User and Based on that Filtering)&lt;/p&gt;

&lt;p&gt;Other Activity (Logging, Alerting)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;........&lt;/p&gt;

&lt;p&gt;2) If the Proxy is Outside the Network(Basically a Scenario of a Online Proxy, Free Proxy Server, Browser Proxy Extension(like Hola , HotSpotShield), Browser VPN Extension(* More Here) ), Then the Reason it is used is to Make the Client Anonymous Over the Internet.&lt;br&gt;
Which Means that This Proxy will provide me Anonymity and Let me Access what is Blocked by My ISP.&lt;br&gt;
[Now This is a Bit Contradictory of the Above that is the reason why I Said the Above Punch line.]&lt;/p&gt;

&lt;p&gt;So we are Clear here About Proxy and How it Differs based on where it is Placed.&lt;/p&gt;

&lt;p&gt;Let's Go To the Other&lt;/p&gt;

&lt;p&gt;How Easy it is for a Proxy to determine the Host the user is trying to Connect to ?&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Based on the &lt;code&gt;Host&lt;/code&gt; Header&lt;br&gt;
For Plain HTTP Website it is Easy to Get the Host Header because anybody can see that, same ways even Proxy can see it Very Easily&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For HTTPS Website, The Browser will First Send a &lt;code&gt;CONNECT&lt;/code&gt; Request to indicate that it is going to initiate a SSL Connection with the Remote Website.&lt;br&gt;
It Looks Like This&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CONNECT b.config.skype.com:443 HTTP/1.1
Host: b.config.skype.com:443
Proxy-Connection: keep-alive
User-Agent: curl/7.58.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Important Headers are Only Below one, Rest &lt;code&gt;Proxy-Connection&lt;/code&gt;, &lt;code&gt;User-Agent&lt;/code&gt; are Important But not Compulsory/Mandatory for &lt;code&gt;CONNECT&lt;/code&gt; Request [Well For &lt;code&gt;User-Agent&lt;/code&gt; it can create problem accessing websites]&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CONNECT b.config.skype.com:443 HTTP/1.1
Host: b.config.skype.com:443
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;Connect&lt;/code&gt; Also specifies Port, indicating whether to connect on Standard or any other Port.&lt;/p&gt;

&lt;p&gt;So, In Simple It works This Way&lt;/p&gt;

&lt;p&gt;In Below Scenario, Imagine it This Way, We are Using Firefox and There is  a Setting in browser: &lt;code&gt;The Proxy Setting&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwfw96l1j0won277r2iwg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwfw96l1j0won277r2iwg.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I am Running a Proxy on My Machine Locally [I will Later Update which proxy I am running]&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Plain HTTP Site&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;We will connect to: &lt;a href="http://example.com/" rel="noopener noreferrer"&gt;http://example.com/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The Browser Will Send a HTTP Request to The Proxy as Follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;hmmm@demo:~# curl -vk "http://example.com/" -x 127.0.0.1:8080
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0)
&amp;gt; GET http://example.com/ HTTP/1.1
&amp;gt; Host: example.com
&amp;gt; User-Agent: curl/7.58.0
&amp;gt; Accept: */*
&amp;gt; Proxy-Connection: Keep-Alive
&amp;gt;
&amp;lt; HTTP/1.1 200 OK
&amp;lt; Age: 341302
&amp;lt; Cache-Control: max-age=604800
&amp;lt; Content-Type: text/html; charset=UTF-8
&amp;lt; Date: Fri, 01 Jan 2021 13:50:29 GMT
&amp;lt; Etag: "3147526947+ident"
&amp;lt; Expires: Fri, 08 Jan 2021 13:50:29 GMT
&amp;lt; Last-Modified: Thu, 17 Oct 2019 07:18:26 GMT
&amp;lt; Server: ECS (nyb/1D2C)
&amp;lt; Vary: Accept-Encoding
&amp;lt; X-Cache: HIT
&amp;lt; Content-Length: 1256
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and Then the Proxy will make a Request to Remote Server (Gathered From Host Header, well it can be extracted from &lt;code&gt;Request Line&lt;/code&gt; But Host Header is the Standard)&lt;/p&gt;

&lt;p&gt;Let's Look at &lt;br&gt;
A Simple DIRECT Request Looks as Follows&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;hmmm@demo:~# curl -vk "http://example.com/"
*   Trying 2606:2800:220:1:248:1893:25c8:1946...
* TCP_NODELAY set
*   Trying 93.184.216.34...
&amp;gt; GET / HTTP/1.1
&amp;gt; Host: example.com
&amp;gt; User-Agent: curl/7.58.0
&amp;gt; Accept: */*
&amp;gt;
&amp;lt; HTTP/1.1 200 OK
&amp;lt; Age: 341302
&amp;lt; Cache-Control: max-age=604800
&amp;lt; Content-Type: text/html; charset=UTF-8
&amp;lt; Date: Fri, 01 Jan 2021 13:50:31 GMT
&amp;lt; Etag: "3147526947+ident"
&amp;lt; Expires: Fri, 08 Jan 2021 13:50:31 GMT
&amp;lt; Last-Modified: Thu, 17 Oct 2019 07:18:26 GMT
&amp;lt; Server: ECS (nyb/1D2C)
&amp;lt; Vary: Accept-Encoding
&amp;lt; X-Cache: HIT
&amp;lt; Content-Length: 1256

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;HTTPS Request&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;We will connect to: &lt;a href="https://example.com/" rel="noopener noreferrer"&gt;https://example.com/&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
hmmm@demo:~# curl -vk "https://example.com/" -x 127.0.0.1:8080
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0)
* allocate connect buffer!
* Establish HTTP proxy tunnel to example.com:443
&amp;gt; CONNECT example.com:443 HTTP/1.1
&amp;gt; Host: example.com:443
&amp;gt; User-Agent: curl/7.58.0
&amp;gt; Proxy-Connection: Keep-Alive
&amp;gt;
&amp;lt; HTTP/1.1 200 Connection Established
&amp;lt; Connection: Keep-Alive
&amp;lt; Proxy-Connection: Keep-Alive
&amp;lt;
* Proxy replied 200 to CONNECT request
* CONNECT phase completed!
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* CONNECT phase completed!
* CONNECT phase completed!
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (OUT), TLS change cipher, Client hello (1):
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS Unknown, Certificate Status (22):
* TLSv1.3 (IN), TLS handshake, Unknown (8):
* TLSv1.3 (IN), TLS Unknown, Certificate Status (22):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS Unknown, Certificate Status (22):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS Unknown, Certificate Status (22):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS Unknown, Certificate Status (22):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN, server accepted to use h2
* Server certificate:
*  subject: C=US; ST=California; L=Los Angeles; O=Internet Corporation for Assigned Names and Numbers; CN=www.example.org
*  start date: Nov 24 00:00:00 2020 GMT
*  expire date: Dec 25 23:59:59 2021 GMT
*  issuer: C=US; O=DigiCert Inc; CN=DigiCert TLS RSA SHA256 2020 CA1
*  SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* TLSv1.3 (OUT), TLS Unknown, Unknown (23):
* TLSv1.3 (OUT), TLS Unknown, Unknown (23):
* TLSv1.3 (OUT), TLS Unknown, Unknown (23):
* Using Stream ID: 1 (easy handle 0x56435e5025c0)
* TLSv1.3 (OUT), TLS Unknown, Unknown (23):
&amp;gt; GET / HTTP/2
&amp;gt; Host: example.com
&amp;gt; User-Agent: curl/7.58.0
&amp;gt; Accept: */*
&amp;gt;
* TLSv1.3 (IN), TLS Unknown, Certificate Status (22):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.3 (IN), TLS Unknown, Certificate Status (22):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.3 (IN), TLS Unknown, Unknown (23):
* Connection state changed (MAX_CONCURRENT_STREAMS updated)!
* TLSv1.3 (OUT), TLS Unknown, Unknown (23):
* TLSv1.3 (IN), TLS Unknown, Unknown (23):
* TLSv1.3 (IN), TLS Unknown, Unknown (23):
* TLSv1.3 (IN), TLS Unknown, Unknown (23):
&amp;lt; HTTP/2 200
&amp;lt; age: 87233
&amp;lt; cache-control: max-age=604800
&amp;lt; content-type: text/html; charset=UTF-8
&amp;lt; date: Fri, 01 Jan 2021 14:04:25 GMT
&amp;lt; etag: "3147526947+ident"
&amp;lt; expires: Fri, 08 Jan 2021 14:04:25 GMT
&amp;lt; last-modified: Thu, 17 Oct 2019 07:18:26 GMT
&amp;lt; server: ECS (nyb/1D0D)
&amp;lt; vary: Accept-Encoding
&amp;lt; x-cache: HIT
&amp;lt; content-length: 1256
&amp;lt;
* TLSv1.3 (IN), TLS Unknown, Unknown (23):
* TLSv1.3 (IN), TLS Unknown, Unknown (23):
&amp;lt;!doctype html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;title&amp;gt;Example Domain&amp;lt;/title&amp;gt;

    &amp;lt;meta charset="utf-8" /&amp;gt;
    &amp;lt;meta http-equiv="Content-type" content="text/html; charset=utf-8" /&amp;gt;
    &amp;lt;meta name="viewport" content="width=device-width, initial-scale=1" /&amp;gt;
    &amp;lt;style type="text/css"&amp;gt;
    body {
        background-color: #f0f0f2;
        margin: 0;
        padding: 0;
        font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;

    }
    div {
        width: 600px;
        margin: 5em auto;
        padding: 2em;
        background-color: #fdfdff;
        border-radius: 0.5em;
        box-shadow: 2px 3px 7px 2px rgba(0,0,0,0.02);
    }
    a:link, a:visited {
        color: #38488f;
        text-decoration: none;
    }
    @media (max-width: 700px) {
        div {
            margin: 0 auto;
            width: auto;
        }
    }
    &amp;lt;/style&amp;gt;
&amp;lt;/head&amp;gt;

&amp;lt;body&amp;gt;
&amp;lt;div&amp;gt;
    &amp;lt;h1&amp;gt;Example Domain&amp;lt;/h1&amp;gt;
    &amp;lt;p&amp;gt;This domain is for use in illustrative examples in documents. You may use this
    domain in literature without prior coordination or asking for permission.&amp;lt;/p&amp;gt;
    &amp;lt;p&amp;gt;&amp;lt;a href="https://www.iana.org/domains/example"&amp;gt;More information...&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
* Connection #0 to host 127.0.0.1 left intact

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see above Curl Sends a &lt;code&gt;Connect&lt;/code&gt; Request Prior.&lt;/p&gt;

&lt;p&gt;So, we found that it is Very Easy for a Proxy to identify which remote server the user wants to connect to.&lt;/p&gt;

&lt;p&gt;and based on that, The Proxy can have add a Condition whether to let users to access Remote Server or do not allow it.&lt;br&gt;
How Efficiently, Easy, Useful depends on the Proxy&lt;/p&gt;

&lt;p&gt;Quick Example: Inorder to Block a Domain in Squid, we need to restart Squid Service.&lt;br&gt;
Same if we do that in Any Other Proxy it will Provide you a Dashboard to add domains and BLOCK it in Realtime&lt;/p&gt;

&lt;p&gt;........... Post Will be Updated Soon.........&lt;/p&gt;

</description>
      <category>securewebgateway</category>
      <category>forwardproxy</category>
      <category>proxy</category>
      <category>proxywithcontentfiltering</category>
    </item>
    <item>
      <title>DOT(.TCP) DOH(oooHTTP) via curl &amp; kdig</title>
      <dc:creator>Ashish R Bhandari</dc:creator>
      <pubDate>Wed, 30 Dec 2020 02:24:20 +0000</pubDate>
      <link>https://dev.to/aashishrbhandari/dot-doh-learning-47fj</link>
      <guid>https://dev.to/aashishrbhandari/dot-doh-learning-47fj</guid>
      <description>&lt;h3&gt;
  
  
  &amp;gt; &lt;em&gt;Feel Free to Point Out If I have made any mistakes&lt;/em&gt;
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Intro To DNS
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;DNS (Plain Text Over UDP)&lt;br&gt;
Well Also Over TCP But Still Plain Text&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I Love Cloudflare Docs and It Pretty Much Covers Most of the part with Ease.&lt;br&gt;
&lt;a href="https://www.cloudflare.com/learning/dns/what-is-dns/" rel="noopener noreferrer"&gt;https://www.cloudflare.com/learning/dns/what-is-dns/&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;DNSSEC (Security Extn But Still Plain Text)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Well still Plain Text Over UDP, But validates the DNS Records&lt;br&gt;
&lt;a href="https://www.cloudflare.com/learning/dns/dns-security/" rel="noopener noreferrer"&gt;https://www.cloudflare.com/learning/dns/dns-security/&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;And Then Comes Security(Encryption) DOT &amp;amp; DOH&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here is Where Plain Text is Encrypted Text&lt;br&gt;
[DOT] &lt;a href="https://www.cloudflare.com/learning/dns/dns-over-tls/" rel="noopener noreferrer"&gt;https://www.cloudflare.com/learning/dns/dns-over-tls/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Cloudflare Detailed Explanation and Practical View&lt;br&gt;
[DOT] &lt;a href="https://developers.cloudflare.com/1.1.1.1/dns-over-tls" rel="noopener noreferrer"&gt;https://developers.cloudflare.com/1.1.1.1/dns-over-tls&lt;/a&gt;&lt;br&gt;
[DOH] &lt;a href="https://developers.cloudflare.com/1.1.1.1/dns-over-https" rel="noopener noreferrer"&gt;https://developers.cloudflare.com/1.1.1.1/dns-over-https&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I am Capturing the Practical View , How it looks like and how you can try one via CLI using CURL and Kdig.&lt;br&gt;
Cloudflare Provides details on how you can achieve it via &lt;code&gt;CURL&lt;/code&gt;&lt;br&gt;
&lt;a href="https://developers.cloudflare.com/1.1.1.1/dns-over-tls" rel="noopener noreferrer"&gt;https://developers.cloudflare.com/1.1.1.1/dns-over-tls&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So Let's Begin With The Practical View&lt;/p&gt;

&lt;h4&gt;
  
  
  DOH (DNS Over HTTP)
&lt;/h4&gt;

&lt;p&gt;A DOH Query using Curl Pre-requisites: &lt;code&gt;Curl v7.4+&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;So, Below it basically does is, it gets the DNS Record (IP) from the DOH Server (cloudflare-dns.com) Since it is Over HTTP and you need a Resource so it is Therefore (&lt;a href="https://cloudflare-dns.com/dns-query" rel="noopener noreferrer"&gt;https://cloudflare-dns.com/dns-query&lt;/a&gt;).&lt;br&gt;
And The Makes a Connection After Fetching the IP&lt;/p&gt;

&lt;p&gt;A Simple Curl &lt;br&gt;
(-v =&amp;gt; Verbose) &lt;br&gt;
(-I =&amp;gt; Head Request) &lt;br&gt;
(--doh-url =&amp;gt; Ask DNS Over HTTP to which DOH Server &amp;gt;&lt;a href="https://cloudflare-dns.com/dns-query" rel="noopener noreferrer"&gt;https://cloudflare-dns.com/dns-query&lt;/a&gt;)&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

$ curl -v -I --doh-url https://cloudflare-dns.com/dns-query https://www.google.com 


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Details:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

$ curl -v -I --doh-url https://cloudflare-dns.com/dns-query https://www.google.com

* Found bundle for host cloudflare-dns.com: 0x7fffe56ebe80 [serially]
* Server doesn't support multiplex (yet)
*   Trying 104.16.249.249:443...
* TCP_NODELAY set
* Hostname 'cloudflare-dns.com' was found in DNS cache
*   Trying 104.16.249.249:443...
* TCP_NODELAY set
* Connected to cloudflare-dns.com (104.16.249.249) port 443 (#1)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
* Connected to cloudflare-dns.com (104.16.249.249) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* Server certificate:
*  subject: C=US; ST=California; L=San Francisco; O=Cloudflare, Inc.; CN=cloudflare-dns.com
*  start date: Jan 28 00:00:00 2019 GMT
*  expire date: Feb  1 12:00:00 2021 GMT
*  subjectAltName: host "cloudflare-dns.com" matched cert's "cloudflare-dns.com"
*  issuer: C=US; O=DigiCert Inc; CN=DigiCert ECC Secure Server CA
*  SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x7fffe56e5290)
&amp;gt; POST /dns-query HTTP/2
Host: cloudflare-dns.com
accept: */*
content-type: application/dns-message
content-length: 32

* We are completely uploaded and fine
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN, server accepted to use h2
* Server certificate:
*  subject: C=US; ST=California; L=San Francisco; O=Cloudflare, Inc.; CN=cloudflare-dns.com
*  start date: Jan 28 00:00:00 2019 GMT
*  expire date: Feb  1 12:00:00 2021 GMT
*  subjectAltName: host "cloudflare-dns.com" matched cert's "cloudflare-dns.com"
*  issuer: C=US; O=DigiCert Inc; CN=DigiCert ECC Secure Server CA
*  SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x7fffe56df9e0)
&amp;gt; POST /dns-query HTTP/2
Host: cloudflare-dns.com
accept: */*
content-type: application/dns-message
content-length: 32

* We are completely uploaded and fine
* old SSL session ID is stale, removing
* Connection state changed (MAX_CONCURRENT_STREAMS == 256)!
&amp;lt; HTTP/2 200
&amp;lt; date: Sun, 30 Aug 2020 14:22:56 GMT
&amp;lt; content-type: application/dns-message
&amp;lt; content-length: 74
&amp;lt; access-control-allow-origin: *
&amp;lt; cf-request-id: 04e15902c60000de8edb16a200000001
&amp;lt; expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
&amp;lt; server: cloudflare
&amp;lt; cf-ray: 5caf2ab13b45de8e-BLR
&amp;lt;
* Connection #1 to host cloudflare-dns.com left intact
* a DOH request is completed, 1 to go
* old SSL session ID is stale, removing
* Connection state changed (MAX_CONCURRENT_STREAMS == 256)!
&amp;lt; HTTP/2 200
&amp;lt; date: Sun, 30 Aug 2020 14:22:56 GMT
&amp;lt; content-type: application/dns-message
&amp;lt; content-length: 62
&amp;lt; access-control-allow-origin: *
&amp;lt; cf-request-id: 04e15902d60000deb22981d200000001
&amp;lt; expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
&amp;lt; server: cloudflare
&amp;lt; cf-ray: 5caf2ab15b01deb2-BLR
&amp;lt;
* Connection #0 to host cloudflare-dns.com left intact
* a DOH request is completed, 0 to go

----- DOH Response [Starts] -----
* DOH Host name: www.google.com
* TTL: 43 seconds
* DOH A: 172.217.160.164
* DOH AAAA: 2404:6800:4009:080a:0000:0000:0000:2004
----- DOH Response [Ends] -----

*   Trying 172.217.160.164:443...
* TCP_NODELAY set
* Connected to www.google.com (172.217.160.164) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN, server accepted to use h2
* Server certificate:
*  subject: C=US; ST=California; L=Mountain View; O=Google LLC; CN=www.google.com
*  start date: Aug 11 08:59:33 2020 GMT
*  expire date: Nov  3 08:59:33 2020 GMT
*  subjectAltName: host "www.google.com" matched cert's "www.google.com"
*  issuer: C=US; O=Google Trust Services; CN=GTS CA 1O1
*  SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x7fffe56bfaa0)
&amp;gt; HEAD / HTTP/2
&amp;gt; Host: www.google.com
&amp;gt; user-agent: curl/7.68.0
&amp;gt; accept: */*
&amp;gt;
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* old SSL session ID is stale, removing
* Connection state changed (MAX_CONCURRENT_STREAMS == 100)!
&amp;lt; HTTP/2 200
HTTP/2 200
&amp;lt; content-type: text/html; charset=ISO-8859-1
content-type: text/html; charset=ISO-8859-1
&amp;lt; p3p: CP="This is not a P3P policy! See g.co/p3phelp for more info."
p3p: CP="This is not a P3P policy! See g.co/p3phelp for more info."
&amp;lt; date: Sun, 30 Aug 2020 14:22:56 GMT
date: Sun, 30 Aug 2020 14:22:56 GMT
&amp;lt; server: gws
server: gws
&amp;lt; x-xss-protection: 0
x-xss-protection: 0
&amp;lt; x-frame-options: SAMEORIGIN
x-frame-options: SAMEORIGIN
&amp;lt; expires: Sun, 30 Aug 2020 14:22:56 GMT
expires: Sun, 30 Aug 2020 14:22:56 GMT
&amp;lt; cache-control: private
cache-control: private
&amp;lt; set-cookie: 1P_JAR=2020-08-30-14; expires=Tue, 29-Sep-2020 14:22:56 GMT; path=/; domain=.google.com; Secure
set-cookie: 1P_JAR=2020-08-30-14; expires=Tue, 29-Sep-2020 14:22:56 GMT; path=/; domain=.google.com; Secure
&amp;lt; set-cookie: NID=204=faTLwUwByLcvvqmTO0G45YKfiKg9_eBHAJG51-GL6xLFiSZSGxNPB4_AEi1NbR_3MkBFwBu1Km2PLw0h6Xh2ZjGO6RHbTR7AEnPHcHiqkC90Zc9XJqsQugw4zOzThkXwufU_YM2x1o4N40JrWvnKKhxG8v5ntJYdlZbWIF13EXk; expires=Mon, 01-Mar-2021 14:22:56 GMT; path=/; domain=.google.com; HttpOnly
set-cookie: NID=204=faTLwUwByLcvvqmTO0G45YKfiKg9_eBHAJG51-GL6xLFiSZSGxNPB4_AEi1NbR_3MkBFwBu1Km2PLw0h6Xh2ZjGO6RHbTR7AEnPHcHiqkC90Zc9XJqsQugw4zOzThkXwufU_YM2x1o4N40JrWvnKKhxG8v5ntJYdlZbWIF13EXk; expires=Mon, 01-Mar-2021 14:22:56 GMT; path=/; domain=.google.com; HttpOnly
&amp;lt; alt-svc: h3-29=":443"; ma=2592000,h3-27=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-T050=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
alt-svc: h3-29=":443"; ma=2592000,h3-27=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-T050=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"

&amp;lt;
* Connection #0 to host www.google.com left intact




&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h4&gt;
  
  
  DOT (DNS Over TCP)
&lt;/h4&gt;

&lt;p&gt;Pre-requisites: kdig&lt;br&gt;
A DOH Query using kdig &lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

$ apt install knot-dnsutils
$ kdig -d @1.1.1.1 +tls-host=cloudflare-dns.com  google.com


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Details:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

# kdig -d @1.1.1.1 +tls-host=cloudflare-dns.com  google.com
;; DEBUG: Querying for owner(google.com.), class(1), type(1), server(1.1.1.1), port(853), protocol(TCP)
;; DEBUG: TLS, imported 138 system certificates
;; DEBUG: TLS, received certificate hierarchy:
;; DEBUG:  #1, C=US,ST=California,L=San Francisco,O=Cloudflare\, Inc.,CN=cloudflare-dns.com
;; DEBUG:      SHA-256 PIN: V6zes8hHBVwUECsHf7uV5xGM7dj3uMXIS9//7qC8+jU=
;; DEBUG:  #2, C=US,O=DigiCert Inc,CN=DigiCert ECC Secure Server CA
;; DEBUG:      SHA-256 PIN: PZXN3lRAy+8tBKk2Ox6F7jIlnzr2Yzmwqc3JnyfXoCw=
;; DEBUG: TLS, skipping certificate PIN check
;; DEBUG: TLS, The certificate is trusted.
;; TLS session (TLS1.2)-(ECDHE-ECDSA-SECP256R1)-(CHACHA20-POLY1305)
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY; status: NOERROR; id: 33976
;; Flags: qr rd ra; QUERY: 1; ANSWER: 1; AUTHORITY: 0; ADDITIONAL: 1

;; EDNS PSEUDOSECTION:
;; Version: 0; flags: ; UDP size: 1232 B; ext-rcode: NOERROR
;; PADDING: 409 B

;; QUESTION SECTION:
;; google.com.                  IN      A

;; ANSWER SECTION:
google.com.             101     IN      A       216.58.193.78

;; Received 468 B
;; Time 2020-12-30 02:36:00 UTC
;; From 1.1.1.1@853(TCP) in 9.6 ms



&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>dnsovertcp</category>
      <category>dnsoverhttp</category>
      <category>dot</category>
      <category>doh</category>
    </item>
  </channel>
</rss>
