-
Notifications
You must be signed in to change notification settings - Fork 5
/
sb0x.py
executable file
·91 lines (78 loc) · 1.79 KB
/
sb0x.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#!/usr/bin/env python2.7
"""
sb0x.py - Main shell
Author: Levi Nachamni (levi0x0)
Date: 20/05/2014
Version: 0.1
"""
import sys
import optparse
import os
try:
from core.tests import tests, init
tests = tests()
tests.test_python_version()
init()
tests.test_for_output()
except Exception as e:
print("\033[01;31m[ERROR] %s\033[00m" %(e) )
sys.exit(1)
from core.main import *
import api.auto
import api.std
"""
This CODE Use sb0x-project API this is short and Simple.
Some Functions you Can Find in the std.py Module
if Not Read the API Tutorial:
https://github.com/levi0x0/sb0x-project/wiki/API
"""
class sb0x_shell(object):
"""sb0x shell"""
def __init__(self):
self.prompt = "\033[01;35mMain => \033[00m"
def run(self):
while True:
options_array = options_array_system
api.auto.sb0x_complete(options_array)
self.run = raw_input(self.prompt)
if self.run == "load":
try:
load()
except Exception as e:
error(sys.exc_info()[0])
error(e.message)
elif self.run == "banner":
header()
elif self.run == "exit" or self.run == "q":
api.std.quit(0)
elif self.run == "help" or self.run == "?":
help();
else:
shell(self.run)
"""
The Main Fucntion Init the Code
"""
def main():
start = sb0x_shell()
start.run()
"""
The While loop is For The Exception
"""
if __name__ == '__main__':
parser = optparse.OptionParser(version=SB0X_VERSION)
parser.parse_args()
while True:
try:
LOOP_COUNT += 1
if LOOP_COUNT == 1:
api.std.cles()
header()
main()
except KeyboardInterrupt:
notify("\ntype 'q' to quit")
except EOFError:
notify("Ctrl + D Pressed")
api.std.quit(0)
except Exception as e:
error(e.message)
api.std.quit(1)