How to check whether NTLM v2 or v1 is used for authentication? Which tool should I use to check which NTLM authentication is used? Consider the fact that I am a user of the web application and not the owner.
Are there any security concerns if a site uses NTLM authentication comparing to form-based authentication?

Forms-based authentication over proper, validated TLS is the modern way forward for web application authentication that require non-SSO (Single Sign On) capabilities (e.g., SAML, OpenID, OAuth2, FIDO, et al).

NTLM authentication is only utilized in legacy networks. Microsoft no longer turns it on by default since IIS 7. Microsoft Domains and/or Forests with a Windows Server 2012 R2 functional level do not even support NTLM authentication by default. Thus, its use is contraindicated.

Cleartext authentication, such as via non-SSL/TLS HTTP, will result in compromise of the web app's credentials -- regardless of how strong the NTLM authentication (or other authentication) is, primarily because of Man-in-the Middle (MITM) scenarios, but also for many other credential-collecting reasons (see the net-creds or the PCredz tools).

If you want to see what NTLM looks like on the wire (MITM scenario optional), check out this blog post which states the following:

  The essential difference between NTLM and NTLMv2 is how the response is calculated. NTLM uses MD4 and DES in a weak way which is well known (5 NULL bytes yada yada yada); NTLMv2 uses HMAC-MD5 based on more than just the password and challenge, which is where the “blob” comes in. So that’s covered off the “challenge”, “HMAC-MD5″ and “blob” that’s missing from the John hash I’m having to build up from scratch.

The author then goes on to show an HTTP message with the Wireshark tool.

In some scenarios, I believe it is possible to reverse which exact NTLM protocol is in use by just connecting to a HTTP-NTLM authenticating web server.

As seen in the book, Network Security Assessment, 3rd Edition:

root@kali:~# telnet 192.168.0.10 80
Trying 192.168.0.10...
Connected to 192.168.0.10.
Escape character is '^]'.
GET / HTTP/1.1
Host: iis-server
Authorization: Negotiate TlRMTVNTUAABAAAAB4IAoAAAAAAAAAAAAAAAAAAAAAA

HTTP/1.1 401 Access Denied
Server: Microsoft-IIS/5.0
Date: Mon, 09 Jul 2007 19:03:51 GMT
WWW-Authenticate: Negotiate TlRMTVNTUAACAAAADgAOADAAAAAFgoGg9IrB7KA92AQAAAAAAAAAAGAAYAA+AAAAVwBJAEQARwBFAFQAUwACAA4AVwBJAEQARwBFAFQAUwABAAgATQBBAFIAUwAEABYAdwBpAGQAZwBlAHQAcwAuAGMAbwBtAAMAIABtAGEAcgBzAC4AdwBpAGQAZwBlAHQAcwAuAGMAbwBtAAAAAAA=
Content-Length: 4033
Content-Type: text/html

  Upon decoding the data, the following strings are revealed:

NTLMSSP0
WIDGETS
MARS
widgets.com
mars.widgets.com

To understand those variables and further HTTP-based NTLM authentication, check out the resources here -- http://www.innovation.ch/personal/ronald/ntlm.html -- as well as in the old presentation on Cracking NTLMv2 Authentication -- http://www.blackhat.com/presentations/win-usa-02/urity-winsec02.ppt (for the different NTLM SSP provider internals)


How can I ensure that I connect to the right wireless Access Point? Under Windows/Linux, client side. How can I ensure that I'm not connecting to a rogue AP?

Speaking generally
MAC's are easily spoofed.
WEP is cracked in minutes.
WPA/WPA2 implementations are not secure in all routers.

IMO man-in-the-middle attacks are almost unavoidable
The main problem is that the control data in 802.11x is never encrypted.
Because every wireless authentication must start using the unencrypted control sequence, it will be vulnerable to a man-in-the-middle attack.

To make matters worse, 802.11x sessions can easily be forced to disconnect and re-authenticate, so the man-in-the-middle can appear at any time in the session.

By using a radio-beam directed only at the client, it is very hard for intrusion detection systems to intercept this traffic.

Don't worry
The solution to this is to stop worrying about the man-in-the-middle at this or that access point.
Just make a connection with any access point, secured or not.
None of them can be trusted, so don't bother.

The solution
Instead use a VPN solution that is safe from man-in-the-middle attacks*). e.g. SSHv2 in a MITM-safe configuration and connect to your endpoint using that.

What can the attacker do?
Than your attacker can listen in on the stream of data to his hearts content, all he can infer is how much data you are sending and receiving at your laptop (traffic analysis), this is still useful, but he could do that anyway by silently sniffing the wireless traffic.

But keep your laptop safe
You will still have to keep an attacker out of your laptop, employ a firewall that only accepts traffic from your VPN connection and nothing else. Use a secure operating system.

Benefits of this approach
Your laptop will be usable outside the corporate infrastructure. Realistically it will almost never stay inside that safe shell and securing all the access points you want to connect with is a pipe dream.
If you set up a proxy server for web and mail server reachable through the VPN connection you'll have full secure use of your laptop from any and all locations.

To recap
With WEP and WPA outside attackers can spoof your wireless access point.
With WPA2, regardless of encryption used authenticated attackers can initiate a mitm attack regardless of encryption scheme used. This can be done by unreliable insiders or malware on a trusted laptop.
Whilst there is no need to get all paraniod about this as D.W. correctly pointed out.
The bottom line is, there is no way to be 100% sure that you are not connecting to a rogue AP.

Now you only need to worry about that iphone.....

WPA2 has a mitm attack vector called Hole 196, see: http://www.airtightnetworks.com/WPA2-Hole196

*) not all VPN solutions are and lots of them have configurations where an otherwise safe solution is still at risk, but there are safe options and if you have a good sysadmin it is not a difficult thing to setup correctly.


Want to verify confidentiality of GSS-SPNEGO SASL mechanism (LDAP) I've been doing some research on LDAP supportedSASLMechanisms and am trying to assert whether or not there is confidentiality protection in play when using GSS-SPNEGO.

My initial assessment is that additional configuration is required to achieve confidentiality because the following C# code (assume GSS-SPNEGO is selected) only shows SASL GSS-API Integrity in Wireshark, but no SASL GSS-API Privacy.

private static void Main()
{
  using (var ds = new DirectorySearcher())
  {
    ds.Filter = string.Format("(&(objectClass=user)(sAMAccountName={0}))", "jdoe");
    var result = ds.FindOne(); // Begin packet capture
    ...
  }
}

The following is a sample of packet captures:

client -> server: searchRequest(73) "<ROOT>" baseObject
server <- client: searchResEntry(73) "<ROOT>"
client -> server: bindRequest(75) "<ROOT>" sasl (SASL mechanism: GSS-SPNEGO)
server <- client: bindResponse(75) success
client -> server: SASL GSS-API Integrity: searchRequest(9) "DC=com,DC=example" baseObject

As you can start to see, the entire transaction (beginning with the outgoing searchRequest query and all subsequent transactions) are sent/received clear text. I do see in the SASL Buffer krb5_blob under the GSS-API section, albeit just above the GSS-API Payload section which also is clear text.

I guess my main questions are:

Would a MITM still be able to see the same traffic I'm seeing in clear text and if so, what exactly is Kerberos' role with respect to confidentiality in these transactions (if any)?
What would be the most preferred route for ensuring encrypted traffic (i.e. EXTERNAL, or SSL/TLS; this part I'm actually still researching implementation details for, specifically in C#, as in AuthenticationTypes.SecureSocketsLayer)?

Note: I have not checked "attempt to decrypt KRB5 traffic" nor specified a keytab file in Wireshark, so my initial impression is that the role of Kerberos is for signing/verification purposes only and as mentioned earlier, additional configuration (or coding) would be required to ensure traffic is encrypted.

So the short answer is no, this is not negotiating SASL GSS-API Privacy and quite frankly I haven't explored this route any further (with exception to playing with LdapConnection).

The following psuedo-code establishes a TLS connection with the LDAP server, however (port number and bind credentials required):

var bindPath = "LDAP://dc.example.com:636";

...

if (!ValidUsername(samAccountName))
    throw new Exception("Invalid samAccountName");

using (var context = new DirectoryEntry(bindPath, bindUsername, bindPassword, AuthenticationTypes.SecureSocketsLayer))
using (var ds = new DirectorySearcher())
{
    ds.SearchRoot = context;
    ds.Filter = string.Format("(&(objectClass=user)(sAMAccountName={0}))", samAccountName);

    var sr = ds.FindOne();

    if (sr == null)
        throw new Exception("User [" + samAccountName + "] not found");

    return sr.GetDirectoryEntry();
}

For completeness, the following psuedo-code is also included for validating the samAccountName being queried:

public static bool ValidUsername(string username)
{
    // Must not be empty/null
    if (string.IsNullOrEmpty(username))
        return false;

    // Must not exceed max length expected
    if (username.Length > ValidUsernameMaxLength)
        return false;

    // Must only contain valid characters in whitelist
    if (!ValidUsernamePattern.IsMatch(username))
        return false;

    return true;
}

Props to Wireshark :)


Netcat does not receive an response over tor I configured Tor Hidden Service to forward from port 5400 to 127.0.0.1:1234. Then i restared tor and I got hostname. Now I run nc -l 1234 and i visit the website and I receive a GET request. Now I wanted to send other data so on the other computer I run echo test | torify nc -w 2 -z MY_hidden_service_address port. When I run it my server just quits and does not print test. But if it quits then it means that it receives a response, right?

As you can see the connection gets properly open and closed (thats why your nc quits) but there is no data transferred. This is because torify does not expect you to just pipe data into it I suppose.
To check maybe try using netcat without torify (nc -v -X5 -x localhost:9050 <server> <port>) or get rid of echo and your pipe and try using nc interactively.


