Skip to content

A modern platform for visual, flexible, and extensible graph-based investigations. For cybersecurity analysts and investigators.

fix: wrong scan name check

dextmorgndc274c145145
diff --git a/flowsint-api/Dockerfile b/flowsint-api/Dockerfile
index cf2a76b5..e59c81ea 100644
--- a/flowsint-api/Dockerfile
+++ b/flowsint-api/Dockerfile
@@ -6,7 +6,9 @@ COPY . .
RUN pip install --no-cache-dir -r requirements.txt git+https://github.com/soxoj/maigret
-RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
+RUN apt-get update && \
+ apt-get install -y git whois dnsutils curl && \
+ rm -rf /var/lib/apt/lists/*
EXPOSE 5000
diff --git a/flowsint-web/src/components/sketches/sketch/search-email.tsx b/flowsint-web/src/components/sketches/sketch/search-email.tsx
deleted file mode 100644
index 76bb78cc..00000000
--- a/flowsint-web/src/components/sketches/sketch/search-email.tsx
+++ /dev/null
@@ -1,37 +0,0 @@
-import { Button } from '@/components/ui/button'
-import React, { useCallback } from 'react'
-import { toast } from 'sonner'
-import { performSearch } from '@/lib/actions/search'
-const SearchEmail = ({ sketch_id, email }: { sketch_id: string, email: string }) => {
-
- const [disabled, setDisabled] = React.useState(false)
- const handleCheckEmail = useCallback(() => {
- // @ts-ignore
- setDisabled(true)
- if (!sketch_id && !email) return
- // @ts-ignore
- toast.promise(performSearch(email, 'email', sketch_id), {
- loading: "Loading...",
- success: () => {
- setDisabled(false)
- return `Scan on ${email} has been launched.`
- },
- error: (error: any) => {
- setDisabled(false)
- return (
- <div className="overflow-hidden">
- <p className="font-bold">An error occured.</p>
- <pre className="overflow-auto">
- <code>{JSON.stringify(error, null, 2)}</code>
- </pre>
- </div>
- )
- },
- })
- }, [email, sketch_id])
- return (
- <Button disabled={disabled} onClick={handleCheckEmail}>Search socials</Button>
- )
-}
-
-export default SearchEmail
\ No newline at end of file
diff --git a/flowsint-web/src/hooks/use-launch-scan.ts b/flowsint-web/src/hooks/use-launch-scan.ts
index d9f50966..1c01d840 100644
--- a/flowsint-web/src/hooks/use-launch-scan.ts
+++ b/flowsint-web/src/hooks/use-launch-scan.ts
@@ -18,7 +18,7 @@ export function useLaunchSan() {
toast.promise(performSearch(value, scan.scan_name, sketch_id), {
loading: "Loading...",
success: () => `Scan on "${value}" has been launched.`,
- error: (error: any) => 'An error occurred.'
+ error: (error: any) => `An error occurred: ${JSON.stringify(error)}`,
})
}
return {
diff --git a/flowsint-web/src/lib/actions/search.ts b/flowsint-web/src/lib/actions/search.ts
index 494f98d0..3b49da89 100644
--- a/flowsint-web/src/lib/actions/search.ts
+++ b/flowsint-web/src/lib/actions/search.ts
@@ -6,9 +6,10 @@ export async function performSearch(value: string, scan_name: string, sketch_id:
await supabase.auth.refreshSession()
const { data: { session } } = await supabase.auth.getSession();
const jwt = session?.access_token;
- const scan = scans.find((s) => s.name === scan_name)
- if (!scan)
- return { error: `Task name "${scan_name}" not found.` }
+ const scan = scans.find((s) => s.scan_name === scan_name)
+ if (!scan) {
+ throw Error(`Scanner "${scan_name}" was not found.`)
+ }
const url = `${process.env.NEXT_PUBLIC_DOCKER_FLOWSINT_API}/scan`;
const body = JSON.stringify({
scanner: scan.scan_name,
@@ -25,6 +26,7 @@ export async function performSearch(value: string, scan_name: string, sketch_id:
},
);
const resp = await response.json()
+ console.log(resp)
if (response.status !== 200) throw Error(`Error: received status ${response.status}`)
return { ...resp, status: response.status };
}