Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1cc3eaa0fa | |||
| bf65c3cf45 | |||
| 456a1508c0 | |||
| 3991f1625f | |||
| 4c1493506d | |||
| 80e75061da | |||
| 5b48737cc7 | |||
| da2dac70ac | |||
| 8c8ea1209b | |||
| df3718a06c |
+1
-1
@@ -26,7 +26,7 @@ RUN echo 'http://dl-cdn.alpinelinux.org/alpine/v3.9/main' >> /etc/apk/repositori
|
||||
RUN apk --update add --no-cache nmap \
|
||||
nmap-nselibs \
|
||||
nmap-scripts \
|
||||
curl-dev==7.64.0-r3
|
||||
curl-dev==7.64.0-r5
|
||||
|
||||
WORKDIR /app/cameradar
|
||||
COPY --from=build-env /go/src/github.com/Ullaakut/cameradar/dictionaries/ /app/dictionaries/
|
||||
|
||||
@@ -76,6 +76,8 @@ e.g.: `docker run -t ullaakut/cameradar -t 192.168.100.0/24` will scan the ports
|
||||
|
||||
Only use this solution if for some reason using docker is not an option for you or if you want to locally build Cameradar on your machine.
|
||||
|
||||
**WARNING**: Manually building the binary will **NOT WORK** for any camera that uses **DIGEST AUTHENTICATION** [if your version of `curl` is over `7.64.0`](https://github.com/Ullaakut/cameradar/pull/252), which is most likely the case. For more information, see [this response on the subject from the author of curl](https://stackoverflow.com/a/59778142/4145098).
|
||||
|
||||
### Dependencies
|
||||
|
||||
* `go` (> `1.10`)
|
||||
@@ -85,9 +87,8 @@ Only use this solution if for some reason using docker is not an option for you
|
||||
### Steps to install
|
||||
|
||||
1. `go get github.com/Ullaakut/cameradar/v5`
|
||||
2. `cd $GOPATH/src/github.com/Ullaakut/cameradar`
|
||||
3. `cd cmd/cameradar`
|
||||
4. `go install`
|
||||
2. `cd $GOPATH/src/github.com/Ullaakut/cameradar/cmd/cameradar`
|
||||
3. `go install`
|
||||
|
||||
The `cameradar` binary is now in your `$GOPATH/bin` ready to be used. See command line options [here](#command-line-options).
|
||||
|
||||
@@ -207,13 +208,13 @@ Default: `false`
|
||||
|
||||
#### Docker build
|
||||
|
||||
To build the docker image, simply run `docker build -t . cameradar` in the root of the project.
|
||||
To build the docker image, simply run `docker build . -t cameradar` in the root of the project.
|
||||
|
||||
Your image will be called `cameradar` and NOT `ullaakut/cameradar`.
|
||||
|
||||
#### Go build
|
||||
|
||||
1. `go get github.com/Ullaakut/cameradar/v5`
|
||||
1. `go get github.com/Ullaakut/cameradar`
|
||||
2. `cd $GOPATH/src/github.com/Ullaakut/cameradar`
|
||||
3. `cd cmd/cameradar`
|
||||
4. `go install`
|
||||
@@ -236,7 +237,7 @@ You can still find it under the 1.1.4 tag on this repo, however it was slower an
|
||||
|
||||
> How to use the Cameradar library for my own project?
|
||||
|
||||
See the example in `/cmd/cameradar`. You just need to run `go get github.com/Ullaakut/cameradar/v5` and to use the `cameradar` package in your code. You can find the documentation on [godoc](https://godoc.org/github.com/ullaakut/cameradar).
|
||||
See the example in `/cmd/cameradar`. You just need to run `go get github.com/Ullaakut/cameradar` and to use the `cameradar` package in your code. You can find the documentation on [godoc](https://godoc.org/github.com/ullaakut/cameradar).
|
||||
|
||||
> I want to scan my own localhost for some reason, and it does not work! What's going on?
|
||||
|
||||
|
||||
@@ -17,19 +17,28 @@
|
||||
],
|
||||
"passwords": [
|
||||
"",
|
||||
"0000",
|
||||
"00000",
|
||||
"111111",
|
||||
"1111111",
|
||||
"123",
|
||||
"1234",
|
||||
"12345",
|
||||
"123456",
|
||||
"1234567",
|
||||
"12345678",
|
||||
"123456789",
|
||||
"12345678910",
|
||||
"4321",
|
||||
"666666",
|
||||
"6fJjMKYx",
|
||||
"888888",
|
||||
"9999",
|
||||
"admin",
|
||||
"Admin",
|
||||
"admin123",
|
||||
"administrator",
|
||||
"Administrator",
|
||||
"aiphone",
|
||||
"camera",
|
||||
"fliradmin",
|
||||
@@ -43,15 +52,19 @@
|
||||
"pass",
|
||||
"password",
|
||||
"password123",
|
||||
"qwerty",
|
||||
"qwerty123",
|
||||
"reolink",
|
||||
"root",
|
||||
"service",
|
||||
"supervisor",
|
||||
"support",
|
||||
"system",
|
||||
"tlJwpbo6",
|
||||
"toor",
|
||||
"tp-link",
|
||||
"ubnt",
|
||||
"user",
|
||||
"wbox123",
|
||||
"Y5eIMz3C"
|
||||
]
|
||||
|
||||
@@ -66,6 +66,14 @@ ch001.sdp
|
||||
ch01.264
|
||||
ch01.264?
|
||||
ch01.264?ptype=tcp
|
||||
ch1_0
|
||||
ch2_0
|
||||
ch3_0
|
||||
ch4_0
|
||||
ch1/0
|
||||
ch2/0
|
||||
ch3/0
|
||||
ch4/0
|
||||
ch0_0.h264
|
||||
ch0_unicast_firststream
|
||||
ch0_unicast_secondstream
|
||||
|
||||
@@ -78,7 +78,6 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW
|
||||
github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
|
||||
github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc=
|
||||
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
|
||||
github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw=
|
||||
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
@@ -139,7 +138,6 @@ golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5h
|
||||
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223 h1:DH4skfRX4EBpamg7iV4ZlCpblAHI6s6TDM39bFZumv8=
|
||||
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
|
||||
@@ -37,13 +37,12 @@ func (s *Scanner) Scan() ([]Stream, error) {
|
||||
|
||||
func (s *Scanner) scan(nmapScanner nmap.ScanRunner) ([]Stream, error) {
|
||||
results, warnings, err := nmapScanner.Run()
|
||||
if err != nil {
|
||||
return nil, s.term.FailStepf("error while scanning network: %v", err)
|
||||
}
|
||||
|
||||
for _, warning := range warnings {
|
||||
s.term.Infoln("[Nmap Warning]", warning)
|
||||
}
|
||||
if err != nil {
|
||||
return nil, s.term.FailStepf("error while scanning network: %v", err)
|
||||
}
|
||||
|
||||
// Get streams from nmap results.
|
||||
var streams []Stream
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
module github.com/Ullaakut/cameradar/magefile
|
||||
|
||||
go 1.16
|
||||
|
||||
require (
|
||||
github.com/Ullaakut/disgo v0.3.1
|
||||
github.com/fatih/color v1.10.0 // indirect
|
||||
github.com/magefile/mage v1.11.0
|
||||
github.com/stretchr/testify v1.7.0 // indirect
|
||||
)
|
||||
@@ -0,0 +1,23 @@
|
||||
github.com/Ullaakut/disgo v0.3.1 h1:BGGVHynji41KGuGI02ztTCnILRvyzlvmiCRl5bBpjKk=
|
||||
github.com/Ullaakut/disgo v0.3.1/go.mod h1:/CSvpnYVSKOeh2dvUvx9cXshzz2t7T1/lRO/MrFj3fI=
|
||||
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/fatih/color v1.10.0 h1:s36xzo75JdqLaaWoiEHk767eHiwo0598uUxyfiPkDsg=
|
||||
github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM=
|
||||
github.com/magefile/mage v1.11.0 h1:C/55Ywp9BpgVVclD3lRnSYCwXTYxmSppIgLeDYlNuls=
|
||||
github.com/magefile/mage v1.11.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A=
|
||||
github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8=
|
||||
github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
||||
github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
|
||||
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae h1:/WDfKMnPU+m5M4xB+6x4kaepxRw6jWvR5iDRdvjHgy8=
|
||||
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
@@ -0,0 +1,109 @@
|
||||
//+build mage
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/magefile/mage/sh"
|
||||
"github.com/Ullaakut/disgo"
|
||||
"github.com/Ullaakut/disgo/style"
|
||||
)
|
||||
|
||||
var supportedPlatforms = map[string]string{
|
||||
"linux/amd64": "ullaakut/cameradar:amd64",
|
||||
"linux/386": "ullaakut/cameradar:386",
|
||||
"linux/arm64": "ullaakut/cameradar:arm64",
|
||||
"linux/arm/v7": "ullaakut/cameradar:armv7",
|
||||
//"linux/riscv64": "ullaakut/cameradar:riscv64", // UNSUPPORTED.
|
||||
//"linux/ppc64le": "ullaakut/cameradar:ppc64le", // UNSUPPORTED.
|
||||
//"linux/s390x": "ullaakut/cameradar:s390x", // UNSUPPORTED.
|
||||
//"linux/arm/v6": "ullaakut/cameradar:armv6", // UNSUPPORTED.
|
||||
}
|
||||
|
||||
var Default = Build
|
||||
|
||||
// Follows https://www.docker.com/blog/multi-platform-docker-builds/.
|
||||
func Build() error {
|
||||
term := disgo.NewTerminal(disgo.WithColors(true))
|
||||
|
||||
term.StartStep("Building images for all platforms")
|
||||
term.Infof("Builds planned for %v\n", supportedPlatforms)
|
||||
for platform, name := range supportedPlatforms {
|
||||
term.Infoln("Building image for", platform, "at", name)
|
||||
|
||||
// docker buildx build --platform linux/arm/v7 -t ullaakut/cameradar:armv7 .
|
||||
if err := sh.Run("docker", "buildx", "build", "--platform", platform, "-t", name, "../../"); err != nil {
|
||||
return term.FailStepf("unable to build image: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
term.Infoln(style.Success("Cross-platform docker build successful."))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func Publish() error {
|
||||
term := disgo.NewTerminal(disgo.WithColors(true))
|
||||
|
||||
term.StartStep("Pushing images to DockerHub")
|
||||
term.Infoln("Pushing ullaakut/cameradar:latest")
|
||||
if err := sh.Run("docker", "push", "ullaakut/cameradar:latest"); err != nil {
|
||||
return term.FailStepf("unable to push latest docker images to docker hub: %v", err)
|
||||
}
|
||||
|
||||
if version, exists := os.LookupEnv("CAMERADAR_VERSION"); exists {
|
||||
term.Infoln("Pushing ullaakut/cameradar:"+version)
|
||||
if err := sh.Run("docker", "push", "ullaakut/cameradar:"+version); err != nil {
|
||||
return term.FailStepf("unable to push versionned docker images to docker hub: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
term.StartStep("Pushing images to GitHub Packages")
|
||||
term.Infoln("Pushing docker.pkg.github.com/ullaakut/cameradar/cameradar:latest")
|
||||
if err := sh.Run("docker", "tag", "ullaakut/cameradar:latest", "docker.pkg.github.com/ullaakut/cameradar/cameradar:latest"); err != nil {
|
||||
return term.FailStepf("unable to push latest docker images to docker hub: %v", err)
|
||||
}
|
||||
if err := sh.Run("docker", "push", "docker.pkg.github.com/ullaakut/cameradar/cameradar:latest"); err != nil {
|
||||
return term.FailStepf("unable to push latest docker images to docker hub: %v", err)
|
||||
}
|
||||
|
||||
if version, exists := os.LookupEnv("CAMERADAR_VERSION"); exists {
|
||||
term.Infoln("Pushing docker.pkg.github.com/ullaakut/cameradar/cameradar:"+version)
|
||||
if err := sh.Run("docker", "tag", "ullaakut/cameradar:"+version, "docker.pkg.github.com/ullaakut/cameradar/cameradar:"+version); err != nil {
|
||||
return term.FailStepf("unable to push latest docker images to docker hub: %v", err)
|
||||
}
|
||||
if err := sh.Run("docker", "push", "ullaakut/cameradar:"+version); err != nil {
|
||||
return term.FailStepf("unable to push versionned docker images to docker hub: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
term.StartStep("Creating manifest(s) for cross platform builds")
|
||||
|
||||
var manifestImages []string
|
||||
for _, image := range supportedPlatforms {
|
||||
manifestImages = append(manifestImages, image)
|
||||
}
|
||||
|
||||
args := []string{"manifest", "create", "--amend", "ullaakut/cameradar:latest"}
|
||||
args = append(args, manifestImages...)
|
||||
|
||||
// docker manifest create ullaakut/cameradar:latest ullaakut/cameradar:amd64 ullaakut/cameradar:armv7 [...]
|
||||
if err := sh.Run("docker", args...); err != nil {
|
||||
return term.FailStepf("unable to create manifest: %v", err)
|
||||
}
|
||||
|
||||
if version, exists := os.LookupEnv("CAMERADAR_VERSION"); exists {
|
||||
args = []string{"manifest", "create", "--amend", "ullaakut/cameradar:"+version}
|
||||
args = append(args, manifestImages...)
|
||||
|
||||
if err := sh.Run("docker", args...); err != nil {
|
||||
return term.FailStepf("unable to create manifest: %v", err)
|
||||
}
|
||||
}
|
||||
term.EndStep()
|
||||
|
||||
term.Infoln(style.Success("Images published successfully."))
|
||||
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user