External password encryption We have passwords to certain external system that we need to use programmatically to login to that system. We have no control over the external system, we can not hash the password and use it like that so we need the plaintext password at some point.
The password is stored currently in an xml file in plaintext. It can not be hardcoded in the program because there are multiple difference instances of that external system with different password and more are added/removed/changed often.
To at least provide some layer of protection we want to (symmetric) encrypt that password and put it in the xml file encrypted like that, and decrypt it in the program when using it (which is still not complete protection, we know that, but it's at least something).
The solution must work without internet at all time, you can't rely on any public/online service.

What would be the best encryption algorithm to do that?
I was going to use AES RFC2898 with keygen nb of iterations 100, keysize 128 and PKCS7 padding. The .NET implementation is at the bottom of this post.
Is this a sufficiently secure choice for the intended use?

The encryption key would be hardcoded in the program which is of course not good, because if they decompile the program they could see the key or they could see it in RAM. However I don't really see an alternative to that: if you want to store that password somewhere else then you want to encrypt that and then we're back to the above. Or am I wrong and is there an alternative?

Considering that the encryption key will be hardcoded should I use a salt with the encryption? Will the salt add any amount of additional security if it's also hardcoded like the encryption key? If not I might as well leave the salt blank?

        string textToEncrypt= "thepasswordtoencryptwillbeputhere";
        int Rfc2898KeygenIterations = 100;
        int AesKeySizeInBits = 128;
        string EncryptionKey = "encryptionkeywillbehardcodedhere";
        byte[] Salt = new byte[16];
        byte[] rawPlaintext = System.Text.Encoding.UTF8.GetBytes(textToEncrypt);
        byte[] cipherText = null;
        using (Aes aes = new AesManaged())
        {
            aes.Padding = PaddingMode.PKCS7;
            aes.KeySize = AesKeySizeInBits;
            int KeyStrengthInBytes = aes.KeySize / 8;
            System.Security.Cryptography.Rfc2898DeriveBytes rfc2898 =
                new System.Security.Cryptography.Rfc2898DeriveBytes(EncryptionKey, Salt, Rfc2898KeygenIterations);
            aes.Key = rfc2898.GetBytes(KeyStrengthInBytes);
            aes.IV = rfc2898.GetBytes(KeyStrengthInBytes);
            using (MemoryStream ms = new MemoryStream())
            {
                using (CryptoStream cs = new CryptoStream(ms, aes.CreateEncryptor(), CryptoStreamMode.Write))
                {
                    cs.Write(rawPlaintext, 0, rawPlaintext.Length);
                }
                cipherText = ms.ToArray();
            }
            Console.WriteLine("Done, encrypted password:");
            string encryptedPassword = Convert.ToBase64String(cipherText);
            // ...
        }

There is very little point in encrypting this password - as you suggest, the encryption algorithm and key and salt will all be available to any attacker in any event. All encrypting will do is slow them down slightly at the expense of complexity and difficulty in rotating the password/key for the external system.

The appropriate mechanisms here are either file system permissions preventing non-authorized people from reading the configuration file (the traditional method) or a key storage mechanism such as a Hardware Storage Module (expensive! possibly overkill), a software equivalent (KeyWhiz, Hashicorp's Vault are examples) or available services (if in AWS, for instance, AWS Key Management System).


Are browsers still vulnerable to Cross-Site Cooking? The latest article that I have been able to find about Cross-Site cooking was stating that it was possible to set cookie on 2 dots top level domain such as .co.uk.

  The mechanism for preventing overly relaxed cookie domain specification seems to be broken in all major browsers.

However this article is dated of 2006. Is this affirmation still true ?

It is believed that browsers can deal with this issue today. However, this is not only the problem of browsers and they are not the general cause of this failure. But to make my answer complete, I would like to direct you to good blog post that is written by Michal Zalewski: http://lcamtuf.blogspot.com/2010/10/http-cookies-or-how-not-to-design.html.


XSS payload without using I am performing testing on a site that takes input from the user and places it between <span> and  </span>. However, < and > from the user are encoded as &lt and &gt. Is there any payload that could possibly execute XSS in the site that doesnot use < and >?

Text entities in HTML can't do anything interesting, and the content between span tags is interpreted as text. To do anything interesting, you'll need to inject a new entity (which is done using < and >), or you'll need your input to be injected into a non-text location (such as the parameters of an entity, or inside a <script> block, or similar). If your input isn't being reflected anywhere else, and < and > are always encoded, then you can't exploit the page via XSS.

However, there might be ways to trick the server into sending un-encoded < and > without it meaning to. One way that I've seen is to send Unicode characters that aren't <> but that the server might map down to those ASCII characters before reflecting them into the output. Consider characters like ˂˃, ‹›, ≤≥, ＜＞, all of which may get mapped to <> by a server and then not get encoded as &lt; &gt;. No guarantees, but it does happen.


How to capture all network using eth0 device I couldn't find an answer yet I hope its not just the way I searched google.
I have a computer connected to a router via Ethernet exit.
my promiscuous mode is on but I don't see other devices connected to my network in PCAPs, I only see my device and broadcast packets.
Also my computer is running Ubuntu 14
I use:

tshark -i eth1 -f "host <some ip>" -w <path> &

to record the network

Thanks

Because that is not how Ethernet works!

Your router's integrated ethernet switch only routes broadcast packets and packets that were meant for your PC's MAC address to you. The others, by design, never reach you.

You'd need to do the packet sniffing on your router, or get a managed switch with a monitoring port; downside of that might be the additional cost of a switch with mirroring port, and the fact that this single mirroring port might limit the bandwidth of your network (which, in a home network sense, wouldn't be an issue, normally).


I'm hacked without telling anyone my ip I have a pc with static IP bought from my ISP and RDP enabled.
I was using this PC for development and didn't tell or use it for any communication purpose so it's not possible that someone knew about it.
But I got hacked with a ransomware and all my files are encrypted.
Fortunately, I have a backup for everything.
But I want to know how the hacker knew that there is a server on that static IP that is not attached to any domain or used by any public products (website, web-service ... etc)

I was using this PC for development and didn't tell or use it for any communication purpose so it's not possible that someone knew about it

The entire Internet is regularly port scanned, both by malware, attackers and researchers such as shodan.io. You can not expect any service accessible to the Internet to be unidentified for more than seconds after connecting it.

If you make anything available, secure it. Keep it patched. Disable unneeded features, and so on. Protocols that have a high impact and poor security record, such as RDP, should probably not be exposed directly, but shielded via for instance a VPN, or a SSH tunnel, so that the service is not externally accessible.

Your question is like asking why anyone broke into your house, when you didn't advertise the address in the newspaper or phone book: someone saw it there, and decided to break in.


SQL injection in limited space This might seem like a noob question. I am currently trying SQL injection on a VM. This is what I am trying

union select group_concat(table_name) from information_schema.tables#

And the injection works. But the page that is returned is an XML file and each tag has a size limitation, so I can see only half of the results.

<title>Bla Forum - Topic:  CHARACTER_SETS,COLLATIONS,COLLATION_CHARACTER_SET_APPLICABILITY,COLUMNS,COLUMN_PRIVILEGES,KEY_COLUMN_USAGE,PROFILING,ROUTINES,SCHEMATA,SCHEMA_PRIVILEGES,STATISTICS,TABLES,TABLE_CONSTRAINTS,TABLE_PRIVILEGES,TRIGGERS,USER_PRIVILEGES,VIEWS,columns_priv,db,func,help_category,help_keyword,help_relation,help_topic,host,proc,procs_priv,tables_pri </title>

Is there a way to print the second half of the results. The table that I need to see contains the word "user". If I'm too ambiguous I want to do something along the lines of:

Arrange the rows of the result and then group_concat it
Slice the result (as in string[10:])
Select all the rows after tables_priv

What I already tried:

union select group_concat(table_name) from information_schema.tables where table_name regexp 'user'#

Nothing is printed out. But this query works when I directly try it in the VM's MySQL (after omitting the 'union' and the '#').

union select group_concat(table_name) from information_schema.tables where table_name like 'user'#

Didn't work on neither the web application nor directly in VM's MySQL.

PS. I know sqlmap will do the job for me, but I want to try things manually.

PPS. I am trying CVE-2011-1047 (topic parameter in feed.php)

There must be string manipulation routines or sth in mysql. Then you simply do a

union select substring(group_concat(table_name),1,10) from information_schema.tables#

or something like that and then you execute the query for each slice...


How Can Cybersquatters Afford the Renewal Fees? Cybersquatters register so many domains and sit on them for so long that the renewal fees alone would bankrupt anyone.

Do they have some kind of special status that lets them pay very low renewal fees? How do they obtain this?

I asked because about a year ago I did a "whois" on an obscure name I was pretty sure no one would have registered and, indeed, no one had registered it. However I didn't really need it and decided not to register it. Then I just did a 'whois' on it again and it turns out a domain squatter grabbed it soon after I did the 'whois' last year. Apparently these guys are getting info from the whois queries and acting on them -- but it seems they'd be put out of business by all the obscure names.

Any technique that enables cybersquatting is a security concern for those wanting to secure domain names.

Well, generally buying bulk domain you get a discounted price and it's only £5-10 per year anyways. So, it's really not that much.

100 domains at £5 per a year is £41.60 a month with a total of £500 per year.

If you manage to a sell a good domain could make you unknown figure depends on how desperate they want that domain.

https://uk.auctions.godaddy.com/?ci=55869

First page on GoDaddy bidding on domains is a classicrockauctions.com at £6,103 which well covers cost of having 100 domains per year but it's all a gamble.


What is the meaning of "Key Deletion" operation? In the context of Key Management and encryption/decryption, what does "Deleting a Key" mean exactly? What are the implications of "Key Deletion", in terms of:

Decryption of the old data (i.e. data encrypted already using this Key)
Re-using the Key by creating it again (either accidentally or on-purpose)
Storage of the Key (should the Key be purged or just simply be marked as "Deleted")?

In other words, assuming there is an encryption application client that uses Keys from a Key Manager, and if there is any data that was encrypted using a Key, what should be done if a user requests to delete a Key? Are there any scenarios possible? Or shouldn't the key be allowed to be deleted at all?

Also, what should be done if a user deletes a Key and then later he wants to create the same Key again? What are the best practices here? Should the user be prevented? Are there any standards?

and, Last but not the least, when a Key Manager deletes a Key, what is normally happens in terms of the actual storage? Should the Key be purged, or should it be retained? Of course, I understand that this is somehow related to the previous questions as if re-creating a deleted Key is not to be allowed, the Key must not be purged. So, my question is, how the things are normally done in a Key Manager? or if there is any standard definition for this management operation?

I hate saying this but, depends on the context.

If you have a lot of documents depending on one key, when a key expire you can do one of the following:

Recypher your documents, so you can truly delete your old key.
Keep old documents cyphered with the old keys, so you just mark your key as deleted and reuse it when you have to obtain those documents.

About "re-creating" the key, it will be very difficult, if not impossible, to regenerate the very same key again if you use standar creation mechanisms, so don't rely on that.

When truly deleting a key, the best practice is purging it (shred it) if you have an old HD, if you have a new HD either you just delete it or on SSD you are screwed or destroy it and buy a new one (you will have to make a decision depending on the system and its security requisites).


How do two Tor relays communicate with one another? Nodes don't know each other's IP address right?

So how do they manage to address one another when it comes to sending data?

They do know eachother's IP address. Tor works so that every relay node knows the previous and the next hop. However they never know the full route.


What steps can I take if I know that someone [Government, Special agents,..etc] is spying on me? If I know someone is trying to spy on me, and they are tracking me both online and in the physical worls, what steps can I take to neutralize the risk? Keep in mind that I'm a normal person with limited resources.
These steps come to mind:

Set up & use a self-hosted VPN service (to prevent ISP as Man-in-The-Middle and prevent DNS Leaks), on a trusted hosting provider.
Encrypt all my emails with PGP keys, and make sure that the usage of PGP keys is the default.
Secure login to all chat apps, with Password/Fingerprint.
Encrypt the full disk of my computer.

In general, I think of:

Securing the communication on the internet (using VPN, fake identity, PGP Keys..etc).
Securing the data on devices by encryption, and add authentication layers.

Is there something more I miss?

How to avoid being spied on? Become someone else.
It always comes down to this solution in the end. The more resourceful and experienced the opponent is, the more you need to put dedication into it. It is easier to do if you are still "flying under the radar" undetected by your opponent.
How to become someone else? That depends who your opponent is. If it's a stalker, you might just need to change social apps accounts (cutting some social links in the process) and move from where you live. If your opponent is a national intelligence agency that is already spying on you... You might have ditch your computers, phone, friends, home, job, etc. and try to live without identification papers (or SSN if you are in the US) and associated services.
If you are tech savy, you can build from scratch one online persona per activity. Each persona should be disconnected from the others. The best is to use one internet connection and computer for each. If that not possible, the next best option is to use a new computer with the Qubes OS distribution (or different Tails configurations), configured with one Tor router per persona. Never set up Tor hidden services, because they are not hidden from intelligence agencies resources. Do not use phones for those personas. Never connect those personas with your physical activities. You would still be spied on personally, but your personas may have a chance to avoid being spied on. However, be warned that Tor is not fully reliable against national intelligence agencies. Be also warned that every connection exiting the Tor network is likely to be heavily spied on by intelligence agencies, so the personas will attract attention on themselves. Distrust VPN services.
If your main identity must be hidden from national intelligence agencies, being tech savvy will not help much. You just have to look at what happened to Snowden or Kim Dotcom, who were tech savvy. The best option is to stay safe, stay legal.
As a side note: Encryption is just a tool. It might prevent intelligence agencies to read the content, depending on how properly it is done, but alone it will not prevent them from knowing who is talking to who, and they might even guess the kind of content of the communications based on the context alone. In your question you focus on protecting your data (stored at home or in transit), but what you really need is to protect your identity ; protecting your data is just one of the steps towards that goal.


How can I convey risks associated with out-of-support software? Where or how can I find a list of only unpatched security exploits for an out-of-support operating system? I want to be sure I can inform server owners of the actual risks of staying on an obsolete OS. I can get a list of all CVEs, but I have been unable to filter for patch status.

CVE Details states there were 414 vulnerabilities reported with 98 patches. Be advised a service pack may have fixed many vulnerabilities so the numbers are not indicative of Windows 2003 still containing 316 vulnerabilities (414-98). This also could never include zero days, nor third party vulnerabilities (e.g., Adobe, JAVA, etc)


Questions about common exploits I'm investigating the state of my MacBook Pro which I know was compromised, and do not know if I removed the exploits completely (and I realize, technically will never know this). I'm trying to hone in on specific exploits, not expecting to prove they don't exist, but in any case I can prove that they do, that can help me decide on various courses of action from basic remediation to replacing the whole system in the most extreme.

Looking for briefest answers, here are some starting questions I have:

What are the common vectors for installing rootkits? (And if I understand correctly, this would include MBR as well as BIOS? So same question for each.)
How common are rootkits that survive OS reinstall (and are these limited to BIOS, or can MBR infections achieve this?)
How common are USB key infections? I know many government agencies have had policies for a few years now of not allowing employees to even use USB keys on their machines, but these are high security settings.
If there's a concern about attacks that are unknown to commercial AV tools, would commercial tools still be useful in detecting a rootkit from a fresh OS install? E.g. detecting unexpected network traffic as it tries to download additional malware?
On a previously compromised machine, is there really any hope of detecting a keylogger? I am suspecting not (unless a very poorly written keylogger, or already known to AV software.)

On all of these, I can post single questions for more detail; I'm just trying to figure out which things to explore first, and which are dead-ends.

What are the common vectors for installing rootkits? (And if I understand correctly, this would include MBR as well as BIOS? So same question for each.)

Mainly by hooking the system calls. I suggest you read a book about this because I cannot cover it all here. I suggest: practical malware analysis and rootkit arsenal

How common are rootkits that survive OS reinstall (and are these limited to BIOS, or can MBR infections achieve this?)

Depends on the rootkit. Read rootkit arsenal for details

How common are USB key infections? I know many government agencies have had policies for a few years now of not allowing employees to even use USB keys on their machines, but these are high security settings.

Not every rootkit is delivered using USB. Some can use your email attachments, 0day vulnerability in your browsers, etc..

If there's a concern about attacks that are unknown to commercial AV tools, would commercial tools still be useful in detecting a rootkit from a fresh OS install? E.g. detecting unexpected network traffic as it tries to download additional malware?

They are called 0days exploits/vulnerabilities. Security engineers are working on detecting those using a technique called behavioral malware analysis. It is a mouse-cat game.

On a previously compromised machine, is there really any hope of detecting a keylogger? I am suspecting not (unless a very poorly written keylogger, or already known to AV software.)

A real hacker (not script kiddies) would make his/her attack persistent. First thing to do is kill any AV.


Spoofing Login with facebook from another app I was looking through the Login with Facebook docs and was wondering what was stopping another app from spoofing my app's login. It seems like if someone reverse engineered my binary and got the appID I was passing to Facebook they could have their app make an identical request to Facebook and Facebook wouldn't be able to differentiate whether it was actually my app trying to sign in or another app.

What defenses does Facebook have against this? Is there something I should add to my app to help prevent against this

I believe you need also the App Secret to successfully issue a request. You should not store both hardcoded in your app. Based on your description it seams your app issues the request directly to fb server, which i think its not recommended instead you should have a server which work as intermediary and stores you app secret and app access token.

for more info checkout this page:
https://developers.facebook.com/docs/facebook-login/security


Looking for SSH key management tricks that apply to a large fleet of machines to reduce the 'trust of first use' attack surface? If you have too many machines and you are nearly always asked about a host key when you connect, it leaves an opening that the first time you connect to a machine it's a security threat, but anytime after that it is not and you need to pay attention if the key isn't the same as it may be a man-in-the-middle attack.

So if you've never connected to these machines before and you have in excess of 1000 machines, the probability is high that it will take a really long time to connect to them all, so how does one ensure that the correct keys are already in place so that the keys which do not match are not ignored?

Note: this question was prompted by my asking this question.

There is no need for tricks, SSH Certificate Authority is designed for exactly this kind of situation.

You install host certificates signed by the Certificate Authority, distribute the Root Certificate to your users, and your users are connecting securely from the first connection.


School performs periodic password audits. Is my password compromised? My university sent me an email informing me that, during a "periodic check", my password was found to be "easily discoverable and at risk of compromise". As I understand it, there shouldn't be a way for them to periodically check my password unless my password was stored in plaintext. My question:

Is my understanding wrong, or has my university been storing my password in plaintext?

UPDATE: The school IT department linked me to a page explaining the various ways they check passwords. Part of the page allowed me to run the tests on my university account and display the password if it was indeed discovered from their tests. The password it displayed was an older (weaker) password of mine that was simply English words separated by spaces, which explains how they were able to find it. Thank you to all who answered.

Your understanding is wrong. If passwords are stored as a strong salted hash, the administrator can’t find good user passwords, but can find ones that are on lists of commonly used passwords by applying the hash and salt to every password on the list and looking for a match. It’s a lot easier if the stored passwords aren’t salted, though, since in that case you only have to run it once and not once per user, so this may indicate that the stored passwords are not salted, which is contrary to best practice.


How can I prevent my WIFI from being hacked? I'm being stalked by a hacker.  I've relocated and am trying to take all possible precautions.  How can I prevent my WIFI from being hacked?  Is there a way to prevent a hacker from finding my WIFI account?  If the hacker finds my WIFI account, can't he just hack into my ISP to get my password?

Please use plain English, I'm not too familiar with computer jargon.

Once your router is connected and you are on the wifi, you can connect to the router via the browser. Your ISP will tell you how. Then you can log in using the provided (by ISP or the router's manufacturer) name & password.

You'll find a settings page. You can change your router's login information there and then just look for the WiFi settings. Choose WPA2 (& if available: WPA2-CCMP) for the best security.


Protecting data on a laptop with linux I'd like to keep some private data (photos, notes, ...) and my browsing data hidden. The rest is not so important. Most of the time I just put the laptop to sleep and don't shut it down often, making disk encyption a lot less usefull. The laptop is typically used at home where it is relatively safe and only sometimes taken into public places, therefore I don't want to bother with auto screen locking all the time.

The laptop could get stolen and my private stuff published. Or my "friends" could have a laugh at my photos when I go away for 5 minutes and forget to lock the screen.

My ideas so far:

encrypting a separate partition or folder with private data that are not accessed very often and don't need to be decrypted on startup. I would always be asked for a password (and again every few minutes).
an applet that would switch between home and outdoor mode. Auto screen locking would be active during outdoor mode. Maybe it could recognize that it isn't at the usual place (connected to a different wifi network than most of the time, not on AC power, and similar).

Are there some other things I should be aware of? Which scenarios are the most probable? How to protect firefox browsing data? How vulnerable is a locked screen? Any tips on how to implement all this?

Those files are not extremely sensitive and the protection should be aimed only at a regular thief or a friend pulling a prank. However, most of my friends are programmers, CS students and sometimes IT security students. With a bad sense of humor.
I'm currently using a fresh install of Fedora 15.

Truecrypt, gpg or pgp would seem to do the job for you.

Encrypted files, folders or separate filesystems - piece of cake. You can configure how long you want them to cache your passphrase before requiring it again.

I would however recommend screen locking every time - it does a lot of good, and in your particular scenario it would definitely help you minimise the threat from your friends.


Is using JWT token for "remember me" less secure than random session token? I am after reading "https://stormpath.com/blog/token-auth-spa" and "https://paragonie.com/blog/2015/04/secure-authentication-php-with-long-term-persistence" (among others :-) ) and thing I would like to avoid is to use blindly every security measure I can think of just to feel more secure. Something like hashing a hash "just in case".

What I have now (the 3rd day of going through MEAN example) -- I have JWT token (id of the user) + expiration date. So the token won't live forever. This token is stored as a cookie in order to get "remember me" feature.

What bugs me here is lack of random data which server adds to the mix, so secure, no secure, but it is very deterministic setup (see the second article I linked).

So I wonder whether the JWT token is less secure than "classic" session token -- I am thinking about such setup:

user logs in, JWT token is created as before, session token is created as well (id + random number), the hash of the random number is stored in DB (expiration date is set of course)
for normal work JWT token is used (it is not used for "remember me")
session token is used for "remember me", it is stored as a cookie

And when user returns, "remember me" kicks in, instead of logging in, cookie with session token is used to authorize user, on success, JWT is created.

So there would be three "layers":

login + password -- infinite usage in time
session token ("remember me") -- long term usage
JWT token -- short term usage, just for current work

My question is -- is my first approach with sole JWT less secure or not? Or in other words -- is adding "session token" as I described above did I make this setup more secure or just make more mess? :-)

JWT, if hashed and encrypted strongly enough, are just as secure as sessions and bring lower overhead. Just make sure to keep it small(although if you're doing anything that requires more than a few KB of storage you're probably doing something wrong...). Follow the best practices for session with JWT and you'll be fine.

If you use a strong enough algorithm and a strong enough key then the user trying to crack it will be WAY out of luck. And if they do crack it then they also have to find a way to steal other people's JWT cookies to get that info(the same type of attack against a session).

If a JWT is less secure than a session, then you've designed it wrong because a JWT is a client sided session. Everything you would store in a session can be stored here. Heck you can even store a session id in it to keep track of larger things in the DB that wouldn't have a place in the JWT.


What are the likely threats to a public-facing DB instance? Quick intro: Small company, VERY limited resources.  I pretty much do everything including take out the trash.

We've been running an instance of MySQL internally for years and it's worked OK, but I think this is largely just good luck.  We have several client computers that are deployed to vendor locations and at times trade shows.  These client machines need access to the database.  Currently we are facilitating the secured access through a VPN to our network.  Our firewall does not have a hole open for MySQL.

The VPN solution is a pain and has it's own security implications.  I'm also increasingly nervous about keeping my own MySQL instance online and available.  I came across Amazon AWS's RDS service and it sounded PERFECT!  However, I ran up against the security group issue right away and realized that I would need to grant full, unlimited access to all IPs due to the fact that I have no control over the IP ranges of the client machines.  Trust me on this one, I have no idea what their IPS will be.

I've read that it is a very bad practice to expose a DB to the public and that when you absolutely must do this it's better to deploy a web services API to the DB.  It would be nice to do this, but there is no way that I have the time (at this time) to write a web services endpoint for all out applications.

So finally.... my question: What are the threats that we would face by exposing our DB instance to all IPs?  We aren't a bank, we aren't a public company - no one even really knows about us so it seems that a targeted attack is unlikely.  However I'm completely ignorant of security threats and "what's out there" - are there threats that scan all IP ranges looking for a server to respond, then when it does they attack "just for fun"?

To be clear, I KNOW this is against best practices and I don't need a lecture, I'm looking for real-world advice on the likeliness of attack - if that's possible to determine.

BTW, I found this question and it is related but not exactly what I need.  I just wanted to include it so that others don't respond by linking to it.
Public Amazon RDS database?

It sounds like you've got a decent grasp on threats, know that what you're doing now is preferable from a security standpoint, and are facing a cost / benefit analysis. With that in mind, here are some alternate thoughts:

Configure MySQL with an SSL frontend. There are some features in MySQL for that, but stunnel may make you less crazy. While client certificates are somewhat ideal, I imagine from your VPN struggles that may not be in the cards.
Run MySQL on your machine and configure it to listen to the world and use the iptables (firewall) capability of the system to deny any connections. Create a very simple web service that upon successful authentication will add the source IP to the list of permitted hosts. Every so often you can clear the iptables statistics and remove hosts that don't generate traffic for a few days. Think of it as port knocking with an audit trail.


Manually Validating Vulnerabilities from a Vulnerability Scan How do you manually validate vulnerabilities from a vulnerability scan or a vulnerability release from a vendor?
Say you received a report with a high vulnerability. The vulnerability scanner used a version check of the header. If there are no public exploits for this vulnerability, how would you check it if you do not have access to the server internally? An example would be CVE-2019-13917, I can't seem to find a public exploit to throw at the server to validate the vulnerability, and my last resource would be to send it to the IT team responsible. Is this the right approach? - if there are no public exploits, the only other way is to create yourself an exploit by reverse-engineering the patch from the vendor...
I have been given a report from Shodan Vulnerability scanner, which seems to do a version check and I need to validate if the vulnerabilities are actually an issue.
I know that version checking is prone to a large amount of false positives, is there any way around this?

Just because a vulnerability scanner identifies that a vulnerability exists in a package or library that you use doesn't mean that it's exploitable in your system. Even if it is exploitable, there may be controls in place that limit who can exploit it that are sufficient to reduce the risk.
Depending on the context, I'd recommend not blindly following the results of a vulnerability scanner. Instead, perform a risk assessment and prioritize deploying patches or fixing code based on the risk of the vulnerability to your code or organization. Taking on different user roles - public actor, end-user, administrator, operations engineer - and attempting to exploit the vulnerability to determine the impact on your system.


How can one find keyloggers in javascript? Assuming no XSS and a client-side only page, how can a keylogger be identified in javascript code?

Should I simply look for the id of the targeted fields and possibly
some sort of DOM traversal to get the value in an obscure way?

Is there anything else?

A quick way I would assess a site would be to run a VM with a network monitor on and monitor what is being sent from the site (and to where). After all, an attacker somehow needs to collect those logged data points.

If nothing shows up, I'd then go into the code itself. I'd use a javascript debugger and see exactly what functions were being fired when I typed something...

It all really depends on how the attacker programmed it...

If you are paranoid (like me;) you could just run NoScript as well.

update

In response to your comments I will elaborate on how to setup a secure environment for malware analysis.

Generally, it is considered good practice to always analyze malware (or suspected malware) inside an isolated environment. The easiest way would be to setup a virtual machine (IE Virtual Box) running a linux distro (I recommend Helix as it has all the forensic tools built in).

Once you have the VM setup (make sure you do not give it network access and basically only configure it to have very limited access to the host machine), you can then perform your analysis.

Now the reasons for performing the examination inside the VM is akin to a biological virologist performing lab work in a secure BSL-3 lab (BSL-4 in cyber security would include air-gap measures and such, but thats a different story).

Of course, if you developed the virus, you would know what it does (presumably) and so could play around wherever.


Trace facebook user ip. Is it even possible? As I know facebook chat is working like user <> server <> user and it's not P2P. I was talking with some guys today and they were pretty sure it's possible to netstat a facebook user IP address. I'm not familiar how FB chat works, but I highly doubt they're using P2P in their chat. So my question is it possible to netstat a facebook IP, or any way to find his IP without sending a link or using any phishing tools?

Most of the articles in the google results, says this is actually possible: here.

Directly, no.

Indirectly, it's possible. One way:

Have a web server, whose access log you control, up and running.
Send your chat partner a unique hyperlink pointing to that web server, have them click the link. For example: http://yourdomain.com/JohnDoe.html (the web page does not have to exist, throwing a 404 is fine).
Check your web server's access log to get the IP address of requests to /JohnDoe.html.
You have your conversation partner's IP address.


What is the entropy of just 1 Diceware passphrase like my passphrase? A 5-word Diceware passphrase gives an entropy of 7776^5 = 3E19 = 19 Bans (or ~64 bits). Apparently monster cracking systems can currently guess passphrases for MD5 at a rate of 180 billion/sec (2E11). See monster system

That system would find my passphrase with an entropy of 19 bans in  at most 3E19/2E11=1.5E8 seconds. Or, since 4 month have 1E7 seconds, it would take on average 0.5(1.5E8/1E7) = 0.8E1=8 of 4 month periods, or about 2.5 years. More precise: 0.5(2.8E19/(1.8E11*3.7E7)=2.4 years.

The term on average outrules, I think, a crack estimate of my single Diceware passphrase. Suppose I know the attacker's crack sequence:111111 11112 etc. Then I can calculate how long cracking my passphrase such as "afire akin been snout tress" would take.

If my math is right, it would take about 10x6667x6667x6667x6667=2.0E16 guesses (suppose afire is word 10in the list) which is much less then 0.5* 3E19 for large sets of passphrases when on average starts working.

Can the "If I know the attacker's crack sequence" perhaps be broken and can "on average" be brought back by first randomly sorting a Diceware word list before throwing the dices?

You're worried that you might by accident take a passphrase that comes early in the list, which would cause your passphrase to be guessed a lot earlier than one might expect on average. Here are two reasons why this worry is baseless.

Your passphrase is (if you're doing things correctly) already randomly generated. This means that there is (e.g.) a 1/100 chance that the first word of the passphrase falls within the first 1% of the list. This is independent from the order of the list, and is independent from the order in which the attacker tries passphrases. Shuffling the list would not change that: the first word of your passphrase would still have a 1/100 chance of being within the first 1% of the shuffled list.

You cannot know the order in which the passphrases will be cracked anyway. Any reasonable passphrase cracker is massively parallel. Furthermore acceleration techniques (such as rainbow tables) lead to making attempts in an order that is pretty much random (on a cognitive sense, if not in a cryptographic sense). You do not know the attacker's crack sequence.


Why guest's connections can pass host's firewall? I've been wondering about this.

Assume a host with a strong firewall setup (for example only allowing port 80). That host has some virtual machines without firewall.

Why the connections made on these virtual machines aren't rejected by the firewall in the host? At the end, the VM it's only a program running in the host like any other program.

If you're running a VM and it isn't filtered by the firewall, then it's probably operating in a bridged mode at L2 below the firewall's view of packets. To diagram:

network card  --|-- firewall ---- applications
                |
               VM

If you're talking about Linux, then a Serverfault question discusses this as well, and there are kernel patches to change this behavior with iptables. There's also ebtables, which is designed specifically for bridged interface filtering.


How difficult it was to crack Navajo's language during WW2? It is well known that during the WW2 America employed native American, namely Navajo people, to "encrypt" their radio communications. I read some time ago (I don't remember where) that their language was super effective and was considered very secure at the time of its deployment. And indeed it was, given that the Japanese never cracked it.

On the other hand I was reading this page on wikipedia that states

  In addition many more Navajo served as code talkers for the military in the Pacific. The code they made, although cryptologically very simple, was never cracked by the Japanese.

Which got me wondering: Is it true that their code was "cryptologically" very simple? And if so, why didn't the Japanese crack it?

I mean I guess that there must be some weakness to this approach to cryptography, otherwise we would just invent a new language (which is fairly easy, albeit a little complex) instead of bothering with RSA, AES and whatnot.

Can you shed some light on this?

Good question.

I'm a Native American, and this is pretty well-known to us. I also have experience with Chinese language and  dialects. I'll explain why I'm mentioning the Chinese part later.

This is a very good example of security through obscurity. It works until it's figured out. However, there are so few Navajo speakers compared to English speakers, that it would've been incredibly difficult to find native speakers to learn from at the time. How would they know it's the Navajo language to begin with? It sounded alien to them.

While the code may have been simple, it's hard to find people to teach you that code. During WW2, Japanese in America were rounded up and placed in internment camps. Anyone caught sympathizing with them may have been likewise punished. The chances of finding a Navajo turncoat were extremely low.

Why is Encryption stronger than Languages and Dialects?

Regarding encryption, other people such as Thomas Pornin can explain this better than me, but I'll try to show you similarities:

Encryption is like a language. It's sort of like a conversion of one word (or character) to another set of highly different characters. With proper encryption, you can't convert A -> Z then Z -> A unless you have the key. With languages, you can compare words with similar meanings in other languages, and translate accordingly. With languages, your key is knowing the languages.

With proper encryption, you cannot do this. You cannot put properly-encrypted text into a decryption routine and get the results back. Not without the key. You need the key to decrypt it. With a hash, you can never get the message back, only verify whether or not it's genuine, but those can be vulnerable to collision attacks.

Here are some examples:

Pretend this is Encryption. The "key" to decrypting the
hidden message is to understand both languages. There is
a second hidden message which requires deeper understanding.

[English]        [Chinese]
Hello       ->   你好
Alpaca      ->   草泥马

In the case of a hash (one-way), it could act like this:

[English]
Bring potter to Naria. The Death Star is ready for our war against the Time Lords.

[bcrypt]
$2a$04$38oxoVSWS9A97nkHYvxyD.FoLh7wxnHFTI2bOvg8XKZ/hA29BPEgS

With a hash, you would have to verify the contents against the message to see if they match. This is not really a method of encryption because you can't return the original message. You may eventually cause collisions as well.

In the case of AES 256 bit (two-way):

[English with key]
Find Potter and bring him to Narnia. The Death Star is ready for our war against the Time Lords.

[AES 256 encryption result]
Uz+07JfiUU8MwjJVCCefLpH8hFlP2mrjMbO4ArP7IbYVbpDFulUNf6GKDYw9fELI0oeni1sdD81E191BownSDPHvAnQ6TJTB63lYEodUj+ZxXVEvSetL+ZwXEgI9zS/R

How are you going to crack these? The same way as languages, actually. The difference is it's much, much harder to crack real encryption. Firstly, mapping a language and creating a translator is much, much easier than mapping an encryption database.

With one-way hashing, you would have to match every single combination of letters for every single encrypted character, to "crack" it, but that isn't going to return the message to you: it's only going to verify that the hash matches the message. With many hashing algorithms, collisions become a problem after a while.
With two-way encryption, you can get the original message back provided you have the key. Kind of like languages. Larger keys will very likely prevent brute force attacks, as with current technology, it would take longer than the estimated life of the universe to crack them. With languages, the "key" is understanding both languages.

This is why the Navajo "code" was cryptographically, "very simple" in comparison. The security through obscurity of the times made it very difficult to crack, but it would be easily very crackable today with current machines.
Having obscure dialects or languages can add an additional layer of "encryption," (note that the quotes indicate it's not really encryption) but, again, this is security through obscurity, and shouldn't be relied on by itself. In the case of encryption, these algorithms have been tested to be secure by well-educated researchers for a long time. Languages on the other hand, are much easier to learn.

Almost any idiot can learn a language. I'm living proof. Well-educated cryptographers and mathematicians can't crack many strong forms of encryption. What hope does the average layperson have?

Language and Dialect Usefulness

Regarding obscure dialects mentioned in #2, you can still see such things today. In fact, this isn't the only example of the Japanese getting owned by security through obscurity.

For example, the Chinese military relies on another layer of "encryption" (mind the quotes) -- which is really just security through obscurity -- with their dialects. During the last war with China, Japan wasn't able to "crack" the Wenzhou dialect because they didn't understand the implementation, and it was used against them.

Side note: considerable effort has been made by organizations such as Phonemica to demask obscure Chinese dialects.

Part of the problem with relying on dialects and languages today is that hacks are everywhere, so chances are high that someone will find your teaching manuals. Computers are at a good point where demasking a language or dialect could be automated in a very short time. On the other hand, real encryption is nigh unbreakable.

Once someone quickly learns your language or dialect, your security through obscurity would disappear very rapidly. This was used for thousands of years, but in modern times, it's not going to be that effective.

Is Security Through Obscurity Completely Invalid?

Despite what I've said, this does add another layer of obfuscation that is technically difficult to break. Even if your encrypted messages are broken, your attacker would still have to spend considerable time mapping it out. While it's child's played compared to proper encryption, security through obscurity does have it's uses, but you shouldn't rely on it entirely anymore.


If site provides MD5 to check file, can't the comparison string also not be modified? I am new to this so please bear with me. I was downloading a VM image and I was told to check the MD5. Naturally, I did but wondered,

  If a hacker would change the file to be downloaded from the site,
  wouldn't the hacker also be able to change the checksum on the site to make the file look genuine?

If this is the case, wouldn't this defeat the purpose or is the checksum not really meant for hackers but only problematic downloads over a network?

Basically yes, you’d need to pass the MD5 checksum out-of-band through some other trusted means of communications, for example that the other party sends it over registered mail or something.

So it’s mostly to check that the file you’re downloading isn’t corrupted, and it does protect against some amateurish attacks, where a script kiddie managed to change the file, but not the site where the download link resides for example.

To truly protect against an attack like this, you’d need to use private/public key pairs, compute the hash and encrypt it with your private key. That would make sure that anybody that has your public key could verify that the hash you’re comparing the file to for integrity is still the hash you published, as it would decrypt using your public key.


How can I detect and reject potentially unsafe pdf uploads We develop a web app that will start accepting pdf uploads, which will be stored and distributed to other users. Pdfs seem  remarkably unsafe still. How can I scan and reject any pdf that does anything beyond representing a printable document? No forms, no javascript, no embedded executables, no shell commands. Are there tools?

Validate it's really a pdf (eg it's not an EXE or JS etc). Do this via multiple methods such as file extension but also using magic text.

Antivirus solutions have command line or codeable scan checkers so AV scan the pdf before deciding to permanently store it on your system.

Train the users opening them on how to spot a phishing pdf and how to avoid clicking on security pop ups such as JavaScript execution or loading external resources.

You can use tools like Didier Stevens ones mentioned above to count number of JavaScript sections and if the pdf has any Javascript reject it on the spot and don't save it.

Do all your validation server side as client side such as JavaScript validation can always be bypassed.

Log everything so you know who uploaded a pdf and who viewed it

Have a process in place to quickly remove a Malicious  process from the system if one is found


Using update with SQLMAP error I am trying to use UPDATE or insert after getting victim database information,  for that I am using command:

sqlmap -u somewebsite.com/id=2  --sql-shell

After  that:

> sql-shell :  UPDATE username FROM ....

and I get an error everytime (also in other websites):

execution of custom SQL queries is only available when stacked queries are supported

And if I type

SELECT username FROM ...

I get correct results.

I've tried to google much about this, but no luck,  if possible give me some advice to update victim's database.  Thanks

Now, this is... ekhm... not the best place to ask SQL syntax questions.

The UPDATE operation does not have a FROM keyword in SQL.  In other words a SELECT operation looks as follows:

SELECT username FROM user_table WHERE user_id = 1;

But the UPDATE operation is:

UPDATE user_table SET username = 'myuser' WHERE user_id = 1;

(which turns to be quite different form your: UPDATE username FROM ...)

So yeah, sqlmap is seeing two queries: an UPDATE (thanks to the UPDATE keyword) and a SELECT (thanks to the FROM keyword).  Most SQL injections do not allow for stacked (multiple) queries.  See this question about the availability of stacked queries in SQL injections.


How many times does a DNS server need to sign? I have a question about DNSSEC and how many times a DNS server must sign or in other words, how many signatures are there in a day. I know that DNSSEC builds on a chain of trust starting at the root level.

Now lets assume that I run a DNS server that covers a zone with 1 million domains and the TTL of each record is 1 hour. Furthermore, the zone changes once a week. How many new signatures are there in one day?

I can think of the two possibilities below:

there are new signatures only when the zone changes, i.e. around 1M / 7 = 143k signatures per day
Every time the TTL expires, the record must be re-signed. This would lead to 1M * 24 = 24M signatures per day

Which one of them is right (if any)? And if none of them, how and way is it?

Thanks a lot!

The DNS server is free to do it as often as it wants/needs: signatures liftetime is a policy issue, covered by a DPS (DNSSEC Policy Statement). You can find examples and good practices, but if a server wants to create signatures even on the fly, it can (see https://doc.powerdns.com/authoritative/dnssec/modes-of-operation.html "In PowerDNS live signing mode, signatures, as served through RRSIG records, are calculated on the fly, and heavily cached." or https://www.cloudflare.com/dns/dnssec/dnssec-complexities-and-considerations/ "Cloudflare’s DNSSEC implementation leverages ECDSA’s efficient signature generation to sign DNSSEC records on-the-fly.")

Signatures in RRSIG records have two dates: a beginning of validity and an end.

This has nothing to do with the TTL value, nor the zone changes (signatures will change even if the zone does not change).

See for example in A Framework for DNSSEC Policies and DNSSEC Practice Statements section 4.6.5. "Signature Lifetime and Re-Signing Frequency" that mandates a good policy document to have:

  This subcomponent describes the life cycle of the Resource Record
     Signature (RRSIG) record.

Now let us look at some published DPS:

.BE

  17.6 Signature Life-time and Resigning Frequency:
  The KSK signatures of the TLD zone DNSKEY RRset will have a validity period of 40 days.
  The ZSK signatures of the TLD zone authoritative data will have a validity period of 10 days

(default TTL: 86400s aka 1 day)

RIPE NCC

  We re-sign our zones daily with a signature lifetime of 30 days.

(default TTL: 3600s aka 1 hour)

.NL

  RR sets are signed with ZSKs with a validity period of fourteen days and are resigned every two days.
  Zone file generation and the signing of new records takes place every hour.

(default TTL: 3600s)

.COM

  The signing practice of the COM Zone is divided into quarterly continuous time cycles of approximately 90 days. Time cycles begin at the following dates each year:
  January 15th
  April 15th
  July 15th
  October 15th

  The time cycle will never be less than 90 days, except in emergency situations (in which a key has been compromised) or if Verisign decides to begin using different key lengths.

(default TTL: 172800s aka 2 days)

etc.

Also, take into account this part from RFC 4035 (section 5.3.3):

If the resolver accepts the RRset as authentic, the validator MUST
   set the TTL of the RRSIG RR and each RR in the authenticated RRset to
   a value no greater than the minimum of:

   o  the RRset's TTL as received in the response;

   o  the RRSIG RR's TTL as received in the response;

   o  the value in the RRSIG RR's Original TTL field; and

   o  the difference of the RRSIG RR's Signature Expiration time and the
      current time.


Is sending passwords through cellphone text messages secure? Both the sender and the receiver deleted the text after it was sent, but is it still possible that it exists somewhere and that someone can get to it?

It is absolutely not secure. Text messages function essentially the same way email does: your client (phone) forwards it to a server, which then looks up a destination which may be on another network (carrier) and then sends it over where it is held in a mailbox until a phone gets it.

Anywhere along the way it can be copied, retained longer than expected, etc. Lawful interception, unlawful interception, cloned phones, Google+ accounts, etc are all ways a message can end up somewhere unexpected and all that assumes you trust the phone and software on it.

Clear text is compromised text. Always.


CodeIgniter CSRF confusion I have been working with CodeIgniter for about 3 weeks and am very well on the way to loving this framework. However I have been looking at the core code of the framework and I was reading over the CSRF protection. I spotted (the lack of) CSRF regeneration. All it does is extends the tokens life. This is making me very nervous. I played around with the expire times and I can not have it expire once a every two minutes. It would make my application unusable as it is mostly based on form submission.

My question is why would some one NOT want to have a token regenerate per request / per form?

Is this a best practice to maintain the same token? I've been reading OWASP and apart from the hidden fields in a form, other solutions are using CAPTCHA but then that would also break my application as the users do not want that. All in all I am just very confused as to why this is so.

Just for a little bit of extra information this is what I am doing to prevent any information leaks:

SSL/TLS (https) through out the entire application
Remove server signatures on headers
set up a 64 Key encryption key for personal information, and the cookies
Xss filter all post get cookie
validate everything
Escape anything that is derived from user inputted data.

and the following are my configurations for CI security :

    $config['cookie_secure']    = TRUE; // Send cookies only over HTTPS
    $config['global_xss_filtering'] = TRUE; // Global xss filter (input only- i escape output when needed)
    $config['sess_encrypt_cookie']  = TRUE; // "encrypts" session with my 64 Character encryption key
    $config['sess_time_to_update']  = 10; // regenerate session id every 10 seconds

Sorry if this post is long and drawn out I just want to make sure that I am taking all the required steps into application security.

Thankyou

Under what conditions should an application regenerate a CSRF synchronization token?

The most important attribute is that this value cannot be guessed by an attacker and therefore unique to a session.  Synchronization Tokens are commonly defeated using XSS.  A good example is the Sammy MySpace XSS worm,  which read the CSRF token using an XHR and filed the request.  So even if the synchronization token was regenerated for every page,  it would still fall to an XSS attack.  (Also Cookie variables are not a vector for XSS because an attacker cannot control these variables in the request.)

An attacker has an advantage that they can make a very large number of requests.  It maybe possible for an attacker to guess the CSRF token used.  Similarly it is also possible for an attacker to potentially guess the session id used.  Both of these attacks have an identical impact,  an attacker is able to perform an action as that user.  There should be some timeout to prevent both of these attacks,  but this value varies on your application.  Is this a bank application dealing with money? Which should expire a session after 20 or so minutes  Or is this just a forum with limited security impact,  in that case maybe 24 hours.


What are the advantages to using a VPN over secured/trusted wifi It's often recommended that you should use a VPN when using unsecured or untrusted networks, such as open public wifi or secured wifi that you don't control. What are the advantages to using a VPN on any network (wifi or wired), even a network you own/control?

If you control the network, there really isn't an advantage (under almost any circumstances). What a VPN does is simulate having a leased line from your computer to the network the VPN server is on. If you are already on that network, there is literally no advantage (unless you enjoy encryption overhead).

There is one main exception: if you control the network, but you cannot fully trust it, and the VPN server is on a separate network you can trust. For instance, if at a school you're worried people might tap into the cables somewhere on campus, but the VPN server and the routers to the Internet are all physically secured, you might not trust the campus network. Likewise, my guess is that ISPs have intranets that are separate from their networks they sell to clients, and that an ISP engineer might VPN from the ISP network even though it's the network they control.

It's important to note that using a VPN just means you're virtually on the network of the VPN server. If it is better to be on its network than the one you are physically on, you should use a VPN (for instance, if there's intranet stuff you need to access). For security purposes, you should use a VPN if and only if you trust the VPN server's network more than your own; it provides absolutely zero security past the VPN server; the only part of your communications that is secure is the path from the local network to the VPN server. If you're using some VPN provider that you trust more than your ISP (not necessarily a good idea, incidentally), then it can give advantages. If you're not worried about someone tapping the local network and you don't trust the VPN provider (and their ISP) more than you trust your network (and your ISP), it's stupid to use a VPN.


Best way to store client side Encryption keys I have different client applications running on different OS (iOS, Android, Windows Desktop, Windows Phone, Mac, Windows Store -All Native Apps-) I have to decrypt (AES-128) some files (thousands of them) on the clients so i need to store Encryption Keys in the client side. Currently i am keeping it as hardcoded string which is bad. So what is the best way to store Encryption keys in the client safe and secure?

For each of the operating systems you've listed, you should leverage the operating system's built-in secure storage for the keys rather than attempt to "roll your own" solution.

In general, it is not seen as a best practice to use your own encryption as you will continue to have to support, and debug your implementation which may have unforseen vulnerabilities.  Instead, it's a best practice to leverage the native tools at your disposal for secure storage.

For iOS, this would be the keychain.  For Android, this is known as the keystore.  For Windows Phone 8.1+, this is known as the "Credential Locker."

These systems generally work by encrypting the private data in a small database on the device, and then restricting access to it to authorized applications only.  This makes it much more difficult to get the private key off of the device without rooting/jailbreaking the device, etc.

You should also be generating unique keys for each device that receives these files.  Having a hardcoded string in the app (rather than in a config file) is dangerous because once that key is compromised, all users are compromised.  Check for correct use of SecureRandom or similar cryptographic libraries to ensure you're generating unique, near-impossible-to-crack keys.


CSRF Testing. Validation Error 422. Locale Required So I'm testing this site for coursework and I think it might be vulnerable CSRF however when I try to make a post request I get a validation error which says "locale" is required despite me specifying it in the request. Here's the form source code.

<html>
<head>
</head>
<body>
    <form action="http://account.testbank.com/api/account/v1/user/email" method="post" enctype='applicatiom/json'>
        <input name='{"email":"testuser@gmail.com" ,"locale": "en"}'>
        <input type="hidden" name="locale" id="locale" value="en-US">
        <script> document.forms[0].submit()</script>
    </form>
</body>
</html>

What am I doing wrong?

I see you want to send a JSON format; a HTML form builds a POST request taking the name and value attributes in the following way:

name1=value1&name2=value2

So, your POST request could look like this:

{"email":"testuser@gmail.com" ,"locale": "en"}=&locale=en-US

As you can see, it's an incorrect JSON format and the application could generate an error. Also, you are using the value applicatiom/json for the attribute enctype to specify the content-type header, but this could encode the body of POST request, something like this:

%7B%22email%22%3A%22testuser%40gmail.com%22%20,%22locale%22%3A%20%22en%22%7D=&locale=en-US

You have another incorrect JSON format.

So, if the application doesn't validate content-type, you could use text/plain instead of applicatiom/json and change your form in the following way:

<input name='{"email":"testuser@gmail.com" ,"locale": "en' value='"}'>

The POST request would be the following:

{"email":"testuser@gmail.com" ,"locale": "en="}

Now, you have a correct JSON format, the unique problem might be the character =.

If the application validates content-type, there is a technique about a Flash script and a HTTP Response 307, I share you a link about this technique.

CSRF Flash 307

I hope this information helps you.

Good luck.


HOTP with as HMAC hashing algoritme a hash from the SHA-2 family I'm looking into using a OTP solution.

HOTP is a OTP solution that is based on a HMAC with as hashing algorithm SHA-1. The standards defines it this way.

But... SHA1 (as we know) has been a weakness.

So, now i'm looking into using a hashing algoritme from the SHA-2 family as the hash for my HOTP solution. any thoughts on this?

Yes, the alternative could be using TOTP, there the RFC tells us that it is ok to use different hashing algoritmes.

Does the way that SHA1 is broken not effect the HMAC? The counter that HOTP uses increments each time. So collisions are not really a big problem.

But some feedback from you people would be very much appreciated!

HMAC/SHA-1 is not broken. SHA-1 has a weakness with regards to collisions (and it is still "theoretical" since producing a collision for SHA-1, though conceptually easier than the generic attack, is still so expensive that nobody has computed one such collision yet). But HMAC resistance does not rely on resistance to collisions.

Indeed, HMAC is proven secure as long as the hash function which it uses is a Merkle-Damgård function which itself relies on an internal "compression function" which behaves like a PRF. This is rather technical. To make a long story short, the known weakness of SHA-1 voids the proof, but nobody knows how to turn that into a weakness on HMAC/SHA-1. Empirically, we have the example of MD4: MD4 is extremely broken with regards to collisions, with a near-zero cost (computing a collision for MD4 takes less time than actually hashing the two colliding messages to verify that it is, indeed, a collision), and HMAC/MD4 is also broken, but with a quite non-trivial cost of 258 plaintext/MAC pairs (and that's a forgery attack, not even a key recovery attack), making it utterly non-applicable in practice. If we have the same kind of ratio for SHA-1, then HMAC/SHA-1 is still very safe.

Nevertheless, HOTP can be used with any hash function but this requires "adaptations". On a general basis, thou shallt not fiddle with cryptographic algorithms. That being said, it is rather obvious (at least for a cryptographer) that replacing SHA-1 with "SHA-256 truncated to 160 bits" in HOTP will yield something which is equally secure (i.e. the detailed security analysis of HOTP fully applies with that alternate hash function). However, changing the hash function means that you can no longer test your implementation with regards to the published test values, and that's a big worry. Implementation bugs are a much more common source of practical vulnerabilities than cryptographic weaknesses.

Therefore, use HOTP with HMAC/SHA-1 and be happy. It is not broken.


Confirmed evidence of cyber-warfare using GPS history data In its recent policy, the US Department of Defense has prohibited the use of GPS-featured devices for its overseas personnel.

They explain it with a theory that commercial devices like smartphones or fitness trackers can store the geo-position (GPS) data along with the device owner's personal information on third-party servers, and this information can leak to the enemies, which, in turn, would “potentially create unintended security consequences and increased risk to the joint force and mission.”

Although it's a nice theory, I'd like to know whether this policy is just a theory or it has been based on some confirmed incidents of such use of cyber-warfare in an ongoing war.
Hence the question: Is there any confirmed evidence of actual use of cyber-warfare exploiting the vulnerable GPS data? If so, what are they?

I have initially asked this question on Politics.SE, but was suggested to ask it here instead.

Confirmed cases? Yes, at least two. One is Strava, and the other is Polar.
When Strava updated its global heat map, it showed some areas in supposed desert areas full of activity. Who would go jogging, at night, on the desert? What about US soldiers?

An interactive map posted on the Internet that shows the whereabouts of people who use fitness devices such as Fitbit also reveals highly sensitive information about the locations and activities of soldiers at U.S. military bases, in what appears to be a major security oversight.
In war zones and deserts in countries such as Iraq and Syria, the heat map becomes almost entirely dark — except for scattered pinpricks of activity. Zooming in on those areas brings into focus the locations and outlines of known U.S. military bases, as well as of other unknown and potentially sensitive sites — presumably because American soldiers and other personnel are using fitness trackers as they move around.

Using fitness trackers will allow the enemy to detect the place, extrapolate the number of soldiers, the patrol patterns and path, and even identify the soldiers. If you can identify someone that lives somewhere in Montana, and suddenly spent 4 months on Pakistan, you can bet he is a soldier. And using the pace and heart rate, you can even say how fit the person is.
The Polar leak was even worse:

With two pairs of coordinates dropped over any sensitive government location or facility, it was possible to find the names of personnel who track their fitness activities dating as far back as 2014.
The reporters identified more than 6,400 users believed to be exercising at sensitive locations, including the NSA, the White House, MI6 in London, and the Guantanamo Bay detention center in Cuba, as well as personnel working on foreign military bases.

The Polar API allowed anyone to query any profile, public or private, without any rate limit. The user ID was pretty easy to predict, and 650k+ user profiles were downloaded, several GB of data. Just ask, and Polar would give all.
The post shows lots of sensitive places (nuclear facilities, military bases, NSA headquarters, Guantanamo Bay facilities, among others) and could identify the users on those places, and even their home addresses, Facebook pages and personal pictures.
You don't need to think too much to realize the damage that can be done with all that information.


auditing mod security rule sets Is there a audit system that can help me try my strings? Such as user agents, post/get data, a simple way to test general sql injections to see how my rule sets hold?

I know with fire fox I can change my user agent but what about trying post and get type attacks?

You should test your code in a real world scenario with a web application scanner like skipfish.    You could also try manually exploiting Damn Vulnerable Web App.

Tamperdata can be used to build and modify requests.  Or just plain old html.


Can I use GitHub and be PCI DSS compliant? Is it possible to use any remote DVCS (GitHub, Bitbucket, etc.) with PCI DSS or should I host Git on my own server?

Note : not a QSA, but I do have some PCI experience.

There is nothing in PCI about storage of source code - there are requirements about change management, which github would help with, but nothing about where source code should be or any requirements to keep source code private (it allows use of open source, after all).  Given a private repo and assuming you do not store authentication information (keys, appids, passwords, api keys, certificates), PCI governed data or PII in GitHub repositories (which you shouldn't be doing anyways), you are probably fine using GitHub.  Talk to your QSA if you want to be sure.


What is the best way to get missing information used for risk analysis The situation is that I am a software developer working for this company since last January and was asked to do information security for my business unit on the side. I don't have a lot of experience with info-Sec (however, I've always had an interest in it and held a security+ cert) and now I have to do a risk analysis based on the analysis of last year (when I didn't work here yet).
The company is quite new to the concept of security, so the previous analysis consists of some threats, frequencies and impacts. What they didn't do last year is naming any controls to mitigate the risks.

I want to determine some controls to add this year, however the more I read/view into the subject matter the more I see I'm missing vital information for doing so.

For example: the course Managing Information Security Threats & Risks (ISO/IEC 27002) mentions the need to know what information there is, who its owners are and what the value of that information is so you can begin estimating the potential loss when a threat occurs. On top of this you need to know what the Exposure Factor is to be able to calculate SLE. Without it I feel that I can't even begin to name controls to apply to threats/risks.

How can someone in my position best get all this information?

You must refere to you immediate manager, and explain him that security is a cost/benefit question. Like in real life: you put a simple lock on your garden shed, a strong door and better knob for hour house and you put you best values in a safe.

You would not use a bank safe to store lawn seeds, but you should not put values in a garden shed. Information security is not different. If you are not sure that doors and windows are all correctly closed you can always start there: identify common and simple security good practices that are not in use in your company and have them applied. But to go further, you must know what is vital for the company and need higher protection.

Real life analogy is often easier to understand for senior managers that are not IT specialists. Do not try to guess yourself, and do not try to steal information form other services, just use the hierarchical path and let the right people take their own responsabilities.


Security measures for a WiFi access point? I am planning to purchase a program that comes with an App that allows you to control the program via phone. The developer told me that the connection will be done via an extra WIFI box connecting to my computer. I plan to give this WIFI's password to friends and family.

Questions:

Does this open my PC to attacks?
My pc connects to the home network via cable. Does opening up a WIFI like this expose my home network to attacks?
Is there a way to stop people from connecting to this WIFI network with devices other than a phone (I am mostly worried about infected laptops)

Mayank's answer had the most important part right: use WPA2 (not WEP and not no-password).  However, I want to add some points.

You should not use a "non-dictionary based word" for your AP "password", but instead use a multi-word passphrase.  Don't reuse this passphrase for anything else (that you want to keep private) as you will be sharing this password (visiting friend needs to connect their laptop) and your devices will be storing this in a recoverable way.  (And some devices will even by default store your wifi passwords in the cloud for you!)  I suggest passphrase as it's easier to tell someone "correct horse battery staple" (all lowercase spaces, between words), than "Capital T, lowercase r, zero, lowercase u-b, number four, lowercase d-o-r, ampersand, number three" and the passphrase has higher entropy  (also see discussion here).  Attacks on observed wifi handshakes can be done offline, so strong passphrases are needed.
MAC address filtering is trivial to bypass and annoying to manage.  MAC addresses are used for layer-2 (link level) addressing; so in wifi that's the radio signal between your router and any listening receiver.  Even when you have an encrypted connection; the data is being encrypted not the layer-2 packet headers.  Hence, if a router is using MAC address filtering, its quite easy to collect one packet sent from the router (to an allowed MAC address) and the attacker can then change their MAC address to clone the observed allowed MAC address.  (Yes, two different computers using the same MAC address at the same time would cause problems, but you can wait until they no longer are using it.)  Furthermore, MAC address filtering is annoying to manage, because you'll have to go into your router settings every time you add a new device to your network and copy the 12 hexademical digit MAC address (and bother with figuring out how to pull up a MAC address on every random wifi device).  People who use MAC address filtering also get suckered into thinking its very secure and then make weak choices for passphrase or think its ok to use WEP or WPS or other vulnerabilities.
Disabling SSID broadcast leads to a loss of features for no concrete gain in security.  Your mobile devices will not be able to automatically connect to the wifi network.  Your cell phone can't switch from 3G/4G radio to faster less-power hungry wifi when you get home, unless you manually press buttons to switch to the unbroadcast network, or if the device is configured to frequently broadcast I'm looking for SSID 'sdfasdfasdf' that which leaves you vulnerable to attackers with rogue access points that will reply that's me.  (Granted with WPA2 they should not be able to complete the 4-way handshake with you; but depending on your device - it may allow a connection to the same SSID that's suddenly not WPA2).  Like MAC addresses, you can eavesdrop the SSID from observing other clients connecting to the non-broadcasting network even if WPA2 is enabled.
Make sure WPS (Wifi Protected Setup) is disabled.  Many routers come with WPS enabled by default, and this allows an attacker to break into your network in under 11000 guesses.  Granted newer routers may have timeouts on consecutive attempts that may make this more difficult; but the standard suggests only a 60s timeout which only delays an attackers attempts to break in by a couple days).

As an aside, for a tad bit of extra security, I'd suggest changing your access point's SSID from the default (e.g., linksys / NETGEAR) to something uncommon.  The access point is used as the salt of the PMK (pairwise master key) in WPA2-PSK before it goes through the HMAC, hence an attacker who has observed a four-way handshake and has attacked a similar network previously can potentially save themselves some time by storing the PMKs from various common passwords with the known salt (granted they'll still have to find the PMK that generates the PTK to match the observed 4-way handshake).

TL;DR - Use WPA2 with a strong passphrase, disable WPS on your router (and change your SSID to not be something super common).  If you want you can use MAC address filtering or disable SSID broadcast, though any patient eavesdropper can easily bypass either protection.


Why is hotmail mail server providing an invalid certificate? It seems that hotmail.com mail server sitting at hotmail-com.olc.protection.outlook.com is using a TLS certificate issued to mail.protection.outlook.com.

Both the mail server hostname and TLS certificate common name belong to the same subdomain: protection.outlook.com

I'm trying to understand what's happening. Am I expected to ignore this kind of name mismatch?

This report seems to point out that there's something wrong:

Edit 2018-08-04

Report link: https://ssl-tools.net/mailservers/hotmail.com

It's currently fixed (2020-01-11), Certificate chain is valid:

  mail.protection.outlook.com 128 days remaining / 2048 bit
   / sha256WithRSAEncryption

  GlobalSign Organization Validation CA - SHA256 - G3 2062 days
  remaining / 2048 bit / sha256WithRSAEncryption

  GlobalSign Root CA (Certificate is self-signed.) 2939 days
  remaining / 2048 bit / sha1WithRSAEncryption

Report:

https://ssl-tools.net/mailservers/hotmail-com.olc.protection.outlook.com


Is there something like a “Windows Sandbox software Wrapper”? I am facing the following problematic: I want people to send me softwares they develop, then I want to share them to other people, in sandboxed mode, that is to say with no need to have a sandbox software...

For example, you have softwares that can manage archives, and you have auto-extracted archives.

I'd like to know if this kind of software exists: you just give it the software you want to wrap, and it gives you a sandboxed type of this soft... Then you can share it to anybody with trust that it won't harm their computer.

Do anyone know about that on the Windows OS?

EDIT: Solution found, but I am still looking for one that would be free.

What about using a virtual Machine (VMWare for example and creating an "Appliance") where you put the software in. This is not meeting "no need to have a sandbox software" however.


Saving connection parameters in an RDP file For connecting to a remote Windows Server 2008 I use a standard Windows 7 RDP remote desktop connection. In an RDP dialog there is an option to save connection parameters to an RDP file to use it later for a quick connection.

Is it safe to save connection parameters (IP address, login, password) in an RDP file? The computer is private, so I mean not the physical security but rather a chance for the parameters to be stolen by a malicious software.

Aside from real people actively using your computer via physical access or remote administration: It is likely that a malicious software, which is able to read the saved password, has sufficient possibilities to read the password from the connection dialog as you type it in.

This approach is likely a bit more work for the author of the malicious software and it won't allow access to old unused RDP connections through.


How secure are the default ASP.NET membership and role providers for Sql Server? I have a very basic idea of how these work.  I've used them many times when I needed a user management system rather then writing my own.  But should I use these for a production system?  Would windows user accounts actually provide more security then these accounts in the database tables, given a small user base with verification of new users before activation?

I do believe that this system of course is more secure than anything I could write, but are there any hardening measures I should be taking or a 3rd party provider that's much better?

How secure they are is dependent entirely on what you are wanting to defend against, and what you are wanting to defend.  Defending against an internal employee who wants to look at their colleague's sales records is different from an external attacker who wants to steal customer information, which is different than defending against a government who wants to steal your proprietary designs.

generally speaking, these providers are not insecure as they follow the basic recommendations like salting passwords, allowing you to change the hash algorithm, etc (including non-crypto stuff as well).  However then you get into the configuration problems like making sure the connection to SQL is secure, the page you POST your credentials to is over SSL, or that the session cookies are protected via SSL, access to the database itself is secure, etc.

Comparatively, Windows Auth has similar problems, and then you get into security boundary issues, as it becomes a pain to use Windows Auth over the internet.

In theory an Active Directory store is probably going to be more secure than an average SQL Server database, but in reality if all you are using it for is user authentication on a public website, its likely VERY insecure because it probably isn't treated as nicely as the corporate AD.  Then again, corporate AD probably isn't treated nicely either (in general, not necessarily in your case).

SQL databases are prone to SQL injection attacks, Active Directory stores are prone to Windows-specific attacks.  SQL databases tend to lead to identity sprawl... multiple user accounts for multiple applications spread across mulitple databases.  Active Directory leads centralized accounts.  Either could be good or bad, it depends on what you are trying to accomplish.

Writing your own providers is usually not recommended as they haven't gone through public scrutiny, whereas the providers built into .NET have.  3rd party providers run into the same basic problem.  How have they been tested?

And then this brings up a question of why are you letting the application handle authentication itself?  Maybe it's better to let someone else do it via Claims Based Authentication.  This pushes the risk onto another system like Google, Facebook, or Windows Live.


Packet Filter with Access Control List Can anyone explain how to read and understand row 1,2 and 3?

My understanding for row 1 is : If any inside packets want to go to outside via any source port to destination port number 80 using HTTP protocol. It is allowed.

Row 2, if any outside packets want to come in via source port number 80 to destination port number bigger than 1023 using Protocol HTTP. It is allowed

For Row 3, no matter, the action is not allowed.

Is my translation correct? Also, is it usual to have action in row 3 in real life?

Also, what is the importance of the ACK bit in the flag field? Is it to make sure the packet sent out or received?

Thirdly, wiki says no state is one of the advantage of Packet Filter. Why is no state being one of the drawbacks of Packet Filter?

You are basically correct.

  Also, is it usual to have action in row 3 in real life?

Yes, if the intent is to only allow packets to your web server, you have to deny everything else.  Many types of ACLs have an "implicit deny," meaning that if the packet doesn't match any ACE, it is denied.

  what is the importance of the ACK bit in the flag field?

The ACK bit is set on established connections.  The reason to filter on it is to prevent incoming TCP connections.  That is, only connections started from the inside are allowed.

  Why is no state being one of the drawbacks of Packet Filter?

Having state information allows you to enforce TCP protocol rules, which better protects your servers.  The disadvantage is when you have multiple paths, you can have asymmetric flows which a stateful device doesn't handle very well.

Perhaps it's just the way your rules were written for this example, but a good practice would be to specify the IP addresess on the inside, instead of a generic range.


Identify an attacker's web vulnerability scanner by IP request rate When conducting a penetration test, I run into difficulties because the defense system can identify an attack due to the high rate of requests, and then block the IP address

Is there a way to avoid this detection?

Configure your vulnerability scanner to wait between requests or ask your customer to whitelist your IP knowing the fact that you have probed that this countermeasure is being effective.


TLS Cipher Suites and PKI I am currently trying to figure out what cryptographic algorithms are applicable when using mutual authentication for TLS with PKI-certificates.

So when I am intitially creating a certificate, I first create a public/private key pair. Afterwards I let some CA sign my public key with some additional information.

So if I want to use that certificate in order to authenticate at the start of a TLS session, do I have to pick an asymmetric signing algorithm to create that initial public/private key pair? An asymmetric encryption algorithm does not work? So for instance I am not allowed to use DLIES or ECIES but have to use something like ECDSA or DSA/DSS?

There's a bunch of questions rolled in there. Untangling:

  Do I have to pick an asymmetric signing algorithm to create that initial public/private key pair?
  An asymmetric encryption algorithm does not work?
  I am not allowed to use DLIES or ECIES but have to use something like ECDSA or DSA/DSS?

For starters, to see what TLS cipher suites exist, I usually go look at what openssl supports: https://www.openssl.org/docs/man1.0.2/apps/ciphers.html

There's way too much in there to reproduce here, but the basic patterns as far as your question goes are:

TLS_RSA_WITH_*
TLS_[EC]DHE_RSA_WITH_*
TLS_[EC]DHE_DSS_WITH_*
TLS_[EC]DHE_ECDSA_WITH_*

So to answer 1 and 2, you don't have to pick a signing algorithm, but currently the only asymmetric encryption algorithm with wide adoption among TLS libraries is RSA.

Similar answer for 3; RSA, DSS, ECDSA are the signing algorithms that are most guaranteed to be widely supported.

You could of course write your own openssl or JSSE crypto module to provide the cipher suite TLS_ECIES_WITH_*, but you'd run into compatibility issues pretty quick if you try to use that to talk to anything other than your own software.


Why is there no adoption of RFC 7616 (HTTP Digest Auth) The successor of RFC 2617 adds support for SHA-256 instead of MD5 and makes the qop field mandatory thus making the whole authentication more secure.

However, no major browser/client (Edge, FF, Chrome, Opera, curl) supports it.

That is a bit strange to me since usually, browser vendors are quite active when it comes to better security standards.

Why is this? Am I missing something here?

Most sites don't use any of the HTTP authentication mechanism, i.e. Basic Authentication or MD5 based Digest Authentication, because these mechanisms are very limited in what they offer. It is not even possible to logout using these authentication mechanisms.

But even the few sites which use HTTP authentication usually prefer basic authentication over HTTPS instead of digest authentication, since the last one requires that the passwords are stored at the server as plain text or equivalent, which of course is bad from a security perspective.

Thus the only advantage digest authentication has against other authentication forms is if is used with unencrypted connections. In all other cases it is worse than the other established ways of authentication. But, any kind of login  over insecure connections is considered bad anyway today. Therefore there is no need to slightly improve an already bad authentication mechanism without addressing the basic problems of it, i.e. the necessary plain text (or plain text equivalent) storage of the password.

Apart from that the weaknesses of MD5 like a bad resistance against collision attacks and pre-image attack don't really affect its use in Digest authentication, i.e. it is still suitable for this use case when used together with a proper random server defined nonce.


How Whatsapp shows link previews despite E2E encryption? Someone sends me a link. Whatsapp shows its preview. How can they do that despite being E2E encrypted?

WhatsApp client makes http request to the site as the sender types in, in order to fetch site meta properties.
<meta property="og:title" content="Information Security Stack Exchange">
<meta property="og:description" content="Q&A by infosec enthusiasts">
<meta property="og:image" content="https://cdn.sstatic.net/Sites/security/Img/logo.svg?v=f9d04c44487b">
<meta property="og:url" content="https://security.stackexchange.com">

Link preview requires sender to be online and the message is yet to be sent. WhatsApp client makes http request for any text that matches with the regular expression of the URL.
Once metadata is retrieved, it is sent as message. The problem with this design is that if there's a query string in a URL, WhatsApp client will not escape it and put it in a GET request as parameter. This leaks the next immediate word in the typed message if you forget to put space between the URL and text while typing the message.


If you connect through a website via a proxy, and the proxy doesn't save information, can you still be linked back? Say I connect to a specific proxy that I know will not keep information/data about who connected to it, and I go to a website and do something deliberately illegal. If the "middle-server" doesn't have any linkbacks or possible ways to determine who connected to it, can law enforcement still find out who did the illegal activity? How so?

It is technically possible in some cases, it depends on what exactly you are doing.

Some packets you send out, and this is more common on some protocols than others, contain identifying information in the packet itself. If you are using HTTPS (as one example) and you don't log in or out or significantly use cookies, it is very unlikely you can be traced. Same goes for all other protocols designed with privacy in mind. However, if you are using, say, an email server (SMTP) over the connection, your email address will be in quite a few packets, and it is very hard to encrypt the actual address and still get the mail to where it is meant to go, for obvious reasons.


Print sensitive info without leaving data on the printer I'm not sure if there is already a question here about this because I can't find anything. But I'm wondering if there are any "safer" ways to print sensitive information without leaving traces on the printer (sensitive data in caches, internal memory, etc.), or at least ways to reduce those traces.
Suppose I need to print some codes, passwords, secret data, or anything sensitive anyway. After you have printed the data, you can put the sheet in a safe place (like a safe), but the printer is going to remain in its usual place where it could be accessed by a malicious actor (I don't think many people lock their printers in a safe).
This might be equivalent to asking how to delete any data left in the memory of a printer, or at least reduce the probability of leaving any sensitive data in it. Maybe printing some more megabytes of documents after the sensitive data will help "overwriting" the memory on the printer? I have no idea.

High-End laser printers (and copiers) often have hard drives that store a significant history of documents, so this would be the worst option.
SoHo laser printers don't generally have hard drives but laser printers are page printers, an entire page of content is held in memory. Standard practice is to print several benign pages afterward to flush the memory. If you are more concerned, powering down the printer for a few minutes should dissipate any memory content remaining.
Inkjet printers are line devices, they have no need to store a page of content as they are only spewing several lines of ink in a rastered pattern. Very low end Windows ink-jet printers use the windows computer for formatting and serializing the ink lines. Higher end inkjets will hold pages like a laser printer and serialize the ink sprays internally. Like the SoHo laser, standard practice is to print several benign pages afterward to flush the memory. You can also follow this with a power down of the printer for more assurance.


YubiKey or Google authenticator? I'm using lastpass and I would like to implement a 2FA in my account, but I don't know which one is the most secure, a software authenticator such as google authenticator or an USB device as Yubikey.

Since there isn't any password manager which has 3FA, I'm a little confused which one is the most secure.

Thanks

Google Authenticator is pretty secure. Certainly better than nothing, and in fact better than most of the options out there.

Yubico OTP devices are slightly better, because it's more difficult to extract the keys out of a Yubico device than a cell phone.

That said, neither is perfect because both are OTP-based and therefore both can be phished. This is a vulnerability that is today being actively exploited by groups like the Syrian Electronic Army, and is the cause for a number of high-profile breaches.

There is a solution which can't be phished, but as of this writing, LastPass doesn't support it. So while I still recommend using your Yubikey or Authenticator code as a second factor, I would caution you to not let your guard down in its use, because you're still vulnerable to phishing.


What sites give the latest information on security threats especially zero day malware What websites give the latest information on zero day malware or other exploits newly introduced.

Most of the information about zero-days, running malware or advanced exploits investigation (marketed as Advanced Persistent Threats) is privately owned by some commerical companies (such as Mandiant for ex.).

Apart of that, you can use the traditionnal vulnerability feeds like CERTs or CVE.
A feeds list was posted in this related question that might help you as well.

At last, I answered to that question with a small list of websites tracking malware / threats seen in the wild:

malwaredomainlist.com
malwaredb.malekal.com
exposedbotnets.com
scumware.org
malc0de.com
cybercrime-tracker.net
vxvault.siri-urz.net
nothink.org
botnet-tracker.blogspot.ch
atlas.arbor.net
marworm.com
zeustracker.abuse.ch (Zeus botnet tracker)
alienvault.com


Why do so many PGP public keys begin with mQINBF? Why do so many PGP public keys begin with mQINBF? I am just curious.

The first few bytes of the public key packets are describing, among other things, the size of the key and the version of OpenPGP used. As many people are using the same size (such as 1024-bit) and the same version of PGP, it will always give the same first characters. But, it does not mean that the key-space is smaller than expected.

For more information you may take a look at the full specification of OpenPGP messages in the RFC-4880.