Snort: How do I get packets to show up? - snort

I've recently installed Snort and according to the video I used, it should start detecting packets. The problem is that its not even though there are no errors. It looks like this:
Decoding Ethernet
--== Initialization Complete ==--
,,_ -*> Snort! <*-
o" )~ Version 2.9.16-WIN64 GRE (Build 118)
'''' By Martin Roesch & The Snort Team: http://www.snort.org/contact#team
Copyright (C) 2014-2020 Cisco and/or its affiliates. All rights reserved.
Copyright (C) 1998-2013 Sourcefire, Inc., et al.
Using PCRE version: 8.10 2010-06-25
Using ZLIB version: 1.2.11
Rules Engine: SF_SNORT_DETECTION_ENGINE Version 3.1 <Build 1>
Preprocessor Object: SF_SSLPP Version 1.1 <Build 4>
Preprocessor Object: SF_SSH Version 1.1 <Build 3>
Preprocessor Object: SF_SMTP Version 1.1 <Build 9>
Preprocessor Object: SF_SIP Version 1.1 <Build 1>
Preprocessor Object: SF_SDF Version 1.1 <Build 1>
Preprocessor Object: SF_REPUTATION Version 1.1 <Build 1>
Preprocessor Object: SF_POP Version 1.0 <Build 1>
Preprocessor Object: SF_MODBUS Version 1.1 <Build 1>
Preprocessor Object: SF_IMAP Version 1.0 <Build 1>
Preprocessor Object: SF_GTP Version 1.1 <Build 1>
Preprocessor Object: SF_FTPTELNET Version 1.2 <Build 13>
Preprocessor Object: SF_DNS Version 1.1 <Build 4>
Preprocessor Object: SF_DNP3 Version 1.1 <Build 1>
Preprocessor Object: SF_DCERPC2 Version 1.0 <Build 3>
Commencing packet processing (pid=16400)
But nothing else appears. The rules I currently have in the local.rules file is
alert icmp any any -> any any (msg:"Testing ICMP alert"; sid:1000001;)
alert udp any any -> any any (msg:"Testing UDP alert"; sid:1000002;)
alert tcp any any -> any any (msg:"Testing TCP alert"; sid:1000003;)
I'm also currently using Windows 10 which didnt help because a lot of people who asked questions similar to this used VM. Would be grateful for some help.

I think you're trying a command like this one:
snort –i3 -c c:\Snort\etc\snort.conf -A console
Where "3" is the number of the interface you're sniffing. Try to change the number of the interface you're sniffing in your command until you get something back.
You can see how many interface you have by typing:
snort -W

Related

What happened to IBM XL C/C++ preprocessor macros?

I'm working on GCC112 from the compile farm, which is a Linux ppc64-le machine. I'm testing IBM XL C/C++ and catching a compile failure on some AES code that uses POWER8. The code has worked for the last couple of years. The failure is new.
The compile failure is:
$ CXX=xlC make aes-simd.o
xlC -DNDEBUG -g2 -O3 -qrtti -qpic -qarch=pwr8 -qaltivec -c aes-simd.cpp
In file included from aes-simd.cpp:29:
./ppc-simd.h:443:16: error: use of undeclared identifier
'__builtin_crypto_vcipher'; did you mean '__builtin_vec_vcipher'?
return (T1)__builtin_crypto_vcipher((uint64x2_p)state, (uint64x2_p)key);
__builtin_crypto_vcipher is a GCC builtin. The only way to get into that path is if __xlc__ and __xlC__ are not defined:
template <class T1, class T2>
inline T1 VectorEncrypt(const T1& state, const T2& key)
{
#if defined(__xlc__) || defined(__xlC__)
return (T1)__vcipher((uint8x16_p)state, (uint8x16_p)key);
#elif defined(__GNUC__)
return (T1)__builtin_crypto_vcipher((uint64x2_p)state, (uint64x2_p)key);
#else
_ASSERT(0);
#endif
}
Checking preprocessor macros:
$ xlC -qshowmacros -qarch=pwr8 -qaltivec -E aes-simd.cpp | grep -i xlc
#define __XLC_BUILTIN_VAARG__ 1
It looks like nearly all the preprocessor macros have disappeared. A single macro of __XLC_BUILTIN_VAARG__ is not correct.
What happened to the IBM XL C/C++ preprocessor macros, and how do I get them back?
$ xlC -qversion
IBM XL C/C++ for Linux, V13.1.6 (Community Edition)
Version: 13.01.0006.0001
/opt/ibm/xlC/13.1.6/bin/.orig/xlC
IBM XL C/C++ for Linux V13.1.6 does not define __xlc__ or __xlC__ by default, but you can get the compiler to define them by using -qxlcompatmacros. You may be able to make use of the other macros it defines like __ibmxl__; see this Knowledge Center page for more information.
I know the GCC compile farm admins recently upgraded to 13.1.6 at the request of one of XL's other users, but I believe IBM XL C/C++ for Linux (for little endian distributions) has always had this same behaviour.
IBM XL C/C++ for Linux (for big endian distributions) and IBM XL C/C++ for AIX behave differently and define __xlc__ or __xlC__ by default.

ocv_add_module breaks execution of cMake file

I am trying to configure a MSVS Comunity 2017 project to get opencv 3.4.1 Matlab 2017 bindings using cMake 3.9.6.
In cMake I always obtain this two messages regarding the matlab module:
Warning: Matlab bindings will only be built in Release configurations
and
Matlab: YES
mex: C:/Program Files/MATLAB/R2017b/bin/mex.bat
Compiler/generator: Not working (bindings will not be generated)
I have edited the CMakeList.txt of the opencv_contrib matlab module, to debug the file. I have added two messages in the configure time components (line 102) as follows:
# ----------------------------------------------------------------------------
# Configure time components
# ----------------------------------------------------------------------------
set(the_description "The Matlab/Octave bindings")
message(WARNING "Message 1")
ocv_add_module(matlab BINDINGS
OPTIONAL opencv_core
opencv_imgproc opencv_ml
opencv_imgcodecs opencv_videoio opencv_highgui
opencv_objdetect opencv_flann opencv_features2d
opencv_photo opencv_video opencv_videostab
opencv_calib opencv_calib3d
opencv_stitching opencv_superres
opencv_xfeatures2d
)
message(WARNING "Message 2")
If everything be OK "Message 1" and "Message 2" should appear in CMake configuration process. When I configure the project with cMake only "Message 1" appears.
Found tiny-dnn in: C:/Datos/opencv-3.4.1/build/3rdparty/tinydnn/tiny-dnn-1.0.0a3
The protocol buffer compiler is not found (PROTOBUF_PROTOC_EXECUTABLE='')
freetype2: NO
harfbuzz: NO
Warning: Matlab bindings will only be built in Release configurations
CMake Warning at modules/opencv_contrib-3.4.1/modules/matlab/CMakeLists.txt:116 (message):
Message 1
Module opencv_ovis disabled because OGRE3D was not found
"Message 2", never ever appears. It seems like ocv_add_module command breaks the execution of the cMake file.
Can someone help me to understand what is happening?
Thanks in advance for your information.

VSTS Build Nuget Packager don't work

I'm trying to package one library after build to publish on my VSTS Packages feed.
But the task Nuget Packager is not working. I've tried lots of combinations of settings, but I could not make it works.
I've tried to package the library using .Net Core and .Net 4.6.2.
I'm getting the following error when trying to pack with .Net Core or .Net 4.6.2:
##[error]The default XML namespace of the project must be the MSBuild XML namespace. If the project is authored in the MSBuild 2003 format, please add xmlns="http://schemas.microsoft.com/developer/msbuild/2003" to the element. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format. d:\a\12\s\myproject.csproj
I'm using the following settings:
Agent: Hosted 2017
Build Number Format: $(date:yyyyMMdd).$(rev:.r).0
The .csproj for .net core is the following:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Label="Globals">
<SccProjectName>SAK</SccProjectName>
<SccProvider>SAK</SccProvider>
<SccAuxPath>SAK</SccAuxPath>
<SccLocalPath>SAK</SccLocalPath>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
</PropertyGroup>
<Import Project="..\..\myproject.shared.projitems" Label="Shared" />
<ItemGroup>
<PackageReference Include="Microsoft.ApplicationInsights" Version="2.3.0" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.2" />
<PackageReference Include="WindowsAzure.Storage" Version="8.1.1" />
</ItemGroup>
</Project>
The complete log for .Net Core is:
2017-05-16T12:25:40.4059161Z ##[section]Starting: NuGet Packager
2017-05-16T12:25:40.4069169Z ==============================================================================
2017-05-16T12:25:40.4069169Z Task : NuGet Packager
2017-05-16T12:25:40.4069169Z Description : Creates nupkg outputs from csproj or nuspec files
2017-05-16T12:25:40.4069169Z Version : 0.1.72
2017-05-16T12:25:40.4069169Z Author : Lawrence Gripper
2017-05-16T12:25:40.4069169Z Help : [More Information](https://go.microsoft.com/fwlink/?LinkID=627416)
2017-05-16T12:25:40.4069169Z ==============================================================================
2017-05-16T12:25:42.1843658Z Preparing task execution handler.
2017-05-16T12:25:47.7782379Z Executing the powershell script: d:\a\_tasks\NuGetPackager_333b11bd-d341-40d9-afcf-b32d5ce6f24b\0.1.72\NuGetPackager.ps1
2017-05-16T12:25:48.1582506Z Find-Files -SearchPattern d:\a\12\s\**\*.csproj -RootFolder d:\a\12\s
2017-05-16T12:25:48.1582506Z
2017-05-16T12:25:48.1582506Z
2017-05-16T12:25:48.2452532Z C:\LR\MMS\Services\mms\TaskAgentProvisioner\Tools\agents\2.116.1\externals\nuget\NuGet.exe pack "d:\a\12\s\SpaceNeedle.NetFX\Net4\SpaceNeedle.NetFX.Net4\SpaceNeedle.NetFX.Net4.csproj" -OutputDirectory "d:\a\12\s" -Properties Configuration=release
2017-05-16T12:25:49.5712932Z MSBuild auto-detection: using msbuild version '4.0' from 'C:\Windows\Microsoft.NET\Framework\v4.0.30319'.
2017-05-16T12:25:49.5712932Z Attempting to build package from 'SpaceNeedle.NetFX.Net4.csproj'.
2017-05-16T12:25:50.6143198Z Packing files from 'd:\a\12\s\SpaceNeedle.NetFX\Net4\SpaceNeedle.NetFX.Net4\bin\Release'.
2017-05-16T12:25:50.9343273Z Found packages.config. Using packages listed as dependencies
2017-05-16T12:25:50.9463282Z WARNING: Description was not specified. Using 'Description'.
2017-05-16T12:25:51.0333303Z Successfully created package 'd:\a\12\s\SpaceNeedle.NetFX.Net4.0.1.0.0.nupkg'.
2017-05-16T12:25:51.0763302Z C:\LR\MMS\Services\mms\TaskAgentProvisioner\Tools\agents\2.116.1\externals\nuget\NuGet.exe pack "d:\a\12\s\SpaceNeedle.NetFX\NetFX\SpaceNeedle.NetFX\SpaceNeedle.NetFX.csproj" -OutputDirectory "d:\a\12\s" -Properties Configuration=release
2017-05-16T12:25:51.4743413Z MSBuild auto-detection: using msbuild version '4.0' from 'C:\Windows\Microsoft.NET\Framework\v4.0.30319'.
2017-05-16T12:25:51.4863414Z Attempting to build package from 'SpaceNeedle.NetFX.csproj'.
2017-05-16T12:25:51.5313430Z ##[error]The default XML namespace of the project must be the MSBuild XML namespace. If the project is authored in the MSBuild 2003 format, please add xmlns="http://schemas.microsoft.com/developer/msbuild/2003" to the <Project> element. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format. d:\a\12\s\SpaceNeedle.NetFX\NetFX\SpaceNeedle.NetFX\SpaceNeedle.NetFX.csproj
2017-05-16T12:25:51.5703444Z ##[error]System.Exception: Unexpected exit code 1 returned from tool NuGet.exe
2017-05-16T12:25:51.5703444Z at Microsoft.TeamFoundation.DistributedTask.Task.Internal.InvokeToolCmdlet.ProcessRecord()
2017-05-16T12:25:51.5713439Z at System.Management.Automation.CommandProcessor.ProcessRecord()
2017-05-16T12:25:51.5943443Z ##[error]PowerShell script completed with 1 errors.
2017-05-16T12:25:51.5953445Z ##[section]Finishing: NuGet Packager
Does anyone have idea of what is happening?
Thank you!
The NuGet packer step doesn't work on SDK-based csproj formats (usually .NET Standard or .NET Core projects).
The projects can be packed using a command line step to call dotnet pack or by using the .NET Core build step (which wraps the call to dotnet in a build step). Note that the command selector currently does not list pack, but the field accepts any input:

NUnit v3 alpha in command line: Assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

I'm trying to run NUnit v3 alpha from command line. Here's my command line:
[...] \NUnit3\nunit-console NUnitAlpha3Experimental.exe /framework:net-4.5
At first, I got this error:
Errors and Failures Could not load file or assembly 'nunit.framework,
Version=3.0.5378.31152, Culture=neutral,
PublicKeyToken=2638cd05610744eb' or one of its dependencies. This
assembly is built by a runtime newer than the currently loaded runtime
and cannot be loaded.
Then I edited nunit-console.exe.config to comment .net 2.0
<startup useLegacyV2RuntimeActivationPolicy="true">
<!-- Comment out the next line to force use of .NET 4.0 -->
<!--<supportedRuntime version="v2.0.50727" />-->
<supportedRuntime version="v4.0.30319" />
</startup>
I tried these command line (with 4.0 and with 4.5)
[...] \NUnit3\nunit-console NUnitAlpha3Experimental.exe /framework:net-4.0
[...] \NUnit3\nunit-console NUnitAlpha3Experimental.exe /framework:net-4.5
Here's the error message I get:
Errors and Failures Could not load file or assembly 'nunit.framework,
Version=3.0.5378.31152, Culture=neutral,
PublicKeyToken=2638cd05610744eb' or one of its dependencies. The
located assembly's manifest definition does not match the assembly
reference. (Exception from HRESULT: 0x80131040)
Then I tried to edit nunit-console.exe.config to add a new entry for .net 4.5. I tried 4.5, 4.5.1, 4.5.50710, 4.5.50938, 4.5.50932, 4.5.51641 (all of them are present in control panel -> program and features) and I get a windows popup asking me to install .Net framework 4.5.
Edit: The new entry for .Net framework 4.5* shouldn't work anyways. The unit tests do run even if I get the error message. More info here: https://github.com/nunit/nunit-console/issues/42#issuecomment-58709851
Can someone help me with that? Thank you.
It looks like the problem was due to many versions of the dll included with nunit 3.0 (one of each .net framework version) and how it was made available to my assembly. More info here: https://github.com/nunit/nunit-console/issues/42#issuecomment-58713975

Building Matlab Mex files with CMAKE for g2o library

I'm trying to build a Matlab wrapper for my program in cpp. The program uses the g2o pose graph optimisation external library. Though the program compiles and functions well under QT, I am not successful to get it working with the the matlab mex compiler.
Any help or suggestions will be highly appreciated.
I have followed the post #: http://datainfer.wordpress.com/2014/03/28/build-matlab-mex-files-with-cmake/
My CMakeLists.txt reads as follows:
###########################################################################
cmake_minimum_required(VERSION 2.8)
project(mex_g2o_test)
SET(CMAKE_BUILD_TYPE Release)
############################################
SET( CMAKE_CXX_COMPILER mex )
SET( CMAKE_C_COMPILER mex )
# #Suffix and Prefix of the output target file
SET( CMAKE_SHARED_LIBRARY_SUFFIX .mexa64 ) # set suffix to .mexa64
SET( CMAKE_SHARED_LIBRARY_PREFIX ) # remove the "lib" prefix
# #Variables controlling the build-phrase
SET( CMAKE_CXX_FLAGS "-cxx -largeArrayDims CXXFLAGS='$$CXXFLAGS -std=c++11'" )
SET( CMAKE_SHARED_LIBRARY_CXX_FLAGS ) # remove the -fPIC option. mex does not accept the "-fPIC" option
SET( CMAKE_CXX_COMPILE_OBJECT
"<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -outdir <OBJECT_DIR> -c <SOURCE>; mv <OBJECT_DIR>/$$(basename <SOURCE> .cxx ).o <OBJECT>")
# #Variables controlling the linking-phase
SET( CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS ) # remove -shared options. mex does not accept the "-shared" option
SET(
CMAKE_CXX_CREATE_SHARED_LIBRARY
"<CMAKE_CXX_COMPILER> -cxx <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> -output <TARGET> <OBJECTS> <LINK_LIBRARIES>")
# #Variables controlling the installation RPATH
SET( CMAKE_INSTALL_RPATH "\$ORIGIN" )
# #CMake will reset RPATH at the installation phase, so we need to specify CMAKE_INSTALL_RPATH
MESSAGE( STATUS "mex.cmake is loaded.\n" )
################################################
SET(CMAKE_MODULE_PATH ${g2o_test_SOURCE_DIR}/cmake)
find_package(Eigen 3.0 REQUIRED)
find_package(G2O REQUIRED)
find_package(CSparse REQUIRED)
find_package(CHOLMOD REQUIRED)
include_directories(${G2O_INCLUDE_DIR})
include_directories(${CSPARSE_INCLUDE_DIR})
include_directories(${EIGEN_INCLUDE_DIRS})
SET(G2O_LIBRARIES ${G2O_CORE_LIBRARY} ${G2O_STUFF_LIBRARY} ${G2O_SOLVER_CSPARSE} ${G2O_SOLVER_CSPARSE_EXTENSION} ${G2O_TYPES_SLAM3D} ${G2O_TYPES_SLAM2D} ${CSPARSE_LIBRARIES} ${CHOLMOD_LIBRARIES} ${G2O_SOLVER_CHOLMOD} cxsparse blas)
ADD_LIBRARY( mex_g2o_test SHARED mex_g2o_test.cpp )
TARGET_LINK_LIBRARIES(mex_g2o_test ${G2O_LIBRARIES} ${EIGEN_LIBRARIES})
#Compilation and Terminal output
$ cmake ../
-- The C compiler identification is GNU 4.7.2
-- The CXX compiler identification is GNU 4.7.2
-- Check for working C compiler: /usr/lib64/ccache/gcc
-- Check for working C compiler: /usr/lib64/ccache/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/lib64/ccache/c++
-- Check for working CXX compiler: /usr/lib64/ccache/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- mex.cmake is loaded.
CMake Error at CMakeLists.txt:38 (find_package):
By not providing "FindEigen.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Eigen", but
CMake did not find one.
Could not find a package configuration file provided by "Eigen" (requested
version 3.0) with any of the following names:
EigenConfig.cmake
eigen-config.cmake
Add the installation prefix of "Eigen" to CMAKE_PREFIX_PATH or set
"Eigen_DIR" to a directory containing one of the above files. If "Eigen"
provides a separate development package or SDK, be sure it has been
installed.
-- Configuring incomplete, errors occurred!
The problem is in the Eigen library. You don't want to find_package( Eigen), instead just set EIGEN_INCLUDE_DIRS to the path where you have unpacked Eigen. Also, remove Eigen libs from target_link_libraries. Eigen is a header only library, including its headers is enough.
Update: Eigen also ships FindEigen3.cmake file in cmake subdirectory. You could copy this file to your sources and add path to is to CMAKE_MODULE_PATH