forked from chenghao11/netcat-1.12
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathupdate netcat 1.11 to 1.12
66 lines (54 loc) · 1.48 KB
/
update netcat 1.11 to 1.12
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
update netcat 1.11 to 1.12
why?
nc -lp port (remote )
nc ip port -e cmd.exe (local)
after ctrl+c cmd.exe no exit,socket no shutdown,remote's nc no exit!
it is a bug!so write netcat 1.12.
only modify doexec.c
Netcat 1.12 for NT
UPDATE 04/20/2013 by [email protected] [ctrl+c]
how to update:in doexec.c
+BOOL ConsoleHandler(DWORD CEvent)
+{
+switch(CEvent)
+{
+case CTRL_C_EVENT:
+ TerminateProcess(Session->ProcessHandle,0);
+ return(TRUE);
+break;
+case CTRL_BREAK_EVENT:
+ TerminateProcess(Session->ProcessHandle,0);
+ return(TRUE);
+break;
+case CTRL_CLOSE_EVENT:
+ TerminateProcess(Session->ProcessHandle,0);
+ return(TRUE);
+break;
+case CTRL_LOGOFF_EVENT:
+ TerminateProcess(Session->ProcessHandle,0);
+ return(TRUE);
+break;
+case CTRL_SHUTDOWN_EVENT:
+ TerminateProcess(Session->ProcessHandle,0);
+ return(TRUE);
+break;
+}
+return TRUE;
+}
if (CreateProcess(NULL, pr00gie, NULL, NULL, TRUE, 0, NULL, NULL,
&si, &ProcessInformation))
{
+ if (SetConsoleCtrlHandler((PHANDLER_ROUTINE)ConsoleHandler,TRUE)==FALSE)
+ {
+ printf("Unable to install handler!\n");
+ return NULL;
+ }
ProcessHandle = ProcessInformation.hProcess;
CloseHandle(ProcessInformation.hThread);
}
else
holler("Failed to execute shell, error = %s",
itoa(GetLastError(), smbuff, 10), NULL, NULL, NULL, NULL, NULL);
return(ProcessHandle);
}
https://github.com/chenghao11/netcat-1.12/wiki/update-netcat-1.11-to-1.12