Saturday, April 8, 2023

Anti-Money Laundering and Terrorism Financing

Money Laundering Definition

It’s a process used by criminals to convert dirty money into clean money. Dirty money is any money which is generated from illegal activity such as selling drugs, financial crimes, or any other form of crimes.

The 3 Stages of Money Laundering

The money which is generated from illegal activities cannot be deposited into bank that easily since the bank will ask for supporting documents that show from where this money was generated. Suppose that someone generated one million dollars by selling drugs. For this money to be legal, it goes through 3 stages, Placement, Layering and Integration.

Placement Stage

At this stage, the person who generated money from illegal activity will try to deposit the illegal money into a bank account by using a legal business as front. That business may not even exist. For example, he might pretend to own a restaurant, and the restaurant generates $50000 a month. In this situation, the criminal will attach all invoices as evidence to deposit $50000 into the bank.

Layering Stage

In this stage, the illegal money is distributed to multiple other accounts. The reason for this is to make it difficult for authorities to track original source of money.

Integration Stage

At this stage, the illegal money is transferred again to one account that the person will use to buy a legal entity such as a car or real estate. Then he will sell this entity and deposit the generated money to this account again. At this stage, the money is considered legal.

Importance of Knowing Our Customer

We need to be aware that a customer or a supplier is using us as a front-end for money laundering. If the customer is caught doing illegal activities and you are doing business with him, you will be held accountable and considered as participant in money laundering activity.

Importance of Customer Due Diligence

Customer Due Diligence (CDD) is one of the activities that is taken by the organization to obtain as much as information about any third party the organization work with, to help their money laundering risks and money laundering exposure.

This implies that an organization must have procedures to:

  • Customer Identification
  • Customer Acceptance
  • Risk Rating
  • Monitoring
  • Documentation

Money Laundering Vs Terrorist Financing

The two are usually mixed with each other since both have many similarities. The main difference between the two is that in Terrorist Financing, the end beneficiary is not the same as the person who generated the illegal money.

Tuesday, March 22, 2022

Content Sniffing in Web Development

While I was testing a software, I needed to refresh JavaScript files based on branch on GitHub. What I did is to include the raw data of the file using raw.gethubcontent.com.

What I noticed is that the console started to display the error which reads :

The resource from “https://raw.githubusercontent.com/usernane/AJAXRequestJs/master/AJAXRequest.js” was blocked due to MIME type (“text/plain”) mismatch (X-Content-Type-Options: nosniff).

What does this error means and why it appeared? After doing a small research, I learned about new concept which is called "Content Sniffing"

In a nutshell, content sniffing happens when a web browser change the content type of server response to a content type that it think is correct. For example, a server might send a JavaScript file with content type "text/plain". In this case, the browser will change content type to "text/JavaScript" because the file smells like JavaScript and make it executable. This can lead to security issues if the file is user generated and can lead to attacks such as .

To make sure that the browser does not change content type based on its smell, the server can send http header. The header has the name "". The error that was appearing in the console was caused by this header. GitHub server always sends this header whenever someone tries to get files using raw.githubcontent.com.

To resolve my issue, I reverted back to jsDeliver. The CDN actually has a nice feature that I just got to know. It is possible to get files using commit hash. Instead of using a branch name or tag after the @, simply add the hash of the commit.

Friday, January 28, 2022

How to Change Document Root in WHM and cPanel for Specific Website

First, create a directory in your home directory. Give it the name 'backup'. Secondly, open the terminal in WHM. Then run the following command:

