Skip to content

Commit 95d3813

Browse files
committed
1.4.5 added OpenAttackDefenseTools/ataka template
1 parent 15f1ba3 commit 95d3813

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "vagd"
3-
version = "1.4.4"
3+
version = "1.4.5"
44
authors = [{ name = "0x6fe1be2" }]
55
description = "VirtuAlization GDb integrations in pwntools"
66
readme = "README.md"

src/vagd/cli.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ def template(
119119
local: Optional[bool] = typer.Option(
120120
False, "--local", help="create local template"
121121
),
122+
ataka: Optional[bool] = typer.Option(
123+
False, "--ataka", help="create an ataka compatible template"
124+
),
122125
):
123126
"""
124127
creates a template
@@ -189,16 +192,20 @@ def template(
189192

190193
template = "".join(templateChunks).format(
191194
"{}",
195+
dependencies=", ".join(dependencies),
192196
aliases=aliases,
193197
binary=binary,
194198
ip=ip,
195199
port=str(port),
196200
env=env,
201+
ataka_env="# ataka envs\nIP = os.getenv('TARGET_IP', IP)\nEXTRA = json.loads(os.getenv('TARGET_EXTRA', '[]'))"
202+
if ataka
203+
else "",
204+
vms=("\n" + " " * 4).join(vms),
197205
libc=libc,
198206
aslr=aslr,
199207
is_local=True if local else "args.LOCAL",
200-
dependencies=", ".join(dependencies),
201-
vms=("\n" + " " * 4).join(vms),
208+
is_ataka=" or os.getenv('TARGET_IP')" if ataka else "",
202209
)
203210

204211
if output_exploit:

src/vagd/res/template.txt

+4-2
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@ c"""
1515
context.binary = exe = ELF(BINARY, checksec=False)
1616
context.aslr = {aslr}
1717

18+
{ataka_env}
19+
1820
{aliases}
1921

2022
def setup():
2123
global vm
22-
if args.REMOTE or {is_local}:
24+
if args.REMOTE or {is_local}{is_ataka}:
2325
return
2426

2527
try:
@@ -34,7 +36,7 @@ def setup():
3436

3537
vm = None
3638
def get_target(**kw) -> tubes.tube:
37-
if args.REMOTE:
39+
if args.REMOTE{is_ataka}:
3840
# context.log_level = 'debug'
3941
return remote(IP, PORT)
4042

0 commit comments

Comments
 (0)