mirror of
https://github.com/h3xduck/TripleCross.git
synced 2026-01-04 15:33:08 +08:00
Fixed bug in client getting local ip
This commit is contained in:
Binary file not shown.
BIN
src/bin/kit
BIN
src/bin/kit
Binary file not shown.
@@ -118,6 +118,7 @@ char* getLocalIpAddress(){
|
|||||||
if(strcmp(ifa->ifa_name, buf)==0){
|
if(strcmp(ifa->ifa_name, buf)==0){
|
||||||
//Interface we chose
|
//Interface we chose
|
||||||
printf("["KBLU"INFO"RESET"]""Attacker IP selected: %s (%s)\n", ifa->ifa_name, host);
|
printf("["KBLU"INFO"RESET"]""Attacker IP selected: %s (%s)\n", ifa->ifa_name, host);
|
||||||
|
strcpy(IPbuffer, host);
|
||||||
return IPbuffer;
|
return IPbuffer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -10,6 +10,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
|
||||||
#define LOCAL_ABORT() \
|
#define LOCAL_ABORT() \
|
||||||
do { \
|
do { \
|
||||||
@@ -79,21 +80,21 @@ int client_run(char *hostname, uint16_t portnum) {
|
|||||||
int conn_tries = 3;
|
int conn_tries = 3;
|
||||||
while (conn_tries >= 0) {
|
while (conn_tries >= 0) {
|
||||||
if (connect(server, (struct sockaddr *)&addr, sizeof(addr)) != 0) {
|
if (connect(server, (struct sockaddr *)&addr, sizeof(addr)) != 0) {
|
||||||
if (conn_tries > 1) {
|
if (conn_tries > 1) {
|
||||||
conn_tries--;
|
conn_tries--;
|
||||||
printf("Failed to connect, trying again. Remaining tries: %i\n",
|
printf("Failed to connect, trying again. Remaining tries: %i\n",
|
||||||
conn_tries);
|
conn_tries);
|
||||||
sleep(1);
|
sleep(1);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
close(server);
|
close(server);
|
||||||
perror(hostname);
|
perror(hostname);
|
||||||
fprintf(stderr, "Is the server running, and on the correct port (%d)?\n",
|
fprintf(stderr, "Is the server running, and on the correct port (%d)?\n",
|
||||||
portnum);
|
portnum);
|
||||||
LOCAL_ABORT();
|
LOCAL_ABORT();
|
||||||
} else {
|
} else {
|
||||||
// Connected
|
// Connected
|
||||||
conn_tries = -1;
|
conn_tries = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user