Why is my phone connection secure without a password when WiFi is not even with a password? When I talk on the phone or send text messages, I never need to type a userid and password.

But when I use WiFi I need to use a password.

How is the phone connection secured without a password, and why is that method not used for WiFi?

WLAN/WiFi can be secure when properly configured (this certainly requires a password or key).
Cellphone connections are not really secure. They are encrypted based on a key from your SIM card. This key is also known to your mobile network operator. You do not need a password, but your communication can be intercepted and eavesdropped on by your mobile network operator and law enforcement. The A5/1 encryption used for GSM is actually completely broken.
The reason why this is not done for WiFi is because you do not want an extra SIM card and you do not want your ISP to specify your password/key for WPA2.
You always need a key, password or certificate to authenticate and key/password to encrypt your communication. This information can be stored in various places, like your SIM card or your brain.
Additional information due to comments:
There are several reasons why using SIM cards for authentication to all WiFis in general would not work.

The WiFi access point would need to support EAP-TLS, EAP-AKA/SIM or similar which allows authentication with a SIM. Your device  (e.g. smartphone) needs to support this authentication as well as the access point.

The WiFi access point would need to contact the mobile carrier and check whether the connection should be allowed or not. This has two problems a) ISPs are not necessary the mobile carrier, b) how do you limit who has access to a WiFi. Not everyone with a SIM card should be able to access a WiFi unless authorized to do so. This means either WiFi operators hand out SIM cards for their WiFi and you end up with lots of SIM cards or they need to tell their ISP who tells all mobile carrier which SIM cards are allowed. It would need to be done manually, because you cannot foresee who might want to access your WiFi in the future. This would mean major costs in infrastructure and staff, not to mention time for connection setup.
The other way to manage it, is to setup a RADIUS-server (see comment of billc.cn). This also requires manual registration of allowed SIM cards and a SIM card reader. You would be able to manage access locally (which is good for security), but it is not the universal access you have asked for in the comments.

You would loose control over the security of your WiFi if the authentication is done by your mobile carrier or ISP. They can control who can access your WiFi and are even able to see lots of meta-data. They would know which person accesses which WiFi and also when.
Even if I have barely scratched on the surface of problems, you see why this is not easily done. You would need new hardware for your WiFi access point, likely your device that you want to connect and the ISPs and mobile carriers would need to adjust their infrastructure too. This makes it entirely infeasible.

Today it would be possible to use a SIM and manage access locally for a WiFi, but this means the SIM is just a substitute for authentication by password and the setup isn't simplified.
Your idea would work for access points operated by your mobile carrier, but as we already have mobile internet through LTE and similar technology (which is not the same as WiFi!), it will not take a central role . Especially since the mobile carrier can charge money for mobile internet usage, which is obviously in their interest. If you have a subscription to special services, some mobile carriers and ISPs offer access to hotspots, that can be accessed through EAP-SIM (thanks billc.cn).


SMS PDU specification and carving techniques? I'm trying to carve NAND flash raw dumps for SMS:s (for school, digital forensics), following the information on dreamfabric.com, but I'm having some trouble. First of all, the specification isn't complete as I'm seeing SMS:s that strays from this, and I feel there is a lot of noise in the data that conforms to the dreamfabric info (no clear header or trailer, fields can have widely varying values etc).

My current method is simply starting at each logical sector (512 bytes) and checking for 0, 1, 3, 5 or 7, and then do some simple sanity checks, but this results in a heap of false positives.

Any suggestions? Links to further info?

Thanks.

I don't know.  You might need to do some experimentation of your own: e.g., send some test SMSs and see what that leads to in the dumps, and then try to corelate them.

Note that Android stores send/received SMSs in a database.  You could try to locate that content provider on the phone's internal flash storage and analyze its contents.  I imagine iOS might well be similar.


Is there any security benefit to using physical machines over VMs? Consider a critical multi-server system (the clients are not in scope for this discussion). Each server can be a physical machine or hosted as VM.

Is there any reason to believe that the physical setup would be more secure than the virtualized equivalent, with all things being equal (e.g. room configuration, sufficient hardware resources for both approaches, etc.)?

Is there any research to claim one or the other?

Edit:
For further clarification (per requests in the comments), the question is primarily targeted at potential software exploits and networking vulnerabilities with regard to the traffic between the servers. For software exploits and vulnerabilities, consider those both on OS and the application level.

It really depends on what is on the scope of "security".

If service availability is part of security, then usually, virtualized system are better on this topic because of:

the inherent mitigation of hardware fault.
Ability to take snapshot, etc... to ease backups and rollback

If availability isn't on scope, then i would tell that, for sure, physical server are more secure since you remove a whole layer (the hypervisor one) that could bring breaches or vulnerability.


Is it possible to retrieve embedded information in a printed image with steganography? If I print the following noise texture image in which I've embedded some information with steganography, can I retrieve the information back or can I detect the information loss occurred due to degradation of quality in printing the steganographic image?

It depends.

Steganography is basically hidden information. It can be as simple as a picture that is mirrored versus a non-mirrored picture. This would convey one bit of information, and may not be easily detectable to an adversary. It would survive even extremely crude reproductions.

If you however hide data in the least significant bit of the colorspace, it would likely not survive, as color reproduction is not that accurate. It also depends on data density; fewer bits with a lot of space used for error correction will give you higher chance of success.

In essence this is a question about the bandwidth of the reproduction. A digital reproduction (e.g. copy of the file) is identical to the original. When you print it, you somehow transform it from digital information, to colored dots on a page. With what accuracy does this process happen? Do you rescale it, so 10 digital pixels ends up being 2-3 colored dots? Is the same color space used? Digital images are commonly RGB, while printed images are commonly CMYK.

When you scan the image you take these dots, shine some light on them, and digitize the return. How accurate is your light source? Is it a cheap LED with a very narrow light color? How accurate is your digital sensor? What resolution can you achieve?

As for your picture, I doubt you'd be able to recover much. The resolution is poor, and there's white and black dots at the size of individual pixels. Paper exhibits bleeding, as ink is a liquid,and paper is a fiber. The problem of bleeding even led to development of ink traps in typefaces to make characters sharp. A print medium could probably not reproduce a single white pixel surrounded in black.

On the other hand,it's two colors. If you print it in large enough scale, you will be able to accurately recover all information present, given that you know it is in two colors only, and pixels are printed significantly larger than any bleed effects. What size this will be probably depends on printing technology and paper stock used.


How to prevent malicious DLL from getting used in LoadLibrary or DllImport (.NET) calls I have a situation where malicious files are being copied to the installation directory of some software and the software will load those files when making a call to LoadLibrary or DllImport (in .NET land).

If your software runs with administrator privileges, a P/Invoke on a malicious DLL can essentially run any code in an elevated fashion, using your application as a vehicle to do so on it's behalf.

Many of these techniques can be found in this question: Ways to inject malicious DLLs to exe file and run it

What I'm asking is how, as a software developer, can you prevent this type of attack? If I want to import user32.dll into my application and make a call, how do I know it's loading the right one?

In the LoadLibrary documentation they do hint at this problem existing but don't exactly explain what you are supposed to do to avoid it at all costs.

  Do not use the SearchPath function to retrieve a path to a DLL for a subsequent LoadLibrary call. The SearchPath function uses a different search order than LoadLibrary and it does not use safe process search mode unless this is explicitly enabled by calling SetSearchPathMode with BASE_SEARCH_PATH_ENABLE_SAFE_SEARCHMODE. Therefore, SearchPath is likely to first search the user’s current working directory for the specified DLL. If an attacker has copied a malicious version of a DLL into the current working directory, the path retrieved by SearchPath will point to the malicious DLL, which LoadLibrary will then load.

A simple solution like checking if the file is in a search path you don't expect (such as side-by-side with your executable) doesn't work very well because the assembly name can be changed and a redirect put in place.

UPDATE: This article on Dynamic-Link Library Security explains things well, however, all these techniques can easily be bypassed by the same process copying the malicious files. I've seen DLL Redirection used to redirect to the malicious files as well.  I fear even programmatic approaches can fail because your applications can be modified anyway to still load the malicious files.

Are all Windows applications doomed to have this security flaw in them?

DLLs and other binaries could be signed (see here for how to check signature).

If they are not, or if you don't want to go that way, but you know what library you are supposed to load, then you can verify the library's checksum before loading. Acquire a read lock on the library and release it only after successfully loading it; this way, you avoid the small chance of a race attack (replacing the DLL after the checksumming but before the loading).

But yes, you need to load the library using the explicit full path, otherwise an attacker can just place a the DLL with the same name in any directory that's checked before the right one. So:

get the full path
lock the file
verify its signature
load the file
unlock the file
lather, rinse, repeat for the other DLLs

One possibility to verify whether Authenticode is trustworthy or not is to supply a tampered library of your own. Try loading it and verify that Authenticode check fails. If it does not fail, you will know that the system has been tampered with, and is not to be relied upon.

Just to be sneaky, you can try loading the tampered library and set a flag, do a bunch of other things, then acquire a lock on wintrust.dll and generate a checksum. Whatever the checksum says, if the flag has been raised, refuse to go on and act as if the checksum was invalid (you could inject the flag's contents into the algorithm to ensure the check will fail).


Does the length of a password for Wi-Fi affect speed? I work at a place that gives Wi-Fi to all the customers, with a password that is 19 characters long. A customer came in and claimed that because the password is long, it slows down the internet speed. Is there any truth to this claim?

No.

This is because your password is converted to a cryptographic key which is of fixed length (128 bits). For any length of password, the corresponding crypto generated key (CMAC) would be of fixed size. Many other parameters such as the client and server id, large random values provided by client and server are used to calculate this CMAC.

Encryption and decryption uses this fixed length CMAC.


What is the purpose of SSL Certificate Authority (CA)? What is the purpose of an SSL Certificate Authority?  How would a CA prevent dishonestcompany.com from doing something dishonest?   What does the CA signing of the SSL/TLS cert for dishonestcompany.com really represent?

What OP are asking, is "What prevents dishonestcompany.com from buying a SSL certificate for dishonestcompany.com and then running a fake webshop from there, collecting card details."

The thing is that this is not something SSL certificates are designed to prevent. SSL certificates are designed to prevent someone impersonating another site.

Certificates also provide a ID card for the website in question, so if the organization in question have purchased a higher grade certificate, or even a EV certificate, the owner of the website can be identified, and prosecuted in case of any fraud.

You can see certificates like a ID card in real life. As with all ID cards, you cannot just accept everyone having a ID card, then you lack a "authorization" step. This is same with for example signed software. What you need to do, is to verify, that the verified identity is the identity you wish to talk to.

You can see this as:
Real Identity -- Claimed Identitiy -- Wanted Identity.

A CA provides a link between Real Identity and Claimed Identity. But for everything to work, you also need to make sure to verify the Claimed Identity matches the Wanted Identity.
Eg, if you go to "dishonestcompany.com" to do your internet banking when you intented to go to "internetbank.com", then SSL certificates will not prevent you from felling into the trap.

Without CA's however, theres no link between Real Identity and Claimed identity, so even if you verify that Claimed Identity is identical to Wanted Identity, you can fall in the trap if you are victim of a MITM attack.

The browser verifies that the certificate matches the hostname you typed in, but YOU as a human, need to verify that the typed hostname is really the one you intended to visit!

In laymans terms, lets say you are Barack Obama, and want to let in Joe Biden into the white house.

What CA's in this case is, the one who issues me a ID card with the name "Sebastian Nielsen" on it.
BUT:
Lets say I show my ID card "Sebastian Nielsen" to you, and you let me in because I own a ID card. The ID card is no indication that im thrustworthy or wont do any harm. Its just a identity card. What you need to verify, is that the name on the ID card matches the name you want to talk to. This is called "authorization", eg checking that the identity is authorized to access the White House. Eg, you need to check that the name is on the list of authorized visitors, eg that the name on ID card in this case is Joe Biden.


How to make sure the data is indeed tunneled? I am not of the IS field so sorry if anything I write here seems pathetic.

Background for this question:

I login to my server with the following command. The second -L porition is to encrypt data transition through my PC's port 2222, into port-80 dependent software in the server (for example, CMSs like Drupal or DBMSs like PHPmyadmin).

ssh user@1.1.1.1 -L 22:localhost:22 -L 2222:localhost:80 -i ~/.ssh/key

My question:

How could I make sure beyond any doubt, that the second tunneling (i.e of port 80), also takes place and is successful?

To ensure that a tunnel is created successfully you can run

lsof -i tcp | grep ^ssh

In the output look for your foreign address 1.1.1.1 , look at the chain formed there should be two linking entries


Is it safe to store the state parameter value in cookie? As per https://tools.ietf.org/html/rfc6749#section-10.12:

  The client MUST implement CSRF protection for its redirection URI.
     This is typically accomplished by requiring any request sent to the
     redirection URI endpoint to include a value that binds the request to
     the user-agent's authenticated state (e.g., a hash of the session
     cookie used to authenticate the user-agent).  The client SHOULD
     utilize the "state" request parameter to deliver this value to the
     authorization server when making an authorization request.

  Once authorization has been obtained from the end-user, the
     authorization server redirects the end-user's user-agent back to the
     client with the required binding value contained in the "state"
     parameter.  The binding value enables the client to verify the
     validity of the request by matching the binding value to the
     user-agent's authenticated state.  The binding value used for CSRF
     protection MUST contain a non-guessable value (as described in
     Section 10.10), and the user-agent's authenticated state (e.g.,
     session cookie, HTML5 local storage) MUST be kept in a location
     accessible only to the client and the user-agent (i.e., protected by
     same-origin policy).

Is it safe to use a secure, HTTPOnly, SameSite cookie (say, with a short timeout) to store the state parameter's value? Would validating the value in the cookie with the value in the state parameter be sufficient to verify the validity of the request?

Is it safe to use a secure, HTTPOnly, SameSite cookie (say, with a short timeout) to store the state parameter's value?

You can make it secure.

Assuming you're writing server-side software (I'm assuming you do, since you mention setting the HTTPOnly option for the cookie): Encrypt the state parameter on the server and store the encrypted value in the cookie. (Details: Make sure you use a secure encryption algorithm with a random iv, and don't use ecb mode). Make sure you keep the encryption key secure on the server.

Why encrypt the cookie?

You have to encrypt the state value (or the whole cookie) for two reasons:

On principle: Security people like to layer their security measures.
If one fails, the other will still protect you. Even if
you protect your traffic with SSL, the SSL encryption may be compromised. For example, where I work, we have a content-inspecting firewall which does MITM on SSL, so it breaks the security of the connection by design. (This is a really bad idea, all in all, but I believe this is quite common - and it means that you can't count on SSL protecting the connection from your server to your clients.
To protect the state value from the client (user-agent). If there is malware sitting on your client, you don't want to expose the state value to it. It might get stolen. If the state value is encrypted, client software has no access to it, which is good.

Is this safe?

This is just as safe as storing a session id in the cookie and then using the session id as an index into a server-side database table, since neither the browser nor malicious javascript sitting in the browser nor anyone else sees anything more than an opaque, random-looking string in your encrypted cookie, and if they mess with it in any way, it won't decrypt to the original state value, which will cause the verification of the state to fail. But you might want to add a MAC (message authentication code) and only touch the encrypted state value from the cookie when the MAC checks out to secure your cookie contents against meddling.

Local in-browser javascript vs server-side processing

If you're writing browser javascript that makes oauth requests, you have to be extra careful (but javascript browser security is fundamentally broken; if you have a javascript browser application do oauth requests, I doubt you can make that really secure - you can make it reasonably safe, but probably can't defend against a determined adversary.

Is validating the state parameter sufficient?

  Would validating the value in the cookie with the value in the state parameter be sufficient to verify the validity of the request?

Whether validating the state is enough to validate the oauth request (reply?) depends on which flow you are using and at what step in the protocol you are.

For example, if you're getting back a jwt id token, in pretty much all of the scenarios you must verify the id token to make sure it's valid and meant for you (you can do that yourself or send it to a verification endpoint. A jwt id token is digitally signed and you must make sure the signature is okay, the audience and your client id match, the token hasn't expired etc.).

The same goes for access tokens: If, for example, you don't verify the audience of the access token, bad things might happen (e.g. the access token might be intended for another client...)

There are a few cases where you don't need to verify tokens. When you're using using open id connect to get an id token from an identity provider and you don't route the request through the browser, and get back the id token from your identity provider via server side request, then I think you can trust the id token without verification. However, I still always verify, just to make sure I don't stumble over my own cleverness ;-)


Why Microsoft leaves known security flaws? There is very well known security flaw in microsoft windows. That you simle boot a linux OS from flash drive e.g Kali Linux. And just replace a cmd file with sethc file and you can prompt cmd with administrator rights on lock screen of windows by pressing shift key 5-6 times. And then you can easily update passwords of currents users and so on.

Now I have tested  this on windows XP, Vista, Windows 7, Windows 8 and Windows 8.1. I have not tested it on windows 10 yet.

So why does microsoft leave this flaw ? Or is there any chance that they do not know about this ?

When the physical security of the computer is not ensured then there are probably dozens of different attack vectors. You can also remove the Administrator password to allow logon without password, you can steal the NTLM hash from the registry hive and try to crack it with John the Ripper and there are probably others I don't know about. These 2 things work up to Win7 without any problems.

The answer is simple: Password protect your BIOS and/or encrypt the hard disk.


Using Hashcat to crack HMAC-SHA256 Hashcat boasts its ability to crack over 200+ hashing algorithms, but there isn't much documentation on much of them. Hashcat --help shows it has support for HMAC cracking, but its not very straightforward with the syntax (it just says "1450 | HMAC-SHA256 (key = $pass)" ). I understand that HMAC-SHA256 takes two parameters, one being the key and one being the message, but I'm not sure how to specify both of these with Hashcat.

What is the proper syntax for Hashcat to crack HMAC-sha256? I have two files, one contains the message and one contains the hash. I know the password and I can verify the HMAC hash using openssl dgst -SHA256 -hmac "mypassphrase" message.txt

I hope what I'm saying is making much sense, its been a long week :/

The syntax is hash:message

Note that the length of the message is limited to 51 bytes.

See hashcat example wiki page for details: https://hashcat.net/wiki/doku.php?id=example_hashes


Why arp returns initial state after arpspoof stopped? I'm wondering why ARP table in my laptop returns to its initial state when arpspoof tool attack is stoppped.

Is there any option for the attacker to modify the victims ARP table until the default gateway sends a new ARP response with its legitimate MAC-IP pair even if the attack tool is stopped?

Thank you.

The ARP cache will be updated any time new information is available. This could be due to an ARP announcement, or simply based on entry expiration (for example: the default expiration time is 1 minute on linux).

If you want the spoofed entries to remain in the cache, you have to keep sending ARP messages.

Be aware that various OSes and configurations may make ARP spoofing less effective. You can read more about some of the methods in the wikipedia entry. If you want to know exactly why you are seeing you behavior, you may want to include more details (OS, actual ARP table entries, timing information, etc..).


Is SQL Server 2016's Deterministic Encryption any good? I'm seeing that MS just released a new version of SQL Server which supports deterministically encrypting a column, so that you can still query it:

https://msdn.microsoft.com/en-us/library/mt163865(v=sql.130).aspx#sectionToggle1

In this example, they deterministically encrypt the SSN column:

http://blogs.msdn.com/b/sqlsecurity/archive/2015/06/04/getting-started-with-always-encrypted.aspx

But this sounds an awful lot like ECB, which I thought was easily cracked (see the penguin diagram):

http://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Electronic_Codebook_.28ECB.29

Is deterministic encryption any good? Does it offer any real protection, or does it just make you feel better?

The currently published documentation on what that deterministic encryption really does is not sufficient to come to any definitive conclusion.

What can be said is that such deterministic encryption may be designed and implemented "properly", in which case it incurs no extra weakness beyond the ones inherent to its functionality: namely, that if two values are identical, they will be encrypted to the same value, and this will be visible to the attacker. This is a big unavoidable problem if the values are in a small enough set (e.g. a boolean true/false).

Existing documentation seems to imply that the underlying encryption algorithm is "AEAD_AES_256_CBC_HMAC_SHA_256", which says both a lot, and not nearly enough to actually know what runs under the hood. A "proper" implementation that matches the documentation would compute the IV for CBC encryption with EK(SHA-256(m)) (symmetric encryption of the hash of the complete data to encrypt). Such an implementation would avoid the ECB/Penguin issue. However, it is not clear whether this is what Microsoft actually implemented.


How do you know your server has been compromised? I recently helped a client who had their server hacked. The hackers added some PHP code into the header of the homepage redirecting the user to a porn website — but only if they came from Google. This made it slightly harder for the client to spot. The client would see the website fine. Only new website visitors from Google would be directed to the porn site.

Last night a similar thing appeared to happen to a different client. I assumed it was a similar hack, but when I checked the codebase I could not find any malicious code.
His chrome browser is redirecting from the clients website to www(dot)pc-site(dot)com. I cannot replicate this behaviour. I guess it is possible that malicious code is being added and removed. So I need a more comprehensive way to tell if the server has been hacked.

Only 2 developers have access to this dedicated server (and the hosting company Rackspace).
The server is Red Hat Linux.

What are the steps I go through to find out if the server has been hacked?

UPDATED

I would check the following:

Logs. If you have root access you should check things like history which will give you command history and log files in /var/logs.
Baseline. If you have a baseline like file hashes to work with for application and system files this will help a lot. You can also use backups to compare a previous state. If using a backup to compare files, use a slightly older one if you can. The site may have been compromised a while before and it is only now that the redirect has been activated.
Check any includes. The files may not be on your server. They may be script includes such as <script src=”http://baddomain.com/s.js” /> or iframe type tags. Also do not exclude images, PDFs of Flash (SWF), video files. It is a fairly common trick to embed links in to files of a different content type. I would suggest you inspect them by hand particularly at the start and end of a file. The file may be completely a link/html/javascript or may be a legitimate image file with a link trailing at the end of the file.
Check for unusual file dates, sizes and permissions e.g. 777.
Check cron jobs for unusual jobs. Someone compromising a system will often leave a back door to get back in again and again. Cron is a very popular way to do this if they managed to get that far.
Check for the absence of files, you may not be able to have access to logs but the absence of them is equally a tell tail sign that someone has cleaned up after themself.
Use search engines. Not surprising search engines are great at finding everything. Use directives like site: e.g. site:yoursitehere.com baddomain.com see if you get any hits.
Often a link or redirect will be obfuscated so long javascript code with single letter variables should be analyzed carefully.
Do a packet capture with a tool like Wireshark or tcpdump from a secure workstation to the site. Save it to file and search the file for a parts of the url.
Check database records that may be queried or updated. The link could be injected in the database not the PHP.
Don't exclude the client's workstation. Use a free online virus scanner if need be. Also check nslookup and see what that resolves to. Check browser extensions, clear cache and check hosts files.

To clean it up (if you are compromised) you really do need to go back to bare metal and reinstall. It is painful but is really the only way to be sure that you have got the whole lot.

To prevent it in the future you should be doing the following (although you may already be doing some of these):

Harden servers, including using vendor recommendations on secure configurations, using up-to-date software. Apply tight security control such as permissions, password policies. Also see folder and file permission shared host advice.
Implement quality control proceedures such as testing on low security environments, code review and testing.
Have your web application / web site vulnerability tested by a professional certified tester at least once. Look for EC-Council, ISO 27001 and PCI certified testers. http://www.eccouncil.org/certification/licensed_penetration_tester.aspx
Check out OWASP www.owasp.org and http://phpsec.org/projects/guide/2.html for web application security resources.
Use Intrusion Prevention System (IPS) tools. However depending on your hosting provider you may have limitations on what you can use. Host based IPS tools should be ok if you have a dedicated virtual machine.

Hope that helps. Otherwise maybe you could provide more information about the systems you are running?


Secure way to pass client certificate to the client2 Our product is comprised of two servers. We would like to authenticate one server to the main server by means of client certificate. I assume that we should ask the customers (who purchase the product) to use their own CA to generate a certificate for the main server.

1) Would that be an intermediate CA certificate? Then, I assume that the main server should generate a client certificate and send it to the subordinate server.

2) What would be a secure way to pass the client certificate from the main server to the sub server?

3) Is this all supported by OpenSSL?

Thanks.

{Already asked this question earlier but my new user was unavailable.}

You do not want to generate a client certificate for your customer.  This would mean that you have the private key for their communications.  This is bad practice.

You kind of have the right idea.  You want to generate a Root CA Certificate for your main server.  The customer would then generate an Intermediate CA Certificate for their server.  They would send this Intermediate CA cert to you via a Certificate Signing Request (CSR), and you would sign the certificate with your Root CA cert.  The previous link is for informational purposes only, I'm not advertising their product.  This signed certificate would then be sent back to the customer for use.
A CSR is a format that contains all the information needed for you to sign the certificate provided.  It does not contain the private key of the certificate.  This answer and comments explain that a form on a webpage for submission is reasonable because there is no private data being passed.  This will also give you a chance to gather other needed information to verify the customer in order to process the CSR.  Once you've processed the CSR you can send the certificate back through the same means, by email, or whatever method you choose.  There is no private information added after you've signed their certificate.
Yes, OpenSSL provides all the functionality you need to set this up.  There are several examples of PKI setups on OpenSSL PKI Tutorial.  Here is another great walk through for PKI creation (PDF).  Now these examples go beyond the scope of what you're doing, but it will give you the full understanding of what needs to happen for certificate authorities to work.

Here is a nice explanation of how the things all fit together at a higher level.


Is it possible to eavesdrop the wireless data transmission without being authorized to a router? I read in computer security book that there are three places in wireless networking where you can be attacked: wireless transmission, access points and wireless network itself. The book illustrates that eavesdropping may occur during data transmission and the countermeasure is encryption. On the other hand, for access points, the main threat is unauthorized access, which is handled by IEEE 802.1X (authentication). Assume that hacker accessed the router, let's say bruteforced passwords. So, it is confusing, why do we need to encrypt the data if an attacker has already got access to an AP? Even if the wireless transmission is encrypted and data received by a router is violated, and as I know, information cannot be processed in ciphered format, it is needed to be decrypted first and then processed. So, why do we need to encrypt data against eavesdropping if threats come from different side?

Having access to an AP doesn't mean you get to see all the data going through it. You'd have to gain admin access, then tell the AP to send all raw data to your device as well. That's a lot more complicated than it sounds. The danger of AP access is that a hacker could try to use SMB or other protocols to access your files. The network data itself is still isolated from you without either a firmware update or custom settings that many AP don't even offer to begin with. Having an unencrypted Wi-Fi connection only makes it easier to see unencrypted (e.g. HTTP/telnet) data. You still wouldn't see HTTPS/VPN data, because there's another layer of encryption.


what is the difference between dll hijacking and dll injection I would like to know if DLL Hijacking and DLL Injection are the same or if they are  different. I know that some malware use it to do malicious things.

DLL Hijacking is when you abuse the library search order to gain execution in a process. Being able to write to the directory an executable resides in allows a malicious actor the ability to drop a dll with the same name as one the executable will request via LoadLibrary. When the executable attempts to load the expected library, they will instead load the malicious one.

A legitimateish use for DLL Hijacking could be to add functionality to a third party tool that doesn't directly support plugins.
The finer details are explained by MSDN in the LoadLibrary entry.
See also this SO Question

DLL Injection on the other hand is where a running process is manipulated to load a desired library. MSDN details a way to do so without directly touching the process, through SetWindowsHookEx. Another way is to open a process, write the desired library name into its memory space, and then create a thread in the process to call LoadLibrary using that name as the buffer. This second way is covered in a SO Question


Email is marked as spam by Google Okay this is strange, I was working with WP_Mail() function, and it's been called successfully from the following statement, and email was delivered correctly.

if ($temp == 'offline-payment') {
    $return = $this->send($this->get_recipient(), $this->get_subject() , $this->get_content(), array(), $this->get_attachments());
        return $return;
    }

However, I tried to add some testing message just after the subject like this:

$this->get_subject().'test'

But the email was marked as spam by Gmail, I've tested it more that one time to be sure.

Why is the email considered as spam, what flags did it raise?
More specifically, was it considered as a security flaw?

Your mails are probably being marked spam because the SMTP plugin that you're using is almost certainly used by other users, who other Google users mark as spam. Now when your mail is sent from the same IP, it goes straight into the spam folder. To combat this, have your plugin send the mails to your own SMTP server and then mail then from there. That should do the trick.

A plugin that helps with this: http://wordpress.org/extend/plugins/wp-mail-smtp/


Deduplication of Encrypted Files Let's assume I have an 18GB database that is backed up nightly by dumping the database and then encrypted using a modern algorithm such as AES-256. This database has a daily update of rate of approximately 5%.

The storage medium the backups are saved on support block level de-duplication. I'm interested in knowing how this would impact the de-dupe rates of the backup partition.

Deduplication works on detection of identical files or blocks of data. Such duplicates occur only with negligible probability in random data, and properly encrypted data ought to be indistinguishable from randomness. Encryption is there to ensure confidentiality and this includes, in particular, hiding from any eavesdropper whether two source data files are identical or not.

In that sense, deduplication can work on encrypted files only if the encryption model is weakened. This is not a light decision: in the case of your database, showing which "blocks" have changed and which have not can be quite revealing on what you did with your database in the meantime. The generic term is traffic analysis. The Wikipedia page lists several famous military cases; traffic analysis is also very good at predicting business tactics of competitors (e.g. noticing in advance preparations for release of new major products).

Assuming that you want to do block-level deduplication, despite the possible leaks alluded to above, there are good ways and bad ways to do it. First you need to split the input data into block-sized chunks, actually a bit smaller because of the need for an extra per-block header (for IV and a MAC). Each block will be encrypted separately. Now the tricky part is that for deduplication to work, the same block data must be reencrypted identically if it did not change between invocations -- so it must reuse the IV. Reusing IV value is a sin; it is deadly when using modes like CTR and in particular its modern derivatives GCM and EAX. The solution here is an IV computed with a one-way function from the block offset in the file, and its contents; the one-way function should be "random looking", and be keyed, because otherwise attackers could try exhaustive search on the data itself, matching with the block IV.

The following scheme should be safe (within the weakened model) but this would require some careful analysis:

