From d9c20c028989a52dbad5019527229d5836bbb920 Mon Sep 17 00:00:00 2001 From: Yazan Essam Date: Fri, 12 Apr 2024 15:57:39 +0200 Subject: [PATCH 1/5] JsLeaks UI --- src/renderer/App.tsx | 2 + src/renderer/components/sidebar.tsx | 6 +++ .../views/project/JsLeaks Jobs/EndPoints.tsx | 23 +++++++++++ .../views/project/JsLeaks Jobs/secrets.tsx | 23 +++++++++++ src/renderer/views/project/JsLeaks.1.tsx | 41 +++++++++++++++++++ 5 files changed, 95 insertions(+) create mode 100644 src/renderer/views/project/JsLeaks Jobs/EndPoints.tsx create mode 100644 src/renderer/views/project/JsLeaks Jobs/secrets.tsx create mode 100644 src/renderer/views/project/JsLeaks.1.tsx diff --git a/src/renderer/App.tsx b/src/renderer/App.tsx index cf83c23..3e35156 100644 --- a/src/renderer/App.tsx +++ b/src/renderer/App.tsx @@ -9,6 +9,7 @@ import { ProjectLayout } from './layout/projectLayout'; import Status from './views/project/status'; import Recon from './views/project/recon'; import { ReconResults } from './views/project/results/recon-results'; +import JsLeaks from './views/project/JsLeaks.1'; function Home() { return ( @@ -31,6 +32,7 @@ export default function App() { } /> } /> } /> + } /> diff --git a/src/renderer/components/sidebar.tsx b/src/renderer/components/sidebar.tsx index 1224a9e..e50e4e8 100644 --- a/src/renderer/components/sidebar.tsx +++ b/src/renderer/components/sidebar.tsx @@ -41,6 +41,12 @@ const dashboardMenu: DashboardMenu[] = [ Disabled: true, icon: , }, + + { + href: 'jsleaks', + title: 'JsLeaks', + icon: , + }, ]; const resultArch: DashboardMenu[] = [ diff --git a/src/renderer/views/project/JsLeaks Jobs/EndPoints.tsx b/src/renderer/views/project/JsLeaks Jobs/EndPoints.tsx new file mode 100644 index 0000000..205df3f --- /dev/null +++ b/src/renderer/views/project/JsLeaks Jobs/EndPoints.tsx @@ -0,0 +1,23 @@ +import { Loader2 } from 'lucide-react'; +import { useState } from 'react'; +import { Button } from '../../../components/ui/button'; + +export default function EndPoints() { + const [Loading, setLoading] = useState(false); + const RunEndPoints = async () => { + setLoading(true); + }; + return ( + // eslint-disable-next-line react/jsx-no-useless-fragment + <> + {!Loading ? ( + + ) : ( + + )} + + ); +} diff --git a/src/renderer/views/project/JsLeaks Jobs/secrets.tsx b/src/renderer/views/project/JsLeaks Jobs/secrets.tsx new file mode 100644 index 0000000..865aea9 --- /dev/null +++ b/src/renderer/views/project/JsLeaks Jobs/secrets.tsx @@ -0,0 +1,23 @@ +import { Loader2 } from 'lucide-react'; +import { useState } from 'react'; +import { Button } from '../../../components/ui/button'; + +export default function Secrets() { + const [Loading, setLoading] = useState(false); + const RunSecrets = async () => { + setLoading(true); + }; + return ( + // eslint-disable-next-line react/jsx-no-useless-fragment + <> + {!Loading ? ( + + ) : ( + + )} + + ); +} diff --git a/src/renderer/views/project/JsLeaks.1.tsx b/src/renderer/views/project/JsLeaks.1.tsx new file mode 100644 index 0000000..b3ad068 --- /dev/null +++ b/src/renderer/views/project/JsLeaks.1.tsx @@ -0,0 +1,41 @@ +import { + Card, + CardContent, + CardDescription, + CardHeader, + CardTitle, +} from '../../components/ui/card'; +import Secrets from './JsLeaks Jobs/secrets'; +import EndPoints from './JsLeaks Jobs/EndPoints'; + +export default function JsLeaks() { + return ( +
+

Initiate Recon Attacks

+
+
+ + + Find Secrets + wanna find secrets ? + + + + + + + + Find EndPoints + + Unveiling extra and hidden endpoints + + + + + + +
+
+
+ ); +} From 328a6e21afe88bec9a4f7e93ccc89511ffe26c4e Mon Sep 17 00:00:00 2001 From: Haitham Mohamed Date: Sun, 14 Apr 2024 06:06:39 +0200 Subject: [PATCH 2/5] jsleak backend dev --- src/main/db/connect.ts | 2 ++ src/main/jsleak/jsleak.ts | 62 +++++++++++++++++++++++++++++++++++++++ src/main/main.ts | 11 +++++++ src/main/recon/httpx.ts | 1 - 4 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 src/main/jsleak/jsleak.ts diff --git a/src/main/db/connect.ts b/src/main/db/connect.ts index 202673d..8d42f73 100644 --- a/src/main/db/connect.ts +++ b/src/main/db/connect.ts @@ -8,6 +8,8 @@ export interface ProjectDetails { domain: string; subfinder?: JobDetails; screens?: JobDetails; + extraLinks?: JobDetails; + findSecrets?: JobDetails; params?: JobDetails; liveDomains?: JobDetails; archive?: JobDetails; diff --git a/src/main/jsleak/jsleak.ts b/src/main/jsleak/jsleak.ts new file mode 100644 index 0000000..55c9df5 --- /dev/null +++ b/src/main/jsleak/jsleak.ts @@ -0,0 +1,62 @@ +import { execSync } from 'child_process'; +import path from 'path'; +import { toolPath } from '../util'; +import { PROJECT_DIR } from '../api/project'; +import { connectJson } from '../db/connect'; +import { countLines } from '../results/countResults'; + +export async function findSecret(outputDir: string = PROJECT_DIR): Promise<{ + message: string; + success: boolean; + error: any; +}> { + const jsleak = toolPath('jsleak_1.0.0_windows'); + const command = `type ${path.join(outputDir, 'httpx_live_domains.txt')} | ${jsleak} -s + >> ${path.join(outputDir, 'secrets.txt')}`; + try { + execSync(command); + const numberOfUrls = await countLines(path.join(outputDir, 'secrets.txt')); + const db = connectJson(path.join(`${outputDir}/details.json`)); + await db.update({ + findSecrets: { + result: numberOfUrls, + run: true, + filePath: '', + date: new Date(Date.now()).toUTCString(), + }, + }); + return { message: 'Done', success: true, error: null }; + } catch (error) { + console.error('Error occurred:', error); + return { message: 'Error', success: false, error }; + } +} + +export async function extraLinks(outputDir: string = PROJECT_DIR): Promise<{ + message: string; + success: boolean; + error: any; +}> { + const jsleak = toolPath('jsleak_1.0.0_windows'); + const command = `type ${path.join(outputDir, 'httpx_live_domains.txt')} | ${jsleak} -l | findstr ".js" + >> ${path.join(outputDir, 'extra_links.txt')}`; + try { + execSync(command); + const numberOfUrls = await countLines( + path.join(outputDir, 'extra_links.txt'), + ); + const db = connectJson(path.join(`${outputDir}/details.json`)); + await db.update({ + extraLinks: { + result: numberOfUrls, + run: true, + filePath: '', + date: new Date(Date.now()).toUTCString(), + }, + }); + return { message: 'Done', success: true, error: null }; + } catch (error) { + console.error('Error occurred:', error); + return { message: 'Error', success: false, error }; + } +} diff --git a/src/main/main.ts b/src/main/main.ts index 19f7133..89e01f4 100644 --- a/src/main/main.ts +++ b/src/main/main.ts @@ -26,6 +26,7 @@ import { import { liveSubDomains, screenwin } from './recon/httpx'; import { fetchJs, parameter, wwayback } from './recon/waybackurls'; import { returnFile } from './api/serve'; +import { findSecret, extraLinks } from './jsleak/jsleak'; class AppUpdater { constructor() { @@ -43,6 +44,16 @@ ipcMain.handle('api-call', async (event, args) => { return res; }); +ipcMain.handle('find-secrets', async (event, args) => { + const { projectName } = args[0]; + const res = findSecret(`${PROJECT_DIR}/${projectName}`); + return res; +}); +ipcMain.handle('extra-links', async (event, args) => { + const { projectName } = args[0]; + const res = extraLinks(`${PROJECT_DIR}/${projectName}`); + return res; +}); ipcMain.handle('subfinder-process', async (event, args) => { const { domain, projectName } = args[0]; const res = subFinder(domain, `${PROJECT_DIR}/${projectName}`); diff --git a/src/main/recon/httpx.ts b/src/main/recon/httpx.ts index 66fc18a..f8db5c8 100644 --- a/src/main/recon/httpx.ts +++ b/src/main/recon/httpx.ts @@ -35,7 +35,6 @@ export async function liveSubDomains(outputDir: string = PROJECT_DIR): Promise<{ return { message: 'Error', success: false, error }; } } -liveSubDomains(`${PROJECT_DIR}/kroking`); export async function screenwin(outputDir: string = PROJECT_DIR): Promise<{ message: string; success: boolean; From 8840bd263da19ab8a7afc3d6266e103f539cbcdf Mon Sep 17 00:00:00 2001 From: Haitham Mohamed Date: Sun, 14 Apr 2024 07:48:37 +0200 Subject: [PATCH 3/5] jsleak backend dev supports all platforms --- src/main/jsleak/jsleak.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/jsleak/jsleak.ts b/src/main/jsleak/jsleak.ts index 55c9df5..46f23b5 100644 --- a/src/main/jsleak/jsleak.ts +++ b/src/main/jsleak/jsleak.ts @@ -1,6 +1,6 @@ import { execSync } from 'child_process'; import path from 'path'; -import { toolPath } from '../util'; +import { CurrentOS, toolPath } from '../util'; import { PROJECT_DIR } from '../api/project'; import { connectJson } from '../db/connect'; import { countLines } from '../results/countResults'; @@ -10,8 +10,8 @@ export async function findSecret(outputDir: string = PROJECT_DIR): Promise<{ success: boolean; error: any; }> { - const jsleak = toolPath('jsleak_1.0.0_windows'); - const command = `type ${path.join(outputDir, 'httpx_live_domains.txt')} | ${jsleak} -s + const jsleak = toolPath('jsleak'); + const command = `${CurrentOS() === 'win32' ? 'type' : 'cat'} ${path.join(outputDir, 'httpx_live_domains.txt')} | ${jsleak} -s >> ${path.join(outputDir, 'secrets.txt')}`; try { execSync(command); From 2cd48e38679a0606211a9d2468d4020d419a8659 Mon Sep 17 00:00:00 2001 From: Haitham Mohamed Date: Sun, 14 Apr 2024 07:52:41 +0200 Subject: [PATCH 4/5] jsleak backend dev supports all platforms. --- src/main/jsleak/jsleak.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/jsleak/jsleak.ts b/src/main/jsleak/jsleak.ts index 46f23b5..2140c3c 100644 --- a/src/main/jsleak/jsleak.ts +++ b/src/main/jsleak/jsleak.ts @@ -37,8 +37,8 @@ export async function extraLinks(outputDir: string = PROJECT_DIR): Promise<{ success: boolean; error: any; }> { - const jsleak = toolPath('jsleak_1.0.0_windows'); - const command = `type ${path.join(outputDir, 'httpx_live_domains.txt')} | ${jsleak} -l | findstr ".js" + const jsleak = toolPath('jsleak'); + const command = `${CurrentOS() === 'win32' ? 'type' : 'cat'} ${path.join(outputDir, 'httpx_live_domains.txt')} | ${jsleak} -l | findstr ".js" >> ${path.join(outputDir, 'extra_links.txt')}`; try { execSync(command); From 2380120e78c8035413107fb387162c4b6e1acbc5 Mon Sep 17 00:00:00 2001 From: Yazan Essam Date: Sun, 14 Apr 2024 16:56:21 +0200 Subject: [PATCH 5/5] changes are done --- src/renderer/views/project/{JsLeaks.1.tsx => JsLeaks.tsx} | 0 .../{JsLeaks Jobs/EndPoints.tsx => jsLeaksJob/Endpoint.tsx} | 0 .../views/project/{JsLeaks Jobs => jsLeaksJob}/secrets.tsx | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename src/renderer/views/project/{JsLeaks.1.tsx => JsLeaks.tsx} (100%) rename src/renderer/views/project/{JsLeaks Jobs/EndPoints.tsx => jsLeaksJob/Endpoint.tsx} (100%) rename src/renderer/views/project/{JsLeaks Jobs => jsLeaksJob}/secrets.tsx (100%) diff --git a/src/renderer/views/project/JsLeaks.1.tsx b/src/renderer/views/project/JsLeaks.tsx similarity index 100% rename from src/renderer/views/project/JsLeaks.1.tsx rename to src/renderer/views/project/JsLeaks.tsx diff --git a/src/renderer/views/project/JsLeaks Jobs/EndPoints.tsx b/src/renderer/views/project/jsLeaksJob/Endpoint.tsx similarity index 100% rename from src/renderer/views/project/JsLeaks Jobs/EndPoints.tsx rename to src/renderer/views/project/jsLeaksJob/Endpoint.tsx diff --git a/src/renderer/views/project/JsLeaks Jobs/secrets.tsx b/src/renderer/views/project/jsLeaksJob/secrets.tsx similarity index 100% rename from src/renderer/views/project/JsLeaks Jobs/secrets.tsx rename to src/renderer/views/project/jsLeaksJob/secrets.tsx