示例#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)