Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1c8dd338f8 |
No files matched your search
@@ -16,6 +16,7 @@ jobs:
|
|||||||
uses: https://github.com/actions/setup-go@v4
|
uses: https://github.com/actions/setup-go@v4
|
||||||
with:
|
with:
|
||||||
go-version: '>=1.20.1'
|
go-version: '>=1.20.1'
|
||||||
|
cache: false
|
||||||
- name: release-build
|
- name: release-build
|
||||||
run: go build -ldflags="-s -w -X 'main.Version=${{ github.ref_name }}'" -o bin/honeyspot-${{ github.ref_name }}-linux-amd64
|
run: go build -ldflags="-s -w -X 'main.Version=${{ github.ref_name }}'" -o bin/honeyspot-${{ github.ref_name }}-linux-amd64
|
||||||
- name: release-build-windows
|
- name: release-build-windows
|
||||||
|
|||||||
@@ -409,7 +409,13 @@ func listen(addr string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check is ip
|
// check is ip
|
||||||
ip := net.ParseIP(remoteAddr.String())
|
remoteAddrStr := remoteAddr.String()
|
||||||
|
// remove port with IPv6 support
|
||||||
|
if strings.Contains(remoteAddrStr, ":") {
|
||||||
|
remoteAddrStr = remoteAddrStr[:strings.LastIndex(remoteAddrStr, ":")]
|
||||||
|
}
|
||||||
|
|
||||||
|
ip := net.ParseIP(remoteAddrStr)
|
||||||
if ip == nil {
|
if ip == nil {
|
||||||
log.Warnf("Got request from non-IP %s, ignoring request", remoteAddr)
|
log.Warnf("Got request from non-IP %s, ignoring request", remoteAddr)
|
||||||
_ = conn.Close()
|
_ = conn.Close()
|
||||||
|
|||||||
Reference in new issue
Block a user