-
Notifications
You must be signed in to change notification settings - Fork 2
/
set_admin.py
40 lines (32 loc) · 1.34 KB
/
set_admin.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
import os
print('''
__ __ _ ____ _____
\ \ / / | | / __ \ / ____|
\ \ /\ / /__| |____ ____ _ _ __ ___| | | | (___
\ \/ \/ / _ \ '_ \ \ /\ / / _` | '__/ _ \ | | |\___ \
\ /\ / __/ |_) \ V V / (_| | | | __/ |__| |____) |
\/ \/ \___|_.__/ \_/\_/ \__,_|_| \___|\____/|_____/
Set the Admin User and Password..''')
# Take Inputs
user = input('[->] Username: ')
password = input('[->] Password: ')
f = open('login(delete_later).txt')
old_data = f.read().split('\n')
f.close()
# Edit it into login.php
login_php = open(f'src{os.sep}api{os.sep}login.php')
login_php_text = login_php.read()
login_php.close()
login_php_text = login_php_text.replace(f"$PASSWORD = '{old_data[1]}';",f"$PASSWORD = '{password}';")
login_php_text = login_php_text.replace(f"$USERNAME = '{old_data[0]}';",f"$USERNAME = '{user}';")
login_php = open(f'src{os.sep}api{os.sep}login.php','w')
login_php.write(login_php_text)
login_php.close()
# Edit Directories Name
os.rename(f'src{os.sep}'+old_data[0],f'src{os.sep}'+user)
os.rename(f'src{os.sep}{user}{os.sep}{old_data[1]}', f'src{os.sep}{user}{os.sep}{password}')
# Write New Data
f = open('login(delete_later).txt','w')
f.write(f'{user}\n{password}')
f.close()
input('[+] Done..')