Pages

Complete Tutorial On Sniffing

1 comments

This tutorial given you a complete introduction about Sniffing.Sniffers mainly developed for debugging network problems.Sniffers could capture,interpret and save packets sent across a network.This helpful for admin to later analyze captured packets and debug or troubleshoot network problems.


In market you found many type of sniffers but most used sniffer is Ethernet-based Sniffer.This Sniffer works with NIC(Network Interface Card).With Ethernet-based Sniffer NIC works in a special state called Promiscuous Mode.This mode ensure that your sniffer receives all the packets within specified range of system.
Sniffers can't catch packets traversing beyond switches and routers.

Sniffer dangerous for you,if an attacker used it against you after install on your system,your all data,password,private messages,e-mail and so on -get captured.
Protocol like FTP,POP,IMAP and HTTP are vulnerable to the sniffers.

Type of Attack:

Sniffer Attack consider as a Passive attack.A passive attack is one that doesn't directly intrude onto a foreign network or computer.

Popular Sniffer

1.Name: tcpdump
Download Here

2:Name:Ethereal
Download Here

3:Name:DSniff
Download Here

4:Name:Sniffer
Download Here

5.Name:SSLdump
Download Here

Code Your Own Sniffer In 'C'

  1. //sniffer.c
  2. //To compile : gcc -o sniffer sniffer.c
  3. //To run : ./sniffer [interface-name]
  4. #include
  5. #include
  6. #include
  7. #include
  8. #include
  9. #include
  10. #include
  11. #include
  12. #include
  13. #include
  14. /* default snap length (maximum bytes per packet to capture) */
  15. #define SNAP_LEN 1518
  16. /* ethernet headers are always exactly 14 bytes [1] */
  17. #define SIZE_ETHERNET 14
  18. /* Ethernet addresses are 6 bytes */
  19. #define ETHER_ADDR_LEN 6
  20. /* Ethernet header */
  21. struct sniff_ethernet {
  22. u_char ether_dhost[ETHER_ADDR_LEN]; /* destination host address */
  23. u_char ether_shost[ETHER_ADDR_LEN]; /* source host address */
  24. u_short ether_type; /* IP? ARP? RARP? etc */
  25. };
  26. /* IP header */
  27. struct sniff_ip {
  28. u_char ip_vhl; /* version << 4 | header length >> 2 */
  29. u_char ip_tos; /* type of service */
  30. u_short ip_len; /* total length */
  31. u_short ip_id; /* identification */
  32. u_short ip_off; /* fragment offset field */
  33. #define IP_RF 0x8000 /* reserved fragment flag */
  34. #define IP_DF 0x4000 /* dont fragment flag */
  35. #define IP_MF 0x2000 /* more fragments flag */
  36. #define IP_OFFMASK 0x1fff /* mask for fragmenting bits */
  37. u_char ip_ttl; /* time to live */
  38. u_char ip_p; /* protocol */
  39. u_short ip_sum; /* checksum */
  40. struct in_addr ip_src,ip_dst; /* source and dest address */
  41. };
  42. #define IP_HL(ip) (((ip)->ip_vhl) & 0x0f)
  43. #define IP_V(ip) (((ip)->ip_vhl) >> 4)
  44. /* TCP header */
  45. typedef u_int tcp_seq;
  46. struct sniff_tcp {
  47. u_short th_sport; /* source port */
  48. u_short th_dport; /* destination port */
  49. tcp_seq th_seq; /* sequence number */
  50. tcp_seq th_ack; /* acknowledgement number */
  51. u_char th_offx2; /* data offset, rsvd */
  52. #define TH_OFF(th) (((th)->th_offx2 & 0xf0) >> 4)
  53. u_char th_flags;
  54. #define TH_FIN 0x01
  55. #define TH_SYN 0x02
  56. #define TH_RST 0x04
  57. #define TH_PUSH 0x08
  58. #define TH_ACK 0x10
  59. #define TH_URG 0x20
  60. #define TH_ECE 0x40
  61. #define TH_CWR 0x80
  62. #define TH_FLAGS (TH_FIN|TH_SYN|TH_RST|TH_ACK|TH_URG|TH_ECE|TH_CWR)
  63. u_short th_win; /* window */
  64. u_short th_sum; /* checksum */
  65. u_short th_urp; /* urgent pointer */
  66. };
  67. void
  68. got_packet(u_char *args, const struct pcap_pkthdr *header, const u_char *packet);
  69. void
  70. print_payload(const u_char *payload, int len);
  71. void
  72. print_hex_ascii_line(const u_char *payload, int len, int offset);
  73. /*
  74. * print data in rows of 16 bytes: offset hex ascii
  75. *
  76. * 00000 47 45 54 20 2f 20 48 54 54 50 2f 31 2e 31 0d 0a GET / HTTP/1.1..
  77. */
  78. void
  79. print_hex_ascii_line(const u_char *payload, int len, int offset)
  80. {
  81. int i;
  82. int gap;
  83. const u_char *ch;
  84. /* offset */
  85. printf("%05d ", offset);
  86. /* hex */
  87. ch = payload;
  88. for(i = 0; i < len; i++) {
  89. printf("%02x ", *ch);
  90. ch++;
  91. /* print extra space after 8th byte for visual aid */
  92. if (i == 7)
  93. printf(" ");
  94. }
  95. /* print space to handle line less than 8 bytes */
  96. if (len < 8)
  97. printf(" ");
  98. /* fill hex gap with spaces if not full line */
  99. if (len < 16) {
  100. gap = 16 - len;
  101. for (i = 0; i < gap; i++) {
  102. printf(" ");
  103. }
  104. }
  105. printf(" ");
  106. /* ascii (if printable) */
  107. ch = payload;
  108. for(i = 0; i < len; i++) {
  109. if (isprint(*ch))
  110. printf("%c", *ch);
  111. else
  112. printf(".");
  113. ch++;
  114. }
  115. printf("\n");
  116. return;
  117. }
  118. /*
  119. * print packet payload data (avoid printing binary data)
  120. */
  121. void
  122. print_payload(const u_char *payload, int len)
  123. {
  124. int len_rem = len;
  125. int line_width = 16; /* number of bytes per line */
  126. int line_len;
  127. int offset = 0; /* zero-based offset counter */
  128. const u_char *ch = payload;
  129. if (len <= 0)
  130. return;
  131. /* data fits on one line */
  132. if (len <= line_width) {
  133. print_hex_ascii_line(ch, len, offset);
  134. return;
  135. }
  136. /* data spans multiple lines */
  137. for ( ;; ) {
  138. /* compute current line length */
  139. line_len = line_width % len_rem;
  140. /* print line */
  141. print_hex_ascii_line(ch, line_len, offset);
  142. /* compute total remaining */
  143. len_rem = len_rem - line_len;
  144. /* shift pointer to remaining bytes to print */
  145. ch = ch + line_len;
  146. /* add offset */
  147. offset = offset + line_width;
  148. /* check if we have line width chars or less */
  149. if (len_rem <= line_width) {
  150. /* print last line and get out */
  151. print_hex_ascii_line(ch, len_rem, offset);
  152. break;
  153. }
  154. }
  155. return;
  156. }
  157. /*
  158. * dissect/print packet
  159. */
  160. void
  161. got_packet(u_char *args, const struct pcap_pkthdr *header, const u_char *packet)
  162. {
  163. static int count = 1; /* packet counter */
  164. /* declare pointers to packet headers */
  165. const struct sniff_ethernet *ethernet; /* The ethernet header [1] */
  166. const struct sniff_ip *ip; /* The IP header */
  167. const struct sniff_tcp *tcp; /* The TCP header */
  168. const char *payload; /* Packet payload */
  169. int size_ip;
  170. int size_tcp;
  171. int size_payload;
  172. printf("\nPacket number %d:\n", count);
  173. count++;
  174. /* define ethernet header */
  175. ethernet = (struct sniff_ethernet*)(packet);
  176. /* define/compute ip header offset */
  177. ip = (struct sniff_ip*)(packet + SIZE_ETHERNET);
  178. size_ip = IP_HL(ip)*4;
  179. if (size_ip < 20) {
  180. printf(" * Invalid IP header length: %u bytes\n", size_ip);
  181. return;
  182. }
  183. /* print source and destination IP addresses */
  184. printf(" From: %s\n", inet_ntoa(ip->ip_src));
  185. printf(" To: %s\n", inet_ntoa(ip->ip_dst));
  186. /* determine protocol */
  187. switch(ip->ip_p) {
  188. case IPPROTO_TCP:
  189. printf(" Protocol: TCP\n");
  190. break;
  191. case IPPROTO_UDP:
  192. printf(" Protocol: UDP\n");
  193. return;
  194. case IPPROTO_ICMP:
  195. printf(" Protocol: ICMP\n");
  196. return;
  197. case IPPROTO_IP:
  198. printf(" Protocol: IP\n");
  199. return;
  200. default:
  201. printf(" Protocol: unknown\n");
  202. return;
  203. }
  204. /*
  205. * OK, this packet is TCP.
  206. */
  207. /* define/compute tcp header offset */
  208. tcp = (struct sniff_tcp*)(packet + SIZE_ETHERNET + size_ip);
  209. size_tcp = TH_OFF(tcp)*4;
  210. if (size_tcp < 20) {
  211. printf(" * Invalid TCP header length: %u bytes\n", size_tcp);
  212. return;
  213. }
  214. printf(" Src port: %d\n", ntohs(tcp->th_sport));
  215. printf(" Dst port: %d\n", ntohs(tcp->th_dport));
  216. /* define/compute tcp payload (segment) offset */
  217. payload = (u_char *)(packet + SIZE_ETHERNET + size_ip + size_tcp);
  218. /* compute tcp payload (segment) size */
  219. size_payload = ntohs(ip->ip_len) - (size_ip + size_tcp);
  220. /*
  221. * Print payload data; it might be binary, so don't just
  222. * treat it as a string.
  223. */
  224. if (size_payload > 0) {
  225. printf(" Payload (%d bytes):\n", size_payload);
  226. print_payload(payload, size_payload);
  227. }
  228. return;
  229. }
  230. int main(int argc, char **argv)
  231. {
  232. char *dev = NULL; /* capture device name */
  233. char errbuf[PCAP_ERRBUF_SIZE]; /* error buffer */
  234. pcap_t *handle; /* packet capture handle */
  235. char filter_exp[] = "ip"; /* filter expression */
  236. struct bpf_program fp; /* compiled filter program (expression) */
  237. bpf_u_int32 mask; /* subnet mask */
  238. bpf_u_int32 net; /* ip */
  239. int num_packets ; /* number of packets to capture */
  240. /* check for capture device name on command-line */
  241. if (argc == 2) {
  242. dev = argv[1];
  243. }
  244. else if (argc > 3) {
  245. fprintf(stderr, "error: unrecognized command-line options\n\n");
  246. printf("Usage: %s [interface]\n", argv[0]);
  247. printf("\n");
  248. printf("Options:\n");
  249. printf(" interface Listen on for packets.\n");
  250. printf("\n");
  251. exit(EXIT_FAILURE);
  252. }
  253. else {
  254. /* find a capture device if not specified on command-line */
  255. dev = pcap_lookupdev(errbuf);
  256. if (dev == NULL) {
  257. fprintf(stderr, "Couldn't find default device: %s\n",
  258. errbuf);
  259. exit(EXIT_FAILURE);
  260. }
  261. }
  262. printf("\nEnter no. of packets you want to capture: ");
  263. scanf("%d",&num_packets);
  264. printf("\nWhich kind of packets you want to capture : ");
  265. scanf("%s",filter_exp);
  266. /* get network number and mask associated with capture device */
  267. if (pcap_lookupnet(dev, &net, &mask, errbuf) == -1) {
  268. fprintf(stderr, "Couldn't get netmask for device %s: %s\n",
  269. dev, errbuf);
  270. net = 0;
  271. mask = 0;
  272. }
  273. /* print capture info */
  274. printf("Device: %s\n", dev);
  275. printf("Number of packets: %d\n", num_packets);
  276. printf("Filter expression: %s\n", filter_exp);
  277. /* open capture device */
  278. handle = pcap_open_live(dev, SNAP_LEN, 1, 1000, errbuf);
  279. if (handle == NULL) {
  280. fprintf(stderr, "Couldn't open device %s: %s\n", dev, errbuf);
  281. exit(EXIT_FAILURE);
  282. }
  283. /* make sure we're capturing on an Ethernet device [2] */
  284. if (pcap_datalink(handle) != DLT_EN10MB) {
  285. fprintf(stderr, "%s is not an Ethernet\n", dev);
  286. exit(EXIT_FAILURE);
  287. }
  288. /* compile the filter expression */
  289. if (pcap_compile(handle, &fp, filter_exp, 0, net) == -1) {
  290. fprintf(stderr, "Couldn't parse filter %s: %s\n",
  291. filter_exp, pcap_geterr(handle));
  292. exit(EXIT_FAILURE);
  293. }
  294. /* apply the compiled filter */
  295. if (pcap_setfilter(handle, &fp) == -1) {
  296. fprintf(stderr, "Couldn't install filter %s: %s\n",
  297. filter_exp, pcap_geterr(handle));
  298. exit(EXIT_FAILURE);
  299. }
  300. /* now we can set our callback function */
  301. pcap_loop(handle, num_packets, got_packet, NULL);
  302. /* cleanup */
  303. pcap_freecode(&fp);
  304. pcap_close(handle);
  305. printf("\nCapture complete.\n");
  306. return 0;
362 }
(My Thanks to Varun Gupta for save my time)

