How to hide or encrypt the config.php or webconfig or database? I think the best way for hiding all is to put the database on other host and source code website on the other host
But how to encrypt config file and database. If someone get all source code and database of website but they can't setup again?
If someone log in server by ssh protocol with administrator privilege, how can they remove all log files on unix or linux server. If one can't get root on the server, they can't remove all log file.  How can somebody take over root privilege or edit chmod?
Except hashcat tool, what is the best to for check password encryption type?

If someone get all source code and database of website but they can't
  setup again?

The closest you can do is obfuscate the way how to get to the data.  Languages like PHP have an obfuscation with products such as ZendGuard.  This prevents a user to figure out the logic of an application easily.  This is similar to running closed source products, it's possible to figure out the execution flow, it will just take more effort.

If you encrypt something, your app still need to have a way to decrypt that data, such as a key.  You could try to load this data upon bootup into memory, so they (the attackers) can't read it form a file, but it will live in the ENV, which is accessible too.

  If one can't get root on the server, they can't remove all log file. How can somebody take over root privilege or edit chmod?

Usually by guessing local credentials or a local privilege escalation exploit.

  Except hashcat tool, what is the best to for check password encryption type?

Not sure what you mean with "password encryption type", any password cracker (like JohnTheRipper) will do an initial round to determine what hashing algorithm is used.


How does DRM enforcement work (across different platforms)? I would like to know how Android, Windows, Linux, and OS X deal with DRM (Digital Rights Management) e-pub, pdf, and mp3 files. Basically, if I download a DRM file to my device (perhaps one that has an expiry date or forbids copying of the file), can't anyone write a custom (despite illegal in most countries, or perhaps even one for personal use written by a coder who knows enough about DRM)  program to ignore the DRM portions of the file and turn it into a regular non-DRM file?

As long as any program capable of reading the DRM protected file is working on your computer, experts can analyze it and write a program that circumvents DRM for that file for an indefinite amount of time.

There are DRM systems in which the key to decrypt the content is calculated just-in-time by a server. If you didn't save the key before expiration, you likely can't access this file with any software after expiration.


2-way SSL - is it possible to accept multiple client certs on one IIS site? A client has asked us to build an API which requires two-way SSL.  Will we be able to expose that same API to other clients with different certificates?  Or will we have to set up a different endpoint for each different client certificate?

We'll be hosting it in IIS, and both parties will be using proper CAs (I mean like Thawte, not self-signed).

You can surely do this with open source. So I think it is possible with IIS as well. Assuming you mean ** TLS Client Authentication** (2-way SSL).

With Apache2 Client Authentication works by exposing the authenticated user's data to your web application. Here is a sample app I put together to demo TLS Client Authentication. Here are the relevant pieces.

Config to use TLS Client Auth (this works w/ a single root, but you can also use multiple CAs by specifying SSLCACertificatePath instead of SSLCACertificateFile):

<VirtualHost *:443>
    ...
        SSLVerifyClient optional
        SSLVerifyDepth 1
        SSLCACertificateFile "/etc/ssl/private/ca.crt"
        SSLOptions +StdEnvVars
    ...

</VirtualHost>

The SSLOptions +StdEnvVars exposes the client certificate's data as an environment variable to your PHP script. You can then access it like so.

<?php
  echo $_SERVER['SSL_CLIENT_S_DN'];
  echo $_SERVER['SSL_CLIENT_S_DN_CN'];
?>

This way you can verify which client is authenticating in your web application. I am not familiar with how IIS handles these cases, but I think it is supported in some way. The key is to have it configured in a way to use multiple CAs when authenticating the clients. This post should help.

Alternatively, you can check out other authentication methods that provide a similar level of protection that TLS Client Certificates do.


What day-to-day activities can compromise a person's information security Recently a car was stopped next to me at the traffic lights.  The driver had his phone connected to the car's bluetooth and the conversation could be heard by me crystal clear in the next car - the guy was talking about something to do with money and his business and I assume was completely oblivious to the fact anybody within a 10ft radius of the car could hear his conversation - of course the information was no good to me;  but maybe to one of his competitors or somebody who knew what he was talking about, it could be.

So it got me thinking about what activities a person might do on a daily basis that could possibly put their information (online accounts, banking information, private details, secret business information, etc) at risk.

Just a couple I can think of other than the car/bluetooth example to get things started...

Reading email on a mobile device while standing in line: people
around you or even watching CCTV around you can potentially see information you'd rather they didn't
Not collectiong an ATM receipt from the machine - you see this all the time, at the very least you know what the person looks like, and now you know how much money they have available in their savings account
???

I know this is an open ended question, I'll give the answer to whoever has the most amount of examples or most creative/interesting examples

I very often hear people on the bus calling companies and doing personal identification by answering questions such as their Address, Date of Birth, Full name, National Insurance Number (Social Security Number) and what not. I think this is a pretty bad one. By just listening to that you can get a whole bunch of information about the same person within minutes without doing anything: besides all the standard questions, you can hear their cases, their reference numbers and even their bank account details to set up a direct debit.

Also, Shoulder Surfing: less than three weeks ago I went to a big department store to get a contract phone and the chap serving me opened a page on their browser, typed an address and typed his password quite slowly with his two index fingers... I can tell you the username had only 5 characters (what I assumed to be his first initial concatenated to his surname) and a very, very short password of no more than 6 characters.


Is it okay to have your SSL cert showing when server is reached by IP? I've been doing some research into SSL for a paper for school, so please forgive my ignorance and lack of experience in this subject. While doing my research I have noticed that some websites when you do a nslookup on them and then search the IP address in chrome it varies what happens. When you nslookup google I get 172.217.7.174 and when you enter that it redirects to google.com as expected. But when you do the same for yahoo.com it takes you to an empty page. When you do it for Microsoft.com 23.100.122.175 it takes you to a "your connection is not private" page and then from there, you can see the information for Microsofts wildcard cert when you click NET::ERR_CERT_COMMON_NAME_INVALID.

So my questions are:

Isn't the private key for a cert supposed to be kept a secret?
Is it okay to have your website like microsoft's that displays the cert in its entirety?
If someone gets your cert cant they spoof your websites?
Shouldn't you be implementing some sort of redirect for IP addresses like a 301 or something?

The certificate does not show only when you access by IP. On Firefox, if you click on the padlock icon and show more information, you can get the certificate of the site you are accessing. It's public information, so no need to protect it.

  Is it okay to have your website like Microsoft's that displays the cert in its entirety?

The certificate does not contain the private key, only the public key. Otherwise there would be no security at all in implementing a certificate.

  If someone gets your certificate can't they spoof your websites?

No, the attacker needs the private key of the certificate too. The certificate only contains the public key, the private key is stored on the server, usually on a very special appliance (the Hardware Security Module - HSM).

  Shouldn't you be implementing some sort of redirect for IP addresses like a 301 or something?

Very, very few people will ever try to access Google or Yahoo or whatever using the IP, and usually certificates are not issued for IP addresses. So it's an exception so rare that does not really need to be addressed.


Should pypi subdirectories be accessible from web browser? I am a security researcher and when I was fingerprinting one web application I found out that all the subdirectories of domain.com/pypi were accessible from the web browser. The main directory pypi returns 403 Forbidden when I try to access it but all the subdirectories are completely open and you can access and download any file from them.

The question is, should this be so? What risks does the access to those files have? Should this be reported in a bug bounty program?

That is Intentional behavior in their Web Application, The reason is PyPI is the official Third party Software Repository of the Python. It is just like catalog of all Open source Python Packages. The .htaccess Options -Indexes is not the problem here, as these are Open Source Packages and it's public faced so, anyone can go the Site and Download manually, if not than i could search the Same from my Terminal by pip search twitter for example and it will List me the same number of twitter keyword packages which the  pypi.python.org/simple has.

The Opensource deals like this, If you notice than the Ubuntu Repo, Debian repos Have no .htaccess and you can easily read all the folders and sub-folders of the repo. Most Software providers and Open source community works in the same way, because there is no Harm in Information disclosure of an open source as they are already open !! Another Reason is they can MIRROR all the content of the site packages and can use for Download if Problem in Main Repo persists.

I assume that, you are Referring to Hackerone's Python Internet Bug Bounty Program, and if you report this bug than surely it's a N/A there due to Intentional behavior


Why is Steam so insistent on security? Is there any particular reason why the Steam application attempts to be so secure? It seems to force you to take more security measures (two-factor authentication, emails confirming all trades, etc) than most banks do.

Is this due to the fact that the Steam software has some inherent security risks associated, or is it just because they want to avoid people complaining that their account was hacked?

Is there any reason that Steam attempts to be more secure than most banks?

Steam has about 100 million users (random link saying they had 75 million almost 2 years ago). If they spend on average $10 per year, we're talking $1,000,000,000 per year - and I'd say that's a conservative estimate (random link saying they had 1 billion in revenue back in 2010). That's the same kind of money small banks deal with.

Then there is almost certainly a large number of low tech attackers. Steam is used by a lot of kids who don't yet have a proper understanding of legality, so at least some of them will try to steal the account of that other kid that smells funny. To be clear: "some" of 100 million is "lots".  These attackers often live in the same town and maybe even saw the other kid typing in the password before, which breaks some traditional safeties based on IP range and passwords. Stolen accounts create customer support costs. Widespread reports of stolen accounts create bad press, which destroys trust. For a digital market, trust is money.

Valve also works with a huge number of partners. These partners can act maliciously and try to break/abuse the billing process, which will directly hurt Steam's reputation and therefore lose Valve some serious money, unless the abuse is detected and dealt with swiftly.

EDIT:

  [...] enough money now moves around the system that stealing virtual Steam goods has become a real business for skilled hackers [...] We see around 77,000 accounts hijacked and pillaged each month. - 9 Dec 2015 http://store.steampowered.com/news/19618/

So in addition to a large number of low tech attackers, there's a large number of high tech attackers as well.


Can I rely on anti-virus scanning "data" objects in installer? When I run an anti-virus scan (Kaspersky in this case) on an (InnoSetup) installer, it scans multiple "data" objects which seem to be the files within the installer:

This gives the impression that it would detect a malicious program even before running the installer.

Can I rely on the anti-virus software detecting a malicious program within an installer when scanning just the installer?
Even if the installer is password protected and encrypted?
Or do I need to scan the installed files as well?

Note: I know that it is dangerous to run an installer from an untrusted source. In my special scenario,
the installer itself is created by a trusted source but the contents are not necessarily trusted.

Here's something important: in an information security field, a "trusted source" is not only a source which, as you believe, won't cause you any harm intentionally. It's also a source which won't cause you harm occasionally due to ignorance or carelessness.

"A source which can provide an installer with untrusted contents" sounds like a definition of an untrusted source. Even if it's, say, your father or sister, you still need to assess the information security threats based on how much do they know about information security, not only on how much do you trust your close relatives in general.

If your close relative has just downloaded an installer somewhere and then sent it to you, it still doesn't come from a trusted source in any sense. So it's still better to avoid running it.


SSD Erasure verification I was hoping someone would be able to give some advise on what would be the best way to verify that an SSD has been erased completely.
We are currently using Blancco v5 and even though it says it has been successful is there a way to manually check the SSD ?

Because of the way SSDs manage writes, it is not possible to truly verify that data has been erased without modifying the low-level firmware on the drive itself. Below are the features SSDs have (wear leveling and overprovisioning) that make erasing data problematic. If you already know all that, skip down to "ATA Security Erase", which is the only solution to erasing all data.

Wear leveling

Data on SSDs is stored in "cells". A cell may only have a lifetime of 10,000 writes, so a way to allow you to write to a single file more than 10,000 times without breaking your drive is necessary. The technique used is called wear leveling, and the way wear leveling works is, when you send a command to write to sector A, the drive does not actually write to physical sector A. Instead, it picks a random sector (or a sector which has not seen much use lately), let's call it B, and writes the data there. It will remember that logical sector A maps to physical sector B, so accessing sector A retrieves the contents of B. However, if you try to write a second time to A, for example to overwrite it, the SSD finds a new free sector, C, and writes to that instead, merely updating its mapping to remember that A now points to C. The physical sector you wanted to erase is never touched until it happens to get chosen as the destination for another write down the line.

Note that this is a bit of a simplification, as modern SSDs actually use static wear leveling, which gives sectors under heavy writes a rest by exchanging their data with sectors that have not changed in a long time. What I described was dynamic wear leveling, but for the purpose of this answer, they are functionally equivalent.

Overprovisioning

Imagine your drive is so full that only a couple of sectors are free. Now what if you start heavily writing to the free space in the drive? The wear leveling would be ineffective because it only has a few cells to choose from, and those cells would rapidly break down. A way to prevent a full drive from breaking was needed, and it is called overprovisioning. Overprovisioning enhances wear leveling by making the drive report less storage capacity than it actually has. An N GB drive (drives are measured in GB, which is a multiple of 1000) may actually have N GiB (with GiB being multiples of 1024) worth of flash cells. By making some of it inaccessible, even when the drive is reporting it is 99.9% full, it may actually only be 80% full. This means that, even if you have only a few sectors free, you can still write heavily to the drive, and it will still be able to spread the wear out among many more cells. In other words, the number of physical sectors exceeds the number of logical sectors. Unfortunately for data erasure, this means that even filling up the whole drive does not overwrite everything.

In terms of implementation, the overprovisioned space is essentially equivalent to a version of the HPA (Host Protected Area) which contains nothing and who's size cannot be modified.

TRIM

TRIM is a feature which allows the operating system to request that the physical sectors pointed to by a certain range of logical sectors be physically deleted ("flashed"). It is intended to mitigate an issue called write amplification by letting the SSD know which filesystem blocks have been deallocated and marked as free. Without TRIM, an SSD will faithfully keep even this unallocated data, as it has no idea if it's actually being used by the filesystem or not. When TRIM tells it to delete a range of sectors, it destroys them and marks them as free, making wear leveling more effective. However TRIM is also capable of securely overwriting data. Deleting a file on a filesystem marks all those blocks as free, and the corresponding sectors will be communicated to a TRIM-capable SSD by the operating system, which will securely erase them. In theory, you could even TRIM an entire drive, destroying all the data on it, but there is no guarantee that the SSD will behave the way you want it, rather than, say, ignoring the overprovisioning area or deferring erasure to a garbage collector later down the line.

ATA Security Erase

The only way to securely erase an SSD is to use the ATA Security Erase feature, present on all ATA6-compliant drives (i.e. virtually all modern ones). Attempting to overwrite data on an SSD will not actually remove everything due to overprovisioning space mentioned above. Unfortunately, because of this overprovisioning space, you cannot actually read everything which is present on the drive, as this space is always hidden, so you cannot verify if you have overwritten everything.

ATA Security Erase is designed to solve this problem by doing a low-level overwrite of every single sector. On some newer SSDs, an additional feature calld ATA Enhanced Security Erase can be used to destroy a master key which the drive uses to transparently encrypt and decrypt your data. Destroying the key is instantaneous, but renders all the encrypted content inaccessible.

There is no way to know whether or not ATA Security Erase succeeded or was implemented correctly, but modern, fairly well-regarded drives such as Intel SSDs are likely to implement it correctly. If you want, you can spray your drive with a constant pattern and initiate the security erase, then search through your drive for that string. While that won't tell you if the erasure worked, it will tell you if it did not work.

How to accomplish this on Linux

Linux has all the tools to do this. Here is how I would do it, assuming the drive is /dev/sda.

# it must say "not locked", "not frozen", and "supported: enhanced erase"
hdparm -I /dev/sda | grep -A8 "^Security:"

# overwrite the drive with a repeating pattern to check for after
yes "You should not see me" > /dev/sda

# begin the erasure, without using a password
hdparm --security-set-pass NULL /dev/sda
hdparm --security-erase-enhanced NULL /dev/sda

# check if the repeating pattern is anywhere to be found
strings /dev/sda | grep "You should not see me"

Writing a repeating string, erasing the drive, and checking for that string is not particularly fast, efficient, or reliable, but it's the closest thing to what you are looking for.

In some cases, the BIOS sets the drive to "frozen", which prevents various actions like ATA Security Erase. This is a poorly-thought out way to prevent malware from locking your drive. Because it's the BIOS which sets this, you can often unfreeze a drive by plugging it in after the system is already powered up (make sure it supports hotplugging!), connecting it to a SATA adapter (note that not all USB to SATA adapters support ATA commands), or, in some cases, suspending the computer and resuming from suspension. As long as it is not frozen or locked, the above commands should work.


How to send emails with Thunderbird without revealing my internal and external IP address? I have noticed this issue while using Google's Gmail with Thunderbird. When I send an email from Gmail's web front end at https://mail.google.com/ my internal and external IP address are not included in the email header.
However, I would like to use Mozilla Thunderbird to send emails from my local machine via Gmail. I logged into Gmail from Thunderbird via the IMAP / SMTP option. But when I send an email with Thunderbird via Gmail, it always includes my internal and external IP address in the email header and therefore exposes / leaks them to the mail's recipient. I would like to prevent this.
Here is a section of an email header sent by Thunderbird via Gmail:
Received: from [INTERNAL_IP] (EXTERNAL_HOSTNAME [EXTERNAL_IP])
        by smtp.gmail.com with ESMTPSA id SOME_ID
        for <RECIPIENT_EMAIL_ADDRESS>
        (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);

INTERNAL_IP is the IP that my computer uses inside my home network behind my router's NAT
EXTERNAL_HOSTNAME is the hostname assigned to me by my ISP
EXTERNAL_IP is the IP assigned to me by my ISP

I found these related posts, but they did not really help me:

http://kb.mozillazine.org/Replace_IP_address_with_name_in_headers
http://forums.mozillazine.org/viewtopic.php?f=39&t=586534

As far as I know the Received part of the email header (see code snippet above) where my IPs are included is not set by Thunderbird but by Google's SMTP server. Since I obviously do not have access to Google's servers, I cannot change their configuration.
My idea is to use a VPN provider (e.g. NordVPN or ExpressVPN) and to route my entire computer's traffic through the VPN tunnel. Then Google's SMTP server would not see my IP addresses but the IP address of my VPN provider's server. Do you think that's a viable solution? Would there be a higher risk of my emails being marked as spam because the IP of my VPN provider might be blacklisted?

Including the originating IP was standard practice until relatively recently. A number of WEB mail providers that also support IMAP/POP clients like Thunderbird have altered their handling to process client email as virtual web mail, replacing the originating IP with that of the Web server. As of 10 minutes ago, that does not seem to be the case with Gmail, it still includes the originating IP.
There are other email providers that don't do this. Since this is of interest to you, I'll remind you that Gmail clearly states that they scan your email content, in case you care.
Using a VPN will indeed show only the VPN IP and not yours. However you may run into problems with Google Security objecting to the VPN IP, particularly if it's from another country. It's easy enough to try, go ahead and test it.
As for recipient providers, I suspect some will blacklist/block/flag the VPN and some won't.
If this is a significant enough concern for you, I'd suggest changing providers.


Is it possible to ensure client data is correct? I have faced a problem with securing backend API in case when I can't trust a consumer.

I have a mobile app which uses GPS coordinates. After some calculation app sends GPS coordinates to backend service. I can't find a reliable solution to avoid faking requests from app to backend service. Some user can sniff traffic that goes from app to backend and just fake real GPS coordinates.

Is there any solution how to avoid this type of cheating? Was thinking about end-to-end encryption, but still, since some "secret key" should be stored on client side - it is possible to get it or even change it in order to see http request structure.

To put it simply: There is NO way

As you already determined, a request can easily be forged.
Even if using a custom encryption, your users can decompile your code and find out how it's done.

The only way to prevent users from tampering and decompiling your code is by not handing it to them.

Often this is done by providing SaaS products that run server sided.

All you can do is try to obfuscate your code if you need to serve the application as such.

But note: Security through obscurity is NOT secure.

P.S: Even if your users do not tamper requests: GPS coordinates of mobile devices can easily be spoofed.


Storing passwords in Confluence vs a password manager My SysOP team is using a page in Confluence for sharing the passwords of common accounts. I suggested them to use a password manager, but now thinking... is there any benefit?

The Confluence page is limited so that only the sysop team can access it, so what's the difference with a password manager? They need to use a password to login into their Confluence account and therefore, for accessing the passwords. If they were using a password manager, they would need a password to unlock it.

There are significant differences, both concrete and general, between the security provided by Confluence and a good password manager.

One specific problem is that Confluence doesn't encrypt data at rest. This means that someone with physical access to the disk can access the passwords. Even if you encrypt the disk, someone who gets access to the disk once the computer has booted (eg: via incorrectly configured remote disk access, or running a process on the server), can read the clear-text passwords.

Confluence also has many configuration settings that combine to grant or deny access to resources. Incorrectly setting these may lead to users unintentionally getting access to data.

Confluence also doesn't support common password manager features such as short authentication time-outs and masking passwords. The former is important because passwords are considered too critical to be trusted to the authentication of a computer or web portal such as Confluence. Masking passwords is important to prevent shoulder surfing which, in the case of a list of passwords in a table on a wiki page, seems a serious concern.

More generally, Confluence is a large and complex app that is written with the goal of sharing data. Password managers are very targeted apps that are written with the goal of securing data. As such, they are likely to have had more security-focused testing and code reviews, been written by more security-aware engineers, and to have been subjected to more security abuse by users. All of this leads to password managers being less likely to have vulnerabilities.


Why does Google require re-authentication before being able to start the password change process? When a user wants to change the password for an account most web applications present a form where the user needs to enter the new password and the old password. So far I thought that I understood the benefits of this approach. For example, the old password is an additional mitigation to CSRF and it avoids account hijacking (i.e. change the password for an account) if an attacker gets the web session.

At Google - of course ;) - it is different. When the user clicks on the link to change the password a login form is presented and the user has to re-authenticate. After re-authentication a form is shown where the user just has to enter the new password. The old password is not required again.

There are some pros and cons with the approaches:

Asking for the password right there where the change happens (first approach) has the advantage that the risk that weaknesses in the whole process can be exploited is greatly reduced. The new password and the old password are processed as a pair. If something goes wrong (e.g. an attacker is able to set an arbitrary user for the web session) then there’s the high probability that the old password still protects the password change.
For the second approach (Google) there could be weaknesses in the process after re-authentication (e.g. CSRF protection could fail, bugs in session management).
The second approach has the advantage that the application to change the password is not accessible before re-authentication. So weaknesses in the application are not accessible before re-authentication as well. Weaknesses which are not accessible cannot be exploited.
Maybe Google wants to implement just one way for doing authentication. I think Google uses some kind of risk analysis for the login and that it could be possible that Google simply wants to use those mechanisms for the password change process as well.

In my opinion the risk for weaknesses in the second approach are much higher especially because there can happen a lot of things between re-authentication and submitting the new password. Also, I think that reusing risk analysis and stuff like that should be possible without great effort for a password change process as well.

So my question is do I miss something that makes the second approach (Google) superior?

My guess would be that for google it allows them to handle all their various different options for TFA(two factor authentication) more easily. Off the top of my head they support 3 or 4 different methods at least. They also allow you to have multiple TFAs enabled at once so you can pick which one to use.

Not saying you couldn't also handle all that on the same change password page with the old and new password fields but it definitely is more complicated than just asking for the old password along with the new one.


Understanding Diffie-Hellman key exchange I understand the diagram up till the point where Bob and Alice do a "Public transport" of their respective mixture. I am wondering how do Bob and Alice know what secret colour to add ( circled picture ) to get the Common secret

The best way to understand the realms of Diffie–Hellman key exchange is to throw a glance on the mathematical procedures ut follows and which I am going to explain:

Alice & Bob agree PUBLICLY to share a random INTEGER number p that belongs to a the cyclic group  g of the ring (Z/pZ)*.
Alice  & Bob choose  RANDOM integer numbers (a and b respectively; {a,b} belong to (Z/pZ)*)
Alice sends (g) pow a (mod p) to Bob
Bob sends (g) pow b (mod p) to Alice
Alice computes
Bob computes
The shared secret is then

But where is the answer to your question ? It is highlighted by the second step of the algorithm: it means Bob & Alice have not to know how to choose the circled pictures but they choose them randomly.


Safe encryption algorithm that works with files bigger than 68GB In my Java application, I used AES/GCM/NoPadding algorithm for encryption, however it throws an exception when I try to encrypt files bigger than ~68GB. From what I read, it is limit of data that can be encrypted using GCM.

I know that there is a possibility to split bigger files and then merge them, but this seems like a complicated solution. Is there an algorithm that is as safe as GCM, but handles massive files?

I tested CBC, and this works with bigger files, however I read that it is ~40yo, and not as safe, due to lack of authorization. Does it really cause safety problems? Are there any alternatives?

Edit:
Thank you all. As a result of Sonar marking CBC as unsafe and orders from senior architect, I implemented file split/merge with GCM in application.

GCM mode combines CTR (counter) mode with MAC called GHASH. You can use virtually any standard block mode if you combine a MAC with it. For example, you can use AES in CBC or CTR mode if you also use HMAC, a MAC that uses cryptographic hashes for authentication. It is always better to encrypt first and then apply the HMAC over the ciphertext, a construction called Encrypt-then-MAC (EtM).


API Key in microservices Is sending an encrypted connection string as an API Key through headers a good idea?

Someone once told me, storing API Keys in a DB is a bad thing to do but I can't seem to figure out how, when in the end all an attacker has to do is use fiddler to check the headers you are sending in requests for the API Key.

The reason I want to store API Keys in a DB is because I want to create a portal so users can view API keys for specific services of my microservice application. Thus making the API Key readable in plaintext.

For most intents and purposes, its good to think of an API Key as a username/password combination.  The reason it's generally frowned upon to store API keys in the database in a reversible format is because if your database gets breached, it's possible for an attacker to gain access to all of the API keys which are stored in the application, and impersonate other users.

Showing users their API keys in plain text is essentially the same as showing them their passwords in plain text.  A more secure alternative might be just allowing them to reset their API keys, and not showing them what the original key was.


Salted hashes vs HMAC? Most of discussions involving access credentials include references to "hashing salted passwords". Is this another way to referring to the HMAC algorithm or a totally different operation? Different or not, why not using HMAC since this is easily referenced to a published standard -FIPS198?

HMAC is a Message Authentication Code, which is meant for verifying integrity. This is a totally different kind of beast.

However, it so happens that HMAC is built over hash functions, and can be considered as a "keyed hash" -- a hash function with a key. A key is not a salt (keys are secret, salts are not). But the unique characteristics of HMAC make it a reasonable building block for other functions, which is what happens in PBKDF2: that's a key derivation function, commonly subverted into password hashing (a role for which it appears to be adequate). PBKDF2 includes a salt, and internally invokes HMAC (several times).

Good password hashing must be slow (in a configurable way) and include a salt. These characteristics are not easily obtained, and you will not get them out of a lone HMAC (which is fast and does not use a salt).


