Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 89da538

Browse files
author
kylekirkby
committed
First working commit. Clone and run to see progress.
1 parent 53e9c43 commit 89da538

File tree

5 files changed

+582
-144
lines changed

5 files changed

+582
-144
lines changed

‎config.dat‎

-46 Bytes
Binary file not shown.

‎display.py‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ class Display:
55
def __init__(self):
66

77
self.appName = "ExploitSearch"
8+
self.mainMenu()
89

910
def mainMenu(self):
1011

@@ -32,8 +33,3 @@ def mainMenu(self):
3233
print(menu)
3334

3435

35-
36-
if __name__ == "__main__":
37-
38-
new = Display()
39-
new.mainMenu()

‎exploitdb.py‎

Lines changed: 2 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -14,129 +14,9 @@ def __init__(self,search):
1414
self.os = os.name
1515
self.foundList = []
1616
self.headerList = []
17-
self.width = None
18-
self.height = None
1917

20-
21-
22-
#Calls to main Functions of program
23-
24-
self.searchDB(search)
25-
self.getTerminalSize()
26-
resultsPagesList = self.createPageLists(self.foundList)
27-
self.createPageListing(resultsPagesList)
28-
29-
def getTerminalSize(self):
30-
31-
env = os.environ
32-
def ioctl_GWINSZ(fd):
33-
try:
34-
import fcntl, termios, struct, os
35-
cr = struct.unpack('hh', fcntl.ioctl(fd, termios.TIOCGWINSZ,
36-
'1234'))
37-
except:
38-
return
39-
return cr
40-
cr = ioctl_GWINSZ(0) or ioctl_GWINSZ(1) or ioctl_GWINSZ(2)
41-
if not cr:
42-
try:
43-
fd = os.open(os.ctermid(), os.O_RDONLY)
44-
cr = ioctl_GWINSZ(fd)
45-
os.close(fd)
46-
except:
47-
pass
48-
if not cr:
49-
cr = (env.get('LINES', 25), env.get('COLUMNS', 80))
50-
51-
### Use get(key[, default]) instead of a try/catch
52-
#try:
53-
# cr = (env['LINES'], env['COLUMNS'])
54-
#except:
55-
# cr = (25, 80)
56-
57-
self.width = int(cr[1])
58-
self.height = int(cr[0])
59-
60-
61-
62-
63-
def createTempFile(self,path): #Writes and opens a temporary file with the shell code in it.
64-
with open(path,mode="r",encoding="utf-8") as myFile:
65-
content = myFile.readlines()
66-
67-
with tempfile.NamedTemporaryFile(mode="w",delete=False) as temp:
68-
69-
for line in content:
70-
temp.write(line)
71-
72-
temp.flush()
73-
74-
if self.os == "nt": #NT Systems - Windows
75-
76-
os.system('start notepad.exe ' + temp.name)
77-
78-
else: #Linux Systems
79-
os.system('%s %s' % (os.getenv('EDITOR'), temp.name))
80-
81-
def createPageLists(self,results):
82-
83-
#Too much data to output at once format into pages
84-
resultsPagesList = []
85-
86-
totalResults = len(results)
87-
88-
if totalResults > 10:
89-
90-
totalPages = int(totalResults // 10)
91-
92-
if (totalResults % 10) > 0:
93-
94-
totalPages += 1
95-
96-
97-
98-
for page in range(1,totalPages + 1):
99-
100-
resultsList = []
101-
102-
#Counter Variables for creating lists for each page
103-
104-
endNum = (page * 10)
105-
106-
startNum = (page * 10) - 10
107-
108-
#If last page use the total pages variable as the end number
109-
110-
if endNum > totalResults:
111-
112-
endNum = totalResults
113-
114-
#Create lists
115-
116-
resultsList = results[startNum:endNum]
117-
118-
resultsPagesList.append(resultsList)
119-
120-
121-
#10 or less results = one page
122-
123-
else:
124-
125-
endNum = totalResults
126-
127-
startNum = 0
128-
129-
#Create lists
130-
131-
resultsList = results[startNum:endNum]
132-
133-
resultsPagesList.append(resultsList)
134-
135-
136-
return resultsPagesList
137-
138-
def searchDB(self,search):
139-
18+
def searchDB(self):
19+
search = self.search
14020
openFile = open(self.file, "r")
14121

14222
reader = csv.reader(openFile)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /