DEV Community

Priyanshu Kumar Sinha
Priyanshu Kumar Sinha

Posted on

Think That Website Looks Safe? Meet WebShield, Your Cybersecurity Ally!

Cybersecurity is not a product, it's a process. – Bruce Schneier

Have you ever wondered how safe the websites you visit are? That’s the question we aimed to tackle with WebShield, our cybersecurity project from the recent hackathon.

WebShield is designed to detect suspicious websites by analyzing multiple layers of their data, such as IP addresses, domain details, SSL certificates, and much more.

It combines technical prowess with user-friendly insights to make the internet a safer space for everyone.

meme

Whether you’re a tech enthusiast or someone simply curious about cybersecurity, this post will guide you through WebShield’s workings, its glossary, and its next-level potential with the integration of Large Language Models (LLMs). Let’s dive in!

About Me

Hi, I’m Priyanshu Kumar Sinha, currently pursuing my B.Tech in Computer Science and Business Systems at Dayananda Sagar College of Engineering. I’ve always been passionate about solving real-world problems through technology.

Priyanshu Kumar Sinha

The idea for WebShield arose from a recurring issue we noticed: many suspicious websites utilize services like Cloudflare to mask their hosting details.

Despite contacting providers like Cloudflare, their response often clarified that they only offered services like SSL certificates and were not responsible for hosting, leaving us without accurate information about the website’s origin. This motivated us to design a system capable of bypassing such hurdles.

Meme

Hackathon Experience: The Journey to Pondicherry

I, along with my teammates Sneha, Vishrutha, and Adithi
participated in this hackathon in Pondicherry to create WebShield. We traveled all the way from Bangalore to Pondicherry, which was an adventure in itself! The hackathon provided a perfect environment for collaboration, brainstorming, and a race against time to turn our idea into a functional application.

Interestingly, during the initial stages of exploring phishing threats, I stumbled upon a website while using Adithi’s laptop that installed some kind of virus. This was a wake-up call and further strengthened our resolve to create a robust solution. To make things engaging, we thought of including a screenshot of the malicious application right on the front page of WebShield, so users can immediately recognize such threats.

Here’s a snapshot of our system architecture, showcasing how each component seamlessly integrates to deliver results:

System Architecture

Glossary: Making Cybersecurity Terms Accessible

Understanding cybersecurity requires grappling with some technical jargon. Here’s a quick glossary of terms central to WebShield:

  1. CDNs (Content Delivery Networks):

    Think of a CDN as a super-efficient delivery truck. It speeds up website loading times by hosting data closer to you. However, bad actors sometimes exploit CDNs like Cloudflare to hide their website’s real location, making detection trickier.

  2. APIs (Application Programming Interfaces):

    APIs act like messengers. They allow our app to communicate with external services, such as WHOIS or Shodan, to fetch relevant data about websites.

  3. DNS (Domain Name System):

    DNS serves as the internet’s address book. When you type a website’s URL, DNS translates it into its corresponding IP address (e.g., 192.168.1.1).

  4. WHOIS Data:

    This is essentially a website’s birth certificate. It provides information about the domain owner, registration date, and more.

  5. SSL Certificates:

    Ever noticed the padlock icon in your browser? It indicates that the website uses SSL (Secure Sockets Layer) to encrypt data, ensuring secure communication.

  6. Reputation Score:

    A metric calculated based on various factors like SSL validity, DNS details, and WHOIS data to assess a website’s trustworthiness.

How Does WebShield Work?

WebShield is a multi-step system combining various data analysis methods to evaluate website safety. Here’s how it works:

Step 1: User Inputs a Website

You start by entering a domain name (e.g., suspicious-site.com) into WebShield’s interface.

Step 2: Backend Fetches Data

The backend retrieves detailed information about the website using APIs like:

  • DNS: Resolves the website’s IP address.
  • WHOIS: Fetches domain registration and ownership details.
  • Shodan: Analyzes open ports and server information.
  • SSL Checker: Verifies the website’s SSL certificate.
  • VirusTotal: Checks the website against a database of known malicious URLs.
  • any many more ...

Meme

Step 3: Data Analysis and Scoring

This step involves analyzing the gathered data and calculating a reputation score based on various factors. For instance:

  • Valid HTTPS: +2 points
  • Recent WHOIS data: +1 point
  • No suspicious patterns in VirusTotal: +2.5 points

Example Code: Calculating Reputation Score

let reputation = 0;
if (sslCheckerData.result.cert_valid) {
  reputation += 2.8; // Bonus for valid HTTPS
}
if (whoisData["Creation Date"]) {
  reputation += 2.2; // Bonus for WHOIS availability
}
console.log("Reputation Score:", reputation);
Enter fullscreen mode Exit fullscreen mode

