https://github.com/shellrow/webscan
Cross-platform web scan library
https://github.com/shellrow/webscan
rust rust-crate rust-library scanner security web
Last synced: about 1 year ago
JSON representation
Cross-platform web scan library
- Host: GitHub
- URL: https://github.com/shellrow/webscan
- Owner: shellrow
- License: mit
- Created: 2021-04-09T14:50:42.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2022-06-11T12:07:49.000Z (about 4 years ago)
- Last Synced: 2025-03-24T04:37:29.487Z (about 1 year ago)
- Topics: rust, rust-crate, rust-library, scanner, security, web
- Language: Rust
- Homepage:
- Size: 39.1 KB
- Stars: 1
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[crates-badge]: https://img.shields.io/crates/v/webscan.svg
[crates-url]: https://crates.io/crates/webscan
[license-badge]: https://img.shields.io/crates/l/webscan.svg
[examples-url]: https://github.com/shellrow/webscan/tree/main/examples
# webscan [![Crates.io][crates-badge]][crates-url] ![License][license-badge]
Cross-platform web scan library
with the aim of being lightweight and fast.
## Features
- URI SCAN
- DOMAIN SCAN
## Usage
Add `webscan` to your dependencies
```toml:Cargo.toml
[dependencies]
webscan = "0.4.0"
```
## Example
URI Scan Example
```rust
extern crate webscan;
use webscan::{UriScanner, ScanStatus, RequestMethod};
use tokio;
use std::fs::{read_to_string, read};
use std::time::Duration;
#[tokio::main]
async fn main(){
let mut uri_scanner = match UriScanner::new(){
Ok(scanner) => (scanner),
Err(e) => panic!("Error creating scanner: {}", e),
};
let base_uri = String::from("http://localhost:8000/");
uri_scanner.set_base_uri(base_uri);
let data = read_to_string("uris.txt");
let text = match data {
Ok(content) => content,
Err(e) => {panic!("Could not open or find uris.txt file: {}", e);}
};
let word_list: Vec<&str> = text.trim().split("\n").collect();
for word in word_list {
uri_scanner.add_word(word.to_string());
}
match read("content.txt") {
Ok(ct) => {
let sep = b'\n';
ct.split(|b| b == &sep )
.for_each(|c| uri_scanner.add_content(c.to_vec()));
},
Err(e) => {panic!("Could not open or find content.txt file: {}", e);}
}
uri_scanner.set_request_method(RequestMethod::Get);
uri_scanner.set_timeout(Duration::from_millis(20000));
uri_scanner.set_accept_invalid_certs(false);
uri_scanner.run_scan().await;
let result = uri_scanner.get_result();
print!("Status: ");
match result.scan_status {
ScanStatus::Done => {println!("Normal end")},
ScanStatus::Timeout => {println!("Timed out")},
_ => {println!("Error")},
}
println!("URI Scan Result:");
for (uri, status) in result.responses {
println!("{} {}", uri, status);
}
println!("Scan Time: {:?}", result.scan_time);
}
```
For more details see [Examples][examples-url]
## Supported platform
- Linux
- macOS(OS X)
- Windows