attackstr 0.2.0

Grammar-based security payload generation — TOML-driven, composable, encoding-aware
Documentation
1
2
3
4
5
6
7
8
9
10
11
import re

with open("src/adversarial_tests.rs", "r") as f:
    content = f.read()

content = content.replace(
'''            if template.contains('{') && !template[template.find('{')..].contains('}') {''',
'''            if template.contains('{') && !template[template.find('{').unwrap()..].contains('}') {''')

with open("src/adversarial_tests.rs", "w") as f:
    f.write(content)