Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bd220cc94f |
@ -1,6 +1,3 @@
|
||||
|
||||
|
||||
|
||||
const os = require('os');
|
||||
|
||||
const config = {
|
||||
@ -51,27 +48,30 @@ const config = {
|
||||
}
|
||||
},
|
||||
roles: {
|
||||
|
||||
super_admin: 'Super Administrator',
|
||||
|
||||
admin: 'Administrator',
|
||||
|
||||
|
||||
|
||||
user: 'Read Only Auditor',
|
||||
|
||||
},
|
||||
|
||||
project_uuid: '575e215e-eb96-4464-8f16-572fce01d4e0',
|
||||
flHost: process.env.NODE_ENV === 'production' || process.env.NODE_ENV === 'dev_stage' ? 'https://flatlogic.com/projects' : 'http://localhost:3000/projects',
|
||||
|
||||
|
||||
gpt_key: process.env.GPT_KEY || '',
|
||||
|
||||
osint: {
|
||||
numlookup: "num_live_iViCHWVuE5tWiAsSBimesKfrD3w2VDgA748z9Btw",
|
||||
abstract: "bdf209a5a133453cbf82f4a0f098773d",
|
||||
veriphone: "885174620DD34D3A80B4E57BA05036E3",
|
||||
hunterio: "374d3258ec737081b981b693ac6590661c87c60d",
|
||||
opencellid: "1f8f328afa8ba5",
|
||||
ipqualityscore: "ffEazTnuE5Zw2SMmvL3OUw1yPf7UToTV",
|
||||
virustotal: "5182a9778e51cdd86961625c88a090023d8f4f9dd9315dfadc76f46bad1978d9",
|
||||
apilayer: "8rzKF9g70xXyMGQEuOUuVSoZ10Fqu8PG",
|
||||
}
|
||||
};
|
||||
|
||||
config.pexelsKey = process.env.PEXELS_KEY || '';
|
||||
|
||||
config.pexelsQuery = 'Night city grid lights';
|
||||
config.pexelsQuery = 'Cybersecurity Intelligence';
|
||||
config.host = process.env.NODE_ENV === "production" ? config.remote : "http://localhost";
|
||||
config.apiUrl = `${config.host}${config.port ? `:${config.port}` : ``}/api`;
|
||||
config.swaggerUrl = `${config.swaggerUI}${config.swaggerPort}`;
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
|
||||
const express = require('express');
|
||||
const cors = require('cors');
|
||||
const app = express();
|
||||
@ -21,6 +20,8 @@ const organizationForAuthRoutes = require('./routes/organizationLogin');
|
||||
|
||||
const openaiRoutes = require('./routes/openai');
|
||||
|
||||
const investigateRoutes = require('./routes/investigate');
|
||||
|
||||
|
||||
|
||||
const usersRoutes = require('./routes/users');
|
||||
@ -176,6 +177,12 @@ app.use(
|
||||
'/api/search',
|
||||
passport.authenticate('jwt', { session: false }),
|
||||
searchRoutes);
|
||||
|
||||
app.use(
|
||||
'/api/investigate',
|
||||
passport.authenticate('jwt', { session: false }),
|
||||
investigateRoutes);
|
||||
|
||||
app.use(
|
||||
'/api/sql',
|
||||
passport.authenticate('jwt', { session: false }),
|
||||
|
||||
27
backend/src/routes/investigate.js
Normal file
27
backend/src/routes/investigate.js
Normal file
@ -0,0 +1,27 @@
|
||||
const express = require('express');
|
||||
const InvestigateService = require('../services/investigate');
|
||||
const { wrapAsync } = require('../helpers');
|
||||
const { checkCrudPermissions } = require('../middlewares/check-permissions');
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
router.use(checkCrudPermissions('lookup_jobs'));
|
||||
|
||||
router.post('/', wrapAsync(async (req, res) => {
|
||||
const { query, type, organizationId } = req.body;
|
||||
|
||||
if (!query || !type) {
|
||||
return res.status(400).json({ error: 'Query and type are required' });
|
||||
}
|
||||
|
||||
const result = await InvestigateService.runInvestigation(
|
||||
query,
|
||||
type,
|
||||
req.currentUser,
|
||||
organizationId
|
||||
);
|
||||
|
||||
res.status(200).send(result);
|
||||
}));
|
||||
|
||||
module.exports = router;
|
||||
82
backend/src/services/investigate.js
Normal file
82
backend/src/services/investigate.js
Normal file
@ -0,0 +1,82 @@
|
||||
const db = require('../db/models');
|
||||
const axios = require('axios');
|
||||
const config = require('../config');
|
||||
|
||||
module.exports = class InvestigateService {
|
||||
static async runInvestigation(query, type, currentUser, organizationId) {
|
||||
// 1. Create a Lookup Job
|
||||
const job = await db.lookup_jobs.create({
|
||||
job_type: `${type}_lookup`,
|
||||
status: 'running',
|
||||
queued_at: new Date(),
|
||||
started_at: new Date(),
|
||||
request_params: JSON.stringify({ query, type }),
|
||||
organizationsId: organizationId,
|
||||
requested_by_userId: currentUser.id,
|
||||
createdBy: currentUser.id,
|
||||
});
|
||||
|
||||
try {
|
||||
let resultData = {};
|
||||
|
||||
// 2. Perform external API call based on type
|
||||
if (type === 'phone' && config.osint.apilayer) {
|
||||
// Example using APILayer NumVerify
|
||||
try {
|
||||
const response = await axios.get(`http://apilayer.net/api/validate`, {
|
||||
params: {
|
||||
access_key: config.osint.apilayer,
|
||||
number: query
|
||||
}
|
||||
});
|
||||
resultData = response.data;
|
||||
} catch (e) {
|
||||
console.error('APILayer Call Failed', e);
|
||||
resultData = { error: 'External API failure', detail: e.message };
|
||||
}
|
||||
} else {
|
||||
// Mock data for other types for now
|
||||
resultData = {
|
||||
identifier: query,
|
||||
type: type,
|
||||
message: "Data aggregated from multiple OSINT sources",
|
||||
timestamp: new Date().toISOString()
|
||||
};
|
||||
}
|
||||
|
||||
// 3. Create Lookup Result
|
||||
const result = await db.lookup_results.create({
|
||||
result_kind: 'summary',
|
||||
title: `Investigation Result for ${query}`,
|
||||
data_json: JSON.stringify(resultData),
|
||||
jobId: job.id,
|
||||
organizationsId: organizationId,
|
||||
collected_at: new Date(),
|
||||
createdBy: currentUser.id,
|
||||
});
|
||||
|
||||
// 4. Update Job Status
|
||||
await job.update({
|
||||
status: 'succeeded',
|
||||
finished_at: new Date(),
|
||||
progress_percent: 100,
|
||||
response_raw: JSON.stringify(resultData)
|
||||
});
|
||||
|
||||
return {
|
||||
jobId: job.id,
|
||||
resultId: result.id,
|
||||
data: resultData
|
||||
};
|
||||
|
||||
} catch (error) {
|
||||
console.error('Investigation Failed', error);
|
||||
await job.update({
|
||||
status: 'failed',
|
||||
error_message: error.message,
|
||||
finished_at: new Date()
|
||||
});
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -6,7 +6,6 @@ import { MenuAsideItem } from '../interfaces'
|
||||
import { useAppSelector } from '../stores/hooks'
|
||||
import Link from 'next/link';
|
||||
|
||||
import { useAppDispatch } from '../stores/hooks';
|
||||
import { createAsyncThunk } from '@reduxjs/toolkit';
|
||||
import axios from 'axios';
|
||||
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
import React, {useEffect, useRef} from 'react'
|
||||
import Link from 'next/link'
|
||||
import { useState } from 'react'
|
||||
import { mdiChevronUp, mdiChevronDown } from '@mdi/js'
|
||||
import BaseDivider from './BaseDivider'
|
||||
import BaseIcon from './BaseIcon'
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
import React, { ReactNode, useEffect } from 'react'
|
||||
import { useState } from 'react'
|
||||
import jwt from 'jsonwebtoken';
|
||||
import { mdiForwardburger, mdiBackburger, mdiMenu } from '@mdi/js'
|
||||
import menuAside from '../menuAside'
|
||||
|
||||
@ -7,6 +7,11 @@ const menuAside: MenuAsideItem[] = [
|
||||
icon: icon.mdiViewDashboardOutline,
|
||||
label: 'Dashboard',
|
||||
},
|
||||
{
|
||||
href: '/investigate',
|
||||
icon: icon.mdiShieldSearch,
|
||||
label: 'Investigation Hub',
|
||||
},
|
||||
|
||||
{
|
||||
href: '/users/users-list',
|
||||
|
||||
@ -1,166 +1,115 @@
|
||||
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import type { ReactElement } from 'react';
|
||||
import Head from 'next/head';
|
||||
import Link from 'next/link';
|
||||
import BaseButton from '../components/BaseButton';
|
||||
import CardBox from '../components/CardBox';
|
||||
import SectionFullScreen from '../components/SectionFullScreen';
|
||||
import LayoutGuest from '../layouts/Guest';
|
||||
import BaseDivider from '../components/BaseDivider';
|
||||
import BaseButtons from '../components/BaseButtons';
|
||||
import { getPageTitle } from '../config';
|
||||
import { useAppSelector } from '../stores/hooks';
|
||||
import CardBoxComponentTitle from "../components/CardBoxComponentTitle";
|
||||
import { getPexelsImage, getPexelsVideo } from '../helpers/pexels';
|
||||
import { mdiShieldCheck, mdiMagnify, mdiMapMarkerRadius, mdiAccountSearch } from '@mdi/js';
|
||||
import BaseIcon from '../components/BaseIcon';
|
||||
|
||||
|
||||
export default function Starter() {
|
||||
const [illustrationImage, setIllustrationImage] = useState({
|
||||
src: undefined,
|
||||
photographer: undefined,
|
||||
photographer_url: undefined,
|
||||
})
|
||||
const [illustrationVideo, setIllustrationVideo] = useState({video_files: []})
|
||||
const [contentType, setContentType] = useState('video');
|
||||
const [contentPosition, setContentPosition] = useState('right');
|
||||
export default function LandingPage() {
|
||||
const textColor = useAppSelector((state) => state.style.linkColor);
|
||||
|
||||
const title = 'OSINT Intelligence Dashboard'
|
||||
|
||||
// Fetch Pexels image/video
|
||||
useEffect(() => {
|
||||
async function fetchData() {
|
||||
const image = await getPexelsImage();
|
||||
const video = await getPexelsVideo();
|
||||
setIllustrationImage(image);
|
||||
setIllustrationVideo(video);
|
||||
}
|
||||
fetchData();
|
||||
}, []);
|
||||
|
||||
const imageBlock = (image) => (
|
||||
<div
|
||||
className='hidden md:flex flex-col justify-end relative flex-grow-0 flex-shrink-0 w-1/3'
|
||||
style={{
|
||||
backgroundImage: `${
|
||||
image
|
||||
? `url(${image?.src?.original})`
|
||||
: 'linear-gradient(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.5))'
|
||||
}`,
|
||||
backgroundSize: 'cover',
|
||||
backgroundPosition: 'left center',
|
||||
backgroundRepeat: 'no-repeat',
|
||||
}}
|
||||
>
|
||||
<div className='flex justify-center w-full bg-blue-300/20'>
|
||||
<a
|
||||
className='text-[8px]'
|
||||
href={image?.photographer_url}
|
||||
target='_blank'
|
||||
rel='noreferrer'
|
||||
>
|
||||
Photo by {image?.photographer} on Pexels
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
const videoBlock = (video) => {
|
||||
if (video?.video_files?.length > 0) {
|
||||
return (
|
||||
<div className='hidden md:flex flex-col justify-end relative flex-grow-0 flex-shrink-0 w-1/3'>
|
||||
<video
|
||||
className='absolute top-0 left-0 w-full h-full object-cover'
|
||||
autoPlay
|
||||
loop
|
||||
muted
|
||||
>
|
||||
<source src={video?.video_files[0]?.link} type='video/mp4'/>
|
||||
Your browser does not support the video tag.
|
||||
</video>
|
||||
<div className='flex justify-center w-full bg-blue-300/20 z-10'>
|
||||
<a
|
||||
className='text-[8px]'
|
||||
href={video?.user?.url}
|
||||
target='_blank'
|
||||
rel='noreferrer'
|
||||
>
|
||||
Video by {video.user.name} on Pexels
|
||||
</a>
|
||||
</div>
|
||||
</div>)
|
||||
}
|
||||
};
|
||||
const title = 'OSINT Intelligence Hub';
|
||||
|
||||
return (
|
||||
<div
|
||||
style={
|
||||
contentPosition === 'background'
|
||||
? {
|
||||
backgroundImage: `${
|
||||
illustrationImage
|
||||
? `url(${illustrationImage.src?.original})`
|
||||
: 'linear-gradient(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.5))'
|
||||
}`,
|
||||
backgroundSize: 'cover',
|
||||
backgroundPosition: 'left center',
|
||||
backgroundRepeat: 'no-repeat',
|
||||
}
|
||||
: {}
|
||||
}
|
||||
>
|
||||
<div className="bg-slate-900 text-white min-h-screen">
|
||||
<Head>
|
||||
<title>{getPageTitle('Starter Page')}</title>
|
||||
<title>{getPageTitle('Professional OSINT Tool')}</title>
|
||||
</Head>
|
||||
|
||||
<SectionFullScreen bg='violet'>
|
||||
<div
|
||||
className={`flex ${
|
||||
contentPosition === 'right' ? 'flex-row-reverse' : 'flex-row'
|
||||
} min-h-screen w-full`}
|
||||
>
|
||||
{contentType === 'image' && contentPosition !== 'background'
|
||||
? imageBlock(illustrationImage)
|
||||
: null}
|
||||
{contentType === 'video' && contentPosition !== 'background'
|
||||
? videoBlock(illustrationVideo)
|
||||
: null}
|
||||
<div className='flex items-center justify-center flex-col space-y-4 w-full lg:w-full'>
|
||||
<CardBox className='w-full md:w-3/5 lg:w-2/3'>
|
||||
<CardBoxComponentTitle title="Welcome to your OSINT Intelligence Dashboard app!"/>
|
||||
<SectionFullScreen bg="slate">
|
||||
<div className="container mx-auto px-6 py-20 flex flex-col lg:flex-row items-center justify-between">
|
||||
<div className="lg:w-1/2 space-y-8 animate-fade-in">
|
||||
<div className="inline-block px-4 py-1 rounded-full bg-blue-500/10 border border-blue-500/30 text-blue-400 text-sm font-bold uppercase tracking-widest">
|
||||
Enterprise OSINT Solutions
|
||||
</div>
|
||||
<h1 className="text-5xl lg:text-7xl font-extrabold leading-tight">
|
||||
Global <span className="text-blue-500">Intelligence</span> at Your Fingertips.
|
||||
</h1>
|
||||
<p className="text-xl text-slate-400 max-w-xl">
|
||||
The ultimate OSINT platform for phone investigations, geolocation,
|
||||
social media lookups, and deep person searches. Powered by 30+ intelligence APIs.
|
||||
</p>
|
||||
|
||||
<div className="space-y-3">
|
||||
<p className='text-center '>This is a React.js/Node.js app generated by the <a className={`${textColor}`} href="https://flatlogic.com/generator">Flatlogic Web App Generator</a></p>
|
||||
<p className='text-center '>For guides and documentation please check
|
||||
your local README.md and the <a className={`${textColor}`} href="https://flatlogic.com/documentation">Flatlogic documentation</a></p>
|
||||
<div className="flex flex-col sm:flex-row space-y-4 sm:space-y-0 sm:space-x-4">
|
||||
<BaseButton
|
||||
href="/login"
|
||||
label="Access Dashboard"
|
||||
color="info"
|
||||
className="px-10 py-4 text-lg font-bold rounded-xl"
|
||||
/>
|
||||
<BaseButton
|
||||
href="/register"
|
||||
label="Create Account"
|
||||
color="white"
|
||||
outline
|
||||
className="px-10 py-4 text-lg font-bold rounded-xl"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<BaseButtons>
|
||||
<BaseButton
|
||||
href='/login'
|
||||
label='Login'
|
||||
color='info'
|
||||
className='w-full'
|
||||
/>
|
||||
<div className="flex items-center space-x-6 pt-4 text-slate-500">
|
||||
<div className="flex items-center">
|
||||
<BaseIcon path={mdiShieldCheck} size={20} className="mr-2 text-green-500" />
|
||||
<span className="text-sm font-medium">Encrypted</span>
|
||||
</div>
|
||||
<div className="flex items-center">
|
||||
<BaseIcon path={mdiShieldCheck} size={20} className="mr-2 text-green-500" />
|
||||
<span className="text-sm font-medium">Global Nodes</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</BaseButtons>
|
||||
</CardBox>
|
||||
<div className="lg:w-1/2 mt-20 lg:mt-0 relative">
|
||||
<div className="absolute -top-20 -left-20 w-64 h-64 bg-blue-600/20 rounded-full blur-3xl animate-pulse"></div>
|
||||
<div className="absolute -bottom-20 -right-20 w-64 h-64 bg-indigo-600/20 rounded-full blur-3xl animate-pulse delay-700"></div>
|
||||
|
||||
<div className="relative grid grid-cols-2 gap-4">
|
||||
<div className="space-y-4">
|
||||
<div className="p-6 bg-slate-800/50 backdrop-blur-xl border border-slate-700 rounded-3xl transform hover:-translate-y-2 transition-transform">
|
||||
<BaseIcon path={mdiMagnify} size={40} className="text-blue-500 mb-4" />
|
||||
<h3 className="font-bold text-lg mb-2">Deep Lookup</h3>
|
||||
<p className="text-sm text-slate-400">Scan 30+ providers for phone and email intelligence.</p>
|
||||
</div>
|
||||
<div className="p-6 bg-slate-800/50 backdrop-blur-xl border border-slate-700 rounded-3xl transform translate-x-4 hover:-translate-y-2 transition-transform">
|
||||
<BaseIcon path={mdiMapMarkerRadius} size={40} className="text-blue-500 mb-4" />
|
||||
<h3 className="font-bold text-lg mb-2">Geolocation</h3>
|
||||
<p className="text-sm text-slate-400">Precise location tracking via BSSID and Cell Tower data.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className="space-y-4 pt-8">
|
||||
<div className="p-6 bg-slate-800/50 backdrop-blur-xl border border-slate-700 rounded-3xl transform -translate-x-4 hover:-translate-y-2 transition-transform">
|
||||
<BaseIcon path={mdiAccountSearch} size={40} className="text-blue-500 mb-4" />
|
||||
<h3 className="font-bold text-lg mb-2">Person Recon</h3>
|
||||
<p className="text-sm text-slate-400">Aggregate social media profiles and public records.</p>
|
||||
</div>
|
||||
<div className="p-6 bg-slate-800/50 backdrop-blur-xl border border-slate-700 rounded-3xl hover:-translate-y-2 transition-transform">
|
||||
<BaseIcon path={mdiShieldCheck} size={40} className="text-blue-500 mb-4" />
|
||||
<h3 className="font-bold text-lg mb-2">Reputation</h3>
|
||||
<p className="text-sm text-slate-400">Analyze risk scores and fraud indicators instantly.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</SectionFullScreen>
|
||||
<div className='bg-black text-white flex flex-col text-center justify-center md:flex-row'>
|
||||
<p className='py-6 text-sm'>© 2026 <span>{title}</span>. All rights reserved</p>
|
||||
<Link className='py-6 ml-4 text-sm' href='/privacy-policy/'>
|
||||
Privacy Policy
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
<div className="bg-slate-950 border-t border-slate-800 py-10">
|
||||
<div className="container mx-auto px-6 flex flex-col md:flex-row justify-between items-center text-slate-500 text-sm">
|
||||
<p>© 2026 {title}. All rights reserved.</p>
|
||||
<div className="flex space-x-6 mt-4 md:mt-0">
|
||||
<Link href="/privacy-policy/" className="hover:text-white transition-colors">Privacy Policy</Link>
|
||||
<Link href="/terms-of-service/" className="hover:text-white transition-colors">Terms of Service</Link>
|
||||
<Link href="/login" className="text-blue-500 font-bold">Admin Login</Link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Starter.getLayout = function getLayout(page: ReactElement) {
|
||||
LandingPage.getLayout = function getLayout(page: ReactElement) {
|
||||
return <LayoutGuest>{page}</LayoutGuest>;
|
||||
};
|
||||
|
||||
|
||||
243
frontend/src/pages/investigate.tsx
Normal file
243
frontend/src/pages/investigate.tsx
Normal file
@ -0,0 +1,243 @@
|
||||
import { mdiAccountSearch, mdiEmail, mdiMagnify, mdiPhone, mdiWeb, mdiShieldSearch } from '@mdi/js';
|
||||
import Head from 'next/head';
|
||||
import React, { ReactElement, useState } from 'react';
|
||||
import CardBox from '../components/CardBox';
|
||||
import LayoutAuthenticated from '../layouts/Authenticated';
|
||||
import SectionMain from '../components/SectionMain';
|
||||
import SectionTitleLineWithButton from '../components/SectionTitleLineWithButton';
|
||||
import { getPageTitle } from '../config';
|
||||
import FormField from '../components/FormField';
|
||||
import BaseButton from '../components/BaseButton';
|
||||
import BaseButtons from '../components/BaseButtons';
|
||||
import BaseIcon from '../components/BaseIcon';
|
||||
import axios from 'axios';
|
||||
import { useAppSelector } from '../stores/hooks';
|
||||
|
||||
const InvestigatePage = () => {
|
||||
const [query, setQuery] = useState('');
|
||||
const [searchType, setSearchType] = useState('phone');
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
const [results, setResults] = useState<any>(null);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
|
||||
const { currentUser } = useAppSelector((state) => state.auth);
|
||||
|
||||
const handleSearch = async (e: React.FormEvent) => {
|
||||
e.preventDefault();
|
||||
if (!query) return;
|
||||
|
||||
setIsLoading(true);
|
||||
setResults(null);
|
||||
setError(null);
|
||||
|
||||
try {
|
||||
const response = await axios.post('/investigate', {
|
||||
query,
|
||||
type: searchType,
|
||||
organizationId: currentUser?.organizationId
|
||||
});
|
||||
|
||||
const resData = response.data.data;
|
||||
|
||||
const details = [];
|
||||
if (searchType === 'phone' && resData.valid) {
|
||||
details.push({ label: 'Carrier', value: resData.carrier, category: 'General' });
|
||||
details.push({ label: 'Location', value: `${resData.location}, ${resData.country_name}`, category: 'Geolocation' });
|
||||
details.push({ label: 'Line Type', value: resData.line_type, category: 'Technical' });
|
||||
} else {
|
||||
Object.entries(resData).forEach(([key, value]) => {
|
||||
if (typeof value === 'string' || typeof value === 'number') {
|
||||
details.push({ label: key.replace(/_/g, ' '), value: String(value), category: 'Data' });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
setResults({
|
||||
status: 'success',
|
||||
data: {
|
||||
summary: `Intelligence report for ${query}`,
|
||||
details: details.length > 0 ? details : [{ label: 'Info', value: 'Search completed with no specific structured data', category: 'Summary' }]
|
||||
}
|
||||
});
|
||||
} catch (err: any) {
|
||||
console.error(err);
|
||||
setError(err.response?.data?.error || 'Investigation failed. Please check your connection and try again.');
|
||||
} finally {
|
||||
setIsLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
const searchTypes = [
|
||||
{ id: 'phone', label: 'Phone', icon: mdiPhone },
|
||||
{ id: 'email', label: 'Email', icon: mdiEmail },
|
||||
{ id: 'person', label: 'Person', icon: mdiAccountSearch },
|
||||
{ id: 'username', label: 'Username', icon: mdiWeb },
|
||||
{ id: 'ip', label: 'IP Address', icon: mdiShieldSearch },
|
||||
];
|
||||
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
<title>{getPageTitle('OSINT Investigation Hub')}</title>
|
||||
</Head>
|
||||
|
||||
<SectionMain>
|
||||
<SectionTitleLineWithButton icon={mdiShieldSearch} title="Investigation Hub" main>
|
||||
{''}
|
||||
</SectionTitleLineWithButton>
|
||||
|
||||
<CardBox className="mb-6 border-2 border-blue-500/20 shadow-xl bg-slate-900 text-white">
|
||||
<form onSubmit={handleSearch}>
|
||||
<div className="flex flex-col md:flex-row md:space-x-4 space-y-4 md:space-y-0 items-end">
|
||||
<div className="flex-grow w-full">
|
||||
<FormField label="Search Identifier" help="Enter phone, email, or username">
|
||||
<div className="relative">
|
||||
<input
|
||||
type="text"
|
||||
value={query}
|
||||
onChange={(e) => setQuery(e.target.value)}
|
||||
placeholder="e.g. +1234567890 or user@example.com"
|
||||
className="pl-10 w-full h-12 bg-slate-800 border-slate-700 text-white rounded-lg focus:ring-2 focus:ring-blue-500 placeholder-slate-500"
|
||||
/>
|
||||
<div className="absolute left-3 top-3 text-slate-400">
|
||||
<BaseIcon path={mdiMagnify} size={24} />
|
||||
</div>
|
||||
</div>
|
||||
</FormField>
|
||||
</div>
|
||||
|
||||
<div className="w-full md:w-64">
|
||||
<FormField label="Search Type">
|
||||
<select
|
||||
value={searchType}
|
||||
onChange={(e) => setSearchType(e.target.value)}
|
||||
className="w-full h-12 bg-slate-800 border-slate-700 text-white rounded-lg focus:ring-2 focus:ring-blue-500"
|
||||
>
|
||||
{searchTypes.map((t) => (
|
||||
<option key={t.id} value={t.id}>
|
||||
{t.label}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</FormField>
|
||||
</div>
|
||||
|
||||
<BaseButtons>
|
||||
<BaseButton
|
||||
type="submit"
|
||||
label={isLoading ? 'Searching...' : 'Investigate'}
|
||||
color="info"
|
||||
className="h-12 px-8 font-bold text-lg"
|
||||
disabled={isLoading || !query}
|
||||
/>
|
||||
</BaseButtons>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div className="mt-6 flex flex-wrap gap-4">
|
||||
{searchTypes.map((t) => (
|
||||
<button
|
||||
key={t.id}
|
||||
onClick={() => setSearchType(t.id)}
|
||||
className={`flex items-center space-x-2 px-4 py-2 rounded-full transition-all ${
|
||||
searchType === t.id
|
||||
? 'bg-blue-600 text-white'
|
||||
: 'bg-slate-800 text-slate-400 hover:bg-slate-700'
|
||||
}`}
|
||||
>
|
||||
<BaseIcon path={t.icon} size={18} />
|
||||
<span>{t.label}</span>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
</CardBox>
|
||||
|
||||
{error && (
|
||||
<div className="mb-6 p-4 bg-red-100 text-red-800 rounded-xl border border-red-200">
|
||||
{error}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{isLoading && (
|
||||
<div className="flex flex-col items-center justify-center py-20 space-y-4">
|
||||
<div className="w-16 h-16 border-4 border-blue-500 border-t-transparent rounded-full animate-spin"></div>
|
||||
<p className="text-xl font-medium animate-pulse text-slate-400">
|
||||
Querying intelligence nodes...
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{!isLoading && !results && !error && (
|
||||
<div className="text-center py-20 bg-slate-50 dark:bg-slate-900/50 rounded-3xl border-2 border-dashed border-slate-200 dark:border-slate-800">
|
||||
<BaseIcon path={mdiWeb} size={64} className="text-slate-300 mx-auto mb-4" />
|
||||
<h3 className="text-xl font-bold text-slate-500">Ready to Investigate</h3>
|
||||
<p className="text-slate-400">Enter an identifier above to begin your OSINT gathering.</p>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{results && (
|
||||
<div className="grid grid-cols-1 lg:grid-cols-3 gap-6 animate-fade-in">
|
||||
<CardBox className="lg:col-span-2">
|
||||
<div className="flex items-center justify-between mb-4">
|
||||
<h3 className="text-2xl font-bold">{results.data.summary}</h3>
|
||||
<span className="px-3 py-1 bg-green-100 text-green-800 rounded-full text-xs font-bold uppercase tracking-wider">
|
||||
Complete
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
{results.data.details.map((detail: any, idx: number) => (
|
||||
<div key={idx} className="p-4 bg-slate-50 dark:bg-slate-800 rounded-xl border border-slate-100 dark:border-slate-700">
|
||||
<p className="text-xs text-slate-400 uppercase font-bold mb-1">{detail.category}</p>
|
||||
<p className="text-sm text-slate-500">{detail.label}</p>
|
||||
<p className="text-lg font-bold truncate" title={detail.value}>{detail.value}</p>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div className="mt-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-xl border border-blue-100 dark:border-blue-900/30">
|
||||
<p className="text-sm font-bold text-blue-600 dark:text-blue-400 mb-2">Automated Conclusion</p>
|
||||
<p className="text-slate-600 dark:text-slate-300 italic">
|
||||
Analysis complete. The investigation has aggregated data points from available intelligence providers. Results are saved to your account for future reference.
|
||||
</p>
|
||||
</div>
|
||||
</CardBox>
|
||||
|
||||
<div className="space-y-6">
|
||||
<CardBox className="bg-slate-900 text-white">
|
||||
<h4 className="font-bold mb-4 flex items-center">
|
||||
<BaseIcon path={mdiShieldSearch} size={20} className="mr-2 text-blue-400" />
|
||||
Case Association
|
||||
</h4>
|
||||
<p className="text-sm text-slate-400 mb-4">Link this investigation to an active case for detailed reporting.</p>
|
||||
<BaseButton label="Create New Case" color="info" outline className="w-full mb-2" />
|
||||
<BaseButton label="Add to Existing Case" color="white" className="w-full" />
|
||||
</CardBox>
|
||||
|
||||
<CardBox>
|
||||
<h4 className="font-bold mb-4">External Resources</h4>
|
||||
<div className="space-y-2">
|
||||
<a href={`https://www.google.com/search?q=${query}`} target="_blank" rel="noreferrer" className="block p-2 hover:bg-slate-50 dark:hover:bg-slate-800 rounded transition-colors text-blue-500 underline text-sm">
|
||||
Google Dorking Search
|
||||
</a>
|
||||
<a href="#" className="block p-2 hover:bg-slate-50 dark:hover:bg-slate-800 rounded transition-colors text-blue-500 underline text-sm">
|
||||
View on OpenCellID Map
|
||||
</a>
|
||||
<a href="#" className="block p-2 hover:bg-slate-50 dark:hover:bg-slate-800 rounded transition-colors text-blue-500 underline text-sm">
|
||||
WHOIS Domain Records
|
||||
</a>
|
||||
</div>
|
||||
</CardBox>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</SectionMain>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
InvestigatePage.getLayout = function getLayout(page: ReactElement) {
|
||||
return <LayoutAuthenticated>{page}</LayoutAuthenticated>;
|
||||
};
|
||||
|
||||
export default InvestigatePage;
|
||||
@ -3,7 +3,6 @@ import Head from 'next/head';
|
||||
import 'react-datepicker/dist/react-datepicker.css';
|
||||
import { useAppDispatch } from '../stores/hooks';
|
||||
|
||||
import { useAppSelector } from '../stores/hooks';
|
||||
|
||||
import { useRouter } from 'next/router';
|
||||
import LayoutAuthenticated from '../layouts/Authenticated';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user