Skip to content

Instantly share code, notes, and snippets.

@ccentauri
Created February 12, 2019 11:30
Show Gist options
  • Save ccentauri/752786d3fc250dae8d1c7ea0df6aa1fb to your computer and use it in GitHub Desktop.
Save ccentauri/752786d3fc250dae8d1c7ea0df6aa1fb to your computer and use it in GitHub Desktop.
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;
}
@SanazAhang
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment