Gallery of wannacry ransomware memes that take over Internet after major cyber attack broke over the weekend.
Wannacry ransomware memes
As everyone is aware the Internet world has been hit by ransomware called WannaCry last weekend. It was a nightmare for Wintel admins as their whole weekend was burned into patching windows servers in their environments. Obviously Linux world was pretty quiet since WannaCry targeted Windows operating systems only.
No wonder, the Internet got filled with lots of memes about this cyber attack. I collected a few of them here:
Read & share !
Note: Image credits are links from where I collected that image. The origin/creator of the image might be different.
If you have any meme about wannacry let us know in comments!
Want to have some some fun in Linux? Read on these articles !
Learn how to configure the local APT repository in Debian based Linux systems. Useful article for package management on Linux.
APT repository configuration
APT is package manager that handles Debian packages (.deb). Linux distributions like Ubuntu, Debian uses APT whereas Red Hat, CentOS uses YUM. The package repository is an index of packages that can be used to search, view, install & update packages for Linux In this article, we will be walking through steps to configure the local APT repository.
APT has two types of repositories: complex and simple. We will see a simple repository configuration in this article. For example, we will be keeping two packages in our repository and configure APT to use it. If you know, you can even download packages in .deb format from existing APT repositories! We are keeping our test packages under /usr/mypackages directory. You can choose your own path.
Rest of the process consist of only 3 steps :
Store packages in the designated directory
Scan that directory to create an index
Add index file path to /etc/apt/sources.list
Step 1 :
Store packages in directory (/usr/mypackagesin our case here). I kept below two packages :
# ll /usr/mypackages
total 156
-rw-r--r-- 1 root root 136892 May 17 10:19 python_2.7.11-1_amd64.deb
-rw-r--r-- 1 root root 11064 May 17 10:20 python-tdb_1.3.8-2_amd64.deb
Step 2:
Scan packages directory with command dpkg-scanpackages. This command takes two arguments: first is a directory to scan and the second is override file. For simple repositories, we don’t need an override file so we can use /dev/null as the second argument.
If you get The program 'dpkg-scanpackages' is currently not installed. error then you need to install package dpkg-dev on your server.
# dpkg-scanpackages . /dev/null
Package: python
Source: python-defaults
Version: 2.7.11-1
Architecture: amd64
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Installed-Size: 635
Pre-Depends: python-minimal (= 2.7.11-1)
Depends: python2.7 (>= 2.7.11-1~), libpython-stdlib (= 2.7.11-1)
Suggests: python-doc (= 2.7.11-1), python-tk (>= 2.7.11-1~)
Conflicts: python-central (<< 0.5.5)
Breaks: update-manager-core (<< 0.200.5-2)
Replaces: python-dev (<< 2.6.5-2)
Provides: python-ctypes, python-email, python-importlib, python-profiler, python-wsgiref
Filename: ./python_2.7.11-1_amd64.deb
Size: 136892
MD5sum: af686bd03f39be3f3cd865d38b44f5bf
SHA1: eb433da2ec863602e32bbf5569ea4065bbc11e5c
SHA256: 5173de04244553455a287145e84535f377e20f0e28b3cec5a24c109e3fa3f088
Section: python
Priority: standard
Multi-Arch: allowed
Homepage: http://www.python.org/
Description: interactive high-level object-oriented language (default version)
Python, the high-level, interactive object oriented language,
includes an extensive class library with lots of goodies for
network programming, system administration, sounds and graphics.
.
This package is a dependency package, which depends on Debian's default
Python version (currently v2.7).
Original-Maintainer: Matthias Klose <doko@debian.org>
Package: python-tdb
Source: tdb
Version: 1.3.8-2
Architecture: amd64
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Installed-Size: 50
Depends: libtdb1 (= 1.3.8-2), python (<< 2.8), python (>= 2.7~), python:any (>= 2.7.5-5~), libc6 (>= 2.2.5), libpython2.7 (>= 2.7)
Provides: python2.7-tdb
Filename: ./python-tdb_1.3.8-2_amd64.deb
Size: 11064
MD5sum: 05035155e6baf5700a19fb8308beeca1
SHA1: bd9ec7d2a902e6997651efeaa0842bfb4a782862
SHA256: c53fd7dae63a846cc9583c174e1def248f9def2c4208923704f964068f0a5ea5
Section: python
Priority: optional
Homepage: http://tdb.samba.org/
Description: Python bindings for TDB
This is a simple database API. It is modelled after the structure
of GDBM. TDB features, unlike GDBM, multiple writers support with
appropriate locking and transactions.
.
This package contains the Python bindings.
Original-Maintainer: Debian Samba Maintainers <pkg-samba-maint@lists.alioth.debian.org>
dpkg-scanpackages: warning: Packages in archive but missing from override file:
dpkg-scanpackages: warning: python python-tdb
dpkg-scanpackages: info: Wrote 2 entries to output Packages file.
You can see in above output, dpkg-scanpackages checks all packages list their details on terminal. Since command sends output to stdout we will pipe this output with gunzip to create gz index file.
# dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz
dpkg-scanpackages: warning: Packages in archive but missing from override file:
dpkg-scanpackages: warning: python python-tdb
dpkg-scanpackages: info: Wrote 2 entries to output Packages file.
# ll
-rw-r--r-- 1 root root 1130 May 17 10:27 Packages.gz
Now your index file is ready to be used by APT. You need to let APT know that a new index is created and can be used as a new location to scan packages.
Update the APT configuration file /etc/apt/sources.listwith path of the newly created index file. Add below line :
deb file:/usr/mypackages ./
Thats it! Its done. Run apt update to pickup this new repo.
# apt update
Get:1 file:/usr/mypackages ./ InRelease
Ign:1 file:/usr/mypackages ./ InRelease
Get:2 file:/usr/mypackages ./ Release
Err:2 file:/usr/mypackages ./ Release
File not found - /usr/mypackages/./Release (2: No such file or directory)
Hit:3 http://ap-south-1.ec2.archive.ubuntu.com/ubuntu xenial InRelease
Hit:4 http://ap-south-1.ec2.archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit:5 http://ap-south-1.ec2.archive.ubuntu.com/ubuntu xenial-backports InRelease
Get:6 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
Get:7 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages [265 kB]
Reading package lists... Done
E: The repository 'file:/usr/mypackages ./ Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
You can see in the above output there are security warnings since e haven’t added release files in our directory. We had configured only simple repo hence we just stick with .deb packages and rest files not included.
Learn the difference between hard links and soft links. Also discover what are they, how to create them, and how to identify them on the system.
Differences between hard link and soft link
One of the frequently asked Linux or Unix interview questions is what is the difference between hard links and soft links? In this post, we will touch base: what is the hard link & soft link, main differences between hard and soft link, how to create a soft link and hard link, a table showing the difference between a hard and soft link, and how to identify the hard link and soft link.
Without much of distraction, lets get started :
What is hard link?
A hard link is a mirror copy of a file in the Linux or Unix system. Having said that, the original file and link file both have the same inodes. Since both share the same inode, hard links can not cross file system boundaries i.e. you can not create a hard link of a file residing in another mount point. Whenever you delete hard links, the original file and its other hard links still exist since they are all mirror copies. It just reduces the link count! Hard links have actual file content.
What is soft link?
A soft link is just a link to a file in Linux or Unix system. For understanding, you can visualize soft link as a “desktop shortcuts” in windows. Since its a link, its inode is different from the file it’s linking to. Soft links can cross file systems. You can create soft links across file systems. If you delete the original file all linked soft links fail. Since it will point to a non-existent file.
Differences between hard link and soft link :
Hard link
Soft link
Its mirror copy of original file
Its link to original file
Link and original file have same inode
Links has different inode than original file
Can not cross file systems
Can be created across file systems
Show data even if original file deleted
Fails if original file deleted
Has full content of original file
Its just points to source file hence contains no data of source
It can not link directories
It can link to directory
Saves your inodes in kernel since it shared same inode as source
One inode is occupied hence decreasing available inodes
Takes up storage space since its a mirror copy
Takes almost no storage since it contains only path of source
How to create hard link?
To create a hard link you need to use command ln followed by source (original filename) and then link name. In the below example, we are creating two hard links link1 and link2 to file testdata.
# cat testdata
This is test file with test data!
# ln testdata link1
# ln testdata link2
# ls -li
total 12
3921 -rw-r--r--. 3 root root 50 May 16 01:16 link1
3921 -rw-r--r--. 3 root root 50 May 16 01:16 link2
3921 -rw-r--r--. 3 root root 50 May 16 01:16 testdata
You can see above we used ln command to create hard links. Following which we listed their inodes with -i option of command ls. You can see, both links are having the same inode (3921) as the original file (see the first column). Also, the size of hard links is the same as the original file since they contain the same data as the source file.
Now we will delete the original file and see if we can still have data of it from link files.
# rm testdata
rm: remove regular file `testdata'? y
# ls -li
total 8
3921 -rw-r--r--. 2 root root 50 May 16 01:16 link1
3921 -rw-r--r--. 2 root root 50 May 16 01:16 link2
# cat link1
This is test file with test data!
Yes. Data still can be fetched from hard links even after deleting the original file since those are mirror copies!
How to create soft link?
For creating soft links, the same ln command can be used but need to specify -s option (soft link). The rest of the command format remains the same.
# ln -s testdata link1
# ln -s testdata link2
# ls -li
total 4
3921 lrwxrwxrwx. 1 root root 8 May 16 01:26 link1 -> testdata
3925 lrwxrwxrwx. 1 root root 8 May 16 01:26 link2 -> testdata
3923 -rw-r--r--. 1 root root 34 May 16 01:25 testdata
In the above example, after creating soft links if you observe inode numbers of soft links are different from the original file. Also, link size is pretty small since they have only path details of the source, not data. Another observation is soft links shows which file they are pointing to in ls output at last column which was not the case in hard links.
Now, we will delete original file and try to access links.
# cat link2
This is test file with test data!
# rm -f testdata
# cat link2
cat: link2: No such file or directory
You can see in the above output, previously we can use link2 properly. After deleting the original file, links are broken and throwing errors when we try to access them!
How to identify hard link and soft link?
From the above examples, you can figure out soft links are easy to identify. Soft links are marked as link files lxxxxxxxxx in special file bit (first column of ll output). They are even displaying pointers and source file names in the last column ofll output (link1 -> testdata).
Hard links are not that pretty straight forward to identify. You need to use inode option -i inls command and then you need to check for duplicate inodes. This is a manual method. You can even use find command with -same file option. It will then scan inodes and list files with the same inodes (i.e. hard links!)
# find /path -xdev -samefile testdata
The above command will scan /path directory and will list all files having the same inode as testdata file. Which means it will list all hard links to testdata file!
Small AWS CSA Associate exam preparation guide to help you get ready for the certification exam. Get confident with the list of test quizzes listed here.
AWS CSA Associate exam preparation guide
Note: SAA-C01 is retiring now and being replaced with SAA-C02.
Recently I cleared the Amazon Web Services Certified Solutions Architect Associate-level exam and I was bombarded with many questions like How to prepare for the AWS CSA exam? Which book to refer to preparing AWS CSA certification? How to study for AWS CSA? Which online resources available for the certified solutions architect exam? So I thought of summing all this up in a small post which can be useful for AWS CSA aspirants.
Remember this post is compiled from my own experience and should not be taken as the final benchmark for taking the certification exams. This post is mainly aimed to help you gaining confidence in taking examination once you are through your syllabus and hands-on experience.
AWS has three streams where you can pursue your cloud career.
All these three streams have an associate-level (primary or base) level certification. Later professional (higher level) certification is available for solution architect only. Developer and SysOps get merged into single AWS certified DevOps Engineer professional certification.
So, we are talking here about the Amazon Web Services Certified Solutions Architect Associate level exam! Obviously you should be well versed with AWS and requirements stated by Amazon on exam link. Let’s have some examination details :
AWS CSA Exam details :
Total number of questions: 60-65
Duration: 130 minutes
Cost : $150
Type: Multiple choice questions
Can be retaken after 7 days of cooldown period if failed in the first attempt
Below is a list of AWS quiz which I gathered from the web which can help you to put your cloud knowledge to test and gain the confidence to get ready for the exam.
AWS Training practice tests $20. It’s free if you are AWS certified. You can get a voucher from your certification benefits section on the AWS certification portal.
Quick revision on topics AWS SWF, Beanstalk, EMR, Cloudfomation before appearing AWS Certified Solutions Architect – Associate exam.
This article notes down a few important points about AWS (Amazon Web Services) SWF, Beanstalk, EMR, Cloudfomation. This can be helpful in last-minute revision before appearing for the AWS Certified Solutions Architect – Associate level certification exam.
This is forth part of AWS CSA revision series. Rest of the series listed below :
In this article we are checking out key points about SWF (Simple Work Flow), Beanstalk (App deployment Service), EMR (Elastic MAp Reduce), Cloudfomation (Infrastructure as code).
Quick revision on topics AWS CloudFront, SNS, SQS before appearing AWS Certified Solutions Architect – Associate exam.
CloudFront, SNS, SQS revision!
This article notes down a few important points about AWS (Amazon Web Services) CloudFront, SNS, and SQS. This can be helpful in last-minute revision before appearing for the AWS Certified Solutions Architect – Associate level certification exam.
This is third part of AWS CSA revision series. Rest of the series listed below :
In this article, we are checking out key points about CloudFront(CDN Content Delivery Network), SNS (Simple Notification Service), and SQS (Simple Queue Service).
Origin can be S3 bucket or CNAME of Elastic Load Balancer ELB
S3 bucket as the origin. URL will be bucket_name.s3-reagion.cloudfront.net
Private content sharing with signed URL with an expiration time limit
To serve a new object version, create a new distribution, or create invalidation of the old objects. Since invalidation costs, creating new distribution always helps.
Limits :
1,00,000 Requests per second per distribution
200 distributions per account
40Gbps speed per distribution
25 origins per distribution
20 GB max file size to serve
By default, object expiration is 24 hours. The minimum TTL is 0.
Amazon SNS
The latest addition to SNS is Lambda
SNS has two clients: Publishers and subscribers
Publishers communicate with subscribers by sending messages to the topic.
Protocol supported :
HTTP
HTTPS
SMS
email
email-JSON
Amazon SQS
AWS Lambda
SNS Topic of the same name can be created after 30-60 seconds the previous topic deleted.
Amazon SQS
The default visibility timeout is 30 secs. The maximum is 12 hours.
Mainly used to decouple your application
The default period message stays in queue is 4 days. Min-Max periods are 1 min to 2 weeks.
The maximum SQS message size is 256KB.
Supports an unlimited number of queues and unlimited messages per queue.
Different ways to find the MAC address of LAN card in HPUX. Learn how to use lanscan, lanadmin, print_manifest, SAM to check MAC.
MAC addresses also known as station addresses can be found physically on LAN cards which are mostly PCI cards on your HP server. Obviously being hardware, it’s not always feasible to open up just to get MAC address! Another way is to get these details from the OS command. You can use lanscan,lanadmin, sam, print_manifest command to get the MAC address of the LAN card in HPUX.
First, you need to get a LAN number on which your expected IP is configured. You can use netstat -nvr to check all IP configured on the system and their respective LAN number.
Look at the interface column to get lanX number. For example, we will try to get the MAC of lan1 interface.
lanscan command
lanscan command without any argument will give you station address i.e. MAC addresses of all available LAN on the system.
# /usr/sbin/lanscan
Hardware Station Crd Hdw Net-Interface NM MAC HP-DLPI DLPI
Path Address In# State NamePPA ID Type Support Mjr#
0/1/2/0 0x001A3B08C4A0 0 UP lan0 snap0 1 ETHER Yes 119
0/1/2/1 0x001A3B08C4A1 1 UP lan1 snap1 2 ETHER Yes 119
Look station address and column and check the value against lan1! lan1 has MAC of 0x001A3B08C4A1.
lanadmin command
This is not straight forward as lanscan command. After issuing lanadmin command you will be presented with lanadmin console prompt where you can use lanadmin commands. Example below.
# /usr/sbin/lanadmin
LOCAL AREA NETWORK ONLINE ADMINISTRATION, Version 1.0
Mon, Apr 17,2017 18:10:09
Copyright 1994 Hewlett Packard Company.
All rights are reserved.
Test Selection mode.
lan = LAN Interface Administration
menu = Display this menu
quit = Terminate the Administration
terse = Do not display command menu
verbose = Display command menu
Enter command: lan
Here type command lan. You will be greeted with the LAN interface mode prompt like below.
LAN Interface test mode. LAN Interface PPA Number = 0
clear = Clear statistics registers
display = Display LAN Interface status and statistics registers
end = End LAN Interface Administration, return to Test Selection
menu = Display this menu
ppa = PPA Number of the LAN Interface
quit = Terminate the Administration, return to shell
reset = Reset LAN Interface to execute its selftest
specific = Go to Driver specific menu
Enter command: ppa
Enter command ppa and change your number to 1 since we are checking lan1 in our example. Default is set to lan0
Enter command: ppa
Enter PPA Number. Currently 0: 1
LAN Interface test mode. LAN Interface PPA Number = 1
Once LAN interface PPA changed to 1 hit command display and you will be shown all details of that lan card including station address!
Enter command: display
LAN INTERFACE STATUS DISPLAY
Mon, Apr 17,2017 18:10:26
PPA Number = 1
Description = lan1 HP PCI-X 1000Base-T Release PHNE_36237 B.11.11.15
Type (value) = ethernet-csmacd(6)
MTU Size = 1500
Speed = 1000000000
Station Address = 0x1a3b08c4a1
Administration Status (value) = up(1)
Operation Status (value) = up(1)
Last Change = 185
Inbound Octets = 1362884960
Inbound Unicast Packets = 1309204600
----- output clipped -----
Here you can pad two zeros in from of station address to make it perfect 12 alphanumeric MAC. Means 1a3b08c4a1 becomes 001a3b08c4a1.
Using SAM
You can even use SAM (text based GUI tool) to get these details. Go to,
SAM -> Networking and communications -> Network Interface Cards
Select your lan (in our case lan1) using a space bar (it will be highlighted). Then choose Actions from the menu bar to get details.
Using print_manifest
If you have Ignite installed on the server then you can try print_manifest command to get all system details. Those details also include MAC of all lan cards. The only issue is your LAN PPA number won’t be available here in output to match MAC with lan id.
Quick revision on topics AWS VPC, Route53, IAM before appearing AWS Certified Solutions Architect – Associate exam.
VPC, Route53, IAM revision!
This article notes down a few important points about AWS (Amazon Web Services) VPC, Route53, and IAM. This can be helpful in last-minute revision before appearing for the AWS Certified Solutions Architect – Associate level certification exam.
This is the second part of the AWS CSA revision series. Rest of the series listed below :
NACL (Network Access Control List) controls traffic security at the subnet level
Security groups control traffic security at the instance level
NACL is stateless (i.e. all traffic need to exclusively allow) while Security groups are stateful (i.e. response traffic is automatically allowed)
Only 1 Internet gateway per VPC is allowed.
VPC peering can be done between two AWS accounts or other VPS within the same region.
VPC peering is a direct network route between two VPC enabling sharing resources in different subnets.
Limits :
5 VPC per region
50 customer gateways per region
200 route table per region
50 entries per route table
5 elastic IP
5 security group per network interface
500 security groups per VPC
50 rules per security group
First 4 and last 1 IP of each subnet is reserved by AWS as below :
x.x.x.0: Network IP
x.x.x.1 : VPC router IP
x.x.x.2: For VPC DNS
x.x.x.3: For future use
x.x.x.255: Broadcast IP
Route 53
Can register domain, act as DNS, Check health of resources.
Port 53 used to serve request by DNS hence the name route 53!
Primarily TCP used to serve DNS request but if the response is more than 512 bytes it will use TCP.
Currently supported records :
A (address record)
AAAA (IPv6 address record)
CNAME (canonical name record)
MX (mail exchange record)
NAPTR (name authority pointer record)
NS (name server record)
PTR (pointer record)
SOA (start of authority record)
SPF (sender policy framework)
SRV (service locator)
TXT (text record)
Routing policies :
Simple routing: Single resource serving traffic
Weighted routing: Divert proportion wise traffic to multiple resources
Latency routing: Returns result with the lowest latency to requestor origin
Failover routing: Active-passive. One resource takes traffic when the other one is failed
Geolocation routing: Returns DNS queries based on the geolocation of the user
Limits :
500 hosted zones per AWS account
50 domains per AWS account
Ideal TTL values for CNAME to the existing domain are 24 hours and CNAM to S3 or ELB is 1 hour.
There is no default TTL for any record type in Route 53. You have to specify TTL for your records.
Weights can be assigned as integer 0 to 255. 0 means no weight i.e. don’t route to that record. The probability of routing to be done to a particular record equals to the weight of that record/Sum of all record weights.
IAM (Identity and Access Management)
Never use the root account for login. Create an admin user and use it for administrative tasks
Created users, groups and roles are global and available across all regions in the same AWS account
Prebuilt policy for :
Administrator – All access
Power-user – Everything administrator has except IAM management access
Read-only – Only view access (accounting purpose)
By default, the newly created user has normal deny on all AWS resources. Explicit allow will override normal deny.
Cross account roles can be defined. It assumes access of other users granted to another user.
The public key can be viewed in the account settings anytime. The private key visible only at the time of creation. If lost can not be retrieved and need to create fresh key pair to use.
Quick revision on topics AWS EC2, S3, RDS before appearing AWS Certified Solutions Architect – Associate exam.
EC2, S3, RDS revision!
This article notes down a few important points about AWS (Amazon Web Services) EC2, S3, and RDS. This can be helpful in last-minute revision before appearing for the AWS Certified Solutions Architect – Associate level certification exam.
This is first part of AWS CSA revision series. Rest of the series listed below :
List of all online Linux yum or apt package repositories, mirrors, download sites. Updated continuously whenever a new link is discovered
List of online resources for linux packages
This article aimed at listing all available mirrors, repositories, package download sites for Linux distros. Let us know broken/new links in comments and we will update this post accordingly.