Making Sniffer Hard To Detect:

There is a method to help make it more difficult to detect a sniffer on a network. For this to work, you have to deploy two NICs in on computer. For the first NIC, configure the interface with the address of 0.0.0.0. This will allow the sniffer to monitor traffic but to not be detected. But there is still the issue of messages and alerts which will be handed off from the card the sniffer is on to another card to finish being delivered. The second card has a regular address but is not in promiscuous mode so it will be very hard for someone to detect this type of setup.

Save Yourself:

Kitty Litter The Anti-Sniffer is a handy application that can prevent hackers from capturing logins and passwords and viewing traffic on your wireless network by spamming thousands of false-leads per second that are unidentifiable from your regular browsing habits.

Free Download Here


I am Spend 2 hr for this complete article,you spend only 1 Minute for your good Comment.









Backtrack 5 Wireless Penetration Testing by Vivek Ramachandran

1 comments

BackTrack 5 Wireless Penetration Testing: Beginner's Guide is aimed at helping the
reader understand the insecurities associated with wireless networks, and how to conduct
penetration tests to find and plug them. This is an essential read for those who would like
to conduct security audits on wireless networks and always wanted a step-by-step
practical guide for the same. As every wireless attack explained in this book is
immediately followed by a practical demo, the learning is very complete.




