Init gravatar recon

Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com>
This commit is contained in:
Hadi
2025-09-25 19:47:06 +02:00
parent a6383c9de3
commit 8729b0c779
15 changed files with 359 additions and 103 deletions

View File

@@ -0,0 +1,104 @@
<script lang="ts">
import Accordion from "$src/lib/components/accordion.svelte";
import Table from "$src/lib/components/table.svelte";
import type { GravatarResult } from "$src/lib/types";
import { Contact, ExternalLink, Mail, Phone } from "@lucide/svelte";
const { result }: { result: GravatarResult } = $props();
</script>
<div class="w-full flex flex-col gap-10">
{#each result.Results as r}
<div class="flex flex-wrap gap-5">
<div class="avatar">
<div class="w-24 h-24 rounded-xl">
<img src={r.thumbnailUrl} alt="Avatar of {r.preferredUsername}" />
</div>
</div>
<div class="flex flex-col gap-2">
<div class="flex flex-col">
<h3 class="h3">{r.displayName}</h3>
<p class="text-base-content/60">
@{r.preferredUsername}
</p>
</div>
<p class="max-w-sm">{r.aboutMe}</p>
</div>
</div>
<div class="card card-border border-neutral shadow">
<div class="grid">
<Table
row={{
profile_url: r.profileUrl,
current_location: r.currentLocation,
job_title: r.job_title,
company: r.company,
pronouns: r.pronouns,
pronunciation: r.pronunciation,
photos: r.photos.length > 0 ? r.photos.length : "N/A",
}}
/>
</div>
</div>
<div class="flex flex-col gap-2">
{#if r.accounts && r.accounts.length > 0}
<div>
<h4 class="h4 mb-2">Social Links</h4>
<ul class="flex gap-4 flex-col mt-4 mb-6">
{#each r.accounts as account}
<a href={account.url} target="_blank" rel="noopener noreferrer">
<div class="badge bg-base-300">
<ExternalLink size={12} />
{account.username} ({account.url})
</div>
</a>
{/each}
</ul>
</div>
{/if}
{#if r.emails && r.emails.length > 0}
<div>
<ul class="list bg-base-100 rounded-box shadow-md">
<Accordion
icon={Mail}
title={"Emails"}
subtitle={r.emails.length + " email found"}
>
<Table row={r.emails} />
</Accordion>
</ul>
</div>
{/if}
{#if r.phoneNumbers && r.phoneNumbers.length > 0}
<div>
<ul class="list bg-base-100 rounded-box shadow-md">
<Accordion
icon={Phone}
title={"Phone Numbers"}
subtitle={r.phoneNumbers.length + " phone numbers found"}
>
<Table row={r.phoneNumbers} />
</Accordion>
</ul>
</div>
{/if}
{#if r.contactInfo && r.contactInfo.length > 0}
<div>
<ul class="list bg-base-100 rounded-box shadow-md">
<Accordion
icon={Contact}
title={"Contact Info"}
subtitle={r.contactInfo.length + " contact info found"}
>
<Table row={r.contactInfo} />
</Accordion>
</ul>
</div>
{/if}
</div>
{/each}
</div>

View File

@@ -12,6 +12,7 @@
result.GithubResult.EmailResult?.Commits?.length | 0,
result.GithubResult.EmailResult?.Spoofing ? 1 : 0,
result.GithubResult.UsernameResult?.Commits?.length | 0,
result.GravatarResult.Results?.length | 0,
];
nresult = r.reduce((a, b) => a + b, 0);
});
@@ -45,9 +46,15 @@
</div>
<div class="stat-title">Status</div>
<div class="stat-value" class:animate-pulse={result.Status === "pending"}>
{result.Status}
{#if result.Status === "pending"}
Pending
<span class="loading loading-dots loading-xs ml-2"></span>
{:else if result.Status === "completed" && nresult === 0}
No results
{:else if result.Status === "completed" && nresult > 0}
Completed
{:else}
{result.Status}
{/if}
</div>
</div>

View File

@@ -11,12 +11,14 @@
initialExactMatch = false,
initialDatawells = true,
initialGithubRecon = true,
initialGravatarRecon = true,
}: {
initialQuery?: string;
initialFilter?: string;
initialExactMatch?: boolean;
initialDatawells?: boolean;
initialGithubRecon?: boolean;
initialGravatarRecon?: boolean;
} = $props();
let filters = [
@@ -35,12 +37,13 @@
let exactMatch = $state<boolean>(initialExactMatch);
let datawells = $state<boolean>(initialDatawells);
let githubRecon = $state<boolean>(initialGithubRecon);
let gravatarRecon = $state<boolean>(initialGravatarRecon);
function NewSearch() {
axios
.post(
`${$serverUrl}/search`,
{ Text: query, Column: activeFilter, ExactMatch: exactMatch, Datawells: datawells, GithubRecon: githubRecon },
{ Text: query, Column: activeFilter, ExactMatch: exactMatch, Datawells: datawells, GithubRecon: githubRecon, GravatarRecon: gravatarRecon },
{
headers: {
"Content-Type": "application/json",
@@ -98,6 +101,12 @@
Github Recon
</label>
</li>
<li>
<label class="label">
<input type="checkbox" bind:checked={gravatarRecon} class="checkbox" />
Gravatar Recon
</label>
</li>
</ul>
</details>
</div>

View File

@@ -60,9 +60,9 @@
</td>
</tr>
<tr class="hover:bg-base-300">
<th>Google hunt</th>
<th>Gravatar recon</th>
<td>
{#if serverInfo.Settings.GithubRecon === true}
{#if serverInfo.Settings.GravatarRecon === true}
<div class="inline-grid *:[grid-area:1/1] mr-2">
<div class="status status-success"></div>
<div class="status status-success"></div>

View File

@@ -27,7 +27,7 @@
<tr>
{#each Object.entries(item) as [key, value]}
<th class="text-xs whitespace-nowrap font-semibold opacity-60">
{#if key.toLowerCase() === "url" && value !== "" && value !== null}
{#if ( key.toLowerCase() == "url" || key.toLowerCase().endsWith("_url")) && value !== null && value !== ""}
<a
href={value}
target="_blank"
@@ -48,7 +48,7 @@
{:else}
<tbody>
{#each Object.entries(row) as [key, value]}
{#if key !== "source" && value !== "" && value !== null}
{#if key !== "source" && value !== null && value !== ""}
<tr class="">
<th
class="text-xs whitespace-nowrap font-semibold opacity-60 capitalize"
@@ -56,7 +56,7 @@
>
<td class="w-fit overflow-x-auto whitespace-nowrap">
{#if key.toLowerCase() === "url"}
{#if key.toLowerCase() == "url" || key.toLowerCase().endsWith("_url")}
<a
href={value}
target="_blank"

View File

@@ -1,4 +1,4 @@
type Query = {
export type Query = {
Text: string;
Column: string;
ExactMatch: boolean;
@@ -6,33 +6,45 @@ type Query = {
// Services
Datawells: boolean;
GithubRecon: boolean;
GravatarRecon: boolean;
};
type LeakResult = {
export type LeakResult = {
Duration: number;
Error: string;
Rows: Array<Record<string, string>>;
LimitHit: boolean;
Inactive: boolean;
};
type GithubResult = {
export type GithubResult = {
Duration: number;
Error: string;
Inactive: boolean;
EmailResult: any;
UsernameResult: any;
};
type Result = {
export type GravatarResult = {
Duration: number;
Error: string;
Inactive: boolean;
Results: any;
};
export type Result = {
Id: string;
Status: "pending" | "completed";
Date: string;
Query: Query;
LeakResult: LeakResult;
GithubResult: GithubResult;
GravatarResult: GravatarResult;
};
type HistoryItem = {
export type HistoryItem = {
Id: string;
Status: "pending" | "completed";
Date: string;
@@ -40,9 +52,9 @@ type HistoryItem = {
Results: number;
};
type History = HistoryItem[];
export type History = HistoryItem[];
type ServerSettings = {
export type ServerSettings = {
Folders: string[];
CacheFolder: string;
Limit: number;
@@ -51,9 +63,10 @@ type ServerSettings = {
GithubRecon: boolean;
GithubTokenLoaded: boolean;
GithubDeepMode: boolean;
GravatarRecon: boolean;
};
type Server = {
export type Server = {
Settings: ServerSettings;
Dataleaks: Dataleak[];
@@ -63,21 +76,9 @@ type Server = {
TotalSize: number;
};
type Dataleak = {
export type Dataleak = {
Name: string;
Columns: string[];
Length: number;
Size: number;
};
export type {
Query,
LeakResult,
History,
HistoryItem,
GithubResult,
Result,
ServerSettings,
Server,
Dataleak,
};

View File

@@ -19,6 +19,7 @@
} from "@lucide/svelte";
import { convertNanoSeconds } from "$src/lib/utils";
import GithubResult from "$src/lib/components/index/search/id/githubResult.svelte";
import GravatarResult from "$src/lib/components/index/search/id/gravatarResult.svelte";
route.getParams("/search/:id");
@@ -41,6 +42,7 @@
})
.then((r) => {
result = r.data;
console.log(result);
if (result && result.Status !== "pending") {
clearInterval(intervalId);
}
@@ -99,8 +101,8 @@
<main>
{#if result}
<header class="flex gap-5 flex-col">
<a href="/search">
<h1 class="h1"><span class="text-2xl align-middle">🔍</span> Search</h1>
<a href="/search" class="w-fit">
<h1 class="h1 "><span class="text-2xl align-middle">🔍</span> Search</h1>
</a>
<Searchbar
@@ -119,7 +121,7 @@
<Stats {result} />
</div>
{#if result.LeakResult.Error !== "not enabled"}
{#if !result.LeakResult.Inactive}
<div class="collapse collapse-arrow bg-base-100 border">
<input type="radio" name="my-accordion-2" checked={true} />
<div
@@ -166,6 +168,11 @@
</div>
{/each}
</ul>
{:else if !result.LeakResult.Rows || result.LeakResult.Rows.length == 0}
<div role="alert" class="alert alert-soft">
<CircleMinus size={20} />
<span>No result</span>
</div>
{:else}
<p class="text-base-content/60">
{result.LeakResult.Rows.length} results in {convertNanoSeconds(
@@ -186,7 +193,7 @@
</div>
</div>
{/if}
{#if result.GithubResult.Error !== "not enabled"}
{#if !result.GithubResult.Inactive}
<div class="collapse collapse-arrow bg-base-100 border">
<input type="radio" name="my-accordion-2" />
<div
@@ -233,6 +240,64 @@
</div>
</div>
{/if}
{#if !result.GravatarResult.Inactive}
<div class="collapse collapse-arrow bg-base-100 border">
<input type="radio" name="my-accordion-2" />
<div
class="collapse-title font-semibold text-xl flex justify-between items-center"
>
<div class="flex items-center gap-2">
<svg
width="18"
height="18"
viewBox="0 0 18 18"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M7.20008 1.79933V8.09932C7.20008 8.57653 7.38965 9.0342 7.72709 9.37164C8.06453 9.70908 8.5222 9.89865 8.99941 9.89865C9.47662 9.89865 9.93429 9.70908 10.2717 9.37164C10.6092 9.0342 10.7987 8.57653 10.7987 8.09932V3.90799C11.9031 4.29735 12.851 5.03509 13.4996 6.01006C14.1482 6.98502 14.4623 8.14438 14.3947 9.31342C14.327 10.4825 13.8812 11.5978 13.1245 12.4915C12.3678 13.3851 11.3411 14.0086 10.1992 14.2679C9.05725 14.5273 7.86198 14.4084 6.79347 13.9294C5.72497 13.4503 4.84112 12.6369 4.27513 11.6117C3.70914 10.5866 3.49168 9.40529 3.6555 8.24581C3.81933 7.08634 4.35557 6.01152 5.18342 5.18333C5.51545 4.84434 5.70032 4.38803 5.69786 3.91353C5.69541 3.43902 5.50582 2.98465 5.17029 2.64912C4.83476 2.31359 4.38039 2.12401 3.90589 2.12155C3.43138 2.11909 2.97508 2.30396 2.63609 2.636C1.16373 4.10834 0.247437 6.04566 0.043349 8.11786C-0.160739 10.1901 0.360003 12.2689 1.51684 14.0002C2.67368 15.7315 4.39505 17.0081 6.38762 17.6125C8.38019 18.2169 10.5207 18.1117 12.4444 17.3148C14.3681 16.5179 15.956 15.0786 16.9374 13.2422C17.9189 11.4059 18.2333 9.28595 17.827 7.24376C17.4207 5.20156 16.3188 3.36344 14.7091 2.04258C13.0995 0.721724 11.0816 -0.000136192 8.99941 1.92733e-08C8.5222 1.92733e-08 8.06453 0.189572 7.72709 0.527012C7.38965 0.864452 7.20008 1.32212 7.20008 1.79933Z"
class="fill-base-content/60"
/>
</svg>
Gravatar Recon
</div>
{#if result.GravatarResult.Error !== ""}
<CircleX size={16} class="text-error" />
{:else if result.GravatarResult.Duration === 0}
<span class="loading loading-dots loading-xs"></span>
{:else if !result.GravatarResult.Results || result.GravatarResult.Results.length == 0}
<CircleMinus size={16} class="text-base-content/60" />
{:else if result.GravatarResult.Results}
<CircleCheck size={16} class="text-success" />
{/if}
</div>
<div class="collapse-content">
{#if result.GravatarResult.Error !== ""}
<div role="alert" class="alert alert-soft alert-error">
<CircleAlert size={20} />
<span>Error! {result.GravatarResult.Error}</span>
</div>
{:else if result.GravatarResult.Duration === 0}
<div role="alert" class="alert alert-soft">
<span class="loading loading-dots loading-sm"></span>
<span>Loading...</span>
</div>
{:else if !result.GravatarResult.Results || result.GravatarResult.Results.length == 0}
<div role="alert" class="alert alert-soft">
<CircleMinus size={20} />
<span>No result</span>
</div>
{:else}
<p class="text-base-content/60 mb-4">
Found a result in {convertNanoSeconds(
result.GravatarResult.Duration,
)}
</p>
<GravatarResult result={result.GravatarResult} />
{/if}
</div>
</div>
{/if}
</div>
{/if}