Wednesday, July 6, 2022

Cisco AnyConnect installation on Archlinux

 "You are missing the required libraries for the authentication method you requested"

Some desktop environments do not come with the webkitgtk library the Cisco AnyConnect client uses to to generate the ONID sign in window. For debian based distributions the required library can be installed by running the following commands from terminal:

sudo pacman -S webkit2gtk

Friday, June 24, 2022

Switch from KMS to OEM

 To convert, do the following: 


• Press Windows Key + R 
• Type cmd in the run command line and press CTRL + SHIFT + ENTER to gain administrative access 
• Type: slmgr.vbs -ipk <enter your 25 digit Windows 10 RETAIL product key here> and press enter 
example: slmgr.vbs -ipk 12345ABCDE12345ABCD12345 
• Then type: slmgr.vbs -ato 

If you have no 25-digit Windows 10 Retail Key and the PC was purchased with pre-installed OEM license, you need to use the following Generic Key: 

YTMG3-N6DKC-DKB77-7M9GH-8HVX7 – If your had had Home version even if you upgraded to Pro through Windows Store 

VK7JG-NPHTM-C97JM-9MPGT-3V66T – If you had Pro. PC was purchased as Pro not upgraded from Home 

BT79Q-G7N6G-PGBYW-4YWX6-6F4BT – If you had a Single Language edition 

These Generic keys will just convert KMS to OEM but will not activate Windows. To activate, you need to go through the digital activation after the conversion by signing in with the Microsoft Account where your Digital Key is associated. To do that, go to Settings > Update & Security > Activation > Add an account 

* Note: If the activation says "Windows is activated with a digital license lined to your Microsoft Account", no need to do anything. 

Friday, June 17, 2022

MacBook Pro and Raspberry Pi4

This tutorial showing how to connect Raspberry Pi4 to MacBook Pro via USB-C (used to power the Pi) and share internet from MacBook to the Pi. Works for Debian and Kali linux images.

-  Image Kali/Debian to Raspberry Pi

- Edit file /boot/config.txt, add

[all]

dtoverlay=dwc2,dr_mode=peripheral

- Edit file /boot/cmdline.txt

console=serial0,115200 console=tty1 root=PARTUUID=ef15daca-02 rootfstype=ext4 fsck.repair=yes modules-load=dwc2,g_ether rootwait

- Create usb0 interface at /etc/network/interfaces.d/usb0

auto usb0

    allow-hotplug usb0

    iface usb0 inet dhcp

On MacBook, open System Preferences 



Thursday, June 16, 2022

Kali Linux In a Docker Container

 Update: this post has been updated and works as of June 2020 (official Offensive Security image names have changed).

Background

Wednesday, February 5, 2020

Complex Data Types in Python: Shallow & Deep Copies in Python

Complex Data Types in Python: Shallow & Deep Copies in Python


Learn about copying operations on containers in Python. You will learn the subtle distinction between shallow and deep copies. Changes made to shallow copies affect the original whereas with deep copies do not.

Table of Contents

  1. Course Overview
  2. Copying Strings
  3. Performing Shallow Copies of Lists
  4. Performing Deep Copies of Lists
  5. Creating Shallow and Deep Copies of Tuples
  6. Creating Shallow Copies of Dictionaries
  7. Creating Deep Copies of Dictionaries
  8. Creating Shallow and Deep Copies of Sets
  9. Exercise: Shallow and Deep Copies

Shallow and Deep Copies

- A shallow copy are made when two variables with different variable names point to the same location in memory.
- Updates that you make using one variable are reflected when accessing the same data using the other variable.
- The same complex data type has just two names with shallow copies.
- Deep copies are made when the same data is copied over to an entirely new memory location.
- Changes made to the deep copy are not reflected in the original memory.

String Copy

- String are immutable in Python
- Once created, strings cannot be updated
- Using assignment operations with strings reference the same location in memory
- But that location cannot be changed
- Assigning a new string value to a variable just creates a new string

list_b=list_a (Shallow Copy)

list_b=list_a[:] (Deep Copy)

list_b=copy.copy(list_a) (Deep Copy of the outer list but shallow copies of nay complex data types)

list_b=copy.deepcopy(list_a) (Deep Copy of the outer list and all of the nested data types)