Apr 22, 2022

Cloud Security for Beginners

A series of webinar that talk about cloud security.






Part 3:

  • What a typical attack would look like and where to look for evidence of compromise
  • How to put into place security controls to prevent the attack
  • Where we can focus our efforts to increase the security of our cloud environment


Apr 21, 2022

Drop-in Replacement For Nmap

Smap - a drop-in replacement for NMAP that powered by Shodan. It is a replica of Nmap which uses shodan.io's free API for port scanning. It takes similar cmdline arguments as Nmap and produces the same output which makes it a drop-in replacement for Nmap.

Smap is super fast since it simple fetches existent port data from shodan.io. It can be used as:

  • a super fast port scanner (200 hosts per second)
  • vulnerability detection (services/version fingerprinting)
  • reconnaissance on most common ports (limited to top 1237) 
  • connection-less or passive-scan to the target

 

 Most important is, it doesn't require any account/api key.


Links:

  • https://github.com/s0md3v/Smap
  • https://www.kitploit.com/2022/04/smap-drop-in-replacement-for-nmap.html


Print Colors And Formatted Text in Terminal

This is my note on how to print formatted text and colors in terminal using Python. There are several methods to output colored text to terminal.

Terminal can be so plain. And formatted text (aka styled text or rich text) can be used as opposed to plan text, has styling info like:

  • color (text and background)
  • style (bold and italic)
  • others (strike-through, underline)

 

1. Using ANSI Escape Codes

ANSI escape codes are used to control the formatting and color in Linux terminal. To encode this formatting info, certain sequences of bytes are embedded into the text, which the terminal looks for and interprets as commands and executes them.

print('\x1b[3;31;43m' + 'Hello world!' + '\x1b[0m')

The python statement above will produce the output in "red" text-color, with "yellow" background, and "italic" style.

The general syntax is \x1b[A;B;C   and the first ANSI escape code used is  \x1b[3;31;43m  . The second ANSI escape code used is \x1b[0m , and this is the code used to reset the color/style to defaults values. 

A is for text formatting style, ranges from 1 to 9.

  • 1 : bold
  • 2 : faint
  • 3 : italic
  • 4 : underline
  • 5 : blinking
  • 6 : fast blinking
  • 7 : reverse
  • 8 : hide
  • 9 : strikethrough

B is for text color, ranges from 30 t0 37.

C is for background color, ranges from 40 to 47.

  • 30/40 : black
  • 31/41 : red
  • 32/42 : green
  • 33/43 : yellow
  • 34/44 : blue
  • 35/45 : magenta
  • 36/46 : cyan
  • 37/47 : white


2. Using built-in modules : colorama, termcolor

Example of using colorama

from colorama import init, Fore, Back, Style

init (autoreset=True, strip=False)

print(Fore.RED + + Back.GREEN + Style.DIM + f'Red text on Green in dim')

print(f'Normal')

 

Example of using termcolor

>>> from termcolor import colored
>>> print(colored('Hello, World!', 'green', 'on_red'))

A more complex example:

# Python program to print
# colored text and background
import sys
from termcolor import colored, cprint

text = colored('Hello, World!', 'red', attrs=['reverse', 'blink'])
print(text)
cprint('Hello, World!', 'green', 'on_red')

print_red_on_cyan = lambda x: cprint(x, 'red', 'on_cyan')
print_red_on_cyan('Hello, World!')
print_red_on_cyan('Hello, Universe!')

for i in range(10):
    cprint(i, 'magenta', end=' ')

cprint("Attention!", 'red', attrs=['bold'], file=sys.stderr)


Links

  • https://www.geeksforgeeks.org/print-colors-python-terminal/
  • https://www.geeksforgeeks.org/formatted-text-linux-terminal-using-python/


Apr 16, 2022

Getting Started ith OpenSCAP

The Security Content Automation Protocol (SCAP) enables automated vulnerability scanning , measurement and policy compliance evaluation of systems based on a method of using specific standards (managed by NIST). 

It was created to provide a standardized approach to maintain the security of enterprise systems, such as automatically verifying the presence of patches, checking system security configuration settings, and examining systems for signs of compromise.

OpenSCAP is a free implementation of SCAP. The SCAP Security Guide along with SCAP components can be utilized in order to automate continuous security management within an organization.

Almost every OS vendor, including RedHat, Ubuntu, and Oracle, supports SCAP to get an overview of which security vulnerabilities are on your system using OpenSCAP. And every OS vendor will provide OVAL, Open Vulnerability and Assessment Language XML file which cab be used in combination with OpenSCAP to get a quick overview of a system.

The following is a step by step guide of how to produce a report in an Ubuntu OS based on Ubuntu OVAL.

Download and install OpenCAP for Ubuntu:

$ sudo apt install libopenscap8


Verify the oscap tool

$ oscap -V

Download Ubuntu OVAL:

$ wget https://security-metadata.canonical.com/oval/com.ubuntu.$(lsb_release -cs).usn.oval.xml.bz2

Uncompress the data:

$ bunzip2 com.ubuntu.$(lsb_release -cs).usn.oval.xml.bz2

Check the integrity of the OVAL XML:

$ oscap info com.ubuntu.$(lsb_release -cs).usn.oval.xml

Use OpenSCAP to evaluate OVAL against localhost and generate an HTML report:

$ oscap oval eval --report report.html com.ubuntu.$(lsb_release -cs).usn.oval.xml

Lastly, open the report.html with any borwser.

 

report.html



Links:

Apr 15, 2022

6 CVE Updates for Dell Products

Today, 6 updates to Dell products including:

  • CPE changed
  • CVSS changed
  • CWE changed
  • References changed
  • Vendors/Products appeared for the first time

 

6 CVE