Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

How to use Net::DNS:: Update with Net::Frame::Simple

by sagarkha (Acolyte)
on Mar 03, 2013 at 12:35 UTC ( #1021499=perlquestion: print w/replies, xml ) Need Help??
sagarkha has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks I am trying to solve a challenge at It is completely ethical. The challenge is to change the A record on Primary DNS server, they are recommending scapy(tool written in python) to do so. But I am trying to do it with Perl. I have modified Net::DNS to acheive this.Here is my code

#!/usr/bin/perl -w use strict; use Net::DNS; # Create the update packet. my $update = Net::DNS::Update->new('evil.zz'); # Prerequisite is that no A records exist for the name. $update->push(prerequisite => nxrrset('hacker11.evil.zz. A')); # Add two A records for the name. $update->push(update => rr_add('hacker11.evil.zz. 86400 A +')); # $update->push(update => rr_add(' 86400 A 172.16.3 +.4')); # Send the update to the zone's primary master. my $res = Net::DNS::Resolver->new; $res->nameservers(''); my $reply = $res->send($update); # Did it work? if ($reply) { my $rcode = $reply->header->rcode; print 'Update ', $rcode eq 'NOERROR' ? "succeeded\n" : "failed +: $rcode\n"; } else { print 'Update failed: ', $res->errorstring, "\n"; }

This code is working fine but to accomplish the task properly i need to change Source IP of this DNS request. I know one can change his source IP while creating a packet though Net::Frame::Simple etc. But how to use it in my case. Please let me know if you need further clarification.

Replies are listed 'Best First'.
Re: How to use Net::DNS:: Update with Net::Frame::Simple
by VinsWorldcom (Parson) on Mar 04, 2013 at 02:16 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1021499]
Approved by ww
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2018-01-19 15:59 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (221 votes). Check out past polls.