Skip to content

Commit

Permalink
Merge branch 'hunters-org:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
0xHunterr authored Apr 23, 2024
2 parents 5aee675 + 8ac984c commit d02e037
Show file tree
Hide file tree
Showing 9 changed files with 170 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/main/db/connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ export interface ProjectDetails {
domain: string;
subfinder?: JobDetails;
screens?: JobDetails;
extraLinks?: JobDetails;
findSecrets?: JobDetails;
params?: JobDetails;
liveDomains?: JobDetails;
archive?: JobDetails;
Expand Down
62 changes: 62 additions & 0 deletions src/main/jsleak/jsleak.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import { execSync } from 'child_process';
import path from 'path';
import { CurrentOS, 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');
const command = `${CurrentOS() === 'win32' ? 'type' : 'cat'} ${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');
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);
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 };
}
}
11 changes: 11 additions & 0 deletions src/main/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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}`);
Expand Down
1 change: 0 additions & 1 deletion src/main/recon/httpx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions src/renderer/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -31,6 +32,7 @@ export default function App() {
<Route path="result" element={<Results />} />
<Route path="result-recon" element={<ReconResults />} />
<Route path="attack" element={<Results />} />
<Route path="jsleaks" element={<JsLeaks />} />
</Route>
</Routes>
</Router>
Expand Down
6 changes: 6 additions & 0 deletions src/renderer/components/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ const dashboardMenu: DashboardMenu[] = [
Disabled: true,
icon: <LayoutDashboardIcon className="mr-2 h-4 w-4" />,
},

{
href: 'jsleaks',
title: 'JsLeaks',
icon: <LayoutDashboardIcon className="mr-2 h-4 w-4" />,
},
];

const resultArch: DashboardMenu[] = [
Expand Down
41 changes: 41 additions & 0 deletions src/renderer/views/project/JsLeaks.tsx
Original file line number Diff line number Diff line change
@@ -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 (
<div className="flex flex-col gap-4">
<h1 className="font-bold text-3xl">Initiate Recon Attacks</h1>
<div>
<div className="grid grid-flow-row grid-cols-2 gap-4">
<Card>
<CardHeader>
<CardTitle>Find Secrets</CardTitle>
<CardDescription>wanna find secrets ?</CardDescription>
</CardHeader>
<CardContent className="flex justify-between">
<Secrets />
</CardContent>
</Card>
<Card>
<CardHeader>
<CardTitle>Find EndPoints</CardTitle>
<CardDescription>
Unveiling extra and hidden endpoints
</CardDescription>
</CardHeader>
<CardContent className="flex justify-between">
<EndPoints />
</CardContent>
</Card>
</div>
</div>
</div>
);
}
23 changes: 23 additions & 0 deletions src/renderer/views/project/jsLeaksJob/Endpoint.tsx
Original file line number Diff line number Diff line change
@@ -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<boolean>(false);
const RunEndPoints = async () => {
setLoading(true);
};
return (
// eslint-disable-next-line react/jsx-no-useless-fragment
<>
{!Loading ? (
<Button onClick={RunEndPoints}>Process</Button>
) : (
<Button disabled>
<Loader2 className="mr-2 h-4 w-4 animate-spin" />
Please wait
</Button>
)}
</>
);
}
23 changes: 23 additions & 0 deletions src/renderer/views/project/jsLeaksJob/secrets.tsx
Original file line number Diff line number Diff line change
@@ -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<boolean>(false);
const RunSecrets = async () => {
setLoading(true);
};
return (
// eslint-disable-next-line react/jsx-no-useless-fragment
<>
{!Loading ? (
<Button onClick={RunSecrets}>Process</Button>
) : (
<Button disabled>
<Loader2 className="mr-2 h-4 w-4 animate-spin" />
Please wait
</Button>
)}
</>
);
}

0 comments on commit d02e037

Please sign in to comment.