Skip to content

Commit 6ed2c10

Browse files
committed
upload on git
0 parents  commit 6ed2c10

File tree

12 files changed

+10128
-0
lines changed

12 files changed

+10128
-0
lines changed

.DS_Store

6 KB
Binary file not shown.

.idea/.gitignore

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/SensitiveFile.iml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.vscode/launch.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "Launch Package",
9+
"type": "go",
10+
"request": "launch",
11+
"program": "Main.go",
12+
"mode": "debug",
13+
"env": {},
14+
"args": ["--url","https://fidibo.com/ " ,"--all"]
15+
}
16+
]
17+
}

Main.go

Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
package main
2+
3+
import (
4+
"crypto/tls"
5+
"encoding/json"
6+
"flag"
7+
"fmt"
8+
"io/ioutil"
9+
"net/http"
10+
"net/http/cookiejar"
11+
"os"
12+
"strconv"
13+
"strings"
14+
)
15+
16+
var justsuccess bool = false
17+
var successlist []string
18+
var httpcc http.Client
19+
20+
func main() {
21+
22+
http.DefaultTransport.(*http.Transport).TLSClientConfig = &tls.Config{InsecureSkipVerify: true}
23+
24+
address := flag.String("url", "", "url address https://google.com")
25+
gitfile := flag.Bool("git", false, "try git lists")
26+
Sensfile := flag.Bool("sens", false, "try sens lists")
27+
Envfile := flag.Bool("env", false, "try env lists")
28+
Shellfile := flag.Bool("shell", false, "try shellfile lists")
29+
Allfile := flag.Bool("all", false, "try all lists")
30+
success := flag.Bool("v", false, "show success result only")
31+
flag.Parse()
32+
if !*gitfile && !*Sensfile && !*Envfile && !*Shellfile {
33+
34+
*Allfile = true
35+
}
36+
if *Allfile {
37+
*gitfile = true
38+
*Sensfile = true
39+
*gitfile = true
40+
*Envfile = true
41+
}
42+
if *success {
43+
justsuccess = true
44+
}
45+
if *address == "" {
46+
println("please set url with --url or -h for help")
47+
}
48+
path, err := os.Getwd()
49+
if err != nil {
50+
println(err.Error())
51+
return
52+
}
53+
54+
jsonFile, err := os.Open(path + "/SensitiveList.json")
55+
if err != nil {
56+
fmt.Printf("%s", "Can not read json file")
57+
}
58+
byteValue, _ := ioutil.ReadAll(jsonFile)
59+
60+
// we initialize our Users array
61+
paths := SensitiveList{}
62+
63+
// we unmarshal our byteArray which contains our
64+
// jsonFile's content into 'users' which we defined above
65+
json.Unmarshal(byteValue, &paths)
66+
defer jsonFile.Close()
67+
jar, err := cookiejar.New(nil)
68+
if err != nil {
69+
println(err.Error())
70+
}
71+
72+
httpcc = http.Client{Jar: jar}
73+
if *gitfile {
74+
for i := 0; i < len(paths.Git); i++ {
75+
checkurl(*address+paths.Git[i].Path, paths.Git[i].Content, paths.Git[i].Lentgh)
76+
}
77+
}
78+
if *Sensfile {
79+
for i := 0; i < len(paths.Sensitive); i++ {
80+
checkurl(*address+paths.Sensitive[i].Path, paths.Sensitive[i].Content, paths.Sensitive[i].Lentgh)
81+
}
82+
}
83+
if *Envfile {
84+
for i := 0; i < len(paths.Env); i++ {
85+
checkurl(*address+paths.Env[i].Path, paths.Env[i].Content, paths.Env[i].Lentgh)
86+
}
87+
}
88+
if *Shellfile {
89+
for i := 0; i < len(paths.Shell); i++ {
90+
checkurl(*address+paths.Shell[i].Path, paths.Shell[i].Content, paths.Shell[i].Lentgh)
91+
}
92+
}
93+
fmt.Printf("%d %s", len(successlist), " Found")
94+
95+
if len(successlist) > 0 {
96+
97+
for _, v := range successlist {
98+
println(v)
99+
}
100+
}
101+
102+
}
103+
104+
func checkurl(url string, content string, len string) {
105+
106+
resp, err := httpcc.Head(url)
107+
108+
if err != nil {
109+
println(err.Error())
110+
resp, err = httpcc.Get(url)
111+
112+
}
113+
if err == nil {
114+
if !justsuccess {
115+
116+
fmt.Printf("Checking '%s', '%s',\n", url, resp.Status)
117+
}
118+
if resp.StatusCode == 200 {
119+
if resp.Header.Get("Content-Type") != "" {
120+
respcontetnt := resp.Header.Get("Content-Type")
121+
var ignore []string = []string{}
122+
if strings.Contains(content, "#") {
123+
arrayslpit := strings.Split(content, "#")
124+
for _, i := range arrayslpit {
125+
if i != "" {
126+
ignore = append(ignore, i)
127+
}
128+
129+
}
130+
}
131+
132+
if respcontetnt == content || content == "*" || checkifinarry(ignore, respcontetnt) {
133+
if len == "*" {
134+
135+
fmt.Printf("Success '%s', '%s', '%s',\n", url, resp.Status, resp.Header.Get("Content-Type"))
136+
successlist = append(successlist, url)
137+
} else {
138+
lennumber, err := strconv.ParseInt(len, 0, 64)
139+
if err == nil {
140+
if lennumber >= resp.ContentLength {
141+
fmt.Printf("Success '%s', '%s', '%s',\n", url, resp.Status, resp.Header.Get("Content-Type"))
142+
successlist = append(successlist, url)
143+
}
144+
}
145+
146+
}
147+
148+
}
149+
150+
}
151+
152+
} else {
153+
//fmt.Printf("'%s', '%s',\n", url, resp.Status)
154+
}
155+
156+
}
157+
}
158+
func checkifinarry(array []string, check string) bool {
159+
if len(array) == 0 {
160+
return false
161+
}
162+
for _, i2 := range array {
163+
if strings.Contains(check, i2) {
164+
return false
165+
}
166+
}
167+
return true
168+
}
169+
170+
type Sensitive struct {
171+
Path string `json:"path"`
172+
Content string `json:"content"`
173+
Lentgh string `json:"lentgh"`
174+
}
175+
type SensitiveList struct {
176+
Sensitive []Sensitive `json:"Sensitive"`
177+
Git []Sensitive `json:"Gitfile"`
178+
Env []Sensitive `json:Env`
179+
Shell []Sensitive `json:shell`
180+
}

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Sensitive File Founder on WebSite
2+
3+
4+
5+
To avoid mistakes you can enter custom settings for each route
6+
Sample config :
7+
8+
{
9+
"path" : "/test.txt",
10+
"content" : "#application/json#text/html",
11+
"lentgh" : "*"
12+
13+
}
14+
15+
16+
Content-Type:
17+
18+
content : "*" allow all responsgie and any header sets
19+
20+
content : "#application/json#text/html" all headers except (text/html , application/json) which are separated by #
21+
22+
content : "application/json" allow just application/json in response header
23+
24+
25+
Content-Length:
26+
lentgh : 10 allow response header Content-Length >= 10

SensitiveFile

6.2 MB
Binary file not shown.

0 commit comments

Comments
 (0)