How to prevent participants from cheating when establishing an OpenPGP-like structure I would like to share documents within groups and make sure that the member of each group can only access the documents shared in his/her group. I also want to make sure that non of the parties can cheat in the process of creating this architecture.

Situation:

There are 5 participants (A, B, C, D). There are two groups (blue: A, B, D, red: D, C). A and B can only see blue documents (like Document_1) and C can only see red documents (like Document_2). D can see documents shared in both groups.

Approach:
The following approach is close to the approach in Tom Leeks answer and is close to OpenPGP. This approach is taken, because it scales to groups with many users.

Example for blue group:

A generates a key pair. Public key: pk_a. Private/secret key: sk_a
B generates key pair pk_b, sk_b
C generates key pair pk_c, sk_c
pk_a, pk_b, pk_c are posted to a key server, visible to the public
A (or any member of the blue group) generates a symmetric key s1
A calculates pk_b(s1) (s1 encrypted with pk_b) and pk_c(s1).
A posts pk_b(s1) and pk_c(s1) to the server
B and C can now take those values and decrypt them using theis sk
A, B, C now know S1 and can share data within the blue group
If they are posting data in the blue group, they can use their sk to indicate to the others that it was really send by them
we do the same for the red group with the symmetric key S2

Problem:
How can we make sure that A actually send the correct symmetric key? A might want to exclude B and send pk_b(Sx) instead of pk_b(S1). B would be excluded of the communication.

Idea:

A is posting a random integer "to B" sk_a(pk_b(int)). To authenticate himself, he is encrypting it with his secret key
B takes that value increments it and posts it to C sk_b(pk_d(int + 1))
D is posting sk_d(pk_a(int + 2))
A can confirm that things are correct and that he indeed received his original integer, incremented by 2
A posts sk_a(pk_b(int + 3))
B can confirm that things are correct
B posts sk_b(pk_d(int + 4))
D can confirm that things are correct

Does this approach make sense? Is there a more elegant or efficient solution?

It sounds like you're trying to do multi-party key exchange for the purposes of broadcast encryption.

In your scenario you aren't trusting the users to send everyone in their group a valid symmetric key (S1), but you're trusting a key server to correctly list the public keys for all participants.  If you presume the keyserver is trustworthy (it could lie to any one of the group members if it were malicious), then can't we also assign it the function of generating the symmetric key and disseminating it to the group?

Let's assume we can't trust the keyserver to generate the symmetric key and send it to all the group participants.  The solution you proposed takes a lot of communication.

Here's my suggestion:

Group: A, B, D
A -> B: pk_b(NONCE), sk_a(hash(NONCE))
B -> D: pk_d(NONCE), sk_b(sk_a(hash(NONCE)))
D -> A: pk_a(NONCE), sk_d(sk_b(sk_a(hash(NONCE))))

The message A receives from D can be verified by using all the public keys to verify the chain of signatures.

Each participant can hash the NONCE they receive and check that it matches the hash signed by A.


Separate web and app server windows authentication I understand that separate web and app server can improve security. Your web server sits in a dmz and then there is firewall between it and the app server.

We provide solutions to clients within an intranet using windows authentication. Our clients normal have 100s of users and the information is sensitive but not critically important I.e. Personal or business info but not credit card numbers. We have a separate web (asp.net) and app server I am just wondering if in security terms if this really adds much since there is no dmz and both boxes exist on the same domain in order to use windows authentication and impersonation.

I am tempted to merge the app and web server for reasons of simplicity, removing delegation issues, cost and scalability.

Really my question is in the scenario above does having a separate web and app server really improve security by a large amount?

The security of a server is limited by the security of the "weakest" accessible service.

Additionally, if any service on the server is compromised, an attacker will likely be able to compromise the whole box, meaning that all services on the box will be compromised.

Segregation of services to different server means that you are not putting "all your eggs in one basket".

Having the application server on a different, back-end server, makes it much harder for an internet based attacker to gain access, as they have to compromise the front-end web server first. However, without knowing full details of the system it is difficult to judge this - it will be up to you to assess the risks and determine whether this separation is worth it. If the cost to secure it is higher than the cost of breaches, then it is not.


Does facebook/google app id need to keep secret if possible? For example, suppose I have an app which includes a link to use the facebook feed dialog, eg:

https://www.facebook.com/dialog/feed?app_id=xxxxx&link=

Which means the Facebook id is revealed to outside. My question is, is revealing facebook/google app ID a security risk?

Not a risk. The app ID is intended to be public; this is how you're supposed to use it.

The app secret is -- as the name implies -- the part which has to be kept private.


How are Google searches intercepted when they are supposed to be encrypted with https? In various news sources I read often that Google search terms are mass  intercepted and tracked. I wonder how is this even technically possible when communication between PC/phone to Google is encrypted by default with HTTPS aka SSL aka TLS? Everytime I read such a claim I cannot believe it is true because this usually needs a non technical solution like a court which says to Google: "Give us the search terms of this user"

Recent example:
https://theintercept.com/2015/09/25/gchq-radio-porn-spies-track-web-users-online-identities/

For the average webmaster, having Google switch to TLS has made tracking somewhat more difficult. The problem of course lies in that the referral connection was encrypted and so you can no longer just 'see' it as was the case years ago. That being said, tracking in not impossible. For instance the average webmaster can use services that essentially embed tracking cookies on many subscribed sites (Google themselves do this). Google only gives you analytic data to your site but it still collects all of this data (we will touch on that later).

Hypothetically, you could also create your own tracker that simply embeds a bit of code on every website that stores the user's info -however, this is obviously infeasible and also not needed (although Google and others do try)!

If you are a law enforcement agency, intelligence agency (GCHQ), or hacker, you potentially have access to the conduit that all of this traffic flows through (via court orders or exploits) and what's more is that you likely have access to the TLS certificates themselves (via court orders or exploits as well).