How to disable/block Microsoft Store on Windows 10 Pro by firewall? I want to block Microsoft Store on Windows 10 pro in a corporate environment. Having read relevant articles about this matter and tested on my machine, I see that Windows 10 Pro does not support this function (either through Group Policy [not recommended by my Manager] or Registry.

Now, I opt for another solution, that is, blocking it by firewall. If it is feasible, can anyone show me the rules how to block Microsoft Store by firewall? I'm using a tool to configure this rule.

Im not sure on how you are planning to block the application through firewall. I believe you can only block the traffic from "windows store" using firewall.

But, this can be done by any application control program or AV(If the AV has an Application control feature).
you can configure the application control program to block the execution of WinStore.App.exe (main process of windows store application).


How can I remotely detect versions? I want to know how to remotely detect a software version.

Once attacker knows the version installed, he can exploit published vulnerabilities. So it will be useful to know it when doing penetration testing.

Yes, of course. Service and OS fingerprinting is one of the first steps in the methodology.

Nmap does service fingerprinting and OS detection. But that requires that the service be available to the network (web server, SMB, etc.). You can even connect to a network port with telnet and request the service banner.

If you want to know an installed program that is not network-accessible, then you need to do meta-data analysis of files that the program created, or you need to perform social engineering or open source searches to get the version info. For instance, has an employee of the company posted on a tech support forum and revealed the version they use?

I see that the original version of the question asked for a specific service. For that, you can try nmap to see if that service will return a banner, or use the non-network accessible option I laid out above.


New certificate but what about the keys? One of our SSL certificates has expired and along with that so has the keys. I have a re-newed certificate but no re-newed keys.
The posting Should I change the private key when renewing a certificate? leads me to think that
the chaining is maintained with the new certificate (same CA).
However, when testing the website I now get "Warning...Untrusted...(expired cert)". Was the certificate supossed to come with new keys or can I generate
them using the re-newed certificate?

I am using Java Keystore and Portecle to maintain my keystore, certs, and keys.
The certificate is a SSL wildcard cert. I also restarted Apache.

I have also found the following...it seems to indicate that chaining is maintained also... How to go about an ssl certificate renewal.

Any advice is appreciated...

A certificate is your public key and some information about the site and then a lifetime. All this is signed by the issuer CA. The certificate is public and thus also the public key, but the private key is not published.

  One of our SSL certificates has expired and along with that so has the keys.

While the certificate will expire the public and private key have no expiration time. Thus you could in theory re-use the same key for the renewed certificate and this is often also done this way (unless the key is compromised or got too weak with the years).

  Was the certificate supossed to come with new keys ...

A certificate does not come with keys. You usually create the keys locally and then send only the public key to the certificate issuer but keep the private key secret. Although some issuers let you create the key online, in which case you get the key pair additionally to the certificate. If this was the case only you know.

  I now get "Warning...Untrusted...(expired cert)"

In this case the site probably still provides the old expired certificate, that is you made some error when re-configuring the site for the new certificate.


How to generate a config file from a .csr using OpenSSL (or other)? I want to export the configuration details from an existing CSR or Certificate to a config file which I can use with OpenSSL to generate a new CSR.
Background
Our CA has changed.  For the old one, I submitted a CSR and a list of subjectAltNames and the CA team sorted it out.  For the new CA, I have to submit a CSR with the subjectAltNames included.  It's a critical time of the year and I can't make a mistake, so I'd rather export the configuration file than recreate it manually, if that's possible.  It's for a Windows server.  I don't know how the original CSR was created - there's no existing config file.  I've exported the private key from the windows key store, for use with OpenSSL.  I have the original CSR and the certificate.

I also had this question, and tying a number of threads together, I cobbled together this bash script to create a config file:
for pem in $1 ; do
echo "[ req ]\ndefault_bits\t= 4096\ndistinguished_name\t= req_distinguished_name\nreq_extensions\t= req_ext\n[ req_distinguished_name ]" ;
IFS=","

    for att in `openssl x509 -in $pem -text -noout | grep Subject: | cut -d: -f2 ` ;

        do VALUE=`echo $att | cut -d= -f2-9 `;
            case $att in
              \ C=*) echo "countryName_default = $VALUE" ;;
              \ ST=*) echo "StateOrProvinceName_default = $VALUE" ;;
              \ L=*) echo "localityName_default = $VALUE";;
              \ O=*) echo "organizationName_default = $VALUE" ;;
              \ OU=*)  echo "organizationUnitName_default = $VALUE" ;;
              \ CN=*)  echo "commonName_default = $VALUE" ;;
        esac
    done

        openssl x509 -in $pem -text | grep -A1 Subject\ Alternative\ Name | tail -1 | xargs echo "[ req_ext ]\nsubjectAltName = "
done


Traffic anonymization through routing - software and algorithms I stumbled upon an interview with "the grugq" in which he is talking about how hackers anonymize their traffic, i.e. hide their original ip address (- this is also what I will mean by "anonymizing" in what follows). He states that

  The old idea was to have a lot of boxes in different countries so that
  it was legally very difficult to get all the records together. These
  days, things are more sophisticated than those old style bounces,
  though. Before you used to have do log-ins to loads of boxes to do
  your bouncing. Now there’s packet routing software, so that rather
  than running a session from box A to box B to box C, you install
  software on a load of boxes, and then you have some packets which get
  routed from box A to C to target, and the other packets go from box B
  to box D to box A to target, and so on.
  (http://www.csoonline.com/article/2121184/network-security/where-is-hacking-now--a-chat-with-grugq.html)

Since I'm rather a programmer than a network expert I would like to know:

What kind of routing software is he talking about? Do you need "special" software for that kind of routing or can you achieve that with standard linux tools (given that you can load necessary kernel modules, change iptables rules etc.)?
Are there any special routing algorithms that bounce traffic with the aim to anonymize it? As far as I see most routing algorithms aim at finding the "best", i.e. fastest (or, more abstract, "cheapest"), routes between source and target what may not be needed when your aim is to bounce traffic between different nodes to hide its origin.

The routing reminds me of what Tor is doing, but there are probably other solutions than Tor for that kind of task, since Tor would seem to be a kind of overhead here (and is limited to 3 nodes).

Thanks!

Tor fulfills both your requirements quite nicely.

Additionally, for your first point, there was no routing protocol used, as such - attackers would literally connect to a 2nd machine, and from there connect to a third etc - using plain old TCP/IP.


Is there is a way to lock my USB port over the device physically? Is there is a way to lock my USB port over the device physically ?

For example I am connecting the USB mouse and keyboard on an public computer but I do not want anyone to remove them physically. I want to physically blocks these USB ports from unauthorized access in fact most airport use USB blockers for the public computer but I cannot find any images on or something relevant.

An other option will be to edit some configuration in the system to just identify these mouse and keyboard and do not  work with any other device?

The solution most often found in airports is to restrict access to the PC itself - placing it within a lockable case or kiosk.

Alternatively, epoxy resin is pretty good for sealing ports, whether or not they have a plug inserted (remember you will need to seal all ports an attacker could access)


Properly generating RSA+AES keys For learning purposes, I'm creating a chat application where the connections are done via SSL/TLS, and the messages are encrypted using AES-CBC-256 and the AES keys are encrypted with RSA-2048.

The AES key is randomly generated (AesProvider.GenerateKey()) per user per session (which means one key for every person an user is chatting with) and the IV is randomly generated (AesProvider.GenerateIV()) by passing in the key generated, each time a message is created (before being sent).
On the RSA side, I'm generating a secure random session name to store the private keys generated in containers, and sending out the public key. I'm also using the same model (one key pair per user per session) as in AES.

I should also state that I'm using HMAC-SHA512 to hash the messages and sending the HMAC key encrypted using the same public key that the AES key/Iv gets encrypted with. Since I've read that it doesn't need to be regenerated often, I'm planning on regenerate the HMAC key every 5000 or 10000 calls.

Questions:
1) Should I be creating only one RSA key pair per user and use it for all sessions, or is it good how it is right now?
2) Is using the same AES key and only changing the IV like explained above considered secure?

Apparently you use RSA to make a key exchange: party A wants to have a shared secret with party B (e.g. a key suitable from some AES or HMAC); thus party A generates a random value K and encrypts K with B's public RSA key. B will use its private RSA key to perform the decryption and recover K.

This process works only as long as party A uses for encryption a RSA public key that really belongs to the intended recipient (B). A might remember B's public key from a previous interaction, or there may be a central trusted repository, maybe a "virtualized" repository (that's what certificates are about). In any case there must be something to prevent attackers from pushing their own, fake RSA public keys in lieu of the genuine ones. This is not an easy problem to solve. If you generate new key pairs on a per-session basis, then that problem will become substantially harder.

Anyway, when you use SSL (which is a good idea), you already get that kind of mechanism for all client-to-server communications. SSL clients use the SSL server's public key (in the server's certificate) to establish a shared secret with that server. You don't see any of this because that's all hidden within the SSL library; but it is there. If you want some extra encryption, then I must assume that you want from user-to-user encryption, because the central server is not trusted. (If you just wanted some encryption between each client and the server, then this would be wholly redundant with the SSL.)

For user-to-user encryption, each user A must somehow know the public key of every other user B that A wants to talk with. Distribution of such public keys is the core problem, because you want to block fake keys, but you do not trust the central server for maintaining order (if you trusted the central server, then you would simply let the SSL do the job). You may want to investigate the notion of Web of Trust for a possible model for decentralized public key distribution.

For symmetric encryption, the whole point of generating new IV is indeed to be able to safely reuse symmetric encryption keys. As long as you generate such IV properly (CBC requires random, uniform, unpredictable IV), this should be fine.


Sending a client-side high-score to a server securely I'm creating an web-application that has a simple javascript game in it. Once the player finished playing the game the high-score is sent to the server and saved.

After a specific period the player with the best score receives a prize.

Is there a way to send the high-score securely and prevent the client sending 'false' high-scores?

Currently we are using:

Https.
Server random token before each game and sent after the game is finished alongside the score.

The server can't fully trust any data it receives from the client, so validating high scores is difficult.

Here are a few options:

Obfuscate the client-side code and traffic to the server. This is the easiest option - it will still be possible to cheat, but probably won't be worth anyone's time.
Send a full or partial replay of the game to the server for validation. The player's moves can be run on the server to determine the legitimate score. This will work for some games and not for others.
Move the game logic and validation to the server. The client simply relays each move to the server, where it is validated and the game state updated.

It comes down to how your game works, how likely it is that people will cheat, and how much you care if they do.


Password write protect an external hard drive (DOK) without encryption I'm handing out a usb sticks to students and want them to return after they copied the material to their personal computers.

I want to make sure the usb's return without any damage/malware (intentionally or unintentionally, i.e. their pc's might be affected by viruses).

Is there a way to set up the usb sticks such that no write will be possible without knowing a certain key/passphrase? reading from it should be permitted. I do not care about encryption, I mean, if that solves the problem I don't mind doing so but as far as I know just encrypting the disk does not make a distinction between read and write accesses.

In any case, I'm working with Ubuntu.

Hardware