About the Author:

Vivek Ramachandran has been working on Wi-Fi Security since 2003. He discovered
the Caffe Latte attack and also broke WEP Cloaking, a WEP protection schema publicly
in 2007 at Defcon. In 2011, Vivek was the first to demonstrate how malware could use
Wi-Fi to create backdoors, worms, and even botnets.
Earlier, he was one of the programmers of the 802.1x protocol and Port Security in
Cisco's 6500 Catalyst series of switches and was also one of the winners of the Microsoft
Security Shootout contest held in India among a reported 65,000 participants.

You Can Purchase this book from:



Sample of Book Download here:



Make Private Folder And Save Your Data

2 comments

Today post tell you how you make a private folder and save your information by other person.

By making Private Folder nobody can open,delete,rename and see properties of folder.

For make private folder go to desktop and make new folder with any name but mind your folder name in my case i am make a hrde name folder.

Go to run and type cmd or open command prompt.

Here write cd desktop like below picture...




After it write Cacls hrde /E /P everyone:n like given below...



Here we use 'n' for locked folder. When you click on folder then a message come like below...



For open folder go to cmd and type Cacls hrde /E /P everyone:f



And your folder open.

Enjoy it!!!

USBCrypt for Windows 7,Vista,XP,2000

0 comments

USBCrypt is a powerful software tool who encrypt and protect your important information from unauthorized access.
It stop the bad guys or hacker,and protect your personal,business and financial data.

