Skip to content

Commit

Permalink
webapp: use sendline in template
Browse files Browse the repository at this point in the history
  • Loading branch information
aiooss-anssi committed Feb 19, 2024
1 parent e8380eb commit 22dcc68
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions webapp/templates/raw-replay.py.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,15 @@ r = remote(HOST, {{ data.port }}, typ="{{ data.proto | lower }}", timeout=2)
# payload. If it is the case, then you should loop using EXTRA.
# for flag_id in EXTRA:
{%- for payload, server_to_client in data.raw_data %}
{%- if server_to_client == 0 %}
{%- if server_to_client == 0 %}
{%- if payload and payload[-1] == 10 %}
r.sendline({{ payload[:-1] | safe }})
{%- else %}
r.send({{ payload | safe }})
{%- else %}
{%- endif %}
{%- else %}
data = r.recvuntil({{ payload[-16:] | safe }})
{%- endif %}
{%- endif %}
{%- endfor %}

# Use the following to capture all remaining bytes:
Expand Down

0 comments on commit 22dcc68

Please sign in to comment.