<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>On Web Security</title><link>https://www.onwebsecurity.com/</link><description>Adventures while penetration testing: verifying vulnerabilities, learning and teaching about security, and... getting things done</description><lastBuildDate>Thu, 24 Jan 2019 10:00:00 +0000</lastBuildDate><item><title>Compiling WordNet on Windows to use with Emacs</title><link>https://www.onwebsecurity.com/configuration/compiling-wordnet-on-windows-to-use-with-emacs.html</link><description>&lt;p&gt;&lt;img alt="WordNet running on MSYS2 on Windows" src="/images/wordnet-on-msys2-windows.png" /&gt;&lt;/p&gt;
&lt;p&gt;As a non-native English speaker who reads, writes and reviews lots of English
texts, I frequently look up definitions as well as synonyms of words. Of course
there are numerous online sources available to do this, but I like to decrease
my online 'footprint' due to privacy reasons. It also takes extra time to switch
to a browser window and enter a search query.&lt;/p&gt;
&lt;p&gt;Fortunately the fine folks at Princeton University compiled &lt;a class="reference external" href="https://wordnet.princeton.edu"&gt;WordNet&lt;/a&gt; &lt;a class="footnote-reference" href="#id1" id="id2"&gt;[1]&lt;/a&gt;, a large
lexical database of English, which can be used offline - together with a tool to
search that database. Even better, somebody wrote a package to use WordNet
inside my favorite editor &lt;a class="reference external" href="https://www.gnu.org/software/emacs/"&gt;Emacs&lt;/a&gt; &lt;a class="footnote-reference" href="#id3" id="id4"&gt;[2]&lt;/a&gt;. This means that just by hovering the cursor
over a word inside Emacs, the definition as well as synonyms can be shown. The
&lt;a class="reference external" href="http://wordnetcode.princeton.edu/3.0/WordNet-3.0.tar.gz"&gt;source code&lt;/a&gt; &lt;a class="footnote-reference" href="#id5" id="id6"&gt;[3]&lt;/a&gt; is kindly provided by Princeton University.&lt;/p&gt;
&lt;div class="section" id="compiling-wordnet-using-msys2-on-for-windows"&gt;
&lt;h2&gt;Compiling WordNet using MSYS2 on/for Windows&lt;/h2&gt;
&lt;p&gt;As is usually the case, compiling on/for Windows using the &lt;a class="reference external" href="https://msys2.github.io/"&gt;MSYS2 subsystem&lt;/a&gt; &lt;a class="footnote-reference" href="#id8" id="id9"&gt;[4]&lt;/a&gt;
can be done, with a few minor tweaks.&lt;/p&gt;
&lt;p&gt;First, start a MSYS2 shell and install the required dependencies (build tools,
as well as the programming language &lt;code class="code"&gt;
Tcl&lt;/code&gt;
 and its widget toolkit
&lt;code class="code"&gt;
Tk&lt;/code&gt;
):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;pacman -Sy --noconfirm base-devel mingw-w64-x86_64-tcl mingw-w64-x86_64-tk
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Then …&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Thu, 24 Jan 2019 10:00:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2019-01-24:/configuration/compiling-wordnet-on-windows-to-use-with-emacs.html</guid><category>compiling</category><category>emacs</category><category>msys2</category><category>windows</category></item><item><title>VirtualBox Does Not Automatically Resize Disk Image</title><link>https://www.onwebsecurity.com/configuration/virtualbox-does-not-automatically-resize-disk-image.html</link><description>&lt;p&gt;I use &lt;a class="reference external" href="https://www.virtualbox.org/"&gt;VirtualBox&lt;/a&gt; &lt;a class="footnote-reference" href="#id1" id="id2"&gt;[1]&lt;/a&gt; a lot as (local) virtualization software. It is a
full-featured virtualization host, and supports multiple underlying disk image
file types for guests.&lt;/p&gt;
&lt;p&gt;One of those is VirtualBox' native &lt;strong&gt;Virtual Disk Image&lt;/strong&gt; or &lt;strong&gt;VDI&lt;/strong&gt; file type.
An advantage of this type is that one can create a dynamically allocated image.
This image will initially be very small and not occupy any space for unused
virtual disk sectors, but will grow when a disk sector is written to for the
first time. VirtualBox does this by checking for unused sectors.&lt;/p&gt;
&lt;p&gt;However, this poses issues for disks with multiple partitions. If the last
partition is say a (unused) swap partition, then VirtualBox does not
automatically grow the underlying image. Even though the first partition is
full, VirtualBox will not grow and therefore the host disk will be full without
having reached its full potential.&lt;/p&gt;
&lt;p&gt;To solve this issue, the machine needs to be partitioned using one big happy
partition. Then VirtualBox will dynamically resize according to expectations.&lt;/p&gt;
&lt;p&gt;I use &lt;a class="reference external" href="https://www.packer.io"&gt;packer&lt;/a&gt; &lt;a class="footnote-reference" href="#id3" id="id4"&gt;[2]&lt;/a&gt; to prepare disk images for Debian, together with a &lt;a class="reference external" href="https://wiki.debian.org/DebianInstaller/Preseed"&gt;preseed&lt;/a&gt; &lt;a class="footnote-reference" href="#id5" id="id6"&gt;[3]&lt;/a&gt; file.
Using preseeding to partition the disk is limited to what is supported by the
partition tool …&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Mon, 14 Jan 2019 10:00:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2019-01-14:/configuration/virtualbox-does-not-automatically-resize-disk-image.html</guid><category>packer</category><category>virtualbox</category></item><item><title>Setting Up a New Sphinx Documentation Framework</title><link>https://www.onwebsecurity.com/configuration/setting-up-a-new-sphinx-documentation-framework.html</link><description>&lt;p&gt;When having to write documentation for different formats, I always use the
&lt;a class="reference external" href="http://docutils.sourceforge.net/rst.html"&gt;reStructuredText&lt;/a&gt; &lt;a class="footnote-reference" href="#id1" id="id2"&gt;[1]&lt;/a&gt; (or reST) format. As this is something that happens quite
often, it made sense to put some effort in automating the set up of a new
documentation framework, a reusable set up script.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Setting up a framework" src="/images/setting-up-towers.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;The standard documentation framework that I use consists of &lt;a class="reference external" href="http://www.sphinx-doc.org"&gt;Sphinx&lt;/a&gt; &lt;a class="footnote-reference" href="#id4" id="id5"&gt;[2]&lt;/a&gt;, which
takes care of converting source pages written in &lt;abbr title="reStructuredText"&gt;reST&lt;/abbr&gt;
into several formats: For example HTML, but also PDF or something more exotic
like ePub files. Note that Sphinx already comes with a setup script,
&lt;a class="reference external" href="http://www.sphinx-doc.org/en/master/man/sphinx-quickstart.html"&gt;sphinx-quickstart&lt;/a&gt; &lt;a class="footnote-reference" href="#id7" id="id8"&gt;[3]&lt;/a&gt; - but this doesn't take care of deploying files.&lt;/p&gt;
&lt;p&gt;In order to be able to create a reusable framework, I split the necessary files
into three groups:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;The Sphinx configuration itself,&lt;/li&gt;
&lt;li&gt;version information, and&lt;/li&gt;
&lt;li&gt;a LaTeX formatting template.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="section" id="the-sphinx-configuration"&gt;
&lt;h2&gt;The Sphinx configuration&lt;/h2&gt;
&lt;p&gt;This part consists of two different files; A generic &lt;a class="reference external" href="https://github.com/PeterMosmans/setup-sphinx-framework/blob/master/Makefile"&gt;Makefile&lt;/a&gt; &lt;a class="footnote-reference" href="#id9" id="id10"&gt;[4]&lt;/a&gt; to build the
different artifact types - as well as a Sphinx configuration file (&lt;a class="reference external" href="https://github.com/PeterMosmans/setup-sphinx-framework/blob/master/conf.py"&gt;conf.py&lt;/a&gt; &lt;a class="footnote-reference" href="#id11" id="id12"&gt;[5]&lt;/a&gt;)
containing basic information about the project, and plugin details. These files
rarely change after having initialized the framework.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="version-information"&gt;
&lt;h2&gt;Version information&lt;/h2&gt;
&lt;p&gt;The version information (version, or build number) can change per release, and
is therefore contained in a separate …&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Wed, 24 Oct 2018 10:00:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2018-10-24:/configuration/setting-up-a-new-sphinx-documentation-framework.html</guid><category>bash</category><category>pelican</category><category>rst</category><category>sphinx</category></item><item><title>Hacker Summer Camp: BSides Las Vegas and DEF CON 2018 review</title><link>https://www.onwebsecurity.com/opinion/hackersummercamp-bsides-las-vegas-and-def-con-2018-review.html</link><description>&lt;p&gt;&lt;img alt="BSides Las Vegas 2018" src="/images/bsideslv2018.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;Time flies... It's already been a few months ago that BSides Las Vegas and DEF
CON 2018 were held.&lt;/p&gt;
&lt;p&gt;BSides Las Vegas was nice, although the overall quality of talks seemed to be a
little higher in previous editions. This of course can be completely due to me
picking exactly the wrong talks: There is simply too much to see.&lt;/p&gt;
&lt;p&gt;DEF CON 2018 was also different than previous editions - mostly, because it was
now so spread out (Caesars Palace as well as the Flamingo Las Vegas). In
practice, this meant a lot of walking between the two locations. When you were
attending a talk in one location, it physically wasn't possible to attend the
next one unless it was located in the same or surrounding room.&lt;/p&gt;
&lt;p&gt;Fortunately DEF CON is all about learning, doing and networking - and in that
aspect it didn't disappoint.&lt;/p&gt;
&lt;p&gt;Especially for Hacker Summer Camp, I designed and built my own badge -
consisting of an &lt;a class="reference external" href="http://esp32.net"&gt;ESP32&lt;/a&gt; &lt;a class="footnote-reference" href="#id1" id="id2"&gt;[1]&lt;/a&gt; microprocessor running &lt;a class="reference external" href="https://micropython.org/"&gt;MicroPython&lt;/a&gt; &lt;a class="footnote-reference" href="#id3" id="id4"&gt;[2]&lt;/a&gt;, an e-Ink
display, some custom Python code, and a retro cassette case. The display rotates
numerous fitting images. The image was visible even when the power was
disconnected, thanks to the 3-color e-Ink display.&lt;/p&gt;
&lt;p&gt;&lt;img alt="ESP32 and an eInk display" src="/images/eink-esp32.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;A follow-up …&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Mon, 08 Oct 2018 10:00:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2018-10-08:/opinion/hackersummercamp-bsides-las-vegas-and-def-con-2018-review.html</guid><category>conference</category></item><item><title>Customize and theme tmux the easy way</title><link>https://www.onwebsecurity.com/configuration/customize-and-theme-tmux-the-easy-way.html</link><description>&lt;p&gt;&lt;img alt="tmux" src="/images/tmux-logo-medium.png" /&gt;&lt;/p&gt;
&lt;p&gt;Terminal multiplexers allow you to view multiple separate terminal sessions
within a single terminal window. &lt;strong&gt;Tmux&lt;/strong&gt; is my terminal multiplexer of choice,
as it has more features than the 'original multiplexer' &lt;strong&gt;GNU Screen&lt;/strong&gt;. The
default setup gives you some information, but its appearance is, well...&lt;/p&gt;
&lt;p&gt;&lt;img alt="tmux-default" src="/images/tmux-default.png" /&gt;&lt;/p&gt;
&lt;p&gt;Fortunately you can theme, or customize pretty much everything: From the colors
to the information being shown in the status bar.&lt;/p&gt;
&lt;p&gt;&lt;img alt="tmux-dracula" src="/images/tmux-dracula.png" /&gt;&lt;/p&gt;
&lt;p&gt;In order to make it easier to theme tmux, I split the tmux configuration file
into two separate files. One file contains the main configuration
(&lt;code class="code"&gt;
~/.tmux.conf&lt;/code&gt;
), and another file contains only theming (visual)
variables (&lt;code class="code"&gt;
~/.tmux.THEMENAME.theme&lt;/code&gt;
). This setup makes it easier to
switch different themes, without changing the main tmux configuration file.&lt;/p&gt;
&lt;p&gt;As I wanted to automatically load a theme based on a shell environment variable,
I added a small piece of code to the main tmux configuration file. This executes
a shell command, which in turn loads the correct theme file.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="go"&gt;run-shell &amp;quot;tmux source-file ~/.tmux.\${TMUX_THEME:-default}.theme&amp;quot;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The theme file is loaded dynamically, based on the environment variable
&lt;code class="code"&gt;
$TMUX_THEME&lt;/code&gt;
. If the environment variable is not set or empty, then the
default theme is loaded: &lt;code class="code"&gt;
~/.tmux.default.theme&lt;/code&gt;
.&lt;/p&gt;
&lt;p&gt;Loading a different …&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Mon, 11 Jun 2018 10:00:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2018-06-11:/configuration/customize-and-theme-tmux-the-easy-way.html</guid><category>bash</category><category>tmux</category><category>zsh</category></item><item><title>Improving cross-subsystem git workflow: The different git configuration files</title><link>https://www.onwebsecurity.com/configuration/improving-git-workflow-difference-system-global-git-config-file.html</link><description>&lt;p&gt;&lt;img alt="Cross-platform" src="/images/st-andrews-cross-spider.png" /&gt;&lt;/p&gt;
&lt;p&gt;Git configuration settings can be stored in three different files: The
&lt;strong&gt;system&lt;/strong&gt; configuration file, the &lt;strong&gt;global&lt;/strong&gt; configuration file and the
repository's &lt;strong&gt;local&lt;/strong&gt; configuration file. See &lt;a class="reference external" href="https://www.onwebsecurity.com/configuration/git-on-windows-location-of-global-configuration-file.html"&gt;git on Windows - location of
configuration files&lt;/a&gt; &lt;a class="footnote-reference" href="#id1" id="id2"&gt;[1]&lt;/a&gt; for their locations.&lt;/p&gt;
&lt;p&gt;When you use multiple subsystems on Windows (like MSYS2, Cygwin or any of the
the Windows Subsystem for Linux distributions) it can be a chore to keep the git
configurations synchronized. In other words: The less configuration files to
maintain, the better.&lt;/p&gt;
&lt;p&gt;Whether it's git for Windows, or one of the subsystem-specific git binaries:&lt;/p&gt;
&lt;blockquote&gt;
Each of the git binaries that runs on Windows expands the tilde (&lt;code class="code"&gt;
~&lt;/code&gt;
)
to the home directory, and the path separator is always a slash (&lt;code class="code"&gt;
/&lt;/code&gt;
).&lt;/blockquote&gt;
&lt;p&gt;These features can be used in our advantage in order to simplify the git
configuration files between all subsystems.&lt;/p&gt;
&lt;div class="section" id="re-defining-the-system"&gt;
&lt;h2&gt;Re-defining the system&lt;/h2&gt;
&lt;p&gt;The system configuration file is meant to store all system-specific
configuration settings, which will be applied to all users and git repositories
on the system.&lt;/p&gt;
&lt;p&gt;If you're the only user of your workstation, it makes sense to re-define system
as &lt;strong&gt;subsystem&lt;/strong&gt;:&lt;/p&gt;
&lt;blockquote&gt;
All &lt;strong&gt;subsystem-dependent&lt;/strong&gt; git configuration settings should be set in the
&lt;strong&gt;system&lt;/strong&gt; git configuration file.&lt;/blockquote&gt;
&lt;p&gt;This means that settings depending on underlying binaries, like …&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Tue, 24 Apr 2018 10:00:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2018-04-24:/configuration/improving-git-workflow-difference-system-global-git-config-file.html</guid><category>git</category><category>tools</category><category>workflow</category></item><item><title>When to sharpen, and when to cut</title><link>https://www.onwebsecurity.com/opinion/when-to-sharpen-when-to-cut.html</link><description>&lt;p&gt;&lt;img alt="Cut down a tree" src="/images/cut-down-tree.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;When performing a task for the first time, I think of whether it's a one-off, or
that it will become a recurring thing. Python scripts for example can be developed
blazingly fast, and a little bit of automation can go a long way.&lt;/p&gt;
&lt;p&gt;However...&lt;/p&gt;
&lt;p&gt;...sometimes, while developing an automated solution that &lt;em&gt;looked so simple
beforehand&lt;/em&gt;, becomes a wild ride from one rabbit hole into the other. Missing
dependencies, compile errors, functions that don't lend themselves very well for
automation; Everything that can go wrong will go wrong.&lt;/p&gt;
&lt;p&gt;That's why I like &lt;a class="reference external" href="https://francescocirillo.com/pages/pomodoro-technique"&gt;The Pomodoro Technique&lt;/a&gt; &lt;a class="footnote-reference" href="#id1" id="id2"&gt;[1]&lt;/a&gt; so much, where you work in discrete
time chunks of say 25, or 30 minutes. You decide upon the maximum cost for
the implementation beforehand. Given the expected return, what is a sane investment ? If
the time is up, then it's back to the original task &lt;em&gt;at hand&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;I have learned the hard way to always budget some time for &lt;strong&gt;documenting&lt;/strong&gt; the
(partial) solution, so that at least there's the profit of knowledge gained. Or,
another record of a failed attempt...&lt;/p&gt;
&lt;blockquote&gt;
&lt;/blockquote&gt;
&lt;table class="docutils footnote" frame="void" id="id1" rules="none"&gt;
&lt;colgroup&gt;&lt;col class="label" /&gt;&lt;col /&gt;&lt;/colgroup&gt;
&lt;tbody valign="top"&gt;
&lt;tr&gt;&lt;td class="label"&gt;&lt;a class="fn-backref" href="#id2"&gt;[1]&lt;/a&gt;&lt;/td&gt;&lt;td&gt;&lt;a class="reference external" href="https://francescocirillo.com/pages/pomodoro-technique"&gt;https://francescocirillo.com/pages/pomodoro-technique&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Thu, 15 Mar 2018 10:00:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2018-03-15:/opinion/when-to-sharpen-when-to-cut.html</guid><category>tools</category><category>workflow</category></item><item><title>Rebase OpenSSL 1.0.2-chacha to use TLS 1.3</title><link>https://www.onwebsecurity.com/announcements/rebase-openssl-1-0-2-chacha-to-use-tls-1-3.html</link><description>&lt;p&gt;&lt;img alt="the-road-ahead" src="/images/the-road-ahead.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;Since its inception in 2014, the &lt;a class="reference external" href="https://github.com/PeterMosmans/openssl/tree/1.0.2-chacha"&gt;OpenSSL 1.0.2-chacha fork&lt;/a&gt; &lt;a class="footnote-reference" href="#id1" id="id2"&gt;[1]&lt;/a&gt; has been used as
standard OpenSSL distribution for numerous SSL/TLS pentesting tools. It includes
default support for ciphers that are deemed insecure, and has extensive starttls
support.... in comparison with the vanilla 1.0.2 branch.&lt;/p&gt;
&lt;p&gt;However, even though 1.0.2 is deemed a Long Term Supported (LTS) version, no new
ciphers or functionality will be added to it.&lt;/p&gt;
&lt;p&gt;The initial reason to start the fork was a lack of ChaCha20 / Poly1305 support
in the 1.0.2 branch. After that, more and more features and insecure ciphers
were added or ported back in from other branches.&lt;/p&gt;
&lt;p&gt;As ChaCha20 / Poly1305 support has been added to the 1.1.1 branch, which also
contains (preliminary) TLS 1.3 support, it might be time for the insecure
OpenSSL version to be rebased onto a new branch. The initial goals will still be
the same:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Add as much ciphers and functionality as possible&lt;/li&gt;
&lt;li&gt;Keep the source aligned as much as possible to the vanilla version&lt;/li&gt;
&lt;li&gt;Keep the patches atomic, transparent and maintainable&lt;/li&gt;
&lt;li&gt;Write as little custom code as possible&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This will be quite the challenge, as the architecture and …&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Wed, 31 Jan 2018 10:00:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2018-01-31:/announcements/rebase-openssl-1-0-2-chacha-to-use-tls-1-3.html</guid><category>tools</category><category>openssl</category><category>pentesting</category></item><item><title>Tools for setting, tracking and achieving long term goals</title><link>https://www.onwebsecurity.com/opinion/tools-for-setting-tracking-and-achieving-long-term-goals.html</link><description>&lt;p&gt;&lt;img alt="planner2018" src="/images/planner2018.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;Immediately after reading an article on David Allen and his brainchild Getting
Things Done, I started with implementing his methodology. I loved it. I still
love it - especially the Getting Things Done concepts of inbox ZERO, maintaining
lists, and periodic reviews.&lt;/p&gt;
&lt;p&gt;Inbox ZERO for me is not so much about having empty email inboxes, as well as
making sure that input is collected from &lt;em&gt;multiple locations&lt;/em&gt; and stored into
one dedicated location. An inbox can also be a notebook, or note taking software
like Google Keep.&lt;/p&gt;
&lt;p&gt;Electronically stored lists have the benefit of being available on a multitude
of devices, the ability to synchronize between them, backups, and their biggest
advantage - providing dynamic views.&lt;/p&gt;
&lt;p&gt;&lt;img alt="emacs" src="/images/emacs.png" /&gt;&lt;/p&gt;
&lt;p&gt;Both tools that I have been using so far (the open source Java application
&lt;a class="reference external" href="https://www.trgtd.com.au/"&gt;ThinkingRock&lt;/a&gt; &lt;a class="footnote-reference" href="#id1" id="id2"&gt;[1]&lt;/a&gt;, and Emacs in &lt;a class="reference external" href="http://orgmode.org/"&gt;Org mode&lt;/a&gt; &lt;a class="footnote-reference" href="#id3" id="id4"&gt;[2]&lt;/a&gt;) for maintaining lists of actionable
items and projects were great in that perspective. Using those tools for
periodic reviews was a different story. After trying numerous configurations I
never got the hang of using ThinkingRock and Emacs for that purpose. Items
become abstract letters on a screen. Views never fully captured what was
important or which project served which goal.&lt;/p&gt;
&lt;p&gt;Periodically reviewing projects and …&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Thu, 18 Jan 2018 10:00:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2018-01-18:/opinion/tools-for-setting-tracking-and-achieving-long-term-goals.html</guid><category>tools</category><category>emacs</category></item><item><title>Diff binary files like docx, odt and pdf with git</title><link>https://www.onwebsecurity.com/configuration/diff-binary-files-docx-odt-pdf-with-git.html</link><description>&lt;p&gt;&lt;img alt="conversion_tools" src="/images/conversion_tools.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;Working with binary file types like the Microsoft Word XML Format Document
&lt;code class="code"&gt;
docx&lt;/code&gt;
, the OpenDocument Text &lt;code class="code"&gt;
odt&lt;/code&gt;
 format and the Portable Document
Format &lt;code class="code"&gt;
pdf&lt;/code&gt;
 in combination with git has its difficulties. Out of the box,
git only provides diffing for plain text formats. Comparing binary files in
textual format is not supported.&lt;/p&gt;
&lt;p&gt;With a simple configuration change and some open source, cross-platform tools,
git can be adapted to diff those formats as well.&lt;/p&gt;
&lt;div class="section" id="installing-the-tools"&gt;
&lt;h2&gt;Installing the tools&lt;/h2&gt;
&lt;p&gt;First, one needs the tools which can convert the binary files to plain text
formats. For most formats like &lt;code class="code"&gt;
docx&lt;/code&gt;
 and &lt;code class="code"&gt;
odt&lt;/code&gt;
, the open source
tool &lt;a class="reference external" href="https://pandoc.org/"&gt;Pandoc&lt;/a&gt; &lt;a class="footnote-reference" href="#id1" id="id2"&gt;[1]&lt;/a&gt; will do the trick. It can even export those files to Markdown
format, or (my personal choice) &lt;a class="reference external" href="http://docutils.sourceforge.net/rst.html"&gt;reStructuredText&lt;/a&gt; &lt;a class="footnote-reference" href="#id3" id="id4"&gt;[2]&lt;/a&gt;. A markup language like
reStructuredText makes it possible to make a detailed comparison between
structured documents, for instance when the heading level changed.&lt;/p&gt;
&lt;p&gt;For PDF, there's the open source tool &lt;code class="code"&gt;
pdftotext&lt;/code&gt;
, which is part of the
&lt;a class="reference external" href="https://poppler.freedesktop.org/"&gt;Poppler&lt;/a&gt; &lt;a class="footnote-reference" href="#id5" id="id6"&gt;[3]&lt;/a&gt; utils package and available for (almost) all operating systems. This can
convert a PDF file to plain text.&lt;/p&gt;
&lt;p&gt;There's a tiny catch with &lt;code class="code"&gt;
pdftotext&lt;/code&gt;
, as it has issues using stdout as
output, instead of writing to files. This is …&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Sun, 19 Nov 2017 10:00:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2017-11-19:/configuration/diff-binary-files-docx-odt-pdf-with-git.html</guid><category>git</category><category>rst</category></item><item><title>Structure research, talks and trainings using mindmaps, reStructuredText and Emacs Org mode</title><link>https://www.onwebsecurity.com/opinion/structure-research-talks-and-trainings-using-mindmaps-restructuredtext-and-emacs-org-mode.html</link><description>&lt;p class="first last"&gt;&lt;img alt="flyinghigh" src="/images/flyinghigh.jpg" /&gt; Researching new vulnerabilities, techniques or concepts can be
time-consuming and sometimes chaotic. A streamlined workflow is
necessary to make the process as efficient as possible. This article
describes the open source tools and well-known standards that I'm
currently using for that purpose.&lt;/p&gt;
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Wed, 18 Oct 2017 11:15:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2017-10-18:/opinion/structure-research-talks-and-trainings-using-mindmaps-restructuredtext-and-emacs-org-mode.html</guid><category>emacs</category><category>rst</category><category>training</category><category>workshop</category></item><item><title>Properly encoding and escaping for the web</title><link>https://www.onwebsecurity.com/security/properly-encoding-and-escaping-for-the-web.html</link><description>&lt;p&gt;&lt;img alt="encoding" src="/images/encoding-and-escaping.png" /&gt;&lt;/p&gt;
&lt;p&gt;When processing untrusted user input for (web) applications, filter the input,
and encode the output. That is the most widely given advice in order to prevent
(server-side) injections. Yet it can be deceivingly difficult to properly encode
(user) input. Encoding is dependent on the type of output - which means that for
example a string, which will be used in a JavaScript variable, should be treated
(encoded) differently than a string which will be used in plain HTML.&lt;/p&gt;
&lt;p&gt;When outputting untrusted user input, one should encode or escape, based on the
&lt;em&gt;context&lt;/em&gt;, the location of the output.&lt;/p&gt;
&lt;p&gt;And what's the difference between escaping and encoding ?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Encoding&lt;/strong&gt; is transforming data from one format into another format.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Escaping&lt;/strong&gt; is a &lt;em&gt;subset&lt;/em&gt; of encoding, where not all characters need to be
encoded. Only &lt;em&gt;some&lt;/em&gt; characters are encoded (by using an escape character).&lt;/p&gt;
&lt;p&gt;There are quite a number of encoding mechanisms, which make this more difficult
than it might look at first glance.&lt;/p&gt;
&lt;div class="section" id="url-encoding"&gt;
&lt;h2&gt;URL encoding&lt;/h2&gt;
&lt;p&gt;URL encoding is a method to encode information in a Uniform Resource Identifier.
There's a set of &lt;em&gt;reserved&lt;/em&gt; characters, which have special meaning, and
&lt;em&gt;unreserved&lt;/em&gt;, or safe characters, which are safe to use. If a character is
reserved, then the …&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Wed, 13 Sep 2017 10:15:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2017-09-13:/security/properly-encoding-and-escaping-for-the-web.html</guid><category>pentesting</category><category>training</category></item><item><title>Hacker Summer Camp: BSides Las Vegas and DEF CON 2017 review</title><link>https://www.onwebsecurity.com/opinion/hackersummercamp-bsides-las-vegas-and-def-con-2017-review.html</link><description>&lt;p&gt;&lt;img alt="BSides Las Vegas 2017" src="/images/bsideslv2017.png" /&gt;&lt;/p&gt;
&lt;p&gt;The 2017 edition of Hacker Summer Camp is over... Blackhat, BSides and DEF CON:
Arguably the best security conferences in the world, being held during a week in
Las Vegas.
And wow, what an amazing edition it was this time.&lt;/p&gt;
&lt;p&gt;I tried to learn, network, enjoy and &lt;em&gt;soak up&lt;/em&gt; as much as possible - which
unfortunately means not seeing each and every talk, and (probably) missing out
on amazing content. That's why I'm so glad that recordings and slidedecks are
being released by BSides and DEF CON, so that you can see where you should have
been - &lt;strong&gt;after the fact&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;The biggest draw for me personally to BSides and DEF CON is that you can immerse
yourself in fields and interests that are outside of your daily work or routine.
Car hacking, lockpicking, the Internet of Things, this year even voting
machines: It's all there. You can learn from and play with everything.&lt;/p&gt;
&lt;p&gt;As with playing Capture the Flag, it's a great way to &lt;em&gt;touch a lot of surfaces&lt;/em&gt;
in a short amount of time.&lt;/p&gt;
&lt;p&gt;&lt;a class="reference external" href="https://youtu.be/ehfrQsmrl7M?t=6862"&gt;Josh Corman's BSides Las Vegas keynote&lt;/a&gt; was amazing - each time I hear him
speak, he manages to get everybody even more enthusiastically about cooperation,
about personal …&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Thu, 10 Aug 2017 22:57:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2017-08-10:/opinion/hackersummercamp-bsides-las-vegas-and-def-con-2017-review.html</guid><category>conference</category></item><item><title>Generate list of used content tags for Pelican</title><link>https://www.onwebsecurity.com/configuration/generate-list-of-content-tags-for-pelican.html</link><description>&lt;p&gt;If your Pelican-generated site uses lots of different tags for articles, it can
be difficult to remember or use tag names consistently. Therefore I needed a
quick method to print (comma separated) unique tags that were stored in text
files.&lt;/p&gt;
&lt;p&gt;This shell one-liner from within the &lt;em&gt;content&lt;/em&gt; directory will sort and show all
tags from reStructuredText (&lt;code class="code"&gt;
*.rst&lt;/code&gt;
) files:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="go"&gt;grep -h &amp;#39;^:tags:&amp;#39; *.rst | sed -e &amp;#39;s/^:tags:\s*//;s/\s*,\s*/\n/g&amp;#39; | sort -u&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;First &lt;code class="code"&gt;
grep&lt;/code&gt;
 will filter on the &lt;code class="code"&gt;
:tags:&lt;/code&gt;
 property and will only
print out the matching line (without filename, thanks to the &lt;strong&gt;-h&lt;/strong&gt; flag).&lt;/p&gt;
&lt;p&gt;Then &lt;code class="code"&gt;
sed&lt;/code&gt;
 will remove the &lt;code class="code"&gt;
:tags:&lt;/code&gt;
 keyword (and trailing spaces),
and all tags will be split using newline characters.&lt;/p&gt;
&lt;p&gt;Finally, &lt;code class="code"&gt;
sort&lt;/code&gt;
 takes care of sorting and only printing unique entries.&lt;/p&gt;
&lt;p&gt;Analogous, one can do the same for categories:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="go"&gt;grep -h &amp;#39;^:category:&amp;#39; *.rst | sed -e &amp;#39;s/^:category:\s*//&amp;#39; | sort -u&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;As Pelican only allows one category, this is somewhat simpler.&lt;/p&gt;
&lt;p&gt;For maximum readability, &lt;code class="code"&gt;
tr&lt;/code&gt;
 can convert the newlines into spaces, so
