### Installation Directory Setup Source: https://github.com/asset-group/sni5gect-5gnr-sniffing-and-exploitation/blob/main/CMakeLists.txt Configures installation directories for runtime, libraries, includes, documentation, and data. It uses GNUInstallDirs and provides a fallback for the library directory if it doesn't exist. ```cmake if (NOT CMAKE_INSTALL_LIBDIR) include(GNUInstallDirs) endif (NOT CMAKE_INSTALL_LIBDIR) # Fall back to just "lib" if the item provided by GNUInstallDirs doesn't exist if (NOT EXISTS "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") message(STATUS "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR} does not exist. Defaulting install location to ${CMAKE_INSTALL_PREFIX}/lib.") set(CMAKE_INSTALL_LIBDIR lib) endif() set(RUNTIME_DIR bin) set(LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}) set(INCLUDE_DIR include) set(DOC_DIR "share/doc/${CPACK_PACKAGE_NAME}") set(DATA_DIR share/${CPACK_PACKAGE_NAME}) ``` -------------------------------- ### Install Example Configuration File (CMake) Source: https://github.com/asset-group/sni5gect-5gnr-sniffing-and-exploitation/blob/main/srsue/CMakeLists.txt This CMake snippet installs an example configuration file named 'ue.conf.example' to the specified data directory during the installation phase of the build process. This provides users with a template for their own configuration. ```cmake install(FILES ue.conf.example DESTINATION ${DATA_DIR}) ``` -------------------------------- ### Install Configs Script Configuration Source: https://github.com/asset-group/sni5gect-5gnr-sniffing-and-exploitation/blob/main/CMakeLists.txt Configures a helper script for installing configurations by using a template file and placing the generated script in the binary directory, marking it for installation. ```cmake # Auto-generate config install helper and mark for installation configure_file( ${PROJECT_SOURCE_DIR}/cmake/modules/SRSRAN_install_configs.sh.in ${CMAKE_BINARY_DIR}/srsran_install_configs.sh ) install(PROGRAMS ${CMAKE_BINARY_DIR}/srsran_install_configs.sh DESTINATION ${RUNTIME_DIR}) ``` -------------------------------- ### Print Build Summary Information in CMake Source: https://github.com/asset-group/sni5gect-5gnr-sniffing-and-exploitation/blob/main/CMakeLists.txt These CMake commands use `message(STATUS ...)` to print important build information to the console during the configuration or build process. They display the installation prefix and the project version, aiding in build verification and debugging. ```cmake message(STATUS "Using install prefix: ${CMAKE_INSTALL_PREFIX}") message(STATUS "Building for version: ${VERSION}") ``` -------------------------------- ### Install Default Configuration Files (CMake) Source: https://github.com/asset-group/sni5gect-5gnr-sniffing-and-exploitation/blob/main/srsenb/CMakeLists.txt This CMake snippet defines the installation rules for default configuration files. It copies example configuration files (enb.conf.example, rb.conf.example, rr.conf.example, sib.conf.example) to the specified data directory during the installation process. ```cmake install(FILES enb.conf.example DESTINATION ${DATA_DIR}) install(FILES rb.conf.example DESTINATION ${DATA_DIR}) install(FILES rr.conf.example DESTINATION ${DATA_DIR}) install(FILES sib.conf.example DESTINATION ${DATA_DIR}) ``` -------------------------------- ### Add Subdirectory and Install Files (CMake) Source: https://github.com/asset-group/sni5gect-5gnr-sniffing-and-exploitation/blob/main/srsepc/CMakeLists.txt This snippet shows how to include subdirectories for building parts of the project and how to install example configuration files and shell scripts to specified destinations upon installation. ```cmake add_subdirectory(src) install(FILES epc.conf.example DESTINATION ${DATA_DIR}) install(FILES mbms.conf.example DESTINATION ${DATA_DIR}) install(FILES user_db.csv.example DESTINATION ${DATA_DIR}) install(PROGRAMS srsepc_if_masq.sh DESTINATION ${RUNTIME_DIR}) ``` -------------------------------- ### Create E-RAB Setup Test Executable Source: https://github.com/asset-group/sni5gect-5gnr-sniffing-and-exploitation/blob/main/srsenb/test/rrc/CMakeLists.txt Defines an executable named 'erab_setup_test' compiled from 'erab_setup_test.cc'. This executable is intended for testing the E-RAB (Evolved Radio Access Bearer) setup procedures. ```cmake add_executable(erab_setup_test erab_setup_test.cc) ``` -------------------------------- ### Create Uninstall Target in CMake Source: https://github.com/asset-group/sni5gect-5gnr-sniffing-and-exploitation/blob/main/CMakeLists.txt This CMake snippet defines a custom target named 'uninstall'. It uses a configuration file template (`cmake_uninstall.cmake.in`) to generate an uninstall script, allowing users to remove installed files cleanly. This is crucial for managing installations and updates. ```cmake configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY) add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) ``` -------------------------------- ### srsGUI Integration Source: https://github.com/asset-group/sni5gect-5gnr-sniffing-and-exploitation/blob/main/CMakeLists.txt Finds and integrates the srsGUI library if `ENABLE_GUI` is set. It adds definitions and includes necessary directories if srsGUI is found. ```cmake if(ENABLE_GUI) find_package(SRSGUI) if(SRSGUI_FOUND) add_definitions(-DENABLE_GUI) include_directories(${SRSGUI_INCLUDE_DIRS}) link_directories(${SRSGUI_LIBRARY_DIRS}) endif(SRSGUI_FOUND) endif(ENABLE_GUI) ``` -------------------------------- ### Build and Run Sni5Gect Docker Container Source: https://github.com/asset-group/sni5gect-5gnr-sniffing-and-exploitation/blob/main/README.md This snippet demonstrates how to build and start the Sni5Gect Docker container, access it, and run the sniffer. It requires Docker and Docker Compose to be installed. The command assumes a configuration file for the srsRAN base station. ```bash docker compose build sni5gect docker compose up -d sni5gect docker exec -it sni5gect bash ./build/shadower/shadower configs/srsran-n78-20MHz-b210.yaml ``` -------------------------------- ### Link Libraries to E-RAB Setup Test Source: https://github.com/asset-group/sni5gect-5gnr-sniffing-and-exploitation/blob/main/srsenb/test/rrc/CMakeLists.txt Links the 'test_helpers' library, configuration parser libraries, and atomic libraries to the 'erab_setup_test' executable. This provides the necessary dependencies for E-RAB setup testing. ```cmake target_link_libraries(erab_setup_test test_helpers ${LIBCONFIGPP_LIBRARIES} ${ATOMIC_LIBS}) ``` -------------------------------- ### Project Setup and Configuration with CMake Source: https://github.com/asset-group/sni5gect-5gnr-sniffing-and-exploitation/blob/main/CMakeLists.txt This CMake code configures the srsRAN project. It sets the minimum CMake version, defines the project name, prints system information, and includes necessary modules for versioning and packaging. ```cmake ######################################################################## # Project setup ######################################################################## cmake_minimum_required(VERSION 3.11) project( SRSRAN ) message( STATUS "CMAKE_SYSTEM: " ${CMAKE_SYSTEM} ) message( STATUS "CMAKE_SYSTEM_PROCESSOR: " ${CMAKE_SYSTEM_PROCESSOR} ) message( STATUS "CMAKE_CXX_COMPILER: " ${CMAKE_CXX_COMPILER} ) list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/modules") include(SRSRANVersion) #sets version information include(SRSRANPackage) #setup cpack include(CTest) configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/CTestCustom.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/CTestCustom.cmake" IMMEDIATE @ONLY) if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release) message(STATUS "Build type not specified: defaulting to Release.") endif(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "") # Generate CMake to include build information configure_file( ${PROJECT_SOURCE_DIR}/cmake/modules/SRSRANbuildinfo.cmake.in ${CMAKE_BINARY_DIR}/SRSRANbuildinfo.cmake ) ``` -------------------------------- ### Install srsue Executable (CMake) Source: https://github.com/asset-group/sni5gect-5gnr-sniffing-and-exploitation/blob/main/srsue/src/CMakeLists.txt Installs the srsue executable to the specified runtime directory. The installation is optional, controlled by the OPTIONAL keyword. ```cmake install(TARGETS srsue DESTINATION ${RUNTIME_DIR} OPTIONAL) ``` -------------------------------- ### Disable Install All Dependency Source: https://github.com/asset-group/sni5gect-5gnr-sniffing-and-exploitation/blob/main/CMakeLists.txt Disables the automatic dependency check for 'make install' by setting CMAKE_SKIP_INSTALL_ALL_DEPENDENCY to TRUE. This can speed up the install process by skipping dependency checks. ```cmake # Disables the project to build when calling "make install" set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY TRUE) ``` -------------------------------- ### Example SRS RAN Configuration Source: https://github.com/asset-group/sni5gect-5gnr-sniffing-and-exploitation/blob/main/README.md This YAML configuration file defines parameters for an SRS RAN setup, including cell configuration, RF settings, worker pool sizes, and exploit module paths. It is used to set up the radio frequency parameters and operational aspects of the 5GNR system. ```yaml cell: band: 78 # Band number nof_prb: 51 # Number of Physical Resource Blocks scs_common: 30 # Subcarrier Spacing for common (kHz) scs_ssb: 30 # Subcarrier Spacing for SSB (kHz) ssb_period_ms: 10 # SSB periodicity in milliseconds dl_arfcn: 628500 # Downlink ARFCN ssb_arfcn: 628128 # SSB ARFCN source: source_type: uhd source_params: type=b200,master_clock_rate=23.04e6 enable_recorder: false # record the IQ samples to file pcap_folder: logs/ rf: sample_rate: 23.04e6 num_channels: 1 uplink_cfo: -0.00054 # Uplink Carrier Frequency Offset correction in Hz downlink_cfo: 0 # Downlink Carrier Frequency Offset (CFO) in Hz padding: front_padding: 0 # Number of IQ samples to pad in front of each burst back_padding: 0 # Number of IQ samples to pad at the end of each burst channels: - rx_frequency: 3427.5e6 # Actual rx frequency for each channel tx_frequency: 3427.5e6 # Actual tx frequency for each channel rx_offset: 0 # rx frequency manual calibration tx_offset: 0 # tx frequency manual calibration rx_gain: 40 # rx gain to use for each channel tx_gain: 80 # tx gain to use for each channel enable: true # Enable this channel or not workers: pool_size: 24 # Worker pool size n_ue_dl_worker: 4 # Number of UE downlink workers n_ue_ul_worker: 4 # Number of UE uplink workers n_gnb_dl_worker: 4 # Number of gNB downlink workers n_gnb_ul_worker: 4 # Number of gNB uplink workers uetracker: close_timeout: 5000 # ms: stop tracking if no messages received parse_messages: true # Parse messages num_ues: 5 # Number of UETrackers to pre-initialize enable_gpu: false # GPU acceleration for decoding downlink_injector: delay_n_slots: 5 # Number of slots to delay injecting the message duplications: 2 # Number of duplications to send in each inject tx_cfo_correction: 0 # Uplink CFO correction (Hz) tx_advancement: 160 # Number of samples to send in advance pdsch_mcs: 3 # PDSCH MCS pdsch_prbs: 24 # PDSCH PRBs log: log_level: INFO syncer: INFO worker: INFO bc_worker: INFO exploit: build/modules/lib_dummy_exploit.so # exploit module to use # exploit: build/modules/lib_identity_request.so # exploit: build/modules/lib_dg_authentication_request_sniffer.so # exploit: build/modules/lib_dg_authentication_replay.so # exploit: build/modules/lib_dg_registration_reject.so # exploit: build/modules/lib_mac_sch_mtk_rlc_crash.so # exploit: build/modules/lib_mac_sch_mtk_rrc_setup_crash_3.so # exploit: build/modules/lib_mac_sch_mtk_rrc_setup_crash_4.so # exploit: build/modules/lib_mac_sch_mtk_rrc_setup_crash_6.so # exploit: build/modules/lib_mac_sch_mtk_rrc_setup_crash_7.so # exploit: build/modules/lib_plaintext_registration_accept.so ``` -------------------------------- ### Install srsRAN Common Library Source: https://github.com/asset-group/sni5gect-5gnr-sniffing-and-exploitation/blob/main/lib/src/common/CMakeLists.txt This command installs the 'srsran_common' library to a specified destination directory. The installation is optional, meaning it will only occur if explicitly requested. ```cmake install(TARGETS srsran_common DESTINATION ${LIBRARY_DIR} OPTIONAL) ``` -------------------------------- ### Install Library Headers with CMake Source: https://github.com/asset-group/sni5gect-5gnr-sniffing-and-exploitation/blob/main/lib/CMakeLists.txt This CMake command installs header files from the 'include/' directory to a specified destination, typically the system's include path. It uses FILES_MATCHING with a PATTERN to ensure only files ending with '.h' are installed. ```cmake INSTALL( DIRECTORY include/ DESTINATION "${INCLUDE_DIR}" FILES_MATCHING PATTERN "*.h" ) ``` -------------------------------- ### Install srsRAN PHY Static Library Source: https://github.com/asset-group/sni5gect-5gnr-sniffing-and-exploitation/blob/main/lib/src/phy/CMakeLists.txt This CMake command installs the `srsran_phy` static library to the specified destination directory (`${LIBRARY_DIR}`). The `OPTIONAL` keyword indicates that the installation is not mandatory and can be skipped. ```cmake install(TARGETS srsran_phy DESTINATION ${LIBRARY_DIR} OPTIONAL) ``` -------------------------------- ### Install srsenb Executable (CMake) Source: https://github.com/asset-group/sni5gect-5gnr-sniffing-and-exploitation/blob/main/srsenb/src/CMakeLists.txt This CMake command specifies that the 'srsenb' target should be installed to the ${RUNTIME_DIR} directory. The OPTIONAL keyword indicates that the installation of this target is not mandatory and can be skipped. ```cmake install(TARGETS srsenb DESTINATION ${RUNTIME_DIR} OPTIONAL) ``` -------------------------------- ### Download and Extract Example Recording Source: https://github.com/asset-group/sni5gect-5gnr-sniffing-and-exploitation/blob/main/README.md This snippet shows how to download a pre-recorded 5G connection sample from Zenodo and extract it for offline analysis with Sni5Gect. It uses `wget` for downloading and `unzip` for extraction. ```bash wget https://zenodo.org/records/15601773/files/example-connection-samsung-srsran.zip unzip example-connection-samsung-srsran.zip ``` -------------------------------- ### Install EPC Executables (CMake) Source: https://github.com/asset-group/sni5gect-5gnr-sniffing-and-exploitation/blob/main/srsepc/src/CMakeLists.txt This CMake snippet installs the 'srsepc' and 'srsmbms' targets to the RUNTIME_DIR destination. The OPTIONAL keyword indicates that the installation of these targets is optional, allowing the build to succeed even if the installation fails. ```cmake install(TARGETS srsepc DESTINATION ${RUNTIME_DIR} OPTIONAL) install(TARGETS srsmbms DESTINATION ${RUNTIME_DIR} OPTIONAL) ``` -------------------------------- ### Setup Include and Link Paths (CMake) Source: https://github.com/asset-group/sni5gect-5gnr-sniffing-and-exploitation/blob/main/srsenb/CMakeLists.txt This CMake snippet configures the include and linker paths for the project. It adds directories for Boost, SEC, and the project's source directory to the include paths, and Boost and SEC library directories to the link paths. ```cmake include_directories( ${Boost_INCLUDE_DIRS} ${SEC_INCLUDE_DIRS} ${PROJECT_SOURCE_DIR} ) link_directories( ${Boost_LIBRARY_DIRS} ${SEC_LIBRARY_DIRS} ) ``` -------------------------------- ### Find and Configure SKIQ Library in CMake Source: https://github.com/asset-group/sni5gect-5gnr-sniffing-and-exploitation/blob/main/CMakeLists.txt This CMake snippet finds the SKIQ library, which is likely related to signal processing or IQ data handling. If found, it configures the necessary include and library paths for the build. ```cmake # SKIQ if (ENABLE_SKIQ) find_package(SKIQ) if(SKIQ_FOUND) include_directories(${SKIQ_INCLUDE_DIRS}) link_directories(${SKIQ_LIBRARY_DIRS}) endif(SKIQ_FOUND) endif (ENABLE_SKIQ) ``` -------------------------------- ### Add Subdirectories to CMake Build Source: https://github.com/asset-group/sni5gect-5gnr-sniffing-and-exploitation/blob/main/CMakeLists.txt This CMake command `add_subdirectory(lib)` includes the build configurations from the 'lib' subdirectory into the main build process. This modular approach allows for organizing the project into logical components. ```cmake add_subdirectory(lib) ``` -------------------------------- ### Add E-RAB Setup Test Case Source: https://github.com/asset-group/sni5gect-5gnr-sniffing-and-exploitation/blob/main/srsenb/test/rrc/CMakeLists.txt Registers 'erab_setup_test' as a CTest test case. It specifies the executable and an include directory for test resources. ```cmake add_test(erab_setup_test erab_setup_test -i ${CMAKE_CURRENT_SOURCE_DIR}/../..) ``` -------------------------------- ### TTCN3 Support Configuration Source: https://github.com/asset-group/sni5gect-5gnr-sniffing-and-exploitation/blob/main/CMakeLists.txt Enables TTCN3 support by finding the RapidJSON library, adding a definition, and configuring include and library paths. A status message is printed if TTCN3 is enabled. ```cmake if (ENABLE_TTCN3) find_package(RapidJSON REQUIRED) add_definitions(-DENABLE_TTCN3) include_directories(${RAPIDJSON_INCLUDE_DIRS}) link_directories(${RAPIDJSON_LIBRARY_DIRS}) message(STATUS "Building with TTCN3 binaries") endif (ENABLE_TTCN3) ``` -------------------------------- ### Define and Configure Test Cases (CMake) Source: https://github.com/asset-group/sni5gect-5gnr-sniffing-and-exploitation/blob/main/shadower/test/CMakeLists.txt This snippet shows how to define tests in CMake, specifying the executable, arguments, and working directory. It includes examples for different test configurations. ```cmake add_test(shd_cell_search_test_srsran_n78_20MHz ${CMAKE_BINARY_DIR}/shadower/test/cell_search_test 0) set_tests_properties(shd_cell_search_test_srsran_n78_20MHz PROPERTIES WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}) ``` ```cmake add_test(shd_cell_search_test_srsran_n78_40MHz ${CMAKE_BINARY_DIR}/shadower/test/cell_search_test 1) set_tests_properties(shd_cell_search_test_srsran_n78_40MHz PROPERTIES WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}) ``` ```cmake add_test(shd_sib_search_test_srsran_n78_20MHz ${CMAKE_BINARY_DIR}/shadower/test/sib_search_test 0) set_tests_properties(shd_sib_search_test_srsran_n78_20MHz PROPERTIES WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}) ``` ```cmake add_test(shd_sib_search_test_srsran_n78_40MHz ${CMAKE_BINARY_DIR}/shadower/test/sib_search_test 1) set_tests_properties(shd_sib_search_test_srsran_n78_40MHz PROPERTIES WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}) ``` ```cmake add_test(shd_rar_search_test_srsran_n78_20MHz ${CMAKE_BINARY_DIR}/shadower/test/rar_search_test 0) set_tests_properties(shd_rar_search_test_srsran_n78_20MHz PROPERTIES WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}) ``` ```cmake add_test(shd_rar_search_test_srsran_n78_40MHz ${CMAKE_BINARY_DIR}/shadower/test/rar_search_test 1) set_tests_properties(shd_rar_search_test_srsran_n78_40MHz PROPERTIES WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}) ``` ```cmake add_test(shd_contention_resolution_test_srsran_n78_20MHz ${CMAKE_BINARY_DIR}/shadower/test/contention_resolution_test 0) set_tests_properties(shd_contention_resolution_test_srsran_n78_20MHz PROPERTIES WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}) ``` ```cmake add_test(shd_contention_resolution_test_srsran_n78_40MHz ${CMAKE_BINARY_DIR}/shadower/test/contention_resolution_test 1) set_tests_properties(shd_contention_resolution_test_srsran_n78_40MHz PROPERTIES WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}) ``` ```cmake add_test(shd_rach_msg3_test_srsran_n78_20MHz ${CMAKE_BINARY_DIR}/shadower/test/rach_msg3_test 0) set_tests_properties(shd_rach_msg3_test_srsran_n78_20MHz PROPERTIES WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}) ``` ```cmake add_test(shd_rach_msg3_test_srsran_n78_40MHz ${CMAKE_BINARY_DIR}/shadower/test/rach_msg3_test 1) set_tests_properties(shd_rach_msg3_test_srsran_n78_40MHz PROPERTIES WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}) ``` ```cmake add_test(shd_rrc_setup_test_srsran_n78_20MHz ${CMAKE_BINARY_DIR}/shadower/test/rrc_setup_test 0) set_tests_properties(shd_rrc_setup_test_srsran_n78_20MHz PROPERTIES WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}) ``` ```cmake add_test(shd_rrc_setup_test_srsran_n78_40MHz ${CMAKE_BINARY_DIR}/shadower/test/rrc_setup_test 1) set_tests_properties(shd_rrc_setup_test_srsran_n78_40MHz PROPERTIES WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}) ``` ```cmake add_test(shd_pdsch_decode_test_srsran_n78_20MHz ${CMAKE_BINARY_DIR}/shadower/test/pdsch_decode_test 0) set_tests_properties(shd_pdsch_decode_test_srsran_n78_20MHz PROPERTIES WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}) ``` ```cmake add_test(shd_pdsch_decode_test_srsran_n78_20MHz_0 ${CMAKE_BINARY_DIR}/shadower/test/pdsch_decode_test 0 -f ${CMAKE_SOURCE_DIR}/shadower/test/data/srsran-n78-20MHz/pdsch_3440.fc32 -s 0 -h 0) set_tests_properties(shd_pdsch_decode_test_srsran_n78_20MHz_0 PROPERTIES WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}) ``` ```cmake add_test(shd_pdsch_decode_test_srsran_n78_20MHz_1 ${CMAKE_BINARY_DIR}/shadower/test/pdsch_decode_test 0 -f ${CMAKE_SOURCE_DIR}/shadower/test/data/srsran-n78-20MHz/pdsch_3640.fc32 -s 0 -h 1) set_tests_properties(shd_pdsch_decode_test_srsran_n78_20MHz_1 PROPERTIES WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}) ``` ```cmake add_test(shd_pdsch_decode_test_srsran_n78_20MHz_2 ${CMAKE_BINARY_DIR}/shadower/test/pdsch_decode_test 0 -f ${CMAKE_SOURCE_DIR}/shadower/test/data/srsran-n78-20MHz/pdsch_3684.fc32 -s 4 -h 1) set_tests_properties(shd_pdsch_decode_test_srsran_n78_20MHz_2 PROPERTIES WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}) ``` ```cmake add_test(shd_pdsch_decode_test_srsran_n78_40MHz ${CMAKE_BINARY_DIR}/shadower/test/pdsch_decode_test 1) set_tests_properties(shd_pdsch_decode_test_srsran_n78_40MHz PROPERTIES WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}) ``` -------------------------------- ### Install Version Header with CMake Source: https://github.com/asset-group/sni5gect-5gnr-sniffing-and-exploitation/blob/main/lib/include/srsran/CMakeLists.txt This CMake command installs the generated version header file to the project's include directory. It ensures that the version information is available to the application during compilation. The destination path is specified relative to the main include directory. ```cmake INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/version.h DESTINATION "${INCLUDE_DIR}/srsran" ) ``` -------------------------------- ### Find and Configure LimeSDR Library in CMake Source: https://github.com/asset-group/sni5gect-5gnr-sniffing-and-exploitation/blob/main/CMakeLists.txt This CMake code finds the LimeSDR library (limesuiteng), a popular open-source SDR platform. If the library is found, it sets the necessary include and library directories for integrating LimeSDR hardware support. ```cmake # LimeSDR if(ENABLE_LIMESUITENG) find_package(limesuiteng REQUIRED) if(limesuiteng_FOUND) include_directories(${limesuiteng_INCLUDE_DIRS}) link_directories(${LIMESUITENG_LIBRARY_DIRS}) endif(limesuiteng_FOUND) endif(ENABLE_LIMESUITENG) ``` -------------------------------- ### Backward-cpp Library Integration Source: https://github.com/asset-group/sni5gect-5gnr-sniffing-and-exploitation/blob/main/CMakeLists.txt Detects the backward-cpp library and enables related definitions if external libraries are available. It provides feedback on whether backward-cpp support is enabled or if external libraries are missing. ```cmake find_package(Backward) if(Backward_FOUND) if(BACKWARD_HAS_EXTERNAL_LIBRARIES) add_definitions(-DHAVE_BACKWARD) message(STATUS "Building with backward-cpp support") else (BACKWARD_HAS_EXTERNAL_LIBRARIES) message(STATUS "Backward-cpp found, but external libraries are missing.") endif() endif() ``` -------------------------------- ### Boost Library Configuration Source: https://github.com/asset-group/sni5gect-5gnr-sniffing-and-exploitation/blob/main/CMakeLists.txt Configures Boost library usage, setting it to use static libraries if `BUILD_STATIC` is enabled. It defines required components and searches for the Boost package, failing the build if Boost is not found. ```cmake if(BUILD_STATIC) set(Boost_USE_STATIC_LIBS ON) endif(BUILD_STATIC) set(BOOST_REQUIRED_COMPONENTS program_options filesystem ) if(UHD_FOUND) # Ubuntu 18.04 requires component 'system' to link UHD list(APPEND BOOST_REQUIRED_COMPONENTS "system") endif(UHD_FOUND) if(UNIX AND EXISTS "/usr/lib64") list(APPEND BOOST_LIBRARYDIR "/usr/lib64") #fedora 64-bit fix endif(UNIX AND EXISTS "/usr/lib64") set(Boost_ADDITIONAL_VERSIONS "1.35.0" "1.35" "1.36.0" "1.36" "1.37.0" "1.37" "1.38.0" "1.38" "1.39.0" "1.39" "1.40.0" "1.40" "1.41.0" "1.41" "1.42.0" "1.42" "1.43.0" "1.43" "1.44.0" "1.44" "1.45.0" "1.45" "1.46.0" "1.46" "1.47.0" "1.47" "1.48.0" "1.48" "1.49.0" "1.49" "1.50.0" "1.50" "1.51.0" "1.51" "1.52.0" "1.52" "1.53.0" "1.53" "1.54.0" "1.54" "1.55.0" "1.55" "1.56.0" "1.56" "1.57.0" "1.57" "1.58.0" "1.58" "1.59.0" "1.59" "1.60.0" "1.60" "1.61.0" "1.61" "1.62.0" "1.62" "1.63.0" "1.63" "1.64.0" "1.64" "1.65.0" "1.65" "1.66.0" "1.66" "1.67.0" "1.67" "1.68.0" "1.68" "1.69.0" "1.69" ) find_package(Boost "1.35" COMPONENTS ${BOOST_REQUIRED_COMPONENTS}) if(Boost_FOUND) include_directories(${Boost_INCLUDE_DIRS}) link_directories(${Boost_LIBRARY_DIRS}) else(Boost_FOUND) message(FATAL_ERROR "Boost required to build srsRAN") endif (Boost_FOUND) ``` -------------------------------- ### Find and Configure ZeroMQ Library in CMake Source: https://github.com/asset-group/sni5gect-5gnr-sniffing-and-exploitation/blob/main/CMakeLists.txt This CMake snippet finds the ZeroMQ (ØMQ) messaging library. If ZeroMQ is found, it configures the include and library paths, enabling the use of ZeroMQ for inter-process communication within the project. ```cmake # ZeroMQ if(ENABLE_ZEROMQ) find_package(ZeroMQ) if(ZEROMQ_FOUND) include_directories(${ZEROMQ_INCLUDE_DIRS}) link_directories(${ZEROMQ_LIBRARY_DIRS}) endif(ZEROMQ_FOUND) endif(ENABLE_ZEROMQ) ``` -------------------------------- ### Configure Hard-SIM Support with PCSC in CMake Source: https://github.com/asset-group/sni5gect-5gnr-sniffing-and-exploitation/blob/main/CMakeLists.txt This CMake snippet enables Hard-SIM support by finding the PCSC-Lite library. If found, it defines `HAVE_PCSC`, sets include directories, and enables PCSC support for the build. ```cmake # Hard-SIM support if(ENABLE_HARDSIM) find_package(PCSCLite) if (PCSCLITE_FOUND) message(STATUS "Building with PCSC support.") add_definitions(-DHAVE_PCSC) set(HAVE_PCSC TRUE) include_directories(${PCSCLITE_INCLUDE_DIR}) #link_directories(${PCSCLITE_LIBRARIES}) endif (PCSCLITE_FOUND) endif(ENABLE_HARDSIM) ``` -------------------------------- ### Conditional Definitions in CMake Source: https://github.com/asset-group/sni5gect-5gnr-sniffing-and-exploitation/blob/main/CMakeLists.txt This CMake code demonstrates how to conditionally add preprocessor definitions to the build based on boolean variables. It uses `add_definitions` to include flags like `-DENABLE_SRSLOG_EVENT_TRACE`, `-DASSERTS_ENABLED`, and `-DSTOP_ON_WARNING`. ```cmake if (ENABLE_SRSLOG_TRACING) add_definitions(-DENABLE_SRSLOG_EVENT_TRACE) endif (ENABLE_SRSLOG_TRACING) if (ASSERTS_ENABLED) add_definitions(-DASSERTS_ENABLED) endif() if (STOP_ON_WARNING) add_definitions(-DSTOP_ON_WARNING) endif() ``` -------------------------------- ### Build ASN.1 Utility Library Source: https://github.com/asset-group/sni5gect-5gnr-sniffing-and-exploitation/blob/main/lib/src/asn1/CMakeLists.txt Creates a static library named 'asn1_utils' from 'asn1_utils.cc'. This library provides essential ASN.1 utility functions and is linked against 'srsran_common'. It is installed optionally. ```cmake add_library(asn1_utils STATIC asn1_utils.cc) target_link_libraries(asn1_utils srsran_common) install(TARGETS asn1_utils DESTINATION ${LIBRARY_DIR} OPTIONAL) ``` -------------------------------- ### Build ZeroMQ RF Plugin (Shared/Static) Source: https://github.com/asset-group/sni5gect-5gnr-sniffing-and-exploitation/blob/main/lib/src/phy/rf/CMakeLists.txt Configures the srsran_rf_zmq library, building it as either a SHARED or STATIC library based on the ENABLE_RF_PLUGINS flag. It links against necessary SRSRAN and ZeroMQ libraries and installs the target. ```cmake if (ZEROMQ_FOUND AND ENABLE_ZEROMQ) add_definitions(-DENABLE_ZEROMQ) set(SOURCES_ZMQ rf_zmq_imp.c rf_zmq_imp_tx.c rf_zmq_imp_rx.c) if (ENABLE_RF_PLUGINS) add_library(srsran_rf_zmq SHARED ${SOURCES_ZMQ}) set_target_properties(srsran_rf_zmq PROPERTIES VERSION ${SRSRAN_VERSION_STRING} SOVERSION ${SRSRAN_SOVERSION}) list(APPEND DYNAMIC_PLUGINS srsran_rf_zmq) else (ENABLE_RF_PLUGINS) add_library(srsran_rf_zmq STATIC ${SOURCES_ZMQ}) list(APPEND STATIC_PLUGINS srsran_rf_zmq) endif (ENABLE_RF_PLUGINS) target_link_libraries(srsran_rf_zmq srsran_rf_utils srsran_phy ${ZEROMQ_LIBRARIES}) install(TARGETS srsran_rf_zmq DESTINATION ${LIBRARY_DIR} OPTIONAL) endif (ZEROMQ_FOUND AND ENABLE_ZEROMQ) ``` -------------------------------- ### Find and Configure SoapySDR Library in CMake Source: https://github.com/asset-group/sni5gect-5gnr-sniffing-and-exploitation/blob/main/CMakeLists.txt This CMake script finds the SoapySDR library, a hardware abstraction layer for SDR devices. If found, it configures the include and library paths, enabling the use of various SDR hardware through a common API. ```cmake # Soapy if(ENABLE_SOAPYSDR) find_package(SoapySDR) if(SOAPYSDR_FOUND) include_directories(${SOAPYSDR_INCLUDE_DIRS}) link_directories(${SOAPYSDR_LIBRARY_DIRS}) endif(SOAPYSDR_FOUND) endif(ENABLE_SOAPYSDR) ``` -------------------------------- ### RF Frontend Detection and Configuration Source: https://github.com/asset-group/sni5gect-5gnr-sniffing-and-exploitation/blob/main/CMakeLists.txt Detects the availability of various RF frontend libraries (BladeRF, UHD, SoapySDR, ZeroMQ, SKIQ, LimeSDR) and sets a flag `RF_FOUND` accordingly. If no RF frontend is found, it defines `DISABLE_RF`. ```cmake if(BLADERF_FOUND OR UHD_FOUND OR SOAPYSDR_FOUND OR ZEROMQ_FOUND OR SKIQ_FOUND OR limesuiteng_FOUND) set(RF_FOUND TRUE CACHE INTERNAL "RF frontend found") else(BLADERF_FOUND OR UHD_FOUND OR SOAPYSDR_FOUND OR ZEROMQ_FOUND OR SKIQ_FOUND OR limesuiteng_FOUND) set(RF_FOUND FALSE CACHE INTERNAL "RF frontend found") add_definitions(-DDISABLE_RF) endif(BLADERF_FOUND OR UHD_FOUND OR SOAPYSDR_FOUND OR ZEROMQ_FOUND OR SKIQ_FOUND OR limesuiteng_FOUND) ``` -------------------------------- ### Include Project Directories in CMake Source: https://github.com/asset-group/sni5gect-5gnr-sniffing-and-exploitation/blob/main/CMakeLists.txt These CMake commands use `include_directories` to add specific directories to the compiler's include path. This makes header files within `${PROJECT_BINARY_DIR}/lib/include` and `${PROJECT_SOURCE_DIR}/lib/include` accessible to the build targets. ```cmake include_directories(${PROJECT_BINARY_DIR}/lib/include) include_directories(${PROJECT_SOURCE_DIR}/lib/include) ``` -------------------------------- ### Find and Configure FFTW3F Library in CMake Source: https://github.com/asset-group/sni5gect-5gnr-sniffing-and-exploitation/blob/main/CMakeLists.txt This CMake script finds the FFTW3F library, including its include directories and library paths. It sets the `FFT_LIBRARIES` variable based on whether static or shared libraries are preferred for the build. ```cmake # FFT if(USE_MKL) find_package(MKL REQUIRED) include_directories(${MKL_INCLUDE_DIRS}) link_directories(${MKL_LIBRARY_DIRS}) set(FFT_LIBRARIES "${MKL_STATIC_LIBRARIES}") # Static by default else(USE_MKL) find_package(FFTW3F REQUIRED) if(FFTW3F_FOUND) include_directories(${FFTW3F_INCLUDE_DIRS}) link_directories(${FFTW3F_LIBRARY_DIRS}) if(BUILD_STATIC) set(FFT_LIBRARIES "${FFTW3F_STATIC_LIBRARIES}") else(BUILD_STATIC) set(FFT_LIBRARIES "${FFTW3F_LIBRARIES}") endif(BUILD_STATIC) message(STATUS "FFT_LIBRARIES: " ${FFT_LIBRARIES}) endif(FFTW3F_FOUND) endif(USE_MKL) ``` -------------------------------- ### Build srsRAN GTP-U Static Library (CMake) Source: https://github.com/asset-group/sni5gect-5gnr-sniffing-and-exploitation/blob/main/lib/src/gtpu/CMakeLists.txt This snippet defines how to build the srsRAN GTP-U library using CMake. It includes the source file 'gtpu.cc', links against 'srsran_common', 'srsran_asn1', and atomic libraries, and sets up installation rules. ```cmake set(SOURCES gtpu.cc) add_library(srsran_gtpu STATIC ${SOURCES}) target_link_libraries(srsran_gtpu srsran_common srsran_asn1 ${ATOMIC_LIBS}) install(TARGETS srsran_gtpu DESTINATION ${LIBRARY_DIR} OPTIONAL) ``` -------------------------------- ### Find and Configure UHD Library in CMake Source: https://github.com/asset-group/sni5gect-5gnr-sniffing-and-exploitation/blob/main/CMakeLists.txt This CMake code finds the UHD (Universal Hardware Driver) library, setting its include and library directories if the library is found. This is typically used for hardware integration in SDR projects. ```cmake # UHD if(ENABLE_UHD) find_package(UHD) if(UHD_FOUND) include_directories(${UHD_INCLUDE_DIRS}) link_directories(${UHD_LIBRARY_DIRS}) endif(UHD_FOUND) endif(ENABLE_UHD) ``` -------------------------------- ### GLIB and Wireshark Dissector Setup (CMake) Source: https://github.com/asset-group/sni5gect-5gnr-sniffing-and-exploitation/blob/main/shadower/CMakeLists.txt Finds the GLIB-2.0 library using PkgConfig and prints its include and link flags. It then defines the path for the Wireshark dissector and sets up include directories for it, including those from GLIB and the dissector's own source and library paths. It also ensures a correct symlink to the dissector's bin folder. ```cmake find_package(PkgConfig REQUIRED) pkg_search_module(GLIB REQUIRED glib-2.0) if(GLIB_FOUND) message("Found GLIB-2.0 library") message("LD Flags: ${GLIB_LDFLAGS}") message("C Flags: ${GLIB_CFLAGS}") endif() set(WDISSECTOR_PATH /root/wdissector) set(WDISSECTOR_INCLUDES ${GLIB_INCLUDE_DIRS} ${WDISSECTOR_PATH}/src/ ${WDISSECTOR_PATH}/libs/wireshark ${WDISSECTOR_PATH}/libs/wireshark/include) message("WDISSECTOR_PATH=${WDISSECTOR_PATH}") # Ensure correct symlink to wdissector bin folder if(NOT IS_SYMLINK ${PROJECT_SOURCE_DIR}/bin) message(INFO "Removing invalid bin folder") execute_process(COMMAND rm -rdf ${PROJECT_SOURCE_DIR}/bin) endif() execute_process(COMMAND ln -sfT ${WDISSECTOR_PATH}/bin ${PROJECT_SOURCE_DIR}/bin) add_library(wdissector SHARED IMPORTED) set_property( TARGET wdissector PROPERTY IMPORTED_LOCATION "${PROJECT_SOURCE_DIR}/bin/libwdissector.so") target_include_directories(wdissector INTERFACE ${WDISSECTOR_INCLUDES}) ``` -------------------------------- ### Exploit Module Loading Source: https://github.com/asset-group/sni5gect-5gnr-sniffing-and-exploitation/blob/main/README.md This section shows examples of how different exploit modules can be loaded within the Sni5Gect framework. The `exploit` configuration parameter specifies the path to the shared object file containing the exploit logic. ```conf # exploit: build/modules/lib_identity_request.so # exploit: build/modules/lib_dg_authentication_request_sniffer.so # exploit: build/modules/lib_dg_authentication_replay.so # exploit: build/modules/lib_dg_registration_reject.so # exploit: build/modules/lib_mac_sch_mtk_rlc_crash.so # exploit: build/modules/lib_mac_sch_mtk_rrc_setup_crash_3.so # exploit: build/modules/lib_mac_sch_mtk_rrc_setup_crash_4.so # exploit: build/modules/lib_mac_sch_mtk_rrc_setup_crash_6.so # exploit: build/modules/lib_mac_sch_mtk_rrc_setup_crash_7.so # exploit: build/modules/lib_plaintext_registration_accept.so ``` -------------------------------- ### Run Sni5Gect with Pre-recorded IQ Samples (Bash) Source: https://context7.com/asset-group/sni5gect-5gnr-sniffing-and-exploitation/llms.txt This bash script demonstrates how to test Sni5Gect offline using pre-recorded IQ samples. It includes downloading an example recording, updating the configuration file to use file input, and running the sniffer. ```bash # Download example recording from Zenodo wget https://zenodo.org/records/15601773/files/example-connection-samsung-srsran.zip unzip example-connection-samsung-srsran.zip # Update configuration for file source cat > configs/file-test.yaml << 'EOF' cell: band: 78 nof_prb: 51 scs_common: 30 scs_ssb: 30 ssb_period_ms: 10 dl_arfcn: 628500 ssb_arfcn: 628128 source: source_type: file source_params: /root/sni5gect/example_connection/example.fc32 rf: sample_rate: 23.04e6 num_channels: 1 uplink_cfo: 0 downlink_cfo: 0 workers: pool_size: 24 n_ue_dl_worker: 4 n_ue_ul_worker: 4 n_gnb_dl_worker: 4 n_gnb_ul_worker: 4 uetracker: close_timeout: 5000 parse_messages: true num_ues: 5 exploit: build/modules/lib_dummy_exploit.so EOF # Run sniffer with file input ./build/shadower/shadower configs/file-test.yaml ``` -------------------------------- ### Main Application Entry Point Source: https://github.com/asset-group/sni5gect-5gnr-sniffing-and-exploitation/blob/main/README.md The main.cc file serves as the entry point for the Sni5Gect application. It likely orchestrates the initialization and execution of the various framework components. ```cpp // main.cc ``` -------------------------------- ### Example srsRAN Configuration Source: https://github.com/asset-group/sni5gect-5gnr-sniffing-and-exploitation/blob/main/docs/configuration.md This YAML configuration file outlines the parameters for setting up a srsRAN cell, including band, resource blocks, subcarrier spacing, and RF source details. It also specifies settings for recording, worker pools, UE tracking, downlink injection, and exploit modules. ```yaml cell: band: 78 # Band number nof_prb: 51 # Number of Physical Resource Blocks scs_common: 30 # Subcarrier Spacing for common (kHz) scs_ssb: 30 # Subcarrier Spacing for SSB (kHz) ssb_period_ms: 10 # SSB periodicity in milliseconds dl_arfcn: 628500 # Downlink ARFCN ssb_arfcn: 628128 # SSB ARFCN source: source_type: uhd source_params: type=b200,master_clock_rate=23.04e6,serial=3218CC4 enable_recorder: false # record the IQ samples to file pcap_folder: logs/ rf: sample_rate: 23.04e6 num_channels: 1 uplink_cfo: -0.00054 # Uplink Carrier Frequency Offset correction in Hz downlink_cfo: 0 # Downlink Carrier Frequency Offset (CFO) in Hz padding: front_padding: 0 # Number of IQ samples to pad in front of each burst back_padding: 0 # Number of IQ samples to pad at the end of each burst channels: - rx_frequency: 3427.5e6 tx_frequency: 3427.5e6 rx_offset: 0 tx_offset: 0 rx_gain: 40 tx_gain: 80 enable: true workers: pool_size: 24 # Worker pool size n_ue_dl_worker: 4 # Number of UE downlink workers n_ue_ul_worker: 4 # Number of UE uplink workers n_gnb_dl_worker: 4 # Number of gNB downlink workers n_gnb_ul_worker: 4 # Number of gNB uplink workers uetracker: close_timeout: 5000 # ms: stop tracking if no messages received parse_messages: true # Parse messages num_ues: 5 # Number of UETrackers to pre-initialize enable_gpu: false # GPU acceleration for decoding downlink_injector: delay_n_slots: 5 # Number of slots to delay injecting the message duplications: 2 # Number of duplications to send in each inject tx_cfo_correction: 0 # Uplink CFO correction (Hz) tx_advancement: 160 # Number of samples to send in advance pdsch_mcs: 3 # PDSCH MCS pdsch_prbs: 24 # PDSCH PRBs log: log_level: INFO syncer: INFO worker: INFO bc_worker: INFO exploit: build/modules/lib_dummy_exploit.so # exploit module to use # exploit: build/modules/lib_identity_request.so # exploit: build/modules/lib_dg_authentication_request_sniffer.so # exploit: build/modules/lib_dg_authentication_replay.so # exploit: build/modules/lib_dg_registration_reject.so # exploit: build/modules/lib_mac_sch_mtk_rlc_crash.so # exploit: build/modules/lib_mac_sch_mtk_rrc_setup_crash_3.so # exploit: build/modules/lib_mac_sch_mtk_rrc_setup_crash_4.so # exploit: build/modules/lib_mac_sch_mtk_rrc_setup_crash_6.so # exploit: build/modules/lib_mac_sch_mtk_rrc_setup_crash_7.so # exploit: build/modules/lib_plaintext_registration_accept.so ``` -------------------------------- ### Crash 5G RRC Setup Request with Malformed Message Source: https://github.com/asset-group/sni5gect-5gnr-sniffing-and-exploitation/blob/main/README.md This exploit targets MTK modems by sending a malformed RRC Setup message in response to an RRC Setup Request. If accepted by the UE, it causes the modem to crash, indicated by 'sModemReason' in adb logs. This demonstrates a denial-of-service vulnerability. ```log MDMKernelUeventObserver: sModemEvent: modem_failure MDMKernelUeventObserver: sModemReason:fid:1567346682;cause:[ASSERT] file:mcu/l1/nl1/internal/md97/src/rfd/nr_rfd_configdatabase.c line:4380 p1:0x00000001 ``` -------------------------------- ### Building Sni5Gect with Clang and Ninja Source: https://context7.com/asset-group/sni5gect-5gnr-sniffing-and-exploitation/llms.txt This bash script outlines the steps to build the Sni5Gect project from source on Ubuntu 22.04. It includes installing necessary dependencies, configuring the build with CMake (specifying Clang compilers and Ninja generator), and executing the build process. ```bash # Install dependencies (Ubuntu 22.04) apt install -y build-essential libfftw3-dev libmbedtls-dev \ libboost-program-options-dev libconfig++-dev libsctp-dev \ libzmq3-dev libliquid-dev libyaml-cpp-dev cmake ninja-build # Configure with CMake cmake -DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_EXPORT_COMPILE_COMMANDS=TRUE \ -DCMAKE_C_COMPILER=/usr/bin/clang-15 \ -DCMAKE_CXX_COMPILER=/usr/bin/clang++-15 \ --no-warn-unused-cli -B build -G Ninja # Build all targets ninja -C build # Rebuild after module changes ninja -C build ``` -------------------------------- ### Set Install RPATH for srsenb (CMake) Source: https://github.com/asset-group/sni5gect-5gnr-sniffing-and-exploitation/blob/main/srsenb/src/CMakeLists.txt This CMake code sets the INSTALL_RPATH property for the 'srsenb' target to a single dot ('.'). This is typically used to ensure that the executable can find its shared libraries when run from the current directory, especially after installation. ```cmake if (RPATH) set_target_properties(srsenb PROPERTIES INSTALL_RPATH ".") endif (RPATH) ``` -------------------------------- ### Launch Sni5Gect with File Recording Source: https://github.com/asset-group/sni5gect-5gnr-sniffing-and-exploitation/blob/main/README.md This bash command launches the Sni5Gect sniffer using a configuration file that is set up to read from a pre-recorded IQ sample file. This is useful for offline testing and analysis. ```bash ./build/shadower/shadower configs/srsran-n78-20MHz-b210.yaml ``` -------------------------------- ### Initializing Wireshark-like Filters in C++ Source: https://github.com/asset-group/sni5gect-5gnr-sniffing-and-exploitation/blob/main/docs/modules.md Demonstrates how to initialize filters for packet dissection within the Sni5Gect exploit modules. It shows the syntax for creating display filters (e.g., 'nr-rrc.c1 == 0') and extracting specific fields (e.g., 'rlc-nr.am.ack-sn') using the wdissector library. ```cpp f_rrc_setup_request = wd_filter("nr-rrc.c1 == 0"); f_ack_sn = wd_field("rlc-nr.am.ack-sn"); ```