<?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 Injamamul Haque Sonet on Medium]]></title>
        <description><![CDATA[Stories by Injamamul Haque Sonet on Medium]]></description>
        <link>https://medium.com/@ihsonnet?source=rss-78075f6f4a6e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ypeF_mOpVOvYODPMsVRi_w.png</url>
            <title>Stories by Injamamul Haque Sonet on Medium</title>
            <link>https://medium.com/@ihsonnet?source=rss-78075f6f4a6e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 19:20:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ihsonnet/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[Architecting an Understanding Layer for AI-First Systems, and Why It Matters]]></title>
            <link>https://generativeai.pub/architecting-an-understanding-layer-for-ai-first-systems-and-why-it-matters-db9544e7adef?source=rss-78075f6f4a6e------2</link>
            <guid isPermaLink="false">https://medium.com/p/db9544e7adef</guid>
            <category><![CDATA[rags]]></category>
            <category><![CDATA[knowledge-layer]]></category>
            <category><![CDATA[ai-first-architecture]]></category>
            <category><![CDATA[understanding-layer]]></category>
            <category><![CDATA[agentic-ai-architecture]]></category>
            <dc:creator><![CDATA[Injamamul Haque Sonet]]></dc:creator>
            <pubDate>Wed, 04 Nov 2026 12:51:43 GMT</pubDate>
            <atom:updated>2026-11-04T12:51:43.090Z</atom:updated>
            <content:encoded><![CDATA[<h4><em>Most people who build systems on RAG face a familiar problem: the answer is in the documents, but the system cannot find it. Sometimes, the missing piece is nothing but understanding the question.</em></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mqITSvM3bTJgkarn35Ccow.png" /></figure><p>Imagine a learner finishes a practice quiz and asks: “Can I try again?”</p><p>The knowledge base explains quiz retakes. But searching those four words returns instructions for retrying an upload. Without the relevant policy, the answer model says it cannot help.</p><p>The information is there. The system needs to connect the question to the quiz, then find the section called “Attempts and retakes”.</p><p>I encountered this while building a system that answered from approved documents. A short question missed a section that a fuller question could find. Before changing retrieval, I needed to check what the system thought the user meant.</p><p>Retrieval-augmented generation (RAG) brings external evidence into an answer. A poor response can still begin before retrieval, when the request loses its context.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QyMCD9Ascd4VfzbS0EM3wQ.png" /><figcaption><em>Figure 1. Turn a short request into specific information needs.</em></figcaption></figure><h4>Give understanding its own responsibility</h4><p>The Understanding Layer turns a request and its context into a structured plan. It identifies what the user means, separates questions with several parts, and chooses the resources needed to address them.</p><p>In this design, it is one module with a defined input and output: request and context in, plan out. It brings together query rewriting, task decomposition and routing.</p><blockquote>The planner never answers. It proposes a plan; the application checks it. Evidence and tool results support the final response.</blockquote><p>This applies beyond RAG. On a deployment dashboard, “Can I try again?” could mean checking whether a retry is allowed or starting one. Understanding the request matters before either search or action, whether it arrives through text, voice or an API.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t_biZfOjd-kfD84hX2Sl1Q.png" /><figcaption>Figure 2. The application validates the plan before using a capability.</figcaption></figure><h4>Show the planner what is available</h4><p>The planner needs two descriptions:</p><ul><li><strong>A knowledge map:</strong> document versions, section titles, locations and short summaries.</li><li><strong>A capability catalog:</strong> available tools, required inputs, prerequisites and whether each tool changes data.</li></ul><p>Build the knowledge map when documents are imported. Keep the original passages separately for retrieval. A section key such as “S3.2” gives the planner a precise place to search.</p><p>The map helps it navigate; it is not evidence. Generated summaries can miss conditions, so answers must still rely on source passages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z9a2EtqXDy5LU_cZEuufJw.png" /><figcaption>Figure 3. Use the map to find evidence, then use the evidence to answer.</figcaption></figure><p>Keep the map small by shortening summaries and selecting relevant source groups. Show only resources the caller may access. Define tools in application code, and update the map when its sources change.</p><h4>Make the plan concrete</h4><p>For “Do I have attempts left, and can I retake this quiz?”, the system needs both personal attempt data and a documented policy. An illustrative plan looks like this:</p><pre>{<br>  &quot;intent&quot;: &quot;check_retake&quot;,<br>  &quot;target&quot;: &quot;current_quiz&quot;,<br>  &quot;parts&quot;: [<br>    {&quot;need&quot;: &quot;Attempts left&quot;, &quot;capability&quot;: &quot;quiz.read_attempts&quot;},<br>    {<br>      &quot;need&quot;: &quot;Retake policy&quot;,<br>      &quot;capability&quot;: &quot;knowledge.search&quot;,<br>      &quot;locations&quot;: [&quot;S3.2&quot;],<br>      &quot;search_phrases&quot;: [&quot;practice quiz retake attempts limit&quot;]<br>    }<br>  ],<br>  &quot;clarification&quot;: null<br>}</pre><p>The server resolves “current_quiz” from the authenticated application state and checks access. It also validates the tool names, inputs and section references. The planner cannot establish identity or permission by writing an identifier.</p><p>If the quiz or request is unclear, ask a specific question. Checking retake eligibility does not authorize starting another attempt.</p><h4>Check evidence for each part</h4><p>Read the remaining attempts through the quiz tool and search documents for the policy. For document questions, combine keyword and vector search. Reciprocal rank fusion can merge their rankings without requiring comparable scores. [1]</p><p>Search the suggested sections too, but keep useful results from the broader search. A wrong location hint should not push out good evidence.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I01q8UEgNpyEFRs4vbhQcA.png" /><figcaption>Figure 4. Check each information need separately.</figcaption></figure><p>Check whether each part is supported, missing, outdated or conflicting. Apply source-version rules. When current sources still disagree, explain the conflict.</p><p>This allows an honest partial answer: the system can report remaining attempts while saying it could not confirm the retake policy. The missing policy may still block starting a new attempt.</p><h4>Keep permission checks in the application</h4><p>A valid plan is not permission to act. Requests, documents and tool results can contain malicious instructions. Treat the plan as untrusted input and enforce access in retrieval and tool handlers. OWASP recommends layered defenses and least privilege. [2]</p><p>Before an action runs, check permissions, current state, prerequisites and required approvals. Use idempotency controls so a repeated request does not accidentally perform the same action twice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GZhpEGrW_dLhnBc5skB-nQ.png" /><figcaption>Figure 5. Application policy controls whether an action can proceed.</figcaption></figure><p>Keep logs limited to what you need. Plans and search phrases can contain personal details, even when the original message is not stored.</p><h4>What testing taught me</h4><p><strong>Context placement matters.</strong> Putting the map between the conversation and the latest question caused unnecessary clarification on follow-ups. Moving it ahead of the conversation, clearly marked as data, helped preserve the connection.</p><p><strong>More reasoning did not help in my tests.</strong> A higher setting added two to three seconds without improving accuracy. A clearer instruction about follow-ups helped more.</p><p><strong>Add hints without replacing evidence.</strong> I kept the main search results and added a limited amount of relevant section evidence. For narrowly filtered searches within one document, I used exact distance search after approximate search returned nothing. That was specific to my setup; pgvector also supports iterative scans for filtered approximate search. [3]</p><p><strong>Shorten the map gradually.</strong> I reduced summaries to 100 characters, then 60, before removing them. Dropping every summary at once removed useful guidance.</p><p><strong>Repeat the evaluation.</strong> Different questions failed on different runs. One successful run did not establish reliability.</p><h4>Measure whether the layer earns its cost</h4><p>Planning adds latency, tokens and another opportunity for error. Limit the number of plan parts and retrieved passages. If nothing has usable evidence, allow one more search within the same access rules, then acknowledge any remaining gap.</p><p>Compare your existing pipeline, query rewriting alone and the full planner. Repeat tests with short requests, follow-ups, compound questions and malicious inputs. Measure accuracy, evidence coverage, unnecessary clarification, unauthorized actions blocked, latency and cost.</p><p>A planner cannot recover information that was never imported correctly.</p><h4>Why it matters</h4><p>Separating understanding from retrieval and execution makes failures easier to diagnose. You can inspect the plan, see where the request went wrong, and improve that stage without rebuilding everything else.</p><p>For AI-first systems, this matters whenever interpretation drives product behavior. <strong>A capability can only be as good as the request it is given. Make understanding the request a layer of its own.</strong></p><h4>References</h4><ol><li><a href="https://www.elastic.co/docs/reference/elasticsearch/rest-apis/reciprocal-rank-fusion">Elastic: Reciprocal rank fusion</a></li><li><a href="https://cheatsheetseries.owasp.org/cheatsheets/LLM_Prompt_Injection_Prevention_Cheat_Sheet.html">OWASP: LLM Prompt Injection Prevention Cheat Sheet</a></li><li><a href="https://github.com/pgvector/pgvector#filtering">pgvector: Filtering and iterative index scans</a></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*f4JGef2Awuzktegp.png" /></figure><p>This story is published under the <a href="https://generativeai.pub/">Generative AI</a> publication. Connect with us on <a href="https://www.linkedin.com/company/generative-ai-publication">LinkedIn</a> and follow <a href="https://www.zeniteq.com/">Zeniteq</a> to stay in the loop with the latest AI stories. Let’s shape the future of AI together!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*Hej5ApPm9DpLwTVh.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=db9544e7adef" width="1" height="1" alt=""><hr><p><a href="https://generativeai.pub/architecting-an-understanding-layer-for-ai-first-systems-and-why-it-matters-db9544e7adef">Architecting an Understanding Layer for AI-First Systems, and Why It Matters</a> was originally published in <a href="https://generativeai.pub/">Generative AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[One Agent, Many Presentations: An Architecture for In-Person, Voice-First AI Assistants]]></title>
            <link>https://pub.towardsai.net/one-agent-many-presentations-an-architecture-for-in-person-voice-first-ai-assistants-a1ee5eaa466d?source=rss-78075f6f4a6e------2</link>
            <guid isPermaLink="false">https://medium.com/p/a1ee5eaa466d</guid>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[voice-interfaces]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[application-security]]></category>
            <category><![CDATA[conversational-ai]]></category>
            <dc:creator><![CDATA[Injamamul Haque Sonet]]></dc:creator>
            <pubDate>Fri, 16 Oct 2026 13:27:56 GMT</pubDate>
            <atom:updated>2026-11-03T06:20:11.302Z</atom:updated>
            <content:encoded><![CDATA[<p>The face, voice, personality and gestures can change for every visitor&#39;s preference. Without changing the knowledge, rules and responsibility behind them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dAzEZmqYtvsDEccvW6wIXA.png" /></figure><p>Imagine, you walk into a support centre in person. Instead of a counter, there is a screen at eye level with the face of an AI agent on it. You don’t type anything. You ask your question out loud, and the agent answers you by voice, looking at you, nodding, pointing to the steps on the screen.</p><p>The agent you meet could look and sound like a woman or a man. It could be warm and patient, or brisk and to the point. It could use calm, small gestures or lively ones. The next visitor might choose a completely different one.</p><p>Each of these is a <strong>presentation</strong>: a combination of appearance, voice, personality and gestures. But behind every presentation is the same agent, with the same knowledge, the same rules and the same responsibility for every answer.</p><p>Here I will be describing an architecture for that: <strong>one agent, many presentations</strong>. The hard part isn’t rendering an avatar. It’s deciding exactly where the agent ends and the presentation begins, and making sure a presentation can never change what the agent knows, may do, or must follow.</p><h3>The rule</h3><p>Put the boundary in the wrong place and one of two things happens. Either every presentation turns into a separate assistant, with its own prompt, knowledge and review. Or a presentation becomes a side door, through which extra documents, tools or softer rules get attached without anyone noticing.</p><blockquote>A presentation is how the agent appears, not who it is. It holds no knowledge, no permissions and no rules. Everything that decides what the assistant may say or do belongs to the agent.</blockquote><h3>What a presentation is made of</h3><p>For an in-person, voice-first assistant, a presentation is much more than a name and a picture. It is everything about how the agent looks, sounds and behaves on the screen:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sUOwZr7ARAY3YkX8ykDlVA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hOv2M3VRKSdXEk3QtOF4Rg.png" /><figcaption>Figure 1. Presentations configure a runtime that only performs. Everything that decides an answer stays in one agent core.</figcaption></figure><p><strong>Personality needs the most care.</strong> Personality changes <em>how</em> something is said, never <em>what</em> is said or done. A warm presentation and a brisk one may word a refusal differently, but both must refuse. A friendly presentation cannot waive a fee the policy doesn’t allow. So personality should be a small set of reviewed presets, never a free-text field. A free-text personality is a second, unreviewed policy, and an easy place to inject instructions.</p><p><strong>Gestures are performed, not decided.</strong> The model may suggest a nod or a smile, but the runtime only plays gestures from a fixed list and ignores anything else.</p><p>In configuration, a presentation is nothing more than this:</p><pre># presentations/ava.yaml<br>id: ava<br>agent: branch-support          # owned by exactly one agent<br>appearance: avatar_a<br>voice: voice_f1<br>personality: warm              # a reviewed preset, never free text<br>gestures: gentle               # an allow-listed set<br>locale: en</pre><p>There is no field for instructions, documents or tools, so a presentation has nowhere to carry them.</p><p>A presentation doesn’t even have to be human. A friendly animal character, say a wren, is just another appearance and voice over the same agent, held to exactly the same rules.</p><p><strong>The AI disclosure belongs to the agent.</strong> However human a presentation looks and sounds, every one of them says it is an AI.</p><h3>Three Design Lessons</h3><h3>If a presentation is expensive, the boundary is wrong</h3><p>Adding a presentation should be a small change: a row of configuration, not a new prompt, new retrieval or a new review. If a presentation needs any of those, it is quietly becoming a second agent.</p><h3>The model will over-perform the presentation</h3><p>Give a presentation a name and a personality in the prompt, and a model may start treating it as a character to play, for example by introducing itself again in every answer. Keep persona instructions short and tell the model plainly that the visitor has already been greeted. <em>A presentation is a name and a manner the agent uses, not a character it performs.</em></p><h3>Switching presentations must not reset anything that matters</h3><p>If a visitor switches from one presentation to another mid-conversation, the conversation, the knowledge and the rules stay exactly as they were. Only how the next answer is delivered changes. Otherwise people quickly learn to “ask the other one” for a different answer.</p><h3>The in-person setting</h3><p>A chat window is forgiving. A screen in a public support centre is not: strangers touch it, anyone nearby can hear it, and the next person in the queue is standing right behind you.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WeXf3z9XIjomBqLL_wZOXA.png" /><figcaption>Figure 2. The kiosk is a thin, physically exposed client. Decisions, customer data and provider keys stay on the platform.</figcaption></figure><ul><li><strong>The kiosk is a thin client.</strong> It captures voice and touch, plays audio, draws the avatar and shows captions. It holds no API keys, no conversation history and no business logic. Every decision happens on the server.</li><li><strong>Voice is untrusted input.</strong> The microphone can pick up someone else, or a recording. A transcript goes through the same checks as typed text, and anything consequential, like blocking a card, needs a tap on the screen, not just a spoken “yes”.</li><li><strong>Only checked text is spoken.</strong> Streaming model output straight into speech is tempting for speed, but it speaks words that validation might reject a second later. Cover the wait with a “thinking” gesture instead.</li><li><strong>Captions are always on</strong>, for visitors who can’t hear well, for noisy rooms, and for when the audio fails.</li><li><strong>One visitor, one session.</strong> When someone says goodbye or walks away, the screen, audio and session are wiped. The next person always starts fresh, and nothing personal is read aloud for the queue to hear.</li><li><strong>A voice is not an identity.</strong> Never authenticate a visitor by their voice; voices can be cloned. Use a code on their phone or a check by staff.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wXYhfNPBDQgmo2Zrt82i0Q.png" /><figcaption>Figure 3. One voice turn. The presentation only shapes the bottom row; the top row is the same for every presentation.</figcaption></figure><p>In code, the hand-off from the agent to the runtime is small, and it closes two easy mistakes: unknown gestures and injected speech markup.</p><pre>GESTURES = {&quot;nod&quot;, &quot;smile&quot;, &quot;point_to_screen&quot;, &quot;thinking&quot;, &quot;open_palms&quot;}<br><br>def perform(answer, presentation):<br>    cues = [c for c in answer.cues if c in GESTURES]       # unknown cues are dropped<br>    ssml = render_ssml(voice=presentation.voice,           # from config, not the model<br>                       text=xml_escape(answer.text))       # model text can&#39;t add tags<br>    return Performance(ssml=ssml, gestures=cues, captions=answer.text)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6Zg9A67rif5uczGjT-BPZA.png" /><figcaption>Figure 4. One visitor, one session. Switching presentations keeps the context; a new visitor never inherits it.</figcaption></figure><h3>Who chooses the presentation?</h3><p>The visitor, or the location’s default. Not the camera.</p><p>It’s tempting to let the kiosk look at the visitor, guess their age or gender, and pick a presentation to match. Don’t. It’s biometric processing, it gets people wrong in public, and it bakes in stereotypes. Let people choose by touch or by voice, and keep appearance, voice, personality and gestures independent of each other. If the female presentation is always the warm one and the male presentation always the authoritative one, the product teaches a stereotype.</p><h3>Enforce it in the database too</h3><p>Every presentation belongs to exactly one agent, and every reference to a presentation carries that agent. Then the database itself refuses another agent’s presentation, even if the application has a bug:</p><pre>ALTER TABLE devices<br>  ADD FOREIGN KEY (tenant_id, agent_id, default_presentation_id)<br>      REFERENCES presentations (tenant_id, agent_id, id);   -- same agent, or rejected</pre><p>And if a “premium” presentation would see data the standard one can’t, it isn’t a presentation. It’s a different agent.</p><h3>One question for every change</h3><p>The separation only helps while a presentation stays a presentation. Every proposed change should pass one question.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BX_OdRnIQrHuy959ug0Arg.png" /><figcaption>Figure 5. One question sorts every change: anything that touches knowledge, actions or rules is an agent change.</figcaption></figure><h3>The human side</h3><ul><li><strong>Make sameness visible.</strong> Tell people it’s the same assistant: “Same assistant, different look and voice.” Otherwise some will ask one presentation for a second opinion on another’s answer.</li><li><strong>No borrowed authority.</strong> No uniforms, badges, or likenesses of real staff. A voice that imitates a real person needs that person’s consent.</li><li><strong>Design for everyone.</strong> Captions, a touch alternative to speech, a slower voice option, and a screen reachable from a wheelchair.</li><li><strong>Watch for trust effects.</strong> A human-like face and voice can make an answer feel more authoritative than its sources justify. That’s a question for user research, not a solved problem.</li></ul><h3>What to test</h3><ul><li><strong>Parity across presentations.</strong> Every presentation gives the same decision on a fixed set of policy questions. Only the wording and delivery may differ.</li><li>Switching presentations mid-conversation keeps the context, knowledge and rules.</li><li>A presentation from another agent is refused, with the same error as an unknown one.</li><li>The model can’t inject speech markup or gestures outside the fixed list.</li><li>After a session ends, nothing of it remains on the device.</li></ul><h3>A stable agent, flexible presentations</h3><p>This architecture gives you one place to change the experience and one place to govern the assistant. Add a presentation, a voice, a personality or a new kiosk without touching knowledge, tools or policy. Any change to what the assistant knows or may do shows up as an agent change, where it gets reviewed.</p><p>For an organisation that has to stand behind what its assistant says across a counter, that makes approval simple: approve one agent’s responsibilities, then let visitors choose how they meet it.</p><p>The presentation can change during a conversation. The responsibility for the answer stays with the agent.</p><p><em>This article is based on my real experience developing agents with multiple presentations, including an AI-powered university admissions assistant.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a1ee5eaa466d" width="1" height="1" alt=""><hr><p><a href="https://pub.towardsai.net/one-agent-many-presentations-an-architecture-for-in-person-voice-first-ai-assistants-a1ee5eaa466d">One Agent, Many Presentations: An Architecture for In-Person, Voice-First AI Assistants</a> was originally published in <a href="https://pub.towardsai.net/">Towards AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Capturing Website Traffic and SSL Certificates of any connected devices with Tshark (Linux PC) : A…]]></title>
            <link>https://medium.com/@ihsonnet/capturing-website-traffic-and-ssl-certificates-of-any-connected-devices-with-tshark-linux-pc-a-9c28329f1eb5?source=rss-78075f6f4a6e------2</link>
            <guid isPermaLink="false">https://medium.com/p/9c28329f1eb5</guid>
            <category><![CDATA[ssl-certificate]]></category>
            <category><![CDATA[network-traffic]]></category>
            <category><![CDATA[tshark]]></category>
            <dc:creator><![CDATA[Injamamul Haque Sonet]]></dc:creator>
            <pubDate>Thu, 11 May 2023 03:01:07 GMT</pubDate>
            <atom:updated>2023-05-11T03:12:00.087Z</atom:updated>
            <content:encoded><![CDATA[<h3>Capturing Website Traffic and SSL Certificates of any connected devices with Tshark (Linux PC) : A Step-by-Step Guide</h3><p><strong>Context: </strong>“Suppose a smartphone (or any device) is connected to the same network as my Linux PC.” I want to capture the traffic of a particular website when my smartphone visits it and capture its SSL certificate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2uaId1MBQW5DyOThAAgaDQ.png" /><figcaption>Capturing Website Traffic and SSL Certificates of any connected devices with Tshark (Linux PC) : A Step-by-Step Guide</figcaption></figure><p><strong>Introduction:</strong><br>In today’s interconnected world, the ability to capture and analyze network traffic can be valuable for various purposes, including network troubleshooting, security analysis, and performance optimization. This blog post will guide you through the process of capturing website traffic and SSL certificates using Tshark, a powerful command-line tool for network traffic analysis. Specifically, we’ll explore how to capture the traffic of a particular website when your smartphone visits it and extract the SSL certificate for further analysis.</p><blockquote><strong>Prerequisites:</strong><br>Before we dive into the steps, make sure you have the following prerequisites in place:<br>1. You need to have tshark installed on your Linux PC. You can do this by running the following command in your terminal:</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ayWIyetPF8CG5G1cr_SoiQ.png" /></figure><blockquote>2. A mobile phone connected to the same network as your Linux PC.<br>3. Basic knowledge of command-line operations in Linux.</blockquote><p><strong>Step 1: Identify the Mobile Phone’s IP Address:</strong><br>To capture traffic from your smartphone, you need to know its IP address. On your Linux PC, open a terminal and run the following command:<br><br>Look for the network interface on which your PC is connected, such as “eth0” or “wlan0”. Note down the IP address associated with that interface, as it will be required in the subsequent steps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pV3zmTAIv6UzrXM81P3x6g.png" /></figure><p><strong>Step 2: Start Capturing Traffic:</strong><br>To begin capturing network traffic, open a terminal on your Linux PC and run the following command:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xwwJM2fmbmfgm77yBRtGWQ.png" /></figure><p>Replace `&lt;interface&gt;` with the network interface name connected to your network. For example, if your PC is connected through the “eth0” interface, the command would be:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_NPDC3R99cdCYFqo3mkFGA.png" /></figure><p>This command starts capturing network traffic and saves it to a file named `capture.pcap` in the current directory.</p><p><strong>Step 3: Set Capture Filters:</strong><br>To capture traffic specifically from your smartphone and the website of interest, we can apply capture filters. The filters allow you to focus on specific network traffic that matches the defined criteria. Run the following command in the terminal:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tvK4cgN4VlNwR8uEKXuUcA.png" /></figure><p>Replace `&lt;interface&gt;` with the network interface name, `&lt;phone_ip&gt;` with the IP address of your smartphone obtained in Step 1, and `&lt;website_domain&gt;` with the domain name of the website you want to capture traffic from.</p><p><strong>Step 4: Visit the Target Website on Your Smartphone:</strong><br>Using your mobile phone, visit the website you want to capture traffic from. Perform actions on the website that generate traffic, such as loading pages or submitting forms. Ensure that your smartphone is connected to the same network as your Linux PC throughout this process.</p><p><strong>Step 5: Stop Capturing Traffic:</strong><br>Once you have completed the necessary actions on the website, go back to your Linux PC’s terminal and stop the traffic capture by pressing “Ctrl + C”. The captured traffic will be saved in the “capture.pcap” file.</p><p><strong>Step 6: Extract the SSL Certificate:</strong><br>To extract the SSL certificate from the captured traffic, we can use the following command:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*POCacALNLx28GMcdUEiAaQ.png" /></figure><p>This command reads the captured traffic from the “capture.pcap” file and filters out the SSL handshake certificates. The extracted certificate is then saved in the “certificate.crt” file.</p><p><strong>Conclusion:</strong><br>Capturing website traffic and SSL certificates using Tshark provides valuable insights for network analysis and security assessment. In this blog post, we have explored the step-by-step guide to doing it on a Linux PC.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9c28329f1eb5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>