forked from kavika13/RemCom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
RemCom.h
78 lines (66 loc) · 2.43 KB
/
RemCom.h
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
/*
Copyright (c) 2006 Talha Tariq [ [email protected] ]
All rights are reserved.
Permission to use, copy, modify, and distribute this software
for any purpose and without any fee is hereby granted,
provided this notice is included in its entirety in the
documentation and in the source files.
This software and any related documentation is provided "as is"
without any warranty of any kind, either express or implied,
including, without limitation, the implied warranties of
merchantability or fitness for a particular purpose. The entire
risk arising out of use or performance of the software remains
with you.
$Author: Talha Tariq [ [email protected] ]
uses some code from xCmd by Zoltan Csizmadia
$Revision: Talha Tariq [ [email protected] ]
$Date: 2006/10/03 09:00:00 $
$Version History: $ - Added ProcComs binary as a local resource for local process impersonation and communication util
$TODO: - See destructor
$Description: $ - RemCom is RAT [Remote Administration Tool] that lets you execute processes on remote windows systems, copy files,
process there output and stream it back. It allows execution of remote shell commands directly with full interactive console
- Declaration of RemCom Message and Response Classes
$Workfile: $ - RemCom.h
*/
#ifndef RemCom_H_INCLUDED
#define RemCom_H_INCLUDED
#include <windows.h>
//#include <winbase.h>
#include <winsvc.h>
#include <tchar.h>
#include <lmcons.h>
#include <stdio.h>
#include <stdlib.h>
#include <process.h>
//#include <iostream.h>
#include <userenv.h>
#include "ProcFunctions.h"
//#include <strsafe.h>
#include "resource.h"
#define SERVICENAME _T("RemComSvc")
#define LONGSERVICENAME _T("RemCom Service")
#define RemComSVCEXE _T("RemComSvc.exe")
#define ProcComs _T("ProcComs.bin")
#define RemComCOMM _T("RemCom_communicaton")
#define RemComSTDOUT _T("RemCom_stdout")
#define RemComSTDIN _T("RemCom_stdin")
#define RemComSTDERR _T("RemCom_stderr")
#define Out(x) { _ftprintf( stdout, _T("%s"), x); fflush(stdout); }
#define Error(x) { _ftprintf( stderr, _T("%s"), x); fflush(stderr); }
class RemComMessage
{
public:
TCHAR szCommand[0x1000];
TCHAR szWorkingDir[_MAX_PATH];
DWORD dwPriority;
DWORD dwProcessId;
TCHAR szMachine[_MAX_PATH];
BOOL bNoWait;
};
class RemComResponse
{
public:
DWORD dwErrorCode;
DWORD dwReturnCode;
};
#endif