forked from OWASP/SecureTea-Project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SecureTea.py
38 lines (29 loc) · 922 Bytes
/
SecureTea.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
#!/bin/python
# -*- coding: utf-8 -*-
"""Docstring."""
import os
import platform
import distro
import time
from securetea.core import SecureTea
# get3grams required for WAF module
from securetea.lib.waf.Server.utils import get3Grams
if __name__ == '__main__':
secT = SecureTea()
try:
time.sleep(5)
platfom = platform.system()
if platfom == 'Linux':
command = 'sudo pm-suspend'
os_name = distro.name()[0]
os_major_version = distro.version()[1].split('.')[0]
if os_name == 'Ubuntu' and int(os_major_version) >= 16:
command = 'systemctl suspend'
os.system(command)
if platfom == 'Darwin':
os.system('pmset sleepnow')
if platfom == 'Windows':
os.system('rundll32.exe powerprof.dll, SetSuspendState 0,1,0')
except Exception as e:
print(e)
secT.run()