Skip to content

Commit 0e96c3c

Browse files
committed
Upgrading to 0.6.0
1 parent 0a34194 commit 0e96c3c

32 files changed

+408
-456
lines changed

README.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Since version 0.42 theZoo have been going dramatic changes. It now runs in both
4242
The current default state of theZoo runtime is the CLI which is inspired by MSF. The following files and directories are responsible for the application's behaviour.
4343

4444
### /conf
45-
The conf folder holds files relevant to the particular running of the program but are not part of the application. You can find the EULA file in the conf, the current database version, the CSV index file and more.
45+
The conf folder holds files relevant to the particular running of the program but are not part of the application. You can find the EULA file in the conf and more.
4646
### /imports
4747
Contains .py and .pyc import files used by the rest of the application
4848
### /malwares
@@ -52,17 +52,17 @@ Since mdbv0.2 is stable for the command line arguments (where as of 0.42 we are
5252

5353

5454
## Directory Structure:
55-
Each directory is composed of 5 files:
55+
Each directory is composed of 4 files:
5656
- Malware files in an encrypted ZIP archive.
5757
- SHA256 sum of the 1st file.
5858
- MD5 sum of the 1st file.
5959
- Password file for the archive.
60-
- index.log file for the indexer.
6160

6261

63-
## Structure of index.csv
64-
The main index.csv is the DB which you will look in to find malwares indexed on your drive. We use the , charachter as the delimiter to our CSVs.
65-
The structure is al follows:
62+
63+
## Structure of maldb.db
64+
maldb.db is the DB which theZoo is acting upon to find malwares indexed on your drive.
65+
The structure is as follows:
6666

6767
uid,location,type,name,version,author,language,date
6868

@@ -87,13 +87,19 @@ Bugs and Reports
8787
The repository holding all files is currently
8888
https://github.com/ytisf/theZoo
8989

90-
##Change Log for v0.50:
90+
## Change Log for v0.60:
91+
- [x] Moved DB to SQLite3.
92+
- [x] Searching overhaul to a freestyle fashion.
93+
- [x] Fixed "get" command.
94+
- [x] More & more malwares.
95+
96+
## Change Log for v0.50:
9197
- [x] Better and easier UI.
9298
- [x] Aligned printing of malwares.
9399
- [x] Command line arguments are now working.
94100
- [x] Added 10 more malwares (cool ones) to the DB.
95101

96-
##Change Log for v0.42:
102+
## Change Log for v0.42:
97103
- [x] Fix EULA for proper disclaimer.
98104
- [x] More precise searching and indexing including platform and more.
99105
- [x] Added 10 new malwares.
@@ -113,7 +119,7 @@ The repository holding all files is currently
113119
- [X] More documentation has been added.
114120
- [X] Removed debugging function which were dead in the code.
115121

116-
##Predicted Change Log for v1.0
122+
## Predicted Change Log for v1.0
117123
- [ ] Fix auto-complete for malware frameworks.
118124
- [ ] Better UI features.
119125
- [ ] Consider changing DB to XML or SQLite3.

conf/index.csv

Lines changed: 0 additions & 69 deletions
This file was deleted.

conf/maldb.db

10 KB
Binary file not shown.

imports/db_handler.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import sqlite3 as lite
2+
from imports import globals
3+
import sys
4+
5+
6+
class DBHandler:
7+
8+
def __init__(self):
9+
try:
10+
self.con = lite.connect(globals.vars.db_path)
11+
self.cur = self.con.cursor()
12+
except lite.Error as e:
13+
print "An error occurred:", e.args[0]
14+
sys.exit()
15+
16+
def get_full_details(self):
17+
return self.cur.execute("SELECT * FROM Malwares").fetchall()
18+
19+
def get_partial_details(self):
20+
return self.cur.execute("SELECT ID, TYPE, LANGUAGE, ARCHITECTURE, PLATFORM, NAME FROM Malwares").fetchall()
21+
22+
def get_mal_names(self):
23+
# Sqlite3 returns a tuple even if a single value is returned
24+
# We use x[0] for x to unpack the tuples
25+
return [val[0] for val in self.cur.execute("SELECT NAME FROM Malwares").fetchall()]
26+
27+
def query(self, query, param=''):
28+
try:
29+
return self.cur.execute(query, param).fetchall()
30+
except lite.Error as e:
31+
print "An error occurred:", e.args[0]
32+
sys.exit()

imports/eula_handler.py

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,32 @@
11
#!/usr/bin/env python
22

3-
#Malware DB - the most awesome free malware database on the air
4-
#Copyright (C) 2014, Yuval Nativ, Lahad Ludar, 5Fingers
3+
# Malware DB - the most awesome free malware database on the air
4+
# Copyright (C) 2014, Yuval Nativ, Lahad Ludar, 5Fingers
55

6-
#This program is free software: you can redistribute it and/or modify
7-
#it under the terms of the GNU General Public License as published by
8-
#the Free Software Foundation, either version 3 of the License, or
6+
# This program is free software: you can redistribute it and/or modify
7+
# it under the terms of the GNU General Public License as published by
8+
# the Free Software Foundation, either version 3 of the License, or
99
#(at your option) any later version.
1010

11-
#This program is distributed in the hope that it will be useful,
12-
#but WITHOUT ANY WARRANTY; without even the implied warranty of
13-
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14-
#GNU General Public License for more details.
11+
# This program is distributed in the hope that it will be useful,
12+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
# GNU General Public License for more details.
1515

16-
#You should have received a copy of the GNU General Public License
17-
#along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
# You should have received a copy of the GNU General Public License
17+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
1818

1919
import sys
20+
import os
2021
from imports import globals
2122

2223

2324
class EULA:
2425

25-
def __init__(self, langs = None, oneRun=True):
26+
def __init__(self, langs=None, oneRun=True):
2627
#self.oneRun = oneRun
2728
self.check_eula_file()
28-
#self.prompt_eula()
29+
# self.prompt_eula()
2930

3031
def check_eula_file(self):
3132
try:
@@ -36,13 +37,13 @@ def check_eula_file(self):
3637

3738
def prompt_eula(self):
3839
globals.init()
39-
#os.system('clear')
40+
os.system('cls' if os.name == 'nt' else 'clear')
4041
print globals.bcolors.RED
4142
print '_____________________________________________________________________________'
4243
print '| ATTENTION!!! ATTENTION!!! ATTENTION!!! |'
4344
print '| ' + globals.vars.appname + ' v' + globals.vars.version + ' |'
4445
print '|___________________________________________________________________________|'
45-
print '|This program contain live and dangerous malware files |'
46+
print '|This program contains live and dangerous malware files |'
4647
print '|This program is intended to be used only for malware analysis and research |'
4748
print '|and by agreeing the EULA you agree to only use it for legal purposes and |'
4849
print '|studying malware. |'
@@ -51,10 +52,11 @@ def prompt_eula(self):
5152
print '|infect you machines will live and dangerous malwares!. |'
5253
print '|___________________________________________________________________________|'
5354
print globals.bcolors.WHITE
54-
eula_answer = raw_input('Type YES in captial letters to accept this EULA.\n > ')
55+
eula_answer = raw_input(
56+
'Type YES in captial letters to accept this EULA.\n > ')
5557
if eula_answer == 'YES':
5658
new = open(globals.vars.eula_file, 'a')
5759
new.write(eula_answer)
5860
else:
5961
print 'You need to accept the EULA.\nExiting the program.'
60-
sys.exit(0)
62+
sys.exit(0)

0 commit comments

Comments
 (0)