Skip to content

Commit 193f819

Browse files
committed
Adding new warning message
1 parent b86b7c0 commit 193f819

1 file changed

Lines changed: 14 additions & 7 deletions

File tree

lib/utils/crawler.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from lib.core.common import clearConsoleLine
1616
from lib.core.common import dataToStdout
1717
from lib.core.common import findPageForms
18+
from lib.core.common import getSafeExString
1819
from lib.core.common import openFile
1920
from lib.core.common import readInput
2021
from lib.core.common import safeCSValue
@@ -127,20 +128,26 @@ def crawlThread():
127128
message += "site's sitemap(.xml) [y/N] "
128129
test = readInput(message, default="n")
129130
if test[0] in ("y", "Y"):
131+
found = True
130132
items = None
131133
url = urlparse.urljoin(target, "/sitemap.xml")
132134
try:
133135
items = parseSitemap(url)
136+
except SqlmapConnectionException, ex:
137+
if "page not found" in getSafeExString(ex):
138+
found = False
139+
logger.warn("'sitemap.xml' not found")
134140
except:
135141
pass
136142
finally:
137-
if items:
138-
for item in items:
139-
if re.search(r"(.*?)\?(.+)", item):
140-
threadData.shared.value.add(item)
141-
if conf.crawlDepth > 1:
142-
threadData.shared.unprocessed.update(items)
143-
logger.info("%s links found" % ("no" if not items else len(items)))
143+
if found:
144+
if items:
145+
for item in items:
146+
if re.search(r"(.*?)\?(.+)", item):
147+
threadData.shared.value.add(item)
148+
if conf.crawlDepth > 1:
149+
threadData.shared.unprocessed.update(items)
150+
logger.info("%s links found" % ("no" if not items else len(items)))
144151

145152
infoMsg = "starting crawler"
146153
if conf.bulkFile:

0 commit comments

Comments
 (0)