Crates.io | lemme_see |
lib.rs | lemme_see |
version | 0.1.2 |
source | src |
created_at | 2022-01-09 17:39:43.30994 |
updated_at | 2022-01-13 18:35:09.833074 |
description | port scanner api |
homepage | |
repository | https://github.com/salugi/lemme_see |
max_upload_size | |
id | 510935 |
size | 25,007 |
Port Scanner API
This is an API to use in "Pelican", a free and open source data gathering platform. This is still in its initial commit stage so things will change. This is the start of a project to bring recon and attack surface into an easier and more consumable using cyber security tools and search engine indexing for certain phrases
use lemme_see::carriers::{CommonCarrier, RadioFlyer};
use lemme_see::constants::COMMON_PORTS;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
//Get a banner
let record = RadioFlyer::get_banner("example.com", 80);
assert_eq!(record.is_ok(), true);
println!("{:?}", record.unwrap());
let record = RadioFlyer::string_drop(
"example.com",
"GET / HTTP/1.1\n\n",
80
);
assert_eq!(record.is_ok(), true);
println!("{:?}", record.unwrap());
//Get the hosts
let hosts = RadioFlyer::host_drop("example.com");
assert_eq!(hosts.is_ok(), true);
let unwrapped = hosts.unwrap();
assert_eq!(unwrapped.len() > 0, true);
println!("{:?}", hosts);
//Port scan a host
let ports: Vec<u16> = COMMON_PORTS.to_vec();
let record = RadioFlyer::scan_drop("8.8.8.8", ports, 100);
assert_eq!(record.is_ok(), true);
println!("{:?}", record.unwrap());
//Banner scan a host
let ports: Vec<u16> = COMMON_PORTS.to_vec();
let record = RadioFlyer::banner_drop("example.com", ports, 100);
assert_eq!(record.is_ok(), true);
println!("{:?}", record.unwrap());
//Scan multiple hosts with common ports
let ports: Vec<u16> = COMMON_PORTS.to_vec();
let record = RadioFlyer::scan_drops(
vec![
"2001:4860:4860:0000:0000:0000:0000:8888",
"8.8.8.8",
"8.8.4.4",
"example.com",
],
ports,
50,
);
assert_eq!(record.is_ok(), true);
println!("{:?}", record.unwrap());
//Banner scan multiple hosts
let ports: Vec<u16> = COMMON_PORTS.to_vec();
let record = RadioFlyer::banner_drops(
vec![
"2001:4860:4860:0000:0000:0000:0000:8888",
"8.8.8.8",
"8.8.4.4",
"example.com",
],
ports,
50,
);
assert_eq!(record.is_ok(), true);
println!("{:?}", record.unwrap());
//make a json file
let record = CommonCarrier::from_file("./assets/import_test.json");
assert_eq!(record.is_ok(), true);
let unwrapped = record.unwrap();
println!("{:?}", record.unwrap());
}
##JSON format example
{
"addresses": [{
"host": "google.com",
"ports": [53, 123, 8006]
},
{
"host": "example.com",
"ports": [53, 123]
},
{
"host": "8.8.8.8",
"ports": [53, 123]
},
{
"host": "8.8.4.4",
"ports": [53, 123]
},
{
"host": "2001:4860:4860:0000:0000:0000:0000:8888",
"ports": [53, 123]
}
],
"global_ports": [80,443]
}