cp /var/cpanel/userdata/USERNAME/* /home/backup

Replace 'USERNAME' with the username of cPanel user that you would like to change its document root. The compand will simply copy all files in the directory "/var/cpanel/userdata/USERNAME" to the directory "/home/backup". The directory "/var/cpanel/userdata/USERNAME" contains configuration files for domains.

Suppose that the domain that you want to change its document root is 'example.com'. In this case, you need to open the file 'example.com' and 'example.com_SSL and edit document root using vim.

Finally, you need to run the following commands to restart apache:

/scripts/updateuserdatacache
/scripts/updateuserdomains
cp /etc/apache2/conf/httpd.conf{,.bak-`date +%Y%m%d`}
/scripts/rebuildhttpdconf
/scripts/restartsrv_httpd
For more information, check here

Wednesday, August 11, 2021

WebFiori Framework Tutorials - 8 - Including External Resource File

In this video, we learn how to include external resource file such as JavaScript file or a CSS file in web pages by using some of the utility methods which are provided by the class 'WebPage'.

Wednesday, August 4, 2021

WebFiori Framework Tutorials - 7 - Building User Interface

In this video, we start by talking about a very important class which is used in building web pages. The class has the name 'HTMLNode'.

Tuesday, July 27, 2021

WebFiori Framework Tutorials - 6 - The Class 'AppConfig'

In this video, we talk about the class which holds basic application configuration. The class called 'AppConfig' and it exist in the root of your application folder.

Thursday, July 22, 2021

WebFiori Framework Tutorials - 5 - Web Pages

In this video, we will learn about new concept in WebFiori framework which is how to represents web pages in the framework. Official website: https://webfiori.com Web pages docs: https://webfiori.com/learn/web-pages

Sunday, July 18, 2021

WebFiori Framework Tutorials - 4 - Route Parameters

This video introduces new concept which is related to routing. The concept is called 'Route Parameters'. A parameter in a route is a string that acts as a placeholder for a value which will be passed in the URI. It is used to create generic routes. More about this feature can be found at: https://webfiori.com/learn/routing#route-parameters

Tuesday, July 13, 2021

WebFiori Framework Tutorials - 3 - More About Routing

In the previuse video, the concept of routing was inroduced. In this video, we look at routing in more details.

Thursday, January 14, 2021

WebFiori Framework Version 2.0.0

Hello everyone. Today is a big day for me. The reason for that is version 2.0.0 of WebFiori Framework was just released.

This release is considered as a major release since it is a whole refactor of version 1.0 of the framework. For more information about this release, you can check GitHub Repo of the project.

If you don't know what is WebFiori framework, it is a web development framework which was built in top of PHP language. The framework makes it easy for web developers to build simple web applications. For more information about the project, chech this page: https://webfiori.com/learn/introduction

Tuesday, December 8, 2020

Apache NetBeans IDE Setup for PHP Development #4

The forth video on a set of videos that explains how to setup Apache NetBeans IDE for PHP development.

Sunday, December 6, 2020

Apache NetBeans IDE Setup for PHP Development #3

The third video on a set of videos that explains how to setup Apache NetBeans IDE for PHP development.

Saturday, December 5, 2020

Apache NetBeans IDE Setup for PHP Development #2

The second video on a set of videos that explains how to setup Apache NetBeans IDE for PHP development.

Apache NetBeans IDE Setup for PHP Development #1

The first video on a set of videos that explains how to setup Apache NetBeans IDE for PHP development.

Tuesday, November 17, 2020

WebFiori Framework: Latest News

It's been long time since I posted any news regarding WebFiori framework but I was actively working on improving it. This will summarize what happened during the last few months.

The focus points where writing documentation of the framework in addition to the release of first beta of version 2. Also, I create an organization that holds any repo which relates to WebFiori framework. The organization can be found at https://github.com/WebFiori

Documentation Website

Now the framework has a written documentation that covers most of the features. The documentation can be accessed through the following link: https://webfiori.com/learn . The actual documentation is hosted in the following repo: https://github.com/WebFiori/docs . Note that it is still under development and more content is added regularly.

Version 2.0.0 beta.1

The first beta of version 2 was just released. This version includes many changes which makes it much better than v1.x.x. You can get the latest version from the following link: https://github.com/WebFiori/framework/releases

The biggest changes are:

  • Moved all core framework files to new namespace.
  • A public folder is added which is used as entry point for all requests.
  • Added support for composer.
  • Added the folder 'app' which should hold any code at which the developer will write for his web application.
  • All standard libraries where updated.
  • Slightly improved routing speed by removing unnecessary initialization steps.

The current plan is to release the stable v2.0.0 by the beginning of the new year.

I would like to thank anyone who helped me in the development process by providing helpful suggestions.

Monday, November 16, 2020

Mystery Skulls Animated - The Future, Finally its out

Finally its out. The animation looks amazing and the story is getting more intersting. The music on the video adds extra hype to the video.

Friday, July 3, 2020

How to Embed an Image In HTML Page Using PHP

Sometimes, you might want to get a self-contaned HTML page that does not have to send a request to fetch an image from your server. This also can be helpful if you want to send HTML emails. To embed an image, first we have to read the image file and then encode it in base 64 and then add to to our HTML. The following code sample shows how to do it.
$file = 'path/to/my/file/image.jpg';
$rawData = file_get_contents($file);
$encoded = base64_encode($rawData);
echo '<img src="data:image/jpg;base64,'.$encoded.'" >';

Monday, June 29, 2020

How to Read a File In PHP

There are two ways to read whole content of a file in PHP language. First way is to use the function fread() with the function filesize(). The second way is to use the function file_get_content().

Examples

The following code shows how to use the first method.
$path = "C:\Users\XUser\documents\my-file.txt";
$stream = fopen($path, 'r');
$wholeContent = fread($stream, filesize($path));
fclose($stream);

The following code shows how to use the first method.
$path = "C:\Users\XUser\documents\my-file.txt";
$stream = file_get_content($path);

As for me, I recomend the second way over the first one. Because in some cases, I have seen that the first way does not read the whole file. In addition, it is easier to understand than the first one