-
Notifications
You must be signed in to change notification settings - Fork 0
API Document
I2cyLib, a multifunctional Python library created by I2cy, aims to cover multiple aspects of daily programming in networking, engineering, cryptography and etc.
I2cyLib
是I2cy常年创建积累的多方向功能库,涵盖有文件系统、网络通讯、网络安全、密码学工具、工程控制、数据库等接口。
Notice: All protected API are not displayed in this document.
注意:所有受保护的接口都不在此文档中显示
i2cylib.network
网络i2cylib.crypto
加密i2cylib.filesystem
文件系统i2cylib.database
数据库i2cylib.engineering
工程、自动化i2cylib.utils
实用工具
i2cylib.network.I2Scan
port scanner | 端口扫描-
i2cylib.network.I2TCP
secured socket based on TCP | 高度封装的TCP安全套接字通讯接口 -
i2cylib.network.i2tcp_basic
the base classes of I2TCP (protected) | I2TCP基类(保留)
i2cylib.network.I2Scan
[source 源码]
A port scanning tool, which has its own command line version, use command i2scan
in terminal for more.
一种端口扫描工具,有提供的接口以程序形式调用,也可在终端中单独使用该工具,使用i2scan
命令可查看其具体用法。
i2cylib.network.I2Scan.I2Target
Scanner base | 扫描器基类i2cylib.network.I2Scan.FullScan
Full connection scanner | 全连接扫描器
class i2cylib.network.I2Scan.I2Target(hosts, ports, max_thread_allowed=512, echo=None)
Base 基类:
object
Return 返回:
I2Target
All scanner are based on
I2Target
object.所有的扫描器类都是以
I2Target
为父类。
I2Target
is subscriptable, usage:I2Target[host][port]
, this returns the port status of the target host.
I2Target
可以作为一个二维字典对指定的地址的端口状态进行查询,用法:I2Target[host][port]
。
Arguments 形参 hosts ( List([str])
) Set the target hosts to apply scanner. 设置扫描的目标地址(列表形式)ports ( List([int])
) Set the ports to scan in each host. 设置所需要扫描的端口(列表形式)max_thread_allowed ( int
>=1 default: 512) Set the maximum number of threads to exist at the same time. 设置最大线程数,越大扫描速度越快,但可能会导致出错echo ( i2cy.utils.stdout.Echo
default: None) Set the standard output API. 设置标准输出接口,接口必须来自i2cy.utils.stdout.Echo
__len__(self)
Return 返回:
int
Return the value of len(hosts) * len(ports).
返回端口状态二维字典总数
__getitem__(self, item)
Return 返回:
dict
Return all ports status dict of the target host.
返回目标地址的所有端口的状态字典。
Arguments 形参 item (str) Target host. 目标地址(不含端口)
scan(self, timeout=3, wait=True, verbose=False, msg=b"GET /index.html HTTP/1.1")
Return 返回:
I2Target
Start the scanner to scan target ports.
启动端口扫描器执行扫描。
Arguments 形参 timeout (int >=0 default: 3) Set the timeout value for each scanner if it has one. 设置连接超时时间 wait (bool default: True) Set weather should this scanner wait for all sub threads stop. 设置函数是否阻塞等待所有线程扫描完毕 verbose (bool default: False) Allow scanner to output real time scan message in terminal. 允许扫描器实时输出扫描信息 msg (bytes default: b"GET /index.html HTTP/1.1") Set the message to send in all scanner sub threads. 设置所有扫描器向服务端对应端口发送的数据
is_open(self, host, port)
Return 返回:
bool
Return the selected target port status. If the target is still in testing, returns
None
.返回目标地址的指定端口的状态,若目标地址的目标端口仍在测试中,则返回
None
。
Arguments 形参 host (str) Set the target host. 目标地址 port (int) Set the target port. 目标端口
class i2cylib.network.I2Scan.FullScan(hosts, ports, max_thread_allowed=512, echo=None)
Base 基类:
I2Target
Return 返回:
FullScan
Full connection scanner object. Use TCP connection to test the target port status and restore its feedback for analysis later.
全连接扫描器,使用TCP全连接至目标端口,向其发送预设的数据然后将返回内容储存在状态字典中以供后续分析。
FullScan
is subscriptable, usage:FullScan[host][port]
, this returns the port status of the target host.
FullScan
可以作为一个二维字典对指定的地址的端口状态进行查询,用法:FullScan[host][port]
。
Arguments 形参 hosts ( List([str])
) Set the target hosts to apply scanner. 设置扫描的目标地址(列表形式)ports ( List([int])
) Set the ports to scan in each host. 设置所需要扫描的端口(列表形式)max_thread_allowed ( int
>=1 default: 512) Set the maximum number of threads to exist at the same time. 设置最大线程数,越大扫描速度越快,但可能会导致出错echo ( i2cy.utils.stdout.Echo
default: None) Set the standard output API. 设置标准输出接口,接口必须来自i2cy.utils.stdout.Echo
__len__(self)
Return 返回:
int
Return the value of len(hosts) * len(ports).
返回端口状态二维字典总数
__getitem__(self, item)
Return 返回:
dict
Return all ports status dict of the target host.
返回目标地址的所有端口的状态字典。
Arguments 形参 item (str) Target host. 目标地址(不含端口)
scan(self, timeout=3, wait=True, verbose=False, msg=b"GET /index.html HTTP/1.1")
Return 返回:
FullScan
Start the scanner to scan target ports.
启动端口扫描器执行扫描。
Arguments 形参 timeout (int >=0 default: 3) Set the timeout value for each scanner if it has one. 设置连接超时时间 wait (bool default: True) Set weather should this scanner wait for all sub threads stop. 设置函数是否阻塞等待所有线程扫描完毕 verbose (bool default: False) Allow scanner to output real time scan message in terminal. 允许扫描器实时输出扫描信息 msg (bytes default: b"GET /index.html HTTP/1.1") Set the message to send in all scanner sub threads. 设置所有扫描器向服务端对应端口发送的数据
is_open(self, host, port)
Return 返回:
bool
Return the selected target port status. If the target is still in testing, returns
None
.返回目标地址的指定端口的状态,若目标地址的目标端口仍在测试中,则返回
None
。
Arguments 形参 host (str) Set the target host. 目标地址 port (int) Set the target port. 目标端口
get_feedback(self, host, port)
Return 返回:
bytes
Return the selected target feedback. If the target is still in testing, returns
None
.返回目标地址的指定端口的返回数据,若目标地址的目标端口仍在测试中,则返回
None
。
Arguments 形参 host (str) Set the target host. 目标地址 port (int) Set the target port. 目标端口
i2cylib.crypto
i2cylib.filesystem
i2cylib.database
i2cylib.engineering
i2cylib.utils