Archive: April 2020

How an interactive shell can make your life easier after getting a Reverse Shell

Posted on by  
Niels van Nieuwenburg

At JCore, we follow a three year program to become senior developers. After following this program successfully, you will be promoted to the JDriven company. In the final year, we have a specialization in a topic of our choice. I chose to specialize myself further into security. I have been studying this topic for some time now, even contributing to the fast track courses as a security teacher. Until now, most of my time I spent on the defending side and now I want to take a look on "the other side". So my specialization is all about attack, also described as joining "The Red Team".

Continue reading →

Java Joy: Using Functions To Replace Values In Strings

Posted on by  
Hubert Klein Ikkink

Since Java 9 we can use a function as argument for the Matcher.replaceAll method. The function is invoked with a single argument of type MatchResult and must return a String value. The MatchResult object contains a found match we can get using the group method. If there are capturing groups in the regular expression used for replacing a value we can use group method with the capturing group index as argument.

In the following example we use the replaceAll method and we use a regular expression without and with capturing groups:

Continue reading →

Practical Protobuf - First call

Posted on by  
Peter Steman

In the previous blog I started my journey into Protobuf and introduced my first steps by introducing an example Contract service and some business operations on it.
Now let’s start with diving into details of how to model the gRPC calls.

Continue reading →

Java Joy: Using Named Capturing Groups In Regular Expressions

Posted on by  
Hubert Klein Ikkink

In Java we can define capturing groups in regular expression. We can refer to these groups (if found) by the index from the group as defined in the regular expression. Instead of relying on the index of the group we can give a capturing group a name and use that name to reference the group. The format of the group name is ?<name> as first element of the group definition. The name of the group can be used with the group method of the Matcher class. Also we can use the name when we want to reference the capturing group for example with the replaceAll method of a Matcher object. The format is ${name} to reference the group by name. Finally we can use a named capturing group also as backreference in a regular expression using the syntax \k<name>.

In the following example we define a regular expression with named groups and use them with several methods:

Continue reading →

Clojure Goodness: Checking Predicate For Every Or Any Element In A Collection

Posted on by  
Hubert Klein Ikkink

In Clojure we can use several functions to see if at least one or all elements in a collection return true or false for a predicate. The function every? only returns true if the predicate function returns true for all elements in the collection. To function not-every? return true if a predicate function return false for all elements in a collection. The some function is a bit different (notice there is no ?) and returns the first logical true value from the predicate function for the elements in the collection. So the return type of the predicate doesn’t have to be a Boolean value and then the return type of some is also not a Boolean. If the predicate returns a Boolean value we can use some like a `any` function (any is not part of Clojure). Clojure provides a not-any? function that returns true if the predicate function returns false for one element in the collection and false otherwise.

The following example uses the different functions on a vector with some cartoon names:

Continue reading →

Practical Protobuf - Introduction

Posted on by  
Peter Steman

As a fan of DDD I sometimes struggle to map the business needs into the current industry standard REST because of its technical nature and entity orientation.
So I went looking for an alternative and found a couple of possible candidates, gRPC+Protobuf, Thrift and Avro.
Of these, it looks like gRPC+Protobuf has the most traction at the moment. It also has a solid future ahead as it is a strategic choice within Google.
So let’s dive in and find out…​.

Continue reading →

Clojure Goodness: Get Clojure Version

Posted on by  
Hubert Klein Ikkink

To get the current Clojure version we must use the clojure-version function. The function simply returns the Clojure version we are using from our code.

In the following example we simply check the result of clojure-version and also define a function to get the Javaa version:

Continue reading →

Clojure Goodness: Splitting Strings

Posted on by  
Hubert Klein Ikkink

In Clojure we can use the clojure.string/split function to split a string, based on a regular expression, into a vector with string values. Optionally we can also specify a limit on the maximum number of returned string values we want. If we want to split a string based on the newline characters we can use the function clojure.string/split-lines that returns a vector where each element is a line from the original multi-line string.

The following example shows several usages of the split and split-lines functions:

Continue reading →

Maintain your local AWS environment with Commandeer

Posted on by  
Thomas de Groot

In my previous blog about Running AWS locally with LocalStack I’ve shown you how to use Localstack, a tool to mock your AWS environment on your local machine. When working with Localstack, I always had to prepare the environment for my application to run. Most of the time this could be done automatically via scripts, but some preparations, for instance editing some data in a S3 bucket, could become a little tricky.

Continue reading →

Clojure Goodness: Get Random Item From A Sequence

Posted on by  
Hubert Klein Ikkink

In Clojure we can use the rand-nth function to get a single random element from a sequence. To get multiple items based on random probability for each item we use the function random-sample. We must set the probability that determines for each item if it is in the result or not.

In the following example code we use rand-nth function:

Continue reading →

shadow-left