Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^5: Inserting domain name into Snort rule

by aaron_baugher (Curate)
on Oct 06, 2012 at 08:22 UTC ( #997597=note: print w/ replies, xml ) Need Help??


in reply to Re^4: Inserting domain name into Snort rule
in thread Inserting domain name into Snort rule

The code as you've quoted it works fine when I give it a hardcoded domain:

$domain = 'foobar.foodomain.com'; $dns = join '|', '', ( map { sprintf('%02d',length $_), $_ } split /\. +/, $domain ), '00', ''; print "$dns\n"; # prints: |06|foobar|09|foodomain|03|com|00|

So I'd say you need to look at your input.

Aaron B.
Available for small or large Perl jobs; see my home node.

Replies are listed 'Best First'.
Re^6: Inserting domain name into Snort rule
by miniperl (Initiate) on Oct 10, 2012 at 14:12 UTC

    You are absolutely correct. The input file was originally an windows csv, so a little dos2unix cleaned it up and it works like a champ now.

    Thanks again.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://997597]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2016-06-24 23:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (322 votes). Check out past polls.