eva-exploit 3.3.4__tar.gz → 3.3.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {eva_exploit-3.3.4 → eva_exploit-3.3.6}/PKG-INFO +1 -1
- {eva_exploit-3.3.4 → eva_exploit-3.3.6}/config.py +1 -1
- {eva_exploit-3.3.4 → eva_exploit-3.3.6}/eva_exploit.egg-info/PKG-INFO +1 -1
- {eva_exploit-3.3.4 → eva_exploit-3.3.6}/modules/llm.py +43 -93
- {eva_exploit-3.3.4 → eva_exploit-3.3.6}/pyproject.toml +1 -1
- {eva_exploit-3.3.4 → eva_exploit-3.3.6}/utils/system.py +1 -1
- {eva_exploit-3.3.4 → eva_exploit-3.3.6}/README.md +0 -0
- {eva_exploit-3.3.4 → eva_exploit-3.3.6}/eva.py +0 -0
- {eva_exploit-3.3.4 → eva_exploit-3.3.6}/eva_exploit.egg-info/SOURCES.txt +0 -0
- {eva_exploit-3.3.4 → eva_exploit-3.3.6}/eva_exploit.egg-info/dependency_links.txt +0 -0
- {eva_exploit-3.3.4 → eva_exploit-3.3.6}/eva_exploit.egg-info/entry_points.txt +0 -0
- {eva_exploit-3.3.4 → eva_exploit-3.3.6}/eva_exploit.egg-info/requires.txt +0 -0
- {eva_exploit-3.3.4 → eva_exploit-3.3.6}/eva_exploit.egg-info/top_level.txt +0 -0
- {eva_exploit-3.3.4 → eva_exploit-3.3.6}/modules/__init__.py +0 -0
- {eva_exploit-3.3.4 → eva_exploit-3.3.6}/modules/attack_map.py +0 -0
- {eva_exploit-3.3.4 → eva_exploit-3.3.6}/modules/exploit_search.py +0 -0
- {eva_exploit-3.3.4 → eva_exploit-3.3.6}/modules/prompt_builder.py +0 -0
- {eva_exploit-3.3.4 → eva_exploit-3.3.6}/modules/reporting.py +0 -0
- {eva_exploit-3.3.4 → eva_exploit-3.3.6}/modules/tooling.py +0 -0
- {eva_exploit-3.3.4 → eva_exploit-3.3.6}/modules/vuln_intel.py +0 -0
- {eva_exploit-3.3.4 → eva_exploit-3.3.6}/modules/workflow.py +0 -0
- {eva_exploit-3.3.4 → eva_exploit-3.3.6}/sessions/__init__.py +0 -0
- {eva_exploit-3.3.4 → eva_exploit-3.3.6}/sessions/eva_session.py +0 -0
- {eva_exploit-3.3.4 → eva_exploit-3.3.6}/setup.cfg +0 -0
- {eva_exploit-3.3.4 → eva_exploit-3.3.6}/utils/__init__.py +0 -0
- {eva_exploit-3.3.4 → eva_exploit-3.3.6}/utils/ui.py +0 -0
|
@@ -38,6 +38,9 @@ OLLAMA_HISTORY_LIMIT = 6
|
|
|
38
38
|
LAST_OUTPUT_PROMPT_MAX_CHARS = 2200
|
|
39
39
|
LAST_OUTPUT_CHUNK_TRIGGER = 5000
|
|
40
40
|
LAST_OUTPUT_CHUNK_SIZE = 2800
|
|
41
|
+
OLLAMA_HTTP_CONNECT_TIMEOUT = 5
|
|
42
|
+
OLLAMA_HTTP_READ_TIMEOUT = 240
|
|
43
|
+
OLLAMA_RUN_TIMEOUT = 240
|
|
41
44
|
STREAM_HIDE_MARKERS = [
|
|
42
45
|
"[:::] analysis_output:",
|
|
43
46
|
"output valid json only",
|
|
@@ -332,109 +335,56 @@ def _stream_visible_fragment(text, pending, suppress_output):
|
|
|
332
335
|
|
|
333
336
|
|
|
334
337
|
def _ollama_chat(messages, on_stream_start=None):
|
|
335
|
-
def _extract_chunk_text(item):
|
|
336
|
-
if isinstance(item, dict):
|
|
337
|
-
return item.get("message", {}).get("content", "") or item.get("response", "")
|
|
338
|
-
message = getattr(item, "message", None)
|
|
339
|
-
if message is not None:
|
|
340
|
-
return getattr(message, "content", "") or ""
|
|
341
|
-
return getattr(item, "response", "") or ""
|
|
342
|
-
|
|
343
338
|
def _ollama_run_stream_fallback(prompt):
|
|
344
|
-
proc = subprocess.Popen(
|
|
345
|
-
["ollama", "run", OLLAMA_MODEL],
|
|
346
|
-
stdin=subprocess.PIPE,
|
|
347
|
-
stdout=subprocess.PIPE,
|
|
348
|
-
stderr=subprocess.STDOUT,
|
|
349
|
-
text=True,
|
|
350
|
-
bufsize=1,
|
|
351
|
-
)
|
|
352
|
-
collected = []
|
|
353
|
-
started = False
|
|
354
339
|
try:
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
collected.append(ch)
|
|
340
|
+
proc = subprocess.run(
|
|
341
|
+
["ollama", "run", OLLAMA_MODEL],
|
|
342
|
+
input=prompt,
|
|
343
|
+
text=True,
|
|
344
|
+
capture_output=True,
|
|
345
|
+
timeout=OLLAMA_RUN_TIMEOUT,
|
|
346
|
+
)
|
|
347
|
+
raw = proc.stdout or proc.stderr or ""
|
|
348
|
+
if raw and on_stream_start:
|
|
349
|
+
on_stream_start()
|
|
350
|
+
return raw, False
|
|
351
|
+
except subprocess.TimeoutExpired:
|
|
352
|
+
return "", False
|
|
369
353
|
except KeyboardInterrupt:
|
|
370
|
-
proc.terminate()
|
|
371
354
|
raise
|
|
372
|
-
|
|
373
|
-
try:
|
|
374
|
-
proc.wait(timeout=5)
|
|
375
|
-
except subprocess.TimeoutExpired:
|
|
376
|
-
proc.kill()
|
|
377
|
-
proc.wait(timeout=2)
|
|
378
|
-
return "".join(collected), False
|
|
379
|
-
|
|
355
|
+
payload = {"model": OLLAMA_MODEL, "messages": messages, "stream": False}
|
|
380
356
|
try:
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
messages=messages,
|
|
386
|
-
stream=True,
|
|
357
|
+
r = requests.post(
|
|
358
|
+
"http://127.0.0.1:11434/api/chat",
|
|
359
|
+
json=payload,
|
|
360
|
+
timeout=(OLLAMA_HTTP_CONNECT_TIMEOUT, OLLAMA_HTTP_READ_TIMEOUT),
|
|
387
361
|
)
|
|
362
|
+
r.raise_for_status()
|
|
363
|
+
data = r.json()
|
|
364
|
+
raw = data.get("message", {}).get("content", "") or data.get("response", "")
|
|
365
|
+
if raw and on_stream_start:
|
|
366
|
+
on_stream_start()
|
|
367
|
+
if raw:
|
|
368
|
+
return raw, False
|
|
369
|
+
except (requests.RequestException, json.JSONDecodeError):
|
|
370
|
+
pass
|
|
388
371
|
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
for item in stream:
|
|
392
|
-
if not started and on_stream_start:
|
|
393
|
-
on_stream_start()
|
|
394
|
-
started = True
|
|
395
|
-
text = _extract_chunk_text(item)
|
|
396
|
-
if text:
|
|
397
|
-
chunks.append(text)
|
|
398
|
-
return "".join(chunks), False
|
|
399
|
-
except Exception:
|
|
400
|
-
payload = {"model": OLLAMA_MODEL, "messages": messages, "stream": True}
|
|
401
|
-
try:
|
|
402
|
-
r = requests.post(
|
|
403
|
-
"http://127.0.0.1:11434/api/chat",
|
|
404
|
-
json=payload,
|
|
405
|
-
timeout=(5, 20),
|
|
406
|
-
stream=True,
|
|
407
|
-
)
|
|
408
|
-
r.raise_for_status()
|
|
409
|
-
chunks = []
|
|
410
|
-
started = False
|
|
411
|
-
for line in r.iter_lines(decode_unicode=True):
|
|
412
|
-
if not line:
|
|
413
|
-
continue
|
|
414
|
-
data = json.loads(line)
|
|
415
|
-
if not started and on_stream_start:
|
|
416
|
-
on_stream_start()
|
|
417
|
-
started = True
|
|
418
|
-
chunk = data.get("message", {}).get("content", "") or data.get("response", "")
|
|
419
|
-
if chunk:
|
|
420
|
-
chunks.append(chunk)
|
|
421
|
-
if chunks:
|
|
422
|
-
return "".join(chunks), False
|
|
423
|
-
prompt = messages[-1].get("content", "") if messages else ""
|
|
424
|
-
return _ollama_run_stream_fallback(prompt)
|
|
425
|
-
except (requests.RequestException, json.JSONDecodeError):
|
|
426
|
-
prompt = messages[-1].get("content", "") if messages else ""
|
|
427
|
-
return _ollama_run_stream_fallback(prompt)
|
|
372
|
+
prompt = messages[-1].get("content", "") if messages else ""
|
|
373
|
+
return _ollama_run_stream_fallback(prompt)
|
|
428
374
|
|
|
429
375
|
|
|
430
376
|
def _ollama_run_fallback(prompt):
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
377
|
+
try:
|
|
378
|
+
p = subprocess.run(
|
|
379
|
+
["ollama", "run", OLLAMA_MODEL],
|
|
380
|
+
input=prompt,
|
|
381
|
+
text=True,
|
|
382
|
+
capture_output=True,
|
|
383
|
+
timeout=OLLAMA_RUN_TIMEOUT,
|
|
384
|
+
)
|
|
385
|
+
return p.stdout
|
|
386
|
+
except subprocess.TimeoutExpired:
|
|
387
|
+
return ""
|
|
438
388
|
|
|
439
389
|
|
|
440
390
|
def _query_g4f(history):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|