LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-31-2005, 11:42 AM   #1
fr_laz
Member
 
Registered: Jan 2005
Location: Cork Ireland
Distribution: Debian
Posts: 384

Rep: Reputation: 32
Libnet performance


Hi!

I'm working for an anti-virus/security company, and a friend of mine wants to write a paper on DNS cache poisoning. So as to have some real data to give as exemple in his paper, he wants to run an attack on tests DNS servers. As he's not easy with C coding he asked me to do the job for him
So... i used libnet to send my forged DNS packets.
The root of the idea is to send my forged DNS answers before the real server answers... so I've got to be pretty quick. Here's some stats concerning the soft i wrote:
Code:
Program: ./dns-poisoner-ethernet
lun oct 31 17:10:52 GMT 2005

Domain name to spoof: www.test.test
IP address to inject in the cache:                      172.16.0.1
IP address of the DNS server to poison:                 192.168.0.79
IP address of the DNS forwarder the victim's calling:   192.168.1.254
IP address used to send the query to the DNS to poison: 192.168.0.80
Number of threads used:                                 10

Number of runs: 6
Durations (usec):  809551 801194 811995 783936 785022 887929

Average: 65536 packets sent in 813271 usec
         12 usec / packet
         80583 packet / sec
         7082 kB/s
so, I'm sending the data at 7082 kB/s... quick enough to use on internet, as i don't even think that i have 7MB/s upload at the office, but still i would like to do some testing on a LAN (well... i wont attack any server on internet, that would be very professional).

Anybody has an idea why my soft do not manage do send packets at almost 100MB/s?
My friend proposed to use multi-threading, which i did, and indeed it improved my results... but still, I'm far from the 100mB/s.
I used libnet in LIBNET_LINK mode as it's supposed to be more efficient (and it is).

I wont post my code, as i don't want it to be used to perform real attacks, but i don't see how i could improve it... the issue really comes from libnet (libnet_write_link), since as soon as i comment this line (which makes the program useless) it runs 1000 times quicker.

Any idea on how i could improve all this?

Do you think i must give special options to gcc so that it optimizes the compilation? I must say that i'm not too bad at coding, but it never was my job, so i don't know much about gcc except that after running it i have an executable program (that's a beginning).

I read about using kernel mode to run my soft. Does anybody know where to find basic info on how to create a module for my program? Would it make my soft running a hundred times as fast?

[edit]
my machine is not a 4-processor server, just a simple AMD Athlon(tm) XP 2200+ with 514792 kB of RAM, but when my soft runs, it only uses smtg like 0.7% CPU and 0.1% RAM...

Last edited by fr_laz; 10-31-2005 at 11:47 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Installing Libnet Baix Linux - Software 2 09-29-2009 08:22 AM
libnet problem zaichik Programming 0 08-06-2005 06:30 PM
libnet problems StraitFaced Linux - Software 0 05-21-2005 06:04 PM
Libnet gr33ndata Programming 2 10-14-2003 02:24 PM
Libnet - Libnids Shu Linux - Software 0 07-15-2003 06:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration