![]() | |
| |||||||
| Home | Register | Projects | Blogs | FAQ | Calendar | Search | Today's Posts | Mark Forums Read | Free Directory | Free DNSReport | Tags |
| Notices |
| Hacking Discuss the art of hacking, your experiences, etc... |
scanner persoThis is a discussion on "scanner perso" within the Hacking part of the Computer Security: Discussions section; Hello! I am coding a scanner multithread with a function random! I have a few pieces of codes which I must rewrite and I need assistance! I use devc++ Thanks a lot of 1/ aleatip=htonl(inet_addr("200.200.... |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| |||
| Hello! I am coding a scanner multithread with a function random! I have a few pieces of codes which I must rewrite and I need assistance! I use devc++ Thanks a lot of 1/ aleatip=htonl(inet_addr("200.200.200.200")); //is ok aleatip=htonl(inet_addr("a.b.c.d")); //don't work but no error message 2/ for (;startip <= endip;startip++) { while (!nthread) _sleep(500); { conf = (struct config *) malloc(sizeof(struct config) ); conf->ip = aleatip; conf->port = port; conf->hthread = CreateThread(NULL, 0, &connection, conf, 0, 0); nthread--; } } If ipstart=endip, I'have no result! |
| Sponsor | ||
| ||
| |
| |||
| I think of having understood the problems! It remains me with the resoudre For a IP, the thread is finished before having been able to receive an answer So problem of time out For the other problem, it is necessary that I manage to convert entireties into character strings |
| ||||
| it's a waste of time to help you looking at the code you are copy pasting, is it a joke ? Try to understand what you are grabbing from all google caches because for example , you doesnt show us startip declared ... , while (!nthread) _sleep(500); { new c style ? etc, etc.... |
| |||
| Sorry, I will try to explain me! This code is a simple ip port scanner with 4 choice: choice of range of ip to scan choice of port choice of thread generate random ip to scan I did not dare to put all the code But if that interests somebody I would put it. I think of having to identify the problems. It remains me to solve them with my friend google. 1) int a,b,c,d; So a.b.c.d is an address IP generated by the function random. I must generated character strings made up of a.b.c.d to the instruction inet_addr: aleatip=htonl(inet_addr("a.b.c.d")); 2) for the second problem if I scan only one IP the loop too quickly finishes before to have received the response of connection. It is a problem of tempo int nthread; int startip; int endip; int port; int aleatip; struct config * conf = NULL; for (;startip <= endip;startip++) { while ( !nthread ) _sleep(100); { conf = (struct config *) malloc(sizeof(struct config) ); conf->ip = startip; conf->port = port; conf->hthread = CreateThread(NULL, 0, &connection, conf, 0, 0); nthread--; } I try to find all alone on google how to correct all that. Thanks a lot of! |
| ||||
| for (startip=???;startip <= endip; and so: while ( !nthread ) _sleep(100); { conf = (struct config *) malloc(sizeof(struct config) ); conf->ip = startip; conf->port = port; conf->hthread = CreateThread(NULL, 0, &connection, conf, 0, 0); nthread--; } I guess ur code between {} is neever executed , try it like this while ( !nthread ) _sleep(100); else { conf = (struct config *) malloc(sizeof(struct config) ); conf->ip = startip; conf->port = port; conf->hthread = CreateThread(NULL, 0, &connection, conf, 0, 0); nthread--; } and so if you startip++ into the for{} , you will have to declare your aleatip better than this because you will simply add +1 to it to target the next ip , which I think you want aleatip. |
| |||
| thanks class101 but code between {} is executed the function scan normal goes very well I solved the problem of the tempo : I placed the tempo out of the loop for for (;startip <= endip;startip++) { while ( !nthread ); { conf = (struct config *) malloc(sizeof(struct config) ); conf->ip = startip; conf->port = port; conf->hthread = CreateThread(NULL, 0, &connection, conf, 0, 0); nthread--; } } _sleep(150); for random scan: int i=1; for (;i = i;i++) //for loop infinite { a=rand()%255; b=rand()%255; c=rand()%255; d=rand()%255; while (!nthread); { aleatip=inet_addr("a.b.c.d"); conf = (struct config *) malloc(sizeof(struct config) ); conf->ip = aleatip; conf->port = port; conf->hthread = CreateThread(NULL, 0, &connection, conf, 0, 0); nthread--; } } _sleep(150); the problem is to transform a.b.c.d into string of caracters |
| ||||
| because you try to indetaddr a char instead of an int, you should before transform a.b.c.d into a fixed ip address, your program doesnt know "a.b.c.d", try to put for example a sample ip adress at argv[4] and code inet_addr(argv[4]), you will see it should work because argv[4] is an int. and while ( !nthread ); there is no ";" at the end, you arent prolly compiling this , or I dunno a compiler allowing to compile this code. |
| |||
| int a,b,c,d; char str[20]; a=rand()%255; b=rand()%255; c=rand()%255; d=rand()%255; sprintf(str,"%d.%d.%d.%d",a,b,c,d); aleatip=htonl(inet_addr(str)); And here is the function random functions! :lol: Quote:
it compiles me that without error thanks a lot of class101 |
| Sponsor | ||
| ||
| |
![]() |
| | |
| perso, scanner | |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| VNC_bypauth: linux & windows scanner | class101 | 0day | 94 | 04-10-08 03:40 |
| CVE-2008-1073 (Internet Scanner) | Heap | Advisories | 0 | 29-02-08 21:40 |
| CVE-2007-6189 (Online Anti-Virus Scanner) | Heap | Advisories | 0 | 01-12-07 14:25 |