Created
February 12, 2019 11:30
-
-
Save ccentauri/752786d3fc250dae8d1c7ea0df6aa1fb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool isFridaServerListening() { | |
struct sockaddr_in sa; | |
ssize_t ret; | |
int sock; | |
char res[7]; | |
memset(&sa, 0, sizeof(sa)); | |
sa.sin_family = AF_INET; | |
sa.sin_port = htons(27042); | |
inet_aton("127.0.0.1", &(sa.sin_addr)); | |
sock = socket(AF_INET, SOCK_STREAM, 0); | |
if (connect(sock, (struct sockaddr *) &sa, sizeof sa) != -1) { | |
send(sock, "\x00", 1, 0); | |
send(sock, "AUTH\r\n", 6, 0); | |
usleep(100); | |
ret = recv(sock, res, 6, MSG_DONTWAIT); | |
if (ret != -1) { | |
if (std::string(res).find("REJECT") != std::string::npos) { | |
close(sock); | |
return true; | |
} | |
} | |
} | |
close(sock); | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello, I need some help can you help me?
I don't know where I have to call Frida server listening function and how
can you guide me?