Step 4: The Final Verdict

Based on the reputation score, WebShield classifies the website into categories:

  • Safe: No red flags detected.
  • Suspicious: Requires caution.
  • Malicious: Likely harmful.

Challenges and Solutions

Challenges:

  1. Many suspicious websites use CDNs like Cloudflare, which mask their actual hosting details, making it difficult to trace their origins.
  2. Even after contacting CDN providers, the responses typically only confirm the use of services like SSL without revealing hosting information.

Solutions:

  1. Bypassing intermediary services like Cloudflare to retrieve accurate hosting information, including the real IP address and hosting provider.
  2. Utilizing advanced techniques such as reverse DNS lookups and historical data analysis to uncover hidden hosting details.
  3. Developing a robust scoring mechanism that combines raw data with contextual insights to enhance detection accuracy.

Cloudflare

Taking It to the Next Level with LLMs

While WebShield is already effective, integrating a Large Language Model (LLM) like GPT-4 can elevate its capabilities. Here’s how:

1. Analyze Complex Patterns

LLMs can interpret subtle correlations within raw data—for example, identifying unusual patterns in IP changes or mismatched WHOIS information.

2. Provide Explanations

Instead of just flagging a website, the LLM could explain why it’s considered risky. For instance: “The website’s SSL certificate is expired, and the WHOIS data suggests frequent domain transfers.

3. Dynamic Scoring

LLMs can weigh factors dynamically, improving the reputation score’s accuracy.

Sample Code: LLM Integration

const axios = require("axios");

const prompt = `
Analyze the following website data:
- IP Address: ${ipinfoData.ip}
- WHOIS: ${JSON.stringify(whoisData)}
- SSL Certificate: ${sslCheckerData.result.cert_valid ? "Valid" : "Invalid"}

Is the website malicious? Why?
`;

const response = await axios.post("https://api.openai.com/v1/chat/completions", {
  model: "gpt-4",
  messages: [{ role: "user", content: prompt }],
  headers: { Authorization: `Bearer ${process.env.OPENAI_API_KEY}` },
});

console.log("LLM Analysis:", response.data.choices[0].message.content);
Enter fullscreen mode Exit fullscreen mode

Why This Matters

"Security is an investment, not an expense." – Anonymous

Cybersecurity is more than just a technical field; it’s a critical layer of trust in today’s digital age. WebShield addresses this by simplifying complex analyses and delivering actionable insights to users.

With LLM integration, WebShield could:

  • Empower non-technical users with clear explanations of risks.
  • Offer adaptive scoring for more nuanced detection.
  • Bridge the gap between raw data and user understanding.

What’s Next for WebShield?

We envision a future where WebShield evolves into a comprehensive cybersecurity toolkit. Future plans include:

  1. Real-time Monitoring: Adding live scanning capabilities for continuous safety checks.
  2. Browser Extensions: Integrating WebShield directly into browsers for instant feedback.
  3. Community Reports: Allowing users to report and review flagged websites, fostering a crowdsourced defense system.

Webshield

Ready to explore cybersecurity further? Join us on this journey to make the internet safer, one website at a time. 🚀

Top comments (10)

Collapse
 
michael_cameroon_5cbe537b profile image
Michael Cameroon

Nice!

Collapse
 
priyanshukumarsinha profile image
Priyanshu Kumar Sinha

Thank you 😊

Collapse
 
areebahmeddd profile image
Areeb

Great read! Scope for browser extensions is my plan😏

Also suggestion: if your using LLMs try utilising it to analyse the DOM content to flag suspicious elements or data or amount of ads

Collapse
 
1ds22cb039_priyanshuku profile image
Priyanshu Kumar Sinha

Yessir 🫡 ... WebShield Complete coming soon ... 🥳

Collapse
 
alfiyafatima09 profile image
Alfiya Fatima

Nicely Explained ! Good work guys :)

Collapse
 
priyanshukumarsinha profile image
Priyanshu Kumar Sinha

Thank you @alfiyafatima09 😊

Collapse
 
snehar17 profile image
Sneha R

Lessgooo💪

Collapse
 
priyanshukumarsinha profile image
Priyanshu Kumar Sinha

Yessir 🫡🫡

Collapse
 
rupali_r_ff77a1d22df9b5e6 profile image
Rupali R

WebShield 💪🫡

Collapse
 
1ds22cb039_priyanshuku profile image
Priyanshu Kumar Sinha

❤❤