百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
L

lzr

> 安全
开源

LZR 可快速检测和生成指纹,识别在意料之外端口上运行的意外服务。

195 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

LZR 可快速检测和生成指纹,识别在意料之外端口上运行的意外服务。

LZR

LZR quickly detects and fingerprints unexpected services running on unexpected ports by working with ZMap. LZR can detect up to 18 unique protocols simultaneously with just two extra packets and can fingerprint over 35 different protocols.

To learn more about LZR's system and performance, check out the original paper appearing at USENIX Security '21. To use LZR to fingerprint services across all 65K ports, check out GPS.

Building

Install and set up ZMap. If also performing full L7 handshakes, set up ZGrab.

Set up $GOPATH (see https://golang.org/doc/code.html).

$ go get github.com/stanford-esrg/lzr
$ cd $GOPATH/src/github.com/stanford-esrg/lzr

LZR intercepts connections which ZMap opens; in order to ensure that the kernel does not interfere with LZR, LZR requires a source-ip to be specified for which the kernel drops all RSTs for traffic targeted to the source-ip. The chosen source-ip—which both ZMap and LZR will use—should be passed in as a parameter to make, so the appropriate iptables rule can be set.

$ make all source-ip=256.256.256.256

It works the same for the IPv6 as the script determines whether the source IP is a IPv4 address or not by checking the . character within the source IP string. If IPv6, it uses ip6tables rather than iptables.

$ make all source-ip=ffff:ffff:ffff:ffff::ffff

Usage

To fingerprint unexpected services on an random port (9002):

bash
sudo zmap --target-port=9002 --output-filter="success = 1 && repeat = 0" \
-f "saddr,daddr,sport,dport,seqnum,acknum,window" -O json --source-ip=$source-ip | \
sudo ./lzr --handshakes http,tls

To complete full L7 handshakes of unexpected services on an random port (9002), substitute port=x in etc/all.ini with port=9002 and run the following command:

bash
sudo zmap --target-port=9002 --output-filter="success = 1 && repeat = 0" \
-f "saddr,daddr,sport,dport,seqnum,acknum,window" -O json --source-ip=$source-ip | \
sudo ./lzr --handshakes wait,http,tls -feedZGrab | \
zgrab multiple -c etc/all.ini 

To scan a custom list of IP:Port (i.e., using LZR rather than ZMap to open connections):

sudo ./lzr --handshakes http -sendSYNs -sourceIP $source-ip -gatewayMac $gateway -rate $PACKETS_PER_SECOND <services_list

The expected input format of an example services list is:

1.1.1.1:1234
2.2.2.2:80

To scan a sample of IP:Port from ZMap's dryrun option (i.e., ZMap still determines which IP:Port we use but LZR opens the connection):

bash
sudo zmap --target-port=9002 -O - --source-ip=$source-ip --dryrun | sudo ./lzr --handshakes http -dryrun -sourceIP $source-ip -gatewayMac $gateway

IPv6

For IPv6, you could just set the --ipv6 flag, and the LZR will switch to IPv6 mode.

Flags

…

Caveats for specific features

Acking Firewall Filtering (-haf): If a host responds both on the expected port and on the random ephemeral port, whichever response comes first will dictate whether the host is marked as having an ACKing firewall.

LZR's Algorithm

License and Copyright

Copyright 2020 The Board of Trustees of The Leland Stanford Junior University

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Gogogolanginternet-wide-scanningipv4

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类安全
定价开源

> 相关工具

O
OWASP ZAP
开源 Web 应用安全扫描器
O
owasp-wstg-tracker
Simple web app to track OWASP WSTG security testing progress
H
homebridge-mi-gateway-security
XiaoMi Gateway Security plugin for HomeBridge.