GnuPG / OpenPGP: How to eliminate redundancy in PGP private key? I examined a few randomly generated private keys generated by Gnu PG, and found a lot of redundancy.

It is enclosed by -----BEGIN PGP PRIVATE KEY BLOCK----- and -----END PGP PRIVATE KEY BLOCK-----
There is a CRC checksum at the end (e.g., =WXYZ)
All RSA keys that I generated start with "lQ"

I tried removing the checksum and the importing works. Also, removing the BEGIN/END markers and the common "lQ" prefix seems reversible. I am wondering how much further can I go to make the key less redundant and more obfuscated?

My main security concern is:

If the attacker steals the encrypted private key, he can (more) quickly and easily verify that the decryption succeeded (in the case above, by verifying it begins with "lQ" and that the checksum is right).

Note: I used the gpg -a --export-secret-key, but it looks the non-ASCII encodeded key (no -a) has pretty much the same redundancy (I verified this using a hex editor).

Is there a specification / standard that specifies which parts of the private keys are "truly secret", and which one serve as a descriptor, checksum and can be safely removed (provided that I trust trust the key is unmodified)?

OpenPGP is defined in RFC 4880, which probably is the specification you're looking for. OpenPGP files (no matter whether binary or ASCII-armored) are composed of individual packets, each having a header (that is probably what you have been observing regarding the "IQ").

In an OpenPGP secret key packet, quite a lot of meta data is stored. As it also contains the public key, expect the user ID packets to be included - if these are the same, there will be more redundancy.

For working out the parts not specific to RSA keys of given size, better work with binary files instead of ASCII-armored ones (you're closer to the values given in the specifications). Very helpful at dissecting OpenPGP files will be gpg --list-packets, which dumps the contents of each packet in a more human-readable version, but also gives you packet identifiers and similar data you can look for in a hex editor.


Design differences of tails and whonix concerning virtualization Tails and Whonix both can run in VirtualBox. Tails doesn't recommends it for security reasons (https://tails.boum.org/doc/advanced_topics/virtualization/index.en.html), for Whonix it seems to be a standard mode of operation.

What are the design differences which makes Whonix more secure to use it together with VirtualBox in comparison to Tails?

See also:

https://www.whonix.org/wiki/Comparison_with_Others

Different threat models.

Whonix (needs to) assumes, that the host is safe. (Tails needs to assume this as well to some degree, because I suppose, many users are downloading and burning/installing Tails using their host, where malware could interfere.)

Tails is more focusing on being amnesic. Whonix is more concerned about misbehaving applications and leaks. Therefore Whonix is not amnesic. While there is no substitute for Whonix's lack of an amnesic feature, full disk encryption is recommended. Each project made a trade-off. (It would be nice to combine both, but we're not there development wise.)

Full disclosure:
I am a maintainer of Whonix.


How to exploit CSRF using HTML form to save data? So I found a CSRF vulnerability on a website. The website is sending GET request to get user data and there is no protection. So using HTML I can get the data from the website if the user is logged in, but I can't save it to my website.

I can't use javascript XHR because of CORS. So is there any way to save the vulnerable website's json response through a HTML form in a separate file on my computer?

HTML code which just shows user data:

<html>
  <body>
    <form id="myform" enctype='text/html' action="https://example.com/v3/user" method="GET"
    </form>
    <script>
      document.forms[0].submit();
    </script>
  </body>
</html>

When exploiting a CSRF vulnerability, you are changing the state of the server (i.e. writing). You are not stealing data (i.e. reading). The browsers same origin policy (SOP) is preventing you from reading the HTTP response.

It sounds like you found an endpoint with no CSRF protection, but all it does is returning sensitive data without changing the state of the server (like adding a user, deleting a record or whatever). That is not exploitable with CSRF.

You are talking about saving data in a file on your computer. An CSRF attack is executed on the victims computer. If you are somehow reading data and sending it to your computer, it's not a CSRF attack. CSRF may be part of it, but there must be something more going on.

I recommend you read up on CSRF attacks. Here is a good article.


Is there a risk associated with to many entries in your SAN list? Is there any risk associated with having lots of websites in your SAN list? For instance:

Or is this common among website hosts, and possibly safe?

The risk is that all those websites share a public key and private key. That means that any of those sites could impersonate / man-in-the-middle another and you would still get the HTTPS padlock. For example, you could be browsing newrepublic.com, but if somehow your traffic was actually going to robertwalters.cn, your browser would have no way to tell.

That said, it's becoming quite common for companies that host more than one site to put them all on the same certificate. This saves costs; both the costs of purchasing the certificate from a Certificate Authority, and also annoyance of each cert expiring and needing to be renewed at a different time.

This is getting even more common with massive hosting providers like CloudFlare who host (or at least provide front-end services) for thousands (millions?) of websites. In these setups, your the HTTPS connection is between your browser and the CloudFlare front-end, and your traffic flows through CloudFlare's backend unencrypted. Since CloudFlare has the private keys for every website it fronts, does it really matter if they're all on the same cert?

Really what that tells you is that those sites are all hosted by the same provider. I don't think there's anything to worry about here.


Is it a security risk that browsers can freely get images (and/or other resources) cross-domain? Same origin policy protects us from malicious site manipulating the data on our trusted site by not allowing requests that would send the auth cookie e.g. But if I understand correctly images, scripts, etc. are an exception from that rule.

See e.g. here:

  A web page may freely embed images, stylesheets, scripts, iframes,
  videos.Certain "cross-domain" requests, notably AJAX requests,
  however are forbidden by default by the same-origin security policy.

Does that mean that if I have a "secret image" on Facebook (or any other resource with cookie session auth) any malicious site that I accidentally visit will be able to load that image in a hidden  tag e.g. and read it? They should definitely know the url, but for many sites it can be as easy as guessing ids (or enumerating them 1,2,3...).

This does not sound any secure to me. Am I missing a point here? Seems that auto-sending of cookies for all requests and cookies in general is just evil for security (not for the ads though that are hugely based on this "nice" feature if I remember correctly).

It should be even worse for iframe (if you can embed and read data from a bank iframe e.g.), so it has to be protected somehow.

Does that mean that if I have a "secret image" on Facebook (or any other resource with cookie session auth) any malicious site that I accidentally visit will be able to load that image in a hidden tag e.g. and read it?

You are correct until the last two words. Yes, any site you visit can load the secret image into your browser. But it can not read it (unless e.g. Facebook have a CORS policy allowing it).

To read the pixel values from an image with JavaScript you would need to do something like loading it into a canvas and then using getImageData() or similar. However, when you load a cross origin image into a canvas the canvas gets "tainted", and those functions are blocked. This is to prevent the kind of risk you are talking about. (Read more about it on Mozilla.)

So all the malicious site can do is load the image into your browser where only you, not them, see it. And thats not very useful.

There are similar protections in place for e.g. iframes. While evil.com can display bank.com in an iframe, JavaScript loaded by evil.com can not read any data from inside the iframe. So all the attackers can do is display your account balance to you. And that is what the SOP is all about.


Would it be plausible to write your own anti-crypto-ransomware tool? Question

After reading about how basic ransomware targets and encrypts your files. I was wondering if it would be plausible to write your own script to try and detect such activities?

Initial Research Effort

I have looked at different ideas people had previously on this site:

Denying Write Access: Is denying write access an effective way to stop ransomware?
Suggestions how to avoid effectiveness of ransomware: How to avoid ransomware

I know of one tool that already advertises to do something like this, but I would assume the attackers already took note of that tool and will try to circumvent it. Maybe they also would just assume that the average user won't actually install this sort-of thing and the < 10% that did are irrelevant to the attackers.

Assumptions

In either case, from my understanding (and please correct me where I am wrong) the most widely spread crypto - ransomware actually:

runs with user privileges
accesses a limited set of the user's files (defined by file extension)
creates many new files under a new name (either new extension or completely encrypted)
deletes the original files properly (I assume they would overwrite the original memory to avoid people just using a simple file restore tool?)

Back to a more specific Question

Under these considerations, it appears entirely plausible for me to write a script that can monitor my most important files and locations. And to make my question more specific:

Is it true that many widespread crypto-ransomware (e.g. TeslaCrypt) work under those given assumptions (above)? And if there are actually more elusive tactics employed, would they easily avoid detection if my own monitoring script relies on standard file-access monitoring?

Side Notes in regards to what I would assume the anti-crypto-tool would be doing:

The tool could even be combined with a honeypot approach to get immediate alerts and kill processes that try to change anything in a specific set of files that look like normal personal documents.

I am aware that the recommendation is not to write your own crypto software, but I am looking for advice if you would encourage people to write anti-ransomware software to at least try to create another layer of security.

I am also aware that backups are more important in this case. I am not thinking of replacing backups with my own homegrown script and I am also aware that testing will be difficult.

The question is more directed at why there are not already more anti-crypto-ransomware tools, given that their approach could actually be detected with some basic file-monitoring. Maybe my assumption is wrong in this and I would love to hear from you why that is.

Why there are not already more anti-crypto-ransomware tools?

Because there are. They are called virus scanners and they should have heuristic algorithms to detect this behavior. Unfortunately the ransomware-developers are smart enough to test their creations against all commonly used virus scanners and make sure they circumvent their heuristics somehow.

And before you start writing your own solution hoping it is somehow not covered by all the evasion tactics used by this kind of malware, setting up a backup solution is usually far easier and protects you from far more problems than just ransomware.


Letsencrypt does not work on Android I have a digitalocean server (ubuntu 16.4 nginx) + serverpilot I installed letsencrypt Following the site tutorial: https: //www.robertwent.com/blog/using-letsencrypt-serverpilot/
Everything worked out, the result was this: https://testelcon2.tk
The problem: The site works with ssl installed on all desktop browsers However, in mobile android browsers it does not work. The error message I receive is a red padlock and the message: NET: ERR_CERT_DATE_INVALID
I tested other sites I found on the internet to see if the problem was only with my site, and they all work normally in my mobile browser (Chrome, Safari and native browser)
I am 4 days trying to solve this problem, but without success. What could be happening? What did I do wrong? Can someone check for me?
My android version: 5.1.1 (Samsung J2)
Test results

https://www.ssllabs.com/ssltest/analyze.html?d=testelcon2.tk
https://www.sslshopper.com/ssl-checker.html#hostname=https://testelcon2.tk
https://sslping.com/testelcon2.tk

Bad time on phone

Short answer: just fix the time on your phone.

Long answer: see below.

I'm only guessing here. But this is what can happen with very fresh (just issued) certs: they can be out of validity.
But not in the way that you usually encounter in the wild, namely: EXPIRED certs but the other way round: NOT YET VALID certs.
And since you say that other sites worked just fine, then I'm guessing that this is what happened on your phone: according to the phone's clock that cert was not valid yet.
BUT: since you said the clock was not a full day off target and some time has passed: try again. If my guess was correct, then it should work now.
As an aside: cert issuers are are aware of this issue and sometimes BACKDATE the validity date to work around this issue.
Let's Encrypt seems to backdate by one hour. See:

https://community.letsencrypt.org/t/time-zone-considerations-needed-for-certificates/23130
https://community.letsencrypt.org/t/ability-to-generate-a-certificate-with-a-valid-from-date-in-the-past/37847


What are the security implications of an out-of-support Java runtime? What are the potential security implications of leaving the January 2019 version of Oracle's Java 8 runtime installed indefinitely?

For context, we have the Oracle Java 8 runtime widely deployed, but after January, updates will only be available to home users or via a commercial contract, at prices we can't afford.  This is in an academic setting, and due to the sheer number of Windows applications (ten thousand plus) any of which might have a known or unknown dependency on Java, moving to an alternative distribution like the AdoptOpenJDK runtime is going to be challenging and seems unlikely to be completed any time soon.

In order to help us prioritize, I'd like to get some idea of what sort of risks we're actually facing here, and of what steps we might take to mitigate them.

My research so far suggests:

Java Applets are now disabled on Firefox and Chrome, and we should be able to use group policy or other tools to disable them on Internet Explorer as well.  (Are applet-based attacks at all common to begin with?  Or are they likely to become more common next year?)
Browsers won't launch Java Web Start applications without the user's explicit permission, so even if the sandbox is broken by a newly discovered vulnerability, this is no more dangerous than a user downloading and running a conventional application.
Desktop Java applications, e.g., .jar files, aren't sandboxed anyway, so security vulnerabilities in the runtime shouldn't matter unless they result in vulnerabilities in the application.  That means we'll have to do something about the (relatively small) number of machines we have running Tomcat, but that should run perfectly well on any Java distribution, and most other Java applications shouldn't be directly exposed to attack.

So on the whole the situation doesn't actually seem quite as bad as it first sounded.  But perhaps I'm overlooking something?  What other risks are we facing?

Risk management is about making sense of a $ investment to protect from losing more money. Applet based attacks happen, but are becoming less and less common. That being said, if your organization is targetted, they may opt to use these attacks simply because they may know that you are still using this version.

Aside from that, your assessment is pretty accurate. For prioritising I personally would probably try identifying applications that are dependant on your outdated Java Runtime but run with different privileges (e.g. more elevated privileges) or are network connected. These applications would probably be more exposed and interesting to an attacker to abuse.

Also I would actively monitor if there are any vulnerabilities being published for the JRE8 in the meanwhile.


Explicit vs transparent proxy As far as I have understood it:

An explicit proxy challenges the user/application within his session.
NGFW (transparent proxy) and SSO/identity-based solutions are just letting everything pass that is using the current IP address of the user.

I agree the latter is flexible with regard to roaming users (VPN, Wifi and whatnot) but IMHO similar to machine/IP-based  authentication, i.e. a step back from actually challenging the individual application for access. (Note: if you use a captive portal, non-interactive apps will have a hard time authenticating.)
The transparent proxy would let all traffic from your machine go directly to the URL filter, including the potential malware. Whereas in the explicit scenario the malware would need to obtain the user's credentials, parse the PAC file or somehow else determine the location of the proxy to use etc. Might be considered security through obscurity, still more hurdles can't hurt...
Additionally, a transparent proxy would require recursive DNS access to the Internet, meaning DNS security would need to be implemented. Whereas when using an explicit proxy, the client needs no DNS access at all, the proxy itself would perform a DNS request once the URL filtering/categorization or any other mechanism has allowed access.
Somehow I fail to see where transparent approach would provide more security than explicit.
The more modern approach (NGFW/transparent) seem to rely more and more on blacklisting and heuristics, while we learned that actual security only comes from denying everything that we do not know i.e. whitelisting. I agree that this is difficult in today's Internet though.
So which one is more secure, transparent or explicit, or does it only depend on the individual definition of security/risk?

Somehow I fail to see where transparent approach would provide more security than explicit.

It doesn't, in contrary. It is just more convenient to enroll since clients do not need to be configured explicitly. Security is usually a trade-off and the additional risks might be acceptable when gaining better usability.
From the security perspective an explicit proxy is the preferred solution since it is independent of the actual target port (NGFW needs to use DPI based heuristics here) and has no problems with multiple users on the same IP address (i.e. NAT, terminal server, ...). Additionally an explicit proxy bases its security decision on the proxy request, i.e. the URL (HTTP) or domain name (HTTPS) given there. And it is the proxy who determines the IP address of the target based on the requested domain name.
Contrary to this with a transparent proxy the client determines the target IP address1 and the transparent proxy passes the connection establishment through before being able to apply security checks based on the domain or URL. This can be used to bypass policies by simply claiming to connect to a whitelisted domain in HTTP Host header and TLS ClientHello SNI, while the actual IP address connected to is for example some C2 server.

The more modern approach (NGFW/transparent) seem to rely more and more on blacklisting and heuristics, while we learned that actual security only comes from denying everything that we do not know i.e. whitelisting.

This is not really a difference between explicit and implicit proxies, i.e. the policies they apply can be the same. Apart from very restrictive setups both usually rely on blacklisting and pass though most traffic. The target hostname lacks reliability though in case of the transparent proxy since the IP address is resolved by the client1 and not by the proxy. And lack of reliable input into a policy means that the policy decision will also lack reliability.

1 As Mike Ounsworth pointed out in his answer this can be avoided if the DNS server is in control by the company too and simply returns the IP address of the proxy. This isn't though how most installations are set up.


How does storing hash passwords work? In usual network applications, that employ password hashing, is the user password hashed on client side before sending it to the server, or is it sent without hashing as encryption of plain text password to the server?

The main question that I have is if an attacker discovers the hashed passwords then why can't they just send hash to the server to authenticate in case of client side hashing?

At least part of the hashing must occur server-side. Indeed, whatever the client sends to the server grants access, so if that very same value is just stored as-is on the server, then you have the same issues as plaintext password storage, namely that a single read-only glimpse at your server database gives all the accesses.

In most cases all the hashing is done on the server, because the client is a Web browser than can, at best, do some Javascript, and Javascript is not very good at cryptographic tasks. The client sends the password itself (through HTTPS of course), and the server computes the hash, and compares it with the stored hash value. The attacker cannot simply "pass the hash"; he must send a value that, when hashed by the server, yields the stored hash value.

If the clients are good at making crypto (e.g. a heavy native client for a game), then the bulk of the hashing process can be done on the client side, but there still needs to be a final hash computation done on the server.


Does Time-based One Time Password improves security in case of database leak? From what I understand, Time-based One Time Passwords used a seed and a mathematical algorithm to generate unique passwords. As the seed is known by the user (or the device used by the user), and the authentication server.
However, this means that if the database is leaked, the seed will be known by the attacker.

As with a database leak, an attacker can know both the password and the OTP, does Time-based One Time Password improves security in case of database leak? Or is the goal of OTP only to prevent an attacker to authenticate when he knows the password by another way (another database leak, social engineering...)?

Actually, password is what is supposed to protect the user in case your database leaks. If you hash and salt properly, the attacker should not be able to obtain plaintext version of the password (with reasonable password in reasonable time with reasonable resources, if an attacker such as the NSA is after you, don't rely on this. Also, if you know your database leaked or could have leaked, force users to change password to be sure). Your app should not accept the hash as a valid password. So the attacker should not be able to log in even if database is leaked. Note: If you want to hash on client side, check schemes such as SCRAM-SHA256 to protect form this kind of attack.

TOTP on the other hand protects from user password being leaked by the user, or otherwise obtained (brute-force, interception, keylogger) without compromising server.

If you want additional protection in case server is compromised AND password is obtained (for example attacker intercepts login requests and get the password that way), consider either using something like SCRAM to limit the password exposure to the server, or using public-private key pair for login, possibly with hardware token using U2F.


Some questions about penetration testing distribution Backtrack 5 I know just the basics of backtrack and I want to ask some questions about it:

Can you attack an ftp server using backtrack? an email server?
I have a Centos virtual private server and backtrack is on my PC, Can I change the IP-address of backtrack to my VPS IP-address and do phishing using my VPS IP-address?
Can I do brute force attack to crack email passwords using backtrack?

Learning and experimentation is good, everyone started somewhere.  There is a lot of information out there.  If you are interested in the functionality of BackTrack then I would suggest hanging out in their community forums.  They have a lot of tips and tricks.  Just like with a carpenter, they have to know their tools and material.  Be as it may - a hammer and wood respectively.  If you want to be good at Red Team stuff, or infosec in general, you need to understand your tools and understand what you are attacking.  You need to study up on networking in general and it sounds like wireless networking principles specifically.

  1-can you attack an ftp server using backtrack? an email server?

Yes it has the tools to facilitate an attack against both of those types of targets

  2-i have a centos vps and backtrack is on my pc, can i change the ip address of backtrack to my vps ip and do phishing using my vps ip?

A semi-complex question, the short answer is it is probably not going to work the way you've pictured it in your mind.  Again you'll want to visit that networking stuff.

  3-can i do brute force attack to crack email passwords using backtrack?

Yes there are a couple of different types of tools included that can help with this depending on your vector, generally the more access you have the more possible the chances are of a successful outcome.

All in all "there is no royal road to information security," you gotta put in the time and effort.  All that technical stuff is one thing, remember to not forget about the weakest link in the entire chain are the people on the keyboards.


Other computers/customers of my Internet Service Provider appears under my "Network" section in Windows Explorer I could see many computers under "Network" section on the left sidebar of Windows Explorer, but I am the only one who uses computer on my home.

So I suppose all those computers are also using the same Internet Service Provider as me, and we're both inside the same "local" network or so.

The network setup on my home is simple, just my computer connected to a Wifi Router, then to a fibre optic router/modem.

I don't know if this is a security issue, but my feeling is that this is not a normal thing to happen.
So, is this a serious issue?

One obvious way this could happen is if your WiFi is not very secure, and a lot of neighbors are using it. That's probably not the case - this is a very large list of local devices for that, and people often set a network they don't control as using the "public" firewall profile (it's the default, in fact), which (by default) turns off Windows Networking (SMB) including discovery.

The other way this can happen is if your home is sharing a subnet with a lot of other computers, probably from other nearby homes. This can definitely happen in apartments or condominiums, where there might only be one line into the building and then all the residents are on a subnet behind a router using network address translation (NAT). It could also happen with an ISP putting a lot of customers behind a NAT to avoid needing too many external IP addresses. It's odd that your WiFi router wouldn't create its own subnet that makes it impossible to directly address the other computers, but depending on how it's configured that's certainly possible.

Security-wise, you're probably OK as long as you have a really good password on your machine and don't open your firewall for programs that don't need it (or that have known vulnerabilities). However, it's definitely not ideal. If you're sharing a subnet with computers you don't recognize, they could be doing things like ARP spoofing (which would cause all of your network traffic to travel through their computer, allowing them to read and even tamper with all unsecured traffic) or DNS poisoning (which would cause your computer to think that a domain name maps to a hostile machine). The attacker could also just be doing things like trying to brute-force your password (for Windows networking, remote desktop, SSH if you have it enabled, etc.) even if it's not possible to reach those services from the Internet.

I'd recommend first of all figuring out why those computers are reachable - are the on the same WiFi as you, or on the same subnet anyway, or what - and removing them if possible (set a good WiFi password, etc.). I'd also consider changing the network profile in Windows to "public"; it'll block a bunch of stuff that is considered unsafe to expose to potentially-hostile networks.


How to decrypt Chrome saved password from "Login Data" file Is there a way to decrypt passwords from Chrome Login Data file?

My goal is learning about the backend process of this decryption, so I don't want to use any pre-built applications.

Google Chrome uses the operating system's API to encrypt passwords. In windows the called function is CryptProtectData.

There are several tools for decrypting Chrome passwords, but generally they involve being logged in as the user who saved them. If instead you want to proceed from scratch, I suggest you study the Microsoft documentation on the encryption function.


How do HTML5 DRM addons protect their output? HTML5 has a DRM framework Encrypted Media Extensions (EME), that allows DRM companies to create content decryption modules (CDM) to decrypt DRM protected content. Browsers should use a sandbox to run the CDM, so that security holes that allow access to the computer are not as dangerous as it was when Flash was used for DRM. Furthermore it is a plugin concept, that allows more companies to provide modules for different forms of DRM, so that competition is enabled.

But when there is a standardized API for modules and the modules themself run in a sandbox (and thus have limited ability to modify the system to protect themself), how can they protect the output stream? The site sends encrypted data, that goes into the CDM, and then the CDM plays a video using a standard API inside the browser. How does the CDM avoid, that I patch the API to dump the stream to the disk instead of playing the video?

For example the widevine CDM provided by Google seems to link against ffmpeg. What would happen, when somebody starts grabbing the data that goes into the decoder in the ffmpeg library? Then the attacker could store the video stream (probably some MP4 format). Another option would be to grab the output of the decoder and save raw video data.

How does the CDM protect its output?

I am aware, that Netflix in Full HD does not use this mechanism, but relies on a trusted media path, thus requiring Windows 10 (I guess booted with secure boot), a recent Intel processor and a HDCP capable monitor, so the trust chain is never broken. But most other DRM video uses EME with one of the common CDMs.

When the addon itself is not responsible to protect the output, how do real world addons make sure, that the browser protects their output?
As far as I know, addons like widevine run in open source builds of Firefox (i.e. they do not restrict themself to binaries provided by Mozilla), but there are no large leaks of DRM protected movies.

For example I would expect a lot more ripped Netflix movies when anyone could run the CDM in a patched browser and then extract the decrypted media stream.
In consequence, Netflix would never have adopted the standard, if the output of the CDM could just be extracted using the EME API.

According to my reading of the specification, this is not a problem that Encrypted Media Extensions are designed to deal with. Once it is verified that your User Agent is allowed to access the media and the media is decrypted, the CDM doesn't care about it anymore. It is then up to the User Agent to handle media protection from there (such as with the Windows Protected Media Path you mentioned).


Diffie-Hellman and MIM attack, and server identity Diffie-Hellman and MIM attack:
When variants of Diffie-Hellman algorithms like DHE, ECDHE etc. are used in SSL handshake for key exchange then can it become prone to man in middle (MIM) attack.

Suppose, SSL handshake has started and now it is time of key exchange, so client computes its public key part of DH and sends it, now bad guy sitting in the middle intercepts it and computes its public key part of DH and sends it. And then both computes the shared secret from each other's public key and shared secret is established. Now even though the traffic is encrypted using the shared secret but since the bad guy did all this, so he will be able to decrypt it. No?

In case of RSA, since anything encrypted using public key can only be decrypted using private key so it is safe. I am sure about this, but with DH I am getting above doubt.

Server identity:
Suppose cipher is TLS_ECDHE_RSA..... Now, as I understand ECDHE is for key exchange and RSA is to prove server identity or authentication. But how RSA is used to prove the server identity or authentication because it is done with digital signature, right? Client will see the server's DC is signed by a trusted CA and he will identify and trust the server. Then how "_RSA" or "ECDSA" part of cipher suite comes into picture to prove server's identity or for authentication?

I have read a lot of algorithm explanation for key exchange thing but never about server's identity or for authentication from "_RSA" or "ECDSA" part of cipher suite.

Diffie-Hellman and MIM attack:
  When variants of Diffie-Hellman algorithms like DHE, ECDHE etc. are used in SSL handshake for key exchange then can it become prone to man in middle (MIM) attack.

  Suppose, SSL handshake has started and now it is time of key exchange, so client computes its public key part of DH and sends it, now bad guy sitting in the middle intercepts it and computes its public key part of DH and sends it. And then both computes the shared secret from each other's public key and shared secret is established. Now even though the traffic is encrypted using the shared secret but since the bad guy did all this, so he will be able to decrypt it. No?

  In case of RSA, since anything encrypted using public key can only be decrypted using private key so it is safe. I am sure about this, but with DH I am getting above doubt.

It seems you are describing something like the scenario below (source):

Notice that the man in the middle replaces the certificate and public key for the legitimate domain with their own cert and public key before DH parameters are exchanged. The MITM then uses their public key to sign the DH parameters. Now what should happen is that as soon as the client receives the cert it should check that the cert is issued for the domain it thinks it is connecting to (Server S). When it is presented with a cert for a different domain from the MITM (Server A) it should reject that cert and not proceed with key exchange. In a more concrete example, consider a client wants to connect to https://www.google.com and instead of getting a cert for the domain google.com it gets a cert for the domain evil.com (signed by a trusted CA). Obviously the client should not interpret this cert as being valid.

  Server identity:
  Suppose cipher is TLS_ECDHE_RSA..... Now, as I understand ECDHE is for key exchange and RSA is to prove server identity or authentication. But how RSA is used to prove the server identity or authentication because it is done with digital signature, right? Client will see the server's DC is signed by a trusted CA and he will identify and trust the server. Then how "_RSA" or "ECDCA" part of cipher suite comes into picture to prove server's identity or for authentication?

  I have read a lot of algorithm explanation for key exchange thing but never about server's identity or for authentication from "_RSA" or "ECDCA" part of cipher suite.

Yes, the cert that the MITM presents may well be valid and signed by a trusted CA, but the MITM cannot get a certificate for Server S.

Note that there have been cases where the domain in the cert is not checked against the domain being connected to (such was the case in the Chase mobile app for a while!), you can read about such cases in this paper, but this is an implementation issue, properly implemented TLS does not allow this scenario.


Is OpenDNS safe to use? Anyone know anything about OpenDNS? Is it safe to use, or should it be avoided? If it should be avoided, what are the alternatives?

I am basically looking for a way to block certain sites from my home network, but at the same time, I don't want to use a service which isn't safe interms of privacy and freedom.

In my opinion, it's perfectly fine to use, and probably a very good option for a home user. Perhaps you should elaborate on your specific concerns?

I think it's OK because it seems well resourced (due to its business success), and has otherwise signaled "good" intentions. By virtue of its size, it is well placed to protect against malicious websites.

From Wikipedia:

  OpenDNS is a company and service which extends the Domain Name System
  (DNS) by adding features such as misspelling correction, phishing
  protection, and optional content filtering. It provides an
  ad-supported service "showing relevant ads when we [show] search
  results" and a paid advertisement-free service.

  The company’s Umbrella cloud-delivered security service secures
  enterprise users from malware, botnets and phishing on PCs, laptops,
  and tablets. The OpenDNS Global Network processes ~50 billion DNS
  queries daily from 50 million active users connected to the service
  through 20 data centers worldwide.

This does mean that you have to trust OpenDNS not to do bad things - because they will see all your DNS requests, they can tell what websites you're visiting. Again, signals of good intent will factor into your decision about whether or not to trust them.

Many other companies offer similar DNS services: Almost any major antivirus vendor will have it built into their product, plus there are companies targeting businesses with dedicated appliances that do the same thing.


Password prompt before en-/decryption to prevent Side Channel Attacks on FPGA? When we are using a FPGA for file, container or full-disk encryption, we need to input a password for encryption/decryption process. How can we prevent side channel attacks to steal password for a stolen FPGA?

Considering without such 'initiation password' an attacker with
physical access would just need to take the FPGA power it on and listens to
the crypto hardware operations in order to crack the key?
Regarding side-channel-attacks is there a preference between
symmetric vs asymmetric algorithms used in FPGA to protect data?
Are there open source code reference implementations available for
FPGA with reviewed source code? Can you recommend a website or
community regarding FPGA crypto implementations, either symmetric and
asymmetric algorithms.

"FPGA" is mostly a red herring here.

Side-channel attacks try to exploit leaks of secret data element when a system uses the said elements. Leakage can occur in a variety of physical ways, such as energy consumption, processing time, emitted radio waves...

IF:

you have a system which contains a secret element;
AND that system may leak information when using the secret element;
BUT the system will refuse to work until an authorized owner has been duly authenticated;

THEN side-channel attacks won't apply even if the device has come under physical control of the attacker: the attacker won't be able to make the device leak the secret because the device will simply refuse to run the operations which could leak.

HOWEVER this is all relative to some core assumptions which are not necessarily true:

This assumes that the authentication mechanism cannot be broken, though that one can be exercised at will by the attacker.
This also assumes that the device is tamper-resistant: even if the device refuses to use the secret, it still contains it. The attacker has physical access to the device and may try to break it apart and plunder its contents directly. A FPGA is not necessarily tamper-resistant. Since it is a physical chip, it may have been shielded and enhanced with tamper resistance features, but that's not a given. Some FPGA claim tamper-resistance, to some extent (the Devil is in the details, as usual).

As for open-source FPGA implementations, they are not as widespread as their software counterparts, but there is a growing trend for that as well. See for instance OpenCores, which tries to aggregate information about available open-source designs for FPGA and ASIC.


Does Virus or Malware make harm to system if it is in Non Admin Mode for Windows Let Assume, In my windows systems, I have two user one Admin user and one Non Admin User, where I install a software with vulnerability and used it in both user mode. Will that get affected in normal user mode.

It is tricky to understand what you are asking so I am assuming you are asking about any damage the malware can cause if run under your user account.

Firstly, it can touch anything your user account can touch, so assume all your data can be wiped, altered or stolen.

Secondly, through the use of a privilege escalation exploit, the malware may be able to use your user account as a stepping stone to an admin account, and then it can do anything that account can do - generally regarded as total control over the machine.


Certificate Subscriber Agreement So, I decided to get an EV SSL certificate and I'm struggling to fill in some field on the agreement.

Never done this before, anyone could help me figure this out for me?

Thanks in advance!

This space is for the type of company you are... such as an LLC, C-Corporation, or Non Profit.

If you're unsure, look at your DUNs filing or your state incorporation papers.  The person who owns the company or manages the legal paperwork (accounting?) will have this.


Using OAuth as Security For E-Commerce Sites I need some help in understanding the security risks if I want to use OAuth 2.0 (Facebook, Twitter and G+) as standard login provider for an E-Commerce site. Keeping in mind that I will not be saving Credit Card information on the site or in any of the data stores. I would be utilising services such as PayPal (And Similar Services)/EFT to achieve payment methods. I had a quick glance at this documentation for standard security assessments. But still no where closer to understand if the OAuth 2.0 would be a viable authentication option. Any advice would be great. I have the Same question posted on Stackoverflow

Don't do authentication to outside OAuth sources if you plan to store any PII (personally identifiable information) like names and addresses, it exposes you to data theft liability if someone hacks the other systems, and you may never even know it happened. You could also have problems if your customer gets locked out of their FaceBook account and you can't do anything to fix it. OAuth is fine for web page comments, but not for paying customers.


Wildcard SSL and EV SSL Is it possible to mix a Wildcard SSL for subdomains and an EV SSL for the www and non-www domain? I know that an EV SSL can't have a wildcard.

Example:

hello.test.com  -> wildcard ssl
hello2.test.com -> wildcard ssl
www.test.com    -> green bar ev ssl
test.com        -> green bar ev ssl

Yes, this is possible.  When the www or root domain are accessed, the users will see the green bar in the browser, since those sites will be returning the EV certificate.   When a user loads a page from another sub-domain, it will be served over HTTPS, but without the green bar, since those sites will be using the wildcard non-EV certificate.

If the resources are mixed, I.E. the page is loaded from a domain using the EV certificate and other resources (javascript, images, etc.) are loaded from sub-domains, the green bar will be shown because it is the certificate for the page that determines the UX, not the certificate used for secondary resources as I've also detailed in this answer.


Should all local users with the same username have the same UID in all the machines of an organization? We have a datacenter environment where there are servers with the username "java" that has the UID 5000. Now, we are creating the same local user, "java", in some thinclients.

Is it important that the username "java" in the thinclients has the
same UID than the username "java" in the datacenter?
How does an organization control that all local users with the same username use
the same UID?

It's not necessarily required. Having said that, there is not enough information provided to see the full picture of where the thin clients come in touch with the servers. You can do that for the sake of easily aligning all Java applications and users under the same uid. If however, the thin clients mount the remote directories from these servers ( nfs maybe), then matching the GID and UID does help in access management.

Normally, to control the UID and GID allocation, you will have some sort of directory setup like ldap or Active Directory or something similar. On the other hand, if you have a decent configuration management system like ansible, or puppet, you can then control it (akin to deploy) using scripts.


Is it possible to do arp spoofing on remote system? I am new to Linux/ Kali but I am trying to learn as much as I can. From past 5 days I have been googling and learning it all by myself. but I got stuck on this. I saw every video on ARP spoofing tutorial and I can perform this attack on my virtual host but I want to know how to perform this attack on other computers?

ARP packets are communicated within the boundaries of a single network, never routed across internetwork nodes, so you can only perform ARP attacks on computers being on the same network as you are (eg. phones, computers connected to the same Wifi).

To find hosts on your network you can do the following:

Figure out your IP and the subnet mask. Run the ifconfig command and look for a line like this inet addr:192.168.1.101  Bcast:192.168.1.255  Mask:255.255.255.0 This indicates that your IP is 192.168.1.101 and the subnet mask is 255.255.255.0. This means, that hosts with IP of 192.168.1.x (where x can be anything between 1 and 254) are on your network so potentially vulnerable to ARP spoofing.
To find hosts on your network you can use nmap. Nmap has a lot of options, but as a quick start you can run it like this: nmap -v -A 192.168.1.101/24. The option -v stands for verbose output, -A is used to perform OS detection and other stuff, the IP needs to be yours, and /24 stands for the subnet mask. (It is the number of 1s in the binary representation of the subnet mask. In the beginning it is enough to know, that 255.0.0.0 = /8, 255.255.0.0 = /16 and 255.255.255.0 = /24).

Now you can perform the same attacks as you did with your virtual machine. On a home network it will most likely work, although on larger network they might have some defense system. See this answer for more info.

And as always: only perform any test on a network you own or if you have permission beforehand. Running nmap itself might trigger an alarm (eg. NOD32 will display an alert), so be careful.


Dangers of giving away Cell phone details I got a spam call saying saying they are upgrading my plan but needed some details. Obviously I knew what it was and gave them fake info. My question is given the information they asked for what are you able to do with it?

The information they asked for is:

(My cellphone provider) ~ Assumed I just rolled with it
Security Code, 4 digit PIN
iPhone/Android
And obviously they got my number

These scammers are after your money, identity, data, etc. The different things they could do are:

Identity Theft: They could use the information obtained from you to social engineer your cellphone provider to disconnect your mobile service or port your mobile service to another carrier. Once they have access to your number, they could impersonate you and would also have access to your two factor authentication codes (if you've used your number/SMS as your second factor). Based on the type of reconnaissance they've done, they could then gain access to your email, Twitter, iCloud and other accounts.
Data Theft: Based on the information you gave them, they could send targeted malware to your device by sending you SMS messages with links. Opening these links on your mobile browser would result in them being able to exploit a bug in your browser to gain access to your mobile device. They could do this using something like BeEF - The Browser Exploitation Framework Project.
Change your Phone Plan: They could convince the cellphone provider to change your plan, make calls that you would be charged for.

There are many other things that they can do. In summary, if you receive a call from a number not stored within your contacts or from Private Numbers, it's better not to answer the call.

Also be wary of missed calls that are made to your number. Scammers give missed calls from premium numbers to make you call back, after which, you're charged a hefty fee.


How secure are the GPG/PGP keyservers? Importing a GPG key with a KeyID or fingerprint seems to rely on keyservers. Doesn't this invite man-in-the-middle attacks, in which someone would alter the keys to allow them to decrypt the data? What measures are in place to prevent this, and what alternatives are there to using a keyserver to and a key to a keyring with only a KeyID or fingerprint?

Side question: are the private keys uploaded along with the public keys?

Importing a GPG key with a KeyID seems to rely on key servers -- but, in reality, it does not. A key server is an untrusted storage area. When you import a key, you shall not use it before having duly verified that the key is genuine, i.e. is really the public key of whom you believe owns it. That the key came from some key server proves nothing; neither the transmission protocol, nor the key server storage itself, offers any protection against attacks. And, in any case, you don't know who owns the key server and thus you will certainly not trust them.

In order to verify a GPG key, you can:

Check its fingerprint, which is really a hash value. This is for the cases where you met the key owner and he gave you a copy of his key fingerprint. Fingerprints are short enough to be printed on business cards or spelled out over a phone call (I have done both). Hash functions are second-preimage resistant, and that's good enough.
If the fingerprint is not available, build chains: keys signed by other people, whose public key you can verify (possibly recursively). This exercises the Web of trust, which is what passes as a PKI in the PGP world.


Secure RESTful api communication between multiple servers Currently I have the following design:

Central cloud hosted server with a REST api
Multiple remote servers each with a REST api

Data is posted from the remote servers to the central server at regular intervals.

Commands are issued from the central server to individual remote servers in the form of POSTs to the REST api running on the remote server.

I am worried about security. The most important thing is to prevent unauthorized commands being issued to the remote servers.

Currently I am using token based authentication. Each remote server has a token without expiry issued by the central server that is stored in a config file on the filesystem of the remote server. This token is passed in the Authorization header of the POST requests originating from the remote server.

The other direction of communication works similarly. Each remote server generates a token for the central server that is stored in a relational database in the same network as the central cloud server.

My issues with this design:

If the database is compromised, the attacker can issue commands to the remote devices - I am essentially storing passwords in plaintext in the db
If the file system of a remote device is compromised, the attacker gets access to the token

What ways can I improve upon this design? The communication from the central cloud server to the remote device does not not need to be a REST api. It seems like what I need is some sort of two-way handshake between the two servers. How is that achievable with a REST api?

Some notes:

Both rest apis are served over HTTPS
The remote devices often lose internet connectivity for periods of time
The remote devices are at risk of being physically stolen

Some things I have considered:

I could connect all servers to the central hosted database, and use that for communication. This does not seem ideal because this seems like a security risk to have these remote devices connected directly to the database. Also, the remote servers often lose connectivity.
Restrict access to the remote servers to a whitelist of IP addresses including the central remote server

Because you are mainly concerned with the security of your program (i.e preventing someone from issuing commands to your clients), you also have to identify your threat model. For example, if you are sending commands to a program to unlock your front door, your approach in designing the application becomes much different than if you are just sending meaningless data such as "hello world!".

Once you have defined that, you can make decisions on whether you should hash a password in your database and lock the key in a safe or a plain text password might work for insignificant data. I will try to speak to your application though without knowing every single detail.

You are already using SSL/TLS so that's a great start. You have implemented a form of authentication, a way for the clients to prove to the server that they are legit. You have physical control over the hosts, so I assume no one can get physical access. If you have static IP's, sure, throw a whitelist in and a possible firewall to restrict certain http methods (GET,POST). You might consider a front end proxy such as Nginx to do all this on the server. I would highly suggest you do not allow the clients clean cut connection to the database. Only allow the server to make connections to the database. You mention you are storing passwords in the database, why not hash/salt them? Again, depends on your threat model.

You mention that the client machines are under your physical access but could be stolen. If a attacker has physical access to a box, all bets are off. Your best bet here would be identifying as quickly as possible that a client is compromised. You are already using tokens, why not have a expiry time

Lastly, any data sent from the clients to your server must, must, must be sanitized and checked. If you have a idea of what the data looks like, set a template and any data received that does not match it, reject it


Restricting locations for unzipping a zip file I hope that I have found the correct place to ask my question regarding unzipping files.

I would like to see if there is a way to restrict the locations available to the user to unzip a password protected zip file in order to ensure security of the contents of that file.
I believe this is useful for security if there is a password protected zip file on a server, which can be set up to only allow unzipping capability to a local file location.

Obviously if the file is unzipped and placed onto the server in regular file format, the file is no longer secure.

Is there a way to do this that anyone is aware of?

No. And this is never going to be possible, because the person unzipping the file can have total control of their machine.

As proven by the numerous failed DRM schemes, once you give code or data to someone, they can do what they want with it.

That's just how the world works :-)


Can email be encrypted before it reaches the mail server? If not, is there something that would allow something like this that's being worked on? I was thinking about hosting my own email (own email server) instead of using Gmail. But then I realized I could never host my email on a server where I'm also hosting Wordpress. That is because I would always fear that someone might have compromised my server; the same could be said about everything else I have on that server, but email is of particular importance given that someone could reset the passwords for most of my online accounts using my email.

The solution would be to have the email encrypted on my server using my public key, so that it would only be readable using my own private key. But if this encryption occurs on the server it's almost just as useless because someone could compromise the server and get to the emails before they get encrypted.

So the second solution that came to my mind was that the email could be encrypted before it reaches the server. For example, having something similar to a DNS MX record containing my public key which would make the transmitting server encrypt the messages using my own public key. So bottom line, is there a way to have the emails encrypted before they reach the server? If not, is there something like this in the works (because I'd be interested to follow their progress)?

Before you go down the road of hosting your own email, why do you want to get rid of gmail?  Is it because of the contextual advertisements,... etc?

Is there another provider that can deliver the privacy and safety you need?  (Microsoft Hosted Exchange, Google Hosted mail, or Hushmail)

When it comes to email, there are two general approaches to protecting the data: encryption-in-transport and encryption-at-rest.  It sounds like you want encryption at rest, so that even if someone were to compromise your server, they wouldn't have access to your information.

S/MIME, PGP, and Microsoft RMS are commonly used to address this need, but it also seems like you also want to store your MTA in what you consider a non-trusted (or vulnerable) location.

  I'm not aware of any standard or RFC that coordinates with external clients that data-at-rest encryption (S/MIME PGP, etc) is required by your MTA.

It may be possible to have your MTA (postfix, IIS SMTP, Exchange Hub Transport, etc) to run an encryption command on every inbound message, and discard the original; but this is a flawed system that can also be attacked by a local compromise.

You should keep in mind what kind of devices you want to read your email on.  Do you want to read your mail on a iPhone, desktop, or have messages processed by a system agent?  Know that custom solutions outside of S/MIME may make it difficult for you to read and respond to your email.

  Is it safe to assume inbound email will reach your MTA, and outbound email will go through Google's servers?

Finally before you decide to switch to your own MTA, make sure all aspects of email security is taken care of. Namely

Is your registrar password sufficiently complex?  (where you purchased the domain)
Is your DNS password sufficiently complex?  (may be different from where you purchased the domain)
Is the inbound MTA able to protect you from directory harvest attacks?
Is the MTA up to date and patched?  (MTA exploits are rarer these days but worth mentioning)
Does the MTA support opportunistic TLS?
Are there antispam/antivirus provisions on the server?
Does it do BATV and DKIM verification on inbound messages?

Look here for some more aspects to be considered when securing email https://security.stackexchange.com/a/982/396


Mysql injection with a single `USE` statement I know you need prepared statements and such to avoid SQL injection, and I've seen that there are different questions about exploits for SELECT, INSERT, UPDATE injectable queries.

But I couldn't come up with an exploit sample for USE statement. Suppose I have an injectable single statement that looks like this:

USE `data_from_attacker`;

What data could the attacker use if they can put anything in place of the data_from_attacker, considering I'm looking for an exploit example that is not just selecting a DB (ie: selecting information_schema or mysql DB seems harmless, as the next queries won't work because tables won't exist; and selecting a DB that do not exists seems also harmless).

Also, consider that mysql will only interpret the 1st query, so attacker cannot inject:

mysql`; SELECT * FROM `users

Can you find such exploit for MySQL? The USE syntax seems very "poor" for such injection...

Quote Xenos
  Can you find such exploit for MySQL? The USE syntax seems very "poor"
  for such injection

Lets track down how USE works in MySQL and which files MySQL in the source code needs to access.

---

**Query #1**

    SET PROFILING = 1;

There are no results to be displayed.

---
**Query #2**

    USE test;

There are no results to be displayed.

---
**Query #3**

    SHOW PROFILES;

| Query_ID | Duration   | Query    |
| -------- | ---------- | -------- |
| 1        | 0.00006425 | USE test |

---
**Query #4**

    SHOW PROFILE ALL FOR QUERY 1;

| Status         | Duration | CPU_user | CPU_system | Context_voluntary | Context_involuntary | Block_ops_in | Block_ops_out | Messages_sent | Messages_received | Page_faults_major | Page_faults_minor | Swaps | Source_function       | Source_file  | Source_line |
| -------------- | -------- | -------- | ---------- | ----------------- | ------------------- | ------------ | ------------- | ------------- | ----------------- | ----------------- | ----------------- | ----- | --------------------- | ------------ | ----------- |
| starting       | 0.000038 | 0.000019 | 0.000012   | 0                 | 0                   | 0            | 0             | 0             | 0                 | 0                 | 0                 | 0     |                       |              |             |
| query end      | 0.000003 | 0.000002 | 0.000001   | 0                 | 0                   | 0            | 0             | 0             | 0                 | 0                 | 0                 | 0     | mysql_execute_command | sql_parse.cc | 4310        |
| closing tables | 0.000003 | 0.000001 | 0.000001   | 0                 | 0                   | 0            | 0             | 0             | 0                 | 0                 | 0                 | 0     | mysql_execute_command | sql_parse.cc | 4356        |
| freeing items  | 0.000009 | 0.000006 | 0.000003   | 0                 | 0                   | 0            | 0             | 0             | 0                 | 0                 | 0                 | 0     | mysql_parse           | sql_parse.cc | 4968        |
| cleaning up    | 0.000012 | 0.000007 | 0.000005   | 0                 | 0                   | 0            | 0             | 0             | 0                 | 0                 | 0                 | 0     | dispatch_command      | sql_parse.cc | 1978        |

---

see demo

MySQL basic lexer works with yacc so we check file sql_yacc.yy first.
Below is the USE keyword defined.

/* change database */

use:
          USE_SYM ident
          {
            LEX *lex=Lex;
            lex->sql_command=SQLCOM_CHANGE_DB;
            lex->select_lex->db= $2.str;
          }
        ;

When we check sql_parse.cc and within the function mysql_execute_command() we find

case SQLCOM_CHANGE_DB: {
  const LEX_CSTRING db_str = {select_lex->db, strlen(select_lex->db)};

  if (!mysql_change_db(thd, db_str, false)) my_ok(thd);

  break;
}

To answer the question.
No i could not find a possible exploit as it is very clear in the source code the <database> part in the USE <database> statement expects a "string" and does not parse and or execute a SQL statement futher.

With string i mean database_name in the format of USE database_name or with backticks.


Suspicious "100% guaranteed" web hosting security package Notes: I have very limited knowledge and experience in this field. My boss does not want to spend a penny more that what we already paid for. The website has a form that sends a message to our email address and that sparked the security conversation.

Context: My boss bought a package from a webdesign company. This package included a  resigned for the site, 12 months of hosting, and an Account Manager that would help us with the site. I talked with our Account Manager about the security of the new site and he tried to sell us another package for an additional $2,000. He said that if we bought the package, they would ban any IP addresses that are suspected of performing MITM attacks, DDOS attacks, etc. He claimed there was a 100% guarantee that no attack could bypass their security. He also said that our website will get a green lock at the left side of the URL bar.

What I think: I think the package he offered is a scam. I did some reading and according to what I read, the package he described won't stop MITM attacks or Large Scale DDOS attacks. To my knowledge, there is no security measure that cannot be bypassed.

What I read: Can I detect a MITM attack?, DDoS: Why not block originating IP addresses?, How does SSL/TLS work?, https://www.tunetheweb.com/blog/what-does-the-green-padlock-really-mean/

Questions: Am I wrong in thinking that what he offered is a scam? Should we consider buying the package? Am I better off just using a free SSL such as Zero SSL?

Thanks, and sorry if I posted this in the wrong exchange or if this is not the right place to ask. I'm not sure where else to ask these questions.

A few things worth noting (expanding on my comment, so I can elaborate a bit more).

He claimed there was a 100% guarantee that no attack could bypass their security.

This claim can never be verified. Aside from the fact that this claim likely came from a sales person with limited (if any) Information Security knowledge, I would say that anybody who ever claims that a system is 100% secure is not to be trusted.

they would ban any IP addresses that are suspected of performing MITM attacks, DDOS attacks

Deploy an SSL / TLS certificate to mitigate any risk of MITM attacks. LetsEncrypt will let you do this for no cost and many hosts support them natively now. Mitigating DDoS attacks is likely not something your host has the capability to do by themselves and will likely just put you on a free CloudFlare plan.

If you're concerned about the security of the application itself then you should be looking for the services of a Penetration Tester. The "security measures" this account representative has presented strictly deal with the protocol level (how traffic gets to your website), and not the security of the website itself. Testing the security, logic flow, etc of the actual application is a task best left to experienced web penetration testers.


What exactly determines which entities/servers "on the Internet" get to read my e-mails when I send them from X to Y? Let's say, for example, that I have a Gmail account. I compose and send an e-mail to info@somecompany.com. They aren't using Google services, just so that we can exclude "special cases" where they just keep the entire thing internal to their own network.

On a technical level, doesn't the e-mail client/software just look up somecompany.com's MX records and then connect directly to that IP address on the "e-mail port" and, assuming it is online and accepts the "handshake", just transfers the e-mail directly to it?

Why have I heard all my life that e-mails just get "flung out in cyberspace randomly" and bounced around the entire world, allowing everyone and their grandmother to read it before it finally gets routed to its final destination?

Is this a total misconception? Was it something that was done in the 1960s because they couldn't afford to have computers on at all times, so they had to do it like this? Is it by design in order to allow spying?

I feel ashamed for still not having a good grasp on this after all these years. I've probably tried to ask about this dozens of times over the years, but never got what I considered a clear and conclusive answer.

There are a few layers to your question, which might be why you have not received a satisfying answer.

The first layer is simple: email sent from one email server to another is not normally encrypted. That means any server/router/node along the path can read emails. I'm not talking about email servers, just infrastructure.

The second layer is more complex. It is possible that your Gmail server sends the email directly to the recipient server, meaning only two email servers are involved. But there are so many other configurations that might also be involved:

Email server fabrics mean that there can be a cloud of servers at either end, with the ownership/control of any one server not contiguous (shared control, control in different countries/legal entities, etc.)
Mail relays might serve one end or another
Forwarders might be used on the user side, which compounds the possibilities
Email clients might have their own server fabric, so when you send the email to the recipient address, it might be served by different clients at the client-side after it hits the email server

Just keep the OSI model in mind. Yes, on one level, it can be one server talking to another. But the magic of stacks means there is a complex web at every layer and the connections between the layers can be equally complex.


Why do DDoS attacks cost a fortune to stop? I have read so many stories that a major DDoS attack is causing companies thousands of dollars to mitigate. I have two questions:

Is this because they try to keep the servers accessible to real site visitors while an attack is going on?
Does shutting the server down instead of trying to keep it up still cause loss of money? In other words, instead of spending thousands of dollars to try to keep the server up why not just shut it down (concede from the attackers) and spend nothing.

It's because if you shut a server down, you can't use it for revenue. Imagine having a real shop: if you close it during the day, you can't sell anything and offer your services. It's as simple as that.

To improve my answer, it costs a lot to fight because it's pretty much impossible to defend yourself against such attacks, since the attacker can use a very large number of machines to attack you. If you can defend yourself from an attack by 1000 computers, the attacker only needs to add one more to win. And since there is no limit to the number of machines the attacker can use, you basically will never be invulnerable :)

So, in conclusion, shutting the server down means no revenue because you can't offer your services anymore, but at the same time, keeping it up is extremely expensive (but it's better than shutting it down).


TrueCrypt and Keyfiles hidden among 500,000 other .pdf files A question from a newby:

I have a USB or Standalone HardDrive with a TRUECRYPT hidden partition on it that needs one or more "keyfiles" and a password to access.

What tells the attacker what kind of file or even where to look for those "KEYFILES" on a generic innocent system filled with over 500,000 generic files on multiples drives....??

a) Is hiding a Keyfile or Keyfiles in plain sight a good idea or

b) My other thought was using 7z Format to archive and encrypt that generic KEYFILES which was a .jpg or .pdf or .bmp or .pcx ((after its use with TRUECRYPT)) with its 7z - AES encryption and use of non standard characters to render the now encrypted KEYFILE Useless as  KEYFILE if the TRUECRYPT drive was attacked. So the 7z - AES Keyfiles would have to be identified first......and unarchived before the Standalone drive could be attacked....

c)If those fail -  Is it necessary to hide those Keyfiles on a separate 2nd smaller USB or on some random server or archive online and therefore 100% physically removed and concealable offsite

Is this thinking logical......or have I overlooked some fatal flaw ......beyond posting on this public board? :-)

Thank you for the good advice re length as passwords and the scary reality of brute force power available at others fingertips.....

Random thought.......Why does not TRUECRYPT not support non standard characters in its password like 7z archiver does?  It seems to add a new set of variables...

Loosely-speaking, you can treat the Keyfile as something you have. You can store it on a USB stick for that sole purpose. Whenever you want to decrypt your secret file, you plug that stick and decrypt.

You can add an extra layer of security by making that USB stick a TrueCrypt volume, thus protecting your Keyfile with a password.

Of course, you can hide your Keyfiles in plain sight. There reason I would not recommend that is that I don't think it'd be that difficult for an attacker to eventually figure out which file is your Keyfile.

You see, no matter how randomly you chose that file, in the end you're a human being. Believe it or not, we're very predictable.

Lastly, a relevant warning from TrueCrypt documentations

  WARNING: If password caching is enabled, the password cache also
  contains the processed contents of keyfiles used to successfully mount
  a volume. Then it is possible to remount the volume even if the
  keyfile is not available/accessible. To prevent this, click 'Wipe
  Cache' or disable password caching.


How can I hide proprietary elements of test data in tests that are automatically run? I am writing automated tests for a web application that will be run periodically over night, and I am running into a moderate security issue.

In order to make the tests thorough, I am hoping to include live data as test input rather than relying exclusively on mock data generated specifically for these tests (this would ideally make the testing substantially more robust). However this is challenging because these tests are stored on a public (to my company) Git server and need to be universally accessible. However not all employees have permissions to view the live data that is used in these tests. As a result I am trying to come up with a way to hide this live data such that it can be used at runtime by automation (in this case RobotFramework running Selenium), but cannot be viewed/accessed by a user pulling down the containing Git repository.

I was hoping to encrypt the stored data and only decrypt it at runtime of test automation. However, this would require providing the test automation suite with credentials to decrypt the encrypted data, which defeats the purpose of encryption in the first place. These automated tests will need to be run automatically over night, which precludes having a human user enter the password to decrypt data.

As a result, I am wondering if what I am trying to do is conceptually possible and how I might go about doing so. My best thought is perhaps finding a way of providing decryption credentials to the job agent that runs the tests, but this is logistically complicated (and the bob agent itself might also need to be publicly accessible) and I am curious if there is another way.

I am not an expert in security (although I understand basics) and so any suggestions are welcome.

Thanks

That's a bit unfortunate.

So long as your code and testing framework are both public, there's nothing that you can do that your unauthorized users can't. You need to lock something down.

The best this I can think of is to put the data on the server running your tests. Limit access to the server to only authorized individuals. That way even if people find the server information, they won't have access to pull the data from it.


Is it possible to clone an RFID/NFC card using a simple RFID reader, for future reuse and impersonation? RFID/NFC technology is used in credit cards and many other personal identification applications.

Is it possible/how easy is it to clone a card using a simple RFID reader?

In other words, can the retrieved information be reused in the future by the attacker?

If it is a basic data providing tag, then it can be cloned.  If it is a secure tag, it is far more difficult.

For secure cards used for payments and authentication, a private key is loaded on to the card and the card never discloses it.  The public key is kept by the bank or whoever needs to be able to verify that the card was used.  If, for example, the card is used for a payment, the vendor's terminal feeds information about the transaction to the card and asks the card to sign the transaction.  The card signs the transaction and returns the signature to the reader.  This signature allows the vendor to prove to the credit card company that the card was used for that transaction, but it doesn't give the vendor the information needed to clone the card.

There are potentially ways to etch off layers of the card and directly access the circuitry that holds the keys, but such methods are unreliable and difficult to execute, particularly since a good secure tag should be designed to be tamper resistant.

There are some attacks against older protocols that should be going out of use now, but generally speaking, a good, modern, secure tag should not be cloneable.  That is the entire point of using this kind of technology rather than a magnetic strip (which is easily cloneable.)


Problems with avoiding JSON hijacking with MVC3's AntiForgeryToken, or similar token validation I'm hesitant to implement the proposed anti-JSON hijacking solutions since