It is not possible to write-protect a USB device via the standard USB mass storage protocol. You would need to find a flash drive vendor that provides that as an extra feature. Make sure it is implemented in hardware, and not as some silly program that one has to run in order for the protections to be enforced. There are surely some out there, but they are likely expensive, and many of them can be easy to bypass.

Note that, even with hardware, it will not necessarily be hard for a skillful or even just clever attacker to bypass. Many flash drives can have their firmware overwritten, which will necessarily disable any write protection. I would recommend against a hardware solution for this reason.

Hash lists, stored on your computer

If your budget is low, and your threat model does not involve particularly advanced adversaries who may be able to exploit flash drive firmware or filesystem drivers, then the solution may be as simple as generating a hash list, and checking the list when the drives are returned. If any of the hashes do not match, you know that a file has been modified. A simple way to generate a hash list using Linux, using relative paths to avoid issues if the mountpoint location is different:

To generate a hash list and save it to your home:

cd /media/usb
find . -type f -exec sha1sum {} + > ~/SHA1SUMS

To verify the hash list:

cd /media/usb
sha1sum -c ~/SHA1SUMS

Signed hash lists, stored on the USB

If you do not want to store a separate file with a hash list for every USB device, you can also put a signed hash list on the drive itself. This works basically the same way, but rather than keeping the hash list on your own computer, you keep it on the USB, using a signing key so you can know if it has been modified. This is a common technique used for distributing software securely as well. You will need to create a key for signing with GPG.

To generate and sign a hash list:

cd /media/usb
find . -type f -exec sha1sum {} + > SHA1SUMS
gpg --clearsign SHA1SUMS -o SHA1SUMS.asc -b

To verify the hash list:

cd /media/usb
gpg --verify SHA1SUMS.asc
sha1sum -c SHA1SUMS

You can likely automate this all with a script.

dm-verity

Another Linux solution, far more powerful than hash trees, involves using a feature called dm-verity, originally designed for protecting the Android boot process. When a drive is used with dm-verity, a master signing key is used to sign the root hash. The root hash will change if anything on the partition with dm-verity changes, and the signing key will no longer validate it. By default, any change will result in that file not being readable. This is far more secure because it cannot be bypassed without knowing the secret signing key, and it can be used on any storage device.

This solution is more efficient than using a hash list, as files are only verified as they are accessed, negating the need to verify it all at once. The partition will however be made read-only, so adding a new file will require reformatting the drive. This is great if you have a write once, read many situation, but is not so great if you have to add new files to the flash drive and redistribute it all the time.


Are KIS 2014, Malewarebytes Pro and SpyBot sufficient to prevent internet attacks? As mentionned in the title, I have KIS 2014, Malewarebyte Pro and Spybot installaed on my windows 7 (regularly updated). I regularly scan my pc for viruses and spywares and clean it with Glary utilities pro and Ccleaner. I also blocked Javascript in my main Chrome browser (for unknown websites).

Are these practices sufficient to stay safe from trojans and direct attacks? I know the question is open, but I'm just wondering if there are other solutions to enhance the security.
I think a good VPN could give more security?

What about Ipchain and proxies? I don't know much for these two tricks but I just state what I've heard from professionnals.

This will only protect you from well known viruses. To be honest, if they perform a targeted, direct attack against you, you would expect the attacker to employ several anti-virus evasion techniques which will bypass all your AV software because its fingerprint is not cataloged yet. Anti-viruses are good protection to prevent infection of known viruses. They can offer no or only limited protection against targeted attacks. Also note that once you have been affected it's already too late. If you have been affected by a virus (it has been able to execute) you should nuke it from orbit and restore from the last know good, clean backup.

A VPN will give you  privacy, it will not give you security, the same goes for ipchains and proxies.


Store passwords as integers I just came up with this idea that I can store passwords as integers which take up 4 or 8 bytes as opposed to a hash that takes like 150 bytes or something. I wrote this function that converts a string to an integer based on some elementary math

function pass($pass) {
    $value = 0;

    for ($i = 0, $l = strlen($pass); $i < $l; $i++) {
        $value += pow(ord(~$pass[$i]), 1/2);
    }

    return (int)round(pow($value, (int)('1.' . $value)) * 10000000000);
}

var_dump(pass('M'));
var_dump(pass('m'));

  int(133416640641)
  int(120830459736)

As I see it in order to get hacked first the hacker needs to know the int value stored for the password and the algorithm. They can get the value either if they hack my database or grab an old backup file which is known to be the more common exploit (I guess) but still if they don't know the algorithm they wouldn't be able to crack it?

I don't think it is possible to revert a converted value back to the original string as that would be a problem with complexity of however many characters the string contains, right?

The other possibility is if they accidentally input a value that converts to the same value of the original password, theoretically I suppose there should be an infinite amount of strings that can get converted to the same value but I'm not sure about the real chances of this happening, as well as this problem is also present in hashing algorithms known as collision.

As you probably guessed already I'm very far from a security expert and I suppose this is all garbage that I'm talking right now but I want to know why?

This is security through obscurity, and in violation of kerchoffs's principle.

  if they don't know the algorithm they wouldn't be able to crack it?

Maybe. And maybe analyzing the entries leads to the revelation of the algorithm.

And once an attacker does get the algorithm - via analysis, by getting access to your server, because you posted it here - they have automatic access to all passwords.

This isn't the case when hashing, because one important property of cryptographic hashing functions is that they are slow.

  The other possibility is if they accidentally input a value that converts to the same value of the original password, theoretically I suppose there should be an infinite amount of strings that can get converted to the same value but I'm not sure about the real chances of this happening, as well as this problem is also present in hashing algorithms known as collision.
  [...]
  integers which take up 4 or 8 bytes as opposed to a hash that takes like 150 bytes or something

If you reduce the size, collisions become more likely, as you still have the same size of the input, but a smaller target area.

  As you probably guessed already I'm very far from a security expert

That's why you should never roll your own (but I'm assuming this is more of a theoretical question to learn, not something you want to actually use in practice).


How often should passwords change? I'm asking two very related questions

As an admin what policies should be enforced regarding the frequency of password changing? I have an idea  that users should be forced to change their password after a certain amount of time but a certain amount of login attempts. For example if 30 incorrect passwords were entered the next time the user logs in they must change their password.
For situations where I'm not the admin and there is no password expiry how often should I changed the password? For example my cellphone provider doesn't require me to change the password and I haven't for over a year, though the password is quite complex.

The brute force attack can be described as such: the attacker tries a lot of random potential passwords, until the right one is found. Forcing a password change for the user, i.e. changing from one potential password to another, does not substantially lower the success rate of the attacker (indeed, it changes anything only if the spaceof possible passwords is so small that the attacker can explore it exaustively -- and this means that you have a bigger problem, which is that your users choose very weak passwords). It is a widespread, but wrong belief that password changes somehow "restore security".

What may make sense is to disable accounts which are the target of a brute force attack, indicated by a lot of failed attempts. But this kind of locking feature can backfire: it allows anybody to lock the account of anybody else, which can turn into a big helpdesk problem.

Correspondingly, there is no need for you to change your cellphone provider password because it is old. Change your password if it is weak, but weakness does not grow over time; it is there right from day 1.


Can my isp see my sock5 proxy traffic? I browse the internet/ connect via rdp computers via a sock5 proxy.  I use proxifier to do this and I set it so that it handles dns requests via the proxy.  I am sure there are no dns leaks.  Can my ISP still see/monitor my web traffic?

YES

SOCKS5 is a proxy, which means the traffic will go directly to it before the target. There is no encryption, so everything is plain text.

Taken from https://unix.stackexchange.com/

  SOCKS5 is just a transport protocol on top of TCP/UDP but below application layer. Thus it's comparable with TCP and UDP, too. There's no inherent encryption in SOCKS, but you application has to care about this (it's not a VPN technology, but a proxy at last). If you want encryption, the protocol you speak inside of the SOCKS-channel has to provide it.

SOCKS5 is there encryption between client and proxy server?


Should I revoke no longer used Let's Encrypt certificates before destroying them? The Let's Encrypt documentation recommends that when a certificate’s corresponding private key is no longer safe, you should revoke the certificate.

But should you do the same if there are no indications that the key is compromised, but you no longer need the certificate? Let's Encrypt certificates will automatically expire after 90 days. Is it enough to delete the certificate and its private key?

As a background, this is my concrete scenario:

When we deploy new software, it will create new EC2 instances, which will eventually replace the existing instances (immutable server pattern).
At startup, new instances will acquire a new Let's Encrypt certificate.
Certificates (and their private keys) never leave the EC2 instance.

So, when old instances are terminated, the certificates assigned to that machine will be destroyed. At this point, we are no longer able to get access to the private key.

Questions:

From my understanding, revoking might be a good practice. But strictly speaking, it will not increase the security of the system (of course, assuming that the private key was not compromised). Is that correct?
Will it help the Let's Encrypt operators to explicitly revoke unused certificates, or will it do more harm? (I'm not sure, but revoking could trigger extra processes, which might be unnecessary if there is no indication of the key being compromised.)

