skeeto / endlessh

SSH tarpit that slowly sends an endless banner
The Unlicense
7.3k stars 280 forks source link

Unable to make on Ubuntu 18 LTS #49

Open rabollig opened 4 years ago

rabollig commented 4 years ago

When trying to make on Ubuntu, I get these errors:

root@hackme:~/endlessh# ls
Dockerfile  endlessh.1  endlessh.c  Makefile  README.md  UNLICENSE  util
root@hackme:~/endlessh# make
cc -std=c99 -Wall -Wextra -Wno-missing-field-initializers -Os  -ggdb3 -o endlessh endlessh.c 
make: cc: Command not found
Makefile:12: recipe for target 'endlessh' failed
make: *** [endlessh] Error 127
root@hackme:~/endlessh# make LDLIBS=-lrt
cc -std=c99 -Wall -Wextra -Wno-missing-field-initializers -Os  -ggdb3 -o endlessh endlessh.c -lrt
make: cc: Command not found
Makefile:12: recipe for target 'endlessh' failed
make: *** [endlessh] Error 127
root@hackme:~/endlessh# make CC=gcc LDLIBS='-lnsl -lrt -lsocket'
gcc -std=c99 -Wall -Wextra -Wno-missing-field-initializers -Os  -ggdb3 -o endlessh endlessh.c -lnsl -lrt -lsocket
make: gcc: Command not found
Makefile:12: recipe for target 'endlessh' failed
make: *** [endlessh] Error 127
root@hackme:~/endlessh# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.5 LTS
Release:    18.04
Codename:   bionic
root@hackme:~/endlessh# 

libc6-dev is installed.

Any advice?

skeeto commented 4 years ago

You don't have a compiler installed on your system. For Debian-based systems like Ubuntu, install the build-essential package.

rabollig commented 4 years ago

Thanks. You're correct, my bootstrap didn't have build-essentials, but after installing it we're still stuck.

root@hackme:~/endlessh# apt-get install build-essential
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  binutils binutils-common binutils-x86-64-linux-gnu cpp cpp-7 dpkg-dev fakeroot g++ g++-7 gcc gcc-7 gcc-7-base
  libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libasan4 libatomic1 libbinutils libcc1-0
  libcilkrts5 libdpkg-perl libfakeroot libfile-fcntllock-perl libgcc-7-dev libgomp1 libisl19 libitm1 liblsan0 libmpc3
  libmpx2 libquadmath0 libstdc++-7-dev libtsan0 libubsan0
Suggested packages:
  binutils-doc cpp-doc gcc-7-locales debian-keyring g++-multilib g++-7-multilib gcc-7-doc libstdc++6-7-dbg
  gcc-multilib autoconf automake libtool flex bison gdb gcc-doc gcc-7-multilib libgcc1-dbg libgomp1-dbg libitm1-dbg
  libatomic1-dbg libasan4-dbg liblsan0-dbg libtsan0-dbg libubsan0-dbg libcilkrts5-dbg libmpx2-dbg libquadmath0-dbg bzr
  libstdc++-7-doc
The following NEW packages will be installed:
  binutils binutils-common binutils-x86-64-linux-gnu build-essential cpp cpp-7 dpkg-dev fakeroot g++ g++-7 gcc gcc-7
  gcc-7-base libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libasan4 libatomic1 libbinutils
  libcc1-0 libcilkrts5 libdpkg-perl libfakeroot libfile-fcntllock-perl libgcc-7-dev libgomp1 libisl19 libitm1 liblsan0
  libmpc3 libmpx2 libquadmath0 libstdc++-7-dev libtsan0 libubsan0
0 upgraded, 35 newly installed, 0 to remove and 14 not upgraded.
Need to get 37.0 MB of archives.
After this operation, 136 MB of additional disk space will be used.
Do you want to continue? [Y/n] 
Get:1 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 binutils-common amd64 

[snip]

Setting up cpp (4:7.4.0-1ubuntu2.3) ...
Setting up binutils (2.30-21ubuntu1~18.04.4) ...
Setting up gcc-7 (7.5.0-3ubuntu1~18.04) ...
Setting up g++-7 (7.5.0-3ubuntu1~18.04) ...
Setting up gcc (4:7.4.0-1ubuntu2.3) ...
Setting up dpkg-dev (1.19.0.5ubuntu2.3) ...
Setting up g++ (4:7.4.0-1ubuntu2.3) ...
update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode
Setting up build-essential (12.4ubuntu1) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for libc-bin (2.27-3ubuntu1.2) ...
root@hackme:~/endlessh# make
cc -std=c99 -Wall -Wextra -Wno-missing-field-initializers -Os  -ggdb3 -o endlessh endlessh.c 
root@hackme:~/endlessh# 

Something still being missing makes sense.

I can compile it as shown in the Dockerfile, so I can maybe copy it from there (or just run it in Docker). It's a fun little program and I'm thinking of running it on lots of IoT devices, some of which don't meet Docker system requirements, though.

rabollig commented 4 years ago

Do dice copying it from the Dockerfile. I get -bash: ./endlessh: No such file or directory when running the file, even after giving it execute permissions.

hamburghammer commented 4 years ago

Do dice copying it from the Dockerfile. I get -bash: ./endlessh: No such file or directory when running the file, even after giving it execute permissions.

If you copy the executable from the Docker image you have still the issue that you are still missing some system libs to run it. I got it running on Ubuntu 18.04.5 LTS with on the latest commit installing build-essential and running make install but I don't know if it helps you.

meffie96 commented 3 years ago

You might be missing the package libc6-dev. Install it and give it a try!