Log4Shell Quick Lab Setup for Testing

Last month, On December 09 2021, The release of a Remote Code Execution POC over twitter involving exploitation of Apache’s log4j2 logging class took everyone’s peace away. The attack was pretty simple and the fact that it can be easily exploited by anyone is what made this more terrifying. The first edition of this attack

Advertisements
Advertisements
Advertisements

Swapping every two bits in byte Java Solution

In the Swapping of two bits in byte in java, the output should look like something below: Swap all the pair of bits in a byte. Before swapping: 11-10-11-01 After swapping: 11-01-11-10 The code is written and tested in Netbeans. Code: import java.util.Arrays; import java.util.Scanner; public class bitbyte { public static void main (String[] args)

Advertisements
Convert decimal to binary in java

Converting Decimal to Binary in Java

The below code will convert decimal number in binary format [bits] in java. I have taken a byte as an array, i.e. 8. You can take more depending on your needs. The input for the current program is a with the value 48. You can take the input through scanner too. Code: public class bitbyte

Advertisements
%d bloggers like this: