diff options
Diffstat (limited to 'checker/src')
| -rw-r--r-- | checker/src/checker.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/checker/src/checker.py b/checker/src/checker.py index 23f1bfd..9d9124a 100644 --- a/checker/src/checker.py +++ b/checker/src/checker.py @@ -144,20 +144,18 @@ class STLDoctorChecker(BaseChecker): def getfile(self, conn, modelname): modelname = ensure_bytes(modelname) - if modelname != "": - self.debug(f"Sending command to retrieve file with name '{modelname}'") - self.write(conn, "search\n") - self.write(conn, modelname + b"\n") - self.write(conn, "0\n") # first result - self.write(conn, "y\n") # yes download - else: - self.debug(f"Sending command to retrieve file") - self.write(conn, f"search\n0\ny\n") + self.debug(f"Sending command to retrieve file with name {modelname}") + self.write(conn, "search\n") + self.write(conn, modelname + b"\n") + self.write(conn, "0\n") # first result + self.write(conn, "y\n") # yes download resp = conn.recvuntil(b"Here you go.. (") + print(resp) try: size = int(conn.recvuntil(b"B)\n")[:-3]) except: + print("GOT INSTEAD:", conn.recvall(timeout=0)) raise BrokenServiceException("Returned file content size for download is not a valid integer") print("FILE SIZE:", size) @@ -216,10 +214,12 @@ class STLDoctorChecker(BaseChecker): self.closeconn(conn) def openconn(self): - import pwnlib - self.debug("Connecting to service") + import pwnlib.tubes.remote + self.debug(f"Connecting to service at {self.address}:{self.port}") conn = pwnlib.tubes.remote.remote(self.address, self.port, timeout = self.timeout) - conn.recvuntil("$") # ignore welcome + resp = conn.recvuntil("$") # ignore welcome + if self.debuglog: + print("WELCOME:",resp) return conn def closeconn(self, conn): |
