Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled exception (#44440a38) #5863

Open
sqlmapreporter opened this issue Feb 27, 2025 · 2 comments
Open

Unhandled exception (#44440a38) #5863

sqlmapreporter opened this issue Feb 27, 2025 · 2 comments

Comments

@sqlmapreporter
Copy link

Running version: 1.9.2.15#dev
Python version: 3.9.13
Operating system: Windows-10-10.0.26100-SP0
Command line: sqlmap.py --output-dir=E:\SQL\SQL\Logs -u ********************************************************************************************************************************************************************************************************************************************************* -p page --time-sec=32 --timeout=360 --random-agent --dbms=MySQL --risk=3 --level=5 --prefix= --dbs
Technique: UNION
Back-end DBMS: MySQL (identified)
Traceback (most recent call last):
  File "sqlmap.py", line 222, in main
    start()
  File "lib/core/decorators.py", line 80, in _
    result = f(*args, **kwargs)
  File "lib/controller/controller.py", line 607, in start
    injection = checkSqlInjection(place, parameter, value)
  File "lib/controller/checks.py", line 713, in checkSqlInjection
    reqPayload, vector = unionTest(comment, place, parameter, value, prefix, suffix)
  File "lib/core/decorators.py", line 80, in _
    result = f(*args, **kwargs)
  File "lib/techniques/union/test.py", line 392, in unionTest
    validPayload, vector = _unionTestByCharBruteforce(comment, place, parameter, value, prefix, suffix)
  File "lib/techniques/union/test.py", line 326, in _unionTestByCharBruteforce
    count = _findUnionCharCount(comment, place, parameter, value, prefix, suffix, where)
  File "lib/techniques/union/test.py", line 130, in _findUnionCharCount
    ratio = comparison(page, headers, code, getRatioValue=True) or MIN_RATIO
  File "lib/request/comparison.py", line 38, in comparison
    _ = _adjust(_comparison(page, headers, code, getRatioValue, pageLength), getRatioValue)
  File "lib/request/comparison.py", line 166, in _comparison
    ratio = round(seqMatcher.quick_ratio() if not kb.heavilyDynamic else seqMatcher.ratio(), 3)
  File "C:/Python3/lib/difflib.py", line 643, in quick_ratio
    numb = avail[elt]
TypeError: unsupported operand type(s) for +: 'dict' and 'str'
@Utkarsh-Karambhe
Copy link

I encountered a TypeError while running sqlmap.py, which seems to originate from an operation in difflib.py where a dictionary type is being added to a string. Here’s the relevant part of the traceback:
TypeError: unsupported operand type(s) for +: 'dict' and 'str'
This error occurs when the code attempts to perform an addition operation between incompatible types. It appears that the error may be occurring in the _comparison function, specifically at line 643, where a quick ratio calculation is performed.
To address this, it would be helpful to review the types of the variables involved in that addition. We should ensure that both operands are either strings or are converted appropriately before performing the operation.
If someone is already working on a fix or if there are any pointers on handling this, I’d be glad to help!
Thank you!

@sqlmapreporter
Copy link
Author

sqlmapreporter commented Mar 1, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants