Skip to content

Commit 28d08e0

Browse files
author
Perkins
committed
First release, version 1.0
1 parent cd86913 commit 28d08e0

File tree

20 files changed

+497
-359
lines changed

20 files changed

+497
-359
lines changed

.idea/workspace.xml

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

DOCS/license.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
```
2+
Copyright 2016 Ekultek (Thomas Perkins)
3+
```
4+
```
5+
Permission is hereby granted, free of charge, to any person
6+
obtaining a copy of this software and associated documentation
7+
files (the "Software"), to deal in the Software without restriction,
8+
including without limitation the rights to use, copy, modify, merge,
9+
publish, distribute, sublicense, and/or sell copies of the Software,
10+
and to permit persons to whom the Software is furnished to do so,
11+
subject to the following conditions:
12+
```
13+
```
14+
The above copyright notice and this permission notice shall be
15+
included in all copies or substantial portions of the Software.
16+
```
17+
```
18+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
20+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
22+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.```

README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,43 @@
11
#PyBelt
22
####The hackers tool belt
3+
4+
PyBelt is a open source, hackers multi-tool much like a Gerber, it can be used for multiple purposes. No it does not come with a screw driver. but it does come with a port scanner! No it does not come with a knife, but it does come with a SQLi error based scanner! No it does not come with a can opener, it does however, come with a Dork Checker!
5+
Why use PyBelt? Well for one, it's written in Python, everybody likes Python. For two, you have multiple tools now at your finger tips, SQLi scanning, Dork checking, and port scanning all available in a free range quick motion with simple flags.
6+
7+
##ScreenShots
8+
SQL Injection scanning made easy, just provide a URL and watch it work
9+
![alt text](http://imgur.com/fPqz3In)
10+
11+
Dork checker, have some Dorks you're not sure of? Go ahead and run the Dork check with the Dork as an argument, it will pull 100 URLs and give you success rate for the Dork
12+
![alt text](http://imgur.com/a/gwHb4)
13+
14+
Simple port scanning, provide a host to scan and find the open ports to forward too
15+
![alt text](http://imgur.com/Otr8e3o)
16+
17+
##Usage
18+
19+
###Installation
20+
You can either clone the repository
21+
`git clone https://github.com/ekultek/pybelt.git`
22+
or download the latest release as a zip/tar ball [here](https://github.com/ekultek/pybelt.git)
23+
24+
25+
Once you have the program installed cd into the directory and run the following command:
26+
`pip install -r requirements.txt`
27+
This will install all of the programs needed libraries and should be able to be run from there.
28+
29+
###Functionality
30+
`python pybelt.py -p 127.0.0.1` Will run a port scan on your local host
31+
32+
`python pybelt.py -s http://example.com/php?id=2` Will run a SQLi scan on the given URL
33+
34+
`python pybelt.py -d idea?id=55` Will run a Dork check on the given Google Dork
35+
36+
##Misc info you probably don't care about
37+
38+
###License
39+
This program is licensed under the MIT license, you can the license in the DOCS folder
40+
41+
###Current version
42+
This program is currently in version 1.0, first release, this will be updated as the program grows
43+

lib/core/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from settings import RESERVED_PORTS
44
from settings import BANNER
55
from settings import RANDOM_COMMON_COLUMN
6+
from settings import LONG_LEGAL_DISCLAIMER
67
from settings import GOOGLE_TEMP_BLOCK_ERROR_MESSAGE
78
from settings import SQLI_ERROR_REGEX
89
from settings import SYNTAX_REGEX
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
http://www.bible-history.com/subcat.php?id=2
2+
http://www.vancouversupermoto.com/page.php?id=2
3+
http://www.putridflowers.com/music.php?id=2
4+
http://www.a-k-a.net/prod_detail.php?id=2
5+
http://www.vacationet.com/resort.php?id=2
6+
http://www.gov.ai/ministry.php?id=2
7+
http://www.dipintoguitars.com/product.php?id=2
8+
http://www.redseahotels.com/index.php?id=2
9+
http://www.jamestrussart.com/models_detail.php?id=2
10+
https://convivea.com/download.php?id=2
11+
http://www.scrivenerpublishing.com/journals.php?id=2
12+
http://www.ukipme.com/engineoftheyear/results.php?id=2
13+
http://www.mvvainc.com/project.php?id=2
14+
http://bmxmuseum.com/forums/viewforum.php?id=2
15+
http://bram.smartelectronix.com/plugins.php?id=2
16+
http://www.foxsister.com/index.php?id=2
17+
http://www.behavior.org/interest.php?id=2
18+
https://trainingcentre.unwomen.org/enrol/index.php?id=2
19+
http://x3t-infinity.com/Home.php?ID=2
20+
http://friendship-bracelets.net/tutorial.php?id=2
21+
http://www.rmco-inc.com/index.php?id=2
22+
http://www.genoma.com/product_page.php?id=2
23+
https://toxtown.nlm.nih.gov/text_version/locations.php?id=2
24+
http://traildays.us/index.php?id=2
25+
https://steamrep.com/group.php?id=2
26+
http://www.tidytowns.ie/interior.php?id=2
27+
http://vlab.co.in/ba_labs_all.php?id=2
28+
http://cleanoceanaction.org/index.php?id=2
29+
http://www.dancewebeurope.net/index.php?id=2
30+
http://www.floconsolutions.com/sub_page.php?id=2
31+
http://www.lakedirectory.net/page.php?id=2
32+
http://www.warrenk12nc.org/schools.php?id=2
33+
http://www.kyygames.com/games.php?id=2
34+
https://www.stopforumspam.com/forum/viewforum.php?id=2
35+
http://www.fjsoft.at/download.php?id=2
36+
http://www.techbridgegirls.org/index.php?id=2
37+
https://mahara.org/interaction/forum/view.php?id=2
38+
http://www.hrpub.org/journals/jour_archive.php?id=2
39+
https://mooc.campusvirtualsp.org/course/view.php?id=2
40+
http://www.vf-venieri.com/prodotto.php?id=2
41+
http://www.poupartsbakery.com/index.php?id=2
42+
http://smartmove.safetyline.wa.gov.au/course/view.php?id=2
43+
https://www.indiacgny.org/pages.php?id=2
44+
http://www.ventrilo.com/dlprod.php?id=2
45+
http://www.innofader.com/products.php?id=2
46+
https://support.steampowered.com/kb_cat.php?id=2
47+
http://theatre99.com/showdetail.php?id=2
48+
http://www.transitionyear.org/about.php?id=2
49+
http://ankn.uaf.edu/Resources/course/view.php?id=2
50+
http://dropbox.0pk.ru/viewtopic.php?id=2
51+
http://www.nysd.uscourts.gov/jury_handbook.php?id=2
52+
http://www.venusenvycomic.com/index.php?id=2
53+
https://primes.utm.edu/top20/page.php?id=2
54+
http://futuresinengineering.org/what.php?id=2
55+
http://immigration.go.tz/module1.php?id=2
56+
http://www.justiceforsergei.com/video.php?id=2
57+
http://www.richardsandoval.com/masa14/promo.php?id=2
58+
http://doyougotinsurance.com/index.php?id=2
59+
http://www.inquiryinaction.org/classroomactivities/activity.php?id=2
60+
https://peacenow.org/entry.php?id=21717
61+
http://zeogames.net/main/game.php?id=2
62+
https://boinc.berkeley.edu/dev/forum_forum.php?id=2
63+
http://animetamago.jp/title.php?id=2
64+
http://www.cathouseonthekings.com/video/webcam.php?id=2
65+
http://www.montbell.us/stores/disp.php?id=2
66+
http://blind.msstate.edu/research/projects/project.php?id=2
67+
http://www.etceteratheatre.com/index.php?id=2
68+
http://www.etceteratheatre.com/details.php?show_id=2410
69+
http://www.leonardo-academy.org/totara/program/details.php?id=2
70+
http://crosscountyar.org/page.php?id=2
71+
http://senseable.mit.edu/trashtrack/visualizations.php?id=2
72+
http://dvaction.northwestern.edu/parentdetail.php?id=2
73+
https://ride2recovery.com/page.php?ID=2
74+
http://www.uncrcpc.org/index.php?id=2
75+
http://www.phparchitecture.com/howto_show.php?id=2
76+
http://www.rumbalotte-continua.de/menuepunkte_inhalt.php?id=2
77+
https://www.meted.ucar.edu/training_course.php?id=2
78+
http://www.cps-cidpc.com/index.php?id=2
79+
http://flashmaths.co.uk/viewFlash.php?id=2
80+
http://www.davidchancellor.com/docs/photos.php?id=2:4
81+
http://www.angelvestgroup.com/info.php?id=2
82+
http://ww3.microtek.com.tw/eu/modules/tinyd0/index.php?id=2
83+
http://www.tony-hawks.com/books.php?id=2
84+
http://www.theredwood.com/indexc.php?id=2
85+
http://www.iga.stir.ac.uk/conf.php?id=2
86+
http://www.jannahplace.com/hotels.php?id=2
87+
https://synopse.info/forum/viewforum.php?id=2
88+
http://www.apsf.org/resources_video_commentary.php?id=2
89+
http://www.guevaragallery.com/art.php?id=2
90+
http://www.wingits.com/products.php?id=2
91+
http://pakpips.com/team.php?id=2
92+
https://www.odysseyofthemind.com/practice/default_cat.php?Id=2
93+
http://www.mobile01.com/category.php?id=2
94+
http://www.eidosk.com/play_game.php?id=2
95+
https://www.facebook.com/pika.picapollo2/photos/pb.233886353328511.-2207520000.1465757435./1138991666151304/?type=3
96+
http://www.gsis.gov.ph/default.php?id=2
97+
http://www.scigames.org/game.php?id=2.

lib/core/port_scan/port_scanning.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import socket
2-
import sys
2+
from lib.core.settings import LOGGER
33
from lib.core.settings import RESERVED_PORTS
44

55

@@ -16,8 +16,7 @@ def connect_to_host(self):
1616
host = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
1717
for port in self.ports:
1818
try:
19-
sys.stdout.write("\rAttempting to connect to port: {} ".format(port))
20-
sys.stdout.flush()
19+
LOGGER.info("Attempting to connect to port: {}".format(port))
2120
attempt = host.connect_ex((self.host, port)) # Connect to the host
2221
if attempt: # If connection fails
2322
pass
@@ -27,6 +26,6 @@ def connect_to_host(self):
2726
pass
2827
host.close()
2928
if not self.connection_made:
30-
return "\nNo connections could be made."
29+
LOGGER.fatal("No connections could be made.")
3130
else:
32-
return "\nConnection made on port: {}.".format(''.join(str(self.connection_made)))
31+
return "Connection made on port: {}.".format(''.join(str(self.connection_made)))

lib/core/settings.py

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import random
21
import os
32
import uuid
43
import re
54
import logging
5+
import random
6+
import base64
67
from colorlog import ColoredFormatter
78

89
log_level = logging.INFO
@@ -33,13 +34,14 @@
3334
CLONE_LINK = "https://github.com/ekultek/pybelt.git"
3435

3536
# Basic legal disclaimer
36-
LEGAL_DISC = "legal disclaimer: This program is intended for learning purposes, any malicious intent is on you, it is the end users responsibility to obey all laws, regulations, and rules of your respective country or place of origin. For further information about this please see the legal information file under docs or run the --legal flag"
37+
LEGAL_DISC = "[!] legal disclaimer: This program is intended for learning purposes, any malicious intent is on you, it is the end users responsibility to obey all laws, regulations, and rules of your respective country or place of origin. For further information about this please see the legal information file under docs or run the --legal flag"
38+
LONG_LEGAL_DISCLAIMER = open("lib/core/text_files/legal.txt").read()
3739

3840
# Random dork to use for basic sqli searches
39-
RANDOM_DORK = random.choice(open("{}/lib/core/text_files/dorks.txt".format(PATH)).readlines())
41+
# RANDOM_DORK = random.choice(open("{}/lib/core/text_files/dorks.txt".format(PATH)).readlines())
4042

4143
# Random saying to display on the banner
42-
RANDOM_SAYING = random.choice(open("{}/lib/core/text_files/sayings.txt".format(PATH)).readlines())
44+
SAYING = "The Hackers ToolBelt.."
4345

4446
# Random common column names
4547
RANDOM_COMMON_COLUMN = random.choice(open("{}/lib/core/text_files/common_columns.txt".format(PATH)).readlines())
@@ -79,10 +81,9 @@
7981
### / ###/\033[0m %s
8082
8183
\033[94m%s
82-
%s\033[0m
8384
84-
\033[91m[!] %s\033[0m\n\n
85-
""" % (VERSION_STRING, RANDOM_SAYING.strip(), CLONE_LINK, LEGAL_DISC)
85+
%s\033[0m\n\n
86+
""" % (VERSION_STRING, SAYING.strip(), CLONE_LINK)
8687

8788
# Path the the search results from a dork scan
8889
DORK_SCAN_RESULTS_PATH = r"{}\lib\core\dork_check\scan_results".format(os.getcwd())
@@ -97,10 +98,10 @@
9798

9899
# List of reserved port numbers, these are the ports that you want to check
99100
RESERVED_PORTS = {
100-
1, 5, 7, 18, 20, 21, 22, 23, 25, 29, 37, 42, 43, 49, 53, 69, 70,
101-
79, 80, 103, 108, 109, 110, 115, 118, 119, 137, 139, 143, 150, 156,
102-
161, 179, 190, 194, 197, 389, 396, 443, 444, 445, 458, 546, 547, 563,
103-
569, 1080
101+
1, 5, 7, 18, 20, 21, 22, 23, 25, 29, 37, 42, 43, 49,
102+
53, 69, 70, 79, 80, 103, 108, 109, 110, 115, 118, 119, 137, 139,
103+
143, 150, 156, 161, 179, 190, 194, 197, 389, 396, 443, 444, 445, 458,
104+
546, 547, 563, 569, 1080
104105
}
105106

106107

@@ -109,3 +110,8 @@ def create_random_filename():
109110
>>> print(create_random_filename())
110111
56558c08-ee1f-40b4-b048-be4c4066f8b6 """
111112
return str(uuid.uuid4())
113+
114+
115+
def decode64(string):
116+
""" Decode a string from base64 """
117+
return base64.b64decode(string)

lib/core/sql_scan/sqli_scan.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,30 +63,30 @@ def add_union_based_injection(self):
6363
return union_based_injection
6464

6565
def sqli_search(self):
66+
""" Search for SQL injection in the provided URL[error based injection] """
6667
soup = []
6768
count = 0
6869
current_sqli_count = 0
6970
query = self.obtain_inject_query(self.url)
70-
current_sqli_check = [self.add_blind_based_to_url(),
71-
self.add_error_based_to_url(),
72-
self.add_union_based_injection()]
71+
current_sqli_check = [self.add_error_based_to_url,
72+
self.add_blind_based_to_url,
73+
self.add_union_based_injection]
7374

7475
LOGGER.info("Starting SQLi search")
7576
while self.vulnerable is False:
76-
for url in current_sqli_check[current_sqli_count]:
77-
self.url_syntax = [re.search(SYNTAX_REGEX, url).group()]
77+
for url in current_sqli_check[current_sqli_count]():
7878
data = urllib2.urlopen(url).read()
7979
soup = [BeautifulSoup(data, 'html.parser')]
8080
for html in soup:
8181
count += 1
8282
for regex in SQLI_ERROR_REGEX:
8383
if regex.findall(str(html)):
8484
self.vulnerable = True
85-
LOGGER.info("%s appears to have a SQL injection vulnerability at %s%s" % (
86-
self.url, query, self.url_syntax[count - 1]))
85+
return "%s appears to have a SQL injection vulnerability at %s" % (
86+
self.url, query)
8787
else:
8888
current_sqli_count += 1
8989
self.url_syntax = self.url_syntax[::]
9090
count = 0
9191
if self.vulnerable is False:
92-
LOGGER.warning("%s is not vulnerable to SQL injection, error, blind, or union based" % self.url)
92+
return "%s is not vulnerable to SQL injection." % self.url
File renamed without changes.

lib/core/text_files/legal.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
This program was written and created for learning purposes. Use of this program for malicious
2+
intents is extremely illegal and will not be tolerated, including, but not limited too:
3+
4+
* Database takeovers
5+
* Phishing attacks
6+
* Blackhat hacking of any kind
7+
* Any malicious intents
8+
9+
It is the end users responsibility to obey, all laws, rules, and regulations set forth by
10+
their state, territory, or any other place of residence. By continuing with the process of this
11+
program you agree that your actions are your own, and that you are liable for them.
12+
13+
Having said that, knowledge is not illegal and nobody can tell you to quit learning. Absorb as
14+
much information as humanly possible and put it into play. I hope you take as much away form
15+
this program as I did writing it.

0 commit comments

Comments
 (0)