Can you use two hardware firewalls? There's a common saying that you should not run more than one software firewalls on the same computer at the same time, for example don't use Comodo and Zonealarm firewall on a single computer because both can cause conflicts with each other.

But, I heard you can use two firewalls if the first one is a software firewall and the second is a hardware firewall, so by that clearly we can use a hardware and a software firewall together. But can you use two hardware firewalls on one network?

Let's say a router is acting as a hardware firewall, can I buy a third party hardware firewall, and hook it up to the router and use the router firewall together with the hardware firewall?

Yes and there are several reasons to do so.

Firewalls like other computing devices occasionally have security flaws which need to be patched. If you were to think of two firewalls or firewall pairs (one behind the other) as two layers of defense if the first layer had an issue and was able to be bypassed the second firewall would be able to prevent outsiders from gaining access to your network.

Likewise different types of firewalls can process different types of attacks at different speeds. Hardware-only style devices tend to process packets at a much faster rate than software firewalls but they don't process or block packets as deeply whereas other types of firewalls can block a much larger number of types of attacks because they do inspection either for more items or cover more of the communications that are being filtered. If a client were to deploy both of these they would want the hardware firewall internet-facing to block the largest number of attacks and then have the software firewall behind it blocking attacks at a deeper layer.

Take this a step further and we have specialized Firewall devices such as Web Application Firewalls (WAFs) which only do filtering on http and https. These are almost always used in conjunction with more traditional firewalls in front of them.

Likewise in a cloud environment it is not uncommon to use a primary firewall in front and also run firewall software on each of the computers in what's known as a Zero-Trust model of firewalling which is also effectively two layers (or more).

Note: Zero-Trust firewalling does not have to have a separate firewall in front this is simply a common deployment pattern I see especially in AWS environments.

Finally to dispel said "rule": You can use two software firewalls like IPTables and mod_security (essentially a WAF) on one computer or even have IPTables forward incoming traffic to a second software firewall for further inspection for things like Data Loss Prevention (DLP) or for advanced malware or application filtering. The use of the second software firewall as a WAF is actually very common for people who run software WAF's.

That said having two software firewalls is not common in traditional computing but it's a very legitimate way to add good security controls to a system and as long as you are adding unique security controls into each layer and not negatively impacting your applications I would say it's very wise to do so.

In regards to having a hardware firewall behind the router. This is very similar to how all businesses have their own firewall behind their router and have access-lists on the router. All companies need to secure that external router so effectively almost all companies effectively do have two layers of firewalling even if one is more actively used than the other. I do this myself because the ISP has access to the network router in my house and I don't trust the ISP to secure it. This is very common in business and semi-common for home routers amongst people in the know about security.

You don't get Defense in Depth from a single layer so having a second layer is always wise and I think it would be wise to question this "rule" you mention about one firewall.

BTW: I once saw a bank that used three different pairs of firewalls in a row for it's Internet-facing banking application.

Useful links for comparison:

https://en.wikipedia.org/wiki/Comparison_of_firewalls

https://en.wikipedia.org/wiki/Application_firewall

https://www.modsecurity.org/


What would be the key size for a picture used as a key? I'm working on a cryptosystem that uses colour pictures as keys for encryption. I'm trying to guess what is the key size of my cryptosystem in order to find the feasibility of a brute force attack. My cryptosystem uses RGB pictures of any size M x N.

The picture is also generated by a chaotic attractor which is sensitive to initial values, so each picture generated is different. These pictures are an example:

I haven't found a paper that tries to do the same calculation yet. Any idea on what the key size is?

Your most recent edit indicates that your pictures are procedurally-generated, so your key size will therefore be bounded by the amount of state required to generate an image. Yours seem to be parameterized by four floats for the initial conditions (and fixed output image size, camera location, point light location, convergence conditions, etc).

Those 128-bits of state will then be transformed into an image by an algorithm that depends solely on your provided state, so your image "key" cannot contain more than 128 bits of information. In fact, I think that entire classes of initial values produce identical outputs (e.g. when all four floats are extremely small), so your image "key" size will be strictly less than 128-bits.

There's really no benefit to touching the 128 bits of state by turning it into an image (and then somehow back) if you only reduce the size of the key by doing so.


Propagating user context between microservices secured with M2M JWT tokens We have a current microservice architecture where we secure communication between microservices via Machine-To-Machine access tokens (these tokens are obtained using the Client Credentials grant flow).
We do this for all communications between microservices, whether triggered by a user action or otherwise (e.g. scheduled task).
The issue we are now facing is that downstream microservices need some user context for actions which have been triggered by a user.
Our current plan is to pass along a user's ID token in a separate, bespoke header. This will allow downstream services to validate the user ID token and extract out user information.

However, we have been warned that this is opposite to how ID tokens are expected to be used.
Cons-

ID token is being used in a non-standard way. It should be restricted to the SPA.

Pros-

Simple and convenient. ID token is already available and is signed.
User Access Token is not propagated, keeping it secure between SPA and Gateway.
Blast radius is reduced - tokens are limited in their use, so if a service is compromised access is only to the next level of services.

I feel like we are missing something obvious. We are securing our communication between microservices with M2M access tokens, but the alternative seems to be to replace this with a user access token which follows the request to all downstream services.
(We previously used network rules to limit communication between microservices, but this is no longer feasible due to using multiple VPCs and the large number of microservices we now have.)
My questions-

What alternatives options do we have?
Have I missed any major downsides with our current approach?

I think the advice you got to not send the ID token is good. In general, an ID token should never be forwarded to some other entity besides the client that received it. Besides just breaking this cardinal rule, there's no cryptographic or physical relationship between the two tokens. As a result, a substitution attack vector is opened up. In other words, the micro-service receiving the two tokens has no way of knowing that the non-standard presentation of the ID token was replaced by an attacker with their own since that token is not related in some way to the access token it finds in the normal Authorization header of the same request.
When working in a micro-services environment where you need user context info into the bowels of the mesh, you have three options:

Share access tokens among the micro-services
Embed other access tokens in the one initially issued to the client (or the phantom equivalent)
Exchange one token for another

