Snort mailing list archives

Re: Barnyard2 loads src IP and dst IP as digital in MySQL


From: Maxim <hittlle () 163 com>
Date: Thu, 9 Feb 2017 09:16:28 +0800 (CST)

Hi, IPv4 address are actually 32-bit integers, you can covert these integers to decimal format using MySQL inet_ntoa 
function, for example,
         select inet_ntoa(3232235693) as ip from xxx;








At 2017-02-08 17:48:52, "Ian" <snort_list () fishnet co uk> wrote:
On 07/02/2017 21:52, Paul Li wrote:
I'm using Barnyard2 to load Snort alerts to MySQL database. In the iphdr
table, src IP and dstIP are showing as a long number, such as the following
+------------------+------------------+
| ip_src          | ip_dst         |
+------------------+------------------+
| 3232235693 | 3232235675 |
| 3232235675 | 3232235693 |
+------------------+-------------------+

Not sure what encoding/values they are. Just wondering how should I get
the original values, which are in the case 192.168.0.183 and 192.168.0.155?

Thanks,
Paul


Hi,

You can use the built in mysql functions to receive the IPs:

SELECT inet_ntoa(3232235693);

or

SELECT inet_ntoa(ip_src), inet_ntoa(ip_dst) FROM iphdr LIMIT 0,1;

Regards

Ian
-- 





------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Snort-users mailing list
Snort-users () lists sourceforge net
Go to this URL to change user options or unsubscribe:
https://lists.sourceforge.net/lists/listinfo/snort-users
Snort-users list archive:
http://sourceforge.net/mailarchive/forum.php?forum_name=snort-users

Please visit http://blog.snort.org to stay current on all the latest Snort news!
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Snort-users mailing list
Snort-users () lists sourceforge net
Go to this URL to change user options or unsubscribe:
https://lists.sourceforge.net/lists/listinfo/snort-users
Snort-users list archive:
http://sourceforge.net/mailarchive/forum.php?forum_name=snort-users

Please visit http://blog.snort.org to stay current on all the latest Snort news!

Current thread: