Skip to content

Commit 6f86819

Browse files
Merge pull request #416 from Kalivarapubindusree/meta
Meta_Data_Info_Script
2 parents 3918978 + c966e23 commit 6f86819

12 files changed

Lines changed: 579 additions & 0 deletions

File tree

Dirbrute/Dirbrute_Script.py

Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
#!/usr/bin/env python3
2+
# -*- coding: utf-8 -*-
3+
#
4+
# dirbrute.py
5+
#
6+
# Copyright 2023 Kalivarapubindusree
7+
#
8+
# This program is free software; you can redistribute it and/or modify
9+
# it under the terms of the GNU General Public License as published by
10+
# the Free Software Foundation; either version 2 of the License, or
11+
# (at your option) any later version.
12+
#
13+
# This program is distributed in the hope that it will be useful,
14+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
# GNU General Public License for more details.
17+
#
18+
#
19+
20+
yellow = "\033[93m"
21+
green = "\033[92m"
22+
blue = "\033[94m"
23+
red = "\033[91m"
24+
bold = "\033[1m"
25+
end = "\033[0m"
26+
27+
28+
print(blue+bold+"""
29+
30+
\t _ _ _ _
31+
\t __| (_)_ __| |__ _ __ _ _| |_ ___
32+
\t / _` | | '__| '_ \| '__| | | | __/ _ \\
33+
\t| (_| | | | | |_) | | | |_| | || __/
34+
\t \__,_|_|_| |_.__/|_| \__,_|\__\___|"""+bold+"V: 1.6"+ end +blue+"""
35+
\t
36+
\t Coded by: Kalivarapubindusree
37+
\t ---------------
38+
"""+end)
39+
40+
41+
from concurrent.futures import ThreadPoolExecutor as executor
42+
import sys, time, requests
43+
from optparse import *
44+
45+
start = time.time()
46+
47+
def printer(word):
48+
sys.stdout.write(word + " \r")
49+
sys.stdout.flush()
50+
return True
51+
52+
53+
def presearch(domain, ext, url):
54+
if ext == 'Null' or ext == 'None':
55+
checkstatus(domain, url)
56+
elif url == "" or url == " ":
57+
pass
58+
else:
59+
ext = list(ext)
60+
ext.append("")
61+
for i in ext:
62+
if i == "" or i == "None":
63+
link = url
64+
else:
65+
link = url + "." + str(i)
66+
67+
checkstatus(domain, link)
68+
69+
70+
def checkstatus(domain, url):
71+
if url == "" or url == " ":
72+
pass
73+
elif url.startswith("#"):
74+
pass
75+
elif len(url) > 30:
76+
pass
77+
78+
else:
79+
printer("Testing: " + domain + url)
80+
#time.sleep(1)
81+
try:
82+
link = domain + url
83+
req = requests.head(link)
84+
st = str(req.status_code)
85+
if st.startswith("2"):
86+
print(green + "[+] "+st+" | Found: " + end + "[ " + url + " ]" + " \r")
87+
elif st.startswith("3"):
88+
link = req.headers['Location']
89+
#link = req.url
90+
print(yellow + "[*] "+st+" | Redirection From: " + end + "[ " + url + " ]" + yellow + " -> " + end + "[ " + link + " ]" + " \r")
91+
92+
elif st.startswith("1"):
93+
print(green + "[+] "+st+" | Found: " + end + "[ " + url + " ]" + " \r")
94+
elif st.startswith("4"):
95+
if st != '404':
96+
print(blue+"[!] "+st+" | Found: " + end + "[ " + url + " ]" + " \r")
97+
98+
#writer(link,'up')
99+
100+
return True
101+
102+
except Exception:
103+
#writer(url,'down')
104+
return False
105+
106+
107+
parser = OptionParser(green+"""
108+
109+
#Usage:"""+yellow+"""
110+
-t target host
111+
-w wordlist
112+
-d thread number (Optional, Default: 10)
113+
-e extensions (Optional, ex: html,php)
114+
"""+green+"""
115+
#Example:"""+yellow+"""
116+
python3 dirbrute.py -t domain.com -w dirlist.txt -d 20 -e php,html
117+
118+
"""+end)
119+
120+
def Main():
121+
try:
122+
parser.add_option("-t", dest="target", type="string", help="the target domain")
123+
parser.add_option("-w", dest="wordlist", type="string", help="wordlist file")
124+
parser.add_option("-d", dest="thread", type="int", help="the thread number")
125+
parser.add_option("-e", dest="extension", type="string", help="the extendions")
126+
(options, args) = parser.parse_args()
127+
if options.target == None or options.wordlist == None:
128+
print(parser.usage)
129+
exit(1)
130+
else:
131+
target = str(options.target)
132+
wordlist = str(options.wordlist)
133+
thread = str(options.thread)
134+
ext = str(options.extension)
135+
136+
if thread == "None":
137+
thread = 10
138+
else:
139+
thread = thread
140+
141+
if target.startswith("http"):
142+
target = target
143+
else:
144+
target = "http://" + target
145+
146+
if target.endswith("/"):
147+
target = target
148+
else:
149+
target = target + "/"
150+
151+
lines = len(open(wordlist).readlines())
152+
153+
print("["+ yellow + bold +"Info"+ end +"]:\n")
154+
print(blue + "["+red+"+"+blue+"] Target: " + end + target)
155+
print(blue +"["+red+"+"+blue+"] File: " + end + wordlist)
156+
print(blue +"["+red+"+"+blue+"] Length: " + end + str(lines))
157+
print(blue +"["+red+"+"+blue+"] Thread: " + end + str(thread))
158+
print(blue +"["+red+"+"+blue+"] Extension: " + end + str(ext))
159+
print("\n["+ yellow + bold +"Start Searching"+ end +"]:\n")
160+
161+
if ext == "None":
162+
ext = "Null"
163+
else:
164+
ext = ext.split(",")
165+
166+
urls = open(wordlist, 'r')
167+
with executor(max_workers=int(thread)) as exe:
168+
jobs = [exe.submit(presearch, target, ext, url.strip('\n')) for url in urls]
169+
170+
took = time.time() - start
171+
took = took / 60
172+
took = round(took,2)
173+
174+
print(red + "Took: " + end + str(took) + " m" + " \r")
175+
176+
print("\n\t* Happy Hacking *")
177+
except Exception as e:
178+
print(red + "#Error: " + end + str(e))
179+
exit(1)
180+
181+
if __name__ == '__main__':
182+
Main()

Dirbrute/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Dirbrute_Script
2+
3+
Short description of package/script
4+
5+
- This Script Was simple to setup
6+
- Need import ThreadPoolExecutor, concurrent.futures, sys, time, requests, optparse
7+
8+
## Setup instructions
9+
10+
Just Need to Import ThreadPoolExecutor, concurrent.futures, sys, time, requests, optparse then run the Dirbrute_Script.py file and for running python3 is must be installed!
11+
12+
## Detailed explanation of script, if needed
13+
14+
This Script Is Only for Dirbrute_Script use only!
15+
16+
## Author(s)
17+
18+
Kalivarapubindusree
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
#!/usr/bin/python
2+
3+
4+
from os import listdir
5+
from os.path import isfile, join
6+
try:
7+
from googlesearch import search # external package
8+
except ImportError:
9+
print("No module named 'google' found")
10+
import urllib
11+
import config_params
12+
from common_utils import menu_utils
13+
14+
VERSION = '1.0'
15+
16+
""" This module uses a Google hacking databases to facilitate dorks """
17+
18+
19+
def load_google_hacks_list():
20+
"""loading the list of google hacks"""
21+
google_hacks = [f for f in listdir(config_params.GOOGLE_HACKS_FOLDER)
22+
if isfile(join(config_params.GOOGLE_HACKS_FOLDER, f))]
23+
return google_hacks
24+
25+
26+
def get_strings(src_file):
27+
"""getting strings from file"""
28+
res = []
29+
try:
30+
res = open(src_file,'r').readlines()
31+
res = [x.strip() for x in res]
32+
except:
33+
res = []
34+
return res
35+
36+
37+
def append_sitename(strs, site):
38+
"""adding site name to strings, and testing if the query returns some response"""
39+
google_hacks = []
40+
for x in strs:
41+
google_hack = x+ ' site:'+site
42+
nres = results_in_google(google_hack)
43+
print("[+] %s results in: %s" % (nres, google_hack))
44+
if nres > 0:
45+
google_hacks.append(google_hack)
46+
return google_hacks
47+
48+
49+
def save_output(strs):
50+
"""printing results"""
51+
res = "\n".join(strs)
52+
print(res)
53+
54+
55+
def from_site(site_name, google_hack):
56+
57+
"""This creates and saves a list of Google dorks for a given site"""
58+
59+
source_file = join(config_params.GOOGLE_HACKS_FOLDER, google_hack)
60+
menu_utils.header(source_file)
61+
62+
if not isfile(source_file):
63+
menu_utils.error('Could not find source file!')
64+
strs = [line.rstrip('\n') for line in open(source_file)]
65+
if not strs:
66+
menu_utils.error("Can't get data from source file!")
67+
exit()
68+
69+
if site_name:
70+
strs = append_sitename(strs,site_name)
71+
72+
save_output(strs)
73+
74+
75+
def results_in_google(query):
76+
77+
"""This will return the number of results found in google using the given query"""
78+
79+
counter = 0
80+
try:
81+
for j in search(query, tld="com", num=1, stop=1, pause=2):
82+
counter += 1
83+
except urllib.error.HTTPError as e:
84+
menu_utils.error(e)
85+
86+
return counter