I am use it to encrypt our USB and other removable and fixed drives with strong encryption security.USBCrypt uses the industry standard AES encryption algorithm to protect your files.



With USBCrypt,you can create a Virtual Encrypted Disk Backup your files directly to the encrypted storage area,No any one extract your backup without password.

For Download USBCrypt Click Here

Plz do not forget given your reply.

Protect Your Computer From The Attacking Live CD

0 comments

Today post about your System Security,here i am tell you how you secure your system login password by crack.

Many hacker use the Live CDs for crack the password of Windows OS.

If you do some change on your system BIOS,then you enhance the security of the PC.

If you should change boot sequence in the BIOS so when your computer start boot then it boot from Hard Disk in place of CDs.

This will protect you from live attacking CDs.

For go to change the boot sequence,first open your system power button when system start boot then press Delete or F2 Key then you see a BIOS window.

Click on boot option like given below...




And change the settings.

Hook Analyser Malware Tool Released

0 comments


Hook analyser is a hook tool which can be potentially helpful in reversing applications and analysing malware. It can hook to an API in a process and search for a pattern in memory or dump the buffer. The tool can hook to an API in a process and can do following tasks.


  • 1. Hook to API in a process
  • 2. Hook to API and search for pattern in memory of a process
  • 3. Hook to API and dump buffer (memory).