How secure is EncFS compared to TrueCrypt? If I choose the paranoia option for EncFS and for TrueCrypt I create containers using the encryption algorithm AES-Twofish-Serpent and the Hash Algorithm Whirlpool.  Are both methods equally secure, or is 1 method more secure than the other?

As based on https://defuse.ca/audits/encfs.htm, EncFS seems to have some issues.

If I am right to assume that TrueCrypt with those settings is more secure than EncFS with the paranoia option, is it possible to make EncFS as secure if not more secure than TrueCrypt?

Ignore the second part if both EncFS and TrueCrypt are equality secure.

When we're talking about security, we're talking about security of the data. In this case it's really not just the encryption algorithms that need considering but the implementation of it and the software used.

There are examples of when poorly implemented crypto technology meant that significant information could be gained about the data 'encrypted' or even the original data itself. The main example is usually SSL where no certificate validation is performed, meaning breaking it is a simple matter of intercepting certificate exchange and injecting your own.

What you need to ask yourself is how well vetted the software implementing the encryption is. Arguably TrueCrypt is the more mature solution, as well as currenlty undergoing a public auditing sponsored by some big infosec companies: http://istruecryptauditedyet.com . These audits are performed because you really don't know if anywhere along the encryption implementation has a weak-point. It only takes a single chink in the chain to expose sensitive data.

For this reason, I'd side with TrueCrypt being 'more secure' than EncFS - but the reality is they could be both just as secure. Without reviewing the source code, which is a big task, you can't always tell.


How should I configure my firewall using iptables commands to defend against hacking? I need to add extra security to my Android device using iptables and a firewall to defend against hackers. My specific goals are to prevent a hacker from remotely breaking into my device to begin with and, in the event spyware is remotely placed on my device, my data/activity cannot be uploaded to whatever command center the hacker controls. Which commands should I use for maximum hacking defense? So far I only know about closing all ports except 80 and 443. I also need to know how to block all ports except those two, both incoming and outgoing, without preventing myself from browsing the web and other basics.

I wonder what corporations and politicians and oil barons do to
protect their devices from targeted hacking?

Ask Jeff Bezos or Angela Merkel, they'll know.
Oh wait ...
It always depends on your adversary. There's a difference between Joe hacker and the NSA.
The average Smartphone usually does not expose any public internet services itself and is often behind some NAT anyways. So theoretically no one from the outside can connect to it directly. Often you "invite" attackers by connecting to their phishing websites, installing some crap app ...
Telemetry/Tracking is also just some kind of legal version of exfiltration.
Preventing exfiltration is nice in theory but in practice only limiting traffic to port 443 and 80 still gives the attacker the ability to exfiltrate data over those ports. Not to mention some lower level stuff like WIFI, Bluetooth, mobile network ...
Smartphones are made to communicate in many ways.
The average politician targeted by the average nation state better does not do any stuff on his phone which could have negative impacts on him. Like storing all his duck pics ...
The true chad politician, however, would store all his duck pics there on purpose because a) remove the attack vector of some moral outrage and b) because the images exploit some vulnerabilities on the attackers system and send all their duck pics to youduck.com
2:0
You'd better prevent or detect the step which happens before exfiltration i.e. compromise. You'd need to know what the system does normally and when it misbehaves. You also need to know if normal=desired (see telemetry ...) That's a lot of work. iptables/firewalling is only a small part of it


File encryption at rest, password considerations I have at most 10,000 files that I want to store encrypted with one
 password.

The current idea is:

Have 1 master file containing (expensive) parameters for scrypt.
For encryption/decryption hash a user password with the given parameters and use it as key for symmetric cipher encryption/decryption
Each file is prefixed with a cryptographic secure random nonce that is unique(only used once)

My questions:

Is this generally wrong?

Is a single password/derived key enough or

Should I derive a new key for each file (I worry the time it takes)?
Should I derive a new key for a bulk of files (e.g. every 100)?

Is this generally wrong?

I see two problems with your implementation:

Using random prefix instead of IV

This technically could be done but it is not recommended or encouraged. Please see this for more details. Generate random IV for each file and save it along with ciphertext (as a prefix or suffix).
Using derived key directly as an encryption key.

In case a password is changed you will need to decrypt and encrypt all of the files again. To solve this, you should generate a single random encryption key that will be used for encrypting all of the files. You will then encrypt this key with a master key derived from user password and save it in a separate file. When password is changed (and consequently master key), you will only decrypt and encrypt the file containing the encryption key. For an example of a well known implementation that uses similar schema take a look at DPAPI and how it handles the keys.

  Is a single password/derived key enough or

  Should I derive a new key for each file (I worry the time it takes)?
  Should I derive a new key for a bulk of files (e.g. every 100)?

This depends on what are you defending against. Considering my comments above, you will not derive each encryption key out of the user password but rather generate them randomly from a strong CSPRNG. If you have new random encryption key for each file you will need to store the encryption key encrypted with master key along with ciphertext and IV. If the file encryption key is compromised only that one file is compromised. You need to think if it is possible for a single encryption key to be compromised without compromising the master key (brute force?). If this scenario is not likely or you choose not to defend against it, you can use single encryption key for all files.

One more thing to consider when using single key for all of the files is how large data encrypted with single key can be before you need to change the key. For an answer to this question please see this and this.


Is selecting trusted computer in 2-step verification less secure? In using 2-step verification, does selecting 'Trusted Computer' a less secure options? https://support.google.com/accounts/answer/2544838?hl=en

If so, is it still a reasonably secure option?

Yes, making a device trusted is absolutely less secure -- but in general it is secure enough. The thing to consider is how easily someone could gain access to the trusted computer in question. Among the questions you'll want to ask yourself before making a computer a trusted device:

Do you control the physical unit? (For example, is it in a locked home or in a key-card-isolated area of an office building?)
Is the computer password-protected? (Do you habitually lock the screen when you step away, or have it set to lock automatically with a short time-out?)
Are you satisfied that the unit is safe from intrusion through the network? (Do you have a firewall in place and do you keep the operating system and installed programs up-to-date with security patches?)


Wipe inaccessible hard drive before returning to vendor My external backup drive broke recently. It just beeps but does not show up in Explorer but in Device Manager.

Sadly this drive contains my unencrypted backups. (Not a failure I will repeat). Is there a way to wipe this drive without physically destroying it before I send it back to my mail order company?

Edit

The ATA Interface seems also broken.

#>hdparm -I /dev/sg2

/dev/sg2:
SG_IO: bad/missing sense data, sb[]:  70 00 05 00 00 00 00 0a 00 00 00 00 24 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

ATA device, with non-removable media
Standards:
    Likely used: 1
Configuration:
    Logical     max current
    cylinders   0   0
    heads       0   0
    sectors/track   0   0
    --
    Logical/Physical Sector size:           512 bytes
    device size with M = 1024*1024:           0 MBytes
    device size with M = 1000*1000:           0 MBytes
    cache/buffer size  = unknown
Capabilities:
    IORDY not likely
    Cannot perform double-word IO
    R/W multiple sector transfer: not supported
    DMA: not supported
    PIO: pio0

ddrescue fails because the drive is not seekable and dd if=/dev/zero of=/dev/sdb bs=4K conv=noerror,notrunc,sync only copies 4 kb

Chances are you will have to destroy the drive.

If the internal components of the hard drives are physically damaged, you cannot wipe it short of using destructive methods such as melting or degaussing (exposing it to an extremely powerful alternating magnetic field). You can try issuing the ATA Secure Erase command which tells the controller to do low-level data erasure without actually sending I/O commands from the host, but it will not work if the drive is so badly damaged that the ATA protocol no longer works (which is likely).

Because degaussing involves incredibly powerful magnetic fields, it's not really something you can do at home with a permanent magnet, or even a cheap electromagnet. You will need to either rent a large degaussing machine, or more practically, send in the drive to dedicated hard drive destruction services that will degauss it for you before sending it back with a certificate of destruction. Note that degaussing does not leave any physically-identifiable marks or damage. If you are returning the drive because it doesn't work, then after degaussing, you'll still be sending it back in one piece.


Why Use IPSEC AH vs ESP? I am refreshing my understanding of IPSEC.

IPSec is an IETF defined set of security services that use open standards to provide data confidentiality, integrity, and authentication between peers.

IPsec involves two security services:

Authentication Header (AH): This authenticates the sender and it
discovers any changes in data during transmission; incompatible with
NAT.
Encapsulating Security Payload (ESP): This not only performs
authentication for the sender but also encrypts the data being sent
(confidentiality).

Why would anyone ever use AH?  ESP does it plus more.  In other words, why is AH specified?  Also, has anyone ever deployed or used AH-only IPSEC?

AH can be easily inspected by firewalls. ESP with NULL is similar but (AFAIK) the firewall doesn't know that it's the NULL cipher and has no easy way to tell after a connection has been established.

So if you want authentication only then that's a plus for AH.


What is pseudo-encryption key vulnerability? An organization in a related business was recently hacked.  The hackers downloaded several GB worth of files with private information and posted it on the Internet.  The news article states:

  “They were able to feed our system a pseudo-encryption key that the
  system should not have accepted but did because of software errors”

Since I live in a Windows world, this terminology is unfamiliar to me. Please can someone explain what this means and how it might apply to Windows?  I believe I'm following all best practices, but I'm trying to determine if there's something I can learn from the above that could apply to me in a Windows environment.

Normally this would be a "fake encryption key".

In the response to the report:

  Now you are making **** up. As it turns out, I was told what you might
  be hinting at here, and it’s clear you have no idea what the **** you
  are talking about.

In other words, in this context it's just a made up thing.