There are two keys K1 and K2 (possibly derived from a single master key with a Key Derivation Function.
For block number i, with data d, compute IV = HMAC(K1, i || d) (the IV is the result of HMAC/SHA-256 over the concatenation of i and the data d, using K1 as key -- truncate the IV to its first 128 bits).
Encrypt d with AES, using the IV from previous step and key K2, in CBC mode.
Put the IV and the encryption result together in a block-size chunk.

This uses CBC and MAC-and-encrypt, which is "not ideal" as far as cryptography is concerned, but hey, weakened model. You get what you ask for.

Edit: Important note: though some HMAC is being used here, this does not guarantee integrity of the block data. You may use the IV for decryption and then recompute the IV and see if it matches the one in the file; this will prevent generic alterations, but an active attacker could still replace a block with an older version of this same block. If you need some integrity check on your backups, do the following: in addition to any encryption and MAC described above, compute a MAC or a signature on the complete file and verify that before using the backup (if you are restoring a backup, then I assume that you will read it completely anyway, so you could have the MAC or signature verification "for free").


Satellite dish giving off RF signal with no reciever I have a pretty decent and new satellite dish on my roof (Direct TV) but have no receiver in use.  It was still technically connected to my cable lines and I found RF signals all over that section of the house.

There was no receiver connected (other than digital comcast boxes which doesn't work that way I believe). As soon as I disconnected the coax from the dish it stopped the RF signals.

My question is could a Dish on a house be used to send a signal as well as receive? If so what could it be used for?

In principle, yes- it is just an antenna and you can use the to send and receive.

In reality, you'd need to replace the receiver circuit with one that can also send - these are cheap so relatively easy to do. You would need to think about where you are sending data to, as those dishes are very directional.

So point to point link would be do-able,  althiugh it might breach local transmission regs.

In reading this back, it isn't a security question so may get migrated or closed.


Why don't video conferencing web applications ask permission for screen sharing? I am using Chrome 87 with Jitsi Meet 2.0, but I have noticed this behavior too with other setups. When I first enter a room, Chrome asks for the following permissions:

Even if I click "Block" to deny these permissions, Jitsi still appears to have access to my entire screen when I click the "Share your screen" button, including other applications and even different virtual desktops. I looked through Chrome's settings, but I couldn't find anything related to screen sharing in the "Privacy and Security" section.
This raises the following questions:

How did Jitsi get access to my entire screen?
Why didn't Chrome ask me for permission to do so?
Can other websites do this too, perhaps even without me knowing?

Either way, the user agent responds by presenting a user interface that prompts the user to choose the screen area to share. Both of these implementations of startCapture() return the MediaStream containing the captured display imagery.

Taken from MDN description of screen share API
When you press the screen share button, the browser shows you a list of windows, screens and so forth that you can share. By selecting what to share on that screen, you grant permission. In other words the selection and giving permission is a single step process.


What is the meaning of KEX DH host key and KEX DH H signature in SSH key exchange During the Diffie-Hellman key exchange, the server sends a Diffie-Hellman Key Exchange Reply (31) message back to the client. This message contains the DH server f but also two other pieces of information KEX DH host key and KEX DH H signature. Could anyone please explain their meaning and what they are good for ? Thank you.

DH server f - the exchange value used to calculate a shared secret.

KEX DH H signature - the signed exchange hash, which is used to authenticate the key exchange.

KEX DH host key - the public key of the server, used to sign the exchange hash

See RFC 4253, Section 7.2 for more details.


Remote Code Execution in apt/apt-get Recently, a vulnerability has been found in apt that allows arbitrary code execution, see here.

Is it reasonable just to update the system? Or we should be worried that this has been used and so probably reinstall?

Note that debian suggest to update doing

sudo apt update -o Acquire::http::AllowRedirect=false
sudo apt upgrade -o Acquire::http::AllowRedirect=false

Is it dangerous to update normally, doing (as I have already done being unaware of the problem...)

sudo apt update
sudo apt upgrade

?

Following the article that you have mentioned, it appears that the vulnerability lies in the http redirect where an attacker can insert the malicious redirects on vulnerable APT versions to download the malicious .deb packages and further install them to infect the system.

Further, the above suggestion to use AllowRedirect=false was just a precaution if you suspect a network man in the middle. Since you have already updated to the latest version though using the normal way, I don't think that would cause any problems. However, it's always recommended to check the response message on what contents APT is going to install to be sure.

Lastly, the guidelines from Ubuntu for upgrade outlined at https://wiki.ubuntu.com/Security/Upgrades haven't mentioned of any redirect flags to be used!

Cheers!


Authenticated vs Unauthenticated network scans What are the differences between authenticated and unauthenticated network scans?
Do they show the same results?
In which scenario should both be used?

I assume you are talking about web applications. If not, edit your question as my answer will not make much sense.

  What are the differences between authenticated and unauthenticated scans?

Authenticated scan is when you have a valid account on the application. Unauthenticated is when you do not have any.

  Do they show the same results?

No, they show different results. Unauthenticated scan will show every resource that anyone on the internet can access, without having an account. Authenticated will show only resources accessible to valid users.

  In which scenario should both be used?

If the application don't have account controls, a simple unauthenticated scan is the only option, as you cannot use an account if no accounts are available.

If there are accounts involved, use both. Why?

If you have credentials, login on your account and scan everything you can. Map every resource, every available backend, everything. Log out, and try to access the protected resources with the unauthenticated session. If you can access secured resources without an account, you found an authentication bypass vulnerability.


Can a non-PCI Compliant Service Provider provide SAQ A-EP compliance? I am trying to find clarification regarding PCI Compliance SAQ A-EP and third party hosting solutions.

In order to achieve SAQ A-EP PCI Compliance using "Hosting Company A" is it necessary for "Hosting Company A" to be a Certified PCI Compliant Service Provider?

Feel free to expand your response as necessary, but what I am hoping to find is a Yes or No answer and "why".

Yes, SAQ A-EP requires your hosting provider be validated to all applicable PCI DSS requirements.

To quote the SAQ A-EP itself (emphasis mine):

  SAQ A-EP merchants confirm that, for this payment channel:

  ...

  If merchant website is hosted by a third-party provider, the provider is validated to all applicable PCI DSS requirements (e.g.,
  including PCI DSS Appendix A if the provider is a shared hosting
  provider);
  All elements of payment pages that are delivered to the consumer’s browser originate from either the merchant’s website or a PCI DSS
  compliant service provider(s);


Trying to figure out Gmail login in Wireshark In my pentesting lab I'm using ettercap for do a mitm to a XP VM.

I go to gmail, accepting the false certification, and here I start to sniff with wireshark. I put some false account like pentest/pentestpasswd try to login and stop the sniffer.

In this moment, ettercap shows that user/password stolen. I'm trying to find that info in Wireshark too, but I can't. Even following the TCP stream, I can't.

Some advice?

you wont be able to see it plain text in wireshark. the packets are encrypted ettercap is acting as a relay, your pc connects to ettercap which decrypts the login info then encrypts it again to send it to the real gmail server


Encryption Question for patient PHI I am the Compliance Officer for a laboratory. Is it permissible to send an unencrypted email with a patient accession number? It does not include patient name, DOB, SS# or address. It is just an associated, unique number related to a test.

In my interpretation of HIPAA/HITECH, NO, it should be encrypted.

From everything that I've read on this over the years the broadest translation of EPHI is ANY information that COULD be used to IDENTIFY a patient.(This would include any account or test numbers) The debate would be "entities that need access to" or "provide access to" however if ruled as negligent in court, it's not an excuse and since you have the title of compliance officer I would require encryption (atleast in writing). If you don't have the ability to approve spending on say encrypted email then provide who does have the authority with Section 164.312(e)(2)(ii) of HIPAA and BCC your external email address to cover yourself that the company is going rogue and not yourself. I always say unencrypted email is like writing information on a piece of paper and putting it on "Joe's" car under the windshield wiper. Enen though it's addressed to "Joe" anyone who is walking by with "curiousity" could read that paper on the windshield of Joe's car and he might never know. If that data is valuable in ANY way, people will try to "acquire it".

Here's a quote from wikipedia's site: PHI is any information held by a covered entity which concerns health status, provision of health care, or payment for health care that can be linked to an individual.[13] This is interpreted rather broadly and includes any part of an individual's medical record or payment history.

taken from: http://en.wikipedia.org/wiki/Health_Insurance_Portability_and_Accountability_Act

Unfortunately an ex-employee could social engineer with that information, additional information such as a SS#.

Depending on how much data is sent and how often it will be sent you may want to consider building a SFTP server (usually favored over FTPS by most Hospitals I.T. departments)

Personally I've done this for two of the largest hospitals in my state and that's how they send reports and patient data. I used a turnkey linux distro here: http://www.turnkeylinux.org/fileserver

It's FREE and very easy to setup and will cover the issue of using encryption while the data's "in motion" Also be sure to make a unique login for EACH entity that will connect since all login attempts are logged and be sure to use a long random password and only give that info over the phone or fax since your email does not sound like it's being encrypted.

A word of experience on email encryption, stay away from Trend Micro, it's too difficult for computarded users to count on their fingers and toes the numerical  placeholders of their passwords.

ex.
password: doggypuppy123
enter characters 1, 2, 7, and 9 of your password
answer: d o u p

plus they have security questions on top of that as well.

It is horrible, I was stuck with it for a year from the previous admin and now we have something much more computarded user friendly. Let me know if you have any other questions.

If you just want to send the information VIA email and don't have the capability to run a SFTP server thatn you could use http://www.jumbleme.com/ which offers FREE low volume encrypted emails. The onlything in question is when you look at the HIPAA compliant version of the "FREE" service they say that they charge $49.95/yr per user account.


Universal DNS Resolver I would like to implement a DNS client which should be able to resolve any valid domain public, private or otherwise (tor,i2p). What's the best way to achieve this?

I know that I need to pick a particular DNS server based on the TLD, for e.g, in order to resolve Tor I should have access to Tor network.

if it's .onion --> local (contact tor node)
if it's .com --> 8.8.8.8 (any public)
if it's .tk --> 80.80.80.80 (freenom) and so on ....

I'm looking for an idea on different possible and efficient ways to achieve this. The few options that I know of:

bash script using dig, pointing to a specific dns server based on
TLD
BIND dns server config based on TLD
writing a custom python program

Love to get your ideas. Please let me know if similar programs exist.

Many DNS Server implements already this logic. You can define multiple DNS server forwarder endpoints based on the domains changing the DNS server configuration file. Then you can use a standard DNS client to point to a DNS server with this configuration.

For instance here is described how to configure dnsmasq in order to forward DNS requeste to two external DNS servers based on the domain name.


What is your way to create good passwords that can actually be remembered? What are the methodologies which can be used to generate "human" good quality password?

They have to ensure a good strength and also easy to remember for a human being.

This XKCD comic describes a way to generate a good password. The quality of such passphrases has been discussed in : XKCD #936: Short complex password, or long dictionary passphrase?


Is there a way to verify the identity of a router over WiFi? I to find out a way to “verify a router's identity” for security purposes.

I was thinking in some process that involves hiding the router's SSID plus verifying the router's MAC address when performing the connection.
The problem here is, the SSID, even when hidden, can be easily detected, as well as the MAC address, a password even with WPA2 security isn't completely helpful when non-techies are connected to that network because social engineering.

So this information would allow an attacker to spoof the router's identity, and maybe with a stronger WiFi signal this attacker would cause pre-configured computers to switch from the real network to the fake one, allowing the attacker to see all packages being transmitted inside and outside the network.

I want to know if there's an SSL-like scheme for verifying the identity of the router someone is connecting to, in order to avoid these kind of attacks.

Two options:

Use a VPN on the client so any man in the middle is avoided and you connect to your network that way. Even if it does go through a bad actors.

Use RADIUS in a EAP-TLS configuration to offer authentication to radius clients and servers. The client in this configuration would be the AP and not the end users device (a common mis conception in RADIUS for new admins)


How to "clean" graphics of embeded exploits? I am not totally sure about the terminology but I hear quite a bit about images in websites that somehow take advantage of bugs in software that can be used to compromise a system.
Its not clear to me if these are in the metadata or embedded some other way.
My question is, how can be sure a graphic is not composed? and/or how to "clean" a graphic? If it is in the metadata then I assume something like Metadata Anonymisation Toolkit (MAT) might do the trick? or some more laborious thing like taking a screen shot of the graphic? (but that would be a PITA if I had a batch of images).

From a comment on the other answer:

Wow, great explanation. And happy to hear that converting is a reasonable option!

Unfortunately, the other current answer is incorrect, and the suggestions there, such as using conversion, do not improve security when presented with a malicious image file with an embedded exploit, and can even make things worse.
Issues with conversion
There is no way to guarantee the file is clean. While others have suggested converting from one format to another, this is likely not a safe solution due to the fact that they all use the same libraries, with few exceptions. If there is an exploit embedded in a PNG images, chances are it will be targeting libpng. If it is in a TIFF image, it will be targeting libtiff. These libraries will be used whether you're using an image viewer or a image converter. This means that a vulnerability that affects an image viewer will, with high likelihood, equally affect an image converter.
Issues with compression
Image compression often does not touch certain parts of the file. If you are doing lossless compression "over" the image, such as compressing it with an archiver, that will preserve any exploit. If you compress it with dedicated tools like optipng or pngcrush, certain parts of the image will be compressed, while other parts will not be. This means that there is no guarantee that you will destroy the malicious components.
Issues with antivirus
Scanning the image for malicious code only works for exploits with known signatures. Unlike executable files, an IPS/AV cannot run heuristic detection on such files, as each method of exploitation behaves differently.
Sandboxed conversion
One potential but partial solution would be to use a highly sandboxed conversion utility, such as graphicsmagick in a tight SECCOMP sandbox. Use it to convert to something like PPM or BMP, which are extremely simple and preserve nothing more than the raw, uncompressed image data. This can later be converted back to whatever format you wish. This is not a perfect solution because, in theory, the conversion utility could be compromised to attempt to generate a malicious output file. This would require chaining exploits and is not likely a realistic issue, so this should be good enough.


Security of a sessionID stored in a div in the page source I've just come across a web application that appears to store my current sessionID in form of a div element, which is not displayed on the web page.

This is an odd method, but to be honest I don't see an actual security risk there. Am I missing something? Can this method be considered as secure? I understand that properly configured cookies are preferable as they increase the effort to steal the sessionID via XSS.

Whether the session is stored in a variable on the page or within a cookie they suffer the same risks. That said storing a sessionID on the page is a method that has been used many times. To mitigate any risks with sessionIDs being tampered with you can always ensure they are transported over the TLS protocol.


How should I validate an API key for a web service deployed via iframe? I'm working on a small web service that provides some functionality that can be embedded in a web page with an iframe.  As this is a subscription-based service, I'd like to be able to manage who can and cannot access the functionality in question via API keys.

My understanding is that one popular approach is to embed an API key into the resource, e.g.:

<iframe src='http://service.com/API_KEY_GOES_HERE/' height='750' width='640'>

When the server receives a request from client, it does a lookup on the referrer to ensure that the site requesting the resource is allowed to access it.

My question is as follows:  can't referres be spoofed and wouldn't this make it trivial to circumvent this system?  What am I missing?

Referrers can be spoofed, but only by the user-agent.  Another website embedding an iframe with the API key wouldn't be able to control the referrer of its users.  So if your goal is to prevent sites from being able to clone API keys, then the referrer check will generally work.

Keep in mind that the referrer is not sent if going https -> http, and some users might have browsers set not to send the referrer.


Is my SMIME certificate secure? Lets take a random well-known Root CA. This CA allows me to sign my own certificate so that it is immediately trusted by others since they trust the root CA. The only thing, which the CA ever sees is my Certificate Signing Request (CSR), they never get to see my private key.

Assuming the CA gets compromised in the future, is my certificate still secure for encrypting emails to me? In my understanding yes, since the CA never saw my private key which I use to decrypt messages. The only thing which could be faked would be a signature, if I don't check that the signature matches the previous signature each time. And also assuming that the signature was not compromised from the beginning.

Is that assumption correct?

If you receive mails which are encrypted with your certificate than these mails are still safe against decryption by others since only you have the private key. This is also true for signatures you create with this certificate since in this case the private key is used for the signature so that other could verify the signature with the public key contained in the certificate.

But, if the attacker compromising the CA managed to get another certificate for your identity then he could try to claim that this is the real certificate (and not yours). This way the attacker can sign mails with your identity and also receive encrypted mails which are sent to you as long these use the attackers certificate. The attacker can also work as the man in the middle in this case, i.e. receive mails for you with but encrypted with the attackers certificate, modify the mail and re-encrypt it with your certificate and then forward it to you.


Using GPG or PGP, is there a way to give another user (or key) access to decrypt a file for a limited time only? I want to share encrypted files with someone else however it's only for a short time only.   What is the best way to do this?

More background: I'd like to add more people to be able to decrypt the file as time goes on and others "expire".    Think of this as when members of a team join and leave and that this constantly happens.

I think the easy and obvious solution is to encrypt for multiple recipients:

each party should create their own PGP key and provide you with
their public key
then you PGP-encrypt the files for all the parties that should be granted access
when you decide someone should no longer have access to future files you stop adding them to the list of 'recipients'

It is also possible to configure GnuPG so that you don't have to specify the recipients manually every time.
For this you add a line in your gpg.conf file with the encrypt-to directive followed by the key ID (one line per recipient).

Time-limited access is an oxymoron.


how to protect smartphone data against theft? i assume typical android has fully encrypted disk with a key stored in a header. header is encrypted using pin / pattern / fingerprint or not encrypted when there is no lock. is that correct?

when the phone is on, a thief can use the OS to access the data. pin and pattern accepting delay will be sufficient. also all the theft protection application might kick in in this scenario

but what happens when the thief turns off the phone and takes out the disk. he can run simple brute force. 4 or 6 digit pin, patter and probably a fingerprint is not a problem for the disk password bruteforce, right? are there any hardware level (NAND level?) protection mechanism? or the only thing that works would be a strong disk password?

if no, is there an option to set strong disk password and separate pin password / pattern / fingerprint for OS level protection? or is there any other way of keeping your data secure in case of a theft (android device)?

Docs here: Full Disk Encryption
Android 7 - 9 implements FDE with a 128-bit key. Of course, no pattern or PIN forms a 128-bit key. And every single device I saw required a PIN for disk encryption, so when you set up a pattern for the lock screen you were always required for a PIN.

Upon first boot, the device creates a randomly generated 128-bit master key and then hashes it with a default password and stored salt. The default password is: "default_password" However, the resultant hash is also signed through a TEE (such as TrustZone), which uses a hash of the signature to encrypt the master key.
You can find the default password defined in the Android Open Source Project cryptfs.cpp file.
When the user sets the PIN/pass or password on the device, only the 128-bit key is re-encrypted and stored. (ie. user PIN/pass/pattern changes do NOT cause re-encryption of userdata.) Note that managed device may be subject to PIN, pattern, or password restrictions.

A thief stealing your device has no chances to decrypt the storage medium with only the disk. Brute-forcing a 128 bit key is a no-go.
So, they would have to force the PIN. The protection is guaranteed by the hardware TEE (Trusted Execution Environment, a hardware crypto chip).
The TEE uses the PIN to form the real encryption key, but hides information within its state registers.
Given that a hardware attack to a crypto chip is infeasible, this prevents your attacker from guessing every reasonable 4-to-8-digits PIN, which don't form a 128-bit key (10^8 possible PINs, 2^128 > 10^30 possible keys).
Other protection at TEE's discretion are:

Attempt limit: the chip will self-destroy crypto data when too many attempts are perpetrated
Delay: the TEE adds a wait to the crypto functions so slow attacks down

In detail, you may want to read the "Storing the encrypted key" paragraph in the document already linked.
Demo
If you boot your device and you are presented with a black screen requesting for your PIN, that is the FDE boot prompt.
Modern Android 10 devices like my Pixel 3XL display the lock screen, because they use a different File-Based encryption and store the non-animated wallpaper as plain text, but require the PIN to decrypt the system. They basically changed the user experience.


What is the danger or downside of using online/cloud web app scanner vs on premise ones? Cloud scanners are becoming more common these days. Pricing is a lot cheaper than on premise scanners. My concern with cloud scanners is that they store sensitive information on 3rd party network. (I am not sure if the sensitive information only include scan result). Is there any other information cloud scanner may store besides scan result? I know when I was taking cyber law and compliance classes, I remember some of them(HIPPA, SOX, PCI) required different set of rules for transferring personal information to another site. Should I be concerned with this when using Cloud web application scanner whether it is SAST or DAST?
What are you experiences and thoughts on cloud scanners vs on premise ones?

I have used both. You will get different results with a cloud based scanner versus an on premise scanner.

Typically an on premise scanner would perform authenticated scans against your assets with no port restrictions, or hindrance from other security devices. This gives you a true snapshot of system vulnerabilities.

Cloud based scanners typically scan your externally facing assets, unauthenticated and must traverse the same infrastructure an attacker would. (IPS, WAF, firewall, etc) This gives you an idea of what an attacker would see.

They both paint a different picture of your network and are typically used in tandem, not in lieu of.

Now, with that being said, maybe you are allowing a cloud based scanner unadulterated access to your internal network which I personally would advise against.

Common information gathered by a vulnerability scanner:

Networks
IP addresses
MAC addresses
Operating systems
Installed applications
Hardware specifications
Open ports
Running services
Running processes
Shares
Users / Groups
Domain / Workgroup membership
Event logs
Registry keys
Any vulnerabilities found

There is a chance that some PII could be contained in scan results. For example, many scanners allow you to review the details of a finding.

  Checked for: (SSN Regex)
  Found: 112 25 0027


Generate Passphrase from the data & encrypted data right now I'm thinking about how to secure some data inside an Application... Now i have the following problem:

Is it possible to generate the passpharase from a decrypted message and the same message encrypted with AES and the passpharse?

Example:

The decrypted message is : "Hello"

The passpharse is: "you"

And the encrypted message is : "Eat7mV9cX/ncVOiFjdJwIcaE+UO5tt44Zk/kJeSDGyo=" (as base64 encoded)

This is called a "known plaintext attack" (not to be confused with a chosen plaintext attack).

There is a known plaintext attack called XSL which some people believe could work on AES, but it is important to point out that even if it did work, it would still take hundreds of trillions of years to break the encryption. (That counts as working in cryptographic terms because it's less than the thousands of trillions of years that brute force would take.)


What is Badlock and how does it work? A while back there was an announcement for the disclosure of a security vulnerability named "Badlock" - including this fancy name and a logo.

The disclosure date was today and I was surprised (and shocked) to read that the attack would allow an attacker to gain administrative privileges for an active directory controler.

How can an attacker gain administrator access by exploiting Badlock?, or formulated slightly differently: How does badlock work?

Bonus question: How could I mitigate it if there was no patch?

Badlock was massively overhyped and, it turns out, the  name has nothing at all to do with the vulnerability (it has nothing to do with bad locking, mutexes, or anything of the sort). It requires a man-in-the-middle attack to carry out, and allows an attacker to execute arbitrary Samba network calls using the context of the intercepted user. The attacker will gain read and write access to the SAM database and will have access to password hashes, which they can use to elevate privileges.

The vulnerability is CVE-2016-2118. According to its description page:

  The MS-SAMR and MS-LSAD protocol implementations in Samba 3.x and 4.x before 4.2.11, 4.3.x before 4.3.8, and 4.4.x before 4.4.2 mishandle DCERPC connections, which allows man-in-the-middle attackers to perform protocol-downgrade attacks and impersonate users by modifying the client-server data stream, aka "BADLOCK."


How to secure communication between server application and client mobile application through HSM We are planning to deploy HSM with our application.
The solution we are thinking is :

Mobile applications talks to server application,
Server application talks to HSM for authentications, encryption, decryption

Clients are mobile application(Android, J2ME etc.) which communicates with server application. Every transaction from mobile application to server and vice-versa have to secured through encryption.
Currently what we do is (without HSM), on client registration we generate a symmetric key and permanently store onto mobile device, server and then encrypted conversation goes on.

Now, we want to do employ session keys. No permanent symmetric key.
The flow we have thought for key generation and distributions:

On client registration, mobile app generates a public-private key pair and sends CSR(Certificate Request) to server
HSM through Server signs certificate with it's root private key, sends signed certificate and it's own certificate back to client. Here, we may consider storing public keys for each client in HSM.
On start of each session, client would be given a session key wrapped in it's public key. We would be storing session key temporary on HSM against each client for encryption decyption.

Is it looking fine ? Can anyone suggest what's standard for such kind of scenario?

I don't understand the advantage of using certificates here. I think one solution for your problem is to deliver your mobile app with the public key of your server. The client and server can then establish a session key as follows:

Client encrypts a random nonce with the server's public key.
The server can decrypt this nonce wih its private key.
Client and server can now derive a session key from the nonce.

Don't forget to use something like a MAC to ensure integrity of the ciphertexts. Without it an attacker could manipulate the ciphertext which could be decrypted to plausible plaintext.


What can an Android app without added permissions do? I've read on androidcentral that an application without added permissions can access /data/system/packages.list, /proc, and files on the SD card. The article is five years old so maybe something has changed.

So, on current versions of Android, which files and which functions can an app without additional permissions use?

Androids security model is such that each app runs in its own sandbox, and access to anything outside that sandbox is a permission that needs to be granted by the system.

There are a few categories of permissions, and those that fall into the "normal" category are allowed without user choice. An example is access to the internet.

Access that poses a risk to the user's system or user's privacy are not "normal" and are termed "dangerous" and have to be approved by the user.

https://www.kaspersky.com/blog/android-permissions-guide/14014/
https://developer.android.com/guide/topics/permissions/requesting.html


Primary Key as Salt? Is it okay to use the primary key as the salt in a Users table?

The only disadvantage that I can see is if the PK changes (unlikely), then the passwords break.

What are your thoughts?

I see no immediate problems with that approach. Especially if you use a per website salt in addition to a per user salt. So that your combined salt is complex enough. The main function of a salt in password hashing is preventing rainbow tables. And you don't need a highly random salt for that.

I still wouldn't do it that way, since using a random salt is standard practice. And inventing your own crypto is usually a bad idea, because it's easy to get wrong. So I'd simply follow the standard practice unless there is a really good reason not to.

IMO it's more important to use a KeyDerivationFunction with enough iterations to slow down brute-force attacks than to worry about the randomness of your salt. Having some salt is essential, but only one of the things you need.


Protective steps to prevent files sent through WhatsApp from installing malware I have been reading articles about exploits which allows someone to send an MP4, PDF or other file type through WhatsApp or other service, which self-executes to install malware without any user click or intervention.

I know some of these security holes were patched by WhatsApp recently but presumably other holes remain.

What steps can an average user to take to prevent this? For example, I can turn auto-download off.

Are there:

Any other phone or WhatsApp settings?
Scanning apps I can install which scan downloads for malware on Android?
Any other steps?

Your best option is simply to keep everything as up-to-date as possible.

Your example of choice is what is known as a 0-day exploit.  Of course once the software provider learns about it and fixes it, it is no longer an zero-day, and the solution is simple: upgrade your software to the latest (protected) version.  Before the software vendor learns about the exploit, it is quite possible that nothing can be done to stop yourself from being affected.  Walking through your suggested steps:

Auto Download: Turning off auto download won't help if a weakness allows an exploit to happen regardless of whether or not an attachment was downloaded
WhatsApp settings: This in particular won't get you very far, and there usually aren't any options for things like, "Make me more secure".  For instance browsers keep javascript sandboxed as much as possible to prevent malicious javascript from installing malware just from visiting the wrong site, but weaknesses in the sandbox (random example) can allow an attacker to do what they want anyway.  In the event of such a weakness, a user who is using a vulnerable software version can't do anything to protect themselves, and by definition the software is unable to offer options to make itself safer.
Malware scanners might help after-the-fact.  It is very unlikely to detect a zero-day being exploited, but for the most part the exploit is used to install an actual payload.  If the installed payload is something that the anti-virus recognizes, it may stop the exploit from becoming dangerous.  However, if the exploit is used to install newer malware, or if it takes actions more directly (it starts spamming itself to your contacts list), then malware may be completely useless.

This is not to say that you can't do anything.  In security, defense-in-depth is key.  As a result doing things like installing malware scanners or disabling automatic downloads can help and may stop some actual exploits from happening.  However, the particular example you picked out have often been the results of attackers exploiting zero-day vulnerabilities.  When that happens, there is often nothing to be done except wait for a patch to come out from the provider and update quickly.


What is the behaviour of CSP if default-src not specified? Basically all in the title.
Imagine a simple CSP like
Content-Security-Policy: script-src 'self'

What is the behaviour of directives that would normally fall back to default-src which are not specified such as img-src or frame-src? Will they default to open (allow everything) or default to closed (allow nothing)?
Unless I'm missing it, neither

the Mozilla CSP docs, and
content-security-policy.com

specify the behaviour if directives are missing.

If no CSP is specified for a directive, it falls back to default-src.
If there is no default-src CSP, it does not fall back on any directive and thus it allows everything.
I have searched the RFC about it and I could hardly find anything to quote that would push my statement. However, this is implied multiple times.

To enforce a policy, the user agent MUST parse the policy and enforce
each of the directives contained in the policy

default-src is a directive by itself. Thus, it WILL enforce default-src which actions is to set the default value for all others directive. If default-src the browser does not have to enforce any default restriction for other directives.


Conversant, CNAME, Cookies, and PCI complaince We have been asked to evaluate Conversant Tracking.

http://www.conversantmedia.com/solutions/enterprise-solutions

From what I can tell its pretty straight forward tracking, like google re-marketing, you pass them the information you want to via some javascript, and they target your visitors with targeted ads you have set up.

The main issue I have is they require us to point two cnames at their system to allow for "First Party Cookies".

I know this means all cookies would have to be changed to www.foobar.com, instead of foobar.com, to avoid any issues with information being possible exposed to their end.

But more I was wondering what type of attacks this could open us up to if they had a security issue, if this is more or less secure than google's re-marketings model, and what issues could this cause for us with PCI compliance?

PS We use Braintree and Braintree.js so we are just covered under PCI for handling of Tokens, if that matters at all.

Cookies that are used to maintain session state must have a limited scope.

Using JavaScript track users by their session id,  means you can't use the httpOnly cookie flag. Scoping cookies to *.foobar.com means that XSS on *.foobar.com could compromise this cookie value. Or to put this another way, if a session id is scoped to *.foobar.com and doesn't have the httpOnly flag, then every domain on *.foobar.com is permitted to compromise a session using XSS.  In the context of PCI compliance,  this specific design would greatly expand the attack surface that needs to be regularly validated.

One solution is to use another randomly generated token for the purposes of tracking users, and then protect the authenticated session id as a separate cookie value.


Public wifi security protocols I should apologize first- this post could seem a lot to ask for, but I am starting to go around in circles. I am interested in securing my laptop for when I use public wireless hotspots, as I am a business traveler and frequent airports a lot. I have to do a large amount of online banking, visiting secure https websites.

What steps can I take to secure my connection from my actual laptop? I have researched the following terms, but it's all starting to become a bit hazy:

WPA2, this works at the hardware level, but if the hotspot network doesn't provide it then I cannot choose to use it, WPA or WEP.
VPN This would allow me to make a tunnel from my machine to a VPN server (or proxy server?) on the internet, tunnel my traffic through without being read.
IPSec is this used to create a VPN?? I understand it works at the machine level, rather than application level (like SSL) so does this make it less secure? I presume only less secure from rootkits?
SSL is this used to create a VPN?? I also assume this is what implements "https"
TLS is this used to create a VPN?? I also assume this is what implements "https". I think I saw somewhere that TLS is the successor to SSL?
SSH, yet again, is this used to create a VPN?
DNSSEC part of my operating system (say on windows 7 or server 2008) which can help prevent DNS caching attacks?

So if I created a VPN, rented out a VPN server/proxy server outside the internet, used my VPN tunnelling (by which of the above protocols?) to connect to my VPN server and put my internet traffic through the public wifi, via this server, instead of the normal access point, I could get secure access? I think I also read you can create the VPN authentication using EAP, but a more recent upgrade to EAP, like EAP-TLS (is that the same as TLS referred to above??).

Have I missed anything out?

WPA2, this works at hardware level, but if the hotspot network doesn't provide it then I cannot choose to use it, WPA or WEP.

WPA2 is better encryption than WEP. WEP is trivial to crack -- not much more work than solving the "encryption" puzzle in the Sunday paper.

  VPN This would allow me to make a tunnel from my machine to a VPN server (or proxy server?) on the internet, tunnel my traffic through without being read.

Yes.

  IPSec is this used to create a VPN?? I understand it works at the machine level, rather than application level (like SSL) so does this make it less secure? I presume only less secure from rootkits?

IPsec could be used to create a VPN, but it's just one option.

  SSL is this used to create a VPN?? I also assume this is what implements "https"

SSL could be used to create a VPN, but it's just one option.

  TLS is this used to create a VPN?? I also assume this is what implements "https". I think I saw somewhere that TLS is the successor to SSL?

This is correct -- you can think of TLS as a "new and improved" SSL.

  SSH, yet again, is this used to create a VPN?

SSH could be used to create a VPN, but it's just one option.

  DNSSEC part of my operating system (say on windows 7 or server 2008) which can help prevent DNS caching attacks?

DNSSEC would help protect you from DNS attacks, but a lack of widespread deployment limits its usefulness.

  So if I created a VPN, rented out a VPN server/proxy server outside the internet, used my vpn tunnelling (by which of the above protocols?) to connect to my vpn server and put my internet traffic through the public wifi, via this server, instead of the normal access point, I could get secure access?

In my opinion, the easiest way to solve your problem would be to rent a VPS and run only an SSH server there. Connect to the server via SSH from your laptop then run a SOCKS 5 proxy over the SSH tunnel. After purchasing your wifi access, switch your browser's proxy to the local end of the tunnel, and your web traffic will be encrypted between your laptop and the VPS. (Keep in mind that if you are visiting http (not https), your traffic won't be encrypted after it leaves your VPS, but at the very least it's not sniffable on your local wifi.)

There may be "canned" services out there that offer this setup for people like you. (A quick search reveals, for example, Guardster -- though for $20/month you could get a VPS at Linode with 200GB of transfer and 20GB of storage.)


Does it have sense a One-Time Session Cookie? Recently I have faced a site that seems to implement something that we can call "one-time cookie". This cookie is used for single-sign on among different sites.

In each request the server sends a Set-Cookie that sets a new session cookie that is used by the browser in the next request... This mechanism is supposed to reduce the risk of cookie theft. I suppose that it does not protect the cookie theft completely because if you steal the cookie before the user uses it, you can use it one time and get the new set-cookie...but it is more difficult for an attacker to use it.

Does it have sense? It is a valid mechanism to avoid cookie theft?

There was a paper a few years ago called "One-Time cookies:Preventing Session Hijacking Attacks with Stateless Authentication Tokens," but that implementation used X-OTC HTTP extension headers and had a lot of crypto under the hood. What you are seeing sounds like something different, though.

https://smartech.gatech.edu/bitstream/handle/1853/42609/GT-CS-12-02.pdf?sequence=1


Should the Strict-Transport-Security max-age be tied to the duration of the certificate? I understand the principle of HSTS, and the fact that the choice of max-age limits how long a visitor could potentially be locked out if the site somehow lost its certificate and had to go back to HTTP-only for a while. When setting up HSTS, most sources recommend rather long max-age values -- on the order of 180 to 365 days. Some "SSL test" websites (Qualys, ImmuniWeb...) even go as far as to issue warnings about HSTS max-age being set to a value below 180 days.

Separately, while most paid certificates are issued for one year, certificates from LetsEncrypt are only valid for 90 days. Which leads me to my question: Is there any reason why the HSTS max-age should be set to match the certificate's validity period? (i.e. 90 day max-age for a 90 day LetsEncrypt certificate, and 365 days for a one-year ExpensiveCA certificate.)

It's two separate things. LetsEncrypt set their certificates to be short-lived because they expect their users to constantly renew them, short-lived certificates limit the exposure time of a lost private key.

Paid certificates are usually issued manually, and hence live a bit longer, for practical reasons (much harder to issue certs every 90 days when somebody has to click buttons and fill out forms).

HSTS on the other hand, was built to ensure that the browser 'remembers' the status of the site, and use HTTPs when accessing it. This has obvious security benefits, but also has a slight performance improvement as well -- the browser will itself perform a 307 redirect and not even attempt a plain-http requests. This saves the user one entire round-trip to the site.

However, the main benefit is obviously security. Once a user visits your legitimate site, and gets their HSTS set -- it's much harder for attackers to spoof your website against their browser, because now the spoofed sites needs a valid cert!

In short, you want to set your HSTS to be as long as possible to enjoy the security and performance benefits -- while you'll like to set your TLS certs to live as short as possible to reduce the threat of a lost key.

Given that, setting the HSTS to equal the max-age of your cert makes no sense at all. After all, even if your cert was set to 90 days, a client visiting your site on day 81, would have their HSTS set to 90 days -- even though your cert would expire 9 days later (hopefully you'll be renewing shortly!)

I understand some concern from folks around, "what would happen if I can't serve https anymore". This was my worry 5-6 years ago, when we started using HSTS, but now this is a very very small issue.

LetsEncrypt is totally free, and all webservers are very easily configurable for it. If you had a catastrophic failure on your website, the amount of time rebuilding it would be much larger than the small incremental step of adding https. If all else fails -- you can always just use Cloudflare or any other CDN to give you https as well.


Difference between OpenPGP symmetric encryption and AES-256? I would like to understand the difference between:
OpenPGP symmetric encryption
and
AES-256 using Winzip/7-zip?

I mean if you encrypt a file with an OpenPGP program like GnuPG, using AES-256 symmetric encryption. And do the same with Winzip/7-zip using AES-256. What is the difference?

[I am not asking about the asymmetric encryption in OpenPGP with public-private keys]

Thanks.

OpenPGP is a standard defining a message format. That message format is fairly complex, but in short, it contains:

Which algorithm it's using, if any
Any required parameters for that algorithm (e.g. nonces)
The (encrypted) message body
Some other metadata which isn't relevant here

OpenPGP is, notably, not an encryption algorithm. It can use encryption (and that's its whole raison d'être, so it normally does) but the algorithm it uses is variable.

AES-256, on the other hand, is a specific algorithm. It takes as input a secret key and a message, and it encrypts that key with that message.

AES-256 is one of the many encryption algorithms that the OpenPGP standard supports.

Encrypting something with AES-256 and the same key with OpenPGP is going to lead to the same ciphertext (encrypted text) as using any other software. However, there are two things to note:

Bad implementations of AES do exist, and can be exploited, depending on context. Bad usages also exist; for example, the AES mode can be any number of things -- ECB, CBC, GCM -- and picking the wrong one could break your security.
Because they're in different formats, the files produced by telling 7zip to encrypt a zipfile versus telling OpenPGP to encrypt a message will likely be different. However, this has nothing to do with their implementation of AES-256; as long as it's not broken, it'll still produce the same ciphertext. It's just represented differently.


What are the core differences between Airodump-ng, Wireshark, and TCPdump? As all three tools are packet sniffers, I would have expected them to give me the same results when I use them to monitor my home's network, but they don't. Therefore what are the core differences and which one is the best to use?

Airdump-ng is for capturing 802.11 frames, so you use this tool exclusively for wireless networks.

Wireshark and TCPdump are similar but Wireshark is more complex, also has a GUI. E.g. you can set many filters and perform more advanced analysis. TCPdump is more lightweight.

Which one is best to use is a broad question and is up to you, depending on what you need. You don't have to limit yourself to one if you think you need several different sniffers.


How to enable self signed certificates in Windows 10? I want to use a Yubikey 4 with Windows 10 Pro for Bitlocker and login with my TPM.

Unfortunately, I found out I need to enable self signed certificates and all the guides on the Internet I found were either outdated or simply didn't work.

Can someone help me out?

Better late than never:

Go to regeditor to the path: Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\FVE

Add SelfSignedCertificates as DWORD entry (if non exists).
Update the value to 1.

This will allow you to use SelfSignedCertificates with BitLocker.

Your certificate needs to meet the following requirements:
https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-7/dd875548(v=ws.10)

Or you can use a cert generated from the EFS wizzard and follow the following instructions:
https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-7/dd875530(v=ws.10)#sharing-an-efs-certificate-with-bitlocker


Why is the brute force search time for hashing algorithms 2^(num_bits / 2)? I noticed that the brute force times (the time it takes to find a message that hashes to a given hash) of various hashing algorithms seems to be 2^(num_bits / 2). For example, people say that brute forcing SHA1 (without using the vulnerability that reduces the brute force time to 2^69) is 2^80. In fact, if you look at this table, the "Security (bits)" column seems to always be half the number of bits, and I believe that's referring to the search time. How are they getting these numbers? I would think that to brute force a 160-bit hash, one would have to at least try 2^160 messages, or maybe 2^159 values on average to find a messages. I don't think the birthday attack is relevant here, as that seems to be about any collision, as opposed to a specific collision.

When a hash function has an output of size n bits, then:

The generic algorithm for finding a preimage (or a second preimage) has average cost 2n evaluations of the hash function.
The generic algorithm for finding a collision has average cost about 2n/2 evaluations of the hash function.

By "generic" we mean "the algorithm that works against every hash function, however perfect that function may be". In the case of preimages and second preimages, the generic algorithm is also known as "luck" (we try input messages until we get lucky). For collisions, there are various smart algorithms that are all facets of the so-called birthday paradox. I wrote "about" because these smart algorithms also incur some RAM cost or some limitations on parallelism, so the actual cost of finding a collision cannot really be expressed as a single number; or, if you prefer, the mathematical cost does not translates exactly to a proportionate number of dollars, if you really want to do the computation.

Various protocols use hash functions for various reasons. It is hard to ascertain whether a given protocol is immune to collisions, or not. In some cases, an actual attack may require a preimage computation; or maybe a collision is enough; or the situation could be more complex. So, just to be safe, we usually assume the worst and thus look at the lowest resistance. Therefore, we rate a hash function with a 160-bit output to be of strength "80 bits" (or 280). We know that we may be overly conservative here; be we cannot be sure.


How are spammers using LinkedIn "http://linkedin.com/slink?code=..." URLs? I was sent this kind of link from presumably compromised Skype account, via a skype message (do not click unless you have a sandbox or something to protect you):

https://www.linkedin.com/slink?code=e4ig_yU#56287=myskypeusername

Where the myskypeusername is, well yes, my skype user name.

Clicking that, the URL would take you through a series of redirects and finally to a page selling some "miracle Brain IQ pills" claiming to boost, double, whatever one's mental capabilities... so clearly SPAM.

Does anyone know what the /slink... etc. URLs are used by LinkedIn? Google brought up nothing, except a few other cases where LinkedIn has been used to redirect users to SPAM.

I contacted LinkedIn about this and their "Safety support specialist" basically said they cannot do anything about it given it's not a message sent by linkedin user... go figure.

UPDATE: After I reiterated the problem to LinkedIn support, I got back the following:

  Thank you for your response.   We will look into this issue further
  and take necessary action based on our results.   Thanks for your
  assistance in keeping LinkedIn a professional and trustworthy site.

Hopefully that's more than just words; we'll see I guess.

So I just stumbled upon this today and got a similar message:

https://www.linkedin.com/slink?code=eiurEkp?61778=myname

First I tried the first part:
https://www.linkedin.com/slink?code=eiurEkp

This ends here: http://281-inteligen.thiscontentedmotion.com/de/ihel/inteligen/
- a scammy article about somebody saying that someone said that this pill will just change the whole world......
But well, it looks like a normal news-paper website and the source-code actually looks semantically clean.

So if linkedin might check the destination's source-code it would be okay in this case and to this point.

But when entering: https://www.linkedin.com/slink?code=eiurEkp?61778 (with the second search-param) - it seems by reading over there obfuscated JavaScripts, that they check for search/hash-params in the URL and redirect properly if found.

And this is probably not being checked by the linkedin-team. I mean how should they? This is hard because it is happening in an obfuscated JS. If they have some automated slink-checker they are scanning the code but likely don't execute the scripts.

Long story short: The slink?code=####### part redirects to a shared link from linkedin and appends any given hash or search parameter to this redirect. On the redirected destination this is then checked and used for a further redirect.


Do systemd-nspawn containers provide the same security guarantees as FreeBSD jails? I am evaluating the systemd-nspawn containers security and would like to know if the systemd-nspawn containers provide the same security guarantees as FreeBSD jails?

Specially, can an attacker escape from the container or manipulate the host?

Systemd-nspawn only manages isolated processes. It cannot isolate resources (which systemd can).

As a constructive difference, in the case of namespaces, you start with no isolation and you add whatever you require — mounts, PIDs, networks, users, etc.
In the case of jails, you start with a reasonable secure baseline since the processes, IPCs, mounts and users are always isolated.
That does not mean you can't get to the same level of security.

We can create a fully isolated environment, which will automatically monitor the /proc and /sys pseudo-file systems and create an isolated loop-back interface and separate name space for PIDs. From there we can run what we want.

To limit the isolation problem we can use systemctl:

systemctl set-property  CPUShares=80 CPUQuota=25% MemoryLimit=1024M

So to conclude, by default you don't have the same level of security but you can get to the same level. Nspawn will probably also evolve a lot more in the near future.