Download Here

Source:Thehackernews

Encrypt Your Messages And Secure Your Email

0 comments

Blender xxTea edition

You can use for encrypting your messages and any other information is Blender.You can download Blender at...




With Blender,all you need to do is store your messages like you normally do.

Send this encrypted data over email or send it as a file or your recipient as a message who can decrypt it using Blender so that only the two of you can understand the message.

Hack and Shutdown Other Person System Who Online On Your Wi-Fi Network

1 comments

Today,i am going to tell you how you shutdown a system on your wi-fi network by your own system.Many hacker already post it but his work incomplete and his trick does not work for you.I am a network engg. so i am capable to write about it.
I am inform you that this post copyright to hrde and hackarde blog so if you post this thread on another place then given credit to hrde and also paste link of this page,Thanx!

First u know that if you find IP address in range of

172.16.0.0 to 172.31.255.255
and
192.168.0.0 to 192.168.255.255

it's come into Private IP address.

When you use school Wi-fi and broadband than always you connected with private IP address to public IP address.

Here i am suggest a tool which help you for trace a IP address which present in your private IP address area,Name of tool 'Advance Ip Scanner' which help you for tracing the IP.You download it with help of Google Uncle. A view of AIS given below...




You trace a IP and go to CMD and type...

Shutdown -i

Window pop-up you enter choose IP and press OK,like given below...



But it not work for u?

Because You do not directly connected with another Private IP address becoz here Puble IP work as a server. when you doing upper write activities you find a message say path not specified, so first work here specified a path. How?

If u directly connected with Victim IP then your path specified,i think you know what i am say,for directly connection to Victim IP you send a long file via chating look below..

you chat with victim <---> server <----> Victim chat with u

Server work between both and hide your IP with another person.when you send a long file to victim then server remove between both becoz server want remove his load than your IP directly connected with Victim.

you chat with victim <------> Victim chat with u

Here use Advance IP Scanner,it tell you victim IP with Victim System name(u also use it on public IP address),that means you directly connected.

Go to CMD type

shutdown -i

In pop-up type private IP address or name of computer(which shown on ADVANCE IP Scanner) click OK,your Victim system shutdown after your set time,again run Advance IP Scanner you see your Victim Private IP address out of list.

It's very difficult to check Public IP address by Advance Scanner becoz when one IP remove then simultanously it go to another System by DHCP.But this problem never come into Wi-Fi,so you see a live example on your private network.

So i think after it how to connect with victim ip address,for find victim IP address use my post...


why i am suggest you use Advance IP Scanner ?
Some time AIS already trace a Private IP which connected with you then you go to cmd and shutdown the computer.

4 month before i am also suffer with this problem,i am read many tutorial of other hacker on his website but i do not found solution but one night i am success full when i am shutdown 3 System 9 times on my hostel wi-fi network and last user go to sleep mode when many times his system shutdown.

I am always share my knowledge with other person.
If you like it,plz reply back.

Set your play video as Desktop wallpaper

1 comments

Hi guys,i am again come for u with new trick.Today i am gonna tell you how we set a play video as desktop wallpaper.
Please post your good comment below if u like it.

Necessary Tool:: Only VLC Media Player.

Here i am tell you two different method by which you set your video as wallpaper in desktop because with different version of Media Player different trick work.

So ready guys,let's go...

Method 1: Run VLC,go to settings>>preferences>>Interface>>Main Interface, then click on
wxWidgets.remove
then tick the Taskbar and Systray icon.

Go to Video option on VLC>>Output Modules>>DirectX. When you done it then a Advance option come check it.You also see a option 'Enable Wallpaper Mode' check it.

Make a Playlist and click on 'Repeat current item' and save.

Close VLC and again play it.Right click on play video then a option come 'Wallpaper' click on it and look you desktop Screen .
It look like my desktop Screen which shown below...




Method 2: If above write Method and option not work on your VLC then do not fear because 'hrde' hear.

Go to Tool on VLC>>Preferences>>a window pop up>>click on Video>>in right side See DirectX
in under it click on 'Wallpaper Mode' and save it.

Go to Video option on VLC click on it,you see a option "Direct3D desktop Mode" click on it and watch desktop.

Enjoy!!!

Plz do not forget given your comment.


Related Posts Plugin for WordPress, Blogger...

Hackarde's Search Engine- Search Hacking Tutorial,Tool and eBook

Loading
 
HACKARDE © 2011 | Designed by HrDe