Obviously, there are legal and moral issues surrounding all of this but the technical rationale for how traffic can be monitored is sound. In regards to your GCHQ example (I didnt follow the link because I am at work and it contains the word 'porn' -can't have them tracking me now), the agency most likely had a subpena to access the information (if they 'hacked' the info, it would be poor OPSEC to disclose such a feat). Considering that the top 5 CAs are based in either the UK or US, this is not much of a stretch to assume. For example From a ToS at section 8.3:

  Comodo will disclose information where required by a subpoena, interception order or other lawful process.

If anyone can add some examples and references, that would be great. I tried to make this more than just conjecture but we will see how it is received.


Prevent manipulation of password database Given: A malicious user has gained (root) access to the server hosting an application's password database. Let's say the application is using a reliable password hashing mechanism like bcrypt and the password database is storing the relevant information - username, hash, salt, # iterations...

Is it possible to prevent the malicious user from creating their own admin user in the database and successfully logging into the application with full rights? Presumably they could INSERT a new admin user into the database with their own bcrypt'ed password. They would then be able to log into the application with full admin rights.

Is there any way to prevent this or mitigate such an attack on the application?

If only the database server is compromised: yes. If the application server is compromised: no.

Store a HMAC of the final password hash along with the hash itself: SIG = HMAC(hash, secret).

secret is a single value only known to the application server. It never changes. When verifying a login attempt, recalculate the HMAC and compare.
This way the attacker who has compromised the database is unable to create or modify a password (since secret is only known to the application server).

In practice, things are always a bit different: if your DB server is compromised you most likely are in a lot more of trouble.


MAC spoofing preventing connection I'm attempting MAC spoofing on a network I own. I'm connecting to a NETGEAR WNDR4300 wireless router from an Ubuntu Linux machine. The network uses WPA2-PSK [AES] security.

Connecting to the network with an un-spoofed MAC works fine. I can bring my network interface down with

sudo ip link set dev wlan1 down

and then spoof my MAC with either

sudo macchanger -e wlan1

or manually with

sudo ip link set dev wlan1 address XX:XX:XX:XX:XX:XX

(picking some address). Both techniques work. When I bring the interface up with

sudo ip link set dev wlan1 up

it attempts to reconnect to the network, then prompts me for the password. I enter the correct password, but it fails to connect. I've tried this numerous times, with various MACs (random, same vendor, etc.), without success.

What's going wrong, or how can I diagnose the issue?

You might find the solution to your problem in this answer on superuser:

Some more information on a big related to your issue here.


SSL - Main and Child servers network There is an embedded device which acts a client.  It communicates to a server via POST method whenever it has any data to be transmitted to the server.

Embedded device:
1. Acts a Client
2. Does not have any browser capability
3. Cannot be accessed by the user directly.
   The data is availabe on the server if the user was to monitor.

We might be having a scenario as explained below:

There is a main server which in turn has child servers.
For each child server, the embedded devices will be connected
The embedded devices connected to the child servers can be moved to other child server or main server by sending a command from the current server (change in the end points)
So during the SSL handshake process, there will a certificate from the server coming to the device.

So the query is

Which & whose root CA certificate should be stored in the embedded device (main or child servers)

Regards,

Sunil

For the scenario you described you should have the root certificate of the main server sign the child server certificates.  The embedded devices would then store the main server's root certificate.

In this way any child server could connect to an embedded device, and the embedded device would trust it because the certificate chain is trusted.

I would then create an SSL certificate for the main server signed by it's root certificate.  This certificate would be used for when embedded devices are connected to the main server rather than a child server.


Using Tor browser to use YouTube and account security YouTube is not available in my country, but I want to make an account on YouTube and use it. I'm not interested in protecting my identity. It is fine if anyone can monitor it. The thing I'm interested in is that I don't want my YouTube account compromised. I want to make sure that my YouTube's username and password (and other secret questions etc.) should remain secure.

I also don't have any problem if someone can do (middle-man-attack) to retrieve my video contents, since my videos will be public.

Is it possible achieve what I've listed above?

As you can see youtube URL is: https://www.youtube.com/. It starts with http"S", so your connection is encrypted for sure. So no worry about your Account Security.

In addition, when you want to sign up for Youtube, what you need actually is to create a Google Account via this URL: https://accounts.google.com.
Again, this is http"S", so it is end-to-end encryption from your PC to Google server. Those guys in middle without really strong decryption tool cannot get your password.

However, as DJCrashdummy just mentioned under your post. I also recommend you use VPN instead of Tor for watching video, cos Video definitely costs a lot of bandwidth of Tor, while this bandwidth is really important and necessary for other people who needs it. Also, Streaming Video over Tor does not provide you a smooth view, so I suggest you try this VPN: https://www.softether.org/, it's developed by Tsukuba University, Japan, and even China Great Firewall cannot block it. Last but not least, it's totally free.


Is accepting arbitrary COM pointers over a process boundary safe? I have a legacy Windows application that needs to be looked over in terms of security. During this review something caught me eye. In the out of process COM server I'm looking at is a method that accepts an arbitrary class pointer. The method manually queries the attacker supplied interface for a specific IID and proceeds to call methods on that interface. It's possible for an attacker to supply any COM class pointer they want to this method, and no further verification is done. The COM server is running the process of a more privileged user.

I don't know much about COM, but this behavior feels unsafe to me. Can an attacker exploit this behavior by sending their own specially crafted COM object or is this safe?

I've been struggling reading documentation and experimenting. I can't seem to find a definitive answer to this question anywhere on MSDN or the web. Could be that I just don't understand the technology enough.

EDIT:

The server's method looks like this, I've abridged it slightly:

HRESULT __stdcall CCallbackRegister::register_handler(char* new_handler, IUnknown* handler_pointer)
{
   std::string handler_name(new_handler);
   if (std::find(_handler_cache.begin(), _handler_cache.end(), handler_name) != _handler_cache.end())
        return E_FAIL;

   void* register_interface = nullptr;

   if (handler_pointer->QueryInterface(_static_handle_proc_iid, &register_proc) == S_OK)
   {
      IHandlerRegister* handler_register = (IHandlerRegister)register_interface;
      handler_register->do_register(this);
   }
...
}

I think I found my answer after more reverse engineering and watching old CON talks. This answer represents my current understanding of the situation.

In theory this operation is safe, But there are a number of caveats. I think I found an improvement in the my server, since I initially did not have specific security settings enabled.

First, what actually happens when I pass an object to the COM server is that the COM subsystem will begin the process to marshal my object and provide a proxy for the server to call.

The COM client (the attacker) can fully control the object, RPC data and marshaled interface.

In the COM server (assuming Out of process servers, as is the case here) the RPC runtime will call CoUnmarshalInterface on the data provided by the client to create a proxy. This function will first determine if the sent object uses custom marshalling. Since I was mainly interested in this functionality I did not verify what happens when a standard object is unmarshalled.

Custom marshalling is used on objects that provide their own serialization and de-serialization routines. The data stream provided by the client will contain the CLSID of an object that can be used to unmarshall the data further.

Before this is done, however, the COM subsystem will check if it has been initialized to allow custom marshalling.

Calling CoInitializeSecurity with dwCapabilities set to EOAC_NO_CUSTOM_MARSHAL will disable this feature.

Supposing that security has been initialized to allow custom marshalling the process continues.

The server will now call VerifyUnmarshalerClsidForRestrictedInternalInterface this function checks if the unmarshal class specified by in OBJREF.u_objref.clsid is restricted in some sense.

A next follows in DetermineEffectiveUnmarshalingPolicyForStream and CheckAllowedByPolicy which will make the final determination if the custom marshaller will be loaded.

The unmarshal clsid specified by the attacker must inherit from IMarshal. The object is then instantiated and it's IMarshall interface by a call to CoCreateInstance. The rest of the function deals with actually unpacking the object with calls to UnmarshalInterface and similar.

I found this talk very helpful in understanding COM more under the hood:
https://vimeo.com/214856542

These documentation pages were also quite helpful:

https://docs.microsoft.com/en-us/windows/win32/api/combaseapi/nf-combaseapi-counmarshalinterface

https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-dcom/fe6c5e46-adf8-4e34-a8de-3f756c875f31


How to exploit open redirect vulnerability which must contain the original url Let's say I have the following url: https://secure.sub.domain.com/?continue=https://sub.domain.com
I found out that I can put anything I want before sub.domain.com in the continue parameter as long as sub.domain.com is present in that parameter, for example: ?continue=https://google.com-sub.domain.com.
I tried to bypass this by using a null byte (?continue=https://google.com%00sub.domain.com) and a lot of other tricks without success.
Do you have any fresh idea on how to exploit this ?

Get your own domain (I'll use attacker.com as an example). Create the subdomain sub.domain.com.attacker.com. Setup sub.domain.com.attacker.com to redirect to wherever you really want to redirect the user to. Done.


Is a government entity capable of establishing a secure virtual currency system? After reading about BitCoins, I can't help but contemplate the idea of the a government withdrawing paper money and bringing all currency transactions digital, via a bitcoin-like method where every unit (1 cent, US, for example) has an id and an owner.

This would theoretically help eliminate theft, tax evasion, money laundering, etc.

What I want to know is:

I've read articles about the capabilities of some extremely powerful mafia-style cyber criminals that can basically break into anything. Is an entity such as a government capable of maintaining the security of such a system?

Consider what happens today with paper currencies - governments spend huge amounts of money evolving their currencies to prevent misuse. It's a never-ending battle to "secure" their currencies.

Most currencies are virtual to a certain extent, the time has long passed that they were backed by anything. For every dollar that is printed and in circulation there is more that exists only in bits and bytes. If you have a bank account the currency in it doesn't exist in a physical way, it's database entries in a system. Banks have an evolved infrastructure to move this money around, and they spend a great deal of time, effort, and money to secure these transactions. Governments are involved with banks already to secure these mostly virtual currencies in the form of regulators like the FFEIC, MAS, FCA.

Currency cannot be fully secured whether they are cowrie shells or crypto-currencies because they have to be able to be used. Any that has inputs and outputs will have vulnerabilities, and so cannot be fully secured.

So can a government maintain the security of a virtual currency? No. Can they make it secure enough to use on a day to day basis? They already have.


How can I know the protocol versions supported at OpenSSL1.1.0g How can I identify the versions (TLSv1.2, TLSv1.1, TLSv1.0, SSLv3, etc.) supported in OpenSSL1.1.0g when I manually compile it from its source (NOT the one shipped with the OS like ubuntu) without explicit disabling any version in the compilation?

Q: Is SSLv3 supported by default in OpenSSL1.1.0g? How can I know this?

The test program openssl s_server has several option to choose the SSL/TLS version, i.e. -ssl2, -ssl3, -tls1, -tls1_1, .... Starting with OpenSSL 1.1.0 the usage openssl s_server -help shows all actually supported options, i.e. -ssl3 is only shown if SSLv3 is actually supported. With earlier versions of OpenSSL the usage might show version which were not actually supported but an attempt to actually use these resulted in an error.

  Q: Is SSLv3 supported by default in OpenSSL1.1.0g? How can I know this?

Since you compile it from source you can just look at the output from config:

$ ./config
...
Configuring OpenSSL version 1.1.0g-dev (0x10100070L)
...
    no-ssl3         [default]  OPENSSL_NO_SSL3

Thus, it looks like SSLv3 is disabled by default.


How to protect myself from future fraud? Recently, I had my credit/debit card from my bank "stolen." The thieves somehow got my card number and information and took quite a bit of money from my account. Fortunately, I was able to recover it all.

The whole process was stressful and time consuming. My account was frozen so I could not access my money, I had to get issued a new card which took weeks, and I had to dispute the charges made.

There were two main purchases made using my card. One purchase was made online from all the way across the country! The other was an in-person transaction made at a store downstate from where I live. The bank told me that someone made a fake card using my card's information, and that's how that purchase was made. Is that something that can be done or were they just telling me that for whatever reason?

Now that everything is back to normal, I want to know how to prevent this from happening again. What caused this in the first place? Was it just my carelessness? How can I ensure that this does not happen again?

What you need to do is learn the tricks of the trade. What likely happened was your card was read by a "Skimmer" and then re-programmed on another card. Many Credit Card Companies make gift cards that look very similar to a real credit card, which makes life easier for a would be thief as finding a legit looking credit card has become much easier.

Your best lines of defense are as follows

Learn to look for and spot card skimmers (on ATM's and employees who you hand your card to feeding it through a cash register)
Only pay with a security chip enabled card
Don't ever leave your credit card unattended (don't give it to a waitress to charge your meal to - ensure they bring the machine to you)
Protect your PIN at all costs


Is it still secure if a cryptographic key generated with OpenSSL while a backdoored HWRNG used? Assuming I plugged a HWRNG in to my Linux machine, use OpenSSL to generate a RSA key pair and encrypted some text with AES. Later then, a researcher posted the HWRNG was backdoored. Should I consider those key are safe to use since Linux kernel mixes data not just from the HWRNG but with other sources. How about vices versa?

I read Can we trust encrpytion when the random number generator is compromised? but the condition of this question seem like it use HWRNG ONLY.

There's no evidence that Intel's RDRAND instruction set has been backdoored, just speculation based on it being a high-profile target for such attacks, and the known nation-state capabilities of introducing subtle silicon-level backdoors into products at the supply chain level. While such a case would be incredibly unlikely to be used in a non-targeted way, and even more unlikely to affect your average user, it's still an interesting concept.

Linux's random number generator implementation (i.e. the one exposed by /dev/urandom - forget about /dev/random for now because it's irrelevant for almost every use-case) involves several key components, the most important of which for this discussion are the entropy pool, the mixing system, and the generator itself.

The entropy pool is a block of memory which has data fed into it which is expected to be highly unpredictable. The goal is to introduce enough uncertainty that it is highly infeasible for anyone to guess what the data inside the pool is. The pool does not need to be large; even a few hundred bytes is quite sufficient to be effective.

Each source of data, which might include CPU debug registers, performance counters from the chipset, timing measurements from the display driver and HID, and all sorts of other feeds, are not independently useful as random numbers for cryptography. It is only in combination that they are useful, as in total it becomes very difficult to predict the resultant state. In order to properly combine these sources of data you need a mixing function which allows a set of independently somewhat-predictable values to be coalesced into a single highly unpredictable value, without losing any of that unpredictability in the process, while also being resistant to cases where an attacker controls or knows the value of a small number of the inputs. Cryptographic hash functions are great at this - you can feed in a concatenated string and get a single fixed-length unpredictable result. This output can then be fed into the entropy pool by xor'ing it with the existing data inside it, which has the useful property that even if the attacker knows the output of a single mixing step, it tells them nothing about previous or subsequent steps and should not allow them to predict the pool contents.

The /dev/urandom implementation takes contents from the entropy pool, generates a key from them, and uses it to key a pseudorandom function (PRF) constructed from AES in CTR mode. This allows it to generate a huge amount of cryptographically useful random data (many gigabytes) from only a few hundred bits of data in the entropy pool, and do so very quickly (hundreds of megabytes per second). This alleviates the need for continuous sources of random data - even under heavy pressure to product random bits, the PRF only needs re-keying every few seconds, which gives the system time to acquire more data from entropy sources like performance counters.

This is where the concern about RDRAND comes in. The implementation within the kernel does not use the mixing function like other sources do. Instead, its output is directly xor'ed into the entropy pool. This means that a backdoor in the silicon could potentially have knowledge of the pool contents and output complimentary values which produce a predictable or known state, allowing the output of future calls to the RNG to be predicted. If you assume that such a backdoor exists, then the Linux entropy pool construction is vulnerable to such an attack.

Now keep in mind that all of this is highly theoretical. Surreptitiously introducing a silicon-level backdoor to the Intel supply chain is a fairly tall order even for nation states, but that backdoor would also need to be able to discern when to trigger the backdoor in the specific case of an RDRAND instruction execution that is part of the Linux kernel RNG and not just some random other software or driver using it, and also avoid triggering the backdoor during any unit testing (whose code may be identical to that used in the real kernel source). On top of all of that, it would also need to be able to discern the location of the Linux entropy pool in memory and perform the necessary memory reads to implement the backdoor, which is actually a fairly tall order at that level of attack implementation. TL;DR - it'd be one hell of a feat for anyone, even the NSA or GCHQ, to pull off, and I cannot possibly imagine them risking the exposure of that kind of capability by leveraging it against a mass-market product rather than only in targeted cases.

The Linux RDRAND implementation caught Linus Torvalds some flack on the mailing lists, but he steadfastly defends the approach. His argument is that in the case of such a sophisticated hardware attack like that, there are so many other (and easier) ways that the processor could expose cryptographic keys or even provide remote access to the system, and the massive performance increase is worth bypassing the mixer for. With the recent revelations of the Intel AMT vulnerabilities, and the lack of openness and accountability for IME/SMM firmware, it seems quite reasonable to expect that much easier avenues of attack would be preferred.


Google Cloud Messaging Spoof I have few question on security of Google Cloud Messaging Service (GCM)

Is it possible to spoof messages that GCM server sends to android
clients?
Does server pushes data in encrypted format?
Data that is pushed to android client by GCM server has any link
with google account merged with android device?
What actually the raw data pushed by GCM server consists of like (
registration id, push data .. etc) and more??

Partial answer to 1 and 2:

There are two servers involved in Google Cloud Messaging, the third party / app developer's server and Google's server. Data sent from the 3rd party server to the Google server is sent over HTTPS with the 3rd party's unique API key in the POST header, so done correctly this should provide authentication of the 3rd party server, integrity and replay protection, i.e. it should not be spoofable. This relies on both the third party and Google securely implementing their services.


Citrix security flaws Are there any security weaknesses associated with using Citrix XenApp 6.5, Citrix Storefront and Citrix Receiver as a remote access tool?

I.e, I know it uses RC4-MD5 and DES-CBC3-MD5 ciphers, which are considered to be a weak cipher.

Any other flaws?

There are many vulnerabilities, CVE or not, in all of Citrix's products -- http://www.cvedetails.com/product-list/vendor_id-422/Citrix.html -- but I would especially target each with tools such as Burp Suite Professional (copying or modifying HTTP headers appropriately, such as replaying a User-Agent header), or, if Windows, you will want to use a tool such as FuzzLabs -- http://fuzzlabs.dcnws.com -- perhaps along with a debugger or fault monitor, such as Immunity Debugger. The book, "Windows Stack Exploitation" goes in depth with the latter. There are also five clever Nmap NSE scripts: citrix-brute-xml, citrix-enum-servers, citrix-enum-servers-xml, citrix-enum-apps, and citrix-enum-apps-xml and a great third-party contributed NSE script: vulscan.

Yokoso has fingerprints for some Citrix services -- http://yokoso.inguardians.com -- These signatures are also likely to be in the Nmap http-enum NSE script.

metasploit-framework has:

use .*citrix_stream <tab>, <tab> <tab> (for port 6905)
use .*citrix_access <tab> (for port 443 in a Citrix environment)
use .*citrix_pub <tab>, <tab> <tab> (for port 1604)

Nessus has:

http://www.tenable.com/plugins/index.php?view=single&id=62310
http://www.tenable.com/plugins/index.php?view=single&id=42961
http://www.tenable.com/plugins/index.php?view=single&id=56282v
http://www.tenable.com/plugins/index.php?view=single&id=63339
http://www.tenable.com/plugins/index.php?view=single&id=59310

exploit-db has:

https://www.exploit-db.com/exploits/17582/
https://www.exploit-db.com/exploits/17583/

Some of the best work I've seen is the seminal work on July 2009 and July 2008 from InsomniaSec (Brett Moore, et al) -- https://www.insomniasec.com/releases -- check out the prezos "Heaps about Heaps" and "Hacking Citrix".


SSL digital certificate process - high level I am a project manager and is touching on an IT project consisting of the usual 3 tier - web/client - middleware - database.

In this case, I have an web server and needs to implement SSL certification.
Though this is not in my scope, but I felt understanding the entire process will be beneficial to everybody.

I understand symmetric and public key encryption concept.

I understand digital signature concept.

But I can't place the whole picture together. Hence, please excuse me for the lengthy post.

Here it goes,

The whole reason of HTTP/SSL certification, if I am not wrong is for 2 purposes

encryption  (so data between client and webserver are secured)
authentication (so that "abc.com" is indeed "abc.com")

Right?

In order to proof "abc.com" is "abc.com", "abc.com" have to apply for a certificate from a Certificate Authority - which will do background checks etc. before issuing the certificate.

The certificate is then signed by CA.

Over here, since the certificate is digitally signed by the CA. So I believe, two things will be sent to the client when the client access the browser

the certificate itself
hash and digital signature of the certificate.

Right?

Since the certificate is signed by the CA (e.g. Verisign), it is encrypted by its private key. So where do I obtain Verisign public key?

Assuming the public key is obtained, the digital signature is then decrypted and the hash value matched with the hash value of the certificate,

The public key inside the certificate (which belongs to the "abc.com") will then be used by the client to encrypt its data to be sent to "abc.com".

Right?

This "data" is actually part of a negotiation between the client and the webserver for the use of a symmetric key use for subsequent communication.

Once the symmetric key is established on both sides, subsequent communication will be encrypted using that symmetric key and not the public key inside the cert.

Right?

Am I getting this on the high level or am I totally way off?

(added)

Thinking back,
When we create self-signed cert, how do we "pass" the public key to the client or whoever that is accessing the to our website ? if the public key of the signature is not given to the client -> is this the scenario whereby a popup will appear on the client browser and ask whether "to trust" the website ?

A: Authentication only. You can still do "null" encryption afterwards, if you like. But if you do non-null encryption, then you'll have an idea of who with you're doing that. That's the authentication part. -- There used to be a time when SGC, Server-Gated-Cryptography, was a thing. An extra bit in the certificate would either allow or disallow any decent encryption stronger than 40 bits "export" size. Nowadays this no longer exists and certificates have NO say in the strength or sort of encryption that happens.

two things will be send to the client when the client access the browser

Nearly. The server is required to send its own cert and the chain of signing certificates. All the way up to a root CA. (Sending the root CA cert itself is optional, and you're allowed to leave it out.)

So where do i obtain Verisign public key ?

On their website. But the actual idea is that you don't need to do this.
The idea is that any client software that you use already includes "trustworthy" Certification Authorities certificates. Microsoft, Mozilla, Apple, Java all maintain their own "certificate trust store"s.

Sort of.
The signature is verified (not "decrypted") and you use the public key from inside the certificate.

Close enough.

Further reading:

Long, canonical go-to entry here on SecSE: 2012-09-28, How does SSL/TLS work?
Nice short introduction: Jeff Moser, 2009-06-10, The First Few Milliseconds of an HTTPS Connection
Great video and book: Ilya Grigorik, https://IsTLSfastYet.com/


Can a usb drive infect a hard drive without an OS Specifically, I was trying to install windows 10 on a fresh new ssd, i was trying to use a usb to do it but it turns out I did not create the usb drive correctly, so I’m stuck on the “reboot and select proper boot devices” screen on my bios.

If the usb was infected, can it infect my ssd or my bios at this point?

It depends on what stage of the boot loading or fresh new installation point you are on in the BIOS.  From what I am reading, it seems you are only at the "reboot and select proper boot devices" screen.  This is typically a BIOS screen that is part of the BIOS which is typically located in the small boot partition or a BIOS flash chip.  The BIOS on many modern day computers, especially those that are designed to come with Windows 10, usually are called UEFI and are different than BIOS from the past.  Modern day computers  also have a TPM chip on the motherboard.

From an external memory interface like a USB, the UEFI can be infected although the likelihood of that happening depends on where the USB came from and where did the image of the OS on the USB came from.  As long as the first two came from legitimate means of obtaining, I do not think there is any need to panic.

If TPM is already activated on the system, then any attempt to infect the UEFI would be useless as the computer will not be able to start.  The TPM is an embedded chip on a computer that has a purpose of security, where everything is signed via a RSA key that is not accessible and is only stored inside the TPM module.  Any changes done to the system firmware that causes the signature to be faltered will cause the TPM module to stop the computer.  However many manufacturers have TPM disabled by default, this is because it delays the boot/startup process as everything has to get checked by the TPM module.

Regarding the SSD, because it is a fresh SSD there is no data on it at this time.  If it does get infected, as long as the BIOS is not infected, doing a clean install from an external drive in BIOS can clean and thus remove the infection on the SSD.

From your question, I am not sure if you are just asking or you really feel that your USB is infected.  Is the USB device showing in the selection list?  Doing a misstep in the burning an installation image via official steps recommended by Microsoft, in my opinion would not cause the USB to have a virus.  Just the image on the USB may be corrupt.  A corrupt OS installation image is not a virus.


Is it dangerous to receive mail as root? In the default configuration for the postfix package on Arch Linux (and possibly elsewhere), the aliases file contains the following comment:

...
# Person who should get root's mail. Don't receive mail as root!
#root:      you
...

Is there something dangerous about reading mail as root, or is this a concern unrelated to security?

Only my own opinion, but this a more of a matter of educating admins. We know that every admin should have their own unpriviledged account, and only switch to root mode for administrative tasks requiring it.

In addition, the smarter the mail reader, the more complex and consequently the higher risk of security flaws => no mail in root's box will prevent an admin to use the last beta but so cute version of [insert your prefered reader here] with root priviledge.

For example in a default FreeBSD installation, many crontab jobs send their output into root's mailbox. It is simply expected that the admin will not add clever rules there and will just use the good old standard BSD mail program to read it.

TL/DR: my opinion here is that it is just an additional defense line to prevent usage of a security broken mail reader as root - not even speaking of automatic mail processing as root...


Is it secure to have source code for website public? I am working on a website and would like to have it under revision control. I have used git for earlier projects before and I like it. This project though is a website written in Django. I am totally for open source, but I am wondering if it would be a bad idea to leave the source code for the website public, so that someone with bad intentions could search the repository for security holes?

Of course I am not going to upload stuff that should be kept secret passwords, etc.

The site is going to be a webpage for a local sports club, so I guess that the security for the site don't have to be as high as for example an online shop.

So my question is, is it a bad idea to have a public repository for a Django website, or is it acceptable if I don't add the sensitive information?

I took a look at the thread Open Source vs Closed Source Systems discussing the same topic, but it rather discusses open source vs. closed source from a security point of view in general. Interesting discussion, however not enough for me to make a decision. In the thread a few people point out that it matters what kind of project you are working on. Could you give me some recommendations for my project with the following specifications.

Small webpage for local sport club.
No on-site payments.
No sensitive information in general except if someone would use same user information as for an other site.
One person developing (me), might be a few more.

What I have found out so far:

Pro open source

I am probably going to write better code if I know that it might be read by others.
If someone sees a bug they'll hopefully inform me.
Hackers know the common security holes anyway.
There is no or very small interest (profit) in hacking my site.
Contributing to the open source community.

Pro closed source

Security through obscurity => another layer of security.
If I or someone else working on the site would commit sensitive credentials by mistake.
Project is exposed because it will be directly accessible over the internet.

If your website is secure, even the source code wouldn't help an attacker in a perfect world. But we do not live in this world.

By making the source code public you are simultaneously holding yourself to a higher standard coding wise, and introducing more risk. Since you're giving away your code to anybody who asks, you'd better make it rock-solid. (In fact, you should be doing this anyway, but I'm sure you know that!)

Releasing your source will allow for good, helpful people to point out bad things, and it gives a motivation for you to write solid code at all times. I'd say it's a good idea. However, you should talk about the risk with the website owner. Private repos do exist on GitHub and you can stand up your own Git server/local Git repo for private version control.

Suggested Reading:

Pros and Cons of Open Source implementation
Kerckhoffs's principle


How to speed-up data collecting of WEP AP for aircrack? I'm using aireplay to collect some data from AP alongside with aircrack.
Unfortunetlly, the proccess seems quite slow to me as I've reached 2000 in more than 20mins so far.
What most affects the speed of data collecting? PWR of AP is -77dB.
Thanks.

you should use airodump-ng to get the traffic. not aireplay. But that asside you can replay traffic you capture with aireplay as stated here

http://aircrack-ng.org/doku.php?id=how_to_crack_wep_via_a_wireless_client

if there are no clients available you could use aireplay-ng to fake auth
and then replay the traffic as stated here

http://aircrack-ng.org/doku.php?id=how_to_crack_wep_with_no_clients

good luck and stay safe


Is it safe to use leakedin.org? leakedin.org claims to offer a service checking if your LinkedIn password has been stolen and whether it has been cracked.

The website claims that it's pure Javascript, that is your password won't leave your computer, and says you can provide a SHA-1'd password if you want. But I don't know the people who created leakedin, so I don't know that they're non-malicious, and competent enough to not have their own website hacked to introduce malicious code.

I'd advocate changing your linkedin password (and any other websites that use the same password) first, and only then use linkedin.org, but is it safe to use the website?

Depends on what you mean by safe to use.   The service when I tested does not record your plaintext password, but likely is recording your unsalted hash.  Note this could easily be changed going forward and could later start recording plaintext passwords, unless you only input a hash on the site.  EDIT: Rather than using this site, I recommend https://lastpass.com/linkedin/ (based on this answer ) as it uses https from a known entity and is likely more trustworthy.

If you type your plaintext password into the source field, client-side javascript in your browser converts that password into a unsalted SHA-1 hash, and then that SHA-1 hash gets sent over the network to leakedin.org to see if your hash is in the 6.5 million list.  The actual http GET request sent from your browser to their server looks like (after typing 'password' into the field):

GET /?check=5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8 HTTP/1.1
Host: leakedin.org
Connection: keep-alive
User-Agent: [scrubbed]
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Referer: http://leakedin.org/?check=7ecfd8f97b4729c6ff0799b0b4d40f870083b461
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: first_pv_66595923=1; _jsuid=1189493102
Query String Parametersview URL encoded

The info from plaintext password can't be recorded as the cookie doesn't change significantly with different plaintext passwords, and no AJAX requests/XHR were noted.  (There is also a request sent to in.getclicky.com but it seems to be benign web analytics -- like google analytics and does not seem to record your password in plaintext or be encoding it somehow).

However, you should note that once you try this service, even if linkedin didn't leak your unsalted hash, you just leaked your unsalted hash to an unknown entity (and that entity now has tied your password to a specific IP address) -- the very thing you were initially worried about.  If you think a dedicated hacker could brute-force your hash in trillions of attempts you have now lost and need to stop using the password you just tested.  However, if you already changed your password and are now just curious, you could use this service to check.  If you are weary of them recording your plaintext password and not just the hash, you should recommend compute the hash on your own computer (e.g., echo -n "password" | shasum or echo -n "password" | openssl sha1 work in linux/unix or if you have python installed you should be able to do something like python -c "import hashlib;print hashlib.sha1('your_password').hexdigest()).


Why do Android and iOS not let users view wifi passwords? On Windows, admin users can view saved wifi passwords. I know that by rooting the device, it is possible to view them on Android and iOS, but usually, rooting is simply not an option. So, why don't these systems offer some option, like require to enter phone's pin code or password to view passwords?

People tend to reuse passwords. So if iOS or Android lets someone see your WiFi password, there is a good chance that that person now knows the password for many other situations. That's not a good idea.

Also, these devices are very portable, so they will find their way into other people's home. Imagine that I would like to access your WiFi, and you're Ok with that except that you don't want me to know your WiFi password. So I hand my phone to you so you enter the password, and everything is fine. I have access to the WiFi, but I don't have access to your password.

iOS has a new feature that couldn't possibly work if you could access the WiFi password: If you bring your phone into reach of my network, and you're in my contact list, you can ask for WiFi access, and I press a button on my phone, and you have access. Your phone gets the password, you don't.


Exploit database for NVD vulnerabilities I have the list of vulnerabilities (CVEs) in the NVD database. I need to find which one has an exploit. Is there any database available to get the list of all the exploits for CVEs? or is there any API to get them?

Few sources I search for exploits (by CVE):

Exploit Database
CX Security
Vulnerability & Exploit Database
0day.today (accessible via tor onion service)
VulDB (not exactly for exploits, but helpful)

Do check this list for additional sources of vulnerability databases


What makes it illegal to use the information learned by exploiting a bug? According to news reports, arrests have already been made in relation to the Heartbleed bug. It sounds like this person managed to gain access to the website's database by capturing the credentials the app used to access the database. This person then apparently used those credentials to access the database.

My question is, what part is illegal here? He was charged with "one count of unauthorized use of a computer and one count of mischief in relation to data." So, is it illegal to send a heartbeat request to a server knowing that the request will result in data leakage? If that data contained nothing but random bits, would it still be illegal or must it contain sensitive data to become illegal? Say passwords or other such info was present, does it then become illegal to have done it? Or does it become illegal to then take those credentials and log into a public-facing admin interface to the database?

What I'm confused about is where is the line between illegal hacking and just using information which is publicly visible? If a website leaves its DB credentials on its homepage with a link to a phpMyAdmin frontend to that DB, is it illegal to log in and look around?

At risk of asking multiple and broad questions which will lead to this question being closed, are there any rules of thumb to abide by when curious snooping around to see how something works crosses the line to become illegal?

The fundamental question here is authorization, not access.

If you break into your neighbor's house, clearly you are in violation of the law. But if he lets you in, then you are not.

So what if you have a key? If he gave you the key along with permission to enter (to feed his dog while he's away), then you have authorization to enter. No trespass there.

On the other hand, if you find the key under his doormat, that does not imply authorization, even though it grants you access. You can get in easily enough, but it's trespassing.

Now, say you go door-to-door checking to see if anyone left a key under their doormat. You just go inside the vulnerable houses and have a look around; you don't steal anything, you're just looking. That's what's happening here with the Heartbleed problem. Someone is using their knowledge of a vulnerability (e.g. key sometimes appears under the doormat) to gain access, but they are not authorized to have access.

Yes, the keys they retrieve are accessible to anyone who understands the vulnerability, just as a key under a doormat is likewise technically accessible to the public. But that doesn't make it legal to use it.


Is an SSL VPN instead of a normal VPN a good idea? I'd like to reach some webservices on my home microserver when I am not at home. Since I don't want to reach other services like SMB, SSH, etc. I thought it might be better to use SSL VPN with a self-signed cert I would add to my client computers manually before using the webservices. Afaik. there are SSL security testers like comodo, so it will be much easier to check whether the VPN is secure or I need to update something. Is it true that if somebody manages to hack it, then they can access only the webservices but not the whole local network like by hacking a normal VPN server? Are there any advantages / disadvantages I did not mention?

In general I don't understand why you want a VPN if you only want to access web services anyway. I mean if you don't want to access the local network why use a VPN? Just use a reverse proxy and htaccess, like this example.

Trying to answer the question:

Maybe you can add more information about what exactly you mean by SSL VPN and normal VPN. Using this SSL VPN definition the answer is probably not necessarily.

According to that website:

  SSL VPN delivers the following three modes of SSL VPN access:

  •Clientless—Clientless mode provides secure access to private web
  resources and will provide access to web content. This mode is useful
  for accessing most content that you would expect to access in a web
  browser, such as Internet access, databases, and online tools that
  employ a web interface.

  •Thin Client (port-forwarding Java applet)—Thin client mode extends
  the capability of the cryptographic functions of the web browser to
  enable remote access to TCP-based applications such as Post Office
  Protocol version 3 (POP3), Simple Mail Transfer Protocol (SMTP),
  Internet Message Access protocol (IMAP), Telnet, and Secure Shell
  (SSH).

  •Tunnel Mode—Full tunnel client mode offers extensive application
  support through its dynamically downloaded Cisco AnyConnect VPN Client
  (next-generation SSL VPN Client) for SSL VPN. Full tunnel client mode
  delivers a lightweight, centrally configured and easy-to-support SSL
  VPN tunneling client that provides network layer access to virtually
  any application.

But this only defines the access mode, so what the client does to access the VPN not what the VPN supports. So, it would depend on if your VPN server allows you to allow clientless mode only.


TLS 1.2 Older Browser Compatibility We are in the process of upgrading our webservers to support TLS 1.2 but I have heard rumor of very old browsers, such as those used as kiosks will fall over when trying to connect to a server that has TLS 1.2 support. Is this true? Or will every browser no matter how old and outdated just fallback to their supported TLS / SSL version? We have to support very old browsers for a number of reasons so I don't want to cause issues with latency or user experience when upgrading to support TLS 1.2.

Thanks!

TLS is backward compatible, in the following sense: when the client connects, it sends a ClientHello message that specifies the highest version that it supports; the server then responds with a ServerHello that defines the protocol version which will be used. That way, a TLS server can perfectly support TLS 1.2 and yet interoperate properly with clients who know only SSL 3.0, TLS 1.0 or TLS 1.1.

In the other direction (when the client knows TLS 1.2 but not the server), there can be some trouble, because some (incorrectly implemented) TLS servers will support only TLS 1.0 and crash/reject connections when the client states support for a newer version. However, this is not your case here.

To make things fail when you upgrade your server to TLS 1.2 support, there must be a client somewhere who claims to support TLS 1.2, but does not actually do it properly. I have not personally encountered such a beast.


Explaining a bad approach - not comparing hashes Today I saw a snippet a code for authentication logic :

function checkPass($pass, $login){
    $inputedPass = $pass;

    $req       = $bdd->prepare('SELECT password FROM agents WHERE password = MD5(?) AND ID = ?;');
    $req->bindParam(1, $inputedPass, PDO::PARAM_STR);
    $req->bindParam(2, $login, PDO::PARAM_STR);
    $req->execute();
    $result2   = $req->fetch();

    if (empty($result2)) {
        $req->closeCursor();
        return false;
    } else {
        $req->closeCursor();
        return true;
    }
}

Ignoring the MD5 part, which we know is outdated, this code doesn't check if your password is the right one (as in, comparing the hash of the password you entered with the hash in the database), it checks if there's a user with your name and the same password.

I changed this to allowing access on equal hashes instead, but I've been told "it's the same".

How do I explain it's not? What are the specific risks with his approach?

[EDIT]

Following @Marc's answer, here's how i updated this function :

checkPass($pass, $login){
    $inputedPass = $pass;

    $req       = $bdd->prepare('SELECT password FROM agents WHERE Id = ?;');
    $req->bindParam(1, $login, PDO::PARAM_STR);
    $req->execute();

    $result2   = $req->fetch();
    $req->closeCursor();

    if(isset($result2["password"]){
        if (password_verify($inputedPass , $result2["password"])) {
            return true;
        }
    } else {

        sleep(rand(40, 100) / 100); //measly attempt to mitigate side channel timing attack
        return false;
    }
}

Which i realized after reading the comments, doesn't handle the case when the user doesn't exists (i assume it will crash). However, it doesn't sends plain passwords nor relies on MD5.

Thank you

Assuming the value stored in the agents.password field is the MD5 hash of the password, the code as shown is correct:

sends the database the (login, password) pair
asks it to find a matching entry where agents.ID == login and agents.password = MD5(password) and return the value of the agents.password field
if the returned value is empty: return an error (I'm not sure about the dialect, so it could be empty as in "no result", or empty as in "empty password field". Let's assume the former).

The good points:

the behavior is correct: it returns true if and only if both the username and password match, and an error otherwise. This is good security behavior in the sense that it does not leak information about the existence of the user (eg: you cannot tell the difference between "user A does not exist" and "wrong password").
timing is similar: the time spent in the function will not differ much depending on whether the user exists or not, which avoids leaking that information (though it depends on the behavior of the query itself).

The bad points:

a single round of MD5 is a terrible way to hash a password. You want a much more expensive password hashing function as well as a random salt and possibly even a secret pepper
this is sending the plaintext password to the database, using builtin DB functions to perform the MD5 hash. This introduces another location where the plaintext password can be logged (eg: data audit logs) and leaked.

Compared to your proposal:

If I understand your proposal correctly, you would prefer to do something along the lines of the following:

hashedPassword = query(select password where ID = login)
hash = md5(password)
if hash != hashedPassword {
    fail
} else {
    success
}

The end result (in terms of input/output) is exactly the same. But looking through the good and bad points, the differences are:

you are not sending the plaintext password to the DB. That's a plus in my book
you may or may not be much faster when the user does not exist (it depends if you exit early if the user does not exist)

Conclusion:

The two approaches are mostly similar, and the little details I pointed out are nothing compared to the fact that MD5 is used. That is the biggest issue that should be resolved as soon as possible.


What is the impact of the OAuth 2 flaw on my social account and on my connected devices? According to forbes , Using the single sign-on via social account to login some applications can allow an attacker to hijack the user account's

  the flaws can be exploited remotely by an attacker to sign into a victim’s mobile app account without any awareness of the victim.

The researchers said that over than 2.4 Billion downloads that are vulnerable to this issue.

What is the impact of the OAuth 2 flaw on my social account and on my connected devices?

This is an fact not a flaw in OAuth 2 but in the implicit trust some developers have put into the data supplied by an Identity Provider (IDp).

The attack mentioned in the Original research is based on manipulating data intransit between 2 apps on your device or between a client and a server (either the Oauth Provider or a 3rd party service).

It boils down to a failure to recognize that you simply can not trust an end-user device (or any device outside of your control) so app developers should treat the data as 'evil' (as all user input should be treated) and assume it will be tampered with.

the attack leverages this mistake by supplying a correct access token but incorrect user details (such as using my own access token and your email address) which than will travel down to the 3rd party server and will be used as means of identifying me (so I will in fact be Identified as you as your email was supplied). In order for me to do this all I would need is your email address (easy to obtain). These servers should have been programmed in a different way. namely they should retrieve there own state of the user details utilizing the access token retrieved by the app. and validate that these are the same as provided.

Now how does this all translate to your question of impact on your devices.
 I am afraid the awnser is and will almost certainly always be "we do not know" Since the flow is a misunderstanding of the protocols use and risks. Since there are to many Apps we simply can not test them all if threre vulnerable for this abuse all. Since the exploit does not require anything from the victim but 'public' data you could be at risk without using oauth 2 logins at all. This is something the developers of these apps and services need to fix. and all wecan do is ask them to prove there not vulnerable (a.e. ask them to do a pen-test)


Optimizr, Is it secure or spam? I received a mail from optimizr.net. They say that I have some errors in my web
I never click to links on mail. So I went to google and they have a nice web. They say that their tool is to check errors in a website. It is free.

But I cannot find any information about that company. Is it a secure place? How are the owners? How do they make money?

Thank you

If you check the IP address that optimizr.net resolves to (178.63.88.243) - it is on at least one Blacklist.  Based on this I would error on the side of caution and say that it is spam.


Insider threat mitigation sql databases I support a number of applications some of which have sql databases. There's a number of scripts (mostly powershell/bash) to check the state of an application to see if it's considered healthy. Some of these scripts make calls out to the sql databases.

I'm fairly certain I could just change the script in place to do something malicious and either run it myself or wait for someone else in my team to run it

Is there any way of preventing or at least mitigating some of the potential damage that a PU could do with a script that hooks into a sql db?

In reality, it isn't even a matter of adjusting the script.  Presumably there are SQL credentials in the script somewhere to allow it access, and you could take those credentials, connect directly to the server, and do whatever you want.
It's worth emphasizing that this is a very valid concern.  "Insiders" are responsible for roughly half of all data breaches, with roughly half of those being intentional and the other half accidental.  As a result it's actually very important to limit and monitor all access to production databases that contain anything sensitive.  You have two main options:
The Principle of Least Privilege (wiki)
The principle of least privileges is a key aspect of information security.  The idea is that people/things should have access only to exactly the things they need to do their "job" - nothing more.  In your case what this means is that the database access credentials being used by the script shouldn't have full and unfettered access to the database.  They should have read-only privileges to only the tables/columns necessary to get the data they need.
This means that you'll have to create a new user account in SQL server that has substantially limited access to the database.  Most people don't bother with such a step because it can take more effort to manage.  For instance, if your needs change and your script needs to check some more tables, someone will have to update the SQL user to increase their privileges.  However, based on real-world experiences of many companies, giving large numbers of developers unrestricted access to the production database is usually a bad idea for a lot of reasons.
So, if your current setup with your script is convenient, then update the SQL access credentials to give the associated user as little access as possible.
Remove SQL access all together
Personally though I'd probably go another route (although this is still just a variation on the "Principle of least privileges").  As a general rule of thumb I don't like giving out SQL access at all, other than to mitigate the bus factor.  Most likely you can come up with another solution all together that won't require giving anyone direct SQL access.
This could come down to generating some API calls or a web portal to accomplish the same tasks. You would give someone access to the API/portal rather than to your server and scripts (which really just gives them direct database access).  You can still limit database access for the user that the API logs in as, just in case the web system ends up with its own vulnerabilities for people to exploit.
The advantage of an API/portal is that you have many more options for tracking user activity, auditing, and access controls.  The disadvantage is that it is another system you have to build, with its own potential security concerns.  However, based on the fact that you already have a number of applications, scripts, and users, I think it is only a matter of time until this is the best solution for you.
Summary
Your first step would be to limit database access for the user that your scripts are operating as.  However, in cases like this it's easy to get stuck in the habit of just writing up a new script everytime some new administrative task is needed.  This can quickly lead to the kinds of disorganization, easy access, and thrown-together-coding that lend themselves to a major data leak.  Designing and building an administrative tool meant to enforce access controls, auditing, and the principle of least privilege puts you in a place where you can default to good security.
Granted, that suggestion may be overkill for you right now.  However, if you continue to grow, there will come a point where your current solution borders on outright negligence.


What are the ports used by Online Email Accounts such as Yahoo Mail, Gmail, etc.? Let us say that I send an email using Yahoo Mail or GMail. Can this email be intercepted using a packet sniffer?

On which port does the email travel? HTTP, SMTP, POP3?

Let us break this down into three parts:

Between domains, the protocol is SMTP, which is essentially a relayed protocol.  If SSL/TLS is not being used, a sniffer will detect anything.  If SSL/TLS is being used, a packet sniffer will be able to know the from and to IP addresses, and any relay on the way would have to decrypt and then re-encrypt the email.
If using POP/IMAP/SMTP from a thick client (e.g. Outlook) to any one of these services, the port numbers vary but there are well-known ones.
If using the Web interface of these services, then the ports are 80 (HTTP) and/or 443 (HTTPS) from your user agent (browser) to the originating domain - (Google or Yahoo).  There, the packets are de-crypted to clear-text and then optionally re-encrypted if the target domain or a relay supports SSL/TLS over SMTP.  After that, the process reverses itself: If your target domain's user is also using a browser, then the reverse will happen and clear-text email stored on the target domain's mail server will be encrypted to HTTPS sent over client ports (random ports) to the end user.

In short,

if not using SSL/TLS, everything is visible.
if using SSL/TLS, everything is visible to the relays but not in transit.
port numbers may vary.


Am I supposed to find non-wifi devices in 802.11 frames of WPA2 encrypted wifi? I recently tuned in on my access point to see what data is visible despite encryption.

Am I supposed to find MAC addresses of my non-wifi clients in the 802.11 frames and is this part of the protocol (beacons) or a flaw in my access point? I was able to discover the structure of my full network from the outside like this.

It depends on the isolation mode of your WIFI AP.

It is not uncommon for consumer-oriented products to treat their wired and wireless ports as part of the same subnet in order to facilitate device discovery.


How to make John the Ripper output example hashes for a given hash type? Is it possible to make John the Ripper output example hashes for a given hash type given by the --format= option?

This is possible using Hashcat, but currently I look in John the Ripper's source code for example hashes, which is rather slow.

Any ideas?

The jumbo version of john has a --list=format-details option. By default, it outputs one record per hash type for all hash types, with tab-separated values of a variety of information about that hash type (maximum password length, long name, etc.). You can also specify a hash type.

So for a specific hash type:

$ john --list=format-details --format=descrypt | cut -f15
CCNf8Sbh3HDfQ

The plaintext can vary - for hash types that have minimum lengths, etc. or if a particular failure mode is being tested for. In this case:

CCNf8Sbh3HDfQ:U*U*U*U*


How can an IPS\IDS detect SQLi \ XSS (or other application layer) attacks? I've been thinking about how an IPS works, and as far as I know it inspects the packets on the TCP\IP layer.

How can it detect attacks on higher levels without harming the user experience? How does it address the fact that there is a loss of information and re-transmissions?

In the end, there could be a long request that splits over a few TCP packets. Does it build the information and then run a check on the request?

I would like to know what happens from network level and forward.

Thanks.

An IPS just does the same TCP reassembly as the stacks on either end.

Retransmissions aren't a problem. When a hole appears in traffic (because of a lost packet), the IPS forwards the packets after that hole, but also keeps a copy of them. Because it's forwarding those packets, there is no loss in user experience.

When the retransmitted packet fills the whole (completing the puzzle), the IPS then analyzes all those stored packets in order. It combines these into a single stream, so requests split across packets are no problem. If any of those packets trigger a signature, the IPS blocks the retransmitted packet, and kills the TCP connection with RST packets. This caused the target victim to then drop the fragments after the hole that it was buffering.

Thus, packets stream through the IPS with essentially zero latency, but at the same time, TCP is reassembled with no problem.

Over the last decade, hackers have developed methods to attack this system, such as retransmitting TCP segments with different data. Likewise, IPS vendors have developed defense, such as matching their reassembly algorithms with the target system so that it can choose the correct segment to analyze.

Also note that the IPS does full HTTP processing as well. There are likewise ways of corrupting HTTP requests in order to evade the IPS, which IPS vendors defend against.

The upshot is that an IPS introduces only about 100-microseconds (or 0.1 milliseconds) in latency to web requests, while still handling such things as TCP reassembly with no problem.


Can I create a website on wordpress anonymously? If I use a VPN that doesn't keep logs and create an email account, then use that email account to create a wordpress website (still using the VPN) and give no personal information (address, name, etc.) then how anonymous would I be from this website? Additionally, there would be no ad revenues or no credit cards linked to the account for anything. How easy or how else could my identity be compromised?

I feel if you want to remain completely anonymous, then creating a new email address with no other association to your self then that alone should be able to manage that.
Again with the use of a VPN you should again be ok, depending on the service your using. As there could be some DNS leak and as a result you could potentially have information leaked.

For this I would recommend Disable WebRTC, as for how easily your ID could be compromised would depend on how similar your user name etc is to your own personal ones. But as long as you creat all new accounts and use Random Name Generator you should be ok!


OpenID without SSL certificate Is it wise to use OpenID (from Google or Yahoo) to log-into a website instead of a username+password login if that website doesn't have an SSL certificate installed?

Just to make things clear, installing an SSL certificate is not possible because there is no dedicated IP address for web hosting.

Any other suggestions for secure login?

It would be safer to user OpenID if the site being logged in to does not support SSL than using a username and password.  As long as the OpenID provider supplies SSL, then all that will be sent in the clear (ie, that a man in the middle could get) would be the submission of the ticket indicating that you are who you say you are to the server.

It would only be useful to someone trying to compromise your account on the unsecured site that you are logging in to.  Depending on configuration, it is likely that they would not be able to reuse the ticket to log in in the future as well, where as a username and password combination could be used indefinitely in to the future.


Can setting the date on your iPhone to the epoch really brick it? So, I've started seeing warnings that there is a troll/hoax saying that people should set the date on their phone to 1st January 1970 to get a retro logo to display.

The warnings say that this will end up bricking your phone, and even a reset of the phone won't help.

Is the warning about bricking well-founded? What is this exploit and how could/should it have been prevented?

It's real, sadly. From Wired article:

  The bug appears to only affect 64-bit iOS devices, meaning iPhone 5S, iPad Air, and iPad Mini 2 and newer are affected. It’s almost certainly related to the same Unix glitch that caused Facebook to wish people a happy 46 years on the service; the date 1/1/70 has an internal value of zero on a Unix system, which in this case is leading to a software freakout.


Chrome/ Opera: How to trace and single out this Malware in Browser Extensions? caused by Tab Manager There have been lot of articles about legitimate chrome/ opera extensions that get sold out to malicious parties that end up pushing the wrong kind of code down the pipe, since by default these extensions auto update.

Since these extensions are mostly open source i.e. JScript and similar code,

How could we trace which ones is causing certain behaviors?

e.g. I got these 2 site/ URLs on my Opera (Chromium base) browser and upon googling them cant understand why and where from they showed up while I was doing some changes and rebooting my "Tomato Router".

I'd like to trace where if any redirectors are sitting. Some specifics sanitized out.

http://coolbar.pro/tracker/go-new?url=javascript%3Areboot()&cid=16

http://crvlck.com/get?key=33bc39603cbf409986a444d6bb525bf1&out=javascript%3Areboot%28%29&ref=https%3A%2F%2F192.XXX.YYY.ZZZ%2F&format=go&uid=16

My scans with Avira and other Anti Virus did not bring up anything conclusive.

I'd like to do & learn to do a bit of manual research into extensions.

If you see any activity on the browser that has these show up/ key words that might point to these issue then the following solution may help.

Keywords for people to find this answer/ solution:

  crvlck.com
  coolbar.pro
  33bc39603cbf409986a444d6bb525bf1

The Extension "Tab Manager" was sold to a malicious 3rd party and users were not notified in any fashion by the original dev.

On the github source code page he pointed to a new entry for the Extension, which most users dont have any way of being notified or knowing. For this, users need to delete and remove the old extension and if they want they can install from the new link.

https://github.com/VanCoding/Tab-Manager - Readme.md

  Tab Manager

  This is a Google Chrome extension which allows you to easily and
  quickly manage and access your tabs/windows ;) Have fun with it!

  IMPORTANT: The old "Tab Manager"-entry in the chrome web store has
  been sold and I am no longer the owner! Neither do I know the source
  code of the version that currently gets deployed there.

  Please note that only the web store entry and no source code has been
  sold. I, and all contributors of the project, are still the owners of
  the source code. I've also created a new entry on the chrome web
  store. I'll keep it up to date with the source code as with the old
  entry.

  license

  MPLv2

But, I still wonder what could we people / users do in future to keep track of such "handovers/ sellouts" and take steps.

Discussed here as well:  https://productforums.google.com/forum/#!topic/chrome/Znvs228EVc8

Specifics of the malicious code are available here:

https://github.com/VanCoding/Tab-Manager/issues/45

https://www.reddit.com/r/help/comments/4tquap/hitting_collapse_comment_icon_button_is/

Update:

Consequently after being criticized for introducing such activities into an open source project, the original author/ dev just made a bait/ switch on the open source project and high tailed out after his open source project turned sold into Malware, with prospective infections of 1,43,000 (based on downloads/ installs of original extension from Chrome Store). Finally, after arguing his stance he just removed/ deleted the open source project repository from GitHub.

  Patrik Stutz
  VanCoding
  Cloud Studios
  Hochdorf LU CH
  patrik.stutz@gmail.com
  http://cloudstudios.ch
  Joined on Feb 2, 2011

His final comments & activities on the subject from screenshot attached:


Best way to reduce encryption of the big files I want to share a big file(All existing formats) with others.
As I'm using Android phones as client/server I want to reduces the CPU overhead and Time it takes to encrypt/decrypt.

My idea is to use a method like partial encryption.

Is there a safe way to do so without huge overhead ?

Partial encryption is not a good idea in general since depending on the file type even clear text fragments can be used to extract sensitive information. Thus the best way is to do full encryption, but in a cheap way.

Depending on the CPU there might be hardware based AES available in which case this is the best option, both in terms of performance and battery usage. If no hardware based AES is available a fast software based algorithm like ChaCha20 is recommended. See also Do the ChaCha: better mobile performance with cryptography.


API hash-based authentication I'm reviewing API documentation from a potential supplier.

In order to gain access to the useful parts of the API, we have to send a GET or POST request to a particular endpoint passing two parameters - our organization name and the "public key hash". This endpoint will then return a token that we use for the remainder of our session.

The description of the "public key hash" is that we take a public key (provided in advance to us by the supplier), append the current UTC date and then perform an MD5 hash of the result. Their example is:

Public Key: a8db14aef3810a92e7c9af9f8782e1f0
Current UTC Date: 2013-02-28
Result string: a8db14aef3810a92e7c9af9f8782e1f02013-02-28
MD5 hash: efdb500ca0a4e107aea100554456ea85

I've not encountered an authentication mechanism like this before. It feels "hand-rolled" to me, and the use of MD5 is also setting my nose hairs twitching - do I really want to be writing new code in 2017 that uses MD5?

But before I really dig into things - is this actually a well-known and used authentication mechanism that I've just failed to find any documentation for? If so, is it actually still considered to be safe?

(Searching on the API key value in the example produces no results, so they've at least rolled a unique example for some reason. Searching on API authentication md5 didn't find any promising results either)

EDIT - This is probably based on DIGEST-MD5 or similar - Wikipedia currently claims it's still secure, but there's a "citation needed" in a crucial place.  Using MD5 is generally a bad idea.

The intention of the hash step is to protect against accidental leaking of the token/password.  By hashing with the time, you're basically deriving a shorter-lived token and sending that instead of the original one, so if the derived token were leaked, the original one would still be safe (assuming the security of MD5, so...).

Over HTTPS, this scheme doesn't really offer much more protection than an OAuth Bearer token.  It isn't any worse than an OAuth Bearer token of equivalent length, but the fact they've used this scheme (as well calling their secret token a "public key") makes it reasonable to assume that they're not that hot on security, and that will probably be reflected elsewhere in their business (e.g. securely storing the data you send them).

If you're sending this over plain HTTP, then it is better than just using the actual token - but you have other problems, because you need HTTPS to prevent MITM (because a bearer token doesn't help).


Can vulnerabilities in libraries cause security problems in user-level binaries? https://trailofbits.github.io/ctf/vulnerabilities/source.html
It says

"Common examples include libraries like libxml, libpng, libpoppler,
and libfreetype that parse complicated file formats and protocols."

Do such vulnerabilities surely cause security problems? For example, if the library is linked to a binary that does not have root permission, what damage the binary can cause to the system on which the binary runs?

Let's talk specifics.
A version of libxml (the first item in your list) has a CVSS score of 10 allowing for a buffer overflow leading to remote code execution and denial of service.
Let's assume that the binary that used this library is not run with elevated permissions.
Now let's re-ask your question:

Does such a vulnerability cause security problems?

Quite obviously yes.

The DoS is a security problem in that a remote attacker can stop the service at will.
Exploiting the vulnerability remotely allows an attacker to run commands as the user the binary was run as. You do not need to be root to do damage or to gain unauthorised access.

Not all vulnerabilities are about gaining root/system access and "total pwnage". Security is not "all or nothing". However, depending on how the system is designed, it is also possible for the misuse/abuse of a non-privileged account to result in privileged access.


Detecting steganography in images I recently came across an odd JPEG file: Resolution 400x600 and a filesize of 2.9 MB. I got suspicious and suspected that there is some additional information hidden. I tried some straight forward things: open the file with some archive tools; tried to read its content with an editor, but I couldn't locate anything interresting.

Now my questions: What else can I do? Are there any tools available that analyze images for hidden data? Perhaps a tool that scans for known file headers?

To detect Steganography it really comes down to statistical analysis (not a subject I know very well).
But here are a few pages that may help you out.

Steganography Countermeasures and detection - Wikipedia page worth a read to cover the basics.
An Overview of Steganography for the Computer Forensics Examiner - Has quite a long list of tools and some other useful information.
Steganography Detection - Some more information about Stegonography.
Steganography Detection with Stegdetect - Stegdetect is an automated tool for detecting steganographic content in images. It is capable of detecting several different steganographic methods to embed hidden information in JPEG images. Tool hasn't been updated in quite a while but it was the best looking free tool I could find with a quick search.


How do I know that I'm vulnerable to the: " Coordinated Website Compromise Campaigns Continue to Plague Internet " http://blogs.cisco.com/security/mass-compromise-of-the-obsolete/

and:

  All Redhat/CentOS versions plus nearly 100% of linux-based routers run
  2.6

Since the article is extremely uninformative..

Q: How do I know that I'm vulnerable or not? ex.: If I have an OpenWRT router, or Redhat 5?

As far as I can tell, there isn't enough public information to know which systems are vulnerable. The Cisco blog you linked to appears to be the primary source for this news (other sites have since picked it up, but add nothing), and it does have any concrete information on the infection vector.

The Cisco blog now includes the following edit (emphasis mine):

  The observation of affected hosts running Linux kernel 2.6 is
  anecdotal and in no way reflects a universal condition among all of
  the compromised websites. Accordingly, we have adjusted the title for
  clarity. We have not identified the initial exploit vector for the
  stage zero URIs. It was not our intention to conflate our anecdotal
  observations with the technical facts provided in the listed URIs or
  other demonstrable data, and the below strike through annotations
  reflect that. We also want to thank the community for the timely
  feedback.


Reason to Require A VPN Client for Exchange 2010 and Newer? Reading Microsoft's Publishing Exchange Server 2010 with Forefront Unified Access Gateway 2010 and Forefront Threat Management Gateway 2010, it looks like encryption is baked in for client access in all flavors (OWA, EAS, etc).  2FA is available with Forefront TMG.

Why would an organization require a VPN client like Cisco Anyconnect, for example, in order to connect to Exchange for email?  What does it provide that a pure MS Exchange 2010/Forefront TMG 2010 based architecture build does not?

Quite simply: they don't want their email server exposed to the Internet. By placing it behind their perimeter, they reduce the threat exposure.

Encryption protects the content of communication, but not the communicators themselves.


Enforce a time limit on the number of uploads per user I've done a lot of searching on SE and particularly here in regards to preventing issues or attacks for an image based website to accept image uploads, but I haven't seen anyone mention the idea of adding a limit on the number of file uploads per a period of time on the server, and wondered if this would be a good addition?

So far I have read:

Risks of a php image upload form
Secure PHP upload form & storage
Secure PHP File Upload Script
Secure File Upload in PHP Web Applications
Why File Upload Forms are a Major Security Threat

Are there any other security precautions to think about? I did read how images should be renamed. I've been thinking about using a 3rd party image API for the site, but I'm still looking into its security and implementation.

The challenge you are going to face is how you identify the remote user.  It's not very hard for a remote client to change their "appearance" (browser, browser version, cookies, browser plugins, IP address, etc) and look like a new client.

If you place a cookie on their browser that indicates they've uploaded a file they can clear that cookie and upload again.

If you add a flag to their session (tracked server side matching a session cookie you give them) indicating they've done an upload, then they can create multiple accounts.

The better approach may be to:

Decrease the value of spamming your site, taking away their
incentive
Improve your ability to detect and remove spam messages
(either before or after they are posted)


Is factory reset enough to remove malware from laptop? I have an ASUS laptop with Windows 10 that I want to factory reset. I used it for many years and did some torrenting with it in the past, so I wouldn't be surprised if something went wrong when it comes to security. The steps I would follow are these: https://www.asus.com/en/support/FAQ/1013065/
I would rather factory reset than format cause it would be harder to find the right drivers again if I formatted, and it's a big deal with laptops.
However, I wonder, is factory reset from a recovery partition safe enough to clean up the laptop if it got infected? Or could malware have overwritten the recovery partition and/or the UEFI (or other firmware)? I have secure boot disabled cause I needed to start Linux from Live USB many times and it interfered.

If you have a TPM, you can enable secure boot and proceed the factory reset. This way should assert than the restored OS is healthy as it is signed by ASUS. Then you will be able to disable secure boot for your linux needs.
Without a TPM, the main concerns are about a rootkit (able to insert itself in the OS after the factory reset) or about a malware which infected the recovery partition.
However, today most of the malware belongs to one of these categories:

spy your activities to produce a detailed consumer profile and send it
encrypt your files and ask for a ransom
make your PC a zombie for botnet usage

I think only the last could be persistent enough to use rootkit strategies.
As hft said, if you are using your computer for gaming, netflix and casual browsing, the factory reset would be sufficient. Even if the botnet malware is persistent he will not annoy your browsing.
If the PC is used for activism, journalism, nuclear code and so one, factory reset is not sufficient and you should consider using an airgap (a new PC) without mixing your sensitive activities with torrent ^^


Are there security concerns when using popular (js) frameworks? To what extent should one trust web/js frameworks?

Most frameworks are open source - developed in the open. Hence, many people can semi anonymously commit to the project. Human validation might be tricked and an attacker is able to commit some "harmful" code that then gets unintentionally called by the web programmer, who uses only the most abstract API layer.

How realistic is such a scenario? And how harmful could such code be?

Furthermore, Angular and React were initiated by Google and Facebook and have a strict revision process. I am now looking at framework developed by Alibaba and (for the most part) the Chinese open source community.

Considering the somewhat bad reputation of Chinese IT products, is there more reason to be concerned? or is this just something that the media/politicians push?

My personal opinion- web/js projects are generally not trustworthy, as the ecosystem is exceptionally weak when it comes to supply chain security. That said, I would not be unusually concerned about a large Alibaba-produced open source library in wide use. I would be more concerned about small node projects deeply enmeshed in the dependency graph.

Concerns about Chinese IT are in products in which visibility, much less security analysis, into the end product or production process is significantly more difficult than in open source- areas like chips, hardware, and algorithms.


Possible holes in this ASP.NET security design? So I plan on updating some data via an ASMX web service on a web server via .NET programs running elsewhere.  The primary security concern is that this web service needs to spawn a process to handle the data.  I'm utilizing the built in windows authentication system and restricting access to a local web server's windows group.  I plan on spawning the process via impersonation of a user with only the necessary permissions to accomplish its tasks.  The user will only be used to launch this program.  Is this an ok design or do I have a glaring issue that I've overlooked?

Additional details:

Impersonation user is hard coded into program.  If data is modified in transit, not particularly catastrophic, program runs nightly without any personal or secure data being sent.  Would be an issue if data was always modified, but that seems to imply a permanent middle man attack.

Check the inputs to the ASMX and for the parameters of the EXE so that you don't create a SQL injection-type of vulnerability.  Depending on the app and how the ASMX cleans the parameter calls the EXE you may be opening up the door to a wide system expolit.

Your application may be vulnerable to a DOS attack since impersonation on IIS generally isn't as scalable as other methods (such as Claims based authentication & Trusted Subsystem).

You may also see IIS/Process performance issues that can DOS yourself as the resource workers hang while running the application.  You may be better off wrapping your Caller and Win32 app in WCF.  Your authentication should flow through the WCF pipeline pretty easily.

How is the ASMX being called? Javascript or a Fat client?

If javascript is being used, make sure that you're protecting yourself from CSRF attacks (Antiforgery token + Cookie over HTTP POST or similar)


Why is MD5 considered a vulnerable algorithm? I know that MD5 is the most vulnerable hashing algorithm, and particularly vulnerable to Collisions. But the collision vulnerability is not very risky and somebody might use that as an advantage, but that's with sheer luck.

OK, let's say I store passwords using MD5. There are some colliding strings here: https://crypto.stackexchange.com/questions/1434/are-there-two-known-strings-which-have-the-same-md5-hash-value
But it's very less likely that a user might use these kind of strings as his password. That's why it depends on luck.

And now, let's say a user has used one of these strings. For an attacker to use this collision vulnerability, he/she has to know the original password and know that there's another colliding string for it. But if the attacker already knows the original password, why bother with collision? Is there any way that the attacker can use this as an advantage?

I know that MD5 is the most vulnerable hashing algorithm

Well technically (we are technical around here) there are worse algorithms than MD5.

  and particularly vulnerable to Collisions

Yes, folks can create a desired hash with a different plaintext. This is not likely to happen randomly, but could occur maliciously.

  But the collision vulnerability is not very risky and somebody might use that as an advantage, but that's with sheer luck.

Not sheer luck. There are techniques to find a plaintext that produces a desired MD5. That's a good subject for a different question.

  OK, let's say I store passwords using MD5.

Ouch. The main reason you shouldn't use MD5 is because it is a General Purpose (Fast) Hash.

You should be using a (Slow) Password Hash such as

BCrypt is commonly recommended, but be sure to run a quick SHA-2 hash on the input data, so super-long passwords will not be truncated by BCrypt
PBKDF2 but that is less GPU-resistant because it has lower Memory requirements.
SCrypt is better than BCrypt if you have a high enough work factor. Otherwise it is worse against GPUs. (again, because of higher or lower Memory requirements)
The winner of the Password Hashing Competition may be even better than the aforementioned, but has not yet stood the test of time, so don't use it just yet. It's called Argon2, and has separate Work Factor settings for CPU time and Memory load. (nice!)
Repetitive SHA-2 can be used instead of PBKDF2 (still not GPU resistant), but this is more tricky to implement the repetition efficiently (i.e. to be brute-force resistant) because SHA-2 is actually a General Purpose (Fast) Hash.

Most of these options generate random Salt by default, but you should verify whether this is the case!

It is best to include some Pepper (~72 bits of entropy) before the Password prior to hashing. The Pepper can be the same for all your users, but should be stored in a file outside of the database so that component cannot be found via SQL Injection.

Make sure your Work Factor requires about 100ms (with appropriate DoS protection) on your target hardware (knowing that attackers will use faster hardware for Brute force)

Of course no amount of hashing will protect weak passwords, so include password strength requirements.

  collision vulnerability ... is there any way that the attacker can use this as an advantage?

In the context of password hash storage this probably will not help the attacker.


Google Cloud IAM login to linux machines Is it true that in GCP, accounts that will be used to log in to linux machines can be provisioned in Google Cloud IAM? And if so, how is it achieved (i.e. using directory services or by amending etc files)?

OS Login simplifies SSH access management by connecting your Linux user account to your Google identity. Administrators can manage access to instances by setting IAM permissions.

Google-provided public images include utilities and components to manage VM access.

When you enable OS Login, a helper script activates these components and perform the configuration.

Read more:

Google Cloud OS Login

Setting up and configuring OS Login


How do I properly bury a hard disk drive to keep it healthy? As a way of backing up big amounts of data (about 1-2 TB) I thought it's good idea to bury a hard disk drive (in a damage-preventing shell) to be able to dig it later and read all the data from it if all other backups are gone (for example, if my laptop is stolen and my house is exploded). But I'm wondering if it's really a good idea, or I'm missing some important drawbacks of such method. Some people tell that in case of an emergency situation the disk is going to die from electromagnetic radiation. How should I protect my hard drive then?

(I'm not sure, maybe this question should be posted on Physics instead. If so, please, move it)

for example, if my laptop is stolen and my house is exploded

I suggest that the initial test run involve renting a safe deposit box at a nearby bank to do your offsite backup storage in.  This is probably the best answer as well.

If you want to get fancy, get a larger safe deposit box and pack the HD in an anti-static bag, then in a small layer of protective foam or other material, then a small Pelican or Otterbox case, then more protective foam/etc, then a larger Pelican/Otterbox case, then in the safe deposit box.

As a bonus, you can actually have two or three drives in play.  One at your main location with regular backups, one at the bank safe deposit box (optional third "in transit" box so all your backups are never, ever in the same place), and then you can rotate your backups, keeping them fresh.

Or bury it on your own land, I suppose.  If you choose to try the burying insanity, be certain to call your local underground line finder first - your hitting a water pipe, gas main, telephone line, cable line, buried electric line, decayed old sewer line, and so on and so forth when you dig is often a MAJOR legal/liability blunder, expensive, and quite frankly dangerous or possibly disgusting.

  die from electromagnetic radiation

That's outside the scope of this answer, and won't be caused by stolen laptops or burned down/blown up houses - start by looking into Faraday Cages.  These can be nested in the previously mentioned Pelican/Otterbox scenario - research how to best do that.

P.S. Encrypt your backups, of course, in case the drive is stolen in transit to or from the bank (or your car is stolen, or someone digs up your hole).