-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrsh.h
More file actions
41 lines (34 loc) · 953 Bytes
/
Copy pathrsh.h
File metadata and controls
41 lines (34 loc) · 953 Bytes
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
#ifndef RSH_H_
#define RSH_H_
#include <stdint.h>
#define BANNER \
" _ \n" \
" _ __ ___| |__ \n" \
" | '__/ __| '_ \\ \n" \
" | | \\__ \\ | | |\n" \
" |_| |___/_| |_| "
#define FOOTER \
" (r)everse(sh)ell\n"
// logging
#define RSH_RAW_LOG(...) fprintf(stdout, __VA_ARGS__)
#ifdef LOGGING
#define RSH_LOG(...) fprintf(stdout, "[*] "__VA_ARGS__)
#define RSH_FATAL(...) fprintf(stderr, "[\033[0;31m-\033[0m] "__VA_ARGS__)
#define RSH_SUCCESS(...) fprintf(stdout, "[\033[0;32m+\033[0m] "__VA_ARGS__)
#else
#define RSH_LOG(...)
#define RSH_FATAL(...)
#define RSH_SUCCESS(...)
#endif // LOGGING
// util macros
#define MIN(x,y) x < y ? x : y
#define XSTR(s) STR(s)
#define STR(s) #s
#define MAYBE_UNUSED __attribute__((unused))
typedef struct {
char ip[16];
uint16_t port;
uint16_t retry_count;
uint16_t retry_interval;
} rsh_cfg_t;
#endif // !RSH_H_