Skip to content

Commit

Permalink
Merge branch 'main' into haitham-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahmoudgalalz authored Apr 27, 2024
2 parents 6faafbd + d30b3e5 commit 38e3ac5
Show file tree
Hide file tree
Showing 14 changed files with 240 additions and 32 deletions.
2 changes: 2 additions & 0 deletions depScript.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ def extract_tar_archive(archive_file, extraction_path):
{"name": "httpx", "repo_owner": "projectdiscovery", "repo_name": "httpx"},
{"name": "waybackurls", "repo_owner": "tomnomnom", "repo_name": "waybackurls"},
{"name": "jsleak", "repo_owner": "0xHunterr", "repo_name": "jsleak"},
{"name": "dalfox", "repo_owner": "hahwul", "repo_name": "dalfox"},
{"name": "nuclei", "repo_owner": "projectdiscovery", "repo_name": "nuclei"},
# Add more tools as needed
]

Expand Down
2 changes: 1 addition & 1 deletion src/main/jsleak/jsleak.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export async function findSecret(outputDir: string = PROJECT_DIR): Promise<{
error: any;
}> {
const jsleak = toolPath('jsleak');
const command = `echo ${CurrentOS() === 'win32' ? 'type' : 'cat'} ${path.join(outputDir, 'httpx_live_domains.txt')} | ${jsleak} -s`;
const command = `${CurrentOS() === 'win32' ? 'type' : 'cat'} ${path.join(outputDir, 'httpx_live_domains.txt')} | ${jsleak} -s`;
try {
fs.writeFileSync(
`${path.join(outputDir, 'secrets.txt')}`,
Expand Down
2 changes: 1 addition & 1 deletion src/main/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +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';
import { extraLinks, findSecret } from './jsleak/jsleak';

class AppUpdater {
constructor() {
Expand Down
2 changes: 2 additions & 0 deletions src/main/preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ export type Channels =
| 'waybackurls-parameter'
| 'get-project-details'
| 'api-call'
| 'find-secrets'
| 'extra-links'
| 'open-link';

const electronHandler = {
Expand Down
3 changes: 2 additions & 1 deletion src/renderer/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ 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';
import Attacks from './views/project/attacks';

function Home() {
return (
Expand All @@ -31,7 +32,7 @@ export default function App() {
<Route path="recon" element={<Recon />} />
<Route path="result" element={<Results />} />
<Route path="result-recon" element={<ReconResults />} />
<Route path="attack" element={<Results />} />
<Route path="attacks" element={<Attacks />} />
<Route path="jsleaks" element={<JsLeaks />} />
</Route>
</Routes>
Expand Down
5 changes: 2 additions & 3 deletions src/renderer/components/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ const dashboardMenu: DashboardMenu[] = [
icon: <PocketKnife className="mr-2 h-4 w-4" />,
},
{
href: 'attack',
title: 'Attack',
Disabled: true,
href: 'attacks',
title: 'Attacks',
icon: <PocketKnife className="mr-2 h-4 w-4" />,
},
{
Expand Down
71 changes: 47 additions & 24 deletions src/renderer/views/project/JsLeaks.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* eslint-disable react/jsx-props-no-spreading */
/* eslint-disable react-hooks/exhaustive-deps */
import { useEffect, useState } from 'react';
import { useParams } from 'react-router-dom';
import {
Card,
CardContent,
Expand All @@ -7,35 +11,54 @@ import {
} from '../../components/ui/card';
import Secrets from './jsLeaksJob/secrets';
import EndPoints from './jsLeaksJob/Endpoint';
import { ProjectDetails } from '../../types';


export default function JsLeaks() {
const [details, setDetails] = useState<ProjectDetails>();
const { projectSlug } = useParams();

const getDetails = async () => {
const res = await window.electron.ipcRenderer.invoke(
'get-project-details',
projectSlug,
);
setDetails(res);
console.log(res);
};

useEffect(() => {
getDetails();
}, []);
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>
<h1 className="font-bold text-3xl">JsLeaks</h1>
{details && (
<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 {...details} />
</CardContent>
</Card>
<Card>
<CardHeader>
<CardTitle>Find EndPoints</CardTitle>
<CardDescription>
Unveiling extra and hidden endpoints
</CardDescription>
</CardHeader>
<CardContent className="flex justify-between">
<EndPoints {...details} />
</CardContent>
</Card>
</div>
</div>
</div>
)}
</div>
);
}
61 changes: 61 additions & 0 deletions src/renderer/views/project/attacks.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from '../../components/ui/card';
import Exposures from './attacks/exposures';
import MissingHeaders from './attacks/missingHeaders';
import PotentialXss from './attacks/potentialXss';
import SqlInjection from './attacks/sqlInjection';

export default function Attacks() {
return (
<div className="flex flex-col gap-4">
<h1 className="font-bold text-3xl">Attacks</h1>
<div>
<div className="grid grid-flow-row grid-cols-2 gap-4">
<Card>
<CardHeader>
<CardTitle>Scan for exposures</CardTitle>
<CardDescription>wanna find exposures ?</CardDescription>
</CardHeader>
<CardContent className="flex justify-between">
<Exposures />
</CardContent>
</Card>
<Card>
<CardHeader>
<CardTitle>Scan for missing headers</CardTitle>
<CardDescription>wanna find more ?</CardDescription>
</CardHeader>
<CardContent className="flex justify-between">
<MissingHeaders />
</CardContent>
</Card>
<Card>
<CardHeader>
<CardTitle>Scan the URLs</CardTitle>
<CardDescription>wanna catch potential XSS</CardDescription>
</CardHeader>
<CardContent className="flex justify-between">
<PotentialXss />
</CardContent>
</Card>
<Card>
<CardHeader>
<CardTitle>Scan for SQL Injection</CardTitle>
<CardDescription>
SSTI, Open Redirect & CRLF Injection
</CardDescription>
</CardHeader>
<CardContent className="flex justify-between">
<SqlInjection />
</CardContent>
</Card>
</div>
</div>
</div>
);
}
23 changes: 23 additions & 0 deletions src/renderer/views/project/attacks/exposures.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 Exposures() {
const [Loading, setLoading] = useState<boolean>(false);
const RunExposures = async () => {
setLoading(true);
};
return (
// eslint-disable-next-line react/jsx-no-useless-fragment
<>
{!Loading ? (
<Button onClick={RunExposures}>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/attacks/missingHeaders.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 MissingHeaders() {
const [Loading, setLoading] = useState<boolean>(false);
const RunMissingHeaders = async () => {
setLoading(true);
};
return (
// eslint-disable-next-line react/jsx-no-useless-fragment
<>
{!Loading ? (
<Button onClick={RunMissingHeaders}>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/attacks/potentialXss.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 PotentialXss() {
const [Loading, setLoading] = useState<boolean>(false);
const RunPotentialXss = async () => {
setLoading(true);
};
return (
// eslint-disable-next-line react/jsx-no-useless-fragment
<>
{!Loading ? (
<Button onClick={RunPotentialXss}>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/attacks/sqlInjection.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 SqlInjection() {
const [Loading, setLoading] = useState<boolean>(false);
const RunSqlInjection = async () => {
setLoading(true);
};
return (
// eslint-disable-next-line react/jsx-no-useless-fragment
<>
{!Loading ? (
<Button onClick={RunSqlInjection}>Process</Button>
) : (
<Button disabled>
<Loader2 className="mr-2 h-4 w-4 animate-spin" />
Please wait
</Button>
)}
</>
);
}
17 changes: 16 additions & 1 deletion src/renderer/views/project/jsLeaksJob/Endpoint.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
import { Loader2 } from 'lucide-react';
import { useState } from 'react';
import { Button } from '../../../components/ui/button';
import { useToast } from '../../../components/ui/use-toast';
import { ProjectDetails } from '../../../types';

export default function EndPoints() {
export default function EndPoints(details: ProjectDetails) {
const { name } = details;
const [Loading, setLoading] = useState<boolean>(false);
const { toast } = useToast();
const RunEndPoints = async () => {
setLoading(true);
if (details) {
const res = await window.electron.ipcRenderer.invoke('extra-links', {
projectName: name,
});
if (res) {
toast({
title: 'Endpoints are ready',
});
}
}
setLoading(false);
};
return (
// eslint-disable-next-line react/jsx-no-useless-fragment
Expand Down
15 changes: 14 additions & 1 deletion src/renderer/views/project/jsLeaksJob/secrets.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
import { Loader2 } from 'lucide-react';
import { useState } from 'react';
import { Button } from '../../../components/ui/button';
import { useToast } from '../../../components/ui/use-toast';
import { ProjectDetails } from '../../../types';

export default function Secrets() {
export default function Secrets(details: ProjectDetails) {
const { name } = details;
const [Loading, setLoading] = useState<boolean>(false);
const { toast } = useToast();
const RunSecrets = async () => {
setLoading(true);
const res = await window.electron.ipcRenderer.invoke('find-secrets', {
projectName: name,
});
if (res) {
toast({
title: 'your Secrets are ready',
});
}
setLoading(false);
};
return (
// eslint-disable-next-line react/jsx-no-useless-fragment
Expand Down

0 comments on commit 38e3ac5

Please sign in to comment.