nbs-system / nxtool-ng

Because life is too short to waste your time transforming naxsi logs to rules by hand
42 stars 13 forks source link

Log import on Centos 7 fails #28

Closed Keithsc closed 7 years ago

Keithsc commented 7 years ago

Hi, If I try and import / parse ? a log file with nxtool-ng it fails with the following error. I am running the command on a new Centos 7.3 VM. Any help would be appreciated.

# python ./nxtool-ng-master/nxtool.py --flat-file /root/Y.log
Traceback (most recent call last):
  File "./nxtool-ng-master/nxtool.py", line 153, in <module>
    sys.exit(main())
  File "./nxtool-ng-master/nxtool.py", line 149, in main
    print(printers.print_generic(source.get_results()))
  File "/root/nxtool-ng-master/nxtool/printers.py", line 18, in print_generic
    print('\n'.join('%s: %s' % (k, item[k]) for k in item) + '\n')
  File "/root/nxtool-ng-master/nxtool/printers.py", line 18, in <genexpr>
    print('\n'.join('%s: %s' % (k, item[k]) for k in item) + '\n')
TypeError: list indices must be integers, not dict

Thanks Keith.

sabban commented 7 years ago

Hi,

Can you show us an (anonymized) extract of log that triggers your issue ?

Regards,

Keithsc commented 7 years ago

Hi, We have a pair of Nginx reverse proxies that we use as load balancers for our servers. We forward the Errors from nginx using syslog to a central server. Now I am looking at the logs I wonder if that's what the problem is. Strangely the original nxtool works with these logs but I couldn't get the original version to work with ElasticSearch v5 which is why we thought we'd try nxtool-ng.

2017-06-07T12:48:36+01:00 192.168.X.Y nginx: 2017/06/07 12:48:36 [error] 29006#0: *2630943 NAXSI_FMT: ip=10.241.15.254&server=mysite.com&uri=/_results.aspx&learning=1&vers=0.55.3&total_processed=8877& total_blocked=5867&block=1&cscore0=$XSS&score0=176&zone0=HEADERS&id0=1315&var_name0=cookie, client: 10.241.15.254, server: mysite.com, request: "GET /_results.aspx?catID=18&regionID=9&orgID=& word= HTTP/1.1", host: "mysite.com", referrer: "https://mysite.com/_results.aspx?catID=&regionID=9&orgID=&word="https://mysite.com/_results.aspx?catID=&regionID=9&orgID=&word=

Keith.

On 07/06/17 15:51, Manuel Sabban wrote:

Hi,

Can you show us an (anonymized) extract of log that triggers your issue ?

Regards,

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/nbs-system/nxtool-ng/issues/28#issuecomment-306819415, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AFUXkD2OWvzDQez7J-7XYLfRYf_rf4tlks5sBrj0gaJpZM4Nyz8e.

-- To assist us in answering your requests in a timely manner, please raise a call with our service desk -NSS.CSD@nhs.net - giving your contact details and some information about your request.

Keith Scott Technical Specialist Architecture & Solutions Service NSS Information Technology SBU

NHS National Services Scotland Area 074a Gyle Square 1 South Gyle Crescent Edinburgh EH12 9EB T: 0131 275 6000

Please consider the environment before printing this email. NHS National Services Scotland is the common name for the Common Services Agency for the Scottish Health Service. www.nhsnss.orghttp://www.nhsnss.org


This message may contain confidential information. If you are not the intended recipient please inform the sender that you have received the message in error before deleting it. Please do not disclose, copy or distribute information in this e-mail or take any action in reliance on its contents: to do so is strictly prohibited and may be unlawful.

Thank you for your co-operation.

NHSmail is the secure email and directory service available for all NHS staff in England and Scotland NHSmail is approved for exchanging patient data and other sensitive information with NHSmail and other accredited email services. NHSmail provides an email address for your career in the NHS and can be accessed anywhere For more information and to find out how you can switch, visit http://support.nhs.net/joiningnhsmail


sabban commented 7 years ago

It seems weird.

Can you verify you have the last commit I merged some hours ago ?

Thanks

Keithsc commented 7 years ago

I downloaded the master.zip file again and it's working! When I run it there a load of text output and it didn't fail so it appears to be able to read my logs.

Thanks for your quick replies.

Keith

On 07/06/17 16:21, Manuel Sabban wrote:

It seems weird.

Can you verify you have the last commit I merged some hours ago ?

Thanks

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/nbs-system/nxtool-ng/issues/28#issuecomment-306828972, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AFUXkIM3tUe1W48VOYEnL8VrwZ-0wghmks5sBr__gaJpZM4Nyz8e.

-- To assist us in answering your requests in a timely manner, please raise a call with our service desk -NSS.CSD@nhs.net - giving your contact details and some information about your request.

Keith Scott Technical Specialist Architecture & Solutions Service NSS Information Technology SBU

NHS National Services Scotland Area 074a Gyle Square 1 South Gyle Crescent Edinburgh EH12 9EB T: 0131 275 6000

Please consider the environment before printing this email. NHS National Services Scotland is the common name for the Common Services Agency for the Scottish Health Service. www.nhsnss.orghttp://www.nhsnss.org


This message may contain confidential information. If you are not the intended recipient please inform the sender that you have received the message in error before deleting it. Please do not disclose, copy or distribute information in this e-mail or take any action in reliance on its contents: to do so is strictly prohibited and may be unlawful.

Thank you for your co-operation.

NHSmail is the secure email and directory service available for all NHS staff in England and Scotland NHSmail is approved for exchanging patient data and other sensitive information with NHSmail and other accredited email services. NHSmail provides an email address for your career in the NHS and can be accessed anywhere For more information and to find out how you can switch, visit http://support.nhs.net/joiningnhsmail