16 lines
450 B
Python
16 lines
450 B
Python
#!/usr/bin/env python3
|
|
path = "/var/www/html/weval-technology-platform.html"
|
|
with open(path, "rb") as f:
|
|
raw = f.read()
|
|
|
|
if b"v72-drilldown-universal.js" in raw:
|
|
print("ALREADY_INJECTED")
|
|
exit(0)
|
|
|
|
marker = b"</body>"
|
|
inject = b'<script src="/api/v72-drilldown-universal.js" defer></script>\n</body>'
|
|
new_raw = raw.replace(marker, inject, 1)
|
|
with open(path, "wb") as f:
|
|
f.write(new_raw)
|
|
print(f"INJECTED {len(raw)} -> {len(new_raw)}")
|