[Snort-users] Barnyard2 loads src IP and dst IP as digital in MySQL

Maxim hittlle at ...7427...
Wed Feb 8 20:16:28 EST 2017


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 at ...16912...> 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 at 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!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.snort.org/pipermail/snort-users/attachments/20170209/47079732/attachment.html>


More information about the Snort-users mailing list