-
Notifications
You must be signed in to change notification settings - Fork 0
/
login.py
41 lines (32 loc) · 882 Bytes
/
login.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
#!/data/data/com.termux/files/usr/bin/env python
import getpass
import hashlib
import sys
import os
password = getpass.getpass()
filepass = open("/data/data/com.termux/files/usr/share/login/.pass", "r")
filepass = filepass.read().split("\n")[0]
password = password.encode()
password = hashlib.sha1(password).hexdigest()
if password != filepass:
print("Invalid password")
os.system("exit")
else:
prefix = "/data/data/com.termux/files/usr"
home = "/data/data/com.termux/files/home"
motd = False
hush = False
os.system("clear")
try:
open(prefix + "/etc/motd")
motd = True
except:
motd = False
try:
open(home + "/.hushlogin")
hush = True
except:
hush = False
if motd and not hush:
print(open(prefix + "/etc/motd").read())
os.system(sys.argv[1] + " " + sys.argv[2])