You'll use option one when multiple micro-services make up the same security context. If they belong to the same bounded security context, then it's OK to share them. If this is the case, they will have the same "audience" and the access token will be audienced to that set of micro-services. An example of a shared context might be a handful of "payments" micro-services that work together to perform payments functionality. These all come into contact with the same product data, user data, etc., so they are effectively the same entity from a security modeling perspective, one could imagine.
When a micro-service calls another in some other security context, it will use one of the other two approaches. The first is the easiest but requires knowledge of a priori of the call from one context to another. In other words, when the token is issued at the authorization server, it must be known that the receiver of that token is going to call a service in a foreign domain (i.e., some other security context). With this knowledge, the authorization server can embed a token for that purpose in the one it issues to the originating micro-service. This is very typical even if it sounds outlandish at first. Think again of that payments service: it's easy to foresee that it will always call an accounts service which may be in a different security context. For this reason, the authorization server may always issue a separate token scoped for accounts and embed that in another that is scoped to payments. It will issue this token within a token to any client that requests an access token with the "payment" scope.
The other choice is to exchange one token for another. This will be done when the calls from one service to another are not known at the moment of token issuance. This can be the case, for instance, when the number of hops is very large, or the route is contextual and user-dependent. When exchanging one token for another, it's important that the scope of access be controlled. You don't want to exchange a low-power token for a very powerful one, for instance. So, think about scope enlargement and try to forbid or greatly control that during an exchange. A good article about batch processing that discusses exchange more can be found on Nordic APIs.
(These three options are orthogonal to whether or not you use the phantom token or split token approaches. One of those may be used in conjunction with these token propagation techniques. If you use those techniques, which you probably should since you have a gateway in the mix, your front-end SPA won't be able to access the actual access token nor any others that may be embedded in it.)


How do I tell the difference between a fake "problem loading page" and a real one? We know that due to numerous reasons, a browser will display a page like "Problem loading page" or "This page can’t be displayed."

But there's one huge problem: browsers seem to show this error page as if it were any regular webpage, so an attacker could replace this browser-generated one with a fake one, with buttons that link to a malicious script or page. They could simulate various error pages based on user agent, simulate a delay serving the page as if the browser was timing out, replace the favicon, and voila, an identical-looking (and malicious) error page.

How can I, as an end user, figure out that this is not a real error page and that I should not click anything because it might compromise my browser security?

With difficulty, if you're a typical end user.

It's important to make a distinction between server generated error pages (e.g. 404 messages or similar), and browser generated pages (e.g. Network problems, server not found). Server generated pages are essentially normal web pages. They can do anything a web page can do, whilst still being an error message which may have been sent with a special error code (such as the common 404) - there is nothing special in the handling of these by browsers, if they provide content. If they don't provide content, browsers will usually give a default message rather than leave the user staring at a blank screen. You generally can't tell the difference between a server generated error page and a browser generated message in this case, unless the server sends an error page which doesn't match your browser - the only difference would be in the size of the response, which an average user may not know how to check.

Browser generated errors are more interesting in this situation. These are shown when the server cannot be contacted for some reason - network failure, mistyped domain name, that sort of thing. In this case, the page shown is generated by the browser. This is key to spotting if it is fake - browser generated content is, effectively, instant to load. It's not coming over the network, so appears as soon as the browser discovers a problem. A fake browser message would have a network delay - might not be much, but it will exist.

You could also open up the built in browser debug tools by pressing F12 and then try refreshing the page. For a genuine network issue, you shouldn't see any traffic being sent or received. For a fake one, there would be at least one connection.

However, is it worth worrying about? What could such a page do? Potentially it could serve up malware, but you wouldn't need to interact with it for that - by the time you notice, it's too late. It can't access any other browser data (cookies and local storage are subject to same origin policy, so are only available to the originating domain), and any flaw that allowed other access would work just as well on a standard page.

In short, you're probably safe to play the dinosaur jumping game on Android Chrome if it pops up!


What is the correct way to remove bitlocker secrets from a TPM when returning a device for warranty? Note: This is not a question about how to preserve data on a device that is returned for warranty.  Rather, this is a question about how to ensure that the encrypted remnant data on the device is not accompanied by decryption keys when the device is returned for warranty.

I have a Surface Pro 2 that has to be returned for warranty.  It is still operational except that it reboots when you move it in just the right way.

When the device was deployed, the drives were encrypted using bitlocker.  The encryption took place prior to writing any sensitive information to the drives.  For this question, let's assume that I trust the device and Microsoft and that the device hasn't been pwned by way of some vulnerability or software that has been installed.

TPM Secrets

This device has relied on the security of the TPM to protect the sensitive information in case the device was stolen.  As I understand from this Chris Tarnovsky's presentation it is probably feasible to read the secrets from a TPM.

Since this is not a theft it seems like it should be possible to delete the secrets from the TPM and avoid that whole vulnerability.

Suspend-Bitlocker

Windows allows you to Suspend-Bitlocker which "makes the encryption key available in the clear."  This seems to be what Windows defaults to when you manage the TPM from Windows.  Obviously, I don't want to send the device back for warranty with bitlocker suspended.

Questions

What secrets reside on the TPM which, if compromised, could be used to decrypt the contents of the drive?
How can I ensure that the secrets are removed from the TPM?
Is there a way to remove the secrets from the TPM in a way that avoids Windows making the encryption key available in the clear?
Are there other precautions that I should consider taking prior to sending the device back for warranty?

Windows Refuses to Part with Bitlocker Secrets it Relies on to Boot

I did not find any official documentation from Microsoft for how to clear bitlocker secrets from the TPM without a copy of the secret being written to the volume in cleartext.  I tried to delete the bitlocker secrets using commands running within the instance of Windows the secrets were protecting.  Every effort I made to do so failed.  It seems you can clear the secret from the TPM, but only once that secret is written to the volume it is protecting in cleartext.  I suppose this is to prevent TPM users from inadvertently ending up in a state where they cannot unlock their bitlocker-protected system volume.

In other words, any given Windows installation refuses to part with the bitlocker secrets it needs to boot.  I really wish I could find some official guidance on how to correctly clear bitlocker secrets from a TPM that is physically attached to the storage it is protecting.  This arrangement is common on many modern tablets and notebook computers, but I couldn't find any published best practice for decommissioning such a device.

It Seems like Another OS Installation Can Clear the Bitlocker Secrets

I did determine that it seems another OS installation that boots on the same computer can clear the TPM.  If that is the case, clearing the TPM of its secrets without them being written to the volume in cleartext should be achievable by booting to another OS and clearing the TPM from there.

Premise and Procedure

Note: I am neither expert at Windows security, nor am I knowledgable enough about the inner workings of TPMs or bitlocker to confirm that this premise is correct or this is an effective procedure.

This procedure is based on the following premise:

When bitlocker is enabled in TPM mode the only copy of the bitlocker secret on the device resides in the TPM.
When an operating system not protected by the TPM is booted on the device, it can clear the TPM without accessing the secret in the TPM.

If the above premise and my reasoning is correct, the procedure to completely clear the bitlocker secrets from the device is as follows:

Boot to the instance of Windows protected by bitlocker.
Ensure that bitlocker is "on" for all drives.  (If bitlocker is not turned on, then either the data on the drive or the secret that can be used to decrypt the data is in cleartext on the drive.  If that is the case, this procedure won't help you.)
Shut down the computer.
Boot the computer to another OS without entering the TPM pin.
Clear the TPM from the OS you booted to in step (4).


My website has been hacked, what do i do next? So. I couldn't see any other question like this on Sec.Se so i thought i'd ask.

My public website www.foo.com has been hacked. The front page is sending it to be redirected to seoblog.fooblog.com in order to gain page ranks.

The attacker (based on the language of the blog (Indonesian)) is presumably overseas. Can i track them down and prosecute?

What should i do next?

I need to know:

How to find out how they got in
How to find where the attack came from
How to to treat my findings
When to involve Law Enforcemnet
How to stop the attack from happening again

Hope you can help :)

This is a forum for IT security experts not legal experts in international IT law, so questions about prosecution / law enforcement are mostly off topic.  Though I'd first harden your system and later think about trying to prosecute; as tracking down who was the human user at the other end is not a trivial task -- especially if it happened overseas.

Can you describe your setup?  Is it on a linux server/windows server/shared host/wordpress blog?

You've given us very little information.  Before figuring out how they got in, let's first see what is going on.

How is it being forwarded?

Javascript?  (E.g., disable javascript in your browser -- does it still forward?)
HTTP META refresh tag or in an iframe?  Use a utility like curl / wget to download a static copy of the html from your webpage.  Is everything in a giant <iframe> or is there a tag like <META http-equiv="refresh" content="0;URL='http://random_other_site.com' />
3xx HTTP Redirect?  Use a utility to look at the HTTP headers.  E.g., in google chrome - press ctrl-shift-I to pull up developer tools, go to the "Network" tab and try visiting your page.  If the http status code is 302/304 (or something else in the 300s), they've altered your server code.  Can you login to your server?
DNS pointing your domain to somewhere else?  Run dig www.foo.com - does it point to your IP address?  (They likely managed to change your authoritative DNS records -- go to your registrar to get back control.  They probably managed to get your passwords at your registar somehow.)
ARP poisoning on your local network? (Try visiting your site from a different network).  (If this is the case; just lock down your routers.)
Changed your content to their content on your website being served by your webserver?  (Look for weak passwords; vulnerabilities where unauthorized users can upload files).

As for how they get in; depends on the type of attack.  Maybe you (or any other user with access) you have a weak password (and it was guessed) or one that you've reused elsewhere, or weak password reset mechanism, or you authenticate into your server without using SSL, or you've logged in once from a machine with a keylogger, and the attacker captured your login information.  Possibly your site was vulnerable to say cross-site scripting that injected malicious javascript to redirect your site.  Maybe your site is configured weakly, used tools that have known 0-day vulnerabilities that allowed attackers to randomly upload files to be served and change content.


How to write Snort rules based on MAC address? I would like to create Snort rules based on MAC addresses instead of IP addresses. Most devices on the network are DHCP assigned, and I would like to ignore certain traffic (ex: Dropbox) for some devices without having to use static addresses or DHCP reservations. Can this be done?

Snort works higher up on the stack. The protocols it deals with are TCP, UDP, ICMP, and IP.

Check out the manual.


How often should SSH_MSG_IGNORE messages be sent? The SSH2 protocol defines the SSH_MSG_IGNORE message type as a means of disguising actual message lengths from strongly correlating with encrypted message lengths.  I have not found any recommendations on how often and when these messages should be sent to be effective. Is there any literature or publications on this I'm missing?

There if RFC 4251 describing when the SSH_MSG_IGNORE should be used:

  If there are no unsent packets, then a packet containing SSH_MSG_IGNORE SHOULD be sent.

There are also examples how this should be used in the same RFC. For more reference, you can consult OpenSSH implementation too, which sends this mesasage under this condition:

if (compat20 && c->isatty && dlen >= 1 && buf[0] != '\r') {
    if (tcgetattr(c->wfd, &tio) == 0 &&
        !(tio.c_lflag & ECHO) && (tio.c_lflag & ICANON)) {

In the english, when we work with TTY, there is something to write to the remote channel (other than newline) and terminal flags do not contain ECHO settings and there is canonical mode.


TPM 2.0 PKCS#11 on Windows and Linux The new Skylake processors have integrated TPM 2.0 inside.

Is there any way how to use the TPM 2.0 as a PKCS#11 token on Windows and Linux for symmetric and asymmetric keys?

TPM 1.2 has a PKCS#11 libraries and I am looking for something similar for TPM 2.0 to use its new RSA keys and certificates hierarchy.

- It's a bit old question, but I managed to found a solution that worked for me.

There's available on Github a module that provides PKCS#11 backend for TPM 2.0 chips.

Usage:

Create TPM Key

Create a primary key with hash algorithm sha256 and key algorithm rsa and store the object context in a file (po.ctx).

tpm2_createprimary -H o -g sha256 -G rsa -C po.ctx

Now create an object that can be loaded into the TPM with parent object from file (po.ctx) using hash algorithm SHA256 and key algorithm RSA output the public and private keys to key.pub|priv.

tpm2_create -c po.ctx -g sha256 -G rsa -u key.pub -r key.priv

Load the private and public keys into the TPM's transient memory.

tpm2_load -c po.ctx -u key.pub -r key.priv -C obj.ctx

Make the object persistent, specifying a valid handle.

tpm2_evictcontrol -A o -c obj.ctx -H 0x81010010

Now you can remove all temporarily files.

rm key.name *.ctx

Install TPM2-PK11 and copy config.sample to ~/.tpm2/config.
Create a certificate (eg. w/ Certtool (GnuTLS)).
Configure your application to use TPM2-PK11 and the created TPM key.

OpenSSH Client:

Create configuration file and change it for your setup:

cp config.sample ~/.tpm2/config

Extract public key:

ssh-keygen -D libtpm2-pk11.so

Use your TPM key:

ssh -I libtpm2-pk11.so ssh.example.com

or add the PKCS#11 module to your ssh config in ~/.ssh/config:

Host *
    PKCS11Provider libtpm2-pk11.so

Firefox:

Go to Preferences, Privacy & Security and click on the button Security Devices.
Press Load and select the libtpm2-pk11.so installed on your system.
After loading the TPM2 PKCS11 Slot should now be listed in the Device Manager and your certificates should be listed when selecting View Certificates under Your Certificates.


Is it safe to share .git folder of a public repo? Say I cloned a repo, then maybe worked on it a bit. Then I reverted/pushed all changes, so my friend has all the repo files. Is it safe for me to send him the .git folder? Is there any private information there, such as my username, my email, command history, or perhaps some secrets?

The contents of your .git repository may contain loose objects that you may not want to share (e.g. something you committed but changed your mind and deleted/amended), so there is no definite "yes, this is safe."
A better way to share git repositories offline is to create a bundle file and send that to your friend, e.g.:
git bundle create /tmp/myrepo.bundle --all

Then you can send myrepo.bundle to your friend and they can clone from it like they would from any remote:
git clone myrepo.bundle

That would be a better way to make sure that you're not sharing loose objects that aren't intended to be seen by others.


Trusting SSL and the Trust Chain As we all know, when an SSL Certificate is assigned, there is a trust chain that is created for verify everyone from the Certificate Authority to the actual website's SSL Certificate.

Thanks to a good discussion with a security expert, I am lead to believe that this trust chain is flawed by the way it is done. After so long in the chain, it seems like you are just blindly trusting everyone that assigns/controls the certificate, even the Certificate Authority.

Is this method blind trusting the Certificate Authorities, Root Authorities, and everyone that processes the SSL Certificate?

I do see this as a major flaw in the system which we hold dear and use.

The chain is not verified "by itself". A given system (say, a Web browser) will consider a server's certificate as valid because it could build a valid chain (with all signatures corrects and matching names and all the rules of X.509) which ends with the certificate to validate (the server's certificate), and starting with a root CA that the client already has.

Signatures don't create trust, they transport trust. It still has to start somewhere. Each client (either in the browser or in the OS itself) comes with a list of "trusted CA": these are the public keys and names of some entities which are deemed "trustworthy" (you did not choose them yourself; Microsoft did that for you; but, anyway, as long as you use Microsoft's software you are trusting Microsoft for not playing nasty games on you). The root CA are "trustworthy" if you trust them for not issuing certificates with fake information: when a CA issues (sign) a certificate for some entity E, it is supposed to make sure that the public key that the CA puts in that certificate, along with E's name, is really owned by E. Similarly, when a root CA delegates its power to another CA (then called intermediate CA or sub CA), it makes sure (through audits and binding contracts) that the sub CA is indeed trustworthy, in that it will apply the same rules.

That's the concept of a Public Key Infrastructure: as a client, you know a priori a handful of public keys owned by trusted CA, and you implicitly trust everything that these CA signs. The certificates assume a tree-like structure, with the root CA as, well, the tree root (hence the name), and the end-entity (SSL servers) certificates as leaves. A certificate chain is really a path from the root to a given leaf.

If a root or intermediate CA becomes untrustworthy, for instance because it was hacked and issued a fake certificate (a wrong association between name and public key), then the recovery entails severing the bad branch, a process known as revocation. In practice this does not occur often for big commercial CA (the ones that are trusted by default in Windows or Firefox); say about once a year. E.g. that one occurred a few days ago, and both revocation and a fail-safe patch from Microsoft block any attempted usage of the rogue certificate. In practice, normal attackers (say, for phishing purposes) don't bother obtaining "valid" certificates for their fake servers.


What are good proof-of-concept implementations for general security awareness training? I will be giving a presentation on "cyber security" to a school class of 16 year olds and want to show them how network security works, how important privacy is (and why it matters) and how to protect oneself online.

Apart from (static) general slides on the topic I want to show them in an visually appealing and understandable way how "hacking", tracking for advertisement and phishing works.

So far I have prepared:

A WiFi hotspot with mitmproxy running to intercept a WhatsApp message sent from a prepared phone
Wireshark running on the same hotspot to show them how easy it is to inspect their web traffic
Firefox Lightbeam addon to show them how ad networks track them

Now I'm looking for more ideas / proofs of concepts of hacks that are easy to deploy / run and show how (in)secure something is.

What are good proof-of-concept implementations for general security awareness training?

Sounds like you really put some thought in that lesson, sounds really fun. I used to run a gaming company and our players were around that age. Here's what we dealt with most:

Maybe you could give an example of brute forcing insecure passwords and how simple it is to hack your accounts with insecure passwords.

Maybe you could give an example of a keylogger that is installed via an email attachment or java web applet. Most examples of this i saw using a youtube video advertising "cheats" for a game if they install something but really it was just a keylogger or a RAT.

Maybe you could give an example of session hijacking (for example their Facebook session.

Maybe you could show how easy it is to make a copy of a website and send somebody to it to steal their password. For example what we saw a lot is youtube videos claiming that you can get free stuff on a website only if you entered your password.. obviously they stole the stuff :-) you could do this by making a post on a forum that accepts HTML input in posts and adding something like

Log In To Facebook

Lastly, maybe you can put something about the exposure of yourself when you add somebody on Skype (IP address, maybe location etc).

Hope that helps!


Should hashing hashed hashes colide or not? Since key stretching basically boils down to hashing hashes over and over again (where salt, pepper and password individualize the hash function, but the principle remains the same), I wonder about this question.

On the one hand, hashes should be as collision-free as possible. For hashes themselves, that is theoretically achievable due to the same length, but this would yield the existence of a bijective map, i.e. for each hash h₁ you could give another hash h₂, the hash of which is the original hash h₁ again, so you can invert the hash. Then you could "simply" use the inversion to invert the entire chain of hashes and craft a valid password - even worse, if salt/pepper and password influence the key derivation in the same way, this could potentially render the salting useless since the crafted password might compensate its influence.

On the other hand, if hashing hashes collides, this means that some hashes are safer than others - some hashes cannot be obtained by hashing another hash, but other hashes can be obtained from multiple hashes. And these hashes would be attractors and be much more likely to occur after many rounds of hashing than the unobtainable ones, effectively reducing the potential keyspace.

So, which of these two possibilities is worse, and which one is the actual case in reality? Since the choice of password and salt/pepper modify the hashing function, does the answer depend on that? Could this problem be solved by concatenating the entire chain of hashes instead of only the final one? (If that doesn't already have a name, may I propose hash cat?)

Since hash functions have a much larger input space than output space, collisions are a normal feature, and it is expected that every possible output corresponds to a lot of matching inputs.

As a rule, collisions are not a problem for password hashing. The previous paragraph means that, for every hash output (in particular the one stored in the server database) then there are many matching passwords which are all equivalent. However:

to find any single password which matches the stored output, you have to break preimage resistance of the hash function;
to find a second password which yields the same hash than a known password, you have to break second preimage resistance of the hash function.

A "cryptographically secure" hash function with an output of n bits ought to offer resistance 2n to both kind of attacks, so no real problem here. Known a collision in abstracto does not give much power to any attacker: the attacker can use a given password, and he has a "spare" with the same effect; so what ?

As for the reduction of space when iterating the function, see this previous answer. Summary: space reduction does occur, but not below an inner space of size 2n/2, which moreover:

requires a lot of effort to be actually reached;
cannot be efficiently characterized (you cannot easily know if a given value is part of that inner space or not).

Use SHA-256 and be happy.


Why are application/services still using outdated Blowfish encryption? Is it secure? For example, CrashPlan, an online backup service, is using 448-bit Blowfish to encrypt its backup files (only enterprise product line has the ability to choose using AES-256). According to Blowfish's creator Bruce Schneier, people should already move onto more modern successors. Why don't these application/services use Twofish, Threefish or AES instead? Is there any particular reasons or benefits to use Blowfish on services like online backup, or it is just an ill practice of the developer?

Is it still secure to keep using the more-than-two-decades-old Blowfish? Won't flaws and security holes be revealed over time?

You could ask this question with hundreds of encryptions. Why is Windows 10 using SHA1, which has been convincingly broken since ages? And despite MD5 has been proven not to be safe as well, many companies still use it for integrity checks.

In the whole area of information security, you have a visible gap between what would theoretically be more secure and what is more convenient to implement and administer.

Regarding your question, Blowfish is not unsafe, even tho Schneier recommends Twofish now. Some algorithmus like RSA are also really old and yet still valid. The fact that, over time, more and more security holes are revealed, is actually an advantage because that way these can be fixed. Older implementations of algorithms which are maintained and audited are more safe than newer ones.


How to maintain balance between integrity and client satisfaction in vulnerability assessments I have done a number of vulnerability assessments and I'm noticing a trend.  In the first assessment the clients are impressed and grateful for the massive security holes I find.  During the second and third assessments, they feel frustrated because they were hoping to get a "clean report" that they could tuck into their marketing package and brag about to their potential clients.

Even though they are doing a good job in mitigating the issues, the problem is that I'm better at my job so I always find more.   On top of all that, there is no such thing as perfect security.   I believe the only "clean report" is one where the assessor didn't dig deep enough.  By the very nature of vulnerability assessments, I'm working against them - and yet I run a business and I need to find a way to work with them at the same time.

I also pride myself at being very helpful in teaching developers how to mitigate issues.  The reality is that more often than not the theory doesn't get translated into practice.   The developers cite tight deadlines and tight budgets from their management.  I know the industry so, it's not hard to believe.

This puts me into awkward situation.  Clients are scared to do an assessment with me because they feel they are not ready and haven't patched enough.  They are (rightfully scared) of what I will find.  Some even tell me "don't go so deep this time, ok?".  And because I don't want to lose their business I find myself holding back my full abilities.   Needless to say, this rubber stamping is not fun at all.  It may be profitable, but not fun.

I'm also worried that this will backfire because inevitably someone else will re-assess what I did and find massive holes.  They they will conclude that I have no idea what I'm doing because I missed such obvious flaws.  Reputation is everything in this industry, so this is a big risk.

One solution that I can think of is that I keep finding fresh clients and staying away from 2nd and 3rd assessments.  Finding fresh clients is something that I find frustrating and inefficient.  I like repeat business where my relationship gets deeper over the years.   It's the long term relationships that I enjoy in my business.   The closeness is what creates the problem in the first place.   Has anyone found an alternative where  you can keep exposing never-ending flaws while keeping a client happy?  Or am I just dreaming?

The other solution I tried is restricting scope.   If I only test a small part of the stack, the client could get what they are looking for: a "clean report".   But it's rare that they agree to that.  They usually want everything tested. They can't have the cake and eat it too, but I have trouble communicating that to them.

I think I know the answer to my own question.  I'm just wondering if I'm missing something here or if this is just the way it is and I have to deal with it.

Sounds like you're doing security assessments for compliance reasons, but I see no mention of compensating controls, acceptable risks, remediation plans in action, etc.

This whole question is really weird to me because from the information you've provided in your question, it seems like neither side of the business relationship -- either you or the client telling you to cover things up -- is qualified to perform compliance assessments. Not trying to be harsh, but there's simply way too many red flags. I'll explain why below.

For some things, the client will not, cannot, and should not be forced to fix in order to get a "Clean Report," but let's [Mass Dispel] some  things first.

Security Assessments

A security assessor's job is to find vulnerabilities, and help explain away vulnerabilities that are not exploitable. Something may be vulnerable, but there could be multiple reasons why it isn't exploitable.

It will then be your job to examine the evidence and determine whether or not the evidence is correct, and then exclude those irrelevant items from the report. In the case of PCI compliance, evidence of this will need to be provided to a third-party Qualified Security Assessor.

If they're hiring you to do the explaining, you'll need to dig deep on each vulnerability you find and attempt to assess whether or not that vulnerability can be exploited. Work with the engineers (sysadmins, developers, network engineers) to get the information you need.

It could be something simple such as nmap/Nessus/etc. returning the wrong version, not realizing that a backported version exists, or something to do with multiple compensating controls for common TLS "misconfigurations."

You can check for the exact version with dpkg -l | grep 'package' for example, then determine if a backported security patch was applied. This problem is really common with many approved scanning vendors.

These are businesses who can't stop what they're doing to fix every little thing that isn't exploitable. It's not a sustainable security model. Should they still be made aware? Absolutely. But they need to prioritize fixes and manage risk.

Clean Reports vs. Fraud

Correct me if I'm wrong, but it sounds like they're looking for a clean report with no remediation. Something's really fishy here. This doesn't make sense.

Any reputable company, especially those involved in required compliance audits, be they quarterly or yearly, will fix all of the vulnerabilities which prevent a passing score for their compliance report. In many cases, they are able to circumvent fixing these vulnerabilities if they can provide documentation for compensating controls, acceptable risks, remediation plan in progress, etc., and you will be required to accept these circumventions if their evidence is correct, but you will need to examine it yourself.

If they attempt to pass off a clean report that is not really clean, then it's fraud - especially if they're pushing these lies to their clients. That's fraud in the highest order, and you do not want to be complicit in this. There will be severe penalties for both you and your client.

Fraudulent Activities

My responses in this section will be made with the assumption that no compensating controls, acceptable risks, remediation plans in action, etc. exist, and they're trying to cover up vulnerabilities.

  They are (rightfully scared) of what I will find. Some even tell me "don't go so deep this time, ok?"

Assuming what you're saying is true and not taken out of context, then I'm pretty sure that's illegal -- unless you're going out of scope. The company should provide you a scope, and you must stay within whatever is determined to be in scope for the audit. If you intentionally go outside of your defined scope, I'd be surprised if they continue to hire your company to perform assessments as that's a betrayal of trust.

  The other solution I tried is restricting scope. If I only test a small part of the stack, the client could get what they are looking for: a "clean report". But it's rare that they agree to that. They usually want everything tested.

I'm having trouble with this. Almost every single client will provide a scope, especially those going through compliance audits. Not everything is going to be in scope for them. If you want to go out of scope because you think you found something dangerous, you need to ask permission and get it in writing.

  I'm also worried that this will backfire because inevitably someone else will re-assess what I did and find massive holes. They they will conclude that I have no idea what I'm doing because I missed such obvious flaws. Reputation is everything in this industry, so this is a big risk.

If you're within scope, then... do you want to be complicit in fraud? You're worried you'll lose clients if people are asking you not to dig too deep, but think about what will happen when a qualified auditor shows up and discovers your company is complicit in fraud.

This is an extreme ethical violation. If you have an (ISC)² certification, then prepare for revocation if anyone finds out. This can also amount to a federal crime if you're in the United States, or anywhere else where fraud is illegal.

Believe me, as someone who has dealt with multiple penetration testing and security assessment firms, if you hold back on glaring flaws like this, many of us will no longer do business with you. If you have a reputation for doing this, it will spread quickly. I've seen consultation firms dropped for not finding very basic things that we already knew about.

Clean report with Remediation

However, it's not uncommon for companies to provide a clean report after they fix your proven vulnerabilities. There should be no need to provide penetration test and security assessment reports that contain vulnerabilities, but only the report after the company remediates them.

If you find more vulnerabilities afterwards (provided they're paying you to do so), that's actually great! Any reputable company will be glad to fix these problems (or have you or themselves explain compensating controls, acceptable risks, remediation plan in progress, etc.) so they can pass their audit.

If they're hiring you too late in their compliance audit process and are worried it won't be completed fast enough, then that's on them and not you -- unless you're too slow at getting your job done within a reasonable time frame.

Where's the remediation coming into play here?

Bringing Balance to the Force

  How to maintain balance between integrity and client satisfaction in vulnerability assessments

There is no balance in the case of fraud or other crimes.

Do your job and do it right. Don't violate anyone's trust and do not commit fraud. Clients who ask you to commit crimes are not the type of clients you're looking for, or they shouldn't be.

TLDR

Get some more experience with assessment and compliance auditing. Manage risk, but don't commit fraud.


Vulnerability scanning of AngularJS web app fails due to '#' in url I tried scanning my web application built with AngularJS front-end and PHP backend. But scanning with scanners like Nessus and Websecurify fails due to '#' in URL. My URL has format

http://domain.com/webapp/index.php/base#controller/function

When I checked apache access log, I found that scanners discard URL portion after '#'. So it always scans for http://domain.com/webapp/index.php/base.

How can I solve this issue?

Browsers don't submit anything after the hash character to the server. Anything after that character can only be access on the client side with JavaScript. Some vulnerability scanners (like burp suite) perform a static code analysis to see if the application is vulnerable to DOM-based cross-site scripting, for example. They generally don't execute JavaScript, so the typical scanning methods don't apply here.

Also see: https://en.wikipedia.org/wiki/Fragment_identifier

  The fragment identifier functions differently than the rest of the URI: namely, its processing is exclusively client-side with no participation from the web server — of course the server typically helps to determine the MIME type, and the MIME type determines the processing of fragments. When an agent (such as a Web browser) requests a web resource from a Web server, the agent sends the URI to the server, but does not send the fragment. Instead, the agent waits for the server to send the resource, and then the agent processes the resource according to the document type and fragment value.[2]

So your options are to manually fuzz the parameters after the hash character in the browser or read the JavaScript source code.


Securimage php library for Captcha Code showing security issues in Arachni Scanner I have used the securimage PHP library to show a captcha on my form. But when I'm scanning my page for vulnerabilities using Arachni scanner, it shows the following message and it's trying to scan the same page with some different values repeatedly:

http://example.com/libs/classes/securimage/securimage_show.php

I have used the Captcha code in the form with the following method:

<?php require_once('libs/classes/securimage/securimage.php');
 echo(Securimage::getCaptchaHtml()); ?>

Arachni scanner is showing the following message:

  A modern web application will be reliant on several different
  programming languages.

  These languages can be broken up into two flavours.  These are
  client-side languages (such as those that run in the  browser – like
  JavaScript) and server-side languages (which are  executed by the
  server – like ASP, PHP, JSP, etc.) to form the  dynamic pages
  (client-side code) that are then sent to the client.

  Because all server-side code should be executed by the server,  it
  should never be seen by the client. However, in some scenarios,  it is
  possible that:

  The server-side code has syntax errors and therefore is not executed
  by the server but is instead sent to the client. Using crafted
  requests it is possible to force the server into  displaying the
  source code of the application without executing it.

  As the server-side source code often contains sensitive information,
  such as database connection strings or details into the application
  workflow, this can be extremely risky.

  Cyber-criminals will attempt to discover pages that either
  accidentally or forcefully allow the server-side source code to be
  disclosed, to assist in discovering further vulnerabilities or
  sensitive information.

  Arachni has detected server-side source code within the server’s
  response.

  (False positives may occur when requesting binary files such as
  images (.JPG or .PNG) and may require manual verification.)

I have tried to pass the session_id() in parameter to validate the class method. I also used another parameter to stop directly showing the captcha image in the URL but with no luck.
What should I do to fix this problem?

(False positives may occur when requesting binary files such as images (.JPG or .PNG) and may require manual verification.)

This is telling you pretty much everything you need to know. You're including a binary file, and the scanner knows that it has trouble distinguishing between server-side source code and binary files.
It's safe to assume that this is a false positive.


Safe to disable UAC? I have programmed my own Windows kiosk application (.NET) which requires admin rights from the OS to ensure certain services are running (amongst other things).

However, this causes the UAC prompt every time the application starts. Obviously this is not ideal in a kiosk situation where the power may be switched off or if silent updates are required.

Other than a non-scalable trick using Task Scheduler, there is unfortunately no way to add exceptions for the UAC prompt; although I can understand why this is.

The other caveat is the kiosks will also be connected to the internet.

But, given the situation, disabling UAC entirely seems to be my only option.

If my software is the only thing that will ever be installed (on a clean OS), is this safe enough, or will it still be open to random attacks from the internet (excluding any security flaws in my own software, of course)?

All advice appreciated - thanks.

Remember, the "U" in UAC stands for User.  In the case of a kiosk, who is the user?  Almost certainly it will not be you.

What good outcome could you expect from UAC on a kiosk?  Do you expect it to prevent the installation of malware if someone is surfing to evilsite.com?  Do you expect the bored kid who surfed to evilsite.com to tap "no, I didn't mean to install a virus on this kiosk?"  Also consider the case where you're trying to send out a patch, and UAC prompts the screen for yes/no; some random customer at your kiosk decides to helpfully tap "no".

UAC needs to be off for a kiosk.  It's not a question of "is it safe?"  Your security has to come from your other activities hardening the machine.  You have to disable accessibility keys, task manager, and a host of other things that can be started by hot keys or gestures.  You have to block browsing to unapproved sites.  You have to lock that machine down hard, and even so you should expect that clever script kiddies will find a way to infect it; so it's even more important that you isolate it from the rest of your network in a DMZ.


Local Scans initiated from a VLAN Broadcast IP address Just reviewing some logs and I am seeing local scans to several local IP addresses on port 137 within my network. The source IP however is the broadcast IP of the VLAN (.255).

I have checked the logs and I can see the broadcast IP trying to initiate udp 137 connections on several other IP addresses of the same subnet.

Many of the errors being shown are "The Windows Filtering Platform has blocked a connection".

I cant really make sense of the Source IP address being the broadcast IP. Has anyone come across this before please? and from your experiences, where should I be looking that I could have missed? Thanks.

It is possible to source a packet with an arbitrary IP address, even an invalid IP address.  This is commonly done with DDOS attacks.

For scanning to be effective, the scanner needs to get the response traffic back. If the scan came from 192.168.2.255, and if the network was 192.168.2.0/24, then the response would be broadcast on that subnet and every host on that subnet (including possibly the scanner) would see the response.

To identify the scanner, look at the Ethernet header of an inbound scan on the originating subnet, and look for the source MAC address.

Long ago, “IP directed broadcast” was enabled by default on Cisco routers.  My company used to synchronize time by broadcasting NTP updates to the class B directed broadcast address for our site (similar to 172.16.255.255).  The NTP update would flood my class-B.

For the past two decades, “no IP directed broadcast” has been default on Cisco (and presumably other vendor) routers, for obvious security reasons.

192.168.2.255 is a perfectly valid IP address if the originating subnet is 192.168.2.0/23.  The intermediate routers and your host have no idea if 192.168.2.255 is valid unless they are directly on that subnet.

It is good that the windows filtering platform is blocking and logging some of this.  “Do not accept packets where the source IP is the broadcast IP of a directly attached subnet” sounds like a good rule.  “Do not accept packets with a multicast source address” would be another good one.


What steps should I take before using my credit card to buy something online? I am a private computer user with an internet connection. Assuming that my connection is a standard land line (that I legally own, I'm not free loading) and that my computer is up to date on operating system updates, and has a firewall, what should be done before I use it to buy something?

When looking for anti-virus software lots of different types of protection are offered. I'm not quite clued up enough to work out what I actually need.

Your first enemy when purchasing online is your own computer: a simple malicious plugin you may have installed within your browser may compromise your privacy dramatically (ZombieBrowserPack is a plugin developed originally as a POC and which you can install on Internet Explorer, Firefox and Google Chrome but can be manipulated remotely to steal authentication credentials, and even bypass two-factor authentication mechanisms such as the ones implemented by Yahoo and Google. It can also hijack your Facebook account, or get your bank account credentials if you perform an online purchase. You can imagine such a plugin purposed to fulfill this or that feature (shim) and doing something nefarious behind in the background.) So you need to scan regularily your computer against the presence of spyware and other types of malware by using firewalls, antiviruses and keep your connections encrypted.

Also, you better need to type the URL of the website you want to purchase on yourself instead of searching for it and clicking on it in a forum page, in an email sent to you (even from a trusted person as email addresses can be spoofed or even hacked using a simple but effective technique such as password guessing) because an attacker can craft a malicious link that will lure you to a website that looks like the one you were used to purchase on but actually is not. Note that a secure website you may purchase on must use secure connections (https) looking something like this:

Avoid using your laptop to purchase something online whereas you're in a public place where nefarious people may be interested in the codes you type to valid your transaction. Same advice is valid in case your purchase with your phone. Better to be patient to do the transactions once you're at home.

Be always careful: attackers are used to send emails pretending to be from your bank or any service you may use and provide you crafted links to click on and pay for something. Read the emails carefully and use common sense to see if you're not going to be trapped. Do not forget to save records of all your transactions (print them for example) just in case ...


IP Conflicts / Spoofing Are there any products / os that behave differently when an duplicate IP address is detected. This may indicate an IP spoof ?

Can TCP stack 'shutdown' or stop in order to protect itself ?

Many switches and routers now have active anti-spoofing, either alerting on duplicates, or entirely blocking IP addresses which are on a port where that address should never be. This is the only sensible use I can think of.

I don't think in any instance it would be a good idea to shutdown of the stack when it discovers its IP address has been spoofed - that would lead to really simple denial of service attacks (the attacker could just increment their IP address through the entire valid range, thus knocking off all devices that do this)

When you say 'protect itself' - as @nealmcb said - against what? An IP spoof is not a direct attack against another network address, in fact usually it is used when trying to pretend to be the valid device, so shutting the real one down would make that much simpler for an attacker as well.


SSL/TLS version switch over reason I'm studying the SSL/TLS protocol, more specifically its handshake. I know that initially, a client sends a Client Hello message to the server which includes the TLS version supported by the client.

I have an application that uses HTTPS connections, implemented with WinHTTP in the client and Apache Java in the server. I'm tracing the HTTPS traffic with Wireshark, which looks like this:

Client Hello,         version-TLS 1.2
Server Hello,         version-TLS 1.2
Client Key Exchange,  version-TLS 1.2
Client Cipher spec,   version-TLS 1.2
Application data,     version-TLS 1.2
Encrypted alert       version-TLS 1.2  [from client]
FIN                   version-TLS 1.2
ACK                   version-TLS 1.2

I don't know what Encrypted alert means (in Wireshark it is displayed as Encrypt alert (21)) - since it is sent by the client I'm assuming it's a Close notify alert.

A few seconds after the initial session is closed, a new session starts as follows:

Client Hello,         version-TLS 1.0
Server Hello,         version-TLS 1.0
Client Key Exchange,  version-TLS 1.0
Client Cipher spec,   version-TLS 1.0
Application data,     version-TLS 1.0
Encrypted alert       version-TLS 1.0  [from client]
FIN                   version-TLS 1.0
ACK                   version-TLS 1.0

From this, I conclude the version changes, and so the cipher.

This doesn't seem to happen every time: Sometimes a new session will use TLS 1.2, sometimes it falls back to TLS 1.0. What's the reason of this?

Your logs are partial; you don't show all packets. Notably, there cannot be in SSL an "application data" record if a handshake has not been completed, and a complete handshake (abbreviated or not) necessarily contains two "change cipher spec" messages. Also, note that when a system sends several successive handshake messages (as is common for a server: the ServerHello is usually followed by a Certificate and then a ServerHelloDone), the messages will usually be wrapped within the same record.

As for versions, there are two of them in SSL: the protocol version negotiated in the ClientHello and ServerHello, and the one used in the record headers. They do not necessarily match (although they should, at least after the pair of hello messages). You should inspect these field more thoroughly.

After a "change cipher spec", subsequent records are encrypted, so Wireshark cannot see their contents; only the general type (handshake, alert, application data...) is visible, because it is part of the record header. This is why you see "encrypted alert".

Some clients will try several versions: they first begin with a high announced version, but they don't like what they see, they may try again with another announced maximum version. This may be what you observe.

This answer is a detailed introduction to SSL/TLS, which should help in analysing recorded handshakes.


Shellshock and PHP fastcgi I understand that running apache/mod_php is safe, but I havn't heard about the case of running php in fastcgi mode (via nginx/php5-fpm), so, anyone can confirm this is also safe?

FastCGI communicates between the webserver and the CGI host using IPC rather than environment variables, so the main attack vector (the webserver setting environment variables for CGI) is gone.  However, it is still possible for you to be attacked if your PHP script itself sets environment variables based on user input before executing bash.


Why is this XPATH injection attack failing, and what is going on in the background of attack? Hi I'm trying to understand XPATH injection, got a loacl ctf issue and cant seem to understand how it works. So this is the query:

555-555-555=true

After fuzzing parameters I get:

   Description: An unhandled exception occurred during the
  execution of the current web request. Please review the stack trace
  for more information about the error and where it originated in the
  code.

         Exception Details: System.Xml.XPath.XPathException:

  '//acctprofile[acctid='555-555-555]'test']' has an invalid
  token.

So I presume there is and XPATH injection here. concat() function work ok, but doc() gives me:

   Description: An unhandled exception occurred during the
  execution of the current web request. Please review the stack trace
  for more information about the error and where it originated in the
  code.

        Exception Details: System.Xml.XPath.XPathException: Namespace Manager or XsltContext needed. This query has a prefix,

  variable, or user-defined function.

I'm trying to use doc() oob data exfiltration bcos application doesn't output any data if query is ok, so oob was my first idea. Any suggestion would be welcome. To be precise, how in my current situation can I exploit this bug further?

Thank you.

Hope this will help:

First of all, if right queries don't show anything you're dealing with a blind XPath injection.

Second, the error you've talked about:

  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Xml.XPath.XPathException: Namespace Manager or XsltContext needed. This query has a prefix, variable, or user-defined function.

May require to add the namespace before the query.

This:

  //acctprofile[acctid='555-555-555]'test']

Should be more like this:

  //"namespace":acctprofile[acctid='555-555-555]'test']

But this requires for you to know the namespace or to have any variable to insert there.


Network address (DNS) translation on Amazon Web Services (Ec2) I am trying to figure out better ways to practice my computer defense/ infosec skills.  If someone was to set up a honeypot (e.g., MHN) on AWS/EC2 server and then try to launch attacks from a local machine against it (e.g., Metasploit) why does the AWS public Public DNS name (hxxp://ec2-xx-xx-xx-xx.us-east-1.compute.amazonaws.com) for the instance translate back to an IPv4 address (x.x.x.x)? When I am launching those attacks from metasploit, am I really launching attacks to all machines that are sitting behind that IP address x.x.x.x vs the ec2-xx-xx-xx....?

EC2 uses 1-to-1 nat, so all of the traffic addressed to the public address is forwarded to the private address of the EC2 machine (subject to firewall rules you define).  EC2 machines sit behind a firewall provided by AWS called a security group, which will certainly have an effect on your testing.

What you are proposing to do almost certainly violate's the AWS acceptable use policy.  They require notification before doing penetration testing.

Have you considered using local virtual machines, such as VMWare or VirtualBox?


Printer Steganography/Watermarking I am referring to the yellow dots which are printed automatically by laser printers. They encode information such as the time the document is printed as well as the serial number. There appears to be quite little information on this subject available on the internet.

I would like to know if anyone has heard of any known cases out there where law enforcement managed to identify the specific printer which produced the document? Is this something viable that could be used to detect corporate espionage or is this a failed attempt that has long been abandoned?

Links for more information:

https://www.schneier.com/blog/archives/2014/10/analysis_of_pri.html

http://en.wikipedia.org/wiki/Printer_steganography

The EFF has a page describing how the information is encoded in those yellow dots:
https://www.eff.org/issues/printers

The Python program to decode can be found at:
https://github.com/zackdouglas/docucolor.cgi

They also published a list of printers which do not display those dots:
https://www.eff.org/pages/list-printers-which-do-or-do-not-display-tracking-dots

I'm not aware of cases where law enforcement declared they used them but I suppose it's common knowledge in any forensic lab since the printer manufacturers were most likely pressured to have that function implemented as it does increase the cost of development and production (even marginally).

Edit:

Ok, I just found out the EFF has a page with all their FOIA requests regarding the use of printer dots and other watermarking by law enforcement agencies (~700 pages total in 6 PDF files), they were released in 2008:

https://www.eff.org/foia/foia-printer-dots

Edit: EFF suggests that any color printer from a major manufacturer add some kind of tracking code.


MUST Share Personal Info with Windows 10? Just upgraded to windows 10. Had window open in Firefox when I upgraded. Should point out that for some reason Windows 10 would not upgrade on it's own, I went to Microsoft and they used remote assistance to upgrade. I then opened Firefox and this massage came up immediately:

        " Microsoft Edge Protection Warning

       Edge does not yet allow browser extensions
     which enable McAffe to protect your personal
     information and identity.

      We recommend using Internet Explorer so
    McAffe can continue protecting you. To help
    you, we'll unpin Edge from your task bar and
    pin Internet Explorer."

Wow,I can't protect my personal info? There can't be any privacy at all. Do I have to use their browser? My Firefox is working right now, worried it won't if I shut it down.Are all browsers like that?

Actually, the message isn't from Microsoft Edge; it's from McAfee itself. But you needn't worry: Firefox (and your other browsers) aren't going anywhere.

What's really happening here? Well, Windows 10 makes the new Microsoft Edge browser, rather than Internet Explorer, the new default browser in the operating system. Edge has some promise to it as a new option in the browser arena (especially when it comes to security).  Unfortunately, at this early point in its lifespan Edge isn't...well, to be blunt Microsoft shipped Edge and made it the default browser in Windows 10 despite the fact that it isn't fully baked yet.  One aspect of that: Edge doesn't yet support extensions, and won't until some time in 2016.

And that brings us to why McAfee wants you to not use Edge; to do what it purports to do McAfee needs to run a browser extension in whatever browser you happen to be using.  And since Microsoft Edge doesn't support extensions yet, McAfee needs you to stay away from using Edge or it won't be able to "protect your privacy" while you're browsing.  Thus, the attempt to kick Edge out of your taskbar and do the other things described.

Really, though, it sounds like what you really want to do is to restore Firefox as your default browser, rather than use either Edge or Internet Explorer. Fortunately, you can do this pretty easily.

(Postscript:
BTW, I'm writing this answer in Edge. It definitely has its appeal--the security improvements are quite interesting, and in some ways it's the fastest browser I've ever used.  As a Windows Insider tester I'm probably using it for about half my day-to-day browsing at this point, which I say only to show I don't hold Edge in any kind of enmity whatsoever. But at the same time right now it is undeniably still very, very raw.)


How to safely execute batch file viruses for practice? I'm following a tutorial on fork bomb and thought it was pretty interesting. TL;DR: It's basically just a program that replicates itself until the computer freezes/crashes.

I want to see how it actually looks like when executing but don't want to screw up my computer. What's a safe way to try out batch file viruses?

You can run it in a virtual machine. A virtual machine emulates a computer on your computer. You can give it a limited amount of resources (CPU's, memory) and the environment on the virtual machine can not access the computer it runs on. Popular software to run virtual machines are VirtualBox and VMWare.


Search on encrypted data of multiple users I want to implement a search over encrypted data. I found a blogpost, which explains 3 methods. One method is to use deterministic encryption, which I'm trying to implement. But my use case is a little bit different.

My application provides end-to-end-encrytpion, so that I (as the service provider) cannot read user data. The data is encrypted on the user's client. Now I want to search through data of different users. The search function and it's results aren't public, they will only be used internally to calculate some metadata, which is sent to the data owner. I don't need to know the unencrypted data, only their relationship. The data isn't natural language so frequency analysis or dictionary attacks shouldn't be a problem, for example person names and email adresses.

To make the encryption deterministic, I have to use the same salt for each data and it's known by everyone. (For example I would use bcrypt's hashpw function always with salt "staticsalt".)

Is this still secure enough or does using the same salt for everyone making it useless?
If it's useless, how should I implement a search through encrypted data of multiple users? The other two search methods in the blogpost don't seem to provide multi-user functionality.

What you are looking to do cannot be made secure.  Regardless of the implementation, if it is possible to efficiently search across multiple users, then the scheme is necessarily vulnerable to dictionary attacks.  Note that it is very likely an attacker would be able to obtain a large list of names and email addresses.  The best you can really hope for is to slightly obfuscate the data such that nothing would be learned from a casual glance.


Why are end-to-end encrypted messaging systems limited to one device per user? I am wondering if it's a theoretical limitation that all messaging services I use support end-to-end encryption only for one device per user or more accurately only between two devices.

Since all of my devices are online, can't there be a mechanism that verifies all message on all devices using some sort of public key / private key mechanism without involving a central server that holds keys?

It is just application developer's choice. Their idea of end2end encryption consist on an assumption that at some time two devices generate some symmetric key and encrypt the data. Keys are stored on particular device and is kept in secret. This model is pretty simple and easy to maintain.

In order to support more devices you own, there is a need to share keys between all your deivices from which you want to access the data. It is not wise to allow end user to manage keys, because users of such applications (for example, Telegram messenger) may not be enough educated to keep the secret in privacy. It would require programming ways to exchange key between devices. This immediately raise a lot of questions. For example, source device is ready to move the key to another device you own:

is the target device your device?
do you possess required permissions to retrieve the key?
is there a secure channel between devices to prevent from MiTM?
...

and others.

Of course, it is certainly doable, but would require assymetric cryptography along with complete, working and reliable public key infrastructure (PKI). Each application user (not device) recieves its own public key certificate (private key is held by the user) from a certification authority (CA) and user installs this certificate to all devices he/she owns. And this certificate would solve all question regarding user/device authentication, key transfer privacy and the rest.

This procedure is similar to common S/MIME, when you insert a smart card with S/MIME certificate to the reader on each system where you want to access encrypted emails. When done, the card is removed and email access is blocked.

The problem with this solution is that it is relatively expensive, requires reasonable investments, requires too much efforts from application vendor on implementing and maintaining the PKI infrastructure.


Is downloading Windows ISOs from TechBench downloaders safe? How safe are TechBench downloaders?
Is it safe to download an iso from TechBench downloading service for example:
https://tb.rg-adguard.net/public.php
I have no idea how it works but it supposedly downloads the ISO directly from Microsoft servers.
Chrome says the download for Windows 7 Ultimate is coming from
https://software-download.microsoft.com/pr/Win7_Ult_SP1_English_x64.iso?t=fa97b958-6996-4845-bdc4-42239af90448&e=1518109568&h=2803582e3572c264fb2da3854d6cc239
(I think the link above is only good for 24 for those trying to test it, it may have already expired but you can generate a new one using the website)

Note: These are hidden downloads, no longer "officially" hosted by
microsoft (they are still on MS servers but hidden). Originally these were on Digital River (anybody remember that?), now they are on
techbench but hidden.

I'm not debating the legality of this. I'm just asking if the actual process of doing this is safe and if you feel like explaining how it works you can.

You have essentially answered your own question. It appears that TechBench is simply providing an interface to download these "hidden" files from Microsoft's servers.

Given that Google Chrome says you're downloading from https://software-download.microsoft.com/, you're getting the file straight from Microsoft over a secure connection. So yes, it's safe.


John the Ripper not identifying a password contained in the username? I have uploaded a screenshot of what exactly is going on, here: http://i.imgur.com/bJSv7C8.png

I can see that single-crack mode includes a rule that looks at the username, and "slices" it to identify the password. I concluded this based on the fact that I have ACC_ff77 and ACC_fInAlfAntAsy77 setup with the same password (the password being fInAlfAntAsy77), and single-crack mode does not solve ACC_ff77, but it DOES solve ACC_fInAlfAntAsy77.

I doublechecked this with ACC_123passw0rd123, which the screenshot shows being solved instantly. I also changed the username to not include the password, and it too was not solved in single-crack mode.

That's all well and good, but this brings me to my question: Why is ACC_^.^S#kvV not being solved? The password is ^.^S#kvV so the same ruleset in single-crack mode that is solving the other two usernames should solve this one. I looked through the rulesets, but I admit I did not understand them all. I could not figure out which rule specifically was the one identifying the passwords.

To prove my due diligence, I added my own rule to the single crack mode: x[0-9]l

This rule successfully identifies the password from ACC_^.^S#kvV, as well as the other two accounts. However, I am still very curious why whatever rule is identifying the other two accounts is failing on ACC_^.^S#kvV

Good question

the default rule : will split the "username" on the following characters for guessing purposes.    I put "username" in quotes because it seems to be treating everything before the ":" as possible GECOS fields that could be delimited by any of the characters.

".", "_", "-", "|", " ","#",";","^",","

(and probably others)

so ACC_^.^S#kvV  will be split into the guesses ("ACC","S","kvV") and never try ^.^S#kvV

As proof try APC_Skater.skater778818:skater778818 and the : will solve it.

your rule x[0-9]l is a variation of xNM (extract substring from position N for up to M characters) and in this case go from position x to the end of the string (l).  So this rule does no splitting, but just tries successive substrings.


How do professional hackers to test their own malwares/viruses without harming their own computer? Yesterday I started some hacking tutorials on http://xeushack.com/tutorials/ by curiosity. I used the Android app to read the different articles about different ways of "hacking". The author clearly stated that some of them shouldn't be reproduce because they would basically harm the computer, such as the famous Zip bomb and Fork bomb or even Folder blaster.

So, I'm wondering what would be the best way for me to reproduces these "malwares" without doing harm to my own computer. But I'm also interested of finding a way that I could use for many different kind of malware/virus testing/development.

The first solution that comes to my mind is to use a Virtual Machine, so I could take a snapshot of the VM once installed and do whatever on it without harming the real OS. But I don't know for sure if this is the best solution and even if it's gonna work or not. I guess it would, but that's a guess.

How do professional hackers to test their own malwares/viruses without harming their own computer?

Almost all malware, if not all, works by obscurity. Once you understand how it works, and you have the appropriate skill-set, you can defeat it quite easily. If it's your own malware and viruses, then it's really quite simple: you know exactly what your malware does, and how to defeat it, correct? After all, you programmed it.

While yes, I agree in general with the use of a Virtual Machine, it isn't 100%. Nothing is 100%. You can infect your own machines, whether they're online or offline, and do interesting things with them.

You can observe how the malware interacts with your environment through many different methods. Here are some notable examples:

Observing all changes to the file system, and/or hard drives.
Observing memory
Debuggers such as OllyDbg, or IDA Pro.
Network packet-capturing tools such as Wireshark.

Disable the Virtual Machine's internet connection for best results

While others talk about malware "possibly escaping" the Virtual Machine, it isn't very likely, though it is possible. Even if the malware could detect that it's running inside a virtual machine, that doesn't help much unless the malware self-destructs upon detecting a virtual environment.

Even if a VM isn't detected, a piece of malware could simply try to escape it by assuming it may be there. So methods to prevent the malware from detecting it's inside a VM may not work, unless it's the type that self-destructs when detecting it.

Regarding the "attacks" you've mentioned, let's take a look at the results of them, assuming you can remove the infections:

Zip bomb

A zip bomb, also known as a zip of death or decompression bomb, is a malicious archive file designed to crash or render useless the program or system reading it. It is often employed to disable antivirus software, in order to create an opening for more traditional viruses.
After removing the infection, the left-behind zip-bomb can be nullified by deleting the files. If you made this yourself, simply make a cleanup routine. If you didn't make it yourself, simply make a cleanup routine. If the program is still forcibly running, you can reboot.
Won't cause physical problems with your hardware.

Fork bomb

In computing, a fork bomb (also called rabbit virus or wabbit) is a denial-of-service attack wherein a process continually replicates itself to deplete available system resources, causing resource starvation and slowing or crashing the system.
Won't cause physical problems with your hardware.

Folder blaster.

Same concept as the zip bomb, but with folder spam. Just write a routine to delete them.
Won't cause physical problems with your hardware.

Better yet, if you have a virtual testing environment, you can delete these automatically by saving the state of a virtual machine before the infection, and restoring it after you're done studying the output. This is the easiest, most efficient method by far.


How did this email list a fake recipient? My friend recently received a suspicious email for an iTunes gift card purchase from "Apple Store" with a header that displayed a fake "To:" address for orders@apple-store.com.

Unsurprisingly, this turned out to be a phishing email with a suspicious "From:" address.

  From: Apple Store <mystorepaysbills767wf08t7q86tpj1@unpaidpurchaseneedconfirmtocontinue.com>

I couldn't find any reference to my friend's real email address in the message itself. I've heard of headers having a fake sender address, but I've never seen an email list a fake recipient.

How could my friend have received this email if it was sent to a fake email address?

When mail is sent via SMTP, there are two separate places this sort of information goes, the Envelope (things that are set with SMTP commands) and the Header (the first block of text under the SMTP Data command, ending with a blank line).  So, for example, here is an SMTP transaction where the Envelope disagrees with the Headers.  The message will get delivered per the Envelope, but the recipient will see the headers.

mail from: <evil@evil.com>
250 2.1.0 Ok
rcpt to: <victim@example.com>
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
From: "Apple Store" <apple@apple.com>
To: orders@apple-store.com
Subject: We just received your purchase...

Mail body goes here.
.
250 2.0.0 Ok: queued as C5E251FFE2
quit
221 2.0.0 Bye
Connection closed by foreign host.

The fake recipient goes in the header "To:" line, but the mail is delivered according to the value set in the SMTP "RCPT TO" command.  And indeed, the recipient sees the Header that the attacker wanted them to see:

Now, there is some protection against this.  If you tell your mail client you want to view the full mail headers, you'll note that the mail server injected an several headers that tell the true story:

From evil@evil.com Fri Jul 27 14:45:21 2018
Return-Path: <evil@evil.com>
X-Original-To: victim@example.com
Delivered-To: victim@example.com

But, of course, mail clients always hide this level of detail by default, and interpreting headers correctly can be difficult.  The key to remember is that they are prepended by servers as they go along, so the ones that the top are put in by your server; if you see "Return-Path" at the bottom of the headers it's likely forged by the attacker to try and misdirect you...  Since the original message 'data' contains headers crafted by the sending client, they can put whatever they want in there before the servers start prepending.

As per how to do it -

The first rule of email recipient forgery is, expect it to fail miserably.

The second rule is, use Bcc: for the recipients you want to get it, and To: for recipients you want to be seen getting it.  This is the standard way of doing this with a mail client, and generally works with everything from mailx to gmail.

But mileage may vary unpredictably.  For example, if you leave To: blank, many mail servers will stuff the contents of Bcc: into To: to make up for it.  20 years ago I spammed thousands of "hidden recipients" with each other's addresses that way, sending out a contest update to the list of applicants.  OOPS.


Is filtering of user input data enough, or should it be parsed? In a web application there could be two approaches to mitigate XSS attacks:

all the input data could be filtered (removing all 'bad' data), or
the input could be parsed, tokenized and output with only the allowed tags etc

Which method should be preferred from security standpoint?

With either method, what are the gotchas?

I agree with @Jorn's answer about the validation.

However, you're still forgetting a very important step here, and that is output encoding.
E.g. HTML encoding (or Attribute encoding, or Javascript encoding, etc) before outputting anything... In fact, this is arguably even more important than the input validation (arguably, not absolutely, and definitely not in all situations...)
In any event it shouldn't be either/or, its definitely both strict input validation + output encoding.

Now, if you are referring to including "safe" HTML tags in the output (then its not very clear in your question), then you should still encode every thing, and then decode the specific tags you're looking for without any of the tag's attributes.

P.s. If you're referring to a .NET app, MS's AntiXSS (in WPL) provides a .GetSafeHTMLXXX set of methods.


How to simulate man in the middle attack in android emulator? I am new to pen-testing. Yesterday i analysed one android application using dex2jar application and i saw an android application implemented https connection using empty trust manager.

class miTM implements  javax.net.ssl.X509TrustManager{

    public void checkServerTrusted(java.security.cert.X509Certificate[] certs, String authType) throws java.security.cert.CertificateException{
        return;
    }

In the above code checkServerTrusted method is empty so this application is vulnerable to MITM attacks.

I created a certificate using openssl and  installed vulnerable android application in emulator.

Now how can i perform man in the middle attack in android emulator using sslsniff or any other tools?

Google "MITM PROXY", you will find a lot of tools. One example is:

http://mitmproxy.org/

With cell phones, MiTM attacks are multi-route, so you have to sometimes do some pretty technical set up of environments to completely cover all the paths. Remember you have 3g/4g, sms/mms, wireless, NFC, BT/BTLE.

Of course if you are using just the emulator, then you just have the "wireless" or traditional network route and any of those frameworks should work.


Is strategic cyber-warfare feasible today? Cyber attacks that target a nation's infrastructure are a documented fact and as such a danger that political and military leadership across the world needs to worry about and act proactively. These attacks can be disruptive but given the relatively few examples, I think it is valid to ask exactly how disruptive can they be.

That is, I'm wondering about the ramifications such an attack by a competent opponent can have that would allow cyber-warfare to be considered a strategic asset the military needs to incorporate to its structure.

All major armies in the world have three branches: Land Forces, Aerospace, Navy. Is the inclusion of a cyber-warfare branch or sub-command necessary in the sense that cyber-warfare can affect operations and strategic outcomes (either coerce an opponent to do as you please or destroy an opponent) to a similar extent the other three can?

In particular, I am wondering about peer-to-peer strategic cyber-warfare attacks involving the three main powers: USA, Russia and China.

USA alongside Israel did mount a successful attack against Iran using Stuxnet but Iran was a far weaker opponent and likely an unsuspecting one, caught off guard.

Just to be clear, I don't refer to attacks that seek to influence public opinion, but "hard" attacks that aim to disrupt and/or destroy networks and infrastructure virtual (e.g stock market crash) or physical (e.g. cause a nuclear plant to go critical) as extreme examples.

The problem with such attacks is that neither the attacker nor the defender have any incentives to claim responsibility of the attack. As such attacks can be done with small number of people and the internet also makes it possible to conceal the source of an attack, a well resourced attacker can even make it impossible for the defender to realise that an attack happened at all. The defender on the other hand, would usually try its best to hide the fact that it's attacked, or to the fact that it had discovered the attack, so as not to alarm the attacker (to allow them to feed back false information), and to avoid embarrassment and erosion of public trust on the agency.

When a military cyber warfare department launched an attack against another nation's infrastructure, since there's no real witness and because most people are ignorant about how internet works and because attack forensic is hard even for experts, concealing such attacks is a lot easier than concealing physical wars. Even the defender might never realise that they are being sabotaged, or that they may have a really hard time proving that the sabotage was done by a nation state actor or figure out who the actors are, rather than, say, by a random Anonymous prankster. Additionally, the attackers themselves may sometimes not realise that they are acting under the direction of a nation state actor.

Infrastructures like nuclear power plant are more difficult to compromise purely by cyberwarfare. The reason being that there's a lot of physical safe guards (not computer controlled) and manual override systems. The most that an attacker can do is force nuclear plant worker to shutdown their sophisticated automatic control system and fallback to manually working the plant. The attack might reduce the efficiency of the power plant and increases the operational costs of the system, but it's unlikely that serious meltdown could occur from such attack.

Most attacks likely will be of the nature to increase costs of the victim, data espionage, and affect decision making. Increasing costs is fairly straight forward, with DDoS, sabotage, etc. Data espionage are more subtle but it's easily concealed by attacking random civilians, so that if the attack is discovered in government machines it'd hopefully be dismissed as random infection rather than a targeted attack. Affection decision making are even more subtle as it's essentially propaganda, targeted at specific decision maker or the entire populace for election.

  Is the inclusion of a cyberwarfare branch or subcommand necessary in the sense that Cyberwarfare can affect operations and strategic outcomes

I think it's safe to say that most countries already do have Cybersecurity and Cyberwarfare capabilities.

  Stock market crash

It's very difficult to say if this kind of attack are happening because stock prices are essentially decided by investors sentiments. A campaign of misinformation could potentially affect investors decision making. Spreading fake news about an upcoming political or economical instability could cause less observant investors to panic and push the market to a certain direction. This might actually trigger an actual meltdown as the initial fake wave can potentially turn into a real one.


How secure is it to store information in Google products I think many people have been gradually forking over more and more personal information to Google. I was noticing how I now have details about my doctor appointments stored in Google Calendar and on Google Drive I have some phone calls recorded from my phone. I'm not sure if the folks at Google actually view the data but what about third party apps? I wanted to know the size of a folder in Google Drive and it turns out I have to use this app which needs to "view and manage" files on Google Drive. So would allowing this basically be like giving my medical history to some random person?

Are there any resources that explain what the different permissions are?

Unless you encrypt all data on the client side, the answer is as easy as: Anything you store with Google is not secure at all, even more so (but not exclusively) if you use third party apps to access the data.

Any app that you use and give access to your Google account can do pretty much anything, from working as you expect to reading and modifying files, or sending your confidential data to someone else. You do not have an easy way of knowing. You'll have to trust the author of that app.

(All of the above is not very particular to Google, however. It applies to every other provider as well.)

As for general security, not only could Google employees in theory read (and modify) any data or deny you access to your data at any time since it's stored on servers that are not under your control (not all Google employees have that level of access, but a considerable number certainly does).
Also, Google will most certainly run automated "data mining scans" over your data. They're a company that makes a living from collecting data and delivering custom-tailored ads as well as selling data (of some more or less unspecified kind) to other companies.
It is not publicly known what methods exactly are applied and what data is collected (anonymized or identifiable) and how much data is stored, nor how exactly it is used. However, it is certain that this is happening (unless they changed their ToS since I last looked, you are agreeing to that, too, by using their service).

In addition to that, Google is an US-based company, and like every US-based company they will deliver your data to governmental agencies without hesitating, and they will neither make this public nor admit to you or to anyone else that they're doing (or have done) it, being bound by what is called "National Security Letter". The nature of a NSL is basically the same as what ordinary blackmailers that are not a governmental agency are doing by telling you "No police, or your child dies".
Except in this case, the threat is something like "Your company shuts down, and you go to jail without trial".


How to enable OPAL SSD encryption on Windows without BitLocker? A lot of SSDs now implement OPAL-compliant AES hardware encryption, which seems to be the only option to get full-disk encryption on modern PCs without buying the (very expensive) Windows 10 Pro edition.

I enabled this encryption with a HDD password in the UEFI, but from what I've read, BIOS- or UEFI-based HDD password can be unreliable (and you have no way to know whether your model implements it correctly until you get hacked).

I searched on how to enable OPAL encryption, but this information seems to be inexistent. Every webpage talking about OPAL says that it's activated by a software, but no one seems to know which software.

I tried the vendor's SSD managing software (Samsung Magician), but it only says that I need "specialized software". It seems that Microsoft BitLocker can use this, but as I said, this is only in Windows Pro and the price is incredibly high.

Is there any Windows software capable of activating OPAL hardware encryption ?

You ought to be able to find something useful here (binaries and source included by r0m30 on github also).

  Up until recently, configuring these TCG Opal drives was only possible
  under Windows, or under Linux with a commercial solution that was not
  available to mere end-users. Fortunately, a programmer named r0m30
  stepped up to the challenge and has developed an open source utility
  called msed and an accompanying pre-boot authorization (PBA) image
  with which the super fast encryption function on these drives can be
  fully configured and used also in pure Linux systems.

The "pure Linux" system shouldn't be a problem - the PBA is OS agnostic, it should simply boot whatever is in the active partition once it is unlocked. The OS and the drive will "see" an unencrypted drive without even be aware that the hardware is actually doing decryption on the fly, unless they issue the appropriate API status calls.

Keep in mind that very likely you'll need to reformat the SSD altogether, since this solution is for booting off an encrypted device and requiring it to boot from a small non-encrypted shadow "partition" for password acquisition purposes.

So you probably will need to:

backup your data
disable OPAL in the UEFI
format disk and install the shadow MBR with OPAL encryption
enable OPAL from shadow MBR and insert a new password
restore your data (the disk might be slightly smaller).

I'm not sure on the "slightly smaller" thing but it seems safest to use some backup strategy that does not rely on the disk exact geometry (i.e., no dd-imaging), just in case.