~heckyel/pwndbtorcredentials

13559f14d66dc2be990610fec3221a1955063173 — Josue 4 years ago 98d9596
Now re.findall is used

1 files changed, 8 insertions(+), 11 deletions(-)

M pwndb_credentials.py
M pwndb_credentials.py => pwndb_credentials.py +8 -11
@@ 36,19 36,16 @@ class FindPasswords():

    def request_data(self):
        result = []
        if self.session is None:
            return []
        try:
        if self.session is not None:
            response = self.session.post(self.url, data=self.data, timeout=5)
            soup = soup = BeautifulSoup(response.text, features="html.parser")
            passwords = soup.find("pre").get_text()
            if passwords:
                i = 0
                for line in passwords.split("\n"):
                    if "[password]" in line:
            if response.status_code == 200:
                soup = BeautifulSoup(response.text, features="html.parser")
                try:
                    passwords = soup.find("pre").get_text()
                    for line in re.findall("\[password\] => .*", passwords):
                        result.append(line.split("=> ")[1])
        except Exception as e:
            print(e)
                except Exception as e:
                    print(e)

        return result