Author Topic: FakeFinger  (Read 2166 times)

0 Members and 1 Guest are viewing this topic.

Offline ca0s

  • VIP
  • Sir
  • *
  • Posts: 432
  • Cookies: 53
    • View Profile
    • ka0labs #
FakeFinger
« on: May 13, 2011, 11:26:08 pm »
Finger was a tool/service used by hosts to prive information about their users. In the last years, it has been put off because it was a good point to begin with for hackers.
This afternoon I was bored and I coded a simple fake finger service which shows a finger to anyone fingering the host. This is it:

Code: [Select]
#include <stdlib.h>
#include <stdio.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>

int main(int argc, char *argv[])
{
 
  char finger[]="\n\
  Servidor de Ca0s       /\"\\\n\
    [url=http://www.ka0labs.org]www.ka0labs.org[/url]     |\\./|\n\
                        |   |\n\
                        |   |\n\
                        |>~<|\n\
                        |   |\n\
                     /'\\|   |/'\\..\n\
  Insanity       /~\\|   |   |   | \\\n\
    for         |   =[@]=   |   |  \\\n\
     the        |   |   |   |   |   \\\n\
      win       | ~   ~   ~   ~ |`   )\n\
                |                   /\n\
                \\                 /\n\
                 \\               /\n\
                  \\    _____    /\n\
     Buscabas      |--//''`\\--|\n\
        algo?      | (( +==)) |\n\
                   |--\\_|_//--|\n\n\n";
 
  struct sockaddr_in data, con;
  memset(&data, 0, sizeof(data));
  data.sin_family=AF_INET;
  data.sin_port=htons(79);
  data.sin_addr.s_addr=INADDR_ANY;

  int s0ck=socket(AF_INET, SOCK_STREAM, 0);
  if(s0ck<0)
  {
printf("Error sock()\n");
return 0;
  }
  if(bind(s0ck, (struct sockaddr *)&data, sizeof(data))<0)
  {
printf("Error bind())\n");
return 0;
  }
  listen(s0ck, 5);
  int c0n=0;
  int cSize=sizeof(struct sockaddr_in);
  char buf[2]="\x00\x00";
  char ip[32];
  while(c0n=accept(s0ck, (struct sockaddr *)&con, &cSize))
  {
inet_ntop(AF_INET, &(con.sin_addr), &ip);
printf("[+] Access from %s\n", ip);
recv(c0n, buf, 1, 0);
send(c0n, finger, strlen(finger), 0);
close(c0n);
  }
  return 0;
}

Offline Stackprotector

  • Administrator
  • Titan
  • *
  • Posts: 2515
  • Cookies: 205
    • View Profile
Re: FakeFinger
« Reply #1 on: May 13, 2011, 11:56:05 pm »
"finger to anyone fingering the host."

Anyway...  thanks for posting:)
~Factionwars

Offline ca0s

  • VIP
  • Sir
  • *
  • Posts: 432
  • Cookies: 53
    • View Profile
    • ka0labs #
Re: FakeFinger
« Reply #2 on: May 14, 2011, 12:33:55 am »
"finger to anyone fingering the host."

Anyway...  thanks for posting:)
I lol'd