Skip to content

Commit

Permalink
Add the strip to parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
shenril committed Aug 28, 2019
1 parent 9c6bf24 commit af441f6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions lib/modules/attacks/bruteforce/bdir.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ def check_url(self, url):
def process(self, start_url, crawled_urls):
self.output.info("Checking common backup dirs..")
db = self.datastore.open("bdir.txt", "r")
backupdir = [x for x in db.readlines()]
backupdir = [x.strip() for x in db.readlines()]
db1 = self.datastore.open("cdir.txt", "r")
commondir = [x for x in db1.readlines()]
commondir = [x.strip() for x in db1.readlines()]

urls = []
for d in commondir:
for b in backupdir:
bdir = b.replace("[name]", d.strip())
bdir = b.replace("[name]", d)
urls.append(urljoin(str(start_url), str(bdir)))
# We launch ThreadPoolExecutor with max_workers to None to get default optimization
# https://docs.python.org/3/library/concurrent.futures.html
Expand Down
6 changes: 3 additions & 3 deletions lib/modules/attacks/bruteforce/bfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ def check_url(self, url):
def process(self, start_url, crawled_urls):
self.output.info("Checking common backup files..")
db = self.datastore.open("bfile.txt", "r")
dbfiles = [x for x in db.readlines()]
dbfiles = [x.strip() for x in db.readlines()]
db1 = self.datastore.open("cfile.txt", "r")
dbfiles1 = [x for x in db1.readlines()]
dbfiles1 = [x.strip() for x in db1.readlines()]
urls = []
for b in dbfiles:
for d in dbfiles1:
bdir = b.replace("[name]", d.strip())
bdir = b.replace("[name]", d)
urls.append(urljoin(str(start_url), str(bdir)))
# We launch ThreadPoolExecutor with max_workers to None to get default optimization
# https://docs.python.org/3/library/concurrent.futures.html
Expand Down

0 comments on commit af441f6

Please sign in to comment.