However, there are other situations, for example IPSEC "NULL Encryption Algorithm" or in GSM (A5/0) where you might give a key during a setup call that would then be ignored.  You could then call it a "pseudo-encryption key" since it would be in the place where an encryption key should be but would be ignored.  This would happen, for example, in some kind of encryption downgrade attack.


Using a Firewall to Trigger Truncation in DNS UDP Response Assume I am a firewall between client and server. If the client sends a DNS query with UDP, I should response this query with set the truncated flag=1. As a result, the client will be forced to use TCP instead of UDP.

Is it possible to generate such UDP responses and how?

Truncated simply means that the packet was larger then the client expected. E.g. if the client expects only 512 bytes by doing recv(fd,buf,512,0) but the message is larger the recv will fail because the message does not fit. With the flag MSG_TRUNC the client can get the truncated message, but not the full message because it does not fit in the allocated buffer.

That means truncated is not a property of the packet itself and can thus not be set at the firewall. At most you could generate a response which is larger than the client probably expects and thus trigger the truncation. But to do this you would need some application level code which generates a response which matches the DNS question, a simple packet filtering firewall can not do this.

EDIT:
There is a TC flag in the message header which indicates that the message was too large for the indicated transport and was thus truncated (i.e. greater than 512 byte for UDP unless EDNS is used). Thus it should be possible to create such a packet. But to make the response packet match the request packet you still need application level filtering, that is a simple packet filter is not enough.

Apart from that the whole question sounds more like either a constructed problem without practical relevance or like an XY problem, i.e. the real problem your are trying to solve is something different.


Thousands of files (png, pdf, tex, java, cpp, etc.) deleted on Mac OS X Yosemite Yesterday, I noticed that, starting at 12:40, many thousands files had been automatically deleted from my drive. The computer is a Macbook Pro with a recent version of Mac OS X Yosemite. Since many folders are under Git version control, I could run a git status, which revealed deleted files in all those directories. I tried to detect a pattern, not using Got alone of course, and it seemed that files were deleted based on their extension.

Deleted: png, pdf, html, mp3, tex, sh, java, cpp, and more
not deleted: sty, toc, and more

The entire filesystem was affected by this, with probably 100K files deleted in total (10K images alone).

At least a very large subset of the files were in Trash, with the earliest timestamp set to about 12:40 yesterday; it seems that the deletions continued for more than an hour.

The computer was in my custody at the precise time when the files were deleted (based on their timestamp in Trash). I was home alone at the time, so I can rule out anyone manually deleting the files as a prank. Given the scale of the incident the files were most likely programmatically deleted.

Does this pattern of deleted files match any well-known, but unknown to me and my searches, Mac malware that is currently doing the rounds?

I have completely wiped the system.

Were you online at the time? I realise that this may be very obvious, but if your mac is linked to any online file sharing site such as dropbox or icloud then deleting files on that site (or another computer linked to the same sharing space) may result in local files being deleted at the next 'sync'. Also, systems such as dropbox have a history mechanism for retrieving lost files if you need them back. Of course git repo deletions will reflect locally if you do various git commands (again, you've probably thought of this).

Now you've wiped the system it may be quite difficult to tell what is happening, but it would have been worth checking the startup programs, which processes were running, the permissions (and therefore the require permissions to delete) of the files that were deleted.

Have you got a time machine backup? Have you thought about how much you will trust that backup?


How can I send and receive untraceable emails? I have been receiving threatening emails from someone, and I don't want them to know my location for my safety's sake, but I need to send them  a "Cease and Desist" notice.  This person has great resources, both technical and financial, and I just wish to be left alone.  What are my options?

Forgetting the reasons behind why you want to do this for the moment and focusing on the technical side of your question.

Your best bet would be the following:

1) Download Tails, a linux 'Live CD' which has a focus on privacy
2) Load it up on your laptop, connect to wifi at a public hotspot such as Starbucks or McDonalds (pay in cash if you intend to eat/drink anything)
3) Connect to the TOR network (it should be integrated into the Tails distro)
4) Pick one of these 'snoop proof email providers' and sign up for an account
5) Only ever access the accounts/send mail etc via the above steps
6) Shut down your computer, remove the Live CD and leave the internet hotspot. There should be no evidence of your email anywhere

Note: While your in the Tails environment, DO NOT do anything outside of your intended purpose (such as checking your real email/facebook etc), this could potentially be linked back to you if you do. Furthermore, DO NOT be tempted to check on your email account from home/work etc. Only ever do it from within the live CD, on the TOR network at an internet cafe of some description.

Technical stuff aside, listen to the other advice posted here and seek legal advice.


In a browser web server communication, who decides which encryption protocol to use My IE browser has SSLv3.0, TLS 1.0,1.1 and 1.2 enabled in the advanced settings.

And (I was informed by my server admin) my web server can encrypt data in SSLv3.0 and TLS 1.0

Now which system (server or the browser) decides which protocol to use. I do know that TLS 1.0 is used. But I need to now which system takes the decision.

To complement the answer from @raz, one must be aware of Protocol Downgrade Attacks. Browsers like IE send their maximum supported version, and then the server chooses (in your case, IE says "I know up to TLS 1.2" and the server responds with "we will do TLS 1.0"). However, browsers know that there exist buggy servers out there, that will simply have an epileptic stroke when the client says "I know up to TLS 1.2". If the connection just breaks, the browser will try again, saying "I know up to TLS 1.1". On failure, it then tries again with "I know up to TLS 1.0". Again on failure, the client will again try, claiming only SSL 3.0 support.

The problem with this behaviour is that an attacker can simply kill connection attempts that try to do anything else than SSL 3.0. From the point of view of the client, this will look like a buggy server that cannot tolerate anything else than SSL 3.0. From the point of view of the server, this will look like an old client that knows only SSL 3.0. The net result is that client and server will use SSL 3.0, even though both support TLS 1.0.

Summary: though, nominally, in SSL/TLS the client proposes and the server chooses, the try-again-with-lower-version behaviour of most browsers implies that, in practice, the client proposes but the attacker chooses. Which is unfortunate.

This is why you should disable SSL 3.0 support in your browser.


Wildcard Paths with semanage fcontext I am trying to set SELinux contexts within a directory structure. So it is something like this:

/var/www/sites
    /www.example.com
        /html
        /logs
    /www.example.org
        /html
        /logs

I want to set different contexts on all of the logs directories and the html directories. With chcon I can just do:

sudo chcon -Rt httpd_sys_rw_content_t /var/www/sites/*/html
sudo chcon -Rt httpd_log_t /var/www/sites/*/logs

But now I want to make them permanent and not so easy with semanage fcontext. It seems to use regex selection based on the docs, which give examples like /myweb(/.*)? repeatedly. So I tried this:

sudo semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/sites/[^/]+/html(/.*)?"

But it doesn't make any changes. When I use restorecon after this nothing has changed. If I don't try to use [^/]+ it works fine:

sudo semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/sites/www.example.com/html(/.*)?"

Can anyone point me in the right direction? Documentation on this is very limited from what I've found so far. How can I use a wildcard selection within a path? Thanks.

Maybe a bit of documentation on the format of the regular expressions that semanage admits would be helpful, I've discovered some patterns that work only through trial and error.

These patterns have worked for me to specify multiple paths beyond the wildcard to he end:

semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/(public/media|httpdocs/wp-content)/uploads(/.*)?"

This matches both public/media/uploads and httpdocs/wp-content/uploads and children.

semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/host/httpdocs(/subdir)?/wp-content/uploads(/.*)?"

This matches both httpdocs/wp-content/... and httpdocs/eng/wp-content/...

I'm making this response a wiki hoping others would contribute working patterns to it.


TrueCrypt vs "native" whole-disk encryption on Linux? When preparing to encrypt an entire partition, is it better to rely on "native" whole-disk encryption (eg following this tutorial), or an external tool like TrueCrypt?

The wikipedia article comparing disk encryption tools doesn't seem overly helpful to me in working towards a decision.

The only thing TrueCrypt gains you is portability. Windows, Mac OS X, and Linux all have a version of TrueCrypt available for download and easy install from http://www.truecrypt.org/. TrueCrypt support is in dm-crypt 1.6+ now which gives Linux native TrueCrypt support out of the box, but you'll have to have a distribution that includes it or install it yourself. Provided you use a compatible file system (FAT32 works on all of them for sure, NTFS with read-only support for Mac OS X by default, and exFAT support works with Linux with the installation of the exfat-fuse package), you can carry a TrueCrypt container and expect to be able to use it on any of the major operating systems seamlessly.

On the other hand, dm-crypt is not as portable to other operating systems, but does everything TrueCrypt does and provides the flexibility of using any algorithm the kernel supports. dm-crypt comes with every Linux distribution and should work out of the box. For Windows, you will need FreeOTFE to mount dm-crypt volumes. You might run into issues with 64-bit Windows along the way. As far as I know, there isn't a FreeOTFE-equivalent for Mac OS X; accessing a dm-crypt volume basically requires installing Linux itself. It's not worth the potential hassle to try and use dm-crypt volumes from other systems if you ask me.

Short answer: if you do not expect to use a volume on other operating systems, stick with native dm-crypt since you'll get support for it straight out of today's live Linux discs. Otherwise, use Truecrypt and FAT32/NTFS.


Governement like classified information system I need to implement a classification system for my company, similar to the government's.

I'm working for a company working with the government. The classification system in my country isn't public so we can't just ask them how to do. We're required to create classification levels like: Top-Secret, Secret, Confidential, Restricted, Public) but with internal names (le, ld, lc, lb, la, "l" stands for "level") just as theirs. We can't know how the government does that, so I need your help to design such a system, talking about encryption, storage, sharing, authentication, ...

We simply need an equivalent system. Concerning the authentication, I've thought about using a PKI. Concerning the storage and redundancy, I've thought about an encrypted external HDD like a NAS/SAN (RAID + geographically distant/separated/isolated connected via a VPN. Levels are cumulative and not automatically deduced. To avoid risk of data loss and because it's needed by the laws in my country, I need to create a 6th level/SOS level (the highest level), to an anonymous which will be able to access and decrypt ANYTHING, and manage the system. "Anonymous" because it's not given to anyone, the "level" will be kept in 1 or more different safe and will be used if there is a system failure or if the government ask access to our data or to manage the system (because I will manage it but I don't have a high level).

I'm thinking about PKI to authenticate someone's identity and level. But then, the user need to decrypt the document. If a data is password based encrypted, it will be stored somewhere (maybe an etoken), if discovered the system is compromised. If I use levels PKI for encryption (1 private key for 1 level), a user which is granted multiple levels will have to store multiple private keys on his token.

Do you guys have an idea on how it's done by the government and their classification system? We have to basically do the same.

EDIT: Some parts of my question aren't clear enough or are bad explained. I've not edited my question based on the answers content, so I hope I didn't change the question because some answers are already really interesting.

Using PKI for access control is a bad idea. It is a very common mistake, everybody who works in the field of PKI makes that mistake, then learns from his errors.

In your situation, suppose that someone who has been cleared for access level 3 has been awarded a "level 3 certificate". This means that this individual has a private key Ks (e.g. on a smart card) and the corresponding public key Kp is in a certificate issued by the CA; the certificate is duly tagged as "level 3". The individual uses his private key and certificate for two purposes:

To authenticate with some systems which verify that the client's certificate is a valid "level 3" certificate.
To decrypt documents which have been encrypted with his public key.

Now it turns out that the individual was bribed by an evil competitor / government. His level 3 clearance must then be cancelled, of course. Unfortunately, this will not fare well with the two usages above:

The individual still has his token in his hands, and the token still works. In order to make the authentication fail, the certificate must be revoked. But revocation is asynchronous; it works with CRL and OCSP responses which have a finite but non negligible lifetime. Revocation will be effective only after a few hours or possibly days. I would not like to be the Security Officer who reports to the management that "the scoundrel has been identified and his certificate was revoked; he will no longer be able to connect and plunder files and spread chaos in our systems, starting... tomorrow. For today, he still can do all of that, and is currently doing it, and we cannot do anything about it because the CRL we issued earlier this morning is still acceptable for all servers".
For encryption, this is worse: revocation or not, you cannot enforce forgetfulness. The bad guy still has his token, thus he can still decrypt. To really prevent him from decrypting data, you must recover (and destroy) his token.

The above means that certificates are a poor location to encode authorization information.

A more robust way of doing things is the following:

A certificate is for authentication only. A valid certificate, containing Bob's name and Bob's public key, is an assertion that Bob is in exclusive control of the corresponding private key. It does not state that Bob is a nice guy or has been cleared for any access level. When Bob turns out to be a spy, he is still Bob and still has his own private key. The certificate should be revoked when that "key ownership" property may be broken (e.g. Bob lost his token, and it may have fallen into other hands), but not in other situations. Loss of key ownership is almost always asynchronously discovered (Bob looks for his token and does not find it, so he assumes that he lost it previously), which is why the asynchronism of revocation is tolerable (i.e. we cannot do better anyway).
All authorization data, including clearance levels, must be maintained "elsewhere", in a system that relevant systems (e.g. servers) can interrogate dynamically, to obtain fresh information at any time. In a Microsoft world, you would put Active Directory accounts in security groups, and removing access would become suppressing the group membership; the effect is immediate (for a more complex and flexible authorization management, see AzMan).
Data shall not be encrypted with a recipient's public key until the last moment. E.g. you encrypt an email when you send it; you don't encrypt thousands of documents with a given user's public key "in advance". You must do such late encryption for two main reasons: because you cannot enforce forgetfulness (as seen above), and also because encrypted data is utterly lost when the corresponding private key becomes unavailable (e.g. Bob loses his token).
Data, when stored, should probably still be encrypted, but with a locally known key, and that encryption is meant to avoid leaks when old disks or backups are discarded. The system which handles the data uses the "master key" to decrypt it and encrypt a copy of the data element with the public key of a given user, but just for that element, and only after having duly verified that right now, in the central authorization manager, the said user is allowed to see the document. Alternatively, the data element, once decrypted with the master key, is sent as is to the user through a protected tunnel (think SSL here) after having verified that the user is indeed at the other end (here goes the user certificate and its validation) and that the user is authorized to access that data element.

In fact, classification levels are only a very crude authorization system, and are not even the main source for authorization. When a document is "secret", it does not mean that every secret-cleared user may read it; it rather means that a given specific set of security features must be activated for that document (keep it in a safe, don't make copies, don't move it outside of a given building...). The relation between classification levels and authorization is one-way: to read "secret" documents, a user MUST have the "secret" level clearance (or higher), but that is not sufficient; the user must also be authorized (because of his role) to read that document. In a business context, this means that though both the Vice-President for Human Resources and the VP for Sales both have "top-secret" clearance, there is no automatic reason why the HR VP should be able to read top-secret Sales documents, and vice versa.

(In actual government / military contexts, it turns out that when papers are tagged "secret", with a very visible red banner or stamp, this mostly is meant so that the janitor does not discard the paper as garbage when he finds it on a desk in the evening.)


SQL injection: real escape string function example4.php?id=id=2-1

I came across the above injection and I can not figure out why(how) does this work and what's interesting is it returns all the records from the database.

Anything guys? educate me

Thanks

It runs the query WHERE id=id. As id is just another column and in SQL you can just pass name of column when doing comparison operations.

This is saying to fetch all rows WHERE id of the row equals id of the same row, which is true for all rows.

This is same as WHERE 1=1, it basically alters WHERE statement in such a way that it is always true.


Can a third party passively read transmissions if WEP / WPA / WPA2 key is known? If I connect to a WiFi network sporting either WEP, WPA or WPA2 encryption, can someone other decipher my communication he passively received if he knows the network's passphrase?

The simplified answer for home routers goes something like this:

In the case of WEP it is trivial to decrypt the traffic being transmitted over the wireless network, since the WEP key is used for encryption of packets.

In the case of WPA it is possible, but not as easy as WEP. WPA makes it harder by introducing a four-way handshake during the authentication phase. In this phase, your computer and the access point "agree" on a key which you will use to send future communications to each other. The problem is that if an attacker intercepts the handshake (and knows the pre-shared key), they can figure out what key you're using for encryption and therefore decrypt your data.

Is it possible to avoid this?

Yes. There are other authentication protocols for WPA which are not centred around a pre-shared key - too many for me to provided detailed answers on each. Have a look at "Extensible Authentication Protocol" (EAP) for more information on these.

Depending on the authentication protocol, it can become very difficult to intercept and decrypt traffic. For (an oversimplified) example, public key cryptography may be employed during key exchange in order to ensure that the handshake is properly authenticated; or Diffie-Hellman might be used to set up a an encryption key in such a way that, even if all of the handshake is sent in "clear-text", the key is not known.

These authentication protocols are commonly used in enterprise wireless setups, where a pre-shared key is obviously not sufficient for security.

Final Note: The problem you're describing is not exclusive to wireless networks. Whenever there is encrypted traffic between two entities, we must consider the security of the key exchange in determining the security of the whole system.

As was pointed out, HTTPS would be adequate to hide your traffic: even if the wireless packets can be decrypted, the content contained within the packet would be encrypted and therefore unreadable** (** not entirely true).

Further Reading:

https://crypto.stackexchange.com/questions/5927/why-does-wpa-psk-not-use-diffie-hellman-key-exchange

Four-way Handshake in WPA-Personal (WPA-PSK)

What are the difference between WPA2-PSK and WPA2-EAP-PSK?


E-mail read receipt through XSS I recently stumbled upon a really silly/unsafe but an interesting way to get a read receipt of an e-mail. I'm not 100% sure if the method in use works, which is why I'm asking it here.

G-mail does not have read-receipts. So, I got this e-mail from a reputed company, a trusted source but G-mail had blocked the images on the page. Since it was from a trusted sender, I did click on "Show pictures in this email". I didn't see a picture there. On looking at the source, I saw an <img> tag with a src to a link which I think is a way to find out if the message was read by me.

My question :

Will this work ? Will the same origin policy prevent the request from going through or does the src in the <img> tag always issue a GET request
Is this legal and has anyone else seen this in practice? If it is not, I have a good mind to report this to the concerned company.

Extra Question

If this is indeed possible, then why wouldn't something like :
<img onload=alert('XSS') src="some-path.jpg"> work ?

This is a fairly common practice called a web bug, it is the main reason that mail clients do not automatically load external images (the second being to protect you from viewing unwanted spam images that could be unsettling; e.g., pornography).

Basically when you load an email with external images enabled and a link to an image like  is in the source, their web server will log something like the following (example below is default access log for nginx web server) when your browser/mail client fetches and downloads the image:

10.1.2.3 - - [10/Oct/2012:10:33:41 -0400] "GET /images/53512_58925.png HTTP/1.1" 200 1933 "http://192.1.1.1/images/53512_58925.png" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.81 Safari/537.1"

which gives them:

your IP address of your computer where you viewed the email (10.1.2.3 in this example),
the timestamp of the access by the server's clock [10/Oct/2012:10:33:41 -0400],
the (first line of the) HTTP GET request to get the image (GET /images/53512_58925.png),
the HTTP response code (200 meaning success),
the size of the file being accessed (1933 bytes),
the full URL of the file (192.1.1.1 is IP of email sender's server), and
the User-Agent string of the client (indicating what web browser and possibly OS you are using).

To really track you accurately, they would need to have a unique URL for the image; e.g., the file 53512_58925.png could mean that user 58925 read the email with the ID 53512 or something.  They could also do something with HTTP GET parameters something like  that would also be logged.

I'm not going to comment on the legality of it; laws vary and some countries that I do not live in have recently enacted strict IT privacy laws (e.g., against a similar policy cookie tracking without explicit user consent).  Also this forum is not really intended to provide legal advice.

This has nothing to do with same-origin policy (used for limiting the power of remotely loaded client-scripts in languages like javascript; so going to unsafe-web-page.com shouldn't be able to read/modify browser data in other tabs) or XSS (where attackers exploit flaws inject content in web pages that are not their own).


Software defense against cold-boot attacks Cold boot attacks are particularly nasty. On Android, a solution is to use a Nexus device with a locked bootloader to preven flashing a custom recovery.

On a PC, your safeguards are even more limited. The attacker that has access to a running laptop can throw it in a freezer, then quickly reboot into BIOS to boot onto a thumb drive designed to search the memory space for the key. Password-protecting the BIOS is a good idea, but your mileage may vary.

One protection I thought of was monitoring the CPU or motherboard temperature in software. If the temperature drops below a certain threshold (ie: cold environment detected), cut the power hard, terminate power as quickly as possible, possibly with a shutdown script which zeroes the RAM.

Would this approach work at least on a theoretical basis? Are there projects which do this in order to prevent cold-boot attacks?

There are several lines of defense:
The obvious ones are to set BIOS password, (as you mention) use full disk encryption, do not use sleep mode, lock mode and especially not hibernation - encrypt it in CMD (Windows 7):

  fsutil behavior set encryptpagingfile 1

Keep your important files in an encrypted container. A successfull cold boot might get into the FDE but not the container inside (correct me if I'm wrong)
Make sure you have DDR3 RAM, it has the lowest memory persistance for this attack, older types are a lot slower.
If you can, enable Power On Self Test (POST) in BIOS, it will attempt to zero out memory.
ECC memory will reset the memory during initialization. Check if you have it in CMD (W7):

  wmic MEMORYCHIP get DataWidth,TotalWidth

If the TotalWidth value is larger than the DataWidth value you have ECC memory.

If you are physically hindered from shutting your PC down you may use remote shutdown software from smartphones. The ideal way is a an Android which binds the shutdown initation to a e.g. pressing up/down volume x times. This way you can shut down the PC with your hands in your pocket.

This is a golden nugget from a Blackhat paper. Unfortunately I don't have the slighest clue on how to implement this.

  BIOS BOOT:  Remnants of encryption keys can be recovered with very high probability, unless your master disk keys are stored in the physical address range 0x7c00– 0x7bff.
  A disk encryption filter driver loads very early in the boot process and can allocate this memory range for its exclusive use.
  512 bytes is enough room for multiple disk encryption keys, or for an AES 256 key schedule.
  Any attempt to boot to ANY alternative operating system or device will overwrite the keys stored in this address range.

In the very same paper they discuss your question:

As for a software solution (I have not tested) but I can see that HWiNFO has an alert function, however I was not able to find RAM temp, but I didn't try very hard.

Lastly (something I have no experience with) you can "permanize" your hardware state by using Epoxy to make it difficult to remove hardware and/or difficult to introduce new hardware.
Sidenote: for those of you with a stationary PC, a chassis with screws and DDR3 memory is plenty of obstacles to prevent cooling of ram if you start shut down before attacker attempts anything.


Malware and Windows 7 I am trying to going into a new military occupational speciality for the cyber community and I am having some difficulty with some of the questions on a questionnaire. The two questions I am having trouble are as followed. I am willing to read other websites to find the answers.

How can a Windows process list, viewed either through Tasklist or Pslist, be used to identify malicious processes? Identify at least 3 ways.
A piece of malware is running on a Windows 7 machine via process injection, so it does not show up in a process list. What remote forensic technique could be used to discover the malware is running under the contents of a specific process?

You can spot processes that:

have a similar name with an officially named process - example: svch0st instead of svchost, expiorer explorer
have randomly generated names - examples : fh74w7ha, xf8f4a34, m599j42k.
have insufficient/inaccurate general description - example: file

You can detect P.I. malware by studying:

Parent-Child process relationship (example: processes named accordingly but not started by winlogon.exe or wininit.exe but by another process)
Usage of suspicious memory protection (PAGE_EXECUTE_READWRITE - sometimes at a round address like 0x1000000).
Comparison between PEB and the VAD structure (process memory vs kernel memory)


What L7 traffic patterns can make it easier DoS an Apache web server? We have a single JMeter HTTP load generator that we use to capacity test our web service (running Django + mod-wsgi + Apache)? If we want to modify the traffic generated to DoS our web service, what are the most effective changes that we can make that could cause the target service to fail with the lowest resource requirement on the load generator?

Examples that we are considering include slowing down the traffic send rate, pulsing requests to be sent in bursts and sending malformed data. Which of these, or any others, will yield the most bang-for-our-buck, considering our tech stack?

Denial of service and traffic overload are two different things, so using a traffic generator isn't really the way to go. Traffic generators are great to model real-world usage of a resource (e.g. users coming at random times (Poisson distribution), random or recorded navigation templates, common searches and errors...). Most DDoSes are little more than GET / HTTP/1.0, but in job lots. Large job lots. That's not real "traffic".

If you want to see what happens when the system gets DoSed and exhausts its resources, you can e.g. disable SYN half-open protection (SYN cookies) if present, and use some DoS utility to fake opening connections. Or keep the connection open through, say, a Perl script.

Or you can send requests to those endpoints with a higher system load (e.g. that need database querying).

Malformed data will in all likelihood be intercepted at the outer layers of the Django router (if not by WSGI itself) and generate the least load. It depends on the malformation, of course.

Slowing down the send rate should stress Apache more than the rest of the stack (Django sends its output in fire-and-forget mode), while pulsing requests should hit Django more heavily, especially if they're crafted against the more expensive endpoints.


Sign/Verify vs Encrypt/Decrypt vs SSL May know what is the key differences between these three certificates.

Sign/Verify
Encrypt/Decrypt
SSL

This is probably about (extended) key usage:

sign / verify is known as Digital Signature:

  Use when the public key is used with a digital signature mechanism to support security services other than non-repudiation, certificate signing, or CRL signing. A digital signature is often used for entity authentication and data origin authentication with integrity.

encrypt / decrypt is known as Data encipherment

  Use when the public key is used for encrypting user data, other than cryptographic keys.

SSL is known as TLS Web server authentication or TLS Web client authentication

Source: this page of IBM which does a wonderful job of explaining (extended) key usage.

As for the differences: signature generation is used to provide message integrity and authentication (although it could be used for entity authentication as well), encryption is to provide message confidentiality and TLS authentication is to perform entity authentication.

There is another key usage for non-repudiation, which is for instance used for official documents. Non-rep has a slightly different use than just signature generation.


Deep attestation of VM's Hypervisors like Xen have virtual TPM (vTPM) support. In cloud environments, are there any implementations where such vTPM's are being used during remote attestation in addition to the host TPM based attestation in practice? What are the possible advantages/drawbacks of using vTPM's?

There is a very helpful document on this from IBM that can enlighten you on your query.

  It is necessary to enable remote
  parties that have established trust in the initial environment
  to also establish trust in the vTPM environment at
  a later point in time.
  For example, the strong binding of TPM credentials
  to those of the hardware platform is important to challenging
  parties during remote attestation. The challenger
  must follow the trust chain from the target platform’s
  hardware TPM through a virtual TPM and into the runtime
  environment of the associated virtual machine.

Pay special attention to page 6.


Secure shuffles and the rand() function I'm trying to understand one aspect of a secure shuffle using Fisher-Yates. For reference, here is Fisher-Yates to shuffle an array x of n elements (numbered from 0 to n-1) (from Securing a Shuffle Algorithm):

for all i from 0 to n-1
    let j = rnd(n - i) + i
    swap x[i] with x[j]

I don't quite understand what Tom Leeks is getting at in his explanation of the rnd function at Securing a Shuffle Algorithm:

rnd(k):
    while true
        let z = next-random-word
        let r = z mod k
        if z - r + k <= 2^32
            return r

Why can't r be used directly, and why is the if z - r + k <= 2^32 needed?

I think my problem is I don't appreciate on understand the bias in the reduction.

The check is to ensure that skew doesn't occur. If your random number generator has a range of 0 to 9, and you simply take a straight modulus, you'll end up with the following outputs:

0 % 6 = 0
1 % 6 = 1
2 % 6 = 2
3 % 6 = 3
4 % 6 = 4
5 % 6 = 5
6 % 6 = 0
7 % 6 = 1
8 % 6 = 2
9 % 6 = 3

This leads to the values 4 and 5 being less common than 0, 1, 2, or 4.

The algorithm Tom gave ensures that the range of the raw RNG values is limited to a range that is evenly divisible by the output range.

So, let's say we want a range of values from 0 to 15. That's a total range of 16. Our internal RNG outputs values between 0 and 100, which would lead to skew like above. The design of the algorithm rejects values larger than or equal to 96 (because it's the largest number less than 100 that's divisible by 16) because those values would lead to skew.


Security characteristics through ISO 25023 standard Could you please help me to clarify the following:

ISO 25023 standard divided security into the following 5 characteristics which are:

Confidentiality characteristic (divided into) -----> Access controllability and Data encryption
Integrity characteristic (divided into) -----> Data corruption prevention and Internal data corruption prevention
Non-repudiation characteristic (divided into) -----> Utilization of digital signature
Accountability  characteristic (divided into) ----->  Access auditability and System Log keeping time
Authenticity characteristic (divided into) -----> Authentication protocols and Establishment of authentication rules

Based on the literature, authenticity is a part of confidentiality (access controllability), why ISO has separated it form confidentiality and categorized it as a characteristic?

I agree that these terms overlap and I also have a hard time differentiating between them in the context of read-access (where Authenticity can not mean the assurance of information 'being authentic' - originating from a known source, but only Authentication as an agent with certain access privileges). But here are some examples involving write-access in which the two concepts differ:

An attacker can read encrypted messages from a channel, and now has gained access to a decryption key. The measure ensuring Confidentiality (the encryption) has been circumvented, but Authenticity may still be in place, in that only the alleged and intended author could have created the messages (asymmetric cryptography can ensure this, as can access control on the channel).
An attacker writes to an encrypted communication channel. Confidentiality requires the plaintext that is being communicated not to be discovered by attackers, which still may very much be in force, even if the attacker can actually read from the channel as well. Authenticity, however, has been defeated, and 'replayed' messages can be used as an angle of attack.

I am under the impression that the distinction is quite common, and that Confidentiality, Integrity and Authenticity (allowing for the convenient initialism CIA) are cited as essential in secure communication. My notes from university - based on the Parkerian Hexad - add Possession, Avaliability and Utility as rather self-evident qualities, but in any case retain the distinction between Confidentiality and Authenticity.


Is it acceptable for customer service to ask for my PIN? I tried to initiate an online chat with customer service of a company I am trying to do business with this weekend, but before they would answer any of my questions they requested that I give them the 4 digit PIN associated with my account. For all intents and purposes, this is my password, as this along with my e-mail address is all that is required to log in to my account and do whatever.  (Yes, the fact that it is only 4 numeric digits isn't particular reassuring either!)

I responded that I wasn't comfortable giving this information out, seeing as how it was pretty much a standard security practice to never give your password to anybody, but they pretty much refused to talk to me if I did not give them this information.   Seeing as how when I created the account I also had to give a "security question" (e.g. what was the name of your first pet, that sort of thing) I was also puzzled as to why they wouldn't just ask for that.

Am I overreacting, or am I justified in refusing to provide this information?  For what it's worth the only other way to talk to this company is by phone, which is very inconvenient. (Update: Not that that is particularly relevant, but from what they said it sounds like they would require my PIN to talk on the phone too.)

Your action is justified from me. I have never been asked from any major and respectful company such information, neither for a service, nor even for account recovery. Send a message to the official support team and see if these info are actually needed if this thing causes you lots of inconvenience. But be aware of this - you might be scammed.


What are the risks of self signing a certificate for SSL Let's say I sign a SSL certificate for myself, and I'm not using a certified CA. What are the risks and/or threats of doing it?

The risks are for the client. The point of the SSL server certificate is that it is used by the client to know the server public key, with some level of guarantee that the key indeed belongs to the intended server. The guarantee comes from the CA: the CA is supposed to perform extensive verification of the requester identity before issuing the certificate.

When a client (the user and his Web browser) "accepts" a certificate which has not been issued by one of the CA that the client trusts (the CA which were embedded in Windows by Microsoft), then the risk is that the client is currently talking to a fake server, i.e. is under attack. Note that passive attacks (the attacker observes the data but does not alter it in any way) are thwarted by SSL regardless of whether the CA certificate was issued by a mainstream CA or not.

On a general basis, you do not want to train your users to ignore the scary security warning from the browser, because this makes them vulnerable to such server impersonation attacks (which are not that hard to mount, e.g. with DNS poisoning). On the other hand, if you can confirm, through some other way, that the certificate is genuine that one time, then the browser will remember the certificate and will not show warnings for subsequent visits as long as the same self-signed certificate is used. The newly proposed Convergence PKI is an extension of this principle. Note that this "remembered certificate" holds as long as the certificate is unchanged, so you really want to set the expiry date of your self-signed certificate in the far future (but not beyond 2038 if you want to avoid interoperability issues).

It shall be noted that since a self-signed certificate is not "managed" by a CA, there is no possible revocation. If an attacker steals your private key, you permanently lose, whereas CA-issued certificates still have the theoretical safety net of revocation (a way for the CA to declare that a given certificate is rotten). In practice, current Web browser do not check revocation status anyway.


I am worried because my college asks students to confirm their credit card number, location, SSN and full name on signup. What do I do? When a user logs in with their username (Their public ID number)  and a password (Their birthday, by default) their name, full social security number, partial credit card number/Expiration date, and billing address is sent over. The user is asked to confirm that the information is correct; This happens every time they try to add classes.

I have a feeling this a massive security risk even though it's sent over HTTPS, but I'm just a student here. What do I do?

(Some less critical information like phone numbers are also sent over)

When you say sent over what do you mean? Is this information presented to you, and you then  have to verify it or does it also ask for this information as well as your regular login credentials (Username, password) of which it then verifies whether the credentials (SSN,  etc.) that you have entered are correct?

Because there is to sides to the security coin as it were, with this situation. As using multiple factors of authentication before a student can add a new class is a particularly good idea, as the underlying fact is it's hard for an attacker to gather all that information on a single person unless of course you're really clumsy with your credentials or your attacker is a really good profiler. However, keeping that amount of data on a person is possibly not the best thing to do if your colleges back end is not all its beefed up to be.

-Dumming down the HTTPS stuff before I go on too much!-
On the matter of the use of HTTPS. It's only really as good as it's implementation.
There are allot of holes and work around's if it hasn't been implemented correctly. Although I shouldn't worry about it as much as the integrity of the AP you're using to send that information.

But If you have any concerns you should talk to a lecturer or someone higher in Management and always use a VPN or if possible an SSH Tunnel.


As a user, how can I defend myself from disclosed unpatched zero-day vulnerabilities? In the wake of the Hacking Team breach on July 6th, 2015 [1] [2] I heard that some previously unknown zero-day exploits might surface (apparently one for Flash already has).

Once these exploits become public knowledge and before a patch that fixes the vulnerability is provided, how can I defend my system as a private user?

The answer is to take responsibility for your own security.

If you rely only on software vendors for your security your trust is arguably misplaced and you might be disappointed quite often.

You are in control of your system as an individual and it is therefore your responsibility to take the necessary measures to protect what is important to you. Most software vendors care very little for you cat picture collection.

It all comes down to knowing what is on your system, how you use it, how important it is to you and how you can minimize exposure. The reputation of a software vendor is a great guide to knowing how much trust you should place in a piece of their software.

Based on your personal risk assessment you can employ basic secure "best practices" like disabling Flash in your browser by default and only enabling it when absolutely necessary, or better yet, removing it completely. If possible, you can also stop using the software completely as another answer suggested. If you want to take it one step further you can also have a default deny policy for javascript in your browser to prevent unwanted malicious script for running (I do this - it's a lot of effort but I sleep better at night). Don't click on email links. Review which ports you have exposed to the internet. Trust with reluctance ... and so on and so forth.

Having said this, you should know that  even if you do all of these things you can only ever make an effort to minimize exposure and will never be immune to 0-day as even the most trustworthy software can be vulnerable in some way, and when this day comes it is your queue to reevaluate your risk and adjust your behavior and mitigation accordingly.

Remember: "The only secure computer is one that's unplugged, locked in a safe,
and buried 20 feet under the ground in a secret location... and I'm
not even too sure about that one" - Dennis Huges, FBI.

Edit: I forgot to mention a very important and relevant concept that ties in with some of the points made before. In order to mitigate the potential effects of a 0-day vulnerability in any particular piece of software you can make sure that in your environment you adhere to the the principle of least privilege. By constraining the privileges of the software you inherently limit the privileges of the the exploit*.

*Assuming the exploit does not make use of a privilege escalation vulnerability.


Is it bad to have cameras using a static IP address? I am about to move in a new house, and I would like to install some security cameras.

The contractor told me that in order for me to check the videos recorded by the cameras in real time when I am away I'll need to have a static IP address.

Are there problems with it? Is it less secure?

I am not a billionaire or famous so it is unlikely there will be targeted attacks. On the other hand it would be my home network and it'll happen that I'll input my bank credentials sooner or later, so I want it to be safe.

Static or dynamic IP is a non-issue.

But since you brought up cameras, you should know that many IP cameras have VERY poor security.  Many of these cameras have a known bad firmware in them that allows unauthenticated download of the entire memory of the device via simply going to /proc/kcore, without the need to authenticate.  This allows anyone to obtain the password for your camera.

http://www.tripwire.com/state-of-security/vulnerability-management/vulnerability-who-is-watching-your-ip-camera/


Threat Hunting Vs SIEM use cases Lately I'm confused about threat hunting vs SIEM Use case creation.
The threat hunting resources I have read can be created as a SIEM use case. Then why should I perform it manually in the name of hunting?
How exactly does hunting differ from SIEM use case?

How exactly hunting differs from SIEM Use case

To simply break this down and answer this question above, when you handle alerts & events with SIEMS it involves a reactive approach. Whereas for Threat Hunting, it harness a more proactive approach. Basically aiming to be a step ahead of threats instead of being on the receiving end of them. Just this alone separates the use cases for both of this specialties.
However, Threat Hunting and SIEM should be able to coexist and is highly recommended to be used together and not either or. The Data gathered from your organization/infrastructure can be used as a set of benchmarks and guidelines and to aggregate said data for analysis and threat hunting.
A succinct guide for Threat Hunting, basic touchpoints


Secure way of opening web page from iOS without need of logging in I am developing an iOS application and web page, both use same Parse backend.

Web page contains some functionality that is not available in the iOS application. Therefore I would like to present the user an option to open home page from app. As user has already logged in before in the app I would like to skip the login process when home page is opened.

I have a solution in my head for which I would like your opinion. When the user clicks on a link in the app, the app would call e.g. generateToken function in Parse which would create a random token, store it DB with some expiration date for this user and return it to the app. The app would then open the web page with query parameter token=newly_generated_token or pass the token value in the http headers if that can be accomplished.
On new request the server code would check if parameter (or header) token exists, check the db for token value and log in the appropriate user where match would be found. Afterwards the token would be invalidated. If the request would not contain any 'token' parameter the usual authentication would go through and login page would display. All comunication would be over https.

I get rid of replay attack by invalidating token when used. Is it vulnerable to any other attacks? Or is there any other way of doing this?

Any help appreciated. Thanks!

Replay attack is only a concern if you're sending the token over a plaintext mechanism (HTTP), in which case the contents of the page would be available to the attacker as well.  The technique you've described is sound, but you can even do it without needing the DB write.  On the server side, you can simply compute an HMAC across a unique resource id (user id if it's one per user) and an expiration time.  Upon receiving this token, the server can validate it as legitimate and verify that the token has not expired, then present the content to the user.

App calls /getToken?resource=foo
Server generates token: token = foo || now() + 15 minutes
Server signs token: h = HMAC(key, token)
Server returns signed token: token || h
App opens browser to /resource?token=token
Server validates that hash on token is valid for the requested resource at the requested time.
Server provides content to user's browser.


Virus Removal Boot Disks -- a few questions I'm new to working with and using a backdoor/virus with a boot disk.

Can they be mounted to a USB drive?
What options are out there and what should I look for in one?
Are they practical?
Do they need to be upgraded/replaced every few months?

If your machine can boot to USB, then you can use an image designed for USB booting, but most are designed for CD/DVD
Just about every AV vendor has a live CD to boot from. Look for one that can access up-to-date virus definitions.
They are very practical from the standpoint that they can inspect the disk while it is at rest and not running an operating system. There are still types of malware that can hide from offline scanning, but live CD's are a real option for most types of malware. On the other hand, in my experience, live CD's can be extremely slow, which reduces their practicality for regular scanning.

EDIT

Just like any software, improvements come over time, so getting the most updated version is important. ... I'm not sure why point #4 was added ...


Authencity of information displayed on an untrusted device Suppose I have a (bluetooth/usb) device which needs to displays information on an external pc/phone. Is there a simple and effective method to garantuee that the information displayed hasn't been altered by malware on that PC or phone?

One possible solution I thought of: the device could generate an unique picture once (based on a private key), and draw the information text on that image every time, and send the end-result to the smartphone. Now if the attacker wants to change the text, it will create gaps in the image, and the attacker cannot fill the gaps, because he doesnt have access to the original background picture, which is stored on the trusted device. As long as the end-user recognizes the image, and visually inspects it very careful for artifacts, that could be pretty secure?

Is there a better solution than the one I just proposed?

I understand your question as follows: there is a tangible device which may produce data and send it over radio (Bluetooth); and another device (say, a smartphone) which receives said data, and displays it; the problem being that the second device cannot be trusted. So the question is: can we do something about it, so that we may gain some confidence in the data as displayed being a faithful representation as what the first device sent ?

Generically speaking, no, we cannot; liars lie. Unless the data that the first device sends comes with some sort of checksum or signature that the second device cannot forge or fake (digital signatures and MAC might prove useful cryptographic tools for that), and that the human observer verifies independently of the untrusted smartphone. This latter point is the true problem: a normal human observer will not compute in his head a signature verification or a MAC.

Workarounds for that kind of situation come in two kinds:

Add a display directly on the first device, so that the device may display its data directly, without interaction from the potentially hostile smartphone. This is what is done with payment terminals: though they are linked with a cash register which is, basically, a PC, such terminals still have their own screen and keyboard because the cash register is not ultimately trusted.
Add a third device to the dance. Give the user a device that he trusts, and that will verify whatever MAC or signature computed by the first device. Mutatis mutandi, this is the Internet, with the untrusted smartphone mapping to mere routers; some SSL between source and destination protects the integrity (and confidentiality) of data from mishandling by routers.

(We may note that this problem is also an inherent issue with smart cards inserted in PC through dedicated readers or USB ports. When we enter the PIN code, it is on the PC; we cannot really know what the PC asks the smart card to sign.)


is it possible to write php code in address bar and its gonna work? Is it possible if i use in address bar this

host.com?<?php unlink("/img/bg.jpg");?>

or

host.com?<?php rename("/bg.jpg","bg.png");?>

if not then is there any way to do that?

Sadly yes, or very close to it, but only due to bugs and/or misconfiguration. For CGI PHP installations there was recently an arbitrary remote code execution using the query string: CVE-2012-1823

Detailed write up by Eindbazen who discovered it at a Nullcon CTF:
  http://eindbazen.net/2012/05/php-cgi-advisory-cve-2012-1823/

There's a Metasploit module to leverage this too.


Where can I find articles about identity disclosure attack? Where can I find more details about identity disclosure attack and it's prevention?

If the adversary tries to steal the identity of an individual like mobile patterns and start appears in various locations. How can we detect them?

The intruder may change the data by listening to the victim for a very long time and try to simulate it, just like identity disclosure attack.

How can we identify the attacker, and can we able to report them to the central authority?

Identity theft deterrent / strategy

For some quick wins I suggest you read into NIST initiative on National strategy for trusted identities in cyberspace

To give you the quick summary of the program focus and objective it is to...

  The new Identity Ecosystem is meant for sensitive transactions — banking, shopping, accessing health records, etc. It is designed to protect your privacy by helping online providers verify your identity before accepting or providing sensitive information to you

This is where the real attacks happens and attacks that costs which is sometimes unquantifiable e.g reputation and trust.

REPORTING

I hope I have understood you correctly if you want some responsive authority to take action in case you experience some indications of fraud then depending upon the country you live and the laws that applies you can best contact local law agency. Like in case of USA FBI help you identify the fraudster through this online reporting system.

http://www.fbi.gov/about-us/investigate/cyber/identity_theft

If you are from USA then following agencies get involved when its comes to prosecution

Excerpt taken from What Are Identity Theft and Identity Fraud?

Federal prosecutors work with federal investigative agencies such as the Federal Bureau of Investigation, the United States Secret Service, and the United States Postal Inspection Service to prosecute identity theft and fraud cases.

Responsible authority
Also, taken from the excerpt

  Under the Identity Theft and Assumption Deterrence Act , the Federal Trade Commission is responsible for receiving and processing complaints from people who believe they may be victims of identity theft, providing informational materials to those people, and referring those complaints to appropriate entities, including the major credit reporting agencies and law enforcement agencies

ONLINE REPORT FTC


Tor exit node can know my IP address? I have read some articles about how Tor works. I know about layer by layer decryption, but there is something that I cannot understand:

If the exit node is the one that does the last decryption and sees the plain text, so it could know about my real IP address which is included in the http header. How does Tor deal with this? Does the client include it's IP address in the main packet at all?

The exit node will not know your address. The principle is that every server only knows the address of the previous and the next host but never the whole path. There are three steps between your TOR browser and the webserver:

Entry-Node (Knows your address and relay nodes address)
Relay-Node (knows entry-node and exit-node address)
Exit-Node (knows address of relay-node and webserver)

The packet you send is traveling this chain and the answer is travelling the same chain backwards. When you use HTTPS none of that TOR servers will ever know the content of packages sent/received. What they all do is adding encryption on top of your connecten even if it is already encrypted using SSL.

// Like in NAT the TOR-Nodes will replace the Source address of the IP-Packet with their own Adresse. The packets are then encrypted between the nodes. The only node that knows your address is the entry node which stores this information in the memory and will or should at least never store it permanently .


Windows RDP logging into itself? There is a computer system that has to have RDP on an open port(I fought against this of course). I secured this via RDPGuard which worked phenomenally. Anyway, after a few weeks I check back on those RDP Logs and I see a RDP login attempt originating from the loopback address, 127.0.0.1 or the actual external IP Address of the server

The user it's attempting to log in as is SERVER$ and I've actually recieved log in success reports from it as well. Is this actually normal Windows behavior or did I just get pwned?

No, this is not normal behavior. Most likely, the server has been compromised, and it has a backdoor installed that forwards the connection to RDP server. Probably a reverse tunnel, given that the RDP port itself is exposed to the internet and forwarding from another port wouldn't be that useful (it would just conceal the connection a bit).

I would try to find out the backdoor, so you have evidence to present that the server was indeed compromised, then wipe & reinstall the server and use the experience to get that the RDP not published. If someone really needs to RDP to that server from outside the company, that should be secured over a VPN. If you hadn't noticed the compromise in the log, your first notice could be when you come and find the server ransomwared. Or that internal information have been leaked through it (in fact, who knows that they already did...).

Good luck getting that improved


HOW is the malicious URL/payload is delivered to the user on a DOM based XSS attack? Testing for DOM based XSS at OWASP reads:

  The first hypothetical example uses the following client side code:

<script>
document.write("Site is at: " + document.location.href + ".");
</script>

  An attacker may append #alert('xss') to the affected
  page URL which would, when executed, display the alert box.

and other sites talk about very similar examples.

The problem is that I cannot find an explanation on HOW the malicious URL/payload is delivered to the user, like how the user can fall victim to this attack since it's a client based attack and requires no server interaction.
Is phishing used for DOM XSS as well?

And how does the attacker identify a site with a possible DOM based XSS vulnerability?

The link you mention says that DOM-XSS is the de-facto XSS. This is simply stating that in XSS you are executing scripts (e.g. JavaScript) that are injected into the DOM.

HOW the malicious URL/payload is delivered to the user?

In some cases (reflected XSS) it's phishing: "Hey check out thiswebsit.com?p=[XSS payload]" When the phished user visits the site the script executes in their browser.

In other cases (stored XSS) you may be able to store a script in say, a comment box that is displayed to every other visitor of the site: "Hey this is a great site! [XSS payload]. Now when any user visits the site and your comment is rendered the malicious script is also executed in their browser.

In both cases although you've inserted JavaScript, that payload is not actually visible as text to the end user. The script is however executed in the end user's browser. The script payload may be a simple alert box, it might be a payload that sends their session authentication cookies to a server you control (allowing you to 'login' as them), or a number of other things.

How does the attacker identify a site with a possible DOM based XSS vulnerability?

Burp was already mentioned, this is a great tool.

A very basic way to get started testing/understanding XSS is to ask yourself when viewing a page "What data do I control, and what data is displayed back to me?". If you can test these data points for script injection you are on your way to understanding XSS. Data points that commonly are vulnerable to basic XSS attacks are comments, usernames, profile details, error messages, and search parameters.


URL Filtering - What is the reason for blocking short url By default many URL Filtering products will block the navigation of short URLs (e.g. the URL used by Twitter to link external pages).

What is the reason behind this block? Why I should prevent the navigation of short url?

Many thanks.

Usually a user can inspect the link on a website before clicking it. Certain websites serve the lone purpose of redirecting to another URL, which cannot be checked easily beforehand. Therefore, the user cannot possible know, which website he is about to connect to, which is not really safe-browsing.

I guess, this is the most common reason to block Short-Links.


What does "packed file" mean in security? I am a beginner in information security.

I was clueless about the term "packed file".

Can anyone explain to me what a "packed file" is in term of malware analysis?

A packed executable file is one which is compressed. It contains a small amount of uncompressed code which decompresses and executes the main payload. Files are often packed to reduce their overall size. However, this is commonly done by malware authors as well to reduce bandwidth usage and to confuse older antivirus software, so it's become somewhat of a red flag, despite having benign uses. This is compounded by the fact that packers have become less common in general.

Modern large executables typically reduce total size by compressing individual resources (images, audio, misc data, etc.) rather than using a packer to compress the entire thing at once, code and all.


Windows PE file and Malwares Trying to understand how and why any virus, malware, worm and code injections are successful after all in a Windows Portable Executable format.
I was going through the PE structure documentation, Part 1 and Part 2.

What is it in PE executable, is the the headers, sections that let code injections happen? why are they vulnerable for executable code modification and injections? In other words how does a virus or malware injects itself or some other malicious code in a PE file or in memory process?

A portable executable (PE) file can describe a number of different types of object, including EXE files, DLLs, screensavers, and drivers. All PE files have a set of headers, followed by a set of sections.

The headers and tables describe the type of executable, the functionality it supports, the APIs it calls, etc. The sections tell the PE loader how to map file data into memory.

There are three main headers and two main tables:

DOS Header - Contains the magic number (MZ), the DOS stub, and some very low-level information about the executable. This is largely legacy now, and is only included for historical purposes.
Common Object File Format (COFF) Header - Contains machine type (e.g. i386 or Intel64) and some basic flags about the type of executable that this file is.
Portable Executable (PE) Header - Contains information about the runtime of the process, e.g. entry point address, code and data sizes, base addresses, the Windows subsystem to run in (e.g. GUI, console, driver, EFI, etc.), the characteristics of the module (e.g. is it NX / ASLR compatible?), the initial stack and heap sizes, etc.
Data Directory Table - A set of pointers (RVAs) and sizes for sixteen "special" segments of the file data, e.g. the import / export directories, the debug directory, .NET metadata, security directory, relocation table, TLS directories, etc
Section Table - A table that represents various sections within the executable. Sections contain the data that constitutes the actual program, e.g. the instructions.

When the OS loads a PE file, it creates blocks of virtual memory for each section, with the addresses, sizes, and flags specified in the section table, and copies the data from the file into these memory sections. There are two special sections: code and data. The code and data sections are identified by the BaseOfCode and BaseOfData fields in the PE header, and are assigned to the CS and DS segment registers respectively. The eip register (or rip in 64-bit) is then set to the value as specified in the AddressOfEntryPoint field in the PE header, and the program begins.

The PE format was not designed to be resistant against modification. There are many vectors to code injection at the file level:

Add a new section to the section table, mark it as code, then change AddressOfEntryPoint to point to your new section. You can now execute code and return back to the original entry point (OEP). This is easy for AVs to detect because the EP points to outside the code section.
Inject code into the "slack" space at the end of the original code section, then modify the entry point and jump back to OEP at the end of your injected code. This slack space is usually limited in size, so it's not always this simple. It may also be possible to use dead code as slack space.
Expand the original code section, shift the data down, inject your code at OEP, re-map the entire section table, re-map any fixups, and rebuild the imports and exports directories. This is difficult, and essentially involved re-building the entire file, but is difficult for AVs to detect.
Add a new data directory that contains instructions (often encrypted), then inject a small stub into the program (through any of the above methods) that allocates a new executable memory block and copies the data into it. If encryption is used, the stub decrypts the instructions. This new code block can then be jumped to directly.
Add TLS callback entries that include an initialisation callback to some code you have injected into the file (e.g. via a new section).
Modify known functions to do something different entirely.
Modify call tables to point to alternative (patched) code.
Many more...

As you can see, if an adversary has write access to a PE file, they can inject their code pretty easily. The best protection against this is digital signatures, which are managed inside the security directory of the PE file. A digital signature is essentially a certificate that is signed by a trusted provider, or by a provider whose certificate authority you trust. This certificate is then embedded in the PE file, and matches the data exactly. If you modify the PE file, or modify the signature, the PE loader will reject the file. Of course, it is also possible to simply strip the signature from the file, so that it runs without any certificate. This can be prevented via local policy, in which you can set a flag that requires all executables to be signed.

Unfortunately, this isn't the only way to inject code. The alternative is to inject memory into a process at runtime, then start a remote thread inside that process. This is relatively trivial in Windows:

Call OpenProcess on the target process, with PROCESS_VM_WRITE, PROCESS_VM_OPERATION, and PROCESS_CREATE_THREAD privileges.
Call VirtualAllocEx to allocate a block of executable memory in the remote process.
Use WriteProcessMemory to write code into that memory.
Call CreateRemoteThread to start a new thread in the process, using the base of the allocated memory as the thread entry point.

This causes code to run in the context of the target process. However, this is only possible when step 1 succeeds, and this is reliant on the malicious process having access to the other process. A low-privilege user cannot open such a handle to a high-privilege (e.g. administrator) user's process. However, if the malicious process is running with high privileges, all bets are off.

There is very little that can be done to protect you from these attacks once a malicious application is running with write access to processes and executable files.


Is it possible to defend against a backscatter attack? Yesterday, some spammer on the other side of the world decided to send out a ton of phishing mails with my business mail address as both From address and envelope sender.

The usual best practices are in place: My provider (apparently) uses Bounce Address Tag Validation, and our Sender Policy Framework record ends with -all. Thus, the amount of "regular" NDRs was a lot smaller than it could have been.

Still, I received about 1-3 auto-replies per minute: "I'm on vacation...", "Thanks for contacting us...", "You message contained malicious content...", "I'm out of office...", "Mr. X is no longer with the firm...", "Our e-mail address has changed...", "Your message has been received and a support ticket has been generated..." - just to name a few. Obviously from around the globe and in a multitude of different languages. Quite an interesting read, actually, if you don't have anything better to do.

Unfortunately, I do have better things to do, and, fortunately, some of the auto-replies included a copy of the original message, allowing me to determine the spammer's IP address and get him (or the poor guy whose server he hacked) shut down by his hosting provider.

Still, I was wondering: 1-3 unsolicited mails per minute I can handle next to my "regular" work, but if the spammer had used more hosts (or even a bot network), my mail account would have effectively been DDOS'ed into uselessness.

Is there anything one can do to defend against this kind of "backscatter auto-reply attack"?

The problem is that autoresponders exist, and that they reply to the senders email address, which is easy to spoof.

There is nothing you can do to prevent this. Filtering is ineffective since they are (from the computer's perspective) legitimate messages. Banning the IP is also ineffective since any particular IP is unlikely to send more than a few messages.


Are webcache pages more secure? Whenever I see a suspicious looking URL I want to go to, I usually just search it up on Google's webcache and browse the site that way. But I just realized that I never really had evidence to support this kind of habit. Are web cached pages generally more safe than the original pages?

Cached pages aren't inherently more secure, as the same page is being sent to your browser. It still renders the website in your browser.
If you need to go to a sketchy website, turning off plugins and JavaScript makes it more safe.
In Chrome, go to Content settings and add a Deny exception for the site in Plugins and JavaScript.
For Firefox, use the NoScript add-on.


Socket.IO Client Security I am new to Node.js and Socket.IO. According to documentation the client side code is something like:

<script src="/socket.io/socket.io.js"></script>
<script>
  var socket = io('http://localhost:3000');
  socket.on('news', function (data) {
    console.log(data);
    socket.emit('my other event', { my: 'data' });
  });
</script>

It's simple and easy but although it's perfectly fine for local testing I am not sure whether is really secure on a live page since it's exposing the event information of the server.

How do I hide the sensitive information on a page like this ?

Socket.io creates a WebSocket,  and WebSockets follow the normal Same-Origin Policy rules.  However,  it is possible to make a WebSocket into a cross-origin resource using the Access-control-allow-origin HTTP header, which commonly known as CORS. If for some reason CORS was being used to create a cross-origin WebSocket,  then it is possible that this WebSocket could be hijacked by an untrusted domain.

Additionally,  a WebSocket is like any other API in that it exposes application logic to attackers.  Make sure you address common web application vulnerabilities like the ones found on the OWASP Top 10. Of particular concern is Insecure Direct Object Reference, Injection Attacks, and Broken Authentication and Session Management.