Skip to content

A pure rust implementation based on the BMS 2.1 protocol

License

Notifications You must be signed in to change notification settings

Schira4396/smb2-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

smb2-rs

这是一个用于Smb2.1 协议认证的库

0x01 说明

此库是纯rust手搓的,Linux/Windows都兼容且不依赖lib-smbclient的C库,目前在Windows7、Windows server 2008、Windows server 2012、Windows server 2016以及Windows 10上测试通过,samba没测。

0x02 使用方法

use smb2_rs::{SmbOptions};
use anyhow::{Result};



#[tokio::main]
async fn main() -> Result<()> {

    let op = SmbOptions{
        Host:        "192.168.132.173",
        Port:        "445",
        User:        "administrator",
        Domain:      "corp",
        Workstation: "123",
        Password:    "123456",
    };
    let mut result = smb_rs::Conn(op).await?;//result
    let b = result.IsAuthenticated();//bool,方便进行判断
    println!("{:?}, status_code: {:?}",b, result.StatusCode);//...
    Ok(())
}

About

A pure rust implementation based on the BMS 2.1 protocol

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages