Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 05b2a33

Browse files
committed
cosmetics
1 parent bff989d commit 05b2a33

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

lib/controller/controller.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from lib.controller.checks import heuristicCheckSqlInjection
2121
from lib.controller.checks import simpletonCheckSqlInjection
2222
from lib.core.agent import agent
23+
from lib.core.common import getFilteredPageContent
2324
from lib.core.common import getUnicode
2425
from lib.core.common import paramToDict
2526
from lib.core.common import parseTargetUrl
@@ -379,11 +380,16 @@ def start():
379380
if len(kb.injections) == 0 or (len(kb.injections) == 1 and kb.injections[0].place is None):
380381
if not conf.realTest:
381382
errMsg = "all parameters are not injectable, try "
382-
errMsg += "a higher --level/--risk and/or --text-only switch"
383+
errMsg += "a higher --level/--risk to use more tests"
384+
if not conf.textOnly and kb.originalPage:
385+
percent = (1.0 * len(kb.originalPage) / len(getFilteredPageContent(kb.originalPage)))
386+
errMsg += " and/or --text-only switch if the target page "
387+
errMsg += "has a low percentage of textual content "
388+
errMsg += "(%.2f%% of page content is text)" % percent
383389
raise sqlmapNotVulnerableException, errMsg
384390
else:
385391
errMsg = "it seems that all parameters are not injectable"
386-
raise sqlmapNotVulnerableException, errMsg
392+
raise sqlmapNotVulnerableException, errMsg
387393
else:
388394
# Flush the flag
389395
kb.testMode = False

0 commit comments

Comments
 (0)