Skip to content

Commit 13e19bf

Browse files
committed
merge development
2 parents 4010602 + 22101dd commit 13e19bf

6 files changed

Lines changed: 22 additions & 4 deletions

File tree

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
cpython@3.12

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,15 @@ Please take a look at our documentation for how to install and use attackmate:
4545
* [Documentation](https://ait-testbed.github.io/attackmate/main/index.html)
4646
* [Command Reference](https://ait-testbed.github.io/attackmate/main/playbook/commands/index.html)
4747
* [Example Playbooks](https://ait-testbed.github.io/attackmate/main/playbook/examples.html)
48+
* [Arxiv Paper](https://arxiv.org/pdf/2601.14108)
4849

4950
## Contribution
5051

5152
We're happily taking patches and other contributions. Please see the following links for how to get started:
5253

5354
- [Contribution Guide](https://ait-testbed.github.io/attackmate/main/developing/contribution.html)
5455

56+
5557
## Disclaimer
5658

5759
AttackMate is purely for educational and academic purposes. The software is provided "as is"

docs/source/playbook/commands/webserv.rst

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ webserv
33
=======
44

55
Start a http-server and share a file. This command
6-
will return after the first HTTP-request.
7-
6+
will return after the first HTTP-request. To keep serving the file instead set keep_serving to True.
7+
The webserv command has to be run in background mode, otherwise the playbook execution will halt until a request is received.
88
.. code-block:: yaml
99
1010
###
@@ -35,3 +35,10 @@ will return after the first HTTP-request.
3535

3636
:type: str
3737
:default: ``0.0.0.0``
38+
39+
.. confval:: keep_servng
40+
41+
Keep serving even after a request has been processed
42+
43+
:type: bool
44+
:default: False

src/attackmate/executors/http/webservexecutor.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,14 @@ def _exec_cmd(self, command: WebServCommand) -> Result:
6161
address = (command.address, CmdVars.variable_to_int('Port', command.port))
6262
try:
6363
server = WebServe(address, WebRequestHandler, local_path=command.local_path)
64-
server.handle_request()
64+
if command.keep_serving:
65+
self.logger.info('Keeping server alive to serve multiple requests')
66+
try:
67+
server.serve_forever()
68+
except KeyboardInterrupt:
69+
server.server_close()
70+
else:
71+
server.handle_request()
6572
except Exception as e:
6673
raise ExecException(e)
6774

src/attackmate/schemas/http.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ class WebServCommand(BaseCommand):
1010
local_path: str
1111
port: StringNumber = '8000'
1212
address: str = '0.0.0.0' # nosec
13+
keep_serving: bool = False
1314

1415

1516
@CommandRegistry.register('http-client')

test/units/test_browserexecutor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ def test_browser_executor_named_session(browser_executor):
193193
reuse_cmd = BrowserCommand(
194194
type='browser',
195195
cmd='click',
196-
selector='#test-link', # matches the anchor in DATA_URL_WITH_LINK
196+
selector='a[href="http://www.iana.org/domains/example"]',
197197
session='my_session'
198198
)
199199
result2 = browser_executor._exec_cmd(reuse_cmd)

0 commit comments

Comments
 (0)