Skip to content

Commit

Permalink
Cleaning up errors
Browse files Browse the repository at this point in the history
  • Loading branch information
DigvijayBhosale1729 committed Sep 19, 2022
1 parent 3a936ac commit ff90627
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 24 deletions.
2 changes: 0 additions & 2 deletions securetea/lib/antivirus/secureTeaAntiVirus.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ def __init__(self, debug=False, cred=None, use_clamav=False, use_yara=False):

# Create CoreEngine object

print("C0")

self.core_engine_obj = core_engine.CoreEngine(debug=debug,
config_path=self._CONFIG_PATH,
Expand Down Expand Up @@ -106,7 +105,6 @@ def start(self):
"Antivirus started.",
logtype="info"
)
print("C1")
self.core_engine_obj.start_engine()
except Exception as e:
self.logger.log(
Expand Down
4 changes: 2 additions & 2 deletions securetea/lib/log_monitor/server_log/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import time
import os
import datetime
import platform
import distro
import threading
from requests.utils import quote
import socket
Expand Down Expand Up @@ -185,7 +185,7 @@ def get_system_name():
Returns:
os_name (str): Name of the operating system
"""
os_name = platform.dist()[0]
os_name = distro.name()
return os_name.lower()


Expand Down
6 changes: 5 additions & 1 deletion securetea/lib/log_monitor/system_log/harmful_root_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ def __init__(self, debug=False):
return

# Path for file of harmful commands
self.COMMNAND_FILE_PATH = "/etc/securetea/log_monitor/system_log/harmful_command.txt"
if debug:
self.COMMNAND_FILE_PATH = "securetea/lib/log_monitor/system_log/harmful_command.txt"
else:
self.COMMNAND_FILE_PATH = "/etc/securetea/log_monitor/system_log/harmful_command.txt"

self.COMMAND = r'COMMAND=(.*\s)' # regex to extract commands
self.harmful_commands = utils.open_file(self.COMMNAND_FILE_PATH)
self.found_harmful = [] # list of harmful commands found
Expand Down
2 changes: 1 addition & 1 deletion securetea/lib/waf/Server/SecureTeaWaf.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def __init__(self,cred=None,debug=False):
"""
self.cred = cred
self.listen_ip="127.0.0.1"
self.port=8856
self.port=8865
self.mode=0


Expand Down
2 changes: 1 addition & 1 deletion securetea/lib/waf/Server/WafLogger.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def __init__(self,modulename,debug=False):
f_create = open("/etc/securetea/waf.log", "a")
f_create.close()
except Exception as e:
print(E)
print(e)


logger.SecureTeaLogger.__init__(self, modulename, debug)
Expand Down
3 changes: 2 additions & 1 deletion securetea/lib/waf/Server/reqHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def data_received(self, data):
method=self.parsed_data.command

headers=self.parsed_data.headers
self.host=headers["HOST"]
self.host=headers["HOST"].split(":")[0]

path=self.parsed_data.path

Expand Down Expand Up @@ -220,6 +220,7 @@ def sendRequest(self):
self.requester=Requester(self.transport)

try:
print("Self.host" + self.host)

self.requester.connect(self.host,self.redirect_table)
self.requester.send_data(self.data)
Expand Down
2 changes: 0 additions & 2 deletions securetea/lib/waf/Server/requester.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ def connect(self,host,redirect_table):


# Check whether the incoming Host is part of the backend server config
print(self.host)
print(redirect_table)

if self.host in redirect_table.keys():
host,port=redirect_table[host].split(":")
Expand Down
28 changes: 14 additions & 14 deletions securetea/lib/web_deface/config/dataset.csv
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
status,content
true,"# Welcome to nginx!

If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.

For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.

_Thank you for using nginx._

"
true,"

![Ubuntu Logo](icons/ubuntu-logo.png)
true,"![Ubuntu Logo](icons/ubuntu-logo.png)

Apache2 Default Page

Expand Down Expand Up @@ -82,3 +69,16 @@ Please report bugs specific to modules (such as PHP and others) to their
respective packages, not to the web server itself.

"
true,"

# Welcome to nginx!

If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.

For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.

_Thank you for using nginx._

"

0 comments on commit ff90627

Please sign in to comment.