Google_Info_Script/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Google_Info_Script
2+
Short description of package/script
3+
4+
- This Script Was simple to setup
5+
- Need import os, listdir, isfile, join
6+
7+
## Setup instructions
8+
9+
Just Need to Import os, listdir, isfile, jointhen run the Google_Info_Script.py file and for running python3 is must be installed!
10+
11+
## Detailed explanation of script, if needed
12+
13+
This Script Is Only for Google Info Script use only!
14+
15+
## Author(s)
16+
17+
Kalivarapubindusree

HTTP_Server/HTTP_Server.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env python
2+
3+
import http.server
4+
import socketserver
5+
6+
print """
7+
*--------------------------------------*
8+
| programmed by : Kalivarapubindusree |
9+
| |
10+
*--------------------------------------*
11+
_ _ _ _
12+
| |__ __ _ ___| | _| | __ _| |__
13+
| '_ \ / _` |/ __| |/ / |/ _` | '_ \
14+
| | | | (_| | (__| <| | (_| | |_) |
15+
|_| |_|\__,_|\___|_|\_\_|\__,_|_.__/
16+
17+
SimpleHTTPServer
18+
----------------
19+
20+
"""
21+
22+
port = 4444
23+
24+
server = http.server.SimpleHTTPRequestHandler
25+
request = socketserver.TCPServer(("",port),server)
26+
print("server is up ....",port)
27+
request.serve_forever()

HTTP_Server/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# HTTP_Server
2+
3+
Short description of package/script
4+
5+
- This Script Was simple to setup
6+
- Need import http.server, socketserver
7+
8+
## Setup instructions
9+
10+
Just Need to Import http.server, socketserver then run the HTTP_Server.py file and for running python3 is must be installed!
11+
12+
## Detailed explanation of script, if needed
13+
14+
This Script Is Only for HTTP server checking and use only!
15+
16+
## Author(s)
17+
18+
Kalivarapubindusree

0 commit comments

Comments
 (0)