forked from chenghao11/netcat-1.12
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathupdate netcat 1.13 to 1.14.txt
64 lines (48 loc) · 1.35 KB
/
update netcat 1.13 to 1.14.txt
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
update netcat 1.13 to 1.14
modify by chenghao0511##gmail.com 2013/05/03
why?
after:
remote:nc -lp 55 < doexec.c
local:nc ip 55 > test.c
remote:nc -lp 55 < doexec.c
_ [can not type in]
local:nc ip 55 > test.c
_ [can type in,remote out]
you can use:
nc -lp 66 < doexec.c
nc -C 127.0.0.1 66 >test.c
or:
nc -lp 66 > test1.c
nc -C 127.0.0.1 66 < doexec.c
how to update:
unsigned int o_wait = 0;
USHORT o_zero = 0;
+USHORT o_connect = 0;
rr = recv (fd, bigbuf_net, BIGSIZ, 0);
if (rr <= 0) {
Debug (("recv rr <= 0 "))
+ if (_isatty( 1 ) == 0) /* > recv = 0,fix by chenghao0511#gmail.com*/
+ exit(0);
FD_CLR (fd, ding1); /* net closed, we'll finish up... */
rr = read (0, bigbuf_in, BIGSIZ);
if (rr <= 0) { /* at end, or fukt, or ... */
close (0);
+ shutdown(fd, 0x02); /* by chenghao0511 */
+ closesocket (fd);
+ if(o_connect)
+ exit(0);
+ return (0);
} else {
rzleft = rr;
zp = bigbuf_in;
case 'C': /* connect then cycle back to start instead of exiting */
+ o_connect = 1;
cycle = 1;
break;
source code:
https://github.com/chenghao11/netcat-1.13/wiki/update-netcat-1.12-to-1.13
http://code.google.com/p/netcat113/
https://sourceforge.net/p/netcat113/
download:
https://www.box.com/s/vmrli1vjt5dh4j0bjarr
https://docs.google.com/file/d/0B0LORKrOvywuOUdvSGo4ZHNEb28/edit?usp=sharing