Category SysAdmin

Dual boot *Encrypted* Kali 2019 with Windows 10 in peace.

If you work in security and don’t encrypt your drives, maybe you should consider something else ūüėČ

I recently was trying to make peace with Windows 10 co-living with Kali 2019 and it was really painful process. Each time I got one side working the other side was complaining.

Eventually it boils down to this:

1- Install Windows 10 fully (including setting up a user, and password, etc.) Failign to do so will corupt the encrypted partition of kali

2- Install Kali until you reach the step to partition the disk. Choose “Manual”

3- now create 3 partitions:
– one is for /boot (~256mb)
– one for swap area (8-10gb)
– the rest is for the root mount /

4- now go to “Encrypt partition” and click “Yes” for writing the current partitions

5- now choose wherever you have swap and root...

Read More

How to get Snort running under Windows

Getting snort to work under Windows is a pain in the ass, so I wrote a quick guide on how I got it working and shared some config files which will save you hours of work.

All can be accessed under my github page:


Read More

Automation: Block ssh brute force attacks with iptables

1. create an iptables.rules file in /etc/

Read More

automate a safe wordpress update through a cron job

I’m a great believer in automation; as one of my interviewers said to me once: If we do it twice; we automate it.
I adopted this style throughout my work; hence I wanted to show how would I upgrade/update the WordPress core and plugins using cron to keep all my blogs and sites secure and up to date with security patches.

1- get & install wp-cli (how/where)
2- write a script to use wp-cli to update WordPress [see attached code]

Read More

auto login to backtrack and startx in 2017

Wait; did I say BackTrack? Yes Backtrack is still a cool (outdated) distro for hacking!
If for some odd reasons you still need to use BackTrack in 2017 (hello? have you heard of Kali), I won’t judge you.
Maybe you’re doing your OSCE and need an image that is still in the course / labs

This post is meant to save you some time if you haven’t used BackTrack for a while and need to get some things done with it.

1. We want to change the root password

Read More

add HSTS to Apache

We mentioned before how did we switch to SSL since 2017.

I want to add here how to set HSTS to prevent a wellknown SSL attack called SSL-Strip.

  • What is SSL Strip?

You can watch the full talk to understand in details how this works here.
Basically the attacker is somehow (we don’t care how) a MITM setting in between the victim and the authentic server.
The attacker in this case can do a downgrade attack on SSL and transfer all HTTPs connection to the normal plain text HTTP connections.
Now the attack can simply sniff all data being communicated between the victim and the server.
The attacker is also free now to change the data and execute other attacks such as injecting malware into the traffic.

  • What is HSTS

HSTS or HTTP Strict Transport Security allows web servers to declare that web b...

Read More

Open .SDF file without SQL Server Management

As part of any post exploitation in a security auditing or testing engagement you will want to gather as much info as you want about the victim to be able to target your next victim in the chain.

Having said that sometimes you stumble upon strange files, encrypted data, and network traffic that you don’t know what to do with it. One of these was an .sdf file related to hmailserver. The last is an open source mail server, you can read more about it here.

When gaining access to this server you will want to read this file:

A sample output would look something like this:

Read More

Attacking Attackers to Protect a WordPress Website

I have previously demonstrated how to protect wp-admin and wp-login files in word-press website.
I wanted to do more. Something like: Attacking those attackers.

What Crashes Browsers?
What crashes applications is what hackers call: Buffer Overflow Exploit. Hackers use them to take control of applications/browsers to gain full system access later on. More about buffer-overflows here.
We are not interested to take control of the attacker’s system; Although that will be very ‘cool’ – maybe the next stage? ūüėČ
We are more interested to stop them i.e: Crash their browsers, fuzzing and brute-force tools.

Amazingly I was able to reduce attacks from 4000~ to around 70 only!

What is happening behind the scenes?

Read More

Redirecting domains / requests to external domain without changing URL

If you want to mask requests of an external domain using your domain. You can use this two lines into your Apache conf file (under virtual hosts)
Use [P] flag to create a proxy-tunnel from your main domain to the external domain.

Rewrite On
RewriteRule ^(.*) http://domainOrIP/$1 [P]

[P] is for Proxy – hence your proxy modules have to be enabled:
ln -s ../mods-available/proxy* /etc/apache2/mods-enabled/

Also enable slotmem
ln -s ../mods-available/slotmem_* /etc/apache2/mods-enabled/

Restart apache
service apache2 restart

Et Voila!

Read More

Apache Virtualhost to WordPress Permalinks

WordPress Permalinks create RESTful link style like: blog/category/sub-cat/post-title. These are not actual directories in your Apache DirectoryRoot hence you cannot just set a subdomain to point to a WP Permalinks via DocumentRoot /var/www/category/blog/bla/bla/bla.

In my case I was trying to set to point to Many methods failed and the only trick that worked resides in RewriteRules and WordPress URL Parameters.

  1. Set new DNS A record. eg: some-IP-address
  2. Set new VirtualHost in your apache config file as follow:
    <VirtualHost *:80>
    DocumentRoot /var/www/
    RewriteEngine On
    RewriteRule . /var/www/index.php?category_name=[YOUR CATEGORY NAME]
  3. Restart Apache and you’re good...
Read More