Skip to Main Content
Sockets, Shellcode, Porting, and Coding: Reverse Engineering Exploits and Tool Coding for Security Professionals
book

Sockets, Shellcode, Porting, and Coding: Reverse Engineering Exploits and Tool Coding for Security Professionals

by James C Foster
April 2005
Intermediate to advanced content levelIntermediate to advanced
700 pages
20h 39m
English
Syngress
Content preview from Sockets, Shellcode, Porting, and Coding: Reverse Engineering Exploits and Tool Coding for Security Professionals
260 int
261 main(int argc, char *argv[])
262 [
263 unsigned short port = SNMP1_DEF_PORT;
264 char *targ = NULL;
265 char *comn = SNMP1_DEF_COMN;
266 char ch = 0;
267 int ret = 0;
268
269
opterr = 0;
270 while((ch = getopt(argc, argv, "t:p:c:")) != -1)
271 {
272 switch(ch)
273 {
274 case 't':
275
276
targ = optarg;
277 break;
278
279
case 'p':
280
281
port = atoi(optarg);
282 break;
283
284
case 'c':
285
286
comn = optarg;
287 break;
288
289
case '?':
290 default:
291
292
usage(argv[0]);
293 return(1);
294 }
295 }
296
297
if(targ == NULL)
298 {
299 usage(argv[0]);
300 return(1);
301 }
302
303
printf("using: target: %s; port: %d; " \
304 community name: \"%s\"\n", targ, port, comn);
305
306
ret = scan(targ, port, comn);
307 if(ret < 0)
308 {
309 printf("scan() failed.\n");
310 return(1);
311 }
312
313
printf("scan ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

32/64-Bit 80x86 Assembly Language Architecture

32/64-Bit 80x86 Assembly Language Architecture

James Leiterman

Publisher Resources

ISBN: 9781597490054