Code Monkey home page Code Monkey logo

Comments (7)

craig-merchant avatar craig-merchant commented on July 28, 2024

I'm seeing similar behavior on Ubuntu 18.04. I saw this error when testing the build:

root@osquery:~/clamav-yara# go test -v

_/home/cmerchant/clamav-yara

./definitions_test.go:41: Errorf format %s has arg def.Level of wrong type int
./definitions_test.go:45: Errorf format %s has arg def.TotalSignatures of wrong type int64
./definitions_test.go:49: Errorf format %s has arg def.Version of wrong type int
FAIL _/home/cmerchant/clamav-yara [build failed]

from clamav-yara.

hapablanha avatar hapablanha commented on July 28, 2024

I am seeing the same errors on CentOS 7.6.

[root@localhost clamav-yara]# go test -v
# _/root/clamav-yara
./definitions_test.go:41:3: Errorf format %s has arg def.Level of wrong type int
./definitions_test.go:45:3: Errorf format %s has arg def.TotalSignatures of wrong type int64
./definitions_test.go:49:3: Errorf format %s has arg def.Version of wrong type int
FAIL    _/root/clamav-yara [build failed]
[root@localhost clamav-yara]# ./clamav-yara
2020/03/09 01:32:16 Downloading main definitions from https://sec51.com/definitions/main.cvd ...
2020/03/09 01:32:17 Download completed, proceeding with parsing.
panic: runtime error: slice bounds out of range [512:162]

goroutine 1 [running]:
main.extractFiles(0xc000184600, 0xa2, 0x200, 0x0, 0x0, 0x200, 0x0)
        /root/clamav-yara/definitions.go:296 +0xb0e
main.(*DefinitionsManager).DownloadDefinitions(0xc000062600, 0x0, 0x0, 0x0)
        /root/clamav-yara/definitions.go:237 +0x42d
main.downloadDefinitions(0xc000062600)
        /root/clamav-yara/main.go:30 +0x34
main.main()
        /root/clamav-yara/main.go:19 +0x84

from clamav-yara.

hapablanha avatar hapablanha commented on July 28, 2024

Is this caused by newer go version? I can't find old go version like 1.5.

[root@localhost clamav-yara]# go version
go version go1.14 linux/amd64

from clamav-yara.

hapablanha avatar hapablanha commented on July 28, 2024

Appears to run into problem here...

definitions.go

// Extract the file tar.gz
func extractFiles(data []byte, fileType definitionType) (map[definitionExtensionType]definitionFile, error) {

	files := make(map[definitionExtensionType]definitionFile)

	// extract the data only and cut the header off
	tarGzip := data[512:]

from clamav-yara.

s0i37 avatar s0i37 commented on July 28, 2024

+1

from clamav-yara.

s0i37 avatar s0i37 commented on July 28, 2024

The solve:

wget http://database.clamav.net/main.cvd
wget https://raw.githubusercontent.com/mattulm/volgui/master/tools/clamav_to_yara.py
sigtool -u main.cvd
./clamav_to_yara.py -f main.ndb -o clamav.yara

from clamav-yara.

AnomalRoil avatar AnomalRoil commented on July 28, 2024

The issue is that the default URL used to download the ClavAV database was set to a HTTPS URL that is now down.

See #6 that's reversing to the ClamAV default HTTP URL.

from clamav-yara.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.