예제 #1
0
파일: photon.py 프로젝트: edkb/Photon
def jscanner(url):
    """Extract endpoints from JavaScript code."""
    response = requester(
        url,
        main_url,
        delay,
        cook,
        headers,
        timeout,
        host,
        proxies,
        user_agents,
        failed,
        processed,
    )
    # Extract URLs/endpoints
    matches = rendpoint.findall(response)
    # Iterate over the matches, match is a tuple
    for match in matches:
        # Combining the items because one of them is always empty
        match = match[0] + match[1]
        # Making sure it's not some JavaScript code
        if not re.search(r'[}{><"\']', match) and not match == "/":
            verb("JS endpoint", match)
            endpoints.add(match)
예제 #2
0
def jscanner(url):
    """Extract endpoints from JavaScript code."""
    response = requester(url, main_url, delay, cook, headers, timeout, host, proxies, user_agents, failed, processed)
    # Extract URLs/endpoints
    matches = rendpoint.findall(response)
    # Iterate over the matches, match is a tuple
    for match in matches:
        # Combining the items because one of them is always empty
        match = match[0] + match[1]
        # Making sure it's not some JavaScript code
        if not re.search(r'[}{><"\']', match) and not match == '/':
            verb('JS endpoint', match)
            endpoints.add(match)