Skip to content

Commit 2e8848b

Browse files
committed
Merge branch 'sslscan2'
2 parents 8f73bf0 + 6c18eb4 commit 2e8848b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+5431
-578
lines changed

.travis.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
sudo: required
2-
dist: trusty
2+
dist: bionic
33
language: c
44

55
before_install:
@@ -9,8 +9,6 @@ before_install:
99
script:
1010
- make sslscan CC=clang
1111
- make sslscan CC=gcc
12-
# OpenSSL can't be compiled out-of-the box with clang, see
13-
# http://wiki.openssl.org/index.php/Compilation_and_Installation#Modifying_Build_Settings
14-
#- make static CC=clang
12+
- make static CC=clang
1513
- make static CC=gcc
1614
- make -f Makefile.mingw

Changelog

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
Changelog
22
=========
33

4+
Version: 2.0.0-alpha1
5+
Date : 22/02/2020
6+
Author : rbsec <robin@rbsec.net>
7+
Changes: The following are a list of changes
8+
> Major rewrite of backend scanning code.
9+
> Support for additional cipher suites.
10+
> Support for TLSv1.3
11+
> Support for SSLv2 and SSLv3 protocol detection regardless of
12+
OpenSSL.
13+
> Checks for server key exchange groups.
14+
> Checks for server signature algorithms.
15+
416
Version: 1.11.13
517
Date : 24/03/2019
618
Author : rbsec <robin@rbsec.net>

Makefile

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ BINDIR = $(PREFIX)/bin
2828
MANDIR = $(PREFIX)/share/man
2929
MAN1DIR = $(MANDIR)/man1
3030

31-
WARNINGS = -Wall -Wformat=2 -Wformat-security
31+
WARNINGS = -Wall -Wformat=2 -Wformat-security -Wno-deprecated-declarations
3232
DEFINES = -DVERSION=\"$(GIT_VERSION)\"
3333

3434
# for dynamic linking
@@ -49,10 +49,7 @@ CFLAGS += -D_FORTIFY_SOURCE=2 -fstack-protector-all -fPIE
4949
# Don't enable some hardening flags on OS X because it uses an old version of Clang
5050
ifneq ($(OS), Darwin)
5151
ifneq ($(OS), SunOS)
52-
# Cygwin's linker does not support -z option.
53-
ifneq ($(findstring CYGWIN,$(OS)),CYGWIN)
54-
LDFLAGS += -pie -Wl,-z,relro -Wl,-z,now
55-
endif
52+
LDFLAGS += -pie -z relro -z now
5653
endif
5754
endif
5855

@@ -61,7 +58,7 @@ ifeq ($(STATIC_BUILD), TRUE)
6158
PWD = $(shell pwd)/openssl
6259
LDFLAGS += -L${PWD}/
6360
CFLAGS += -I${PWD}/include/ -I${PWD}/
64-
LIBS = -lssl -lcrypto -lz
61+
LIBS = -lssl -lcrypto -lz -lpthread
6562
ifneq ($(OS), FreeBSD)
6663
LIBS += -ldl
6764
endif
@@ -75,6 +72,14 @@ LDFLAGS += -L/usr/local/lib -L/usr/local/ssl/lib -L/usr/local/opt/openssl/lib
7572
CFLAGS += -I/usr/local/include -I/usr/local/ssl/include -I/usr/local/ssl/include/openssl -I/usr/local/opt/openssl/include -I/opt/local/include -I/opt/local/include/openssl
7673
endif
7774

75+
# Find the number of processors on the system (used in -j option in building OpenSSL).
76+
# Uses /usr/bin/nproc if available, otherwise defaults to 1.
77+
NUM_PROCS = 1
78+
ifneq (,$(wildcard /usr/bin/nproc))
79+
NUM_PROCS = `/usr/bin/nproc --all`
80+
endif
81+
82+
7883
.PHONY: all sslscan clean install uninstall static opensslpull
7984

8085
all: sslscan
@@ -114,28 +119,31 @@ uninstall:
114119
true
115120
opensslpull:
116121
if [ -d openssl -a -d openssl/.git ]; then \
117-
cd ./openssl && git checkout OpenSSL_1_0_2-stable && git pull | grep -q "Already up-to-date." && [ -e ../.openssl.is.fresh ] || touch ../.openssl.is.fresh ; \
122+
cd ./openssl && git checkout OpenSSL_1_1_1-stable && git pull | grep -q "Already up-to-date." && [ -e ../.openssl.is.fresh ] || touch ../.openssl.is.fresh ; \
118123
else \
119-
git clone --depth 1 -b OpenSSL_1_0_2-stable https://github.com/PeterMosmans/openssl ./openssl && cd ./openssl && touch ../.openssl.is.fresh ; \
124+
git clone --depth 1 -b OpenSSL_1_1_1-stable https://github.com/openssl/openssl ./openssl && cd ./openssl && touch ../.openssl.is.fresh ; \
120125
fi
121126

