├── run.sh ├── Cargo.toml ├── docker ├── README.md └── Dockerfile ├── .gitignore ├── src ├── proxy_validator.rs ├── main.rs └── scanner.rs ├── test ├── proxy_check.py └── batch_portscan.py ├── README.md └── LICENSE /run.sh: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "port_scanner" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | tokio = { version = "1.37.0", features = ["full"] } 8 | dns-lookup = "2.0.4" 9 | futures = "0.3" 10 | reqwest = { version = "0.12.9", features = ["json"] } -------------------------------------------------------------------------------- /docker/README.md: -------------------------------------------------------------------------------- 1 | 下面是一个Dockerfile,它将初始化一个Rust环境,并从指定的GitHub仓库下载并编译Rust代码。 2 | 3 | 这个Dockerfile基于官方Rust镜像,安装了Git工具,然后克隆了您指定的GitHub仓库,并使用`cargo build --release`命令编译项目。编译完成后,默认运行编译后的二进制文件。 4 | 5 | 您可以使用以下命令来构建和运行Docker镜像: 6 | ```sh 7 | docker build -t rustscan_env . 8 | docker run rustscan_env 9 | ``` 10 | 11 | 如果需要进一步调整或者添加其他功能,请告诉我。 -------------------------------------------------------------------------------- /docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM rust:latest 2 | 3 | # Install necessary tools 4 | RUN apt-get update && \ 5 | apt-get install -y git && \ 6 | rm -rf /var/lib/apt/lists/* 7 | 8 | # Set working directory 9 | WORKDIR /app 10 | 11 | # Clone the rustscan repository 12 | RUN git clone https://github.com/XiaomingX/rustscan.git 13 | 14 | # Change working directory to rustscan 15 | WORKDIR /app/rustscan 16 | 17 | # Build the project 18 | RUN cargo build --release 19 | 20 | # Run the compiled binary as the default command 21 | CMD ["/app/rustscan/target/release/rustscan"] 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Generated by Cargo 2 | # will have compiled files and executables 3 | debug/ 4 | target/ 5 | 6 | # Remove Cargo.lock from gitignore if creating an executable, leave it for libraries 7 | # More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html 8 | Cargo.lock 9 | 10 | # These are backup files generated by rustfmt 11 | **/*.rs.bk 12 | 13 | # MSVC Windows builds of rustc generate these, which store debugging information 14 | *.pdb 15 | 16 | # RustRover 17 | # JetBrains specific template is maintained in a separate JetBrains.gitignore that can 18 | # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore 19 | # and can be added to the global gitignore or merged into this file. For a more nuclear 20 | # option (not recommended) you can uncomment the following to ignore the entire idea folder. 21 | #.idea/ -------------------------------------------------------------------------------- /src/proxy_validator.rs: -------------------------------------------------------------------------------- 1 | // File: proxy_validator.rs 2 | use reqwest::Proxy; 3 | use reqwest::Client; 4 | 5 | pub async fn validate_proxy(addr: &str) -> Option { 6 | if let Ok(client) = Client::builder() 7 | .proxy(Proxy::http(addr).unwrap()) 8 | .build() 9 | { 10 | let headers = [ 11 | ("User-Agent", "Mozilla/5.0"), 12 | ("Accept", "text/html,application/xhtml+xml"), 13 | ]; 14 | let mut req = client.get("http://www.baidu.com"); 15 | for (key, value) in headers.iter() { 16 | req = req.header(*key, *value); 17 | } 18 | if let Ok(_) = req.send().await { 19 | Some("HTTP Proxy".to_string()) 20 | } else { 21 | Some("HTTP (无法通过代理访问)".to_string()) 22 | } 23 | } else { 24 | Some("HTTP (代理配置失败)".to_string()) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /test/proxy_check.py: -------------------------------------------------------------------------------- 1 | import requests 2 | from concurrent.futures import ThreadPoolExecutor 3 | 4 | ## 批量验证的代理服务器. 5 | 6 | # 代理列表 7 | proxies_list = [ 8 | {"ip": "47.93.0.20", "port": "8080"}, 9 | {"ip": "47.93.0.23", "port": "8081"}, 10 | {"ip": "47.93.0.24", "port": "8080"}, 11 | {"ip": "47.93.0.30", "port": "9999"}, 12 | {"ip": "47.93.0.35", "port": "8888"}, 13 | {"ip": "47.93.0.56", "port": "8888"}, 14 | {"ip": "47.93.0.61", "port": "9999"}, 15 | {"ip": "47.93.0.82", "port": "8888"}, 16 | {"ip": "47.93.0.102", "port": "8888"}, 17 | {"ip": "47.93.0.115", "port": "8080"}, 18 | {"ip": "47.93.0.129", "port": "8000"}, 19 | {"ip": "47.93.0.179", "port": "8888"}, 20 | {"ip": "47.93.0.212", "port": "8081"}, 21 | {"ip": "47.93.0.224", "port": "8888"}, 22 | ] 23 | 24 | def check_proxy(proxy): 25 | proxies = { 26 | "http": f"http://{proxy['ip']}:{proxy['port']}", 27 | "https": f"http://{proxy['ip']}:{proxy['port']}" 28 | } 29 | try: 30 | response = requests.get("https://www.baidu.com/", proxies=proxies, timeout=5) 31 | response.raise_for_status() 32 | print(f"代理 {proxy['ip']}:{proxy['port']} 可用") 33 | return True 34 | except requests.exceptions.RequestException: 35 | print(f"代理 {proxy['ip']}:{proxy['port']} 不可用") 36 | return False 37 | 38 | # 使用线程池进行批量验证 39 | with ThreadPoolExecutor(max_workers=10) as executor: 40 | executor.map(check_proxy, proxies_list) 41 | -------------------------------------------------------------------------------- /test/batch_portscan.py: -------------------------------------------------------------------------------- 1 | import os 2 | from datetime import datetime 3 | 4 | def main(): 5 | # 获取当前日期并创建文件夹 6 | today = datetime.today().strftime('%Y-%m-%d') 7 | folder_path = os.path.join(os.getcwd(), today) 8 | os.makedirs(folder_path, exist_ok=True) 9 | 10 | # 在文件夹中创建README.md文件 11 | readme_path = os.path.join(folder_path, "README.md") 12 | with open(readme_path, "w") as readme_file: 13 | subnets = { 14 | "香港": [ 15 | "47.56.0.0/15", 16 | "47.244.0.0/16", 17 | "47.75.0.0/16" 18 | ], 19 | "新加坡": [ 20 | "47.74.128.0/17", 21 | "47.88.192.0/18" 22 | ], 23 | "日本": [ 24 | "47.74.0.0/18", 25 | "47.245.0.0/18" 26 | ], 27 | "美国": [ 28 | "47.251.0.0/16", 29 | "47.254.0.0/17" 30 | ], 31 | "德国": [ 32 | "47.254.128.0/18" 33 | ], 34 | "马来西亚": [ 35 | "47.254.192.0/18", 36 | "47.250.0.0/16" 37 | ] 38 | } 39 | 40 | for region, ips in subnets.items(): 41 | for ip in ips: 42 | command = f"./target/release/port_scanner -ips {ip}" 43 | result = os.popen(command).read() # 执行命令并获取结果 44 | # 写入执行命令的区域、IP和结果到README.md 45 | readme_file.write(f"## {region}\n") 46 | readme_file.write(f"### IP: {ip}\n") 47 | readme_file.write("```\n") 48 | readme_file.write(result) 49 | readme_file.write("```\n\n") 50 | print(f"Executed command for {region}: {command}") 51 | 52 | if __name__ == "__main__": 53 | main() 54 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | mod scanner; 2 | mod proxy_validator; 3 | 4 | use scanner::{scan_port, generate_ip_range}; 5 | use proxy_validator::validate_proxy; 6 | use std::net::{IpAddr, Ipv4Addr}; 7 | use std::time::Instant; 8 | use futures::future::join_all; 9 | use std::env; 10 | 11 | #[tokio::main] 12 | async fn main() -> Result<(), Box> { 13 | let start_time = Instant::now(); 14 | 15 | // 获取命令行参数 16 | let args: Vec = env::args().collect(); 17 | 18 | if args.contains(&"-h".to_string()) { 19 | println!("使用方式: \n -ips <网段> 指定要扫描的网段 (例如: 192.168.1.0/24)\n -h 显示帮助信息"); 20 | return Ok(()); 21 | } 22 | 23 | let input = if let Some(idx) = args.iter().position(|x| x == "-ips") { 24 | args.get(idx + 1).map(|s| s.as_str()).unwrap_or("192.168.1.0/24") 25 | } else { 26 | "192.168.1.0/24" 27 | }; 28 | 29 | let (base_ip_str, mask_str) = input.split_once('/').unwrap_or(("192.168.1.0", "24")); 30 | let base_ip: Ipv4Addr = base_ip_str.parse()?; 31 | let subnet_mask: u8 = mask_str.parse()?; 32 | 33 | let ip_range = generate_ip_range(base_ip, subnet_mask); 34 | 35 | let ports_to_scan = vec![3128, 8080, 8888, 1080, 8000, 8001, 9050, 8081, 8118, 3129, 5000, 8119, 8110, 3124, 9999, 8443, 8088, 1081]; 36 | 37 | println!("开始扫描 {} 的代理端口...", input); 38 | 39 | let mut tasks = Vec::new(); 40 | for ip in &ip_range { 41 | for &port in &ports_to_scan { 42 | tasks.push(scan_port(IpAddr::V4(*ip), port)); 43 | } 44 | } 45 | 46 | let results = join_all(tasks).await; 47 | 48 | println!("扫描结果:"); 49 | println!("------------------------"); 50 | 51 | let mut open_ports = 0; 52 | for result in results { 53 | if result.is_open { 54 | open_ports += 1; 55 | let protocol = if let Some(protocol) = &result.protocol { 56 | protocol.clone() 57 | } else { 58 | validate_proxy(&format!("{}:{}", result.ip, result.port)).await.unwrap_or("Unknown".to_string()) 59 | }; 60 | println!("IP {}:{:5} - 开放 - 协议: {}", result.ip, result.port, protocol); 61 | } 62 | } 63 | 64 | let duration = start_time.elapsed(); 65 | 66 | println!("扫描统计:"); 67 | println!("------------------------"); 68 | println!("扫描总IP数: {}", ip_range.len()); 69 | println!("扫描端口数: {}", ports_to_scan.len()); 70 | println!("发现开放端口: {}", open_ports); 71 | println!("扫描总用时: {:.2}秒", duration.as_secs_f64()); 72 | println!("平均每个IP用时: {:.2}毫秒", 73 | (duration.as_millis() as f64) / (ip_range.len() as f64) 74 | ); 75 | 76 | Ok(()) 77 | } 78 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Port Scan 2 | 3 | 一个简单的命令行工具,用于检测指定网段内的主机是否在特定端口(如80端口)开放。适用于网络管理员和开发人员快速扫描主机端口状态。 4 | 5 | ## 功能介绍 6 | 7 | image 8 | 9 | - 用户可输入特定的网段,例如 `192.168.1.0/24`,扫描程序会检测该网段内的所有主机。 10 | - 检查指定端口(默认为80端口)是否开放。 11 | - 支持多线程扫描,提升检测效率。 12 | 13 | ## 安装方法 14 | 15 | 请确保已安装 [Rust](https://www.rust-lang.org/) 编译器。 16 | 17 | ```bash 18 | git clone --depth 1 https://github.com/XiaomingX/RustProxyHunter.git 19 | cd RustProxyHunter 20 | cargo build --release 21 | ``` 22 | 23 | ## 使用方法 24 | 25 | 1. 运行编译后的程序: 26 | 27 | ```bash 28 | cargo run --release 29 | ``` 30 | 31 | 2. 输入指定网段,即可开始扫描。 32 | 33 | ## 示例 34 | ### 编译 35 | ```bash 36 | cargo run --release 37 | ``` 38 | 39 | ### 使用 40 | ```bash 41 | ./release/port_scanner 42 | ``` 43 | 44 | ## 如果你对网络安全感兴趣,如下开源代码不容错过: 45 | - rust实现的端口扫描器: 46 | - https://github.com/XiaomingX/RustProxyHunter 47 | - python实现的代理池检测: 48 | - https://github.com/XiaomingX/proxy-pool 49 | - golang实现的供应链安全,CVE-POC的全自动收集(注无人工审核,可能被投毒,仅限有基础的朋友): 50 | - https://github.com/XiaomingX/data-cve-poc 51 | - python实现的检查.git泄漏的工具 52 | - https://github.com/XiaomingX/github-sensitive-hack 53 | 54 | ## 可监控的网段 55 | 56 | ### 阿里云 57 | **中国大陆** 58 | ``` 59 | 北京: 60 | 47.93.0.0/16 61 | 47.94.0.0/15 62 | 39.98.0.0/16 63 | 182.92.0.0/16 64 | 65 | 杭州: 66 | 112.124.0.0/16 67 | 121.40.0.0/15 68 | 101.37.0.0/16 69 | 121.43.0.0/16 70 | 71 | 青岛: 72 | 115.28.0.0/16 73 | 139.129.0.0/16 74 | 118.190.0.0/16 75 | 76 | 深圳: 77 | 120.76.0.0/14 78 | 119.23.0.0/16 79 | ``` 80 | 81 | **海外节点** 82 | ``` 83 | 香港: 84 | 47.56.0.0/15 85 | 47.244.0.0/16 86 | 47.75.0.0/16 87 | 88 | 新加坡: 89 | 47.74.128.0/17 90 | 47.88.192.0/18 91 | 92 | 日本: 93 | 47.74.0.0/18 94 | 47.245.0.0/18 95 | 96 | 美国: 97 | 47.251.0.0/16 98 | 47.254.0.0/17 99 | 100 | 德国: 101 | 47.254.128.0/18 102 | 103 | 马来西亚: 104 | 47.254.192.0/18 105 | 47.250.0.0/16 106 | ``` 107 | 108 | ## 腾讯云 109 | ``` 110 | 中国大陆: 111 | 49.51.0.0/16 112 | 81.68.0.0/14 113 | 106.52.0.0/14 114 | 115 | 香港: 116 | 43.132.0.0/16 117 | 129.226.0.0/16 118 | 119 | 新加坡: 120 | 170.106.0.0/16 121 | ``` 122 | 123 | ## AWS 124 | ``` 125 | 美国东部(弗吉尼亚): 126 | 3.80.0.0/12 127 | 23.20.0.0/14 128 | 129 | 新加坡: 130 | 13.212.0.0/15 131 | 18.136.0.0/16 132 | 133 | 日本东京: 134 | 13.112.0.0/14 135 | 54.178.0.0/16 136 | ``` 137 | 138 | ## Google Cloud 139 | ``` 140 | 美国: 141 | 34.64.0.0/11 142 | 35.184.0.0/13 143 | 144 | 亚太: 145 | 34.80.0.0/15 146 | 35.194.0.0/15 147 | ``` 148 | 149 | ## Azure 150 | ``` 151 | 美国: 152 | 13.64.0.0/11 153 | 20.33.0.0/16 154 | 155 | 亚太: 156 | 20.184.0.0/13 157 | 20.195.0.0/16 158 | ``` 159 | 160 | 3. test/app.py用于复测验证,是否确实可以用于代理服务器 161 | ``` 162 | python3 test/app.py 163 | ``` 164 | 165 | ## 注意事项 166 | 167 | - 仅用于合法的端口检测操作,切勿用于未经授权的网络。 168 | - 运行此工具时,请确保在网络环境中有相应的权限。 169 | - 代理服务器是不是可能是蜜罐?监控流量[待分析] 170 | -------------------------------------------------------------------------------- /src/scanner.rs: -------------------------------------------------------------------------------- 1 | // File: scanner.rs 2 | use std::net::{IpAddr, Ipv4Addr}; 3 | use std::time::Duration; 4 | use tokio::net::TcpStream; 5 | use tokio::time::timeout; 6 | use tokio::io::{AsyncWriteExt, AsyncReadExt}; 7 | use reqwest::Proxy; 8 | 9 | #[derive(Debug)] 10 | pub struct ScanResult { 11 | pub ip: IpAddr, 12 | pub port: u16, 13 | pub is_open: bool, 14 | pub protocol: Option, // 识别协议类型(HTTP/HTTPS) 15 | } 16 | 17 | pub async fn scan_port(ip: IpAddr, port: u16) -> ScanResult { 18 | let timeout_duration = Duration::from_secs(1); 19 | let addr = format!("{}:{}", ip, port); 20 | 21 | let result = timeout(timeout_duration, TcpStream::connect(&addr)).await; 22 | 23 | if result.is_err() || result.as_ref().unwrap().is_err() { 24 | return ScanResult { 25 | ip, 26 | port, 27 | is_open: false, 28 | protocol: None, 29 | }; 30 | } 31 | 32 | let mut stream = result.unwrap().unwrap(); 33 | 34 | let request = b"GET / HTTP/1.1\r\nHost: example.com\r\n\r\n"; 35 | if let Err(_) = stream.write_all(request).await { 36 | return ScanResult { 37 | ip, 38 | port, 39 | is_open: true, 40 | protocol: None, 41 | }; 42 | } 43 | 44 | let mut response = vec![0; 1024]; 45 | if let Ok(n) = stream.read(&mut response).await { 46 | let response_text = String::from_utf8_lossy(&response[..n]); 47 | 48 | let protocol = if response_text.starts_with("HTTP/1.") { 49 | if let Ok(client) = reqwest::Client::builder() 50 | .proxy(Proxy::http(&addr).unwrap()) 51 | .build() 52 | { 53 | let headers = [ 54 | ("User-Agent", "Mozilla/5.0"), 55 | ("Accept", "text/html,application/xhtml+xml"), 56 | ]; 57 | let mut req = client.get("http://www.baidu.com"); 58 | for (key, value) in headers.iter() { 59 | req = req.header(*key, *value); 60 | } 61 | if let Ok(_) = req.send().await { 62 | Some("HTTP Proxy".to_string()) 63 | } else { 64 | Some("HTTP (无法通过代理访问)".to_string()) 65 | } 66 | } else { 67 | Some("HTTP (代理配置失败)".to_string()) 68 | } 69 | } else if response_text.starts_with("\x16\x03") { 70 | Some("HTTPS".to_string()) 71 | } else { 72 | None 73 | }; 74 | 75 | return ScanResult { 76 | ip, 77 | port, 78 | is_open: true, 79 | protocol, 80 | }; 81 | } 82 | 83 | ScanResult { 84 | ip, 85 | port, 86 | is_open: true, 87 | protocol: None, 88 | } 89 | } 90 | 91 | pub fn generate_ip_range(base_ip: Ipv4Addr, subnet_mask: u8) -> Vec { 92 | let ip_count = 1 << (32 - subnet_mask); 93 | (0..ip_count) 94 | .map(|i| Ipv4Addr::from(u32::from(base_ip) | i)) 95 | .collect() 96 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | --------------------------------------------------------------------------------