Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
R4yGM committed Mar 5, 2020
1 parent 4d63a3d commit 3a2a11d
Show file tree
Hide file tree
Showing 9 changed files with 621 additions and 8 deletions.
10 changes: 2 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
# netscanner
netscanner - TCP/UDP scanner to find open or closed ports

## Install
to install you have to clone the repository
```shell
$ go get https://github.com/R4yGM/netscanner
```
# netscanner
netscanner - TCP/UDP scanner to find open or closed ports
6 changes: 6 additions & 0 deletions data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"version":"0.1",
"owner":"R4yan",
"github":"https://github.com/R4yGM/netscanner",
"help":"\nnetscanner 0.1\n \nUsage: netscanner <command>\n\nCommands:\n\n sp,scanport - scan a singular port: usage sp,scanport <protocol> <hostname> <port> (ex. scanport tcp 127.0.01 80)\n in,initscan - scan the first 1023 ports: usage in,initscan <protocol> <hostname>(ex. initscan tcp 127.0.0.1)"
}
61 changes: 61 additions & 0 deletions header/header.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
package header

import (
"math/rand"
"time"
)
var asciiArt1 =
`
=============================================================================
_
| | _
| |__ ___| |_ ___ ___ __ _ _ __ _ __ ___ _ __
| '_ \ / _ \ __/ __|/ __/ _' | '_ \| '_ \ / _ \ '__|
| | | | __/ |_\__ \ (_| (_| | | | | | | | __/ |
|_| |_|\___|\__|___/\___\__,_|_| |_|_| |_|\___|_|
`
var asciiArt2 =
`
=============================================================================
__ __ ______ ______ ______ ______ ______ __ __ __ __ ______ ______
/\ "-.\ \ /\ ___\ /\__ _\ /\ ___\ /\ ___\ /\ __ \ /\ "-.\ \ /\ "-.\ \ /\ ___\ /\ == \
\ \ \-. \ \ \ __\ \/_/\ \/ \ \___ \ \ \ \____ \ \ __ \ \ \ \-. \ \ \ \-. \ \ \ __\ \ \ __<
\ \_\\"\_\ \ \_____\ \ \_\ \/\_____\ \ \_____\ \ \_\ \_\ \ \_\\"\_\ \ \_\\"\_\ \ \_____\ \ \_\ \_\
\/_/ \/_/ \/_____/ \/_/ \/_____/ \/_____/ \/_/\/_/ \/_/ \/_/ \/_/ \/_/ \/_____/ \/_/ /_/
`
var asciiArt3 =
`
=============================================================================
+-+-+-+-+-+-+-+-+-+-+
|n|e|t|s|c|a|n|n|e|r|
+-+-+-+-+-+-+-+-+-+-+
`
var asciiArt4 =
`
=============================================================================
_____ _____ ____ _____ _____ _____ _____ _____ _____ _____
/ _ \/ __\/ \/ ___>/ \/ _ \/ _ \/ _ \/ __\/ _ \
| | || __|\- -/|___ || |--|| _ || | || | || __|| _ <
\__|__/\_____/ |__| <_____/\_____/\__|__/\__|__/\__|__/\_____/\__|\_/
`
func random(min, max int) int {
rand.Seed(time.Now().Unix())
return rand.Intn(max - min) + min
}

func AsciiTitle()(tex string){
num := random(1, 5)
switch num {
case 1:
return asciiArt1
case 2:
return asciiArt2
case 3:
return asciiArt3
case 4:
return asciiArt4
}
return
}
65 changes: 65 additions & 0 deletions info/info.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
package info

import (
"io/ioutil"
"encoding/json"
"fmt"
"os"
)
type Info struct {
Version int `json:"version"`
Owner string `json:"owner"`
Github string `json:"github"`
Help string `json:"help"`
}

func Version()(tex int){
file, _ := ioutil.ReadFile("info.json")

data := Info{}

_ = json.Unmarshal([]byte(file), &data)
tex = data.Version
return tex
}
func Owner()(tex string){

file, _ := ioutil.ReadFile("info.json")

data := Info{}

_ = json.Unmarshal([]byte(file), &data)
tex = data.Owner
return tex

}
func Github()(tex string){

file, _ := ioutil.ReadFile("./info.json")

data := Info{}

_ = json.Unmarshal([]byte(file), &data)
tex = data.Github
return tex

}
func Helper()(tex string){

jsonFile, err := os.Open("data.json")

if err != nil {
fmt.Println(err)
}

defer jsonFile.Close()

var in Info


responseData, err := ioutil.ReadAll(jsonFile)
json.Unmarshal(responseData, &in)
fmt.Println(in.Help)
return

}
2 changes: 2 additions & 0 deletions init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
echo netscanner initialize
go run ./netscanner help
Binary file added netscanner
Binary file not shown.
Loading

0 comments on commit 3a2a11d

Please sign in to comment.