122127
# Need to build OpenSSL differently on OSX
123128
ifeq ($(OS), Darwin)
124129
openssl/Makefile: .openssl.is.fresh
125-
cd ./openssl; ./Configure -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIC enable-ssl2 enable-weak-ssl-ciphers zlib darwin64-x86_64-cc
130+
cd ./openssl; ./Configure -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIC enable-weak-ssl-ciphers zlib darwin64-x86_64-cc
126131
# Any other *NIX platform
127132
else
128133
openssl/Makefile: .openssl.is.fresh
129-
cd ./openssl; ./config -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIC no-shares enable-weak-ssl-ciphers enable-ssl2 zlib
134+
cd ./openssl; ./config -v -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIC no-shared enable-weak-ssl-ciphers zlib
130135
endif
131136

132137
openssl/libcrypto.a: openssl/Makefile
133-
$(MAKE) -C openssl depend
134-
$(MAKE) -C openssl all
135-
$(MAKE) -C openssl test
138+
$(MAKE) -j $(NUM_PROCS) -C openssl depend
139+
$(MAKE) -j $(NUM_PROCS) -C openssl all
140+
# $(MAKE) -j $(NUM_PROCS) -C openssl test # Disabled because this takes 45+ minutes for OpenSSL v1.1.1.
136141

137142
static: openssl/libcrypto.a
138-
$(MAKE) sslscan STATIC_BUILD=TRUE
143+
$(MAKE) -j $(NUM_PROCS) sslscan STATIC_BUILD=TRUE
144+
145+
test: static
146+
./docker_test.sh
139147

140148
clean:
141149
if [ -d openssl ]; then ( rm -rf openssl ); fi;

Makefile.mingw

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ SECURITY_OPTIONS=-fstack-protector-all -D_FORTIFY_SOURCE=2 -Wformat -Wformat-sec
4949
# Turn on linker optimizations, and DEP support (--nxcompat)
5050
LINK_OPTIONS=-Wl,-O1 -Wl,--discard-all -Wl,--no-undefined -Wl,--dynamicbase -Wl,--nxcompat -static
5151

52-
CFLAGS += -Iopenssl_mingw/include -D__USE_GNU
53-
LDFLAGS += -lws2_32 -lgdi32
52+
CFLAGS += -Iopenssl_mingw/include -D__USE_GNU -DOPENSSL_NO_SSL2 -Wno-deprecated-declarations
53+
LDFLAGS += -lws2_32 -lgdi32 -lcrypt32
5454

5555
# Set the version string for the program.
5656
VERSION = "$(shell grep -E -o -m 1 "[0-9]+\.[0-9]+\.[0-9]+" Changelog) Windows $(ARCHITECTURE) (Mingw)"
@@ -71,9 +71,9 @@ zlibpull:
7171

7272
opensslpull:
7373
if [ -d openssl_mingw -a -d openssl_mingw/.git ]; then \
74-
cd ./openssl_mingw && git checkout OpenSSL_1_0_2-stable && git pull | grep -q "Already up-to-date." && [ -e ../.openssl_mingw.is.fresh ] || touch ../.openssl_mingw.is.fresh ; \
74+
cd ./openssl_mingw && git checkout OpenSSL_1_1_1-stable && git pull | grep -q "Already up-to-date." && [ -e ../.openssl_mingw.is.fresh ] || touch ../.openssl_mingw.is.fresh ; \
7575
else \
76-
git clone --depth 1 -b OpenSSL_1_0_2-stable https://github.com/PeterMosmans/openssl ./openssl_mingw && cd ./openssl_mingw && touch ../.openssl_mingw.is.fresh ; \
76+
git clone --depth 1 -b OpenSSL_1_1_1-stable https://github.com/openssl/openssl ./openssl_mingw && cd ./openssl_mingw && touch ../.openssl_mingw.is.fresh ; \
7777
fi
7878

7979
zlib_mingw/libz.a: zlibpull

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
# sslscan2
2+
3+
An alpha build of sslscan 2 has been merged into master. If you want the old code,
4+
the tag [1.11.11-rbsec](https://github.com/rbsec/sslscan/tree/1.11.11-rbsec) was the last release in that branch.
5+
6+
The main changes in sslscan2 is a major rewrite of the backend scanning code,
7+
which means that it is no longer reliant on the version of OpenSSL for many checks.
8+
This means that it is possible to support legacy protocols (SSLv2 and SSLv3), as well
9+
as supporting TLSv1.3 - regardless of the version of OpenSSL that it has been compiled against.
10+
11+
This has been made possible largely by the work of [jtesta](https://github.com/jtesta), who has been
12+
responsible for most of the backend rewrite.
13+
14+
Other key changes include:
15+
16+
* Enumeration of server key exchange groups.
17+
* Enumeration of server signature algorithms.
18+
* SSLv2 and SSLv3 protocol support it scanned, but individual ciphers are not.
19+
* A test suite is included using Docker, to verify that sslscan is functionality correctly.
20+
21+
There are likely to be bugs in this version, so please report any that you encounter.
22+
123
# README
224

325
[![Build Status](https://travis-ci.org/rbsec/sslscan.svg?branch=master)](https://travis-ci.org/rbsec/sslscan)

0 commit comments

Comments
 (0)