that the output is one big line:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="go"&gt;grep -h &amp;#39;^:tags:&amp;#39; *.rst | sed -e &amp;#39;s/^:tags:\s*//;s/\s*,\s*/\n/g&amp;#39; | sort -u | tr &amp;#39;\n&amp;#39; &amp;#39; &amp;#39;; echo&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The last echo is meant to end …&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Sun, 09 Jul 2017 20:25:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2017-07-09:/configuration/generate-list-of-content-tags-for-pelican.html</guid><category>pelican</category><category>rst</category></item><item><title>Convert WordPress to static site generator Pelican</title><link>https://www.onwebsecurity.com/configuration/convert-wordpress-to-static-site-generator-pelican.html</link><description>&lt;p&gt;&lt;img alt="Pelican" src="/images/pelican.png" /&gt;&lt;/p&gt;
&lt;p&gt;After a number of years using WordPress as blogging software, I converted the
site to a static site generator: Pelican.&lt;/p&gt;
&lt;p&gt;Pelican converts reStructuredText into static HTML. No more PHP, no more
databases, but straight static HTML.&lt;/p&gt;
&lt;p&gt;The process of converting the site was relatively painless. The conversion tool
did a great job of converting an XML export of WordPress into reStructuredText
pages.&lt;/p&gt;
&lt;p&gt;What needed (and still needs) some manual care were/are the code blocks (the
biggest reason of the move from WordPress to Pelican) in articles, and the
escaping of variables. WordPress gets pretty complex once you're trying to use
it for code snippets and console outputs. The reStructuredText is much more
flexible and allows you to edit the site using any text editor. There are tools
to do that with WordPress and its API, but it always felt like a difficult
workaround.&lt;/p&gt;
&lt;p&gt;I thought about keeping the URLs as-is: Over the years the number of
visitors of the site has steadily risen, as has the level of indexing by search
engines. You don't want dead links - but on the other hand, a transition to
another content management system would be &lt;strong&gt;the&lt;/strong&gt; perfect moment to 'clean up'
the category …&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Tue, 27 Jun 2017 00:00:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2017-06-27:/configuration/convert-wordpress-to-static-site-generator-pelican.html</guid><category>pelican</category><category>rst</category></item><item><title>Write once, present anywhere in every format: preparing an interactive secure coding workshop</title><link>https://www.onwebsecurity.com/opinion/write-once-present-anywhere-in-every-format-preparing-an-interactive-secure-coding-workshop.html</link><description>&lt;p class="first last"&gt;How to use reStructuredText and Sphinx to convert a single source into
multiple formats for security workshops. Generate a dynamic website, a
PDF handout and more, all using the same plain text files.&lt;/p&gt;
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Tue, 06 Jun 2017 08:42:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2017-06-06:/opinion/write-once-present-anywhere-in-every-format-preparing-an-interactive-secure-coding-workshop.html</guid><category>rst</category><category>workshop</category></item><item><title>zsh shell inside Emacs on Windows</title><link>https://www.onwebsecurity.com/configuration/zsh-shell-inside-emacs-on-windows.html</link><description>&lt;p class="first last"&gt;Configuring Emacs (on Windows) to use the zsh shell can be tricky, especially when you use ( oh my zsh) plugins or fancy prompts.
Emacs sets an environment variable when running a shell, which can be used to selectively disable plugins and change prompts.
Configuring the SSH client and server to set and accept that variable makes ssh-ing inside Emacs to remote servers possible as well.&lt;/p&gt;
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Fri, 19 May 2017 02:11:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2017-05-19:/configuration/zsh-shell-inside-emacs-on-windows.html</guid><category>emacs</category><category>msys2</category><category>zsh</category></item><item><title>The complexity of securing Docker versus Vagrant</title><link>https://www.onwebsecurity.com/opinion/the-complexity-of-securing-docker-versus-vagrant.html</link><description>&lt;p&gt;&lt;img alt="Docker versus Vagrant" src="/images/docker-versus-vagrant.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;There are many, many comparisons out there on the Internet of Docker versus
Vagrant. Usability, scalability, portability, you-name-it-ability.&lt;/p&gt;
&lt;p&gt;This blogpost is about some different security aspects about the &lt;em&gt;current
implementation&lt;/em&gt; of Docker versus Vagrant. It's a high, high-level comparison of
the security impact for the host system.&lt;/p&gt;
&lt;p&gt;Can you compare the two ? Not really, they're being used for completely
different reasons. Docker is wildly popular for medium to large scale production
webserver deployments and microservices, where each service has its own process,
or container. Vagrant is more being used during design and development by
individual developers, or in teams at companies.&lt;/p&gt;
&lt;p&gt;So, having said that, let's compare the security differences in
high-level:&lt;/p&gt;
&lt;div class="section" id="docker"&gt;
&lt;h2&gt;Docker&lt;/h2&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Partial isolation from the host&lt;/li&gt;
&lt;li&gt;Shares the kernel with the host.&lt;/li&gt;
&lt;li&gt;Resources aren't guaranteed, they're shared.&lt;/li&gt;
&lt;li&gt;Uses runC/libcontainer as runtime (before version 1.8 it used linux
containers (lxc) under the hood, then libcontainer, and since the
inception of the Open Container Initiative it uses runC which
abstracts even further away from libcontainer). System resources can
be allocated using &lt;strong&gt;control groups&lt;/strong&gt; (cgroups): block devices
(blkio), CPU (cpu), CPU accounting (cpuacct), individual CPU and
memory nodes (cpuset), devices, task management (freezer), memory
usage (memory), network packets (net_cls …&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Wed, 03 May 2017 04:40:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2017-05-03:/opinion/the-complexity-of-securing-docker-versus-vagrant.html</guid></item><item><title>Security through obscurity means better operational security</title><link>https://www.onwebsecurity.com/opinion/security-through-obscurity-means-better-operational-security.html</link><description>&lt;div class="line-block"&gt;
&lt;div class="line"&gt;&lt;img alt="Are YOU OPSEC ?" src="/images/are-you-opsec.jpg" /&gt;&lt;/div&gt;
&lt;div class="line"&gt;What I personally like so much about being a penetration tester, is
that (I'd like to think that) we make the world a safer place. Better
security means better privacy means more democracy.&lt;/div&gt;
&lt;div class="line"&gt;It's not about telling people what &amp;quot;they&amp;quot; did wrong. On the contrary,
it's a learning process for all of us. No single application, network
or system is the same. Each company has its own risk model, which
means that there often is no one-size-fits-all solution.&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;It's about &amp;quot;how can we improve the security&amp;quot; for everybody. That's why I
think it's so important that penetration testers should lead by example.
Apply proper operation security procedures themselves.&lt;/p&gt;
&lt;p&gt;Recently my first Pluralsight course was published, operational security
for penetration testers. It deals with what opsec is, and how to apply
it to your penetration testing workflow. The trailer of the course can
be found at &lt;a class="reference external" href="https://www.youtube.com/watch?v=DSF6XbCxYGY"&gt;https://www.youtube.com/watch?v=DSF6XbCxYGY&lt;/a&gt;. The course
itself can be found on Pluralsight's site,
&lt;a class="reference external" href="https://www.pluralsight.com/courses/opsec-penetration-testers"&gt;https://www.pluralsight.com/courses/opsec-penetration-testers&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;As beautifully stated by the third law of OPSEC: &lt;em&gt;&amp;quot;If you are not
protecting it, the adversary wins&amp;quot;&lt;/em&gt;.&lt;/p&gt;
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Sun, 16 Apr 2017 06:04:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2017-04-16:/opinion/security-through-obscurity-means-better-operational-security.html</guid><category>opsec</category><category>pentesting</category></item><item><title>Use Emacs to create OAuth 2.0 UML sequence diagrams</title><link>https://www.onwebsecurity.com/configuration/use-emacs-to-create-oauth-2-0-uml-sequence-diagrams.html</link><description>&lt;p&gt;&lt;img alt="OAuth 2.0 abstract protocol flow" src="https://www.onwebsecurity.com/images/oauth2-abstract-protocol-flow.png" /&gt;&lt;/p&gt;
&lt;p&gt;It seems that the &lt;a class="reference external" href="https://tools.ietf.org/html/rfc6749"&gt;OAuth 2.0 framework&lt;/a&gt;
is more and more being used by web (and mobile) applications. Great !&lt;/p&gt;
&lt;p&gt;Although the protocol itself is not that complex, there are a number of
different use-cases, flows and implementations to choose from. As with most
things in life, the devil is in the detail.&lt;/p&gt;
&lt;p&gt;When reviewing OAuth 2.0 implementations or writing penetration testing reports
I like to draw UML diagrams. That makes it easier to understand what's going on,
and to spot potential issues. After all, a picture is worth a thousand words.&lt;/p&gt;
&lt;p&gt;This can be done extremely easy using the GPL-licensed open source &lt;a class="reference external" href="https://www.gnu.org/software/emacs/"&gt;Emacs&lt;/a&gt; editor, in conjunction with the
GPL-licensed open source tool &lt;a class="reference external" href="https://plantuml.com"&gt;PlantUML&lt;/a&gt; (and
optionally using Eclipse Public Licensed &lt;a class="reference external" href="http://www.graphviz.org/"&gt;Graphviz&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Emacs is worlds' most versatile editor. In this case, it's being used to edit
the text, and automatically convert the text to an image. PlantUML is a tool
which allows you to write UML in human readable text and does the actual
conversion. Graphviz is visualization software, and optionally - in this case,
it's used to show certain images.&lt;/p&gt;
&lt;p&gt;Download the &lt;a class="reference external" href="http://plantuml.com/download"&gt;compiled PlantUML jar file&lt;/a&gt;,
&lt;a class="reference external" href="https://www.gnu.org/software/emacs/download.html"&gt;Emacs&lt;/a&gt; and optionally
download and install &lt;a class="reference external" href="http://www.graphviz.org/Download.php"&gt;Graphviz&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Once you have Emacs installed and running …&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Thu, 23 Feb 2017 03:11:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2017-02-23:/configuration/use-emacs-to-create-oauth-2-0-uml-sequence-diagrams.html</guid><category>emacs</category><category>oauth2</category><category>pentesting</category><category>security</category></item><item><title>It's about the journey: Compiling 64-bit Unison / GTK2 on Windows</title><link>https://www.onwebsecurity.com/configuration/its-about-the-journey-compiling-64-bit-unison-gtk2-on-windows.html</link><description>&lt;p&gt;&lt;img alt="Unison File Synchronizer" src="https://www.onwebsecurity.com/images/unison.png" /&gt;&lt;/p&gt;
&lt;p&gt;The excellent MSYS2 (mingw64 and mingw32) subsytem makes compiling native
Windows compilations &amp;quot;as easy as compilation can be&amp;quot;. However, as with
everything in life, sometimes when trying to do one thing (compile a program),
you end up chasing other vaguely related issues (one exotic compile error after
another).&lt;/p&gt;
&lt;p&gt;For synchronizing files between servers and workstations I use the open source
GPLv3 licensed &lt;a class="reference external" href="https://github.com/bcpierce00/unison"&gt;Unison File Synchronizer&lt;/a&gt; &lt;a class="footnote-reference" href="#id2" id="id3"&gt;[1]&lt;/a&gt;. Although the text interface version
of Unison compiles straight-out-of-the box on mingw64, the GTK2 interface proved
to be a bit more cumbersome.&lt;/p&gt;
&lt;p&gt;To compile Unison with the GTK2 interface, &lt;a class="reference external" href="http://lablgtk.forge.ocamlcore.org/"&gt;lablgtk&lt;/a&gt; &lt;a class="footnote-reference" href="#id4" id="id5"&gt;[2]&lt;/a&gt; is needed, an OCaml
interface to GTK.&lt;/p&gt;
&lt;p&gt;So, the journey began with firing up a shell in a fresh mingw64 environment, and
installing the build prerequisites:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="go"&gt;pacman -Sy --noconfirm base-devel git \&lt;/span&gt;
&lt;span class="go"&gt;mingw-w64-x86_64-{glib2,gtk2,ocaml,pango,toolchain}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;After downloading the latest source (&lt;a class="reference external" href="https://forge.ocamlcore.org/frs/download.php/1627/2.18.5.tar.gz"&gt;2.18.5&lt;/a&gt; &lt;a class="footnote-reference" href="#id6" id="id7"&gt;[3]&lt;/a&gt;) and trying to compile it (using
&lt;code class="code"&gt;
make&lt;/code&gt;
) after running&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="go"&gt;./configure --prefix=/mingw64 --disable-gtktest&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;the first error message is shown:&lt;/p&gt;
&lt;div class="section" id="mingw64-include-gtk-2-0-gdk-gdkwin32-h-40-36-fatal-error-gdk-win32-gdkwin32keys-h-no-such-file-or-directory"&gt;
&lt;h2&gt;mingw64/include/gtk-2.0/gdk/gdkwin32.h:40:36: fatal error: gdk/win32/gdkwin32keys.h: No such file or directory&lt;/h2&gt;
&lt;p&gt;It seems that GTK2 version 2.24.31 contains an &lt;a class="reference external" href="http://osdir.com/ml/commits.gnome/2016-11/msg06962.html"&gt;error&lt;/a&gt; &lt;a class="footnote-reference" href="#id8" id="id9"&gt;[4]&lt;/a&gt;, and incorrectly still
references the file …&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Sat, 24 Dec 2016 03:23:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2016-12-24:/configuration/its-about-the-journey-compiling-64-bit-unison-gtk2-on-windows.html</guid><category>compiling</category><category>msys2</category><category>unison</category><category>windows</category></item><item><title>Why Sharing Improves Us</title><link>https://www.onwebsecurity.com/opinion/why-sharing-improves-us.html</link><description>&lt;p&gt;&lt;img alt="why sharing improves us" src="https://www.onwebsecurity.com/images/why-sharing-improves-us.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;If you're a perfectionist, it's difficult to release a product: Whether that's
source code, a pentest report or a blogpost. It's always a work in progress, and
never finished.&lt;/p&gt;
&lt;p&gt;That's why I like open sourcing code for example, releasing it for everybody to
see. Knowing beforehand that the code, your work will be read by others (while
you're working on it) forces you to think longer, deeper and harder about the
variable names, the structures, function names and coding styles.&lt;/p&gt;
&lt;p&gt;I'm the lead pentester for a company where we allow the customer to peek over
our shoulder while we're working. The customer can see everything that we try,
do and find out during the pentest. This improves the relationship with the
customer, as s/he sees what we're doing and even can think along with us.&lt;/p&gt;
&lt;p&gt;It also improves the customer satisfaction, as they know exactly what they're
getting. And, it improves the mutual respect. Instead of becoming a classical
us-versus-them pentest (the pentesters versus the developers), it becomes a
'let's improve the overall security together' exercise.&lt;/p&gt;
&lt;p&gt;According to all the positive feedback we're receiving, we're onto something
here. A win-win.&lt;/p&gt;
&lt;p&gt;Sunlight is not only a great disinfectant, it's also …&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Fri, 16 Dec 2016 05:38:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2016-12-16:/opinion/why-sharing-improves-us.html</guid><category>opensource</category><category>pentesting</category></item><item><title>Verify security vulnerabilities: A collection of Bash one-liners</title><link>https://www.onwebsecurity.com/security/verify-security-vulnerabilities-a-collection-of-bash-one-liners.html</link><description>&lt;div class="line-block"&gt;
&lt;div class="line"&gt;&lt;img alt="security test one-liners" src="https://www.onwebsecurity.com/images/security-test-one-liners.jpg" style="width: 600px; height: 450px;" /&gt;&lt;/div&gt;
&lt;div class="line"&gt;There's manual pentesting and writing reports, and there is blindly
copying the output of automated scantools. I am fortunate enough to
write and review a lot of pentest reports, as well as read pentest
reports of a other companies.&lt;/div&gt;
&lt;div class="line"&gt;Nothing looks as bad as &amp;quot;vulnerabilities&amp;quot; in a report that haven't
been verified as such. This really degrades the quality of the report.&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Below is a number of simple one-liners that can help with verifying
vulnerabilities. All examples can be run in a basic shell (Bash, zsh),
where the TARGET variable contains the hostname of the target that needs
to be verified (without protocol).&lt;/p&gt;
&lt;div class="section" id="ssl-tls-breach"&gt;
&lt;h2&gt;SSL/TLS: BREACH&lt;/h2&gt;
&lt;blockquote&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="k"&gt;for&lt;/span&gt; compression in compress deflate exi gzip identity pack200-gzip br
bzip2 lzma peerdist sdch xpress xz&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; curl -ksI -H &lt;span class="s2"&gt;&amp;quot;Accept-Encoding:&lt;/span&gt;
&lt;span class="nv"&gt;$compression&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt; https://&lt;span class="nv"&gt;$TARGET&lt;/span&gt; &lt;span class="se"&gt;\|&lt;/span&gt; grep -i &lt;span class="s2"&gt;&amp;quot;content-encoding:&lt;/span&gt;
&lt;span class="nv"&gt;$compression&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;done&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;div class="line-block"&gt;
&lt;div class="line"&gt;&lt;strong&gt;*Might* be vulnerable when&lt;/strong&gt;: one or more compression methods are
shown.&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="section" id="ssl-tls-client-initiated-secure-renegotiation"&gt;
&lt;h2&gt;SSL/TLS: Client-Initiated Secure Renegotiation&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;R\nQ&amp;quot;&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; timeout &lt;span class="m"&gt;10&lt;/span&gt; openssl s_client -connect &lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;TARGET&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;:443
&lt;/pre&gt;&lt;/div&gt;
&lt;div class="line-block"&gt;
&lt;div class="line"&gt;&lt;strong&gt;Vulnerable when&lt;/strong&gt;: Renegotiation is successful (exit code == 0)&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="section" id="http-trace-enabled"&gt;
&lt;h2&gt;HTTP: TRACE enabled&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="k"&gt;for&lt;/span&gt; proto in http https&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; testing &lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;proto&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;://&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;TARGET&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
curl -qskIX TRACE &lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;proto&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;://&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;TARGET&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="se"&gt;\|&lt;/span&gt;grep -i TRACE&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;done&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;div class="line-block"&gt;
&lt;div class="line"&gt;&lt;strong&gt;Vulnerable when&lt;/strong&gt;: the verb TRACE is shown&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="section" id="http-open-secure-redirect"&gt;
&lt;h2&gt;HTTP: Open …&lt;/h2&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Fri, 25 Nov 2016 02:09:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2016-11-25:/security/verify-security-vulnerabilities-a-collection-of-bash-one-liners.html</guid><category>bash</category><category>pentesting</category></item><item><title>Zen provisioning: Bootstrap the installation of Ansible using Vagrant</title><link>https://www.onwebsecurity.com/configuration/zen-provisioning-bootstrap-the-installation-of-ansible-using-vagrant.html</link><description>&lt;p&gt;&lt;img alt="zen" src="/images/zen-provisioning.jpg" style="width: 600px; height: 450px;" /&gt;&lt;/p&gt;
&lt;p&gt;I'm a big fan of the DevOps attitude of &amp;quot;cattle&amp;quot; versus &amp;quot;pets&amp;quot;: machines should
be built in a repeatable, automated and consistent way. If there's something
wrong, don't be afraid to replace a sick &amp;quot;cow&amp;quot; instead of trying to revive your
&amp;quot;pet&amp;quot;.&lt;/p&gt;
&lt;p&gt;This Zen mindset also helps when preparing for demos, trainings and workshops:
Usually I need a number of machines, and what better way than create them by
using automation ? For that I'm using the tools Ansible, Packer, Vagrant and
VirtualBox - they are all Open Source and can be used on a number of platforms
(e.g. Windows, Linux and Mac OS X).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ansible&lt;/strong&gt; is a tool for managing systems and deploying applications,
licensed under the GNU General Public License version 3 (my personal
favorite).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Vagrant&lt;/strong&gt; is a tool for managing virtual machines and is licensed
under the MIT license.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;VirtualBox&lt;/strong&gt; is a virtualization environment for local use, licensed
under the GNU General Public License version 2.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Packer&lt;/strong&gt; creates a machine image by installing an operating system to
a multitude of local and cloud platforms, for example VMWare, VirtualBox
as well as Docker, Amazon EC2 and DigitalOcean. Packer is licensed under
the Mozilla Public License Version 2.0.&lt;/p&gt;
&lt;p&gt;How …&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Fri, 07 Oct 2016 04:20:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2016-10-07:/configuration/zen-provisioning-bootstrap-the-installation-of-ansible-using-vagrant.html</guid><category>ansible</category><category>devops</category><category>packer</category><category>training</category><category>vagrant</category></item><item><title>Compile Emacs for Windows using MSYS2 and mingw64</title><link>https://www.onwebsecurity.com/configuration/compile-emacs-for-windows-using-msys2-and-mingw64.html</link><description>&lt;div class="line-block"&gt;
&lt;div class="line"&gt;&lt;img alt="Emacs 25.1" src="/images/emacs.png" /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Emacs 25.1 was officially released on September 17th, 2016. The
excellent &lt;a class="reference external" href="https://msys2.github.io/"&gt;MSYS2 subsystem&lt;/a&gt; and the open source gcc
compiler make it super-easy to build binaries on/for Windows (7, 8, 10). In
three easy steps from source to binaries:&lt;/p&gt;
&lt;div class="section" id="install-and-prepare-the-msys2-subsytem"&gt;
&lt;h2&gt;1: Install and prepare the MSYS2 subsytem&lt;/h2&gt;
&lt;p&gt;Download and run the installer at &lt;a class="reference external" href="http://repo.msys2.org/distrib/msys2-x86_64-latest.exe"&gt;http://repo.msys2.org/distrib/msys2-x86_64-latest.exe&lt;/a&gt;
After installing, run MSYS2 64bit which drops you in a Bash shell.
Update all packages using the following command:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="go"&gt;pacman -Syuu&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Sometimes updates of the runtime/filesystem can cause update errors. This is no
cause for panic - kill and restart the terminal. For building 64-bit Windows
binaries, always use &lt;code class="code"&gt;
mingw64.exe&lt;/code&gt;
 to start the terminal.&lt;/p&gt;
&lt;p&gt;Install all packages necessary for building:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="go"&gt;pacman -Sy --noconfirm base-devel git \&lt;/span&gt;
&lt;span class="go"&gt;mingw-w64-x86_64-{giflib,gnutls,jbigkit,lib{jpeg-turbo,png,rsvg,tiff,xml2},toolchain,xpm-nox}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class="section" id="clone-the-emacs-source"&gt;
&lt;h2&gt;2: Clone the Emacs source&lt;/h2&gt;
&lt;p&gt;To simplify building, you can define the environment variables &lt;code class="code"&gt;
BUILDDIR&lt;/code&gt;

(where the binaries are built), &lt;code class="code"&gt;
INSTALLDIR&lt;/code&gt;
 (where the binaries will be
installed to), and &lt;code class="code"&gt;
SOURCEDIR&lt;/code&gt;
 (where the source lives, the git
repository). Note that since you're in the MSYS2 subsystem, paths are
Unix-style, using forward slashes. This command creates &lt;code class="code"&gt;
SOURCEDIR&lt;/code&gt;
 if it
doesn't exist yet, clones the …&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Mon, 19 Sep 2016 14:25:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2016-09-19:/configuration/compile-emacs-for-windows-using-msys2-and-mingw64.html</guid><category>emacs</category><category>msys2</category><category>windows</category></item><item><title>Are you a PenTexter ? Now in BSidesLV</title><link>https://www.onwebsecurity.com/announcements/are-you-a-pentexter-now-in-bsideslv.html</link><description>&lt;p&gt;&lt;img alt="BSidesLV" src="/images/bsideslv.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;If you're around in Las Vegas during BlackHat / BSidesLV / DefCon, I'll
be presenting at BSidesLV 2016 together with Melanie Rieback on an open
source pentest reporting framework.&lt;/p&gt;
&lt;p&gt;The talk will announce a new OWASP project: PenText, a fully
open-sourced XML-based pentest document automation system. The PenText
system is a document automation framework that supports the entire
pentesting lifecycle: from the initial inquiry, through pentest scoping,
quotations, pentesting, and reporting, through the final invoice.&lt;/p&gt;
&lt;p&gt;During this talk, Melanie and I will demonstrate the OWASP PenText
system live, in the context of our larger Pentesting ChatOps
infrastructure (RocketChat, Hubot, and Gitlab). We will describe the
basics of how the OWASP PenText system is architected (XML, XSLT,
XSL-FO), and show how the system can be used to manage the entire
lifecycle of pentesting data, including the automatic generation of
documentation at various points in the process (including quotations,
pentest reports, and invoices).&lt;/p&gt;
&lt;p&gt;Lots of ChatOps in combination with pentesting and open source.&lt;/p&gt;
&lt;p&gt;See
&lt;a class="reference external" href="https://bsideslv2016.sched.org/event/7azc/are-you-a-pentexter-open-sourcing-pentest-reporting-and-automation"&gt;https://bsideslv2016.sched.org/event/7azc/are-you-a-pentexter-open-sourcing-pentest-reporting-and-automation&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;See you there ?&lt;/p&gt;
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Tue, 26 Jul 2016 08:15:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2016-07-26:/announcements/are-you-a-pentexter-now-in-bsideslv.html</guid><category>pentext</category></item><item><title>Verifying webserver compression - BREACH attack</title><link>https://www.onwebsecurity.com/security/verifying-webserver-compression-breach-attack.html</link><description>&lt;p&gt;&lt;img alt="BREACH attack" src="/images/breach.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;A few lines of Bash script let you check which compression methods are
supported by a SSL/TLS-enabled webserver.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="go"&gt; target=URL-OF-TARGET&lt;/span&gt;
&lt;span class="go"&gt;for compression in compress deflate exi gzip identity pack200-gzip br&lt;/span&gt;
&lt;span class="go"&gt;bzip2 lzma peerdist sdch xpress xz; do&lt;/span&gt;
&lt;span class="go"&gt;curl -ksI -H &amp;quot;Accept-Encoding: ${compression}&amp;quot; https://${target} | grep -i ${compression}&lt;/span&gt;
&lt;span class="go"&gt;done&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;div class="line-block"&gt;
&lt;div class="line"&gt;If you see any output (and the server supports one of these
compression algorithms), the site &lt;em&gt;might&lt;/em&gt; be vulnerable to a BREACH
attack. Might, because an attacker has to 'inject' content into the
output (and have some control over it): This is called a chosen
plaintext attack.&lt;/div&gt;
&lt;div class="line"&gt;By carefully injecting certain content to the page, an attacker is
able to deduce (parts) of the page content by merely looking at the
response size (speed). An attacker therefore also has to be able to
observe the server's response. A third prerequisite is that the secret
(that an attacker wants to steal) is contained in the server
response's body, and not 'just' in the response's header. Cookies are
therefore out of scope.&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The easiest mitigation is to disable HTTP compression completely. Other
less practical mitigations are adding random content to each page, which
changes the compressed size per page request, rate limiting the …&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Tue, 28 Jun 2016 03:21:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2016-06-28:/security/verifying-webserver-compression-breach-attack.html</guid><category>openssl</category><category>pentesting</category><category>tls</category></item><item><title>Automating OAuth 2.0 / JWT token retrieval for pentests</title><link>https://www.onwebsecurity.com/security/automating-oauth-2-0-jwt-token-retrieval-for-pentests.html</link><description>&lt;p&gt;&lt;img alt="OAuth 2.0" src="/images/oauth.png" /&gt;&lt;/p&gt;
&lt;p&gt;Recently I was pentesting a complex API which used the OAuth 2.0 framework for
authentication. Each API call needed an &lt;code class="code"&gt;
Authorization: Bearer&lt;/code&gt;
 header,
containing a valid JSON Web Token (JWT).&lt;/p&gt;
&lt;p&gt;To access the API I needed a lot of JWT tokens, as the tokens had a very short
expiry time. To facilitate the quick generation of tokens I created a basic
script that automated the OAuth authorization: It logs on to a domain, requests
an authorization code, and converts that token to an authorization token.&lt;/p&gt;
&lt;p&gt;One or more of these steps can be circumvented by command line options (e.g. by
specifying valid cookies), to speed up the process.&lt;/p&gt;
&lt;p&gt;Another feature of the script is that it automatically performs GET, POST, PUTs
and DELETEs with valid tokens against a list of API endpoints (URLs). This
preloads all API calls into a(n) (attacking) proxy, and helped the pentest speed
up tremendously.&lt;/p&gt;
&lt;div class="section" id="json-web-tokens"&gt;
&lt;h2&gt;JSON Web Tokens&lt;/h2&gt;
&lt;p&gt;A JSON Web Token (JWT) is basically a string, representing a collection of one
or more claims. Claims are name/value pairs which state information about a user
or subject. The claims are either signed using a JSON Web Signature (JWS) or
encrypted using JSON …&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Tue, 21 Jun 2016 02:50:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2016-06-21:/security/automating-oauth-2-0-jwt-token-retrieval-for-pentests.html</guid><category>pentesting</category><category>tools</category><category>oauth2</category></item><item><title>Getting to know your pentesting tools - curl and the HTTP/1.0 protocol</title><link>https://www.onwebsecurity.com/security/getting-to-know-your-pentesting-tools-curl-and-the-http1-0-protocol.html</link><description>&lt;div class="line-block"&gt;
&lt;div class="line"&gt;&lt;img alt="Tooling is important" src="/images/getting-to-know-your-pentesting-tools.jpg" /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;When pentesting, it's always handy to have a bunch of automated
scanner do the grunt work for you. Using automated tools saves time
and can help in spotting potential vulnerabilities. Usually I run
&lt;a class="reference external" href="https://github.com/PeterMosmans/security-scripts/"&gt;analyze_hosts.py&lt;/a&gt;,
a wrapper around the open source tools droopescan, nmap, nikto,
Wappalyzer and WPscan, with a bit of intelligence built in.&lt;/p&gt;
&lt;p&gt;Recently I had a pentesting engagement where nikto flagged a IIS server as
leaking the internal IP address (see
&lt;a class="reference external" href="https://support.microsoft.com/en-us/kb/218180"&gt;https://support.microsoft.com/en-us/kb/218180&lt;/a&gt; for more information).&lt;/p&gt;
&lt;p&gt;This is a very common issue with older, unhardened IIS servers.
The issue is triggered when a HTTP 1.0 request is made to the server,
without supplying a &lt;strong&gt;Host&lt;/strong&gt; header. The resulting
&lt;strong&gt;Content-Location&lt;/strong&gt; header will contain the server's (private) IP
address, thereby leaking information which can subsequently be used
for other attacks.&lt;/p&gt;
&lt;p&gt;Example of a server's partial response:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="go"&gt;HTTP/1.1 200 OK Content-Location: http://1.1.1.1/Default.htm&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;I ran into an interesting observation when I needed to reproduce this using
&lt;a class="reference external" href="https://curl.haxx.se"&gt;curl&lt;/a&gt;. Curl is a great tool do do all kinds of HTTP
requests on-the fly, and it's very well suited for scripting. It has flags to
specify the protocol (e.g …&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Fri, 27 May 2016 03:32:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2016-05-27:/security/getting-to-know-your-pentesting-tools-curl-and-the-http1-0-protocol.html</guid><category>pentesting</category></item><item><title>Automating repetitive git / setup tasks</title><link>https://www.onwebsecurity.com/configuration/automating-repetitive-git-setup-tasks.html</link><description>&lt;div class="line-block"&gt;
&lt;div class="line"&gt;&lt;img alt="repetitite work" src="/images/repetitive.jpg" /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Imagine you work on a large number of projects. Each of those projects has its
own git repository and accompanying notes file outside of the repo. Each git
repository has its own githooks and custom setup.&lt;/p&gt;
&lt;p&gt;Imagine having to work with multiple namespaces on different remote servers.
Imagine setting up these projects by hand, multiple times a week.&lt;/p&gt;
&lt;p&gt;Automation to the rescue ! Where I usually use Bash shell scripts to automate
workflows, I'm moving more and more towards Python. It's cross-platform and
sometimes easier to work with, as you have a large number of libraries at your
disposal.&lt;/p&gt;
&lt;p&gt;I wrote a simple &lt;a class="reference external" href="https://github.com/PeterMosmans/git-utilities/blob/master/setuprepo.py"&gt;Python script&lt;/a&gt; that
does all of those things more or less 'automated'. Feed the script the &lt;em&gt;name&lt;/em&gt; of
the repository you want to clone, and optionally a &lt;em&gt;namespace&lt;/em&gt;, &lt;em&gt;patchfile&lt;/em&gt; and
&lt;em&gt;templatefile&lt;/em&gt; variable (either command-line or using a configuration file). The
script will then:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;clone the repository&lt;/li&gt;
&lt;li&gt;modify the repository (e.g. apply githooks)&lt;/li&gt;
&lt;li&gt;optionally modify the repository based on given variables&lt;/li&gt;
&lt;li&gt;create a new notes file from a template&lt;/li&gt;
&lt;li&gt;optionally modify the notes file based on given variables&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The advantage is that you can use a configuration file containing the
location of the remote git repository, the patchfile …&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Thu, 14 Apr 2016 06:57:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2016-04-14:/configuration/automating-repetitive-git-setup-tasks.html</guid><category>git</category><category>tools</category></item><item><title>Bash vs Python (dependency hell)</title><link>https://www.onwebsecurity.com/opinion/bash-vs-python-dependency-hell.html</link><description>&lt;p&gt;For a number of years I maintained a &lt;a class="reference external" href="https://github.com/PeterMosmans/security-scripts/"&gt;small collection of open source
security scripts&lt;/a&gt;,
written in Bash. The main purpose of these scripts was to act as a
wrapper around other open source tools. Why try to remember long and
awkward command line parameters, when you can ask a script to do that
for you ?&lt;/p&gt;
&lt;p&gt;Bash was chosen, as it was distribution-independent. It works almost
everywhere (although sometimes OSX support is troublesome, due to
outdated Bash versions).&lt;/p&gt;
&lt;p&gt;After more and more (requested) features crept in, the
&lt;pre&gt;
analyze_hosts.sh&lt;/pre&gt;
 Bash script became more and more complex. That's
why I decided to port the script to Python. In my experience, it's
at-least-as portable, and the usage of third party (pip) packages means
that less time is spent on re-inventing the weel, and more on the actual
functionality.&lt;/p&gt;
&lt;div class="line-block"&gt;
&lt;div class="line"&gt;Yes, sometimes people talk about the dependency hell of Python, and in
some cases, the usage of third party packages means you have to be
careful of what you're doing.&lt;/div&gt;
&lt;div class="line"&gt;However, when using virtual environments each Python script and its
dependencies can be safely separated from the 'main' Python. For
example, the following commands create a separate virtual environment
for the security scripts repo …&lt;/div&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Sun, 31 Jan 2016 04:11:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2016-01-31:/opinion/bash-vs-python-dependency-hell.html</guid><category>bash</category><category>python</category></item><item><title>Open secure redirect</title><link>https://www.onwebsecurity.com/security/open-secure-redirect.html</link><description>&lt;p&gt;&lt;img alt="left or right" src="https://www.onwebsecurity.com/images/left-or-right.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;Aren't those RFC docs amazing ? Reading up on standards ?&lt;/p&gt;
&lt;p&gt;I needed plenty of time for them, as I encountered some interesting
issues. As it turned out, some websites / loadbalancers are overly
optimistic in encrypting all the things - actually, in &lt;strong&gt;redirecting&lt;/strong&gt;
all the things.&lt;/p&gt;
&lt;div class="section" id="tl-dr"&gt;
&lt;h2&gt;TL;DR&lt;/h2&gt;
&lt;p&gt;Never trust HTTP(s) clients, and be careful when setting up redirection rules. A
non-RFC compliant &lt;em&gt;client&lt;/em&gt; can trigger a (difficult to exploit) open redirect
vulnerability, due to a non-RFC compliant &lt;em&gt;server&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;This vulnerability can be tested using&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="go"&gt;analyze_hosts.py --http TARGET&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;See &lt;a class="reference external" href="https://github.com/PeterMosmans/security-scripts/"&gt;https://github.com/PeterMosmans/security-scripts/&lt;/a&gt; for the latest
version of analyze_hosts.py&lt;/p&gt;
&lt;p&gt;Be warned, long post ahead:
A while ago I came across some servers that, when being sent insecure
requests, responded with a redirect to the secure version.&lt;/p&gt;
&lt;p&gt;Request:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="gp"&gt;%&lt;/span&gt; curl -sI http://VICTIM/
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Response:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="kr"&gt;HTTP&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="m"&gt;1.1&lt;/span&gt; &lt;span class="m"&gt;301&lt;/span&gt; &lt;span class="ne"&gt;Moved Permanently&lt;/span&gt;
&lt;span class="na"&gt;Connection&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="l"&gt;close&lt;/span&gt;
&lt;span class="na"&gt;Location&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="l"&gt;https://VICTIM/&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;So far so good, nothing fancy going on here. In fact, this is
excellent behaviour. Insecure requests are immediately upgraded to
secure requests.&lt;/p&gt;
&lt;p&gt;However, the server seemed to be overly happy in redirecting, as it
listened to the client-supplied Host parameter:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="gp"&gt;%&lt;/span&gt; curl -s -I -H &lt;span class="s2"&gt;&amp;quot;Host: MALICIOUS&amp;quot;&lt;/span&gt; http://VICTIM/
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;And the server responded by&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="kr"&gt;HTTP&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="m"&gt;1 …&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Tue, 08 Dec 2015 07:33:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2015-12-08:/security/open-secure-redirect.html</guid><category>pentesting</category><category>vulnerability</category></item><item><title>automatic XML validation when using git</title><link>https://www.onwebsecurity.com/configuration/automatic-xml-validation-when-using-git.html</link><description>&lt;p&gt;&lt;img alt="XML" src="https://www.onwebsecurity.com/images/xml.png" /&gt;&lt;/p&gt;
&lt;p&gt;Recently I worked on a project which involved manually editing a bunch of XML
files. Emacs is my favorite ~operating system~ editor, and it has XML validation
built in (using the nXML mode). It highlights validation errors while-you-type.
Unfortunately, even with Emacs showing potential issues in &lt;em&gt;RED COLOR&lt;/em&gt;, I
managed to commit a number of broken XML files to my local git repository.
Subsequently when I pushed my errors to the remote 'origin' git repository, the
errors broke builds.&lt;/p&gt;
&lt;p&gt;Of course this can be completely prevented by locally using &lt;strong&gt;pre-commit&lt;/strong&gt;
hooks. If your local git repository validates XML files before you can commit
them, and denies invalid XML files, then one part of the problem is solved.&lt;/p&gt;
&lt;p&gt;A &lt;strong&gt;pre-receive&lt;/strong&gt; hook on the receiving server side can do the same as a
pre-commit hook locally: Validate XML files before letting somebody push a
commit which can break the build process.&lt;/p&gt;
&lt;p&gt;I looked around the Internet but couldn't find a lightweight quick script to do
only and exactly that. That's the reason I whipped up a basic pre-commit and
pre-receive hook, written in Python.&lt;/p&gt;
&lt;p&gt;You can find the very basic and rough code at
&lt;a class="reference external" href="https://github.com/PeterMosmans/git-utilities"&gt;https://github.com/PeterMosmans/git-utilities&lt;/a&gt;. By changing the …&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Tue, 29 Sep 2015 13:51:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2015-09-29:/configuration/automatic-xml-validation-when-using-git.html</guid><category>git</category></item><item><title>Preparing your team for a CTF competition - Defcon style</title><link>https://www.onwebsecurity.com/opinion/preparing-your-team-for-a-ctf-competition-defcon-style.html</link><description>&lt;p&gt;&lt;img alt="Defcon" src="/images/defcon-PRIDE.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;Playing Capture The Flag with a team on location is something completely
different than performing penetration tests, security assessments or even trying
to solve CTF challenges over the Internet.&lt;/p&gt;
&lt;p&gt;At Defcon 23 I joined a team of really knowledgeable, nice and friendly people
for the OpenCTF competition. It was an exhilarating ride from setting up all
equipment to the glorious finish. Playing Capture The Flag on Defcon was
educational but foremost fun, fun and fun.&lt;/p&gt;
&lt;p&gt;So why would you spend a good chunk of 48 hours sitting in a chair behind a
screen while there is so much more to see and experience at Defcon ? In one
word: The undescribable exciting atmosphere of playing during a conference, of
competing against all these bright people from all over the world, desperately
trying to solve the challenges.&lt;/p&gt;
&lt;p&gt;Here are some of my personal notes on how to get the most out of competing in an
OpenCTF competition with a team:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Allow plenty of time before the competition to set up (and harden -
&lt;a class="reference external" href="https://www.onwebsecurity.com/opinion/defcon-23-was-great-people-are-great"&gt;don't be a fool like
me&lt;/a&gt;)
your machine. Make sure you have all necessary tools and notes.&lt;/li&gt;
&lt;li&gt;Make sure beforehand that all team members have one communication
channel (eg. IRC …&lt;/li&gt;&lt;/ul&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Sat, 15 Aug 2015 14:35:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2015-08-15:/opinion/preparing-your-team-for-a-ctf-competition-defcon-style.html</guid><category>ctf</category><category>pentesting</category></item><item><title>Defcon 23 was great - people are great</title><link>https://www.onwebsecurity.com/opinion/defcon-23-was-great-people-are-great.html</link><description>&lt;div class="line-block"&gt;
&lt;div class="line"&gt;&lt;img alt="Defcon 23" src="https://www.onwebsecurity.com/images/defcon.jpg" /&gt;&lt;/div&gt;
&lt;div class="line"&gt;For quite a while now, I work in the security industry. One of the
things I do is providing security advice for companies on all sorts of
guidelines, policies and hardening stuff. Web penetration tests is
also something I do very regularly. In other words, a disclaimer
before you read on: I should have known better...&lt;/div&gt;
&lt;/div&gt;
&lt;div class="line-block"&gt;
&lt;div class="line"&gt;VirtualBox, Packer, Vagrant and Ansible are tools that I use a lot.
These four tools make virtualizing and provisioning really easy. You
can create new machines, experiment with them and test different
setups in a repeatable and automated way.&lt;/div&gt;
&lt;div class="line"&gt;As I sometimes organize pentesting workshops, I have several virtual
machines with Kali (a penetration testing distribution) installed on
them readily availabe.&lt;/div&gt;
&lt;div class="line"&gt;So, I connected my laptop to the network of the 23rd Defcon conference
in Las Vegas, when one of these standard Kali virtual machines was
(still) running as guest on my machine. Not only was Kali running, the
guest was also configured to run in bridged networking mode. This
means that Kali got it's own network IP address assigned.&lt;/div&gt;
&lt;div class="line"&gt;What I hadn't changed on that machine was Kali's default root
password. To make matters worse, what I had changed was the ssh server …&lt;/div&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Sun, 09 Aug 2015 21:51:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2015-08-09:/opinion/defcon-23-was-great-people-are-great.html</guid><category>conference</category></item><item><title>The future is here: HTTP/2</title><link>https://www.onwebsecurity.com/configuration/the-future-is-here-http2.html</link><description>&lt;p&gt;Last month I held a number of presentations on the latest and greatest
HTTP/2 protocol. It's an area where there's currently a lot of demand
for knowledge and practical tips. Most people are surprised to find out
that the're actually already using it on a daily base.&lt;/p&gt;
&lt;p&gt;If you're interested you could check out an Ansible role which installs
a number of client-side and server-side tools all HTTP/2 enabled:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;&lt;strong&gt;curl&lt;/strong&gt; - A data transferring tool with HTTP/2 support&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;h2load&lt;/strong&gt; - A benchmarking tool for HTTP/2 and SPDY servers&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;nghttp&lt;/strong&gt; - A HTTP/2 client with SPDY support&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;nghttpd&lt;/strong&gt; - A HTTP/2 server with SPDY support&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;nghttpx&lt;/strong&gt; - A transparent HTTP/2 proxy with SPDY support&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;openssl&lt;/strong&gt; - A cryptographic library with ALPN support
(1.0.2-chacha)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The following libraries will be installed:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;&lt;strong&gt;libcrypto&lt;/strong&gt; - OpenSSL&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;libcurl&lt;/strong&gt; - CURL library&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;libnghttp2&lt;/strong&gt; - A HTTP/2 and HPACK C library&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;libspdylay&lt;/strong&gt; - A SPDY library&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;libssl&lt;/strong&gt; - OpenSSL&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can find the role at
&lt;a class="reference external" href="https://github.com/PeterMosmans/ansible-role-http2"&gt;https://github.com/PeterMosmans/ansible-role-http2&lt;/a&gt;&lt;/p&gt;
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Fri, 31 Jul 2015 22:26:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2015-07-31:/configuration/the-future-is-here-http2.html</guid><category>ansible</category><category>pentesting</category></item><item><title>Safely storing Ansible playbook secrets</title><link>https://www.onwebsecurity.com/configuration/safely-storing-ansible-playbook-secrets.html</link><description>&lt;div class="line-block"&gt;
&lt;div class="line"&gt;&lt;img alt="see the forest for the trees" src="/images/see_the_forest_for_the_trees.jpg" /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;More and more organizations use dedicated software to safely handle
the creation and management of secrets (for example SSL certificate
keys, private variables and passwords). Three 'well known' solutions
are Square's &lt;a class="reference external" href="https://square.github.io/keywhiz/"&gt;Keywhiz&lt;/a&gt;,
Hashicorp's &lt;a class="reference external" href="https://www.vaultproject.io/"&gt;Vault&lt;/a&gt; and
&lt;a class="reference external" href="https://xordataexchange.github.io/crypt/"&gt;crypt&lt;/a&gt; in combination
with etcd or consul.&lt;/p&gt;
&lt;p&gt;As with all security solutions the roll-out can be quite cumbersome.
The correct implementation (think key management, think audit trails,
think key recovery) of any one of these solutions is difficult. And
difficult means that most people won't use it, at least not right away
(remember SELinux ?).&lt;/p&gt;
&lt;p&gt;There are a number of tools available to encrypt secrets &lt;em&gt;within&lt;/em&gt;
(Ansible) repositories. One of them for instance is &lt;a class="reference external" href="https://docs.ansible.com/playbooks_vault.html"&gt;Ansible
Vault&lt;/a&gt; (look
&lt;a class="reference external" href="https://www.onwebsecurity.com/tools/openssl-the-ansible-vault-using-pbkdf2"&gt;here&lt;/a&gt;
for a more in-depth review). Although the idea of selectively encrypting
data is a good one, text-oriented version control systems like git or
Subversion aren't meant to store binary blobs of encrypted data.
Moreover you still run the risk of accidentally uploading or sharing
unencrypted files. Mitigations like adding filenames of unencrypted
secrets to a .gitignore file are error-prone.&lt;/p&gt;
&lt;p&gt;How to facilitate developers and system operators to store secrets in a
safe place, &lt;strong&gt;outside&lt;/strong&gt; the repositories where Ansible playbooks and
configuration files are kept ?&lt;/p&gt;
&lt;p&gt;This article describes a …&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Tue, 23 Jun 2015 06:30:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2015-06-23:/configuration/safely-storing-ansible-playbook-secrets.html</guid><category>ansible</category><category>devops</category></item><item><title>OWASP AppSecEU 2015 review - more and more DevOps</title><link>https://www.onwebsecurity.com/opinion/owasp-appseceu-2015-more-and-more-devops.html</link><description>&lt;p&gt;
&lt;center&gt;&lt;/center&gt;&lt;div class="line-block"&gt;
&lt;div class="line"&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div class="line"&gt;This year, the European edition of OWASP AppSec conference was held in
Amsterdam, The Netherlands.&lt;/div&gt;
&lt;div class="line"&gt;One of the things I really like about OWASP conferences is the
atmosphere. Usually it consists of a nice blend of IT people from
literally all over the world, and this conference didn't disappoint.
One of the added values of visiting such a conference is that you hear
stories from the trenches from peers and likeminded people. It makes
it easier to (try to) spot trends in the security world.&lt;/div&gt;
&lt;/div&gt;
&lt;/p&gt;&lt;p&gt;Some observations:&lt;/p&gt;
&lt;div class="section" id="devops"&gt;
&lt;h2&gt;DevOps&lt;/h2&gt;
&lt;p&gt;I'm a big fan of the DevOps movement, and what it means for security.
More cooperation plus more automated testing means more secure systems.
Thankfully there were a lot of presentations that focused on how to
integrate automated security testing into the continuous deployment
pipeline. As the O from OWASP stands for open, mainly open source
testing tools were covered, like OWASP ZAP, Arachni and the Gauntlt
framework. Some tools still need quite some tweaking to be successful,
but the landscape surely is promising.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="dev-is-running-faster-than-ops"&gt;
&lt;h2&gt;Dev is running faster than Ops&lt;/h2&gt;
&lt;p&gt;I'm still under the impression that the DevOps movement is mainly led by
developers. The tools that are improving faster are the …&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Mon, 15 Jun 2015 06:32:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2015-06-15:/opinion/owasp-appseceu-2015-more-and-more-devops.html</guid></item><item><title>OpenSSL the Ansible vault... using PBKDF2</title><link>https://www.onwebsecurity.com/configuration/openssl-the-ansible-vault-using-pbkdf2.html</link><description>&lt;div class="line-block"&gt;
&lt;div class="line"&gt;&lt;img alt="OpenSSL the Ansible vault" src="https://www.onwebsecurity.com/images/locks.jpg" style="width: 600px; height: 450px;" /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;a class="reference external" href="http://www.ansible.com"&gt;Ansible&lt;/a&gt; is a popular open-source software
platform for configuring and managing computers. It helps sysadmins to
provision new servers in a reliable and repeatable way, and helps
developers who want to push their code as fast as possible.
It takes scripts (playbooks) as input, which a lot of people can and
do share with each other. The beauty of open source.
Playbooks can contain sensitive data like passwords and SSL keys -
stuff that you don't want to share, or incidentally upload to GitHub.&lt;/p&gt;
&lt;p&gt;Last year Ansible added a tool to its arsenal to easily encrypt
structured datafiles (containing sensitive data), called Ansible
Vault. You can specify a key or keyfile when running a playbook, which
decrypts the data on-the-fly. Encrypted data can still be edited&lt;/p&gt;
&lt;p&gt;I love it when people make it easier to use encryption. The easier it
becomes, the more people will use it, the safer everybody will be.&lt;/p&gt;
&lt;p&gt;Another beauty of open source is that you can inspect the code. And
modify it! I wanted to be able to encrypt and decrypt the data
where/when you cannot use Ansible vault, by using other tools and
languages like OpenSSL and Bash script.&lt;/p&gt;
&lt;p&gt;Under the hood Ansible vault …&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Sat, 25 Apr 2015 12:38:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2015-04-25:/configuration/openssl-the-ansible-vault-using-pbkdf2.html</guid><category>ansible</category><category>openssl</category></item><item><title>Replacing ChaCha20/Poly1305: a new owner</title><link>https://www.onwebsecurity.com/announcements/replacing-chacha20poly1305-a-new-owner.html</link><description>&lt;p&gt;A post back I wrote about the 'design goals' of the 1.0.2-chacha fork of
OpenSSL - see
&lt;a class="reference external" href="https://www.onwebsecurity.com/openssl/the-work-flow-of-the-full-featured-openssl-fork-chacha20poly1305"&gt;https://www.onwebsecurity.com/openssl/the-work-flow-of-the-full-featured-openssl-fork-chacha20poly1305&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img alt="A new owner" src="/images/new_owner.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;The ChaCha20 / Poly1305 code in the 1.0.2-chacha fork is originally from
the OpenSSL repository, but has since been abandoned there. BoringSSL
became its new home, where it's actively being maintained by Google
(primarily Adam Langley and David Benjamin). Over time I applied several
patches that BoringSSL applied to the ChaCha20 / Poly1305 code, to keep
it as up to date as possible.&lt;/p&gt;
&lt;p&gt;The issue now is that BoringSSL diverges more and more from the OpenSSL
code, which makes it more difficult to maintain (error-prone), and, more
important, makes the fork itself diverge too much from OpenSSL.&lt;/p&gt;
&lt;p&gt;That's why it's my intention to replace the current ChaCha20 / Poly1305
code from 1.0.2-chacha with more recent attributions that align better
with the official OpenSSL code. As far as I understood the official
OpenSSL distribution will add ChaCha20 / Poly1305 at some time in the
future, which of course would be the best possible outcome. Official
support.&lt;/p&gt;
&lt;p&gt;Until that time I will do my best to maintain the 1.0.2-chacha branch.&lt;/p&gt;
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Tue, 07 Apr 2015 02:27:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2015-04-07:/announcements/replacing-chacha20poly1305-a-new-owner.html</guid><category>openssl</category></item><item><title>The workflow of the Full-Featured openssl Fork (ChaCha20/Poly1305) 1.0.2-chacha</title><link>https://www.onwebsecurity.com/announcements/the-work-flow-of-the-full-featured-openssl-fork-chacha20poly1305.html</link><description>&lt;p&gt;As you might know I maintain a fork of OpenSSL at
&lt;a class="reference external" href="https://github.com/PeterMosmans/openssl"&gt;https://github.com/PeterMosmans/openssl&lt;/a&gt; The 1.0.2-chacha fork started out of
adding the ChaCha20/Poly1305 ciphers to the official fork, and slowly more and
more ciphers and features were added.&lt;/p&gt;
&lt;p&gt;&lt;img alt="workflow" src="/images/workflow.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;The main goals of the fork are&lt;/p&gt;
&lt;ol class="arabic simple"&gt;
&lt;li&gt;add as much ciphers and (test)functionality as possible&lt;/li&gt;
&lt;li&gt;to keep the source as aligned to the original as possible&lt;/li&gt;
&lt;li&gt;keep the patches transparent (easily applicable to the original source)&lt;/li&gt;
&lt;li&gt;keep the patches maintainable&lt;/li&gt;
&lt;li&gt;write as little custom/new code as possible&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;For 2 (to keep the source as aligned to the original as possible) I try
to merge and test the code as often as I can, so that the fork is never
too far behind the official repository.&lt;/p&gt;
&lt;p&gt;As it was my first idea to start a feature branch I used no-fast forwarding git
merges. This kept it transparent when I merged the code, and what the history of
the commits was. However, since I'm probably going to maintain this fork besides
the official fork I'm going to use fast-forwarding merges from now on (March
2014) whenever possible. I think this will keep the commit history
cleaner - see …&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Fri, 13 Mar 2015 08:49:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2015-03-13:/announcements/the-work-flow-of-the-full-featured-openssl-fork-chacha20poly1305.html</guid><category>openssl</category></item><item><title>FREAK!</title><link>https://www.onwebsecurity.com/security/freak.html</link><description>&lt;p&gt;As you probably read somewhere else, and on another place, and another... on
March 3rd 2015, another attack on SSL/TLS was published. Following the tradition
of BEAST, CRIME, Heartbleed, LUCKY13 and POODLE this one also has a catchy name:
FREAK (Factoring RSA Export Keys).&lt;/p&gt;
&lt;p&gt;It's a man-in-the-middle attack where a man in the middle can decrypt a SSL/TLS
connection between a client and a server.&lt;/p&gt;
&lt;p&gt;&lt;img alt="FREAK" src="https://www.onwebsecurity.com/images/FREAK.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;Vulnerable *servers* are servers that accept export-grade ciphers
(RSA-EXPORT). Checking whether a server is vulnerable can be done in
many ways.&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Take for example
&lt;a class="reference external" href="https://github.com/PeterMosmans/security-scripts/blob/master/analyze_hosts.py"&gt;analyze_hosts.py&lt;/a&gt;,
a Python wrapper around several tools:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="go"&gt;analyze_hosts --ssl HOST&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;If you see any EXPort ciphers, the server is vulnerable.&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Another way is by using
&lt;a class="reference external" href="https://github.com/jvehent/cipherscan"&gt;cipherscan&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="go"&gt;cipherscan HOST:443&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;If you see any EXPort ciphers, the server is vulnerable.&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Yet another way is by using nmap:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="go"&gt;nmap --script ssl-enum-ciphers -p433 HOST&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;If you see any EXPort ciphers, the server is vulnerable.&lt;/p&gt;
&lt;p&gt;You get the idea...&lt;/p&gt;
&lt;p&gt;Mitigate this vulnerability server-side by making sure that your server
doesn't allow export ciphers in the OpenSSL configuration: add the
following expression&lt;/p&gt;
&lt;pre class="literal-block"&gt;
!EXP
&lt;/pre&gt;
&lt;p&gt;There are also vulnerable clients...&lt;/p&gt;
&lt;p&gt;Clients using OpenSSL are &lt;strong&gt;not&lt;/strong&gt; vulnerable if they were built after
&lt;a class="reference external" href="https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2015-0204"&gt;CVE-2015-0204&lt;/a&gt; was
published.&lt;/p&gt;
&lt;p&gt;The …&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Wed, 04 Mar 2015 11:40:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2015-03-04:/security/freak.html</guid><category>openssl</category><category>pentesting</category><category>tls</category><category>vulnerability</category></item><item><title>Us versus them: CrikeyCon 2015 review</title><link>https://www.onwebsecurity.com/opinion/us-versus-them-crikeycon-2015-review.html</link><description>&lt;p&gt;I had the chance to visit &lt;a class="reference external" href="http://crikeycon.com"&gt;CrikeyCon&lt;/a&gt; February 2015,
which was held in Brisbane&lt;/p&gt;
&lt;p&gt;&lt;img alt="CrikeyCon" src="https://www.onwebsecurity.com/images/crikeycon-2015.png" /&gt;&lt;/p&gt;
&lt;p&gt;It was the second time this event was held, but it already got the looks and
feel of a professional organization behind it. The program was really diverse,
from social engineering and awkward hugs to iOS runtime hacking, and everything
in between.&lt;/p&gt;
&lt;p&gt;Takeaway ? Well, it surprised me to hear that there's still a general
feeling of &lt;em&gt;us&lt;/em&gt; versus &lt;em&gt;them&lt;/em&gt;. We the security gods who lay bare all the
faults and stupid mistakes the others make.&lt;/p&gt;
&lt;p&gt;As a security professional, especially as a pentester, it's your job
to find vulnerabilities and weaknesses. It's your job to hunt for
other people's mistakes, lack of knowledge, or constrained security
budgets. Security falls into the quality assurance department.&lt;/p&gt;
&lt;p&gt;This means that most of the time you're telling other people what's wrong with
an application. Unfortunately it's not your job to tell them how awesome their
web application is, how well it scales, or the nifty features it has.&lt;/p&gt;
&lt;p&gt;One of the more challenging issues when for instance presenting a
pentest report to a group of developers is to get everybody on board, to
get everybody to work together. And if …&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Thu, 26 Feb 2015 11:27:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2015-02-26:/opinion/us-versus-them-crikeycon-2015-review.html</guid><category>conference</category></item><item><title>OpenSSL 1.0.2 - now with less whitespace!</title><link>https://www.onwebsecurity.com/announcements/openssl-1-0-2-now-with-less-whitespace.html</link><description>&lt;div class="line-block"&gt;
&lt;div class="line"&gt;On January 22 2015, version 1.0.2 of OpenSSL was released. Besides
some new bugfixes and features, the biggest change under the hood was
a &lt;a class="reference external" href="https://www.openssl.org/blog/blog/2015/01/05/source-code-reformat/"&gt;complete
reformatting&lt;/a&gt;
of the source code. An &lt;a class="reference external" href="https://www.openssl.org/about/codingstyle.txt"&gt;official coding style
document&lt;/a&gt; was
published, and as a result primarily buckets and lots of tabs and
newline characters have been converted into whitespaces.&lt;/div&gt;
&lt;div class="line"&gt;Personally I hope that this action, which affected the majority of
lines(!) of code, will help the project for the best and will make it
easier to maintain the project in the future.&lt;/div&gt;
&lt;div class="line"&gt;One disadvantage of reformatting code for instance however is that it
makes it a lot harder to spot differences in code between certain
versions, as almost all files have most of their lines changed.&lt;/div&gt;
&lt;div class="line"&gt;Another disadvantage is that merging additional patches (like the
ChaCha20 and Poly1305 ciphers) back into OpenSSL took a great deal of
extra time. Unnecessary time, one might say.&lt;/div&gt;
&lt;/div&gt;
&lt;div class="line-block"&gt;
&lt;div class="line"&gt;The OpenSSL 1.0.2 fork including the ChaCha20 and Poly1305 ciphers has
been pushed to the github repo at
&lt;a class="reference external" href="https://github.com/PeterMosmans/openssl/"&gt;https://github.com/PeterMosmans/openssl/&lt;/a&gt;&lt;/div&gt;
&lt;div class="line"&gt;As always, you can find compiled Windows 32 and 64 bit binaries at
&lt;a class="reference external" href="https://www.onwebsecurity.com/cryptography/openssl%20"&gt;https://www.onwebsecurity.com/cryptography/openssl&lt;/a&gt;.&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;February 2015 update: read …&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Sun, 08 Feb 2015 15:34:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2015-02-08:/announcements/openssl-1-0-2-now-with-less-whitespace.html</guid><category>openssl</category></item><item><title>CVSSv2 rating of new vulnerabilities patched in OpenSSL</title><link>https://www.onwebsecurity.com/announcements/cvssv2-rating-of-new-vulnerabilities-patched-in-openssl.html</link><description>&lt;p&gt;On January 8th, 2015, the OpenSSL team published an &lt;a class="reference external" href="https://openssl.org/news/secadv_20150108.txt"&gt;OpenSSL Security
Advisory&lt;/a&gt; containing 8
previously unknown vulnerabilities in OpenSSL.&lt;/p&gt;
&lt;p&gt;Unfortunately, as with most large software suppliers/vendors nowadays,
OpenSSL uses its own &lt;a class="reference external" href="https://www.openssl.org/about/secpolicy.html"&gt;severity classification
system&lt;/a&gt; for
vulnerabilities. There are many classifications systems out there, which
results in less transparent patching policies and procedures for system
administrators and end users. Fortunately NIST publishes the CVSSv2
Severity Base Score of most, if not all vulnerabilities with a CVE
entry. This makes it easier to classify.&lt;/p&gt;
&lt;p&gt;&lt;img alt="CVSSv2" src="https://www.onwebsecurity.com/images/cvss.png" /&gt;&lt;/p&gt;
&lt;p&gt;Two of the eight vulnerabilities (CVE-2014-3571 and CVE-2015-0205) have
the OpenSSL vulnerability rating 'moderate'. This corresponds to a
CVSSv2 base score of 5.0 (MEDIUM) for
&lt;a class="reference external" href="https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2014-3571"&gt;CVE-2014-2571&lt;/a&gt;
as well as
&lt;a class="reference external" href="https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2015-0205"&gt;CVE-2015-0205&lt;/a&gt;
Both of these vulnerabilities could be exploited for a Denial of Service
attack of the OpenSSL service. The remaining six vulnerabilities have a
lower rating.&lt;/p&gt;
&lt;p&gt;The 1.0.2-chacha and 1.0.1-chacha branches of the ChaCha20 - Poly1305
fork of OpenSSL have been patched for all of the published
vulnerabilities.&lt;/p&gt;
&lt;p&gt;As always, see &lt;a class="reference external" href="https://www.onwebsecurity.com/cryptography/openssl"&gt;https://www.onwebsecurity.com/cryptography/openssl&lt;/a&gt; for
the Windows 32 and 64 bit binaries, and more information.&lt;/p&gt;
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Sat, 10 Jan 2015 04:45:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2015-01-10:/announcements/cvssv2-rating-of-new-vulnerabilities-patched-in-openssl.html</guid><category>openssl</category></item><item><title>MSYS2 - successful successor of MSYS ?</title><link>https://www.onwebsecurity.com/opinion/msys2-succesful-successor-of-msys.html</link><description>&lt;p&gt;&lt;img alt="MSYS2" src="https://www.onwebsecurity.com/images/msys2.png" /&gt;&lt;/p&gt;
&lt;p&gt;MSYS can best be described as a Bash shell and some GNU tools, which facilitate
compiling sources under and for a Windows environment. It's the environment to
use when compiling for instance OpenSSL or Emacs on Windows.&lt;/p&gt;
&lt;p&gt;MSYS2 is the 'new and improved' version of MSYS.&lt;/p&gt;
&lt;p&gt;One of its biggest advantages is better package management. MSYS2 has pacman, a
package manager from Arch Linux. Upgrading can finally be done from within the
shell session itself, with only a few basic commands.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="gp"&gt;#&lt;/span&gt; download package descriptions from the remote repositories
&lt;span class="go"&gt;pacman -Sy&lt;/span&gt;
&lt;span class="gp"&gt;#&lt;/span&gt; upgrade MSYS2 core components and the shell itself
&lt;span class="go"&gt;pacman --needed -S bash pacman msys2-runtime&lt;/span&gt;
&lt;span class="gp"&gt;#&lt;/span&gt; restart MSYS2 &lt;span class="k"&gt;if&lt;/span&gt; any package needed updating, &lt;span class="k"&gt;then&lt;/span&gt; update the rest
&lt;span class="go"&gt;pacman -Su&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This was 'somewhat more difficult' under MSYS.&lt;/p&gt;
&lt;p&gt;Another advantage is the Bash version - currently at 4.3.30 versus 3.1.17 on
MSYS. Bash 4 means support for functions like associative arrays and fancier
redirections:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="gp"&gt;#&lt;/span&gt; redirect stdout and stderr at the same &lt;span class="nb"&gt;time&lt;/span&gt;
&lt;span class="go"&gt;command &amp;amp;&amp;gt; output&lt;/span&gt;

&lt;span class="gp"&gt;#&lt;/span&gt; same &lt;span class="nb"&gt;command&lt;/span&gt; in Bash &lt;span class="m"&gt;3&lt;/span&gt; syntax
&lt;span class="go"&gt;command &amp;gt; output 2&amp;gt;&amp;amp;1&lt;/span&gt;

&lt;span class="gp"&gt;#&lt;/span&gt; pipe stdout and stderr at the same &lt;span class="nb"&gt;time&lt;/span&gt;
&lt;span class="go"&gt;command |&amp;amp; someothercommand&lt;/span&gt;

&lt;span class="gp"&gt;#&lt;/span&gt; same &lt;span class="nb"&gt;command&lt;/span&gt; in Bash &lt;span class="m"&gt;3&lt;/span&gt; syntax
&lt;span class="go"&gt;command 2&amp;gt;&amp;amp;1 \| someothercommand&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The third big plus is that it's …&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Fri, 05 Dec 2014 09:34:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2014-12-05:/opinion/msys2-succesful-successor-of-msys.html</guid><category>msys2</category><category>windows</category></item><item><title>OpenSSL: Fatal SSL alert number 47 (Illegal Parameter)</title><link>https://www.onwebsecurity.com/announcements/openssl-fatal-ssl-alert-number-47-illegal-parameter.html</link><description>&lt;div class="line-block"&gt;
&lt;div class="line"&gt;As a pentester, I regularly test the configuration of SSL servers. For
this purpose I use my &lt;a class="reference external" href="https://github.com/PeterMosmans/openssl"&gt;customized OpenSSL
fork&lt;/a&gt; which contains a lot
more ciphers than the official version, and &lt;a class="reference external" href="https://github.com/PeterMosmans/security-scripts"&gt;wrapper
scripts&lt;/a&gt; (easier
than remembering command line options).&lt;/div&gt;
&lt;div class="line"&gt;Last month I ran into an issue with servers behind a SSL terminator
from a well-known network equipment supplier. As soon as the SSL
Client Hello offered 128 or more ciphers to the server and the tls1_2
protocol was specified, the handshake was aborted with the following
error message&lt;/div&gt;
&lt;/div&gt;
&lt;pre class="literal-block"&gt;
9304:error:14094417:SSL routines:ssl3_read_bytes:sslv3 alert illegal parameter:s3_pkt.c:1481:SSL alert number 47 9304:error:1409E0E5:SSL routines:ssl3_write_bytes:ssl handshake failure:s3_pkt.c:636:
&lt;/pre&gt;
&lt;p&gt;The supplier hadn't heard of this bug yet - I suspect that not that many
browsers or generic SSL clients offer 128 or more ciphers. A bugreport
has been filed.&lt;/p&gt;
&lt;p&gt;To facilitate the testing of SSL/TLS handshakes I created a script,
which can be found at
&lt;a class="reference external" href="https://github.com/PeterMosmans/security-scripts/blob/master/test_ssl_handshake.sh"&gt;GitHub&lt;/a&gt;.
Currently 3 handshake bugs are identified.&lt;/p&gt;
&lt;p&gt;Of course you can test for this bug using a version of OpenSSL with enough (128
or more) ciphers, and the command&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="go"&gt;openssl s_client -connect host:port -tls1_2&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Tue, 25 Nov 2014 06:33:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2014-11-25:/announcements/openssl-fatal-ssl-alert-number-47-illegal-parameter.html</guid><category>openssl</category></item><item><title>Black Hat Europe 2014 review</title><link>https://www.onwebsecurity.com/opinion/black-hat-europe-2014-review.html</link><description>&lt;p&gt;Black Hat Europe was held in Amsterdam in October, 2014. The so called Briefings
(tech talks) were extremely versatile, ranging from Android pentesting to SCADA
hacks. It was difficult to choose which talk to attend - there were around 50 or
so, each title vying for your attention (&amp;quot;Hack Your ATM with Friend's
Raspberry.Py&amp;quot; [sic], or &amp;quot;Endrun - Secure Digital Communications for Our Modern
Dystopia&amp;quot;).&lt;/p&gt;
&lt;p&gt;&lt;img alt="Black Hat Europe 2014" src="https://www.onwebsecurity.com/images/Black_Hat_Europe_2014.png" /&gt;&lt;/p&gt;
&lt;p&gt;I really enjoyed the technical depth of some talks, and it was great to hear
someone like Adi Shamir, one of the inventors of the famous RSA algorithm, talk
about his current research.&lt;/p&gt;
&lt;p&gt;Because of the sheer size I couldn't find one generic takeaway, or see the, or a
current bigger picture in information security land. Even all of the vendors'
offerings looked similar.&lt;/p&gt;
&lt;p&gt;Now that I come to think of it, that actually IS the key takeaway:
&lt;strong&gt;Genericity&lt;/strong&gt;.&lt;/p&gt;
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Tue, 11 Nov 2014 12:56:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2014-11-11:/opinion/black-hat-europe-2014-review.html</guid><category>conference</category></item><item><title>Creating and verifying digital signatures of files</title><link>https://www.onwebsecurity.com/security/creating-and-verifying-digital-signatures-of-files.html</link><description>&lt;p&gt;Digital signatures can be used to establish the authenticity and integrity of a
(binary) file. These signatures can also be used for non-repudiation purposes,
but that's usually not the intention when you're distributing or receiving
files. (Note: non-repudiation means impossible to reject; to make sure beyond a
doubt that the signer's key has been used to create that signature).&lt;/p&gt;
&lt;p&gt;The easiest and most secure way of creating and verifying digital signatures is
by using PGP. The following commands assume that you have downloaded and
configured GPG, the free and complete implementation of the OpenPGP standard.&lt;/p&gt;
&lt;div class="section" id="create-a-digital-signature-of-filename"&gt;
&lt;h2&gt;Create a digital signature of FILENAME&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="go"&gt;gpg --armor --detach-sig --output FILENAME.sig FILENAME&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;table class="docutils option-list" frame="void" rules="none"&gt;
&lt;col class="option" /&gt;
&lt;col class="description" /&gt;
&lt;tbody valign="top"&gt;
&lt;tr&gt;&lt;td class="option-group"&gt;
&lt;kbd&gt;&lt;span class="option"&gt;--armor&lt;/span&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;td&gt;make sure that the file is ASCII armored (Radix-64 encoded)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="option-group"&gt;
&lt;kbd&gt;&lt;span class="option"&gt;--detach-sig&lt;/span&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;td&gt;create a separate signature file&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="option-group"&gt;
&lt;kbd&gt;&lt;span class="option"&gt;--output&lt;/span&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;td&gt;the name of the signature file&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div class="section" id="paranoid-options"&gt;
&lt;h2&gt;Paranoid options&lt;/h2&gt;
&lt;table class="docutils option-list" frame="void" rules="none"&gt;
&lt;col class="option" /&gt;
&lt;col class="description" /&gt;
&lt;tbody valign="top"&gt;
&lt;tr&gt;&lt;td class="option-group"&gt;
&lt;kbd&gt;&lt;span class="option"&gt;--no-version&lt;/span&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;td&gt;don't show which software version has been used to create the signature&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="option-group"&gt;
&lt;kbd&gt;&lt;span class="option"&gt;--comment&lt;/span&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;td&gt;don't show which software has been used to create the signature&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div class="section" id="verify-a-digital-signature"&gt;
&lt;h2&gt;Verify a digital signature&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="go"&gt;gpg --verify FILENAME.sig&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This command assumes that the original file is FILENAME and resides in the same
location as the signature file FILENAME.sig. To verify a signature you also need
the signer's public key. If …&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Tue, 28 Oct 2014 06:51:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2014-10-28:/security/creating-and-verifying-digital-signatures-of-files.html</guid><category>openpgp</category></item><item><title>Patched openssl SSLv3 downgrade attack (POODLE) with ChaCha20 and Poly1305 support</title><link>https://www.onwebsecurity.com/announcements/patched-openssl-sslv3-downgrade-attack-poodle-with-chacha20-and-poly1305-support.html</link><description>&lt;div class="line-block"&gt;
&lt;div class="line"&gt;The OpenSSL team published a security advisory on October 15th 2014,
see &lt;a class="reference external" href="https://www.openssl.org/news/secadv_20141015.txt"&gt;the OpenSSL
site&lt;/a&gt; for more
information.&lt;/div&gt;
&lt;div class="line"&gt;In short, SSLv3 using Cipher Block Chaining mode (CBC) has a weakness,
which can be exploited using the POODLE attack having CVE entry
CVE-2014-3566.&lt;/div&gt;
&lt;div class="line"&gt;The POODLE attack depends on SSLv3 and tries to downgrade a connection
to that specific, really old protocol. This downgrade can be mitigated
by using the signaling cipher suite value (SCSV) TLS_FALLBACK_SCSV,
which is implemented in the/this latest version of openssl. Please be
advised that not only the server, but the client itself also has to
support this relatively new method.&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;All vulnerabilities in the advisory have been patched in the latest
versions of OpenSSL 1.0.2-chacha. Moreover, the new binaries/source are
aligned with the latest beta release (3).&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;SRTP Memory Leak (CVE-2014-3513)&lt;/li&gt;
&lt;li&gt;Session Ticket Memory Leak (CVE-2014-3567)&lt;/li&gt;
&lt;li&gt;SSL 3.0 Fallback protection&lt;/li&gt;
&lt;li&gt;Build option no-ssl3 is incomplete (CVE-2014-3568)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;As always, check &lt;a class="reference external" href="https://onwebsecurity.com/cryptography/openssl"&gt;https://onwebsecurity.com/cryptography/openssl&lt;/a&gt; for the
latest Windows 32 and 64 bit binaries, and
&lt;a class="reference external" href="https://github.com/PeterMosmans/openssl"&gt;https://github.com/PeterMosmans/openssl&lt;/a&gt; for the latest sources.&lt;/p&gt;
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Sat, 25 Oct 2014 07:35:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2014-10-25:/announcements/patched-openssl-sslv3-downgrade-attack-poodle-with-chacha20-and-poly1305-support.html</guid><category>openssl</category></item><item><title>Patched vulnerabilities in OpenSSL with ChaCha20 and Poly1305 support</title><link>https://www.onwebsecurity.com/announcements/patched-vulnerabilities-in-openssl-with-chacha20-and-poly1305-support.html</link><description>&lt;p&gt;The OpenSSL team published a security advisory on August 6th 2014, see
&lt;a class="reference external" href="https://www.openssl.org/news/secadv_20140806.txt"&gt;the OpenSSL site&lt;/a&gt;
for more information. All vulnerabilities in that advisory have been
patched in the latest versions of OpenSSL 1.0.1-chacha and 1.0.2-chacha:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Information leak in pretty printing functions (CVE-2014-3508)&lt;/li&gt;
&lt;li&gt;Crash with SRP ciphersuite in Server Hello message (CVE-2014-5139)&lt;/li&gt;
&lt;li&gt;Race condition in ssl_parse_serverhello_tlsext (CVE-2014-3509)&lt;/li&gt;
&lt;li&gt;Double Free when processing DTLS packets (CVE-2014-3505)&lt;/li&gt;
&lt;li&gt;DTLS memory exhaustion (CVE-2014-3506)&lt;/li&gt;
&lt;li&gt;DTLS memory leak from zero-length fragments (CVE-2014-3507)&lt;/li&gt;
&lt;li&gt;OpenSSL DTLS anonymous EC(DH) denial of service (CVE-2014-3510)&lt;/li&gt;
&lt;li&gt;OpenSSL TLS protocol downgrade attack (CVE-2014-3511)&lt;/li&gt;
&lt;li&gt;SRP buffer overrun (CVE-2014-3512)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;As always, check &lt;a class="reference external" href="https://onwebsecurity.com/cryptography/openssl"&gt;https://onwebsecurity.com/cryptography/openssl&lt;/a&gt; for the
latest Windows 32 and 64 bit binaries, and
&lt;a class="reference external" href="https://github.com/PeterMosmans/openssl"&gt;https://github.com/PeterMosmans/openssl&lt;/a&gt; for the latest sources.&lt;/p&gt;
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Thu, 07 Aug 2014 14:49:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2014-08-07:/announcements/patched-vulnerabilities-in-openssl-with-chacha20-and-poly1305-support.html</guid><category>openssl</category></item><item><title>DevOps 2014 Brisbane and security</title><link>https://www.onwebsecurity.com/opinion/devops-2014-brisbane-and-security.html</link><description>&lt;p&gt;DevOps is a worldwide phenomenon, which is reflected by the global
popularity of its major event, the DevOps Days.&lt;/p&gt;
&lt;p&gt;&lt;img alt="DevOps Days 2014 - Brisbane" src="/images/dodbne2014.png" /&gt;&lt;/p&gt;
&lt;p&gt;I was fortunate enough to attend the DevOps Days 2014 in Brisbane.&lt;/p&gt;
&lt;p&gt;The keynote speaker was &lt;a class="reference external" href="http://sidneydekker.com"&gt;Sidney Dekker&lt;/a&gt;, a
Dutchman who has extensive experience on human factors and safety. He
argued that a lot of major incidents don't have any precursor events.&lt;/p&gt;
&lt;p&gt;You can have a clean track record with regards to security and still
suffer a huge incident. Do I agree ? Not completely, but nonetheless
thought provoking.&lt;/p&gt;
&lt;p&gt;Personally I think that the inverse will always hold true: There is a higher
chance on a major security incidents after a number of several minor security
incidents. Cluttered desks mean cluttered minds after all.&lt;/p&gt;
&lt;p&gt;Some buzzwords and issues that were (frequently) discussed:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;&lt;a class="reference external" href="https://www.docker.com/"&gt;Docker&lt;/a&gt; - A lightweight virtualization
platform (can it live up to its sky-high expectations ?)&lt;/li&gt;
&lt;li&gt;Microservices - Build small, independently deployable services&lt;/li&gt;
&lt;li&gt;&lt;a class="reference external" href="https://github.com/Netflix/SimianArmy/wiki/Chaos-Monkey"&gt;ChaosMonkey&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Terminate random virtual machines to test (and improve) resiliency&lt;/li&gt;
&lt;li&gt;&lt;a class="reference external" href="http://en.wikipedia.org/wiki/W._Edwards_Deming"&gt;Edwards Deming&lt;/a&gt; -
The godfather of Devops ?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For me the key takeaway was that DevOps doesn't really changes your
(level of operational) security. Whether system administrators deploy
code built by developers or developers push their own code to an
environment - in both …&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Mon, 28 Jul 2014 13:10:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2014-07-28:/opinion/devops-2014-brisbane-and-security.html</guid><category>conference</category></item><item><title>Should you disable RC4 in SSL/TLS ?</title><link>https://www.onwebsecurity.com/opinion/should-you-disable-rc4-in-ssltls.html</link><description>&lt;p&gt;I'm by no means a crypto expert. Still I'm frequently getting (and
answering) questions regarding the use of RC4 in SSL/TLS. Should you
disable it? Or keep it enabled?&lt;/p&gt;
&lt;p&gt;March 2015 update - A 'new' attack method (&lt;a class="reference external" href="https://en.wikipedia.org/wiki/Bar_mitzvah_attack"&gt;Bar Mitsvah
Attack&lt;/a&gt;) using a
previously known RC4 vulnerability was presented, thereby reducing the
RC4 security even more.&lt;/p&gt;
&lt;p&gt;February 2015 update - RFC 7456 has been published, which effectively
prohibits the use of RC4 in TLS.&lt;/p&gt;
&lt;blockquote&gt;
&lt;div class="line-block"&gt;
&lt;div class="line"&gt;This document requires that Transport Layer Security (TLS) clients&lt;/div&gt;
&lt;div class="line"&gt;and servers never negotiate the use of RC4 cipher suites when they&lt;/div&gt;
&lt;div class="line"&gt;establish connections. This applies to all TLS versions.&lt;/div&gt;
&lt;/div&gt;
&lt;/blockquote&gt;
&lt;p&gt;See
&lt;a class="reference external" href="https://tools.ietf.org/html/rfc7465"&gt;http://tools.ietf.org/html/rfc7465&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Here is my reasoning to &lt;strong&gt;disable&lt;/strong&gt; all ciphersuites using RC4:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;RC4 is a stream cipher that has been around since 1987. The number
and quality of attacks on RC4 (in SSL/TLS) increases.
&lt;strong&gt;Fact:&lt;/strong&gt; Attacks on encryption algorithms only get better, they
never get worse.&lt;/li&gt;
&lt;li&gt;A lot of sites still enable RC4 in their ciphers, to support a wide
browser base.
&lt;strong&gt;Fact:&lt;/strong&gt; Even Internet Explorer on Windows XP supports DES-CBC3-SHA
(an alternative to one of the RC4 ciphers)&lt;/li&gt;
&lt;li&gt;RC4 is one of the few ciphers that is resistant to the BEAST attack …&lt;/li&gt;&lt;/ul&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Wed, 23 Jul 2014 11:22:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2014-07-23:/opinion/should-you-disable-rc4-in-ssltls.html</guid><category>cryptography</category><category>tls</category></item><item><title>git on Windows - location of configuration files</title><link>https://www.onwebsecurity.com/configuration/git-on-windows-location-of-global-configuration-file.html</link><description>&lt;p&gt;Git is used as distributed version control system for the majority of
projects I work on. On Windows I use the official &lt;a class="reference external" href="https://git-scm.com/download/win"&gt;Git for
Windows&lt;/a&gt; version, as well as the
'native' mingw/MSYS2 git binary when using the &lt;a class="reference external" href="https://msys2.github.io/"&gt;MSYS2
shell&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The location of the system and global &lt;strong&gt;gitconfig&lt;/strong&gt; configuration files varies,
depending on which environment (native Windows command, Windows shell or MSYS2
shell) you're using, and depending on which binary (Git for Windows versus
native git). There's a logic to it, but it can be hard to figure out...&lt;/p&gt;
&lt;p&gt;Git version 2 introduced a much easier method of finding where the git
configuration files are stored, the &lt;code class="code"&gt;
--show-origin&lt;/code&gt;
 flag. This parameter
tells you exactly where each of the configuration files can be found.&lt;/p&gt;
&lt;p&gt;Retrieve the locations (and name value pairs) of all git configuration files:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="go"&gt;git config --list --show-origin&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Retrieve the location (and name value pairs) of the system git configuration
file:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="go"&gt;git config --list --system --show-origin&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Retrieve the unique locations of all git configuration files:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="go"&gt;git config --list --show-origin | awk &amp;#39;{print $1}&amp;#39; | uniq&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;div class="section" id="local"&gt;
&lt;h2&gt;Local&lt;/h2&gt;
&lt;p&gt;Regardless from where you use git on Windows, the repository (local)
configuration always resides at the same location, in the root directory of your
repository …&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Wed, 09 Jul 2014 09:10:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2014-07-09:/configuration/git-on-windows-location-of-global-configuration-file.html</guid><category>git</category><category>msys2</category><category>windows</category></item><item><title>OpenSSL 1.0.2-chacha</title><link>https://www.onwebsecurity.com/announcements/openssl-1-0-2-chacha.html</link><description>&lt;p&gt;&lt;em&gt;Note: see
`http://www.onwebsecurity.com/cryptography/openssl &amp;lt;https://www.onwebsecurity.com/cryptography/openssl&amp;gt;`__
for the latest binary. The version below is obsoleted by newer builds&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Windows 64-bit binary build from a 26-06-2014 snapshot of
&lt;a class="reference external" href="https://github.com/PeterMosmans/openssl/tree/1.0.2-chacha"&gt;https://github.com/PeterMosmans/openssl/tree/1.0.2-chacha&lt;/a&gt;. This is the
official 1.0.2 branch (OpenSSL_1_0_2_stable), merged with support
for the ChaCha20 and Poly1305 ciphers. Some minor build patches for
Windows compatibility were applied. See the git repo for the full
source.&lt;/p&gt;
&lt;p&gt;Build commands:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;mingw64 shared experimental-jpake enable-md2 enable-rc5
enable-rfc3779 enable-ec_nistp_64_gcc_128 enable-static-engine
--openssldir=c\:/programs/openssl -DOPENSSL_NO_HEARTBEATS&lt;/li&gt;
&lt;li&gt;make depend&lt;/li&gt;
&lt;li&gt;make util/libeay.num&lt;/li&gt;
&lt;li&gt;make util/ssleay.num&lt;/li&gt;
&lt;li&gt;make&lt;/li&gt;
&lt;li&gt;make report&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Compiler used:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="go"&gt;gcc version 4.9.0 (x86\_64-posix-seh-rev1, Built by MinGW-W64 project)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;All tests passed&lt;/p&gt;
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Thu, 26 Jun 2014 14:04:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2014-06-26:/announcements/openssl-1-0-2-chacha.html</guid><category>openssl</category></item><item><title>OpenSSL 1.0.1-chacha</title><link>https://www.onwebsecurity.com/announcements/openssl-1-0-1-chacha.html</link><description>&lt;div class="line-block"&gt;
&lt;div class="line"&gt;A Windows 64-bit binary build from the 1.0.1 branch of OpenSSL
(OpenSSL_1_0_1-stable), including (assembly code for) ChaCha20,
Poly1305, J-PAKE, NIST P-224, NIST P-256 and the relatively unsafe
ciphers MD2 and RC5 and broken protocol SSLv2. All available engines
are provided as separate DLLs.&lt;/div&gt;
&lt;div class="line"&gt;If you're using this in a production environment, don't forget to
explicitly enable only ciphers that are considered safe.&lt;/div&gt;
&lt;div class="line"&gt;The code for this build can be found at
&lt;a class="reference external" href="https://github.com/PeterMosmans/openssl/tree/1.0.1-chacha"&gt;https://github.com/PeterMosmans/openssl/tree/1.0.1-chacha&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class="line-block"&gt;
&lt;div class="line"&gt;Example openssl.cnf cipher string:&lt;/div&gt;
&lt;div class="line"&gt;`` HIGH:!SSLv2:!IDEA:!RC4:!MD5:!ADH:!aNULL:!eNULL``&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Build commands:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Configure mingw64 shared experimental-jpake enable-md2 enable-rc5
enable-rfc3779 enable-ec_nistp_64_gcc_128 enable-static-engine
--openssldir=c\:/programs/openssl -DOPENSSL_NO_HEARTBEATS&lt;/li&gt;
&lt;li&gt;make depend&lt;/li&gt;
&lt;li&gt;make util/libeay.num&lt;/li&gt;
&lt;li&gt;make util/ssleay.num&lt;/li&gt;
&lt;li&gt;make&lt;/li&gt;
&lt;li&gt;make report (all tests passed)&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="line-block"&gt;
&lt;div class="line"&gt;&lt;a class="reference external" href="http://www.onwebsecurity.com/files/1.0.1-chacha-latest.zip"&gt;http://www.onwebsecurity.com/files/1.0.1-chacha-latest.zip&lt;/a&gt;&lt;/div&gt;
&lt;div class="line"&gt;md5sum: d890de1ab4eba13c7d39139c5726144f&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Compiler used:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;gcc version 4.9.0 (x86_64-posix-seh-rev1, Built by MinGW-W64
project)&lt;/li&gt;
&lt;/ul&gt;
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Wed, 18 Jun 2014 05:54:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2014-06-18:/announcements/openssl-1-0-1-chacha.html</guid><category>openssl</category></item><item><title>OpenSSL 1.0.2 (10-06-2014)</title><link>https://www.onwebsecurity.com/announcements/openssl-1-0-2-10-06-2014.html</link><description>&lt;p&gt;&lt;em&gt;Note: see http://www.onwebsecurity.com/cryptography/openssl for the
latest binary. The version below is obsoleted by newer builds&lt;/em&gt;&lt;/p&gt;
&lt;div class="line-block"&gt;
&lt;div class="line"&gt;A Windows 64-bit binary build from a 10-06-2014 snapshot of the
official 1.0.2 branch (OpenSSL_1_0_2_stable). This means that 'the
latest OpenSSL vulnerabilities' that were disclosed on June 5th 2014
are fixed - see &lt;a class="reference external" href="https://www.openssl.org/news/secadv_20140605.txt"&gt;https://www.openssl.org/news/secadv_20140605.txt&lt;/a&gt; for
more information.&lt;/div&gt;
&lt;div class="line"&gt;I applied some minor patches for Windows compatibility and changed the
version string.&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Build commands:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="go"&gt;Configure mingw64 shared experimental-jpake enable-md2 enable-rc5 \&lt;/span&gt;
&lt;span class="go"&gt;enable-rfc3779 enable-ssl-trace enable-ec_nistp_64_gcc_128 \&lt;/span&gt;
&lt;span class="go"&gt;enable-static-engine --openssldir=c:/tools -DOPENSSL_NO_HEARTBEATS \&lt;/span&gt;
&lt;span class="go"&gt;-mtune=native&lt;/span&gt;
&lt;span class="go"&gt;make depend&lt;/span&gt;
&lt;span class="go"&gt;make util/libeay.num&lt;/span&gt;
&lt;span class="go"&gt;make util/ssleay.num&lt;/span&gt;
&lt;span class="go"&gt;make&lt;/span&gt;
&lt;span class="go"&gt;make report&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Compiler used:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;gcc version 4.9.0 (x86_64-posix-seh-rev1, Built by MinGW-W64
project)&lt;/li&gt;
&lt;/ul&gt;
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Tue, 10 Jun 2014 07:37:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2014-06-10:/announcements/openssl-1-0-2-10-06-2014.html</guid><category>openssl</category></item><item><title>OpenSSL on 64 bit Windows with ChaCha and Poly1305 support</title><link>https://www.onwebsecurity.com/announcements/openssl-on-64-bit-windows-with-chacha-and-poly1305-support.html</link><description>&lt;p&gt;&lt;em&gt;Note: see https://www.onwebsecurity.com/cryptography/openssl for the
latest binary. The version below is obsoleted by newer builds&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;The main development branch of OpenSSL doesn't have support yet for the
(relatively new) ChaCha 20 and Poly1305 ciphers. These can be found
however on the 1.0.2-aead branch.&lt;/p&gt;
&lt;p&gt;By slightly modifying some makefiles the source can be compiled for
64-bit Windows using mingw64 and msys.&lt;/p&gt;
&lt;p&gt;Please find a binary build from a 27-05-2014 snapshot of the source code
(1.0.2-aead branch) with assembly code enabled (imported from the 1.0.2
stable branch), and a lot of insecure, new and experimental ciphers
enabled. I added the GOST engine gosteay32.dll as well.&lt;/p&gt;
&lt;p&gt;The source code for this build can be found at
&lt;a class="reference external" href="https://github.com/PeterMosmans/openssl"&gt;https://github.com/PeterMosmans/openssl&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Build commands:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Configure mingw64 shared experimental-jpake enable-md2 enable-rc5
enable-rfc3779 enable-ssl-trace enable-ec_nistp_64_gcc_128
enable-static-engine --openssldir=c:/tools&lt;/li&gt;
&lt;li&gt;make depend&lt;/li&gt;
&lt;li&gt;make util/libeay.num&lt;/li&gt;
&lt;li&gt;make util/ssleay.num&lt;/li&gt;
&lt;li&gt;make&lt;/li&gt;
&lt;li&gt;make test&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Enabled ciphers:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;ECDHE-RSA-AES256-GCM-SHA384&lt;/li&gt;
&lt;li&gt;ECDHE-ECDSA-AES256-GCM-SHA384&lt;/li&gt;
&lt;li&gt;ECDHE-RSA-AES256-SHA384&lt;/li&gt;
&lt;li&gt;ECDHE-ECDSA-AES256-SHA384&lt;/li&gt;
&lt;li&gt;ECDHE-RSA-AES256-SHA&lt;/li&gt;
&lt;li&gt;ECDHE-ECDSA-AES256-SHA&lt;/li&gt;
&lt;li&gt;SRP-DSS-AES-256-CBC-SHA&lt;/li&gt;
&lt;li&gt;SRP-RSA-AES-256-CBC-SHA&lt;/li&gt;
&lt;li&gt;DH-DSS-AES256-GCM-SHA384&lt;/li&gt;
&lt;li&gt;DHE-DSS-AES256-GCM-SHA384&lt;/li&gt;
&lt;li&gt;DH-RSA-AES256-GCM-SHA384&lt;/li&gt;
&lt;li&gt;DHE-RSA-AES256-GCM-SHA384&lt;/li&gt;
&lt;li&gt;DHE-RSA-AES256-SHA256&lt;/li&gt;
&lt;li&gt;DHE-DSS-AES256-SHA256&lt;/li&gt;
&lt;li&gt;DH-RSA-AES256-SHA256&lt;/li&gt;
&lt;li&gt;DH-DSS-AES256-SHA256&lt;/li&gt;
&lt;li&gt;DHE-RSA-AES256-SHA&lt;/li&gt;
&lt;li&gt;DHE-DSS-AES256-SHA&lt;/li&gt;
&lt;li&gt;DH-RSA-AES256-SHA&lt;/li&gt;
&lt;li&gt;DH-DSS-AES256-SHA&lt;/li&gt;
&lt;li&gt;ECDHE-ECDSA-CHACHA20-POLY1305&lt;/li&gt;
&lt;li&gt;ECDHE-RSA-CHACHA20-POLY1305&lt;/li&gt;
&lt;li&gt;DHE-RSA-CHACHA20-POLY1305&lt;/li&gt;
&lt;li&gt;DHE-RSA-CAMELLIA256-SHA&lt;/li&gt;
&lt;li&gt;DHE-DSS-CAMELLIA256-SHA&lt;/li&gt;
&lt;li&gt;DH-RSA-CAMELLIA256-SHA&lt;/li&gt;
&lt;li&gt;DH-DSS-CAMELLIA256-SHA&lt;/li&gt;
&lt;li&gt;GOST2001-GOST89-GOST89&lt;/li&gt;
&lt;li&gt;GOST94-GOST89-GOST89&lt;/li&gt;
&lt;li&gt;AECDH-AES256-SHA&lt;/li&gt;
&lt;li&gt;SRP-AES-256-CBC-SHA&lt;/li&gt;
&lt;li&gt;ADH-AES256-GCM-SHA384&lt;/li&gt;
&lt;li&gt;ADH-AES256-SHA256&lt;/li&gt;
&lt;li&gt;ADH-AES256-SHA&lt;/li&gt;
&lt;li&gt;ADH-CAMELLIA256-SHA&lt;/li&gt;
&lt;li&gt;ECDH-RSA-AES256-GCM-SHA384&lt;/li&gt;
&lt;li&gt;ECDH-ECDSA-AES256-GCM-SHA384&lt;/li&gt;
&lt;li&gt;ECDH-RSA-AES256-SHA384&lt;/li&gt;
&lt;li&gt;ECDH-ECDSA-AES256-SHA384&lt;/li&gt;
&lt;li&gt;ECDH-RSA-AES256-SHA …&lt;/li&gt;&lt;/ul&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Mon, 19 May 2014 09:09:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2014-05-19:/announcements/openssl-on-64-bit-windows-with-chacha-and-poly1305-support.html</guid><category>openssl</category><category>windows</category></item><item><title>test_bn fails for OpenSSL on Windows</title><link>https://www.onwebsecurity.com/configuration/test_bn_fails_for_openssl_on_windows.html</link><description>&lt;p&gt;Compiling OpenSSL on Windows using MSYS and mingw64 is pretty
straightforward. However, one of the tests (test_bn) to verify OpenSSL
fails: The temporary file that test_bncreates contains Windows newline
characters (\r\n) instead of the Unix type newline charater (\n).&lt;/p&gt;
&lt;p&gt;The original regular expression checks for a zero (0) at the beginning
of a line, and a newline character (\n).&lt;/p&gt;
&lt;p&gt;&lt;pre&gt;
(!/^0$$/)&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;A change to the regular expression that test_bn uses fixes this
problem, and can be used on Unix as well as Windows environments. This
makes the Makefile more cross-platform friendly. The modified regular
expression checks for a zero (0) at the beginning of a line, an optional
Windows newline character (\r) and a newline character (\n).&lt;/p&gt;
&lt;p&gt;&lt;pre&gt;
(!/^0\r?$$/)&lt;/pre&gt;
&lt;/p&gt;
&lt;div class="line-block"&gt;
&lt;div class="line"&gt;File:
&lt;a class="reference external" href="http://www.onwebsecurity.com/files/openssl-test-Makefile.patch"&gt;openssl-test-Makefile.patch&lt;/a&gt;&lt;/div&gt;
&lt;div class="line"&gt;md5sum: 1032dff7f957c4d1cdfa96af305c152b&lt;/div&gt;
&lt;/div&gt;
&lt;div class="line-block"&gt;
&lt;div class="line"&gt;Here's the patchfile (can be applied in the source directory using
patch -Np1)&lt;/div&gt;
&lt;div class="line"&gt;&lt;pre&gt;
--- openssl-1.0.1g/test/Makefile 2014-04-07 16:55:44 +0000 +++ patched/test/Makefile 2014-05-06 00:07:20 +0000 &amp;#64;&amp;#64; -227,7 +227,7 &amp;#64;&amp;#64; &amp;#64;../util/shlib_wrap.sh ./$(BNTEST) &amp;gt;tmp.bntest &amp;#64;echo quit &amp;gt;&amp;gt;tmp.bntest &amp;#64;echo &amp;quot;running bc&amp;quot; - &amp;#64;) {if (/^test (.*)/) {print STDERR &amp;quot;\nverify $$1&amp;quot;;} elsif (!/^0$$/) {die &amp;quot;\nFailed! bc: $$_&amp;quot;;} else {print STDERR &amp;quot;.&amp;quot;; $$i++;}} print STDERR &amp;quot;\n$$i tests passed\n&amp;quot;' + &amp;#64;) {if (/^test (.*)/) {print STDERR &amp;quot;\nverify …&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Tue, 06 May 2014 02:16:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2014-05-06:/configuration/test_bn_fails_for_openssl_on_windows.html</guid><category>openssl</category><category>windows</category></item><item><title>analyze_hosts</title><link>https://www.onwebsecurity.com/security/analyze_hosts.html</link><description>&lt;p&gt;If you're like me, you don't want to spend your precious memory on
remembering awkward command line parameters. However, lots of tools
require exactly that: awkward command line parameters.&lt;/p&gt;
&lt;div class="line-block"&gt;
&lt;div class="line"&gt;To simplify scanning of hosts for network vulnerabilities I wrote &lt;a class="reference external" href="https://github.com/PeterMosmans/security-scripts/blob/master/analyze_hosts.sh"&gt;a
simple wrapper
script&lt;/a&gt;
around several open source security tools. The script lets you analyze
one or several hosts for common misconfiguration vulnerabilities and
weaknesses.&lt;/div&gt;
&lt;div class="line"&gt;My main objective in writing the script was to make it as easy as
possible to perform generic security tests, without any heavy
prerequisites, make the script as informative as possible, and make
use of open source tools.&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Note that the latest version is the &lt;strong&gt;Python&lt;/strong&gt; version - please use that one.&lt;/p&gt;
&lt;div class="section" id="how-to-install"&gt;
&lt;h2&gt;How to install&lt;/h2&gt;
&lt;p&gt;Clone the git archive using the command&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="go"&gt;git clone https://github.com/PeterMosmans/security-scripts.git&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class="section" id="needed"&gt;
&lt;h2&gt;Needed&lt;/h2&gt;
&lt;p&gt;Linux, and nmap&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="optional"&gt;
&lt;h2&gt;Optional&lt;/h2&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;&lt;dl class="first docutils"&gt;
&lt;dt&gt;&lt;pre&gt;
curl&lt;/pre&gt;
&lt;/dt&gt;
&lt;dd&gt;for fingerprinting and to test for TRACE&lt;/dd&gt;
&lt;/dl&gt;
&lt;/li&gt;
&lt;li&gt;&lt;dl class="first docutils"&gt;
&lt;dt&gt;&lt;pre&gt;
dig&lt;/pre&gt;
&lt;/dt&gt;
&lt;dd&gt;to test for recursive DNS servers&lt;/dd&gt;
&lt;/dl&gt;
&lt;/li&gt;
&lt;li&gt;&lt;dl class="first docutils"&gt;
&lt;dt&gt;&lt;pre&gt;
git&lt;/pre&gt;
&lt;/dt&gt;
&lt;dd&gt;to update the script&lt;/dd&gt;
&lt;/dl&gt;
&lt;/li&gt;
&lt;li&gt;&lt;dl class="first docutils"&gt;
&lt;dt&gt;&lt;pre&gt;
nikto&lt;/pre&gt;
&lt;/dt&gt;
&lt;dd&gt;for webscanning&lt;/dd&gt;
&lt;/dl&gt;
&lt;/li&gt;
&lt;li&gt;&lt;dl class="first docutils"&gt;
&lt;dt&gt;&lt;pre&gt;
testssl.sh&lt;/pre&gt;
&lt;/dt&gt;
&lt;dd&gt;to check the SSL configuration&lt;/dd&gt;
&lt;/dl&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class="section" id="usage"&gt;
&lt;h2&gt;Usage&lt;/h2&gt;
&lt;p&gt;Oh irony - the command line parameters for the tool:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
usage: analyze_hosts.sh [OPTION]... [HOST]

Scanning options:
 -a, --all perform all basic scans
 --max perform all advanced scans (more thorough)
 -b, --basic …&lt;/pre&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Thu, 23 Jan 2014 03:57:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2014-01-23:/security/analyze_hosts.html</guid><category>pentesting</category><category>tools</category></item><item><title>securing AMFPHP</title><link>https://www.onwebsecurity.com/security/securing-amfphp.html</link><description>&lt;p&gt;I regulary run into Flash applications when I perform a web application
penetration test. One of the most widely used server frameworks for
communicating with a Flash object is AMFPHP.&lt;/p&gt;
&lt;p&gt;Unfortunately the default installation of AMFPHP is insecure. A system
administrator or developer actively has to secure the installation,
which is often forgotten.&lt;/p&gt;
&lt;div class="line-block"&gt;
&lt;div class="line"&gt;There are some tips lying around the Internet how to secure an AMFPHP
installation. The summary:&lt;/div&gt;
&lt;div class="line"&gt;In the root of your AMFPHP deployment,&lt;/div&gt;
&lt;/div&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;delete the DiscoveryService.php file&lt;/li&gt;
&lt;li&gt;Delete the browser folder and its contents&lt;/li&gt;
&lt;li&gt;Edit gateway.php and set the PRODUCTION_SERVER property to true&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Of course it's at least as important to write secure code, harden your
server and implement proper patch and maintenance procedures.&lt;/p&gt;
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Thu, 30 May 2013 09:13:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2013-05-30:/security/securing-amfphp.html</guid><category>amfphp</category></item><item><title>unsafe HTTP methods</title><link>https://www.onwebsecurity.com/security/unsafe-http-methods.html</link><description>&lt;div class="section" id="vulnerability-name-unsafe-http-methods"&gt;
&lt;h2&gt;Vulnerability name: Unsafe HTTP methods&lt;/h2&gt;
&lt;dl class="docutils"&gt;
&lt;dt&gt;Aliases&lt;/dt&gt;
&lt;dd&gt;&lt;ul class="first last simple"&gt;
&lt;li&gt;Web server HTTP Trace/Track method support&lt;/li&gt;
&lt;li&gt;Cross-site tracing vulnerability&lt;/li&gt;
&lt;li&gt;Dangerous HTTP methods&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;dt&gt;Scope&lt;/dt&gt;
&lt;dd&gt;Although this is a &lt;em&gt;server&lt;/em&gt; configuration issue, the &lt;em&gt;client&lt;/em&gt; is at risk here&lt;/dd&gt;
&lt;dt&gt;Remediation&lt;/dt&gt;
&lt;dd&gt;Disable TRACE and/or TRACK and/or DEBUG methods&lt;/dd&gt;
&lt;/dl&gt;
&lt;/div&gt;
&lt;div class="section" id="verification"&gt;
&lt;h2&gt;Verification&lt;/h2&gt;
&lt;p&gt;Using &lt;code class="code"&gt;
curl&lt;/code&gt;
, one can employ one of the methods by hand:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="go"&gt;curl -sIX TRACE $TARGET | awk &amp;#39;NR==1 {print $2}&amp;#39;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Vulnerable when: the result is &lt;strong&gt;200&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;One should expect (not vulnerable) &lt;em&gt;405&lt;/em&gt; (Method Not Allowed) or &lt;em&gt;501&lt;/em&gt; (Not
Implemented) results.&lt;/p&gt;
&lt;p&gt;This executes the TRACE method against &lt;code class="code"&gt;
$TARGET&lt;/code&gt;
, and prints out the HTTP
status code using &lt;code class="code"&gt;
awk&lt;/code&gt;
. The &lt;code class="code"&gt;
-I&lt;/code&gt;
 parameter fetches the head only,
&lt;code class="code"&gt;
-s&lt;/code&gt;
 stands for silent mode, and &lt;code class="code"&gt;
-X&lt;/code&gt;
 specifies the method.&lt;/p&gt;
&lt;p&gt;The easiest way to test whether a server is vulnerable is by using the script
&lt;a class="reference external" href="https://github.com/PeterMosmans/security-scripts/"&gt;analyze_hosts.py&lt;/a&gt; &lt;a class="footnote-reference" href="#id1" id="id2"&gt;[1]&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This script uses &lt;code class="code"&gt;
curl&lt;/code&gt;
 as well as &lt;code class="code"&gt;
nmap&lt;/code&gt;
 to perform multiple tests.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="go"&gt;analyze_hosts.py --trace http://www.target.com&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;div class="admonition note"&gt;
&lt;p class="first admonition-title"&gt;Note&lt;/p&gt;
&lt;p class="last"&gt;When an OPTIONS method is issued, the webserver should return the
supported methods. Some web servers have a habit of replying with methods
that are in fact not supported - which does not combine nicely with inferior
security scanners (and pentesters, I might add) that relying …&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Mosmans</dc:creator><pubDate>Wed, 20 Mar 2013 09:01:00 +0000</pubDate><guid isPermaLink="false">tag:www.onwebsecurity.com,2013-03-20:/security/unsafe-http-methods.html</guid><category>pentesting</category><category>vulnerability</category></item></channel></rss>