Exploiting shellshock On doing some digging on the shell shock vulnerability, I found that being able to run the exploit via a remote location depends on whether the attacker actually knows the exact cgi script which uses bash as an interpreter on the vulnerable system. Am I right in this understanding and does this actually limit the scope of this vulnerability?
Also, does the attacker have to enumerate pages on the vulnerable system to get at a vulnerable cgi script eventually or is there other known methods?

the exact cgi script which uses bash as an interpreter

"Using bash as an interpreter" not a precondition for the exploitation of the family of bash vulnerabilities called "shellshock" (the many distinct parsing vulnerabilities based on an environment variable with any name beginning with exactly the bytes () {).

All you need to exploit one of "shellshock" vuln is to run the bash program with one user-controlled value of an environment variable; a shell script with bash as a shell interpreter (#!/bin/bash or #!/bin/sh where /bin/sh is a link to bash) is one obvious way to run bash, but many others exist when /bin/sh is bash: many function calls which run an external program take a string command (not a path and an array of arguments); notably system and popen (unlike the exec* family of functions). These functions taking a string use the default shell (/bin/sh) to parse the command string, so the use of these functions makes the program vulnerable to bash vulnerabilities, unless the environment has been cleaned up from any user input.

So any C program using these functions is potentially vulnerable. And programs written in other programming languages with similar functions.

This is a lot more programs than just /bin/bash scripts.

Of course, a C program can exec an executable file that happens to be a shell script with a /bin/bash interpreter, too.

  exact cgi script which uses bash

Please note that a "cgi script" can actually be any program with the CGI interface; it does not need to be a "script" as in shell script. Often, CGI "scripts" are written in compiled languages, like C.

  Also, does the attacker have to enumerate pages on the vulnerable
  system

Many CGI scripts are in well known, fixed, locations, on most installations.


If encrypted data in a database are accessed by application, does that mean that the application has the decryption key? I'm using an application linked to a database which holds confidential data (numbers). According to the developer, this data is encrypted. However, i can easily generate a report that will show the numbers in clear text. How can the application access and get this data if they're encrypted? And if the data is accessed by the application, what's the benefits of the encryption in the first place? The attack can be initiated starting from the web app in that case which will overcome the encryption ...

This is a precaution against (certain forms of) SQL injection or anyone who can access the database otherwise (internal breach on your database server). The application will do something like this:

Fetch information from DB ==> use decrypt function on information ==> present to the user

Whereas when using SQL injection, you will directly use queries injected to extract the data. However because you cannot call the decrypt function (because that's part of the application's code) used by the application you can only get encrypted data.

This might not be true for all situations where you can use SQL injection. If a function is vulnerable for SQL injection where there is code which loops through an array of results and decrypts that information and you are able to modify the results which are gathered by the function (by for instance injection a   1=1 statement). You will get those results returned to you, decrypted.

Note that database encryption is just a part of security measures to harden data-driven applications. You can also have a look at this paper by RSA.


Keyloggers and Performance Benchmarks I don't know very much about keyloggers; but I thought I'd be able to detect the presence of one by writing a program to simulate keystrokes (in Windows) and recording the throughput, then repeating the test with an active keylogger.

The idea being that a keylogger would also have to listen to the keystroke messages and perform some action; and that I'd be able to detect a decrease in performance.  Thus far, my approach has failed miserably.

I'm trying this in Windows 7 using WIN32APIs to send messages.  I really thought this would work, even if it's not very practical.  Can anyone with more knowledge/experience flat out tell me if there is an obvious reason why this approach is doomed to fail?  Several of the commercial keyloggers claim to 'not slow down the machine' but I figured it was just marketing.  Yet, I can see no measurable performance difference.

Is it possible to detect keyloggers by monitoring the system for performance loss?

I'm not sure how your keyboard hooking code works in the background, but first up, Mr Chen blogged about the problem of using PostMessage for this type of thing. As he says, if you want to send input that gets stuck into the keyboard queue, use SendInput.
For example, one way to capture keypresses is to use SetWindowsHookEx and write an event handler as part of a DLL loaded in via LoadLibrary. This will then receive all the keyboard input you feed the system, and is one way for example to implement global hotkeys (as in, for the whole system).
The problem with this mechanism is that if the hook takes too long to process that input, Windows boots it out and never passes any more messages to it. Charming. It turns out there's actually a Windows 7 bug where the OS chucks hooks out for no good reason, too.
Anyway, OK, back on to task. It is possible, as one explanation, that your keylogger isn't showing any measurable performance difference because it's not actually installed. This is worth verifying.
Secondly, however you hook, you're going to incur a performance penalty, whatever the marketing speak says. There's extra instructions being executed whichever way you cut it, since if you're using a driver, Windows is clattering through an extra device in the driver stack and if you're using SetWindowsHook, Windows is enumerating and calling an extra hook.
What might be going wrong is the measurement process. This is pretty hard to do, especially when you account for confounding factors like context switches, IO delay etc. Depending on how you attempt to measure input time, you might just be missing the difference.
It gets more technical than that too - for example, rtdsc doesn't work all that well with multi-core systems these days, so if you're using that, it might not work. You need the appropriate API function to get a decent resolution timer.
Another point to note is the presence of a debugger. If you've ever debugged an application under say Visual Studio, you'll be well aware as DLLs load, debugging symbols get loaded too, introducing massive delays. I'm sure you've realised this, but worth repeating.
Here's how I'd approach this:

Write a Windows application. Log WM_KEYPRESS messages - time and keypress.
Have a thread.
Have a button that triggers the thread to begin sending SendInput messages.
Run this process for a while - you need to get enough data to negate any confounding factors.
Stop.
Repeat with keylogger loaded in.

Needless to say, I'd load this on a physical, not virtual machine, with as little running as possible.
Will you see anything? Honestly, I don't know. It looks like some have tried using this and other metrics, but I'm not sufficiently privileged to be allowed to read papers that are the advancement of human knowledge and that my taxes might have contributed to. If you can, do let me know if it's any good!
Added detail a context switch may occur whenever you make an API call, but does not necessarily occur. For example, if you call an IO-related function and the API must block, your process will then be suspended and the scheduling algorithm run to determine if any waiting processes are either starved of time, or have IO messages they need to handle. Depending on this, you, or another process, might well be woken up and run. The process then repeats.
If a switch between processes is merited, this is comparatively expensive (on the minute scale that we'd be measuring here) then the current register state is saved, your process is mapped out and another is mapped in. This is clearly more expensive than jumping back to user land.
Another potential gotcha are interrupts. On Linux (not sure about Windows), interrupts preempt everything when allowed to run, so a call may take more time simply because during that time, the kernel handled more interrupts than the previous time.
Interrupts don't always (in fact, probably shouldn't need) to switch process context, but there may be more or less of them at any given point, depending on what the hardware is doing. More of them means more CPU cycles between call and completion of that call.


How a computer can infect others devices on the same network? As I said in this post, my father is very careless about online security. Besides what I already said on that post, yesterday I saw in his android that the permission to install of third-party apps are enabled, and he confirmed that he disabled this protection to install something that he even remember what is it (I think this was recently, because he did not want to answer anything about the app's nature or when he did this). I have already talk to him about his negligence, but nothing appears to has effect.

I'm worried because my mother accesses her bank account here (in her own PC, not in my father's PC). Some members in this forum recommended to me create a separate network for me and my mother's devices, but I am have difficult to find information about how do this and I don't have knowledge about networks.

I would like to know:

How likely is to a virus (or any malicious program/app) spread through devices on the same network?
What type of malicious application can do that?
It is possible for me to identify if that occurs without doing a long search?

I'm accepting other suggestions about what I can do.

Obs: All devices here are windows or android.

Many different types of malware can spread from device to device on the network. Wannacry was a very famous recent one.

Firewalls that block incoming connections is the most basic protection against this. You should have no reason to accept incoming connections. Make sure your Windows firewalls are set up and that you are running anti-virus programs.

Android phones do not run services that you can connect to, so they do not need firewalls.

From your other post, because your router cannot provide a second network, what you need to do is to get one that does. It's just that simple.


WPA2 ephemeral key derivation I'm trying to learn how ephemeral keys in WPA2 4-way handshake are derived.

Starting from 4 EAPOL packets sniffing, I successfully derived PMK and PTK reading ANonce, SNonce, and knowing ASCII-PSK and the SSID.

From PTK I derived, by splitting it, the KCK (128bit), the KEK (128bit), TK for ENC (128bit) and the TK for MIC (128bit).

I'm stuck in a GTK derivation.

If I understood correctly, the GTK is transmitted encrypted from AP to ST in WPA Key Data field using the chiper suite described in first field of Key Information, in my case "AES Cipher.

In WPA2 AES is used in CTR mode for confidentiality, so i tried to decrypt the Key Data using OpenSSL, using KEK as key and filed Key IV as IV.  I obtain 6c 1b 11 38 1f 8e 01 ee e1 d0 7b [...] from decryption, but reading the IEEE 802.11 I saw that the first Key Data's octect in EAPOL Key Frame is Type and should be0xdd, so decryption fails.

What's wrong?

It seems using key decryption found in OpenSSL isn't really going to do it. If you are using a Linux box that has apt-get you can apt-get install pyrit, which is designed to crack WPA2 using various techniques. Even if it doesn't crack, you will get a better idea how a cracking application like this works simply by typing the command followed by the -h option.


Should I inform the previous email account that it is no longer the main email address of my user? I'm building a website where you can register with an email account.

In your account private section you can find a form where you can change the email address to use when logging in. I wanted this form to send an email to the previous address in the form of "You can no longer use this email address to log in here at blahblah.com, you have to use newaccount@mail.com."

Can I tell to the previous email the new email address, or am I creating a vulnerability?

Not at all. The account and both emails belong to the same person, right? So you are notifying the same user that he changed his email, so you are not publishing anything to a third party.

And just in the case that indeed the email change is being performed a third party that got access to the account in an unauthorized way, you better send that email out noting that they are changing the email account associated with your website, and if that was not by them, to take proper action (usually the user is asked click a link to cancel the email change, or directed to contact a support email address).


Will this router setup add a good layer of security? I'm looking at doing this, where I have 2 routers in the setup to protect a group of networked computers from other computers.

It would look like this:  Internet - Modem - Router A (other computers) - Router B (networked computers)

Will this actually prevent malware from accessing Router B from Router A's computers?  On a side note, should I use different brand routers when making this setup?

Thank you very much.

That's not a very good idea, it's prone to MiTM attack since LAN B is a part of LAN A. Anyone with access to the latter can control what happens between modem and LAN B. The inner firewall won't help much against a dedicated attacker with access to LAN A. If nothing else, he/she could extract sensitive information from computers inside the private network through network communication.

Better option would be to reverse the situation and limit the public LAN group inside the private LAN according to the least privilege principle. Also, you can always monitor the switch where public network (LAN A) connects to (LAN B) and potentially set up some rules against various type of scans.

It needs to be said though that neither options are bulletproof. The safest option here, if you can afford it, is to have two modems connecting to two different ISPs. One for private network and the other for public, totally separated from one another.


Session ID containing username? Is it safe to append the user's username to the session ID? The session ID is 32 bytes long generated using a secure PRNG. I encode it using base64 URL to save it in a HttpOnly cookie. The cookie value would be base64URLEncode(rand32bytes.username).

It's not dangerous in and of itself, but I would still advice against it for two reasons:

It serves no purpose. If you want to make the session ID harder to guess, just add more random data instead.
It might be tempting to use the username from the session ID instead of fetching it from the server side session store or the database. This would be a security vulnerability, since users could impersonate each other just by changing a cookie.


Are CSRF Attacks Really Blind I'm new to CSRF attacks but don't see how they are always blind.

Let's say we are dealing with a site where the asset we need to protect is the HTTP response. Something like one's medical history. According to what I've read one shouldn't need to protect GET requests even though the response to these requests may contain sensitive information.

What prevents an attacker from making a CSRF Ajax request and then sending the response from that request as a POST or GET to another server?

The Same-Origin Policy makes it impossible for JavaScript on A.com to read content from B.com.   However,  Same-Origin Policy does not prevent JavaScript or HTML on A.com from sending an arbitrary request to B.com.  In order to prevent this,  you need a method of CSRF Prevention,  such as a secret token which would not work if the system wasn't blind.

The point of CSRF is that it incurs a useful side-effect,  like changing a user's password or adding an administrative account.  Even if CSRF wasn't blind, (due to some magic,  or perhaps a misconfigured CORS or crossdomain.xml rule-set) it wouldn't matter as the response would probably be discarded,  all that matters is a useful side-effect.

It is very easy to send GET and POST requests cross-domain,  if a GET request incurs a side-effect,  then it is vulnerable to CSRF.  A good example of this is a PHP application that uses $_REQUEST for all inputs.


Malicious script compromising browser extensions In Firefox or Chrome,
is it possible for a web page script  to compromise a user installed extension?
This might involve access to extension private data or obtain the same execution privileges as the compromised extension.

I am not interested in vulnerabilities from the browser side, which might be  occasional and fixed relatively fast, but on the extensions side.
What  measures can be taken by extension developers to reduce the attack vector?

In Firefox or Chrome, is it possible for a web page script to compromise a user installed extension?

Absolutely, extensions are getting their fair share of vulnerabilities. What bugs you need to look out for depends on how the extension interacts with web content. E.g., the LastPass addon for Firefox was shown to be vulnerable multiple times. Due to one of the flaws it was possible for a prepared website to exfiltrate the stored account credentials belonging to different domains by confusing the extension's URL parser.

  What measures can be taken by extension developers to reduce the attack vector?

Just like with regular web applications, you need to validate user input, prevent injections, verify origins, etc. - you can't give a complete list here. Since browser extensions are often implemented using web technologies (JS, HTML, ...), most of the typical web application vulnerabilities apply. Also note that extensions often operate with higher privileges than web scripts which means that an XSS flaw in a Firefox extension can potentially compromise the host.


Remote Worker Sharepoint Access Permissions Here is the problem encountered at my company:

We have set of very disorganized files on a Microsoft Sharepoint server
I have one person going through and reorganizing everything. In terms of permissions, this requires (a) read access and (b) access to move files
I would like to minimize the risk that that person working on this, with those permissions, could download my files locally (and, for example, distribute files to my competitors).

The solutions I see:

Limit permissions on the Sharepoint, but from what I see there isn’t a combination of pre-set permissions that accomplishes what I want.
Have person work in a virtual machine with the following settings: (a) Blocking all internet other than the Sharepoint web-site. (b) Keeping the password saved in the virtual machine instance (rather than giving it to the worker, who could then login from their own computer), (c) One connects to the virtual machine via remote desktop. I understand there is a feature where you can use that to connect the storage of the virtual machine as a networked drive on one’s local machine. This would serve as another workaround.

I’d appreciate if you could look into this and see if you can figure out a way to solve the problem I’ve outlined above, either by fixing the issues with the solutions I’ve suggested below or identifying an alternate workflow.

My general suspicion is that your desires are mutually exclusive.  Effectively, you are trying to give someone access to your data while also not giving them access to your data.

If the data is so sensitive that someone could use this opportunity to steal your data and potentially sink your business, then I think there is really only one option: do it yourself.  Or find someone you really trust.  I mean, here is a basic flaw in your system:

User opens up file marked "TOP SECRET CLASSIFIED DO NOT SHARE" in your virtual machine
User takes a screenshot from their computer
User shares your top secret data

That's just the first thought that I have off the top of my head.  I'm sure that if the person you put in charge of this really wants to steal your stuff, they will find a way.  You can't simultaneously give someone access to your data and not give them access to your data.

Do it yourself.
Find someone you trust.
Have someone local do it and watch them the whole time

I don't really think you have any other options.


What is as CISOs job, exactly? The company I work for (kind of a startup) can't afford a full-time chief information security officer (CISO). So the boss is asking the security aware people in the team to work together to do a CISOs job. And I don't think we will have any budget for that.

The thing is, we all have a security related background, and know some stuff, but don't really know where to start, neither where to go after that.

We do know we should :

Document ourselves for methods and best practices, set goals
Assess the needs of our organisation and the risks
Define a security policy
Apply the security policy
Promote security awareness throughout the company
Control that the policy is being respected
Report directly to CEO (and not, traditionally, to CIO)
Adapt the policy with growth and business: back to point 2.

What we need are the exact steps, contents, things to look for, things we may not think of. Basically a complete guide to do a CISOs job.

We found and read through several resources, often complementary, sometimes contradictory, but never complete. So we don't really know what we are missing. And it seems a lot of work, but we believe that if the knowledge is correctly gathered and the methods defined, we would be able to succeed in doing this, while staying motivated and, above all, doing it right.

It's maybe a lot to ask, but can someone help me with that?

As someone who has overseen a number of shared CISOs and sold organisations on the need for someone in this role, I can tell you that the problem is that each organisation has different needs and different expectations of a CISO. Some expect operational support, some require a dedicated risk expert, some just want a Board-level representative of the security function who acts as a translator.

The core goal for the organisation is to know the risks, manage and monitor the risks, and communicate the risks to the organisations and any stakeholders. The CISO needs to think about the risks that the organisation cannot.

As an addition, the CISO should be able to lead the security function, the risk function, and/or the regulatory function of the business. But the expectations here are up to the organisation.

Deloitte has it's "Four Faces of the CISO" which is a pretty good guide for what a CISO should be.

  CISOs continue to serve the vital functions of managing security
  technologies (technologist) and protecting enterprise assets
  (guardian). At the same time, they are increasingly expected to focus
  more on setting security strategy (strategist) and advising business
  leaders on security’s importance (advisor).

So, there is no set list of "things to do" for a CISO. There is a long list of things that need to be done, but you do not need a CISO to do them. For that, grab a framework (ISO 27001, NIST CSF, Cyber Essentials, etc.) and start the work. Your list in your question is a small set of things to tackle, but a good list.


Will using Tor make any difference if using mobile internet to connect? I am using a spoofed MAC address and Tor services for spoofing my IP address.

Will it make any difference if I am using the phone's internet by tethering?
Will that compromise my anonymity? If so, how could I get around it?

I does not mather how you connect to the internet if you use Tor. The traffic will be encrypted anyway, so whoever controls the network you use - be it your ISP or your cell phone provider - will not be able to read it.

However if you do it by tethering, your cell phone company can see that you are using Tor and could potentially block it (just like your ordinary ISP would if you connected with your ordinary broadband).

Do note that MAC spoofing has nothing to do with this. Your MAC address never leaves your local network so there really is no point in spoofing it to stay anonymous on the internet.

Also, I would not call using Tor a form of IP spoofing.


LUKS HDD Encryption crack I need help.

I actually encrypted two mouths ago my external HDD with LUKS but know i have lost my password. I am so depressed because, all of my life is on this HDD.

Is there any possibility to get back my files: i think i almost know the password.

Please help me.

EDIT: 24.05.15 6:27 pm

Manumit: thank you. But the programm you send me is very expensive

jas- Thank you for your advices  : i'll check the link you sent me and then i'll keep you in touch.
And yes i'll review the backing up subject :)

Actually i tried to start with bruteforce-luks-masrer but i don't get it to install  (on linux).

Well given you once knew the password and assuming it should be a variation of a previously known password use of a password list and a tool such as https://github.com/glv2/bruteforce-luks it should be relatively easy to recover.

On that note, to prevent this scenario I the future you may want to review the process for backing up keys and the metadata used on the disk.


Defending against wifi spoofing Since a few weeks, someone is regularly running a wifi network copying the  SSID and BSSID of my private router, resulting in some anoyance, due to being kicked out of my own network from time to time. This is especially annoying, because for some unknown reasons, my devices won't connect to my wifi for quite some time after changing its SSID. Also connecting to the fake access pints redirects to a website resembling the login page of some Wifi-hot spots, asking me to log in via my password. Altough i certainly won't use my password there, i don't wanna have to tell every guest, not to use the password there.

What are my options? I would prefer not to have to spend too much time or money on that issue, so buying a router able to change it's BSSID is not my prefered option (also i'm not quite sure wheter that would help)

Triangulating the source of the spoof with my smartphone did not work well, due to urban environment.

You don't need much to find his person. Just a cantenna and a rfmon sniffer like kismet or airodump-ng (from aircrack-ng). The signal levels displayed are in increasing negative numbers toward 0, where e.g. -67 is 'in range, and useable', -65 even better, -20 quite close, etc. The radiowaves bounce around, but these numbers cannot lie. Another proximity  indicator is the amount of ESSID broadcasts you pick up. 10 per second is 'nearby'. A cantenna will filter  signals from other directions out. Point it around, up and down. Eventually you will be standing outside the person's door. Screenrecord your entire scan.

Then, audibly call the police. Why audibly? Because you are standing outside of the attackers door, of course. The police are likely to respond, but cannot really do anything. Perhaps the spoofed AP went down after you called, or they knocked. That's because you stress the script kiddie. The police can talk, but not enter a residence. Let them talk to this person, and record it on your phone. It is only a deterrent, but unless you have seriously annoyed the attacker, he will most likely stop. Be painfully polite. The attack itself is trivial to do on Linux, so don't be too alarmed.


What does "probabilistic algorithm with random tape" mean? I am new to the study of cryptography, and when reading papers they often mention that "probabilistic algorithm G with random tape w ...". What does it mean by "random tape w"? I mean why it does is not just refer to probabilistic algorithm G?

When computer science papers speak about tape, it usually concerns some form of Turing machine. A Turing machine is a fictional machine which can read and write binary values from positions on an infinite string of tape.

However, if this is the case the paper would definitely mention this or provide certain properties of the machine.


Error150 (net::ERR_SSL_PINNED_KEY_NOT_IN_CERT_CHAIN): The server's certificate appears to be a forgery Help me guys please i'm having an problem with my google account.
I can't log in it keeps saying :  Error 150 (net::ERR_SSL_PINNED_KEY_NOT_IN_CERT_CHAIN): The server's certificate appears to be a forgery.
How do i fix this please?

A quick search indicates that you might see this if your Chrome version is very old.


How a VPN makes the effect of being physically in that private network? I know the basics of how a vpn works, but what I cannot get it is why if my computer is connected to a company via VPN, why my computer experience like if it was physically there in the company. I know that in reality this is not like that, but I cannot connect all of these pieces together. I would appreciate a well explained answer without copy/paste from other pages, I would really understand it. Thanks you in advance.

It all depends on encapsulation and your point of reference.  Your understanding of a VPN is correct, but you are missing one technical aspect.  Once a VPN tunnel is created, you can send connections through that one and it acts like you're right there.  In most corporate VPN setups, the software used actually creates a virtual network adapter, that the operating system can use to communicate (much like "Ethernet" or "Wireless LAN", but instead would be called "VPN Adapter").  When your OS attempts to communicate over the network, it'll route your traffic through the VPN adapter which, because it's a "tunnel", shoots straight into your company's network and then goes from that point of reference.

The way this all works is through encapsulation.  The layers of protocols for networking allow for encapsulating data at different levels.  Ethernet protocol encapsulates IP, IP encapsulates TCP, TCP encapsulates your VPN data, which in turn encapsulates whatever other data it needs to send.  When a network communication is sent through the VPN virtual adapter, the traffic is the normal Ethernet[IP[TCP[HTTP]]] encapsulation scheme, but then gets additional encapsulation as it is sent over the VPN, resulting in Ethernet[IP[TCP[VPN[Ethernet[IP[TCP[HTTP]]]]]]].


Is it safe to share a LastPass master account? I just found out my company started using LastPass Enterprise for service accounts. (databases and web applications that our whole team needs access to) I immediately switched my team over to it because it seemed safer than the method we were previously using - storing all the passwords in an encrypted file and passing it by encrypted email or share folders. We quickly found out our company has disabled the password sharing feature of LastPass, which I thought was the whole reason to use it. Instead they created a single team account (with associated email address) and told us all the password use for logging into LastPass. OK, I guess that works but it makes me uneasy for some reason - at the very least it feels nonsensical doing this when LastPass can restrict sharing to within an organization or team.

Is our team sharing a single account and master password any less secure than using individual accounts?

Also kind of curious why a company might disable the sharing feature, but perhaps that's something only they can answer.

It is a lot less secure. You have the equivalent of a password-protected file filled with passwords.

Everyone with access to this resource:

has all the passwords contained within it, whether they have a legitimate need or not
can change any stored password maliciously or mistakenly and confuse (delay) all other users

Moreover, when someone on your team leaves, then the master password needs to be changed and all remaining users need to be updated with the new credentials. If a user is skipped or misses the update, they are locked out.

Per-user control solves all these issues. You can:

share the appropriate passwords with the approved people
provide read-only access to passwords
revoke the single user's access to the password repository without affecting the rest of the users


NMap scan from within armitage - missing root privileges I just installed metasploit + armitage on my Ubuntu 16.04 machine. When I start armitage and click "Hosts->Nmap->Quick Scan (OSdetect)" I get the following error:

msf > db_nmap --min-hostgroup 96 -sV -n -T4 -O -F --version-light 192.168.0.0/24
[*] Nmap: 'TCP/IP fingerprinting (for OS scan) requires root privileges.'
[*] Nmap: 'QUITTING!'

I launched armitage with sudo like so sudo -E java -jar armitage.jar (it wont even run otherwise).

What else can I do to give that nmap scan the necessary privileges?

The nmap command is not launched by armitage but by msfrpcd.

So you must make sure that msfrpcd is running with root proviledges.

So what i guess happend for you: you started armitage without root and without msfrpcd running, in this case armitage asks you if it should start msfrpcd. If you clicked "yes" msfrpcd was started without root, if you quit msfrpcd does not quit too but keeps running in the background. Now you restarted armitage with sudo but it connected to the non sudo msfrpcd so nmap still complains about not haveing root.

Easiest way to fix: Quit armitage, quit msfrpcd (e.g. by using htop), start armitage with sudo which will ask you again if it should launch msfrpcd which will now be launched as root.

Alternatively you can launch msfrpcd seperatly with "sudo msfrpcd -U user -P password"

tl;dr not armitage but msfrpcd needs root: quit armitage, kill msfrpcd (e.g. by using htop), restart armitage with sudo which will start msfrpcd as sudo


Benefit of signed SSH user certificates? I've recently read an article about using an SSH CA. While I'm understanding why signed host keys/certificates are useful, I fail to understand what's the benefit of using signed user keys/certificates over just using unsigned user keys.

Can someone elaborate on this?

It's useful so you can grant access to any key signed by that particular CA certificate. For example, you have a server which trusts a CA. You can now allow access to any user by signing their key using the CA without having to add their key to the server itself, which might be impossible (let's say it's an embedded device with read-only storage so any addition to .ssh/authorized_keys will be lost on next reboot).


How secure is the hashing/salting/stretching process as described in this diagram? Question

I was just brainstorming about the hashing, stretching, salting part of the user password in the authentication process and I want it to be as secure as possible (no matter how paranoid that is).

I came up with something that I described in the diagram shown below. I was wondering if this is a good way to go or that is has some disadvantages or potential risks using this process.

Diagram

I think the combination of salting and stretching locally based on a pin-code that is never stored but just known by the user makes it harder to guess the salt and also to reproduce the exact process without the user since the local used salt and amount of stretching will be unknown to the server.

Secondly assuming that the connection is compromised because of an MiTM attack. The process of how the leaked hash of the password is created is still unknown because the salt and iterations (based on the pincode) are unknown. The local process (in the browser) can be reversed engineered obviously but assuming the browser and computer aren't infected, just by intercepting the communication, it's not possible to reproduce it (read: very hard to guess).

Simplified example

- User opens browser and goes to login page
- User types password / pincode / username, nothing gets send yet
- Javascript in browser uses pincode to generate a salt
- Generated salt is used to hash the password locally
- Only username and hashed (+salted+stretched) password is send to server over compromised TLS SSL
- Server rehashes the browser created hash with a server-wide/global salt to +restretch
- Server rehashes previous hash with a user-specific salt so the same salt isn't used for all stored password hashes
- Final hash is used for storage / comparing in authentication process
- User is send to a Two-Factor authentication step

Hashing client side

  Secondly assuming that the connection is compromised because of an MiTM attack. The process of how the leaked hash of the password is created is still unknown because the salt and iterations (based on the pincode) are unknown.

In case of a MitM attack (made possible by say incorrect use of TLS) hashing client side will not help you. The attacker could just modify the JavaScript sent to the client so that it sends the password and PIN in clear text. Short of having the user read and verify the complete JavaScript code at every login there is no way to protect your password if an attacker breakes the TLS.

Using a PIN that is "never stored"

  I think the combination of salting and stretching locally based on a pin-code that is never stored but just known by the user makes it harder to guess the salt and also to reproduce the exact process without the user since the local used salt and amount of stretching will be unknown to the server.

If I understand you correctly, your goal is to make it harder to make an offline brute force attack on the password hashes, by using a salt that is never stored.

Let me recap the main points of your scheme to establish some terminology. We have a hash function: HASH(data, salt, itteration count). The user has secrets P1 (password) and P2 (PIN). P2 is hashed locally with N itterations and using P2 as salt: H1 = HASH(P1, P2, N). H2 is sent to the server, where it hashed again (with a user specific salt and M itterations) : H2 = HASH(H1, salt, M).

So how would an attacker in posession of H2 brute force this? She would just use a normal dictionary attack, looping through possible combinations of P1 and P2. First she would recreate the process on the client to get H1 and then she would recreate the process on the server to get H2, and compare it with the actual value to see if she picket the right secrets.

This would take N + M itterations per attempt, and she would have to make X ^ (LENGTH(P1) + LENGTH(P2)) (where X is the size of the alphabet) attempts to try all possible secrets.

Now compare this to a scheme where there would just be one password with the combined length of P1 and P2, that is only hashed on the server with N + M itterations. Would your scheme be any better than this? No, it would be exactly the same. That would also take N + M itterations per attempt, and X ^ (LENGTH(P1) + LENGTH(P2)) attempts in total.

Long story short, your scheme is no better than just using a longer password. The only difference is that you have split the password in two parts, complicated things a bit, and done some hashing on the client.

Or in more general terms: You can not increase security by doing something with the password client side. If you do F(P) and send that instead of P, the attacker will also do F(P) when she brute force and you have gained nothing.

Some thoughts about rolling your own

You are rolling your own here - that is, you are coming up with your own solution to a problem where an established best practice already exists. This has been discussed here many times before:

Is my developer's home-brew password security right or wrong, and why?
Is This Password Scheme Secure anti pattern/canonical question?

Rolling your own system when there are established solutiongs seldom leads anywhere. You add more complexity, but you seldom add any security. If you are lucky, at least you don't make things worse. But if you are unlucky, there is no limit to the problems you can cause for yourself.

In your case, I don't think you did any fatal mistakes leading to obvious vulnerabilities. But who knows? Not me, not you. And when you implement this complex system, there are so many more places where you can make a tiny mistake and ruin it.

That said, speculating about alternative solutions can be a very useful learning experience and help us understand existing practices and concepts better. So there is nothing wrong in proposing and discussing different systems, as long as you don't roll them out into production.


Response HTTP 500 And SQL Injection I have question about 500 HTTP ERROR.
In my website for example:

Response HTTP 200

www.example.com/test.php?id=19

And when I add a semicolon (;) to the number I get an error:

Response HTTP 500

www.example.com/test.php?id=19;

Does that have any relation to an SQL injection?

It might - it is promising.  A well designed app would either silently remove the ; or would return a proper "bad input" error message.  That it blew up (500) is a good sign.

It doesn't necessarily mean that is vulnerable, however - they could be returning 500s in case of bad input, for instance.  But it certainly suggests you may want to try some more.  Try putting an '19 or sleep(2) = 1' (no quotes) - if it takes 2 seconds longer to respond, you are in like Flynn.

NOTE : this should be on either a site you have been asked to test, one you control or a demo site designed for cracking.  Doing this on some else's site could result in charges.


SSL certificate for testing I am building a node / express app, and for testing https routes, I would like to include a dummy ssl private key and certificate in the repository. This is so that the other developer, who is mainly working on styling and markup, can run the app on his own machine without having to create and configure a key and cert himself.

When the server is configured for development, it would use the dummy certificate, and when it is configured for production, it would use environment variables to find the client's certificate.

Is there anything wrong with this idea from a security point of view?

There is no theoretical problem with using test certificates for tests, as long as you apply some proper external protection (e.g. the tests use a test server which is not accessible, firewall-wise, from the outside). Experience shows, however, that test features tend to leak to production. If a developer must remember that he should switch certificate configurations when going to production, then chances are that, at some point, he will forget, and a test certificate with a not-really-private key will be deployed in production.

Hence, it would be best if you include some sort of failsafe. For instance, in its initialization code, the App could test whether the certificate to use is the dummy or not, and if this is the dummy, change a visible feature of the app (e.g. put a red border around the screen, or something like that).


Single token in cookie for e-commerce site to store all data related to user in DB, is it secure? I am building an e-commerce website using PHP, mysql, javascript.

My idea is to save one token, say a 50 character guid, to a single cookie, and use this to identify the user for each request.

I would then save other items such as cart_id, order_id, customer_id, logged_in (bool) and expires_at in a sessions table of the database.

I would probably then refresh the token upon each corresponding request and renew it's expiry time.

I'd like to know if this would be considered a secure way of maintaining a session, and if it's generally a good idea.

Also, anything else I can do to make a logged in session more secure would be a bonus. Thanks.

Edit:

This is the function I'm using to generate my guid:

<?php
function guid($length) {
    $bytes = ceil($length/2);
    $guid = bin2hex(openssl_random_pseudo_bytes($bytes));
    return $guid;
}

I'm calling it as follows:

<?php
$token = guid(50);

Do not use a GUID as a session identifier, GUIDs may be cryptographically secure, but they are not always. Since you're using PHP you should use PHP's default session cookie implementation since it uses a CSPRNG (as of 7.1, for older versions see here).

Session hijacking can be avoided by:

Using a CSPRNG to avoid predictable session identifiers
Set the Secure flag on the cookie to avoid sending it over an unencrypted connection
Set the HttpOnly flag on the cookie to prevent javascript from reading it

Recent versions of PHP do #1 for you, and session_set_cookie_params allows you to do #2 and #3.

Related: Are GUIDs safe for one-time tokens?


Whatsapp encryption: are the public keys requested from the server every new message or only at session setup? I was reading trough Whatsapp white paper (and all related questions here) and couldn´f find an answer to this question: are the public keys for the recipient requested by the sender from Whatsapp servers every new message or only at session setup?

I´m asking this to know if Whatsapp, compelled by a government order, can, in theory, create a 'fake' public key for the recipient, which in reality belongs to whatsapp itself, and in turn gain access to the communication between parties. I understand that this possibility exists because the keys are requested from whatsapp servers, but are they requested at every new message (thus making it able to be intercepted at any time if the public keys are swapped) or only at the first communication between parties?

Also, I understood that they use'forward secrecy', which means at every new message a new key-pair is generated, is that correct?

The public key is requested from the sender when you are initiating the session.

You can also verify your keys to see if you are a victim of a MitM attack. All information regarding that can be find in the whitepaper.

The coming quote is an answer to your question about forward secrecy.

Clients exchange messages that are protected with a Message Key using AES256 in CBC mode for encryption and HMAC-SHA256 for authentication.

Forward secrecy is a property of secure communication protocols in which compromise of long-term keys does not compromise past session keys. A implemenation of that property is that whatsapp is doing for achieve this property.


Is there a way to fool google with wrong location information Google maps tracks our mobile location accurately using multiple ways: gps, cellular network, nearby wifi networks etc. It knows the hotels, banks and other places I have been to. Recently, when I uploaded a photo of a cafeteria, it thanked me and showed up all the places I have been to in the past. It is really a sort of breach of privacy. I want to fool google maps into thinking that I am at a different place.  Is there a way I can "mislead" google maps into using wrong location information?

Note: some answers suggested way to remain anonymous. My concern is not about staying anonymous. I literally want to mislead google maps.

Your question could be split into several parts; if you use Google through a browser, and that browser is not controlled by Google (say for instance, you're using a private window in Firefox on a laptop), then a VPN should protect you; google will only have access to the information Firefox provides it.

If you're using an Android phone though, and are logged in with your google account, then obviously Google has access both directly to your phone, and whatever info your browser is providing google.

So what then if you use a secure browser to access the Google web page form an Android phone? Depending on what you need, a VPN might keep you safe enough here: Google may be able to see your physical location using GPS, nearby networks, etc, but may yet not be able to connect that info with any action you do in the context of your browser.

In other words, Google may know where you are, but have no idea that it is you who are doing whatever you are doing on www.google.com in your browser.

Based on you question (specifically mentioning GPS, etc), I'm guessing this distinction is not of any great significant to you, but thought it might be worth mentioning anyway.

Beyond that, I can basically see two options:

Use the settings under your Google Account to delete your location data, and choose to trust that Google really will delete your private data here. I would assume there are other settings too, to minimize the amount of data Google gathers about you, but again - it comes down to trusting Google in the end.
Get a different / extra (non-Android) phone, on which you can limit Google`s access to your data.

Neither option is ideal if you're even slightly paranoid, but if you want your phone to be able to connect to a network (cellular or wifi), then I really can't see any other option.


Is it possible to prevent user from dumping hashes? I run a Windows server, is it possible to prevent user from enumerating user password hashes?

Also can someone explain how the hash dumping tools works? As I didn't find it with google

Hash dumping tools exploit access control weaknesses to gain access to the hashes (if you google SAM file you will find out more about it)

So to prevent used accessing it you need to implement access controls. If your users have admin rights they can access anything in the system so you need to ensure they have ordinary user accounts.

You also need to make sure your system is patched up to date, as a vulnerability may allow a tool to run with admin rights or otherwise gain access.


What security features and qualifications should we look for in an online backup provider? What security features and qualifications should we look for in an online backup provider for an Internet-exposed web server storing sensitive data?

In the backups themselves - encryption type, transport method, data center qualifications?
In the client software that runs on our server- What do we look for to determine if the client software will create attack vulnerabilities in the server. I'm specifically thinking about a case where an attacker pretends to be the backup provider's service and "restores" a malicious file onto our system or obtains a copy of something sensitive. What questions should we ask to mitigate this possibility? ie. should the client authenticate the provider's server?
Is it bad practice to use a backup service that can (easily) restore files back to your server? ie. where you can select files on a web based control panel and it restores those files "on demand"?

In our case, it's a production web server that runs an e-commerce site and collects credit card information. We need to 1.) Maintain PCI compliance and 2.) prevent down time and bad publicity.

I'd say that the PCI compliance aspect is going to complicate things more than a little bit and that you should really speak to your QSA about requirements.  Whilst I'm not a QSA it would seem to me that if you backup card data then that backup service would effectively become part of your cardholder data environment.

Apart from that one thing I always look at for online backup facilities is whether your data is encrypted when stored with them.

Unfortunately it's not as simple as it either being encrypted or not, as all providers will say that it is.  some providers use a common key for encryption which means that they can get access to the data without your password, which means that if their security is compromised it could lead to your data being compromised

So one important thing to consider is whether your data is encrypted in such a way that compromise of their systems won't compromise your data.

A service I've used for backups is SpiderOak and their model is to handle encryption client-side so that the encryption key shouldn't be available on their server.  The downside here is that if you forget the password there's no way for them to retrieve the data.

The question about the service being able to restore data to your servers would seem to be a security concern as to achieve that it would seem that the provider would need persistent write access to your server.


Microservice to Microservice Auth We're planning a new architecture which will utlize a backend of many different microservices that will need to talk with each other as well as field requests from systems not part of the service. In the latter part I'm not talking about external customers, I'm just talking about systems inside our network, but that aren't part of this microservice architecture.

What is the best way to handle authentication/authorization for those services talking with each other? I typically see Oauth as the solution for Microservices, but that tends to be when talking about external customers utilizing the service. Does the same go for microservices talking to each other?

OAuth 2 client credentials grant is designed for communications between services. Authentication for client credentials grant typically involves passing a shared secret, instead of a login/password. The shared secret is used to meet the RFC requirement of a "confidential client" for client credentials grant.

If you don't already have an authentication server in mind, I suggest taking a look at Keycloak, at least for a proof of concept - it's an open source offering from RedHat. It utilizes Open ID Connect (OIDC), which is an extension of OAuth 2 (adds an ID layer). Keycloak's server admin documentation on service accounts  for details.


How is github 2FA personal access token more secure than passphrase? I recently enabled 2-factor authentication (2FA) on my github account. Once you enable 2FA, you can no longer connect to the repo using your normal passphrase using command line tools. You have to create a personal access token.

At the endpoint, we use the personal access token (a string) in lieu of a passphrase.

Since a passphrase and a randomized string are arguably the same thing (disregarding entropy), how is one more secure than the other? Why force a personal access token in lieu of a password? What is the security benefit (again, other than entropy)?

The security lies in that you have a unique "access token" per client. So you can revoke and control as you will.
Look at for example, Googles "App Passwords" which are the same thing.

These tokens, of course make the 2FA no longer 2FA, but thats required for software and programs that do not support 2FA at all.

The idea is that if a token becomes compromised, you can revoke & renew that token, without jeopardizing access to your account or throwing out other clients.


Microservices and RBAC using OIDC I am currently working on migrating our users from an internal DB to an OIDC service (considering Cognito/Auth0/etc.), and I am trying to implement RBAC.

Our backend is basically a bunch of microservices, and I am trying to understand how we can manage the ACL of our service without having each service implement its own solution on the one hand, and having a central service that they will all have to call (single point of failure).

What we're imagining the solution to look like, is having a JWT Access Token that is signed and holds all the user permissions as its claims, but it seems like we are missing something since I cannot seem to find an implementation that does it.

I did see that I can add these claims to the ID Token, but as I understand it, the ID token should not be passed as an Acces Token. Am I missing something? how is it usually done in microservices environments?

Edit: Seems like Auth0 supports our use case and Cognito doesn't... That still leaves the question whether it's a good idea to implement it the way we're planning

ID token and Access Token serve two different purposes in OIDC.

ID Token = For ascertaining Identity of the user. Who the user is? What is their email address?
Access Token = For ascertaining if the user is allowed to have access. If the Access Token signature is valid, then allow access. Typically contains the information needed to ascertain access (e.g. some identity info, roles, sometimes permissions, etc.)

For access related claims, you should only add them to the Access Token, unless those are "identity claims (e.g. address)"

As far as a separate authorization service is concerned, I think if your application does not deal with a high number of permissions and roles, then it is OK to simply add them as claims to the Access Token.

If there are very high number of roles and permissions, this will lead to token bloat (as mentioned in David's comment). In this case a separate authorization service makes sense. This authorization service should do the roles to permission mapping and provide an API to evaluate permissions. Keep the roles for the user in the Access Token. When a permission is evaluated, check the access token for the roles and determine the permission validity. Remember to pass around the access token when evaluating a permission. How common is this method? ONAP seems to use a similar approach.


Government Surveillance VPN or TOR As some of you may be aware the UK government has pretty much passed a new surveillance bill. For those that wish to read in more detail can do so here http://www.computerworlduk.com/security/draft-investigatory-powers-bill-what-you-need-know-3629116/

The main aspect of the bill is to require ISPs and mobile network providers to log your browsing history to allow various government departments and the odd private company access to it.

Now I can somewhat understand the need by a country to observe its people with a lot of what we do now carried out online it is one tool in the toolbox to combat serious criminals and terrorists however the Governemnt can get carried away giving its self too much power and the fact that departments that don't really need my history such as Gambling Commission, Food Standards Agency, Competition and Markets Authority and NHS Foundation Trusts will be given access is where I decide enough is enough.

I'm here because I'm considering using either a VPN or joining TOR. But have some questions.

Would both VPNs and the TOR network put a stop to this surveillance?
Which is the better option for every day use (least speed reduction)?
If VPN is the best option what are favourites to use (again, with focus on privacy and speed)?

Thanks

There are realy long and detailed articles out there, which are nice to read if you got time.

This is a short overview:

TOR is "more secure", but VPN is most of the time faster
It is "easier" to track you back when using VPN (depends on the provider)
TOR can only be used for browsing the internet (yes i know, its possible... but we are talking about every day use and not some special builds)

-> I would recommend using VPN primarily. If you have some shady stuff to do, feel free to use TOR. But remember not using both at the same time.


Insecure Deserialization in C# (.NET) - How to identify and test I have been reading up on Insecure Deserialization and how it can affect Java applications.

https://owasp.org/index.php/Top_10-2017_A8-Insecure_Deserialization

If the captured traffic data include the following patterns it may suggest that the data was sent in Java serialization streams:

"AC ED 00 05" in Hex
"rO0" in Base64
Content-type = 'application/x-java-serialized-object'

Burp extension to perform Java Deserialization Attacks:

https://github.com/NetSPI/JavaSerialKiller

https://owasp.org/index.php/Deserialization_of_untrusted_data

https://owasp.org/index.php/Deserialization_Cheat_Sheet#Java

My question is if a similar pattern exists for .NET? Are there any tools to test exploits for this?

The article below mentions a JSON deserialization flaw in Breeze, JSON deserialization flaw in NancyFX and XML deserialization flaw in DotNetNuke,

https://www.bleepingcomputer.com/news/security/severe-deserialization-issues-also-affect-net-not-just-java/

I have been reading about XML External Entity (XXE) injection for System libraries but nothing with deserialization in .NET.

https://owasp.org/index.php/XML_External_Entity_(XXE)_Prevention_Cheat_Sheet#.NET

Insecure deserialization is not a Java specific flaw, all languages are subject to this kind of vulnerability. Please have a look at this 2017 blackhat conference : Friday the 13th: JSON attacks, it focuses on .Net JSON serializers.

You can find a useful tool to test your developments in yoserial.

Regarding XXE, it has nothing to do with serialization, those two vulnerabilities are clearly separated in the latest OWASP's top ten.


Is it possible to guarantee a transaction between two peers against interruption exploits? Let's take an egregious example of this:

Alice and Bob want to clone a Pokemon.

They set up a trade between their console devices. Alice's device sends a copy of the data to Bob's device, then Bob's device sends a copy of theirs to Alice. As each device begins to save the results, Alice shuts off her device preventing the save. Bob does not. Bob now has Alice's Pokemon and Alice still has a copy of it on her device.

Suppose we try to set up a dirty bit before beginning the transfer and revert changes on next power on if the transfer has not completed. That doesn't seem to work either. After both parties complete they send completion acknowledgements to one another, Alice simply has to shut her device off while Bob receives and processes the acknowledgement. Bob gets the clone, Alice's database state reverts to previous.

It just seems to me like it is incredibly difficult to ensure that two equal peers with no mediator can sync up on a single piece of data if both are at risk of communication cutoff strategically employed at the right moment. But is it impossible?

The situation you describe assumes that both Alice and Bob are not in full control of the device and software because otherwise Alice could use a modified software which prevents the deletion of the local Pokemon.
If this assumption is true, i.e. Alice cannot tamper with the device and software, one could do the transfer in multiple steps:

Alice creates a random key and encrypts the Pokemon
Alice sends the encrypted Pokemon to Bob but not yet the key. Alice waits for confirmation that Bob received the encrypted Pokemon.
Alice deletes the local Pokemon.
Alice sends the encryption key to Bob until it gets a confirmation. Bob confirms after successful decryption. Only after the confirmation both destroy the no longer needed key.

If the initial assumption is not correct, i.e. if Alice can actually modify the software which is in control of the exchange, then you need some external service where all parties can verify who owns a specific Pokemon now. While this will not make cheating impossible it can be used to detect if a Pokemon is used by somebody who does not own it.  As indicated in a comment, Bitcoin is one way to run such a service.


How does the Certificate Authority work I'm learning how the Certificate Authority work and have a question.

As my understanding, the Certificate Authority can guarantee that the client get the true public-key:
Saying that I'm a server and you are my client, to ensure that we can communicate securely, we use some asymmetric encryption --- I hold the private-key and I send the public-key to you. Now the problem is that how we can make sure that you get my public-key, instead of someone else's.

In this case, the Certificate Authority can help us: CA encrypts my public-key with its own private-key and send it to you, you use the public-key of CA to decrypt and get my public-key.

If I'm right, my question is:
How can we guarantee that we received the true public-key of CA? In other words, if the thing that I send my public-key to you is not secure, why does the CA sending its public-key to you is secure?

The CA doesn't send any public keys to clients.

The CA signs the server's public key with their private key and then gives that signature to the server. When the client connects to a server, the server then sends both its public key and the signature to the client.

Clients already have the public keys of all CA's they trust. These are called root certificates. Clients use those public keys to verify that the signatures on the public keys of any servers they communicate with are valid.

Now for the problem "how do the public keys of the CA's come to the client"? Some web browsers come with their own set of root certificates, others use the certificate store of the operating system. Most users blindly trust the vendor of their browser / os that the list of CA's they curated is trustworthy. So downloading and updating your web browser or operating system is a critical process for the CA infrastructure. A powerful adversary who can manipulate your internet traffic or controls the fileservers from which you receive your updates could smuggle their own CA root certificate into those installers / updates. But if they are able to slip you a backdoored update, then they can do far worse things.


Is TLS 1.0 more secure than TLS 1.2? I just wanted to confirm, my system admin is telling me that TLS 1.0 is more secure than TLS 1.2 and told me I should stay on TLS 1.0...is this accurate?

He mentioned that TLS 1.2 is more vulnerable and that TLS 1.0 is more secure. And that the Heartbleed bug is most vulnerable from TLS 1.1. and TLS 1.2 and NOT from TLS 1.0.

Thank you!

Your admin got it real wrong (or there was some translation mishap).

TLS 1.1 and 1.2 fix some issues in TLS 1.0 (namely, predictability of IV for CBC encryption of records). It is possible to work around this issue in TLS 1.0, but it depends on how hard the implementations work at it. So, in that sense, TLS 1.1 and 1.2 are more secure than TLS 1.0, since they are easier to implement securely.

The so-called "heartbleed" is not a protocol flaw; it is an implementation bug that is present in some OpenSSL versions (OpenSSL is a widespread implementation of SSL/TLS, but certainly not the only one). When an OpenSSL version has that bug, it has it for all protocol versions, including TLS 1.0. Thus, when heartbleed applies, it equally applies to TLS 1.0, TLS 1.1 and TLS 1.2. When it does not apply, well, it does not apply.

The source of the confusion is that your admin (or his sources) does not appear to understand or conceptualize the difference between protocols and implementations. TLS 1.0 and TLS 1.2 are protocols described in relevant standards (RFC 2246 and RFC 5246, respectively). A protocol says what bytes must be sent when. An implementation is a piece of software that runs the protocol. OpenSSL is an implementation. It so happens that the "heartbleed" bug occurs in the implementation of a relatively new protocol feature (the "heartbeat extension") that very old OpenSSL implementations don't know about. Thus, very old implementations of OpenSSL don't suffer from heartbleed (though they have other serious issues, being very old). The same very old implementations don't know about TLS 1.1 and TLS 1.2 at all. Thus, in the mind of your admin, the two independent facts coalesced into a single (but flawed) mantra, that wrongly says that heartbleed is a security issue of TLS 1.1 and 1.2.


Expiration / enforce change of passphrase for private ssh keys Out of curiosity, and also to check whether this is doable at all:

Is there any way using standard tools to assign an expiry date [only] to the passphrase of an ssh private key, or to enforce the expiry and change of the passphrase without changing the private key itself? (I'm not talking about scripts that check [a,c,m]time of the keypair or something like that ...)

Or is there any standard solution that achieves a similar result, that is enforcing/ensuring regular change of the passphrase for keybased authentication?

Please don't ask WHY I want to do that, but feel free to comment on the added security/inconvenience/insecurity this might provide.

The only thing loosely related seems to be the validity interval that can be specified when creating the keypair via ssh-keygen. Although if I've understood this correctly that would expire the signing certificate which was used to sign the keypair, hence effectively expiring the key itself.

Simple answer, no. SSH keys are simple cryptographic keys, if you want to add a validity period to it, you end up in PKI territory.

There is an answer on the Ubuntu Stack Exchange site, asking how to make SSH keys expire automatically, but this is to do with using the ssh-agent tool.

Alternatively, you can use a third party app installed on your server to automatically expire SSH keys based on custom settings. One nice example of this is the SSHARK tool, which uses custom DNS records to record key validity, and using the command= feature in the authorized_keys file.


Click to play plugins vs. AdBlock? Reading through articles like Faked Flash-based ads... I'm wondering what is a better way to keep yourself safe from malvertising. Many people suggest setting your browser's plugin settings to "Click to Play" (C2P). I've started doing that and it's pretty nice. I also use AdBlock. I'm wondering, does all malvertising only use Flash? Does an adblocker protect you better from malvertising than C2P? I also subscribe to MVPS Hosts file.

Obviously none of these are foolproof. Just wondering what other people think is better C2P or an adblocker. Any enterprise adblockers out there?

While the two can be used to achieve the same objective in some cases(in this case blocking flash ads) it's not intended to that, each one complement other but one can't do everything the other can. I will explain.

"Click to play" helps because: by blocking Java, Flash, SilverLight, Shockwave, Vlc plugin and more you stop a lot of tracking around the web that happens without you to see...you think that all flash that happens on a page are videos or iterative content? No, surprise you the ones that track you are well invisible to your naked eye(you can learn more about this seeing by yourself how much plugins leak data : Here and Here and Here ) also stops things that happens automatically and annoy you like videos, audio and etc and also make pages load faster on slow connections.

Unfortunately on most browsers you can't choose what you want to allow or not, your either allow flash or java for an entire page or you block it, so to see an video you wan't you will have to allow flash on this page, the same flash that plays your video will load the ads and track you if they want but it's better than allow that on every page on internet you visit. You would be surprised about how much sites ask Flash without a visible reason at all.

Adblockers helps because : it blocks the ads that also can track you and are obviously annoying, but ads can show in many ways including flash, java, just images and etc. Some Adblockers can block specific scripts used to delivery ads(not 8 or 80 as "click to play")

Thats why each one complement each other but can't replace other. I personally use Ublock Origin since it's open source work very well and others Adblockers had a few controversy in the past like phoning home and etc...it's available for all major browsers


IPsec using pre-shared keys I am trying to understand why do we really use those pre-shared  keys when creating a IPSec tunnel.

From all the reading that I have done the DH group creates the keys that are used to do the actual data encryption, hope I am correct.
If yes, the pre-shared keys are used only for the authentication?

The role of preshared key (or certificate) is to authenticate the other peer. Even if connection is encrypted, you need to know that the peer you are establishing connection with is the one it should be. Encryption provides confidentiality in the connection and preshared key that only you and the other party knows provides the authentication.


Protecting the Java keystore with a weak password, what's the risk? From my understanding, the Java keystore contains certificate information, but this information is public (i.e. other machine certificates which you want the local machine to trust).

Is there something else besides this that I am missing? What would be the risk in protecting the keystore with a weak password?

Update

I just realized I might have been referring to the truststore in this question. Apparently the keystore also includes private keys. If you can confirm this, then I can easily see what the issue of using a weak password to protect it would be.

If you are talking about the truststore, the risk isn't that someone will see or steal the certs in the truststore. The risk is that someone will add a certificate into the store which you do not want to trust.
The store should be protected first protected by the OS permissions. The password is an additional protection.


Difference between Process and Practice in Information Security I'm learning from the "Information Security" book and already know what the two terms policy and procedure mean.

While these two terms are quite easy to distinguish:

policy is what to do to secure the data and the information system, whereas procedure refers to the steps about how the policy should be enforced.

I came across another two terms: process and practice. There is a book using these 2 terms  and the term policy as the book titled "Information Security". In the sense of English, I suppose these two terms have similar meaning with procedure.

I'm not quite sure what the main difference is between process and practice in an Information Security point of view. In addition, when process and practice are added together, do they have the same meaning as procedure or does this rather depend on the context?

Yes you've already got it. Like you mentioned, process is what "should" be done, and practice is what is actually done (akin to theory vs. practice). Try not to get mixed up in minutia like this, though. There are no hard and fast definitions between the terms, and if anyone is being pedantic, just ask them what they're actually talking about.


CSR questions - Do they matter I have a SSL certificate that is due to expire very soon and I need to generate a CSR in order to get my certificate renewed.

I have the private key pem file on hand and I have set myself up to run the following command.

openssl req -out codesigning.csr -key my-company-apps-Private-Key.pem -new

When I run this command it is asking me for the following...

Country Name:
State Name:
Locality Name:
Organization Name:
Organizational Unit Name:
Common Name:
Email Address
Challenge Password:
Company Name:

The guy who generated the initial CSR has left the company and I havce no idea what he would have put in for these answers on the original CSR.

Do the questions to these answers matter for the CSR?

Is there anyway I can find out this information using the original certificate?

Any other guidance would be welcome.

thanks in advance.

CN and SAN both matter, as there are RFIs that require identifier matching. For example, for TLS RFC 6125. So be deliberate with these. For other fields it matters less, so just copy what you have in your old certificate.

Before you generate CSR, I recommend verifying that you have 2048-bit or better key. You can do this by running:

$ openssl x509 -in public.pem -text -noout | grep "RSA Public Key" RSA

Also, consider including basicConstraints and extendedKeyUsage extensions.


Check router for DNS changer virus I want to verify that router was not affected by DNS changer virus. Router provided by local Internet provider, runs custom firmware with web admin which does not contain DNS settings, no telnet/ssh/upnp. Is it possible to verify that it does not configured to use malicious DNS servers? Is it possible to do that just by performing some analysis with DNS queries from inside local network?

DNSChanger works be forcing you to use a DNS server managed by a malicious party, which thus can reply to your DNS queries with the wrong answers containing IP addresses in the control of the attacker. This way your systems connects to a different (and attacker controlled) system than you've intended and allows the attacker to hijack and man-in-the-middle your traffic.

To find out if your router is infected you thus need to find out what DNS server the router is using and compare it to your expectations. If you don't have access to the routers configuration you can use the help of some external service, which lets you visit a unique domain in control of the service and then shows you from where the DNS query for this domain came. If your router is not infected by DNSChanger then the source of the DNS query should be likely the DNS server of your ISP.

An external site which provides such service is Router Checker  service offered by F-Secure. It shows you from where the DNS request came and if the DNS server in questions looks suspicious.

Note that this shows you the DNS server used by your browser. While this is the the  DNS server provided by your router in most cases it does not need to be. For example your browser might be using DNS over HTTPS and thus is ignoring the setting provided by your router. Or you might have configured your system to use a different DNS server then the one provided by the router. This might have been done by manually, by using some privacy enhancing software or also by malware. In these cases this method will not show you if your router is infected since it does not use the DNS server offered by the router. But it shows you at least if connections done by your browser would have been hijacked, no matter if done by your router or somewhere else.


It is safe to buy a domain if I get this message in Firefox? I want to buy a domain name from a big registar (well known on the internet) but when I go to checkout I see that my link is going from full encrypted  to “Connection Partially Encrypted” and I am asked to enter my credit card information. My question is, is it safe to enter my credit card and pay? If it's not fully encrypted can my data be sniffed?

If it helps, I'm running a Unix-like system, so can't be a keylogger or a hoax or a phishing attack. My hosts file is intact.

"Connection partially encrypted" means that some parts of the page you see came outside of the SSL tunnel; most probably, the main page was served over HTTPS but contains links to inline images with plain HTTP URL. This is not really dangerous per se, but still kind of sloppy. It does not speak well for their ability to manage security issues.

When you write your credit card number in a Web page, the data will be sent to whatever URL was set in the form as "submit action". This can be seen in the page source. On a general basis, if you send some rather sensitive information (your credit card number) to somebody, then you are trusting that person to apply some care in the handling of said information. Since the warning you got demonstrates a low level of competence of the site manager in the matter of security, I would say that giving them your credit card number may not be the best idea ever.


Can older or custom web browsers override the same origin policy? I totally understand the basis of origin policy and the reasoning why all modern browsers have put this policy into place.

My question I guess is, do older browsers support this, and if they don't, could mean that people can create AJAX requests and target these requests to my website using an older browser?

The reason I ask is because I don't want anybody overhauling my website with AJAX requests.

The purpose of the same-origin policy is to protect the user (client) and not you (the server). Thus, it's irrelevant in this case. Attackers can use tools like wget, cURL, and even simply inject custom JavaScript in modern browsers using readily-available tools such as Developer Tools.

Therefore, it doesn't matter if old browsers have certain behaviours or not, an attacker will probably not use a browser at all.

All rate-limiting rules and restrictions must be applied server-side.


How to calculate CVSS of an attack so that it matches those in CVEs? I have drawn an attack graph for a file-sharing application (eg. Dropbox) where a database stores details of virtual machines Eg. memory space left, etc. I've listed some possible attacks:

The attacker can reduce the memory size assigned by some amount (eg. if I'm assigned with 2Gb of memory, the attacker can reduce it to 1Gb by manipulating the database records)
The attacker can reduce the memory size assigned to zero (eg. as in previous case, but there is no memory space left and so I can't upload any files)
The attacker can make repeated attacks and reduce the memory size (eg. as in point 1. where memory size was reduced to 1Gb. The same thing is repeated and memory size is reduced to 0.5Gb)
The attacker can hack a link between the downloader and the file location and get the file

I need to calculate CVSS. How do I match the attacks I've listed to those in CVE?

I would go with the CVSS calculator from the NIST which you can find here http://nvd.nist.gov/cvss.cfm?calculator&adv&version=2

If the vulnerability can be exploited over a non-adjacent network, and the Access Complexity is Low, and the attacker needs to authenticate multiple times you have

AN:N, AC:L, Au:M

No impact on the Confidentiality and Integrity while a complete impact on the availability gives

C:N, I:N, A:C

will give the following scores

Base-Score: 6.1
Base-Impact: 6.9
Exploitability: 6.4

and an overall score of

6.1

makes it a major vulnerability. You can further calculate the Temporal and Environmental scores on the NIST page.


What is the actual drawback of "CheckHostIP no"? What are the actual security implications of setting CheckHostIP no in SSH client configuration?

There are some discussions about this (eg. https://askubuntu.com/a/48339) and recommendations to set it to yes for extra security (eg. https://security.stackexchange.com/a/8479, https://serverfault.com/a/193634), but some people also say it doesn't really matter for security (https://unix.stackexchange.com/a/285551).

What kinds of attacks are possible with CheckHostIP no that are prevented/detected with CheckHostIP yes?

Afterthought: does CheckHostIP no mean that the SSH key of the target host is not checked at all? If so, how do I securely connect to a machine with dynamic IP address?

CheckHostIP no means that ssh does not check the host IP address in the known_hosts file. So only if CheckHostIP is set to no a DNS server can return a different IP address as written in the known_hosts file without a warning of the ssh client.

For example an entry in a (unhashed) known_hosts file could be:

www.example.org,1.2.3.4 ssh-rsa AAAA...njvPw==

If CheckHostIP is set to no a DNS server can return an different IP as 1.2.3.4 as address for www.example.org. But the SSH key is still checked. CheckHostIP no means only to expect that the IP is variable and to let key-checking against the hostname.

Therefore if (1) CheckHostIP is set to no and (2) an attacker can control the DNS and (3) has your private key he can setup a server which will first appear like the original one. That can be bad for confidentiality. Think about a backup server. But already if the preconditions 2+3 are met a attacker is able to compromise your system. With  CheckHostIP no only more further attacks are possible.


Is URL redirection in PHP safe if I use ../../ as a prefix? I am developing a PHP web app and I'm in the process of implementing a redirection functionality.

I know that redirection can be dangerous when it can be set on the client side and I use ../../ as a prefix for redirection.

Is this enough to make sure one can only redirect to internal pages? I tried it with $_POST['redirurl'] containing stuff like http://www.evil.com and ; http://www.evil.com but non worked.

Is this safe?

if(isset($_POST['redirurl'])){
    $redir='Location: ../../'.$_POST['redirurl'];
    header($redir);
}

You should never allow redirection to a relative path that can be manipulated on the client side. As you say, it's dangerous as it potentially allows access to files outside of your webroot. A better approach is to "tag" or name the target pages and redirect to them inside your code.

For example, when a user triggers a form, let it post redirpage with a certain value, like dashboard to redirect a user to a dashboard page. Then in your code, just check for a supported page name:

switch ($_POST['redirpage']) {
    case 'dashboard':
       header('Location: http://www.example.com/dashboard/');
       break;
    case 'account':
       header('Location: http://www.example.com/account/');
       break;
    default:
        // This fallback will be triggered when an "unknown" target page is set
        header('Location: http://www.example.com/');
}

That way, you control what redirects can be done and where they end up.


SQL Injection on MariaDB I am trying to exploit (legally) a MariaDb database with an SQLi vulnerability.

I have identified the vulnerability here...

/?o=1&page=app

The o=* is vulnerable and produces the following error...

DEBUG INFO: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '5' or dest like '1'') LIMIT 10' at line 1

I am using Burp Suite and have landed upon the following syntax which seems to be closer to the mark but is still producing a syntax error.

I think it is closer to the mark because the error is only spitting out the query that I have introduced and not the 'extra' field: '5' or dest like '1'') LIMIT 10'.

I am assuming that is part of the original query as the 1 is included and when I test with other random strings that remains true.

I am after the admin password hash which I know from the page clues is uid 1.

What am I missing with this query?

SELECT Password FROM mysql.user WHERE (uid = '1' or dest like '%') --') LIMIT 10

You are missing a space after your comment marker.

  From a '-- ' to the end of a line. The space after the two dashes is required (as in MySQL).

Comment syntax


I need help finding a list or a reference of DLL's for discovering hijacked programs I am removing malware from my grandpa's Windows computer using the system internals suite. I suspect he has a Trojan which has been making remote connections and downloading a TON of viruses every day.

There are a lot of processes going on and a few of them are pretty suspicious. However, nearly all of them are Windows verified and just barley legitimate enough for me to want to check the Dll's. Unfortunately, I am very new to the malware detection game and I have no idea what each one means or where within Windows it would usually be expected.

EDIT: What I am looking for is a comprehensive (or at least semi comprehensive) guide of system dlls with descriptions of what each one does. I have not found anything on the web thus far, so if anyone has a link to a resource it is much appreciated.

If you are positive the box is infected by malware (but do not necessarily know which one), first thing I would do is image the HDD using a tool like clonezilla. If he has not rebooted since he first observed the malicious behavior, you could also try to take a memory snapshot you could later analyze with volatility.

After that I'd reinstall the machine and do offline analysis of the image at home.


Cryptographic patterns a security risk? I am writing an application that serialises objects and then saves the resultant XML in an encrypted file.

I am using an Initialisation Vector and a Salt both saved in the file for decryption so two files will not be the same even though they may contain the same data.

Is the fact that I will have a recognisable patterns of characters like "<" and "/>" and the header being present within the encrypted output represent a security risk or make it easier to crack the encryption ?

The option I have is to save the values I need to save in a format I understand which will have no patterns other than the data itself but not sure if this is of any benefit.

If recognizable data patterns in the plaintext do somehow weaken your symmetric encryption, then your symmetric encryption is pure junk and should not be used at all. Do not make your data format inconvenient and complex just to cope with the (assumed) shortcomings of the encryption algorithm; instead, use an algorithm which does things properly.

It is difficult to say more about it without a complete and precise description of the algorithm you use. However, in all generality, we may say that if you probably don't know enough to do things properly (or at least to know whether you did things properly). That's not to be depreciative of your abilities: cryptography is a very specialized subject, and it has the unique characteristic of not being testable. Nobody can really know whether what they implemented is secure; they can test that it works but not that it cannot be attacked.

This applies to trained cryptographers as well. In fact, what distinguishes a trained cryptographer from an "ordinary" developer is not that the cryptographer can design and implement a secure protocol by itself; he cannot either. The real difference is that the cryptographer knows that he cannot make something sufficiently secure by himself.

The way out of this problem is to use an established protocol. For instance, if you want to do "symmetric encryption", then take an existing standard which has been investigated and analysed by many people (e.g. OpenPGP). And then, don't even implement it yourself; instead, use an existing library which has also been reviewed, so that most bugs have been extirpated (e.g. GnuPG).


Are there examples of implementing security as a side effect? I have long since felt that one of the best ways to effectively implement new security constructs is to implement it in the background, where it is not the primary feature of some new construct. This idea continues to be the basis of many developments for the AJAr Foundation, but I am trying to explain it now as it applies to my day job in FinTech where developers historically have neglected to code for security while using convenient (but unprotected) constructs in order to finish the work quickly.

For example, I have a new construct called uf_GetUserCustomerData (fake name) which accepts the identity of our intended end-user audience and returns information that only that user should see. It is a DB construct wrapping unprotected constructs such as a View.

I have designed this function with convenient features such as inline decryption of sensitive user data, masking of certain data, and filtered exposure to those unsecured constructs they already know and love. This way, the data is still protected regardless of what happens downstream.

Are there any examples of similar approaches to security? Is there a term for what I'm doing here? And probably most importantly: Am I wrong to think this methodology is good practice?

Unsure where this is really relevant, but what you describe looks like a separation of concern. It is used for example in Java with aspects. The developper code the business rule classes without worrying about the authorizations required to run the methods. Then the authorization rules are implemented in an aspect, basically wrapping the methods.

The well known Spring Security framework makes a heavy use of that pattern.


Is the Litecoin Scrypt hashing technique a threat to hashed passwords? The Bitcoin alternative, Litecoin uses a different algorithm to protect the block chain, namely Scrypt (not Sha256).

Given that GPU accelerators exists, and ASICS are due to be released, does the widespread implementation of the Litecoin network affect the implied security of my hashed password database?

Does the mere existence of consumer grade Scrypt ASICs with the ability to brute force a defined difficulty affect the implied security of hashed passwords?

The mitigation I'm hoping to hear is that the Litecoin protocol (and all clones) use crypto in a different way that makes it infeasible to use in distributed password cracking.

No.

Litecoin uses an algorithm called scrypt which has variables that determine the amount of CPU/RAM required to compute  hash. Litecoin's scrypt parameters are fixed at N = 1024; p = 1; r = 1. (http://cryptocur.com/litecoin/)

Users of Scypt for password hashing purposes should have the parameters set much, much higher which will put password cracking out of range of Scrypt ASICs designed for Litecoin mining. After all, this is the key behind Scrypt's design, having a tunable hashing cost.


Are TLS session keys cached in a browser? For example, when authenticating to a TLS protected service, and then closing the tab, you can sometimes reconnect to the service afterwards without re-authenticating.

In preservation of perfect forward secrecy, the key should be deleted after the session terminates. Does the session only "terminate" when the browser closes, or is there a "Time To Live"-like expiration on session keys not in use?

Are TLS session keys cached in a browser?

Yes, sometimes, but not as you're describing.

The simplest bottom line answer for you is "Yes, sessions are cached until the browser is closed."  That's not absolutely true, or true in all cases, but it's a reasonably secure belief for you to base your actions upon.

  when authenticating to a TLS protected service, and then closing the
  tab, you can sometimes reconnect to the service afterwards without
  re-authenticating.

What you're describing here is that you authenticated to a web application which you browsed to using a TLS connection.  Unless you were prompted to provide a client certificate the first time through, the authentication is not for TLS, it's for the app.

That app is probably using cookies, and those cookies mean that when you go back in another tab, it recognizes you and you don't need to authenticate again.  Depending on the setup, this authenticated state may also persist past a browser close and restart, system sleep, and IP address change!  I've had authenticated web sessions work on either side of a day of air travel.

(Even if you were prompted for a client certificate... browsers will remember your selected certificate and re-present it as necessary until you close the browser.  Closing the tab would not impact that.)

  In preservation of perfect forward secrecy, the key should be deleted
  after the session terminates. Does the session only "terminate" when
  the browser closes, or is there a "Time To Live"-like expiration on
  session keys not in use?

Realistically, the speedup provided by session resumption outweighs the potential negative of re-using keys - keep in mind that most HTTP transactions are astonishingly small, whereas PFS becomes a larger practical concern with protocols like IPSec that will be up for days/weeks/months and swap large chunks of data.

So, in practical terms, browsers will remember recent TLS session IDs and use them to try and shortcut the TLS negotiation process.  Closing a tab will not cause them to be forgotten (although closing the browser probably will).  They are used invisibly; the use of one cuts down on 4-8 packets of back-and-forth when setting up TLS and thus speeds the connection up.

But - again - this has nothing to do with authentication you might see, and takes place quietly, behind the scenes.

The "time-to-live" is determined by both the client (who has to remember the session ID) and the server (who also has to remember the session ID).  There's a good article here which talks about how to tweak the cache for various servers to limit the amount of past sessions that would be compromised if the server is compromised.

And this interesting answer suggests that Chrome and Opera stores session keys infinitely until browser restart (or other limited situations).


Does the device you are logging into count as one of the factors for MFA when you are using device biometrics? Yes it does because

I 'have' the physical device
I 'am' the owner of the fingerprint

But no it doesn't because

1=>2 : If you have my device the fingerprint is now something you can get.

Which makes me unwilling to install banking or payment apps on my phone. I'd want a separate physical dongle. Access to a bank account would justify the cost of forging a fingerprint.

I would say no.

To quote StackOverflow:

  Authentication is the process of ascertaining that somebody really is who he claims to be.

Only by posessing the phone I cannot be sure that you are who you claim to be.


What are advantages of malware evolution research? As the title, There are some research in malware development. But they just give an advantage: "Research in relationship of malware families can be a powerful tool for cyber–defense".

I think this reason is not clear. Does anyone know the clearly advantages?

Researching relationships between malware families is critical because it makes malware identification and clustering easier.

Any single malware sample is rarely totally unique. Just like in non-malicious software development, a new malware sample will typically reuse code and/or techniques from older samples.

Malware researchers can look for these shared elements with signatures. These signatures will cluster (or "group") separate malware samples which have similar characteristics. You could, for example, write signatures to identify samples which contain techniques like DNS Poisoning and Browser Settings Hijacking. You could also write signatures to identify members of a specific malware campaign such as Zeus or Conficker.

Such signatures can (1) be used to protect users, by detecting that a given file contains malware, and (2) be used to track how the malware changes and spreads over time.

This is made possible when researchers understand relationships between malware samples rather than trying to study each sample in isolation.