Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Library Loading #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix Library Loading #12

wants to merge 1 commit into from

Conversation

N8Tech
Copy link

@N8Tech N8Tech commented Feb 25, 2019

Probably better to tell it where to look before looking. ;-)
cmake was bombing out because of this.

Probably better to tell it where to look before looking. ;-)
cmake was bombing out because of this.
@jacob-baines
Copy link
Contributor

As stated, this compiles fine on Ubuntu 18.04 and 16.04. What OS were you on? What version of CMake?

@N8Tech
Copy link
Author

N8Tech commented Feb 25, 2019 via email

@jacob-baines
Copy link
Contributor

I'm not exactly sure what you are doing, but I can't reproduce this.

I just downloaded and installed Kali 64 bit (2019-01-03). I used apt to install cmake (3.13.4) and libboost-all-dev (1.67). I cloned the routeros repo. I moved to poc/cve-2018-14847. Made a directory called build. Moved into build. Typed "cmake .." and everything ran as expected.

Unless you can give me specific instructions to reproduce, I'm not sure what you've done.

@N8Tech
Copy link
Author

N8Tech commented Feb 25, 2019 via email

@jacob-baines
Copy link
Contributor

Despite my shortness, I really do appreciate it.

And I agree, what you see does appear to be a failure to find boost. I just prefer to be able to recreate an issue before accepting a PR. I'm going to leave this open and maybe someone else will encounter the problem and set me straight.

The other thing, is that there are many other CMake scripts that should have the same issue. So if someone does confirm this is a problem, it should affect just about every PoC.

@DocterJac
Copy link

DocterJac commented Mar 10, 2019

I experienced the same error message on a fresh installation, some libraries were not installed.

get install libboost-all-dev

fixed it

maybe overkill, but i can live with the bloat on this temp VM

@ICyperior
Copy link

I Think the Error is Because in the line 8, It's "boost" and not "Boost"

Changing it to "Boost" Solves The CMake Problem.

@E3V3A
Copy link

E3V3A commented Dec 7, 2019

I'm getting similar errors, and have tried all sort of variations.

$ mkdir build && cd build && cmake ..
-- Building for: Visual Studio 15 2017
-- Selecting Windows SDK version 10.0.17763.0 to target Windows 6.3.9600.
-- The C compiler identification is MSVC 19.16.27034.0
-- The CXX compiler identification is MSVC 19.16.27034.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Warning at C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:1125 (message):
  New Boost version may have incorrect or missing dependencies and imported
  targets
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:1247 (_Boost_COMPONENT_DEPENDENCIES)
  C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:1885 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:17 (find_package)


CMake Warning at C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:1125 (message):
  New Boost version may have incorrect or missing dependencies and imported
  targets
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:1247 (_Boost_COMPONENT_DEPENDENCIES)
  C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:1885 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:17 (find_package)


CMake Warning at C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:1125 (message):
  New Boost version may have incorrect or missing dependencies and imported
  targets
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:1247 (_Boost_COMPONENT_DEPENDENCIES)
  C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:1885 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:17 (find_package)


CMake Error at C:/Program Files/CMake/share/cmake-3.15/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find Boost (missing: program_options system regex) (found
  suitable version "1.71.0", minimum required is "1.66")
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.15/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:2142 (find_package_handle_standard_args)
  CMakeLists.txt:17 (find_package)


-- Configuring incomplete, errors occurred!

Including changing stuff in the CMake file:

cmake_minimum_required(VERSION 3.2)

set(PROJECT_NAME btw)
project(${PROJECT_NAME})

# -Wno-dev
set(CMAKE_CXX_FLAGS "-g -std=c++17 -Wall -Wextra -Weffc++ -Wshadow -Wcast-align -Wcast-qual -Woverloaded-virtual -Wstrict-null-sentinel  ... TRUNCATED!

#cmake_policy(NEW)
cmake_policy(SET CMP0074 NEW)

set(Boost_INCLUDE_DIR "C:/Program Files/boost/boost_1_71_0")

include_directories(SYSTEM ${Boost_INCLUDE_DIR})
include_directories(../../common/)

find_package(Boost 1.66 COMPONENTS program_options system regex REQUIRED)


# compilation units
add_executable(${PROJECT_NAME}
                src/main.cpp
                ../../common/md5.cpp
                ../../common/session.cpp
                ../../common/winbox_session.cpp
                ../../common/winbox_message.cpp)

# linking comp / libs
target_link_libraries(${PROJECT_NAME} ${Boost_LIBRARIES} -lpthread)

Any ideas how to resolve this?
I have also tried with a number of different env variables:

BOOST_LIBRARYDIR="C:\Program Files\boost\boost_1_71_0\libs"
BOOST_ROOT="C:\Program Files\boost\boost_1_71_0"


export Boost_INCLUDE_DIR="C:\Program Files\boost\boost_1_71_0"
export Boost_LIBRARIES="C:\Program Files\boost\boost_1_71_0\libs"
export Boost_ROOT="C:\Program Files\boost\boost_1_71_0"

still no success.

@kalimini
Copy link

Hello. I'm on kali linux. Tried to follow install. instructions, to build CVE-2018-14847. after that, in build folder there is no cve_2018_14847_poc file (there is Makefile, cmake_install.cmake, CMakeCache.txt, and CMakeFiles folder.).

@jacob-baines
Copy link
Contributor

@E3V3A sorry, but you're on your own for compilation on Windows. I'd be shocked if I didn't do something Linux specific actually...

@kalimini I need more details than that. What commands did you run?

@darkmanlv
Copy link

darkmanlv commented Apr 17, 2020

i`m new one to compilling stuff from github, so cloned routeros, then cmake from poc/bytheway/ and all was fine, recovered old forgotten password on hex poe with 6.41, reset button was disabled

PS: used ubuntu 18.04, boost 1.66, standard cmake in oracle virtualbox on windows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
7 participants