コード例 #1
0
ファイル: scanner.py プロジェクト: securestep9/scant3r
 def Put(url):
     for param in url.split('?')[1].split('&'):
         for payload in sqli_payloads:
             if post_data(urlparse(url).query) == 0:
                 break
             r = nq.Put(url, post_data(urlparse(url).query))
             if r == 0:
                 break
             save_request.save(r)
             data = urlparse(url.replace(param, param + payload)).query
             req = nq.Put(url.split('?')[0], post_data(data))
             if req == 0:
                 break
             for n, e in sql_err.items():
                 r = findall(e.encode('utf-8'), save_request.get().content)
                 r2 = findall(e.encode('utf-8'), req.content)
                 if len(r) < len(r2):
                     bug = {
                         'name': 'SQL injection',
                         'payload': payload,
                         'method': 'PUT',
                         'parameter': param,
                         'target': url.split('?')[0],
                         'data': data
                     }
                     show.bug(bug='SQL injection',
                              payload=payload,
                              method='PUT',
                              parameter=param,
                              target=url.split('?')[0],
                              link=data)
                     return bug
     return None
コード例 #2
0
ファイル: scanner.py プロジェクト: securestep9/scant3r
 def Put(url):
     if methods.Put(url) == 1:
         for param in url.split('?')[1].split('&'):
             for payload, message in ssti_payloads.items():
                 if post_data(urlparse(url).query) == 0:
                     break
                 r = nq.Put(
                     url.split('?')[0], post_data(urlparse(url).query))
                 if r == 0:
                     break
                 r = len(findall(message.encode('utf-8'), r.content))
                 data = urlparse(url.replace(param, param + payload)).query
                 req = nq.Put(url.split('?')[0], post_data(data))
                 if req == 0:
                     break
                 if r < len(findall(message.encode('utf-8'), req.content)):
                     bug = {
                         'name': 'template injection',
                         'payload': payload,
                         'method': 'PUT',
                         'parameter': param,
                         'target': url.split('?')[0],
                         'data': data
                     }
                     show.bug(bug='template injection',
                              payload=payload,
                              method='PUT',
                              parameter=param,
                              target=url.split('?')[0],
                              link=data)
                     return bug
     return None
コード例 #3
0
ファイル: scanner.py プロジェクト: securestep9/scant3r
 def Put(url):
     mt = methods.Put(url.split('?')[0], urlparse(url).query)
     if mt == 0:
         pass
     elif mt == 1 and refxss.Put(url) == 1:
         for param in url.split('?')[1].split('&'):
             for payload in xss_payloads:
                 data = urlparse(url.replace(param, param + payload)).query
                 d = post_data(data)
                 if d == 0:
                     break
                 req = nq.Put(url.split('?')[0], post_data(data))
                 if req == 0:
                     break
                 if payload.encode('utf-8') in req.content:
                     bug = {
                         'name': 'Corss-site scripting',
                         'payload': payload,
                         'method': 'PUT',
                         'parameter': param,
                         'target': url.split('?')[0],
                         'data': data
                     }
                     show.bug(bug='Cross-site scripting',
                              payload=payload,
                              method='PUT',
                              parameter=param,
                              target=url.split('?')[0],
                              link=data)
                     return bug
     return None
コード例 #4
0
ファイル: analyzer.py プロジェクト: securestep9/scant3r
 def Put(url,data=None):
     try:
         if nq.Put(url.split('?')[0],post_data(urlparse(url).query)).status_code != 405:
             return 1
         else:
             return 0
     except:
         return 0
コード例 #5
0
ファイル: analyzer.py プロジェクト: securestep9/scant3r
 def Put(url):
     try:
         for param in url.split('?')[1].split('&'):
            url = url.replace(param, f'{param}scantrrr')
         r = nq.Put(url.split('?')[0],post_data(url))
         if r.content.decode().lower().find('scantrrr') != -1:
             return 1
         else:
             return 0
     except:
         return 0
コード例 #6
0
 def Put(url):
     for param in url.split('?')[1].split('&'):
         for payload, message in rce_payloads.items():
             if post_data(urlparse(url).query) == 0:
                 break
             r = nq.Put(url.split('?')[0], post_data(urlparse(url).query))
             if r == 0:
                 break
             r = len(findall(message.encode('utf-8'), r.content))
             data = urlparse(url.replace(param, param + payload)).query
             req = nq.Put(url.split('?')[0], post_data(data))
             if req == 0:
                 break
             if r < len(findall(message.encode('utf-8'), req.content)):
                 show.bug(bug='command injection',
                          payload=payload.replace('\n', '%0a'),
                          method='PUT',
                          parameter=param,
                          target=url.split('?')[0],
                          link=data.replace('\n', '%0a'))
                 break
コード例 #7
0
ファイル: analyzer.py プロジェクト: securestep9/scant3r
 def Put(url):
     try:
         for param in url.split('?')[1].split('&'):
           url = url.replace(param, f'{param}scantrrr')
         r = nq.Put(url.split('?')[0],post_data(url))
         for header,value in r.headers.items():
             if 'scantrrr' in header or 'scantrrr' in value:
                 return 1
         else:
             return 0
     except:
         return 0
コード例 #8
0
 def Put(url):
     for param in url.split('?')[1].split('&'):
         for payload in xss_payloads:
             data = urlparse(url.replace(param, param + payload)).query
             d = post_data(data)
             if d == 0:
                 break
             req = nq.Put(url.split('?')[0], post_data(data))
             if req == 0:
                 break
             if payload.encode('utf-8') in req.content:
                 show.bug(bug='Cross-site scripting',
                          payload=payload,
                          method='PUT',
                          parameter=param,
                          target=url.split('?')[0],
                          link=data)
                 break
コード例 #9
0
 def Put(url):
     d = nq.Dump()
     for header in SCAN_Headers:
         for payload in sqli_payloads:
             all_headers = {}
             try:
                 url.split('?')[1].split('&')
                 data = urlparse(url).query
                 data = post_data(data)
                 if data == 0:
                     data = {}
             except:
                 data = {}
             r = nq.Put(url, data)
             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],
                       data=data,
                       method='PUT',
                       headers=all_headers)
             if req == 0:
                 break
             for n, e in sql_err.items():
                 r = findall(e.encode('utf-8'), save_request.get().content)
                 r2 = findall(e.encode('utf-8'), req.content)
                 if len(r) < len(r2):
                     show.bug_Header(bug='SQL injection',
                                     payload=payload,
                                     method='PUT',
                                     header=header,
                                     target=url)
                     break
コード例 #10
0
 def Put(url):
     d = nq.Dump()
     for header in SCAN_Headers:
         for payload, message in rce_payloads.items():
             all_headers = {}
             payload = payload.replace('\n', '%0a')
             try:
                 url.split('?')[1].split('&')
                 data = urlparse(url).query
                 data = post_data(data)
                 if data == 0:
                     data = {}
             except:
                 data = {}
             r = nq.Put(url.split('?')[0], data)
             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],
                       data=data,
                       method='PUT',
                       headers=all_headers)
             if req == 0:
                 break
             if r < len(findall(message.encode('utf-8'), req.content)):
                 show.bug_Header(bug='command injection',
                                 payload=payload.replace('\n', '%0a'),
                                 method='PUT',
                                 header=header,
                                 target=url)
                 break
コード例 #11
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
コード例 #12
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}'))