This is a subjective Cost vs Risk decision. We can't make it for you, but I can help you examine the factors involved.
Cost
To you: the effort of revoking the cert. If you have to do this manually, that's annoying, but if you can script it up in 10 mins and add it to your CloudFormation plays, then why not? As @Hildred points out, this also advertises that your server has been decommissioned, which could be considered a privacy / security issue depending on how much you care.
To LetsEncrypt: They need to handle the revocation request, which is not a particularly heavy request. Each revoked cert adds a line to their CRLs, slightly higher bandwidth costs to transmit the CRLs, and slight performance penalty to their OCSP responders that need to search the CRLs. But it's certainly not a burden since the system is literally designed for this.
Risk
If an attacker finds out that you terminate your VMs without revoking the cert, can they use that to their advantage? A rogue admin (either yours or amazon's) could pull the cert and key from the VM as it is being terminated and you'd be none the wiser. Is that likely or any bigger of a threat than pulling it from a live system? Probably not.

So really, we're dealing with a very small cost vs a very small risk. Your choice. Thanks for asking the question though, neat to think about!


Penetration testing Windows Phone 8 apps w/o source I am interested in performing a penetration test of a Windows Phone 8 application for which I do not have the source code. While I can easily validate network communication security, it is more difficult to validate that the application is not storing any sensitive data insecurely.

Because there is no public jailbreak/root for Windows Phone 8 at this time, this seems to be a difficult task.

I considered that if I could install the app into the Windows Phone 8 emulator/simulator that I could use WinDbg, Process Hacker, maybe Process Monitor, or even API Monitor to determine where files are being written/read in the simulator's file system.

My purpose is to ensure a Windows Phone 8 application enforces security as this application claims, and it is difficult to perform a penetration test without root/SYSTEM access to the device.

Is it possible to monitor a Windows Phone 8 app's filesystem activity either in the simulator or on a device (without the app's source)? If so, how?

I believe it is possible to jailbreak a windows 8 phone.  Seeing as Microsoft can't keep people from pirating games for the XBOX 360, I don't expect Microsoft to be able to put up much of a fight in the jailbreak war.

A jailbroken device isn't the only way to conduct analysis of a mobile app. You can decompile Windows 8 apps  which can shed light in their inner workings.  As with iOS and Android hacking,  you can MITM SSL/TLS connections by importing an your own certificate and intercept requests using a program like BURP.


What is the use of password encryption? Why do we encrypt passwords?  Is it to protect the password from eavesdropping? to protect the password after saving it in database?  both?  or for some other reason?

I wrote a blog article specifically on that subject. Summary: password should be hashed ("encrypted" is not the correct term for that) to protect against attackers who gain read-only access to the database where a server stores whatever it needs to verify passwords.


E-mail forensics for dummies Long story short, I am getting Dutch language spam from a group; it has been going on for years, and they send several of them daily. They got my e-mail when I lived in the Netherlands and imagine that their "business" is very profitable and I'm just lucky to not speak Dutch and therefore it was easy to ignore them this long.