The recommended solutions to mitigating JSON hijacking involve non-REST-full JSON POSTs to GET data

The alternate solution (object wrapping) causes problems with 3rd party controls I don't have source-code access to.

I can't find a community-vetted implementation that implements the Alternative Solution (listed below) on how to compose the security token, or securely deliver it within the webpage.  I also won't claim to be enough of an expert to roll my own implementation.

Referrer headers can't be relied upon

Background
This blog describes a CSRF issue regarding JSON Hijacking and recommends using JSON POSTs to GET data.  Since using a HTTP POST to GET data isn't very REST-full, I'd looking for a more RESTful solution that enables REST actions per session, or per page.
Another mitigation technique is to wrap JSON data in an object as described here.  I'm afraid this may just delay the issue, until another technique is found.
Alternative Implementation
To me, it seems natural to extend the use ASP.NET MVC's AntiForgeryToken with jQuery HTTP GETs for my JSON.
For example if I GET some sensitive data, according to the Haacked link above, the following code is vulnerable:
$.getJSON('[url]', { [parameters] }, function(json) {
    // callback function code
});

I agree that it isn't RESTful to GET data using the recommended POST workaround.  My thought is to send a validation token in the URL.  That way the CSRF-style attacker won't know the complete URL. Cached, or not cached, they won't be able to get the data.
Below are two examples of how a JSON GET query could be done.  I'm not sure what implementation is most effective, but may guess that the first one is safer from errant proxies caching this data, thus making it vulnerable to an attacker.
http://localhost:54607/Home/AdminBalances/ENCODEDTOKEN-TOKEN-HERE
or
http://localhost:54607/Home/AdminBalances?ENCODEDTOKEN-TOKEN-HERE
... which might as well be MVC3's AntiForgeryToken, or a variant (see swt) thereof.  This token would be set as an inline value on whatever URL format is chosen above.
Sample questions that prevent me from rolling my own solution

What URL format (above) would you use to validate the JSON GET  (slash, question mark, etc)  Will a proxy respond to http://localhost:54607/Home/AdminBalances with http://localhost:54607/Home/AdminBalances?ENCODEDTOKEN-TOKEN-HERE data?

How would you deliver that encoded token to the webpage?  Inline, or as a page variable?

How would you compose the token?  Built in AntiForgeryToken, or by some other means?

The AntiForgeryToken uses a cookie.  Would a backing cookie be used/needed in this case?  HTTP Only?  What about SSL in conjunction with HTTP Only?

How would you set your cache headers?  Anything special for the Google Web Accelerator (for example)

What are the implications of just making the JSON request SSL?

Should the returned JSON array still be wrapped in an object just for safety's sake?

How will this solution interop with Microsoft's proposed templating and databinding features?

The questions above are the reasons I'm not forging ahead and doing this myself.  Not to mention there likely more questions I haven't thought of, and yet are a risk.

This technique was pioneered by Jeremiah Grossman.   This was only an issue because the returned json also contains javascript which could be included into a page via a <script> tag.   Most json responses cannot be abused this way because the same-origin policy forbids javascript from fetching the results.   To patch this issue Google used an unparseable cuft.


Do telecom operators listen to every phone calls I usually don't answer unknown numbers. Few days back i got couple of calls from unknown numbers and i didn't answer it. That evening i had contacted one of my lady friend and the next day i got a call from that friend but when i answered it, to my utter surprise it was an operator calling for a confirmation for the service i recently applied. They disguise their call with my friend's number and name. Is that possible.

It is possible for operators to fake their caller ID's although I have not heard of them doing it for phone calls in practice.

Certainly they are aware of the phone numbers you call, but considering how many calls would go through their systems each minute, I would say that the answer to your title question "Do telecom operators listen to every phone call?" would be a resounding no. It's just not possible without a huge amount of manpower. There are ways to automate the process using keyword recognition etc but it's not practical to have an actual person listening to every call.

Which carrier are you with/where are you located? We might be able to find some further information on any practices like this.


Mitigating security risks of using open-source software The title sounds like a trolling question but it is not (I'm a huge fan of OSS).

I have a small company with a web app that is undergoing infosec review with a Fortune 100 company.  The questions I have been asked include:

How do you track and monitor vulnerabilities in open source software?
What steps do you take to ensure that the open source software is risk free? (This seems to be a very poorly worded question)

My current answer is that I don't do anything other than to only use established and reputable OSS, but I don't think that is enough.

It isn't feasible to review the code of all the OSS I am using.  What would be a reasonable process to satisfy an infosec team?

The OSS to be evaluated is all Python (e.g., Flask, Flask-Security). I use VMs provided by Google/AWS (which they update), and I add some additional Python packages to them, and it is these additional Python packages that are my primary concern.

(They don't seem to want me to address all the OSS on the underlying Linux VM and I don't want to open that can of worms.)

How do you track and monitor vulnerabilities in open source software?

The same way it's monitored in closed source software. Vulnerabilities are reported and updated in subsequent releases. Generally this cycle is even faster with OSS.

What steps do you take to ensure that the open source software is risk free?

The same steps that are taken with closed source software: review, reputation, support. History demonstrates that closed source and open source have statistically similar risks.

To be fair closed source provides a target for legal action, but unless you have deep pockets that's not a winner.

This may or may not help your argument:

GSA Open Source Policy

  18F: An Open Source Team

  18F, a digital services delivery team within the General Services Administration, develops in-house digital solutions to help agencies meet the needs of the people and businesses they serve. This requires flexibility in how we code, with a focus on lowering costs for the American people, while improving their interactions with the U.S. Government.

  The default position of 18F when developing new projects is to:

  Use Free and Open Source Software (FOSS), which is software that does not charge users a purchase or licensing fee for modifying or redistributing the source code, in our projects and contribute back to the open source community.
  Develop our work in the open.
  Publish publicly all source code created or modified by 18F, whether developed in-house by government staff or through contracts negotiated by 18F.

Benefits

Flexible usage.
Community involvement.
Cost-savings.
Reusability.


GDPR data flow mapping and inventory Anybody can share some tips on how to create a nice GDPR data flow mapping and inventory?

Any sample diagrams? What diagrams types are best to be used here?

Would you show high level diagram and sub-diagrams for each component set?

How would you approach it for a bigger system (monolith with dozen of micro-services, several data sources etc)?

Don't want to re-invent diagram type, make something non standard, hence my question for experienced GDPR folks that did this before.

Using a Data Flow Diagram will help map out all the locations data is stored, processed and in transit.

This gives a great high level overview of the data.

Some good sources can be found here:

https://www.visual-paradigm.com/guide/data-flow-diagram/what-is-data-flow-diagram/
https://stackoverflow.com/questions/450498/what-are-the-data-flow-diagrams-dfd


Does Web Apps and Databases running on AWS EC2 need a IDS/IPS? I have googled around for information about Web Apps or Databases running on AWS EC2 needing a IDS/IPS or not.

I will present my findings so far here, but it will be good if you guys can confirm these findings, or comment on them.

Netword based IPS/IDS systems are not necessary because:

  Packets are only delivered to the destination addresses and no other
  devices will ever see that packet. While that eliminates many
  traditional threat vectors, it also makes intrusion detection
  approaches like NIDS/NIPS basically useless in AWS. So for intrusion
  detection in AWS you must look to host-based approaches.

  Quoted from: http://www.erpassociates.com/peoplesoft-corner-weblog/cloud-computing/securing-enterprise-data-in-aws.html

People tend to use nagios for IDS purposes on AWS: https://forums.aws.amazon.com/thread.jspa?messageID=176652&#176652
How to do it.
People use host-based(software) IPS/IDS in AWS EC2, like OSSEC.

What do you guys think? Also, it seems to be that nagios can be configured to achieve what OSSEC can do. Is this correct too?

I'm not sure how you would manage a physical IDS on AWS since you are limited to what Amazon has in their system.  When using a cloud provider, you largely have to trust their physical security, but you can reinforce it with your own software security to attempt to protect against any broad breach in their technology or any direct attacks against functionality you don't need or don't use in certain contexts.


How I can get the elliptic curves parameters from a host? For example, with openssl I have seen that facebook works with ANSI X9.62 prime256v1 elliptic curve and what I want is the point of the curve that is using with my signature. I have seen that I can extract the point from facebook certificate, in the public key.

So again with openssl I get the public key:

-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEoPGMr6c5iGhbE1YOFRW0p0XvG8fl
hTwrBNRlijExIuqjku1knbplgeO2EnbYswtF8f8KKBScT9xzqbNJLaB20w==
-----END PUBLIC KEY-----

But now I don't know how to get it. Anyone knows how to do it? Or am I doing it wrong?
I can do operations with Sage.

Thanks


Is Firefox's new JavaScript support within PDF files a security concern? Historically, we have learned that many security vulnerabilities and exploits have resulted from allowing document files to contain executable code, whether it be JavaScript, VBScript, another scripting language, or even macros.
As such, since the first days that JavaScript could be embedded into PDF files, I have disabled JavaScript support within every PDF reader and editor I have used.  Many colleagues have done the same.
According to the pre-release notes for Firefox 88, which is being pushed to the public any hour now:

We [Mozilla] keep on working on improving our PDF forms support and now support JavaScript embedded in PDF files (some PDF forms use JavaScript for validation and other interactive features). If you find any bug with this feature, please file an issue on the PDF.js repository.

On the surface, this sounds quite concerning from a security standpoint.  Although, hopefully, any code executed from a PDF file will have at least the same security in place as JavaScript run from a website, the source and control of PDF content being loaded is often very different than a website.
For example, let's take google.com (as Henny Youngman would add, "please").  Assuming a non-compromised connection, any JavaScript code running on that domain would be written by Google developers (for better or worse).  But if you perform a search for PDF files on google.com, you'll be presented with literally billions of PDF files, each of which could be written by any random person.  And each could contain JavaScript code written by literally anyone.  With PDF JavaScript support enabled within the browser, any PDF file you click on to read could now run arbitrary code on your computer.
Is this a security concern?  And if so, can it be disabled?

Regular folks don't have to worry about this feature more than any other part of Firefox. For a professional worrier like myself (I literally get paid to worry) it's less concerning than JavaScript in a web page because of the lack of functionality.
JavaScript in PDFs has an extremely limited set of objects it can manipulate: just the form data. It can't access or manipulate the document text, nor does it have access to any DOM (browser) APIs and can't send network requests. In addition, Firefox has always opened PDF files in a special local context and it's no longer considered part of the site the file was downloaded from. We still show that original URL in the address bar for convenience (you might want to copy it, or manually edit it to a related URL) but it's pretty much a lie. Even if the script could get out of the sandbox through some security bug--and this sandbox has been in use for years with Web Extensions--it wouldn't be able to affect the site it was uploaded to.
The one new potential is that a jerk could write an infinite loop and try a denial of service attack, but that's not any different from any web page or framed web advertisement you browse to all day. It doesn't seem to be a problem in practice given equally "vulnerable" PDF viewers in Chrome, Edge, and Opera. You can always just close the tab as you would with a bad web page.
You can turn it off if you want with the pdfjs.enableScripting pref, but there's no real reason to do so.


How does CryptoDefense ransomware encrypt large data with a (relatively) small RSA key? I recently encountered some news about the recently new Ransomware called CryptoDefense: it uses RSA 2048 to encrypt your valuables and offers the private key for a price. (It's already been solved since the private key is apparently cached locally)

My question however is how does this software actually encrypt large files of an arbitrary size such as photos and word documents that can be 1MB+ in file size with an RSA 2048 key? Is it actually RSA + AES or is it only using RSA 2048 by splitting files into small blocks somehow?

I've tried to find a detailed analysis of the software on Google by failed to find anything useful since almost all articles are fixated on it's insecure RSA mechanisms or bitcoin profits.

Generally speaking, this is called hybrid encryption. When we need to encrypt a lot of data with RSA, well, we don't; not only would this be highly inefficient, but we also don't really know how a big chunk of data should be split into small messages to be individually encrypted with RSA: from a cryptographer's point of view, this is a non-trivial issue, which is already hard enough for block ciphers (for block ciphers, this problem results in modes of operation which are already a complex subject; with RSA things are just worse).

Instead, we generate a symmetric key K, encrypt K with RSA, and encrypt the bulk of the data with K, using an algorithm which is good at that, and that means symmetric encryption (e.g. AES in a suitable mode).

If the ransomware author knows his trade (which is to be hoped, because nothing is more irksome than being attacked by an incompetent), then he used hybrid encryption.


Expose the source code repository externally or allow VPN access? To allow third party consultants, offshore developers and contractors working on the code, we can expose our Git repository externally. Or we can grant VPN access to the external parties and limit their access by configuring a new group on firewall so they can only access the Git repository in our internal network.

Which of these two options is a better security choice? Some arguments I have myself are:

1- By exposing our code repository over the Internet, we are opening door to hackers doing brute forcing on the Git. Also if there is any zero day in Git, we are impacted.

2- By providing VPN access to third parties, we allow untrusted entities into our internal network, and if the firewall rule setting is not configured well, our internal network which is more sensitive is exposed.

Given that you cannot use a dedicated, isolated network for this, I would suggest a modified version of option 1:

Allow access over the web with rigorous security checks.

If possible authorize git users using a cryptographic key (the way github does.) This will make brute forcing attacks very difficult.
Use IP filtering. That is, find out the IP addresses of your contractors and only accept queries from those IP addresses.
Make sure you have good firewall, IDS rules on this box.


How to decrypt Diffie-Hellman in wireshark? How can i decrypt Diffie-hellman TCP packets?

I'm trying to make a tool that shows cleartext response from a server that uses this encryption.
However when i look online people all seem to say it's impossible to decrypt DHE, which is not true since we are the client and have access to this information,

but how can i decrypt these packets with the handshake in wireshark?

Bonus question:  Any tools in python or something that establish DHE connections and show cleartext response?

The traffic itself does not contain enough information to decrypt it (if it did, a malicious WiFi hotspot could decrypt TLS making TLS worthless). You need the ephemeral (single-use) private key for the DHE or ECDHE (has nothing to do with a certificate), either the client's or the server's. Alternatively, you need the resulting shared secret. Either the client or the server can write it to log, but only as long as they have it - after the connection is closed, it is gone. There is a standard for such logging for browsers (to produce logs) and for wireshark (to consume logs), called SSLKEYLOGFILE.

See Mozilla docs for NSS Key Log Format and a blog post with screenshots for using it.


What are requirements for HMAC secret key? I'm creating HTTP REST service which will be available over tls only.

For authentication purposes I plan to generate JWT token for every user using HMAC HS256. I need a secret key for HMAC.

What are the requirements for secret key?

Do I need a long string of random characters? Or fixed-length string? Or what?

I've added my answer here as I feel the existing ones don't directly address your question enough for my liking.

Let's look at RFC 4868 (regarding IPSec, however it covers the HMAC-SHA256 function you intend to use - em mine):

  Block size:  the size of the data block the underlying hash algorithm
        operates upon.  For SHA-256, this is 512 bits, for SHA-384 and
        SHA-512, this is 1024 bits.

  Output length:  the size of the hash value produced by the
  underlying
        hash algorithm.  For SHA-256, this is 256 bits, for SHA-384 this
        is 384 bits, and for SHA-512, this is 512 bits.

As WhiteWinterWolf notes, longer than B is discouraged because the value must be hashed using SHA-256 first (i.e. 512 bits in this case) and less than L is discouraged (256 bits in this case). However, a 256 bit key is overkill as anything that is 128bits or greater cannot be brute forced in anyone's current lifetime, even if every computer in the world was working on cracking it.

Therefore I'd recommend a 128 bit key, generated with a cryptographically secure pseudo random number generator (CSPRNG). If you want to store this as text then a 128 bit key can be represented by generating a random 32 character length hex string, or alternatively you could generate 16 random bytes and then run them through a base64 function.


High-latency anonymous communication minimum delay? High-latency anonymous communication (e.g. Mixmaster and Mixminion) delay messages for a long time using mixers to anonymous communications. I understand that it has applications for email and p2p but not for good for responsive applications such as web browsing and instant messaging.

I've gone through the papers for them but couldn't find the relevant information.

How long exactly are the delays? minutes, hours, days?
Can these be set? is there a minimum bound for it to be defined as safe? I asked this because I'm wondering if it could be somehow applied to web browsing

I finally found a paper, Message Splitting Against the Partial Adversary,  on this topic, thanks to Prof. Murdoch.

For Mixminion, minimum delays seems to be 4.8 minutes and it is dependant on the numbers of messages into the mix.


Detecting RDP on non-standard ports How can RDP connections on the network be identified if they are no longer using TCP 3389 and instead using a non-standard port?

If the administrator of a system changed the port for remote connections from 3389 to something else and not updated same in IDS or firewall, then how can someone detect the active remote connections at the network level?

The only way you can identify "rogue"  remote connections that are inside your network (and because your use case eliminates using the port number as identifier ) is through deep packet inspection on the network.

If you want to know outgoing connection from a specific machine and you have access to the root user of said machine. You can ask the network stack what connections it has ('''ss''' on Ubuntu but all systems have some way)
This will list all connections the system has. (Including sockets)