schoolkithub commited on
Commit
8f0cfd4
·
verified ·
1 Parent(s): f687dd5

Update blackgat/app/main.py

Browse files
Files changed (1) hide show
  1. blackgat/app/main.py +49 -21
blackgat/app/main.py CHANGED
@@ -1,29 +1,57 @@
1
- from fastapi import FastAPI, Request
2
- from app.ai_modules import heatseeker_score, scribe_generate, killchain_ai, recon_gpt, exploit_suggestion
 
 
 
 
 
 
 
3
 
4
- app = FastAPI()
 
 
 
 
5
 
6
- @app.post("/score")
7
- async def score(request: Request):
8
- data = await request.json()
9
- return heatseeker_score(data)
 
 
 
 
 
 
 
 
 
 
 
 
 
10
 
11
- @app.post("/report")
12
- async def report(request: Request):
13
- data = await request.json()
14
- return scribe_generate(data)
15
 
16
- @app.post("/chain")
17
- async def chain(request: Request):
18
- data = await request.json()
19
- return killchain_ai(data)
 
 
 
 
 
 
 
 
20
 
21
  @app.post("/recon")
22
- async def recon(request: Request):
23
- data = await request.json()
24
- return recon_gpt(data["prompt"])
25
 
26
  @app.post("/exploit")
27
- async def exploit(request: Request):
28
- data = await request.json()
29
- return exploit_suggestion(data)
 
1
+ # main.py
2
+ from fastapi import FastAPI
3
+ from pydantic import BaseModel
4
+ from typing import Dict
5
+ from ai_models import (
6
+ scribe_generate, killchain_ai,
7
+ heatseeker_score, recon_gpt,
8
+ exploit_suggestion
9
+ )
10
 
11
+ app = FastAPI(
12
+ title="BlackGat AI",
13
+ description="Cloud-based AI for bug bounty automation",
14
+ version="1.0.0"
15
+ )
16
 
17
+ # Models
18
+ class VulnReport(BaseModel):
19
+ type: str
20
+ url: str
21
+ payload: str
22
+ impact: str
23
+
24
+ class Finding(BaseModel):
25
+ data: str
26
+
27
+ class ExploitRequest(BaseModel):
28
+ data: str
29
+
30
+ class HeatInput(BaseModel):
31
+ url: str
32
+ params: Dict[str, str]
33
+ status_code: int
34
 
35
+ class ReconPrompt(BaseModel):
36
+ prompt: str
 
 
37
 
38
+ # API Routes
39
+ @app.post("/scribe")
40
+ def scribe(data: VulnReport):
41
+ return scribe_generate(data.dict())
42
+
43
+ @app.post("/killchain")
44
+ def killchain(data: Finding):
45
+ return killchain_ai(data.data)
46
+
47
+ @app.post("/score")
48
+ def score(data: HeatInput):
49
+ return heatseeker_score(data.dict())
50
 
51
  @app.post("/recon")
52
+ def recon(data: ReconPrompt):
53
+ return recon_gpt(data.prompt)
 
54
 
55
  @app.post("/exploit")
56
+ def exploit(data: ExploitRequest):
57
+ return exploit_suggestion(data.data)