Still, I finally reported some of their domains to web.com, the registrar they use, whose abuse department replied:

  Although the domain name is registered through Register.com/Network
  Solutions/Web.com, the e-mail itself, which is separate from the
  domain name registration, is hosted elsewhere and we have no control
  over the website, e-mail or its content. Any issues regarding the
  content of the website or e-mail  will need to be addressed directly
  to the owner of the site or to the e-mail-hosting provider who should
  be in a position to assist you with your concerns.  To determine the
  mail-hosting provider you can use a publicly available tool such as
  http:www.mxtoolbox.com this tool will provide you with the e-mail
  hosting provider of the domain name, which can then be compared to the
  ARIN.net (http://www.arin.net) IP allocation database.  This will give
  you the relevant information for the true e-mail hosting provider.

Now the problem is that I could not properly locate the hosting providers for their domains - peabolin.com, suraccess.com, compun.org, etc. - with those tools and need your help with doing that (also for their future domains as I'm sure they will keep trying).

Also, is this truly the best way of going after such a spam-ring? Should I be using dedicated software? I did try reporting them to a local spam agency before without any results.

Update: let me copy here the response from another registrar (namecheap.com) as well which cared much more than web.com about my complaint, as an encouragement for others to take action:

  ... it seems the domain name is blacklisted by SURBL. Since we
  consider SURBL to be a trusted organization, we opened a case
  regarding the domain name.

  (and 2 business days later:)

  This is to inform you that the potyxc.men domain was suspended. It is
  now pointed to non-resolving nameservers and will be null routed once
  the propagation is over. The domain is locked for modification in our
  system.

I could not properly locate the hosting providers for their domains - peabolin.com, ...

First, make sure that this is really spam and that it is impossible or useless to complain directly to the sender of the mail.

Then you might start by getting the IP address of their website:

$ dig www.peabolin.com
...
peabolin.com.           3501    IN      A       91.185.198.54

You could also check the IP address of their incoming mail server:

$ dig mx peabolin.com
...
peabolin.com.           3419    IN      MX      10 peabolin.com.
...
peabolin.com.           3419    IN      A       91.185.198.54

In this case both point to the same IP address and you might lookup who is responsible for the IP:

$ whois 91.185.198.54
...
% Information related to '91.185.198.0 - 91.185.198.255'
...
% Abuse contact for '91.185.198.0 - 91.185.198.255' is 'abuse@telemach.net'
...
inetnum:        91.185.198.0 - 91.185.198.255
netname:        Telemach-NET
descr:          Broadband Network Services

If you feel that the domain owner misuses this network (for example to send spam) you can contact the abuse contact shown above. But note that you should also check that the main actually has its origin by this party and is not a spoofed mail. You can also check the Received headers in the mail which path the mail has taken and which IP addresses are involved - IP addresses used for sending might be different to the ones used for receiving. See Email header IP address for more information.


Bridge mode question İ have an outdoor in my shop and distributing my network to customers using mac filtering opition..
 one of my neighboor got a weak signal....so, he bought a wirelss repeater to recieve a better signal
 to use it on his mobile.
so should i put his repater mac or İ must establish a bridge point to point connection?
As İ do not want him to spread my network without my permission.
Please give me your suggestion

Theoretically anyone who is capable of connecting to your network is capable of sharing it without your permission.  Any device connected to your network can create a private LAN within the original LAN and share the Internet connection by allowing devices to correct to the new, inner LAN.  This is sometimes known as a double-NAT.  If the repeater is configured this way, then from your point of view there will only be one additional device on the network (the repeater) no matter how many people connect to the repeater.

Fortunately, most off-the-shelf consumer repeaters do not normally work this way; instead of creating a new LAN the repeater will extend (bridge) the original LAN, so anyone who connects to the repeater will be connected to your main network and thus be subjected to MAC filtering.  Even so, your best bet would be to talk to your neighbor to make sure the repeater is extending your LAN rather than creating a new one.

You should also be aware that MAC authentication is a very weak method of wireless security.  All devices connected to a wireless network broadcast their MAC addresses in plaintext, so it's trivial to listen for them and then spoof the MAC address of a valid client.  If MAC authentication is your sole method of protection, you should really consider giving your customers WPA2 keys instead. If you have the necessary equipment to do WPA2-Enterprise you can even give each customer a distinct login and password.


System breach or OpenSSH glitch? The system runs a SSH daemon, and a nginx web server, both ports being open to the internet. We are part of a university so our ports are forwarded from the main router to the intranet.

At about 19:00, the SSH daemon stops responding to all requests for login. All passwords as well as SSH keys seem invalid. We responded by taking the machine offline two hours after the incident, just in case it was more than a "glitch".

I also checked the daemon logs, and there is no reason to suspect the process was killed, as it was still responding to password requests, just not allowing any user to login given correct credentials.

I've ruled out user error by looking through the shell history files. The only other option is that we were attacked. So my question is: is this a glitch with OpenSSH, or was my system breached?

I realize this is a very broad question with not much details, so I will provide any further information upon request.

EDIT
Running On Fedora 20 Heisenbug with OpenSSH v.6.4p1, and Nginx v1.6.0
I'm not sure what auditing software is available in Fedora. Could anyone suggest

This might have been the Kernel oom-killer in action.

How much RAM does your machine have? Does it have swap memory?

What could happen is when running out of memory, oom-killer will sacrifice a daemon and that daemon might have been the sshd one.

You could confirm this by looking in your messages log /var/log/messages or via journalctl.


Account import into gmail - is it considered safe? From my Gmail account / settings, I can import another mailing account (for example a Microsoft Exchange account).
Then Google asks for my personal Microsoft Exchange password (! this is not very "OAuth").

After the setup is complete, I can read and send emails impersonating my Microsoft Outlook account from Gmail.
I guess this as safe as my Google account... but would you advise it for an organization?
Should we allow our users to configure the company's Outlook account into their personal Gmail?
I guess not...

Company emails should not be stored on personal accounts or devices. There are data protection/privacy issues, as well as issues around corporate control over data.
By doing this, the company loses control over the email.
Email is used for many different things, including passing files and using it as a de facto file store. To pass all that data to a personal data store is often considered a breach of data (specifics are up to the relevant data protection regulation the company is subject to).
So, it's not about Gmail. It's about the appropriate use of email in general. Gmail could be the most secure email system on the planet, and using it would still be inappropriate.


Do any security experts recommend bcrypt for password storage? On the surface bcrypt, an 11 year old security algorithm designed for hashing passwords by Niels Provos and David Mazieres, which is based on the initialization function used in the NIST approved blowfish algorithm seems almost too good to be true. It is not vulnerable to rainbow tables (since creating them is too expensive) and not even vulnerable to brute force attacks.

However 11 years later, many are still using SHA2x with salt for storing password hashes and bcrypt is not widely adopted.

What is the NIST recommendation with regards to bcrypt (and password hashing in general)?
What do prominent security experts (such as Arjen Lenstra and so on) say about using bcrypt for password hashing?

Bcrypt has the best kind of repute that can be achieved for a cryptographic algorithm: it has been around for quite some time, used quite widely, "attracted attention", and yet remains unbroken to date.

Why bcrypt is somewhat better than PBKDF2

If you look at the situation in details, you can actually see some points where bcrypt is better than, say, PBKDF2. Bcrypt is a password hashing function which aims at being slow. To be precise, we want the password hashing function to be as slow as possible for the attacker while not being intolerably slow for the honest systems. Since "honest systems" tend to use off-the-shelf generic hardware (i.e. "a PC") which are also available to the attacker, the best that we can hope for is to make password hashing N times slower for both the attacker and for us. We then adjust N so as not to exceed our resources (foremost of which being the user's patience, which is really limited).

What we want to avoid is that an attacker might use some non-PC hardware which would allow him to suffer less than us from the extra work implied by bcrypt or PBKDF2. In particular, an industrious attacker may want to use a GPU or a FPGA. SHA-256, for instance, can be very efficiently implemented on a GPU, since it uses only 32-bit logic and arithmetic operations that GPU are very good at. Hence, an attacker with 500$ worth of GPU will be able to "try" many more passwords per hour than what he could do with 500$ worth of PC (the ratio depends on the type of GPU, but a 10x or 20x ratio would be typical).

Bcrypt happens to heavily rely on accesses to a table which is constantly altered throughout the algorithm execution. This is very fast on a PC, much less so on a GPU, where memory is shared and all cores compete for control of the internal memory bus. Thus, the boost that an attacker can get from using GPU is quite reduced, compared to what the attacker gets with PBKDF2 or similar designs.

The designers of bcrypt were quite aware of the issue, which is why they designed bcrypt out of the block cipher Blowfish and not a SHA-* function. They note in their article the following:

  That means one should make any password function as efficient as possible for the setting in which it will operate. The designers of crypt failed to do this. They based crypt on DES, a particularly inefficient algorithm to implement in software because of many bit transpositions. They discounted hardware attacks, in part because crypt cannot be calculated with stock DES hardware. Unfortunately, Biham later discovered a software technique known as bitslicing that eliminates the cost of bit transpositions in computing many simultaneous DES encryptions. While bitslicing won't help anyone log in faster, it offers a staggering speedup to brute force password searches.

which shows that the hardware and the way it can be used is important. Even with the same PC as the honest system, an attacker can use bitslicing to try several passwords in parallel and get a boost out of it, because the attacker has several passwords to try, while the honest system has only one at a time.

Why bcrypt is not optimally secure

The bcrypt authors were working in 1999. At that time, the threat was custom ASIC with very low gate counts. Times have changed; now, the sophisticated attacker will use big FPGA, and the newer models (e.g. the Virtex from Xilinx) have embedded RAM blocks, which allow them to implement Blowfish and bcrypt very efficiently. Bcrypt needs only 4 kB of fast RAM. While bcrypt does a decent job at making life difficult for a GPU-enhanced attacker, it does little against a FPGA-wielding attacker.

This prompted Colin Percival to invent scrypt in 2009; this is a bcrypt-like function which requires much more RAM. This is still a new design (only two years) and nowhere nearly as widespread as bcrypt; I deem it too new to be recommended on a general basis. But its career should be followed.

(Edit: scrypt turned out to not to fully live up to its promises. Basically, it is good for what it was designed to do, i.e. protect the encryption key for the main hard disk of a computer: this is a usage context where the hashing can use hundreds of megabytes of RAM and several seconds worth of CPU. For a busy server that authenticates incoming requests, the CPU budget is much lower, because the server needs to be able to serve several concurrent requests at once, and not slow down to a crawl under occasional peak loads; but when scrypt uses less CPU, it also uses less RAM, this is part of how the function is internally defined. When the hash computation must complete within a few milliseconds of work, the used RAM amount is so low that scrypt becomes, technically, weaker than bcrypt.)

What NIST recommends

NIST has issued Special Publication SP 800-132 on the subject of storing hashed passwords. Basically they recommend PBKDF2. This does not mean that they deem bcrypt insecure; they say nothing at all about bcrypt. It just means that NIST deems PBKDF2 "secure enough" (and it certainly is much better than a simple hash !). Also, NIST is an administrative organization, so they are bound to just love anything which builds on already "Approved" algorithms like SHA-256. On the other hand, bcrypt comes from Blowfish which has never received any kind of NIST blessing (or curse).

While I recommend bcrypt, I still follow NIST in that if you implement PBKDF2 and use it properly (with a "high" iteration count), then it is quite probable that password storage is no longer the worst of your security issues.


Dangers of WAP billing? Recently I clicked an ad by mistake on my phone and it routed me through different pages and popups automatically. On of the pages had my mobile phone provider in its URL and WAP-billing. So I searched for WAP-billing but only found vague informations.

What are the dangers of WAP-billing?

Can it automatically (without my interaction or similar like in this case) withdraw money via my mobile phone bill?

Can it be used to identify me(get my name/address/mobile phone number/other ID)?

My provider automatically logs you in on his website without requiring any username or password if you open its website from your connection (most propably checking the source IP address and checking to which customer it is assigned to).

The dangers of WAP-billing include:

Highlevel of difficulty to stop or recoup unintended payments once initiated.
Susceptibility to clickjacking attacks through poorly or maliciously designed mobile web pages and applications.

WAP-billing will automatically add a line item to your mobile bill once you have confirmed the transaction (click). If you pay your bill automatically - it can certainly lead to automatic debits through your mobile provider. Disputing these charges with your mobile provider can be quite difficult because your mobile provider provides the initial payment on your behalf and then passes the charge along to you via your bill.

The information transmitted during each transaction will vary based on the payment gateway used and in some instances does include the mobile number. However, There seems to be geographic restrictions for the inclusion of this information based on a review of WAP-billing payment gateway service offerings. Since the payment is coming directly from your mobile provider there is no reason for any additional information (name, address, etc) beyond what is gathered when you land on the mobile site to begin with to be included in the transaction details.


What security standards apply to physical security for an infosec office I'm looking for actual specific standards that apply to physical access control for Information Security office space. Long story short, our building manager wants an open office concept, and in order to argue this, my boss wants some specific standards. We have to meet NIST and PCI requirements, but we also model our corporate policy from COBIT.

You probably want to have a look at the ISO 27001 standards.

https://www.itgovernance.co.uk/iso27001

Here are a couple of web pages specifically focusing on the physical aspects of offices for security:

https://www.churchillsecurity.co.uk/2017/03/08/iso-27001-protect-secure-areas/

https://advisera.com/27001academy/blog/2015/03/23/physical-security-in-iso-27001-how-to-protect-the-secure-areas/

Google the following terms to find many others:

iso27001 physical security of offices


At what point is deleted data irrecoverable? From reading around on the internet I get the impression that barring physical damage, deleted data can be always be recovered using sophisticated digital forensics.

For this reason the advice is that you should encrypt your data.

So at what point is data irrecoverable even to sophisticated digital forensics?

This depends a lot on what medium is used to store the data and what you consider "irrecoverable".

"Deleting" data mostly does not what most people think it does.
Simply put, after a standard deletion, the data isn't gone but only the link between "Data XY lies at 0x000000" and the actual storage location 0x000000 is being deleted. Your data is still at 0x000000.
File recovery programs will easily restore this data.

HDDs: When deleting data or formatting/deleting partitions, you are not actively erasing the data but also only making it not actively indexed.
To actually erase the data, you need to overwrite every bit.

Actually, to make it really secure, you need to do that multiple times as data on magnetic drives can be recovered even after overwriting it with zeroes.

SSDs: Wear leveling and other features prevent SSDs from actually erasing or overwriting sectors even if specifically advised to. Instead, the SSD controller writes the new data to somewhere else and creates a pointer from the old to the new, actual location. Your old data still lies on the disk.

Most SSDs offer a Secure Erase feature that is designed to tackle those exact problems.

There are research papers dedicated to erasing data on SSDs:

Michael Wei, Laura M. Grupp, Frederick E. Spada, and Steven Swanson. Reliably Erasing Data From Flash-Based Solid State Drives. USENIX Conference on File and Storage Technologies, 2011.

NIST offers an overwriting standard NIST SP-800-88 Rev. 1 that elaborates on 64 pages on the difficulties of erasing data on different mediums.


How long would it take to bruteforce an AES-128 protected pdf knowing the key is 20 letter long and that the charset is A-Z,0-9? The question says everything, knowing that a pdf is protected using standard Adobe password encryption that comes with Acrobat Pro (which as far as i know is AES 128) how much would it take to bruteforce a key which is known to be 20 characters long and that the charset is A-Z, 0-9?
Please assume for calculation a modern GPU rig, or a GPU cluster from for axample Amazon AWS.

A-Z and 0-9 means 36 possible characters. 20 such characters imply 3620 possible keys. That's approximately equal to 2103.4.

The biggest brute force effort currently known publicly was for a 64-bit key (for RC5, but the difference between RC5 and AES is not important here); it is described here. It took almost five years and a lot of contributors; the peak cracking rate was equivalent to what 30000 top computers of that time could do. Of course, this was a decade ago, and computers have become faster, but not to the point of closing the gap from 264 to 2103.4: we are talking about a problem which is 725 billion times harder.

GPU would not be a very efficient platform for AES-breaking; the most cost-effective system would be CPU with AES-NI opcodes. Note, though, that an AES key is a sequence of 128, 192 or 256 bits; not a sequence of characters. Therefore, your characters are probably transformed through some kind of hashing into an AES key, and the hash function computation will probably be more expensive than the AES invocation itself. Depending on the used hash function, GPU may become competitive again. In any case, we are talking about, at best, a few billions of keys per second and per GPU. One billion of such GPU would produce a lot of heat... and would still need billions of seconds to get through (one billion of seconds is 30 years).

So the only realistic answer to your question is: forever. An key of the format you describe (20 characters in an alphabet of size 36) will not be cracked through brute force. Brute forcing such a key would not make sense: even if it was technologically feasible (which assumes more resources than is available to the biggest governments or corporations currently existing), it would cost a lot more than whatever the key is protecting. For instance, if I owned the millions of billions of dollars involved in the process, then I would simply buy the USA wholesale (top corporations, government,... including a complete national debt buyout)(that is, if it took my fancy to actually own the USA, which is, when you get down to it, a weird idea).

(In all of the above I am using the American "billion", i.e. one thousand millions, not one million millions.)


How to proceed if the admin and the responsible CERT do not resolve the issue? About six months ago, while trying new google dorks, I stumbled upon an open folder containing personal files.

To my surprise, google had led me straight to the misconfigured folder of an employee of a well-known science institute. It contains research data mixed with personal photos and financial documents.

I was relieved to find they had the right infrastructure in place; their public PGP key was readily available. But after contacting the security admin and getting his assurance he would check it out, nothing happened.

1.5 month ago, I also reported the details to my national CERT, who agreed to act as an intermediary, and resolve the issue. Still nothing. The page still loads.

I've never been in this situation before, info leaks of this magnitude always get resolved smoothly in my limited experience. So i turn to SE for advice.

What would be a good course of action here? I could alert the affected user, he would be motivated to get this resolved. But i'm not sure that's appropriate and risk-free in this situation.

The important things to answer are:

What's the ethical thing to do?
What's the morally right thing to do?
What's the legal thing to do?
Do I have to act?
What would happen if I didn't act?

I think there is general agreement that it was a right choice (morally and ethically) to notify the local IT staff, as well as the the appropriate CERT.

Now that has been exhausted, what's next? We should probably look at what would happen if you sat on your hands and did nothing else:

You did the morally right thing to do
You did an ethically sound action
You are covered legally, as you reported the issue
Someone else could potentially find the personally sensitive documents

When I submit a security issue, I always get something in writing. From my time in law enforcement, I had a strong policy of CYA, better known as "cover your a**". It's unclear if you did this, but this leads into, "Should I follow up?". You are under no bounds to force people to dig this back up, but you may want to. I would advise speaking with the individual directly, by email, instead of the CERT. You could word the email this way:

  Good afternoon,

  It's important that the two of us communicate, as it has come to my attention your personal files are out on the web.

  I have notified the local IT team and was hopping they would follow up with you, this doesn't seem to be the case.

  I would strongly recommend we talk about this, as the documents (at least from the file names) look to be personal and sensitive. I respect your privacy, and that's why I'm emailing you now, as someone has failed their duty to bring this to your attention.

  You can give me a call at XXX XXX XXX ext. XXXX or email at XXXXXXX@XXXX.XX

  Thanks.

I have found it important not to put too much information in the email, as it pertains to potentially private information, and you don't know who will be reading the email. Also avoid putting links in emails like these, as spam systems might throw the message in the spam folder to never see the light of day again.

Looking at the situation, you are again under no obligation to dig this all back up. From the sound of it, patching privacy issues is not your concern, it isn't your job to do. However, out of the respect of the person, you would want to consider emailing/phoning them, as someone else seems to have failed their job. The only two repercussions that can come out of it are:

They say thank you, and they get to work about fixing it themselves
They become angry, thinking you have "hacked" into their files, and report it.

With the last option, if it's likely, attach a copy of emails you have sent so that the end individual is aware you tried to resolve it.


DirBuster request found in my log files I was going through the logs of my application hosted on IIS 7.5.

I found a request like the following:

2013-08-19 08:14:10 192.168.200... HEAD //DSL/ - 80 - 115.114.27...
DirBuster-0.12+(http://www.owasp.org/index.php/Category:OWASP_DirBuster_Project) 404 6 0 62

Is this some kind of attack? I have searched google for DirBuster and found the following

  DirBuster is a multi threaded java application designed to brute force directories and files names on web/application servers. Often is the case now of what looks like a web server in a state of default installation is actually not, and has pages and applications hidden within. DirBuster attempts to find these.

(Source: http://www.owasp.org/index.php/Category:OWASP_DirBuster_Project)

Should I be worried about this?

This log entry means that someone, somewhere, tries to know the names of the directories on your server by the simple but inelegant expedient of trying a lot of possible names -- and that someone is honest enough to let his tool state it plainly.

Such attacks are very common. Whenever there is a public-facing server on the Internet, seemingly random attacks are to be expected. Most of them are from automated botnets who just try to replicate; they try random IP addresses or server names and then look for "known holes".

There is no reason to worry about DirBuster unless you have on your server a directory which is accessible from unauthenticated users, and yet you would prefer that directory to remain "hidden", and the directory name is guessable (i.e. it is something like "secret" instead of "7o8AW4dslEwrSD78C9xaUdns5"). I would argue that if this is your case, then you have reason to worry: not because of DirBuster, but because you are doing your security wrong and should go back to design phase, this time with an architect who has a clue about security.


Is forbiding the ; char enough to prevent SQL injection? Disclaimer: Parameterized queries are the way to go, no need to discuss about that :)

I've seen the following code at a friends place:

var query = "SELECT * FROM students WHERE name = " + name;

with name being a user provided variable. My obvious reaction was like "Hey John, are you not afraid of SQL injection?". He than stated, that he knows he should parameterize the query but it's not needed for this case as the user is allowed to read everything and he built a simple solution to prevent editing the table/database:

if(query.Contains(';') { throw new Exception(); }

I know I could do something like

name = Felix OR 1 = 1

but this would do no harm as the user is allowed to read everything.

My question is: Is John really right? Is there no way to bypass this simple check to insert, update or delete an entry?

TL;DR No, your friend is not right. INSERT, UPDATE, DELETE and DROP TABLE aren't the be-all and end-all of SQL risks connected to SQL injection.

The very simplest thing I could do with that query is ask repeatedly for a user by the name of SLEEP(3600) (or john' OR SLEEP(3600)=') and, voila, denial of service (as soon as the available connection pool is exhausted - unless memory gets filled up first - while all extant connections are locked waiting for the 3600 second (1 hour) delay to expire).

I could use UNCOMPRESS(HEX2BIN(...)) with a suitable string to trigger a string expansion bomb.

Then I can explore other tables (and possibly even other tablespaces) by using the UNION keyword. If the permissions are set incorrectly and passwords are not properly secured, which happens waaaay more often than you might think, a JOIN against mysql.user can do a world of damage.

And if the user really has "all read privileges", then I could UNION SELECT a nifty variable called @@secure_file_priv and, if it was empty, I could replicate the SLEEP trick using a little-known function called LOAD_FILE(), which under the proper circumstances allows reading - for example - the access passwords to several Web applications that store them, MD5-hashed but not salted (and thus vulnerable to reverse hashing), in insufficiently protected PHP files for ease of recovery.

Finally, what version of MySQL are we talking about? Because this can be deadly important. The ability of using UNION with a known table equals to me being "able to run any SELECT query with the privileges of an authenticated user". In some cases - this is the first I found with a few seconds' googling - this might be a whole lot more than you bargained for.


Possible to prevent Juice Jacking by only connecting USB pins 1 & 4? According to this accepted answer, there is no phone on the market today that is immune from "Juice Jacking"*.   I think an easy way to mitigate this threat is to have a filter that blocks USB pins 2 & 3 and only connects 1 & 4.  (see Wiki for pinouts)

I'm sure that I can't be the only one who thought of this, so I'll assume it's a hardware dongle of some type that I can use to filter power before it gets to my phone.

Question

Is this a legitimate idea?
What hardware devices exist that allow this filtering?
Do any cellular phones incorporate this security feature in hardware? (akin a hardware switch  that opens or closes pins 1&2)

  *Definition: Juice Jacking is when a USB charger is modified so that it reads, modifies or deletes information on a user's cell phone.  This can include stealing passwords or adding spyware onto the device.

Many phones allow you charge with only power and ground connected. Some phones (looking at you, Apple) use the data lines to determine whether or not the charger is "permitted" to charge your phone. Other phones still (some Android phones in particular) explicitly ask you to decide what to do with the USB connection -- e.g. charge only, or mount as usb drive, or application-specific data connection.

Some USB cables (often the cheap ones you get with a cheap charger) will only run power and ground leaving the data lines unconnected. It's pretty trivial to tell if you have one of them by attempting to use it for data and see what happens.

While I don't belive that any "adapters" exist for this purpose, it would be very simple to make one: just take any existing adapter and clip the data lines. Just bear in mind that with some devices (e.g. apple) this will prevent charging.


vt-d Virtualisation and Trusted Execution Technology Being a long time VirtualBox user and having recently purchased a new laptop equipped with an intel i7 720QM I discovered that it supported vt-d.

In the meantime I've found out that vt-d comes with TXT which is a kind of hardware security addition to the i386 architecture. I've got two questions:

Why is vt-d coupled with TXT ?
How does TXT enhance security ?

Trusted Execution Technology is coupled with a collection of security features available on the modern Intel chipset.  The Trusted Platform Module (TPM) and other DRM like features are also in this bundle.  The reasoning behind this is because of abstraction,  which is more commonly attributed to a software architecture.   The commonality behind all of these features is restricting what access a piece of software has and there for they are going to share complexity and thus they become coupled.

This leads into the next question How does TXT enhance security?   A very important feature of TXT is to isolate the memory used by guest vm's.  What if a guest vm had a malicious kernel that tried to access memory owned by a host or another guest?  TXT is very efficient method of preventing this from happening.  Purely software VM's also have this important feature,  but there is more overhead.   TXT also comes into play for controlling who has access to hardware peripherals like the mouse/keyboard and mass storage devices.