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

TypeError: string indices must be integers #8

Open
lengjibo opened this issue Dec 18, 2020 · 7 comments
Open

TypeError: string indices must be integers #8

lengjibo opened this issue Dec 18, 2020 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@lengjibo
Copy link

TypeError: string indices must be integers

截图_2020-12-18_10-37-11

@ghost
Copy link

ghost commented Jan 13, 2021

same error. Any solutions?

@merlin123h
Copy link

Hi.
This error happened to me with the same text and information. Does anyone know a solution?

@Ziconius Ziconius self-assigned this Feb 8, 2021
@Ziconius Ziconius added the bug Something isn't working label Feb 8, 2021
@Ziconius
Copy link
Owner

Ziconius commented Feb 8, 2021

Looking into the issue I've found the issue. Should have a fix being pushed shortly - sorry for the delay

@cryptic-hunter
Copy link

cryptic-hunter commented Jul 31, 2021

Was this issue solved and the updated code pushed to the git repo?
I am facing the same issue though I have the latest repo installed.

image

@markfilan
Copy link

TypeError: means that you are trying to perform an operation on a value whose type is not compatible with that operation. An Iterable is a collection of elements that can be accessed sequentially . In Python, iterable objects are indexed using numbers . When you try to access an iterable object using a string or a float as the index, an error will be returned as TypeError: string indices must be integers. This means that when you're accessing an iterable object like a string or float value, you must do it using an integer value.

For example, str[hello"] and str[2.1] as indexes. As these are not integers, a TypeError exception is raised. This means that when you’re accessing an iterable object like a string or float value, you must do it using an integer value . If you are accessing items from a dictionary , make sure that you are accessing the dictionary itself and not a key in the dictionary.

Python supports slice notation for any sequential data type like lists, strings , tuples, bytes, bytearrays, and ranges. When working with strings and slice notation, it can happen that a TypeError: string indices must be integers is raised, pointing out that the indices must be integers, even if they obviously are.

@Ron-zs
Copy link

Ron-zs commented Oct 27, 2022

this problem is still existence in 2022

@Epicccal
Copy link

Epicccal commented Feb 3, 2023

hello, i found a solution in FudgeC2/email_client/email_client.py

    # line 24
    def __init__(self):
        # Setup email config if one exists.
        state, data = db.email.get_full_email_server_configuration()
        # comment out the three lines
        # s = smtplib.SMTP(
        #     host=data['host'],
        #     port=data['port'])
        if state:
            # add here
            s = smtplib.SMTP(
                host=data['host'],
                port=data['port'])
            try:
                s.starttls()

Also, if you want to use this C2, you may make some changes in requirements.txt

flask==2.1.0       # 1.1.1 -> 2.1.0
... ...
flask-restful==0.3.9       # 0.3.8 -> 0.3.9 
... ...
Werkzeug~=2.0.0     # add this line 

Then its ok

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants