Compare commits
3 Commits
31530c83a4
...
3ebface620
Author | SHA1 | Date | |
---|---|---|---|
3ebface620 | |||
f91bc39762 | |||
957bb06d97 |
@ -2,6 +2,5 @@
|
||||
|
||||
#include <netinet/in.h>
|
||||
|
||||
int dns_lookup(char *ip_addr, const char *hostname,
|
||||
struct sockaddr_in *addr_con);
|
||||
int dns_lookup(char *ip_addr, const char *hostname);
|
||||
int reverse_dns_lookup(char *ip_addr, char *host);
|
||||
|
@ -6,8 +6,7 @@
|
||||
#include <string.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
int dns_lookup(char *ip_addr, const char *hostname,
|
||||
struct sockaddr_in *addr_con)
|
||||
int dns_lookup(char *ip_addr, const char *hostname)
|
||||
{
|
||||
struct hostent *host = gethostbyname2(hostname, AF_INET);
|
||||
if (!host) {
|
||||
@ -17,9 +16,6 @@ int dns_lookup(char *ip_addr, const char *hostname,
|
||||
return -1;
|
||||
}
|
||||
strcpy(ip_addr, inet_ntoa(*(struct in_addr *)host->h_addr));
|
||||
(*addr_con).sin_family = host->h_addrtype;
|
||||
(*addr_con).sin_port = htons(0);
|
||||
(*addr_con).sin_addr.s_addr = *(long *)host->h_addr;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -16,8 +16,7 @@
|
||||
|
||||
static int scan_host(struct scan *general, uint8_t nb_threads)
|
||||
{
|
||||
struct sockaddr_in addr_con;
|
||||
if (dns_lookup(general->dest_addr, general->dest_addr, &addr_con)) {
|
||||
if (dns_lookup(general->dest_addr, general->dest_addr)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -52,6 +51,7 @@ int main(int ac, char **av)
|
||||
}
|
||||
|
||||
if (option_isset(options, FL_HELP)) {
|
||||
free_options(options);
|
||||
print_usage();
|
||||
return 0;
|
||||
}
|
||||
|
@ -14,6 +14,9 @@ void print_usage(void)
|
||||
printf("--file: File name containing IP addresses to scan\n");
|
||||
printf("--speedup: [250 max] number of parallel threads to use\n");
|
||||
printf("--scan: NULL/SYN/FIN/XMAS/ACK/UDP\n");
|
||||
printf("--max_retries: number of retries when host doesn't reply\n");
|
||||
printf("--ttl: precise the ttl\n");
|
||||
|
||||
}
|
||||
|
||||
void print_config(const struct scan *general, const char *hosts_path,
|
||||
|
Reference in New Issue
Block a user