LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 06-18-2014, 11:57 AM   #1
NewLegend
LQ Newbie
 
Registered: Oct 2012
Posts: 18

Rep: Reputation: Disabled
Convert Domain-String to Hex


Hi,
Is there any way to convert domain-string to hex.

I looking to drop string by iptables for DNS service, for example I wanna drop this domain "luse0.com", What's the command to convert string to hex and what about this numbers in the rule below: 34 and 80


iptables --insert INPUT -p udp --dport 53 -m string --from 34 --to 80 --algo bm --hex-string '|056c7573653003636f6d00|' -j DROP -m comment --comment "DROP DNS Q luse0.com"
 
Old 06-19-2014, 04:41 AM   #2
NewLegend
LQ Newbie
 
Registered: Oct 2012
Posts: 18

Original Poster
Rep: Reputation: Disabled
Any ideas
 
Old 06-19-2014, 06:40 AM   #3
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,474

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Quote:
Originally Posted by NewLegend View Post
What's the command to convert string to hex
Code:
man od
 
Old 06-22-2014, 02:01 AM   #4
NewLegend
LQ Newbie
 
Registered: Oct 2012
Posts: 18

Original Poster
Rep: Reputation: Disabled
Hi,
Is od command will convert the domain ?
 
Old 06-22-2014, 02:16 AM   #5
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,474

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
od can convert text to hex, go read the man pages
 
  


Reply



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
How to get hex offset of string otaku2k2 Linux - Software 6 01-30-2012 06:06 AM
[SOLVED] Convert hex string to int in kernel yoavf Linux - Kernel 9 03-22-2011 05:10 AM
Hex String to ttysX digmeupnow Linux - Newbie 1 11-25-2008 03:33 AM
Hex output of a hex/ascii input string mlewis Programming 35 04-10-2008 12:05 PM
hex string to long in c rubadub Programming 5 07-26-2007 12:48 PM

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

All times are GMT -5. The time now is 10:52 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