How to verify secure erasure of Android and Apple mobile devices

Factory reset, open the camera and let it record a movie in the highest resolution and framerate until all storage is full, factory reset again.

The first factory reset will free all storage, then the movie recording will fill up all the storage, overwriting everything, and the second factory reset deletes everything again. This will work even on older phones where the storage was not encrypted.

It's overkill on the newer versions, because the storage is fully encrypted and the first factory reset will destroy the key.


Is it possible to come close to complete anonymity for bittorrent traffic?

If I want to use my home network, is it possible to make it almost completely anonymous?

Unfortunately, you cannot be completely anonymous if you use your own home network. Actions like disabling DHT and Peer Exchange do not improve anonymity, since you still need to send your real IP to the tracker in order to actually interface with the swarm. This is not something you can avoid, because the trackers are required to track your IP and distribute it out to anyone who asks in order to actually maintain the swarm. After all, how else does the torrent program know the IP addresses of other seeders so that they can connect to them and begin the download?

If you use a VPN, you will route your system's traffic through another server. The traffic is typically encrypted so that your ISP is unable to view the contents of the data. When you do this, you simply shift the trust from your ISP to the VPN's ISP. This is intended to make it a bit harder for law enforcement or anti-piracy groups to obtain your original IP. However, many, many VPNs are highly insecure or provide very poor anonymity. Good ones are usually enough to protect against the MPAA as an adversary, but are far from capable of providing "close to complete anonymity".

If you use a seedbox, you will be using a remote server to run the BitTorrent application for you, doing the downloading and seeding on its own without involving your ISP. When you wish to access the downloaded material, you are able to download it directly from the seedbox. This provides anonymity that a VPN does not provide in addition to allowing for faster speeds, since all your downloads are direct downloads, and the remote server is what becomes the BitTorrent peer.


Validating JWT in server-to-auth-server scenario

I have found the library that is used in this sample code here:
https://github.com/auth0/auth0.net/blob/master/src/Auth0.AuthenticationApi/AuthenticationApiClient.cs

The sample is using the Resource Owner Password Credenatials flow (which is rather not recommended) but that is not the topic of the question. You can see in the related library that at the response the Identity Token is validated with an AssertIdTokenValid() function which is using IdTokenValidator:

private Task AssertIdTokenValid(string idToken, string audience, JwtSignatureAlgorithm algorithm, string clientSecret)
    {
        var requirements = new IdTokenRequirements(algorithm, BaseUri.AbsoluteUri, audience, idTokenValidationLeeway);
        return idTokenValidator.Assert(requirements, idToken, clientSecret);
    }

So by default the library is validating the Identity token.

The Access Token does not have to be validated in client application (Relying Party). It is only used by this client to authorize against API that the access token will be sent to - like it is when the UserInfo is requested to get the user claims. It is APIs responsibility to validate that access token.

DISCLAIMER: It is recommended to use Authorization Code flow with PKCE in such scenarios.


This seems misguided.

Time in seconds from any source lacks almost any entropy, and is almost immediately guessable. If your OS allows microsecond granularity for a running process, you'll get 4 or 5 bits of entropy there, from the lower bits, but a lot less if someone finds a way to get the exact system uptime.

You're then talking about MD5, which isn't really useful in this case. All it does it give you the impression that you've made it more random, without actually making it random. Really you've only got a couple of integers that are dependant on each other (process time is always going to be in sync with system uptime) and that are entirely non-random. Your system will almost certainly leak its uptime in one form or another. You'd actually be better off using an LCG like PHP's rand(), since the internal state can't be guessed as easily.

This approach to random number generation is bad, because it's not random at all, and can be predicted. However, salts don't actually need to be particularly random, they just need to be unique; they're only there to prevent rainbow table attacks. Unpredictability helps (see "how to store salt?") but isn't entirely required. Regardless, there are some benefits to making the salt difficult to predict.

If you're on Linux, read some bytes from /dev/urandom to generate the salt - you don't need to do anything more than take those bytes and use them, because they're already strong random numbers.

If not, you could generate the salt as SHA256(username || email || time || mt_rand()) where || denotes concatenation, time is the current system time in as high a resoluton as you can get, and mt_rand() is an output value from whatever random generator is available in your programming language's default library. In PHP you should use mt_rand rather than rand, since it has better characteristics. This provides enough entropy for a salt to be very difficult to guess remotely, especially given the limited opportunities for re-use of username and email combinations.

For storing the password, you should definitely be using PBKDF2 or bcrypt. A single use of a cryptographic hash function is simply not enough to protect you from bruteforce attacks, especially when almost everyone has an OpenCL-compatible GPU these days.


OVPN Connections vulnerable to Heart Bleed?

In short, OpenVPN using buggy OpenSSL versions are indeed affected. OpenSSL versions older than 1.0.1 and newer than (and including) 1.0.1g are safe. Versions in between may be safe iff the vendor applied a patch. Note that there are other SSL libraries that can be used with OpenVPN, namely PolarSSL.

Long story, OpenVPN often uses UDP instead of TCP. Existing public tools are mostly concentrated on TLS over TCP. So for that reason alone, you cannot just enter your OpenVPN server running on UDP into a random website and expect a sane response.

Second, OpenVPN uses its own protocol on top of TCP. TLS run atop of that protocol. Looking at a packet capture for OpenVPN (over UDP), I can see that the Heartbeat extension is advertised.

If you have not updated your OpenVPN client now, hurry! If you manage the OpenVPN server and have still not considered updating your OpenSSL libraries, have you been sleeping for a whole day?!


I can pay by my credit card under fake name: who's responsible to check?

Ultimately, it is the responsibility of the merchant to do whatever they can to verify that the card is not being used fraudulently - because if the transaction is later found to have been made fraudulently, the transaction is reversed by the processor.

There are many things the merchant can do to attempt verify that the card being used is not stolen, such as address verification, cvv code verification, etc.  However, name verification is not one of these, as this does not even get sent over the wire when the transaction is submitted to the processor.  See https://community.developer.authorize.net/t5/Integration-and-Testing/how-to-validate-name-on-credit-card/m-p/22163 for more info.


I'm sure you are aware that Oracle does provide a TDE solution.

http://www.oracle.com/technetwork/database/options/advanced-security/index-099011.html

The only time I seen this solution being cost effective if your company was large enough to have a global contract with Oracle.


Is it risky to URL-encode characters in an already URL-encoded string?

Adding a URI encoding for a character in an already URI encoded string, when you know where that URI encoded string will be decoded has a vanishingly small probability of exploitability. It would have to allow a string to bypass a filter located between where the string is encoded and where it's decoded.

There are always risks, of course, but you have to specify a receiving end if you want to identify security risks. The biggest risk is that the receiving end won't know to decode the additional URI encoded parts at all, and it will break the system.

If you have no control over the receiving system or insight into what it's going to do with the string, then you can't identify a security risk. There's always the (negligible but non-zero) chance that you'll trip over something.


Should employees confront people without access cards?

Not sure if there are any best practices, but here are some tips.

First of all, your top level managers should always be wearing one, and if not, accept to be confronted by their staff. They should actively encourage people to do so.
When you find someone unknown in the building without access card, ask them politely that they seem lost and you want to help. Then ask who they are with and escort them to your colleague. Then also inform your colleague about getting a visitor badge for their guest.
When you find someone known (as in a colleague), say they need to wear their badges. If they refuse, inform his or her manager about the situation. And again, management should encourage the wearing of the badges.
Sounds lame, but make wearing one part of the ongoing HR-process for KPI and performance of employees.

But start with the people first. What culture is your company? Is it open and transparent, or is it more hierarchical or more like a flat company in which people organize themselves? And then start from there on.


According to CryptDeriveKey() documentation, upper WORD of dwFlags parameter specifies desired key size in bits. In your case it should generate 40-bit (0x28) keys, effectively discarding all but first five bytes of the MD5 output.

To achieve similar behavior with CommonCrypto you can try this:

CCCryptorCreate(kCCDecrypt, kCCAlgorithmRC4, 0,
                      (void*)m_hKey.data(), 5, NULL, &cryptor);

EDIT:

Actually, the above code is not compatible with CryptDeriveKey(). It turns out (from test vectors published in comments) that Windows still uses 16-byte key but last 11 bytes are set to zero (thus, effective key length is still 5 bytes or 40 bits). Python code that produces same result as Windows code:

from Crypto.Cipher import ARC4
import binascii

KEY = "cfba3dd2ed"
DATA = "eb b9 bd 6f 5d 46 8d 17 c1 88 db 78"

key = binascii.unhexlify(KEY) + "\x00" * 11
rc4 = ARC4.new(key)
print binascii.hexlify(rc4.encrypt(binascii.unhexlify(DATA.replace(" ", "").strip())))

Outputs for me:

04021f02730101000000ff9b

This CommonCrypto code should work:

if (m_hKey.length() > 5) {
    memset(m_hKey.data() + 5, 0, m_hKey.length() - 5);
}

CCCryptorCreate(kCCDecrypt, kCCAlgorithmRC4, 0,
                          (void*)m_hKey.data(), m_hKey.length(), NULL, &cryptor);


DOS safe alternative to delay response to an attacker with sleep()?

sleep() won't slow down current generation brute force attacks all that much to begin with.

In general, bruteforce breakin attempts nowadays are executed via the same type of botnet used for DDoS attacks - so rather than a single source attempting one set of credentials after another, you'll be seeing hundreds or thousands of different sources attempting a single set without waiting for a response to one another. Whichever one scores a hit reports back, all the other zombies just shrug and move on.

If you have sufficient control over your server that you can tell your services to log bad login attempts to a file somewhere, you can set up something like fail2ban to handle blocking and unblocking attackers for you, but sleep() is going to be essentially useless against most modern breakin attempts while degrading performance for legitimate users who'll have to wait an extra second to get each new page.


John the Ripper supports parallelization. This uses OpenMP or MPI. All of this is open source.


SQL Injection - "order by" clause does not work

As @tryna-learn-somethin mentions in comments, the likely source of the problem here is that you appear to be enclosing the order by column in single quotes, which are likely not necessary and getting treated as a SQL syntax error.

If you look at examples like the ones in this answer you should be able to construct a valid example for this injection point.


What type of encryption does Windows 10 virtual WIFI hotspot use?

WPA2-AES, according to Microsoft.

  To provide protection for the wireless communications between the computer hosting SoftAP and the devices connecting to the SoftAP, the wireless Hosted Network requires that all devices connected use the WPA2-PSK/AES cipher suite.


This may sound a bit of a cop-out, but at the end of the day it is down to what assurances you need from the provider so you should ask both of them the same questions - and these should be specifically on what you need to feel confidence that using the provider doesn't expose you to more risk than you can accept.

Have a look at this question about EC2 security for a bit of info.

Some more:

Amazon provide services to major corporates so have a vested interest in physical datacentre security - whether you can rely on this is up to you. Odds of you getting a guided tour are pretty slim.
Similarly, they aren't that transparent about a lot of their security features, but they do have a lot to lose and decent security budget so have put in place the features they feel are appropriate for their customers.
If you need a PCI certified provider (no matter what they are worth in the real world) then Amazon will fit the bill. If you don't need that, then you can ignore that feature as almost irrelevant - just accept that it means they have shown protection of account data sufficient to pass PCI-DSS.
Cloud services involve divesting some control around security and availability. If you have a critical uptime requirement or need to be able to carry out on the spot checking of hardware, the cloud may not be for you.


Extract information about certificate from a .pfx file without the password

Assuming the file is actually encrypted (its optional - at least in the file spec) I don't believe so.

Newer .pfx files are PKCS Archives. These support encryption both at the file and container level - but seeing as the entire key would be in a single container I don't believe it would be possible.


What is same site scripting and what are some exploit scenarios?

Based on the link from Julian's answer, it's pretty straightforward. It does seem a little dangerous but nothing critical.

How the web works

Imagine you have a website. Browsers send HTTP traffic to that website. This traffic includes session cookies. The site should be TLS protected, or your session cookies are going over the internet in cleartext, for anyone to read. You also need to protect your session cookies (and any other sensitive cookies) with the 'secure' flag to prevent them from being sent over http traffic, or your browser will just send them to any server that intercepts your cleartext http requests. And you can use HSTS to prevent usage of http to your server.

When the browser tries to communicate with the web server, it communicates via IP -internet protocol. Internet protocol doesn't use host names, but rather uses ip addresses - 4 decimal separated values such as 127.0.0.1.  the browser uses dns* to learn the ip address for the hostname to which you want to connect. The web server has an associated dns server whose job it is to respond to 'what ip address is this host'. Every named host on the internet is supported by a dns server.  Assuming dns is secure**; the browser gets the server's real ip address from the real dns server.

The class of misconfiguration in question

But what happens if the dns server is misconfigured and returns the wrong ip address? If the desired server is www.example.com at 1.1.1.1 and the server sometimes returns 6.6.6.6, which may belong to evil.com, what does the browser do? The browser connects to 6.6.6.6, evil.com.

Now, this isn't so bad at first blush. Remember how the traffic is TLS protected? Well, TLS lets the browser detect that 6.6.6.6 is not example.com because 6.6.6.6 does not have the private key that goes with example.com's certificate. The browser rejects the connection attempt to evil.com.

Ah, but what if TLS isn't used to connect to 6.6.6.6? In that case, there is a risk. The cookies don't get sent, because you remembered to use the secure flag on your cookies. However, the same domain policy that protects pages served from one domain against pages served from another domain breaks down - these servers are both in the same domain. In theory, malicious JavaScript on 6.6.6.6 should be able to interact with the page served by 1.1.1.1. This is bad. There may be other attacks that suddenly start working as well.

Thankfully, this misconfiguration shouldn't happen in practice.  The DNS server owned by example.com has no reason to serve evil.com's IP address as though it represents example.com.  Typos causing this are unlikely. Even if a typo did occur, users would notice outages before the attacker would likely have the time to make use of the window of opportunity.

The specific misconfiguration in question

But what if there were a common misconfiguration? The security focus message lists one: forgetting to put a period at the end of the definition for localhost. Due to the way the server parses the configuration file, localhost then becomes interpreted as a hostname within the current domain instead of a fully qualified domain in and of itself.  Going back to example.com: if example.com defines localhost incorrectly, we get a resolvable ip address for localhost.example.com.

This routable address for localhost.example.com, which exists within the example.com domain, is assigned a loopback ip address. The loopback address is a special address that computers know means 'myself'. When you try to connect to the loopback address, you are always connection to the machine sending the message, by definition.  In fact, most operating systems will not even send the message to the network when the loopback address is used - then traffic stays entirely on the local machine.

Impact

Just like evil.com could attack your usage of example.com in the original misconfiguration, your computer can now attack your usage of example.com.  The main thing that really seems to lower the risk is that the attacker has to be on the same machine as you are. If they're not, they can't open a network port over which to serve HTTP traffic to your browser from the local machine.

If the attacker is not on your local machine, they cannot make use of this specific misconfiguration.

Example

Let's take an example to try and help understand how this works. Victoria, our victim, is logged with shell access to vicki.com, IP 2.2.2.2. Mallory,  our attacker, is also logged into vicki.com with shell access. Evelyn, our other attacker, controls evil.com at 6.6.6.6.

Vicki opens her web browser within her vicki.com shell,  and browses to example.com, which has a misconfigured DNS entry to include localhost in the example.com domain. Vicki clicks around and does stuff,  and eventually,  for whatever reason follows a link to localhost.example.com.

Mallory prepared for this eventuality.  He is running an HTTP server on vicki.com, with malicious JavaScript. Vicki's browser loads Mallory's malicious page and executes the JavaScript payload. Mallory's JavaScript can now access vicki's account in example.com and do anything that vicki could d,  as vicki. If vicki could read a private message that was sent just to her now so can mallory. If she could delete a user account, now so can mallory. Mallory,  quite literally, the same level of access to Vicki's account that Vicki does -  until she closes her browser*** . Mallory has,  quite literally, delivered a cross site scripting payload using a different attack vector.

Note that Evelyn didn't do anything here and that evil.com didn't come into play. Same site scripting requires the attacker to be on the exact same machine that you are on. Evelyn doesn't have that type of access to vicki.com.   evil.com doesn't have that kind of access to vicki.com.

Note, also, that Vicki had to load localhost in her browser.  Servers don't normally include links to localhost,  so there would likely have to be some social engineering to get vicki to load that malicious page.

Risk: medium

Between a misconfiguration,  the attacker already being on your system,  and the need for social engineering to accomplish the attack,  this isn't all tht serious.  If I had to score it with CVSSv2, I'd give it 6.0(AV:L/AC:H/Au:S/C:C/I:C/A:C),  assuming that vicki is an administrator of example.com,  and her web access includes full administrative access. NVD ranges for cvss would call those medium (https://nvd.nist.gov/cvss.cfm)

About the name 'same site scripting'

Like many names in the security field, this is a bit of a misnomer. It's not really the same site that's performing the xss attack. It's the same domain, but the site happens to be the local machine, not the website in question. This is also not an xss/JavaScript injection issue, but a DNS misconfiguration that bypasses the same domain policy and allows non-injected JavaScript from the local host to run in the context of pages served by the misconfigured domain.

It would have been more accurate to name it something like 'Same-Domain Policy Bypass via DNS Misconfiguration', but that's not nearly as sexy.

End notes

* I intentionally omit all details of using the system's resolver to keep this answer a reasonable length and avoid losing the reader in the details.

** We know it's not totally secure, but just pretend it is so that the answer can focus on the question asked

*** Assuming no other vulnerabilities that allow Mallory to persist his access.


When the machine says that "you have the private key corresponding to this certificate", then this means that you have the private key which corresponds to the certificate, not that the certificate itself contains the private key.

Asymmetric keys come in pairs: the public key and the private key. They are mathematically linked to each other, but rebuilding the private key from the public key is considered unfeasible (way too expensive with existing technology). This is why the public key can be made public: this does not reveal the private key (which is kept private).

The certificate contains only the public key. The certificate is inherently public and can be shown to the whole World. When the certificate is used in SSL, it is indeed sent, as part of the protocol, to the peer. The private key, of course, remains private. In your case, the private key was generated within the entrails of Windows and it stays there. The localhost.cer file contains only the certificate.

(Unfortunately, some documentations designate by "certificate" the union of the certificate itself and the private key; this abuse of terminology is a great source of confusion. In the Windows world, when a certificate and a private key travel together as a file, the file follows the PKCS#12 format, also known as "PFX".)


Should I consider my Google Storage identifier as a secret?

That answer really comes down to whether or not you are happy showing off where your data is stored.

If the project is a commercial grade product then, personally, I would advise that you don't make it visible to the public. Afterall, people may be more prone to attempt hacking into the account as you are giving quite a bit of information away. Basically you are sharing your documents ID with them, which doesn't sound like a good thing to do regardless of the case.

To be honest, there probably isn't a right or wrong answer in that sense, rather one of ethics.


Is it normal if user gets logged in Facebook or Twitter after they use Like or Tweet button?

Public access computers are typically set to destroy all user activity upon log out, or at least they should be. So don't worry about that so much.

Now for the bulk of your question: You are not responsible for Facebook's actions. You didn't code your api, you don't administer their account sessions. But since you have this knowledge, share it with your users. Next to the "like this page!" button, put a small disclaimer: "clicking this will require you to log into facebook on this computer." Now your users know they've logged in, and they can logout after they finish browsing. If they don't, then that's something they have to deal with. And if they don't understand because they're 10? Well, that's why we have the age limit of 13 for Facebook and other sites that collect data on people ;)


How secure is the private storage of a mobile app

The file system on an Android device is not encrypted. iOS does this by default. However note that once you are at runtime this is not really relevant anymore. They only protect against attackers who have gained access to the phone and have removed the storage for analysis.

On Android, applications are sandboxed and as long as you are not running a rooted device one application cannot access the other application.

Generally if you want to encrypt your database it should be done from the application itself. Furthermore your encryption key should be derived from a password the user needs to supply every single time. Caching the password should be done carefully as you could dump it at runtime. The password or key should not be stored on the device.

Note that there is no foolproof way to protect your data once an attacker has gained access to the phone. You can only make it a bit harder, but not impossible.


What does "if ntp is configured to allow remote configuration" mean in this ntp CVE?

ntpd can be configured remotely with the ntpdc command. See e.g. this for what you can do (add and remove servers e.g.). This is normally only enabled for localhost, if at all.


Which is better in "DH-group14-sha1 with hmac-sha2-256" and "DH-group-exchange-sha256 with hmac-sha2-256" from performance and security perspective?

The unstated context of this question is an SSH server: these are negotiable cryptographic options in the SSH transport protocol. You may want to update the question to indicate this.

From the form of your question, I first want to clear up something. When you ask:

  Is it ok to use diffie-hellman-group14-sha1 along with hmac-sha2-256. Would diffie-hellman-group14-sha1 and hmac-sha2-256 combination be good from performance and security point of view?

... this appears to imply that you think there's something to be concerned about in the mere combination of these algorithms. There isn't; they are entirely independent. These:

diffie-hellman-group1-sha1
diffie-hellman-group14
diffie-hellman-group-exchange-sha256

... are key exchange algorithms. They are used early in the transport protocol to establish the session keys (encryption/MAC), authenticating the server in the process. These:

hmac-sha1
hmac-sha2-256

... are names of MAC algorithms used to implement integrity checking for user data subsequently transmitted by the protocol. These are used later, with keys derived from the output of the key exchange. If you're asking the question because you think there might be some issue in "mixing" SHA-1 and SHA-256 -- so far as I know, there is no reason to be concerned about that in this scenario.

  Would there be much performance impact if we use diffie-hellman-group-exchange-sha256 and hmac-sha2-256 combination.

Now you've introduced the "group exchange" version of the SSH Diffie-Hellman key exchange. This allows the server to use locally configured Diffie-Hellman parameters (finite groups), instead of the fixed groups prescribed by the "group1" and "group14" exchanges. The performance impact would be determined by the groups you provide, mostly by the size of the groups in question. You can reduce the overhead by using smaller groups, with a corresponding reduction in security. Keep in mind that the client requests a modulus by size, so you must provide groups large enough to satisfy your clients.

SSH Transport Protocol (http://tools.ietf.org/html/rfc4253)
SSH Diffie-Hellman Group Exchange (http://tools.ietf.org/html/rfc4419)


Convenient cross-platform help on checking secure hashes like SHA-256

For Windows, you can use PowerShell, which is installed by default on Windows 7 / Server 2008 R2 and onwards. The Get-FileHash function was introduced in PowerShell v4, which comes with Windows 8.1 and Windows Server 2012 R2. For older PowerShell versions, these scripts from James Manning's blog will do the trick.
Example of Get-FileHash usage:
C:\Windows> Get-FileHash -Algorithm md5 .\notepad.exe

Algorithm       Hash                                                                   Path
---------       ----                                                                   ----
MD5             24DA05ADE2A978E199875DA0D859E7EB                                       C:\Windows\notepad.exe

Supported algorithms are SHA1, SHA256, SHA384, SHA512, MACTripleDES, MD5 and RIPEMD160.


"RATs" or Remote Access Tools are pieces of software.

The issue is when you discuss things, everyone makes certain assumptions. For instance, I'm assuming you are talking about remote access by software.

Intel has a remote access "tool" via it's VPro platform, which isn't software. It's built into the processor/chipset. An OS reinstall would not remove it, and with VPro an administrator can even access the BIOS remotely.

If you want to make another assumption that the tool has a rootkit, and has even place itself into the boot sector, a reformat and reinstall would still remove it. A simple reinstall might not, as the Windows installer might not clear the boot sector.


Is it possible to get a flash src after a redirect or an element inside an embed/object/iframe tag (cross-domain)?

If the user is authenticated and an attacker manages to use some kind of exploit to inject javascript (or flash) into the page, then yes, the attacker will be able to steal the secret token. They simply make a request using AJAX to the /auth endpoint and read the redirect URL that comes back. This was made possible recently by the addition of the responseURL parameter to XHR requests.
They can then do with the token as they wish.

To avoid this, you could use some method of sending back the token that javascript and flash can't access (such as setting an HTTPOnly cookie). That way, the attacker can make requests all they want to the endpoint, but they won't be able to access the cookie using javascript.

If you need the token to be readable by your javascript, then you've got a bit more of a tricky problem.


Detecting and preventing 'phone home' behavior in PDF files

Is it possible for PDF documents to dial home?

Yes it is, at least with Adobe reader products (see here):

  In addition to visible links in a PDF document, form fields can contain hidden JavaScript calls that open a page in a browser or silently requests data from the Internet.

How can I tell if a particular pdf does this?

I'm sure there is a way to do this, but I do not know what it is.  Possibly the adobe pdf reader would show you what features a particular document uses, but I don't use them so I don't really know.  I would argue that the more important question is...

How do I protect myself from a PDF file calling home?

First, I should say that anti-virus scanning is NOT the way to do this.  For one thing, "dialing home" is not a virus in a pdf, it's just use of a "legitimate" feature.  For another thing, virus scanning is something of a broken security model: a new virus will make it past the scanners every time.

Fortunately, it is possible to disable a number of options such as web links and JavaScript using Reader's preferences (see here for instance, note that the Adobe term "links to the Internet" does not refer to usual hyperlinks like the web has, but actual connections).  You probably want to permanently disable internet access and JavaScript: very seldom do you need these features, and they just expose potential problems.

Practically speaking, this is really all you need to do to keep yourself safe.

However...

There have also, over the years, been vulnerabilities discovered in various pdf viewers, making it possible for a specially crafted pdf to do nasty things like execute arbitrary code.  There are ways to mitigate this as well: modern versions of adobe reader have a built-in sandbox that you can enable, see here.

Presuming you are running on a system that you keep patched, this is probably not a huge risk.  If you need to make extra extra sure, using a virtual machine (like VMWare or VirtualBox).  I would suggest this procedure:

Create a virtual machine and install pdf reader software on it
Set up a shared folder between the host machine and the virtual machine
Use this shared folder to copy the pdf files to the virtual machine.
Shut down the virtual machine, disable it's network and the shared folders
Take a snapshot of the virtual machine's hard disk state
re-start the virtual machine and view the pdf files.  Since the network and shared files are disabled, there should be no way for anything nasty in the pdf files to get off of the virtual machine.
when you are finished, shut down the virtual machine, and roll back it's state to the checkpoint.  Now anything bad that the pdfs might have done to our virtual machine is gone.

However...

All that being said, it might theoretically be possible for there to be flaws in the vitualization software allowing something extra extra nasty in the pdf file to escape.  We were in the realm of extreme paranoia with the virtual machine, IMHO, and we're WAY over the edge now, but for the sake of completeness, an airgapped physical machine would be an even more secure option.

(As Deer Hunter's comment suggests, using physical hardware that is not connected to any network which you destroy afterwards would be even more secure, though we're getting exponentially more paranoid by the minute).


Burp proxy between non proxy aware device

Have you looked at burps support for Invisible proxying?  It sounds like it would help with the test you're looking at as it's designed to let burp work with non-proxy aware clients.


Cryptography protocol suitable for two-way radio communications

First thing to do is define what you mean by "secure and authenticate". You need to put into words who the attackers are, what they can do, and what they should be prevented from doing.

On example of such an attack model is the following:

Attackers are outsiders. They eavesdrop on the common channel (the radio waves). They want to obtain the confidential data that the group members exchange with each other. The group members trust each other.

If that is the attack model, then it suffices to come up with a shared secret K, that all group members but no attacker knows, and then encrypt packets with some symmetric encryption algorithm (say, AES in a suitable mode) using K as key. Initial distribution of K can be done by having each group member own a RSA key pair; one group member generates K randomly, encrypts it with the public key of each group member, and broadcasts that.

Now let's extend that attack model into another one:

Attackers are outsiders. They eavesdrop on the common channel, but will also attempt to send fake messages, sometimes replaying previous messages, with or without alterations. Such fake/replayed message instances shall be reliably detected and dropped by group members.

Now you also need a MAC for each packet (so that the attackers can only replay previous packets, not create new ones or alter existing packets), and some sort of connection context so that replay attacks are detected. This can be done by embedding a sort of time stamp or counter in each packet: each participant remembers the counter values for the last packets received, rejecting packets which have already been seen or which have a "too old" counter value. Such mechanisms are often called window-based and there is some balance to strike between replay attack prevention, memory requirements (to remember past packets), and tolerance to packet loss due to the unreliable nature of the transport medium. Peruse DTLS as an illustration of how the SSL/TLS protocol can be adapted to packet-based unreliable mediums.

If the attacker is allowed to try to send fake messages, then he might also be able to advertise a fake RSA public key. Distribution of public keys is a matter of Public Key Infrastructure, with certificates being the usual solution.

Maybe we want more ? E.g., what about the following:

Group members are attackers too. Each group member will try to eavesdrop on and/or interfere with one-to-one communications between other group members.

In that case, you will need pairwise key exchanges. For any pair of group members A and B, there must be a shared secret KA,B that other group members and outsiders do not know. This can still be leveraged from pre-distributed RSA Key pairs: when A wants to talk to B and they don't already have a shared secret (or they forgot a previously shared secret, e.g. B rebooted his computer and that shared secret was in RAM only), then A generates a new random key KA,B and encrypts it with B's public key.

There again, read up the complete TLS and DTLS standards: they are quite readable, and that will show you what you have to think about.


return-to-libc can't get the system function address

It seems I found an answer myself, at least a sort of.
Well, as I suspected, kernel developers are very far away from me.
Indeed the "Address space layout randomization" seems to produce the behaviour I observed on my system.
When I read the wikipedia article, I understood address space is structured once each time kernel starts, but testing it I verified that actually things are slightly different.
GDB has a neat feature called "disable-randomization" which is on by default.
In spite that, libc system(), and I guess any libc function, changes its address each time I start GDB.
Digging deeper I finally found that kernel feature may be disabled at kernel level through "/proc/sys/kernel/randomize_va_space".
My kernel by default was set it to the value 2.
Setting it at 0, I realized the randomization stops.
Everything seems clear now, but there's still a piece which does not fit.

Why the code I wrote to print the libc system address, when I run it
from the prompt produces any time the same address?
Is the code I wrote, that do not request the feature producing this
result?

UPDATE
if there's someone is good enough, I'd like this guy to explain me this:

$ cat /proc/sys/kernel/randomize_va_space
0
$ ldd /tmp/t
        libc.so.6 => /lib/tls/libc.so.6 (0x00110000)
        /lib/ld-linux.so.2 (0x00843000)
$ ldd /tmp/t
        libc.so.6 => /lib/tls/libc.so.6 (0x00dcd000)
        /lib/ld-linux.so.2 (0x0037b000)
$ ldd /tmp/t
        libc.so.6 => /lib/tls/libc.so.6 (0x00ab7000)
        /lib/ld-linux.so.2 (0x00f14000)


How does Gmail detect if my email account is accessed from another computer?

How does Gmail detect when my mail is accessed from another computer? Does it keep track of my MAC address to check whether a new device is used? I think it doesn't have anything to do with IP address.

You can test this by logging in with a different browser on the same computer and observing the account activity details (link is at the very bottom of your gmail front page.

Detail should show a different browser at the same IP address.

If you sign out of your gmail account, invalidating the session ID, and then log in again, you will not get a notice because the device is trusted, meaning google stores data used to fingerprint your computer and browser.
My other browser above was not known or trusted so I got a 2 factor prompt when tried to use it.  Subsequent logins with that other browser did not get a notice / 2fa prompt because that browser is now trusted.  If you look at the cookies in your browser, you see many google cookies that provide this trust.

I cleared all google related cookies from my other browser and when I tried to login again, it did not recognize that browser as trusted.

If I walk down to the corner coffee shop or use a VPN, it will not look like a new device to google because the session cookie and the fingerprint data I mentioned above will be the same.
Google does not know your computer's mac address (Unless you are using google wifi).


It depends on whether or not you are a full time employee of a "consulting company" or if you are an independent contractor.

Let's say company WeHaveHoles AG wants their security tested.

In the first case, they hire the company WeTestSecurity AG.  WeTestSecurity AG hires you as a full time employee.  You don't need any special insurance - your employer does.

In the second case, WeHaveHoles AG contracts with you independently to test their security.  You will probably want "Errors and Omissions" insurance to cover you in case you make a mistake and accidentally damage them.


TLS 1.2 supports certificates using SHA-1, as described kind of cryptically in the RFC:

   -  Any certificates provided by the client MUST be signed using a
      hash/signature algorithm pair found in
      supported_signature_algorithms.

   ...

   enum{
       none(0), md5(1), sha1(2), sha224(3), sha256(4), sha384(5),
       sha512(6), (255)
   } HashAlgorithm;

Certificates signed with SHA-1 are not trusted in modern browsers, but switching TLS versions does not change that.


The fact that you can run a schema query is a first red flag, especially if this is a production environment endpoint.
Being able to run schema queries gives an attacker everything they need to explore the API, and if there are any API methods/queries/mutations that can be misused then the schema query will make it easier for them to find any potential weaknesses.
Once you can run a graphql schema query, the next step is to look for queries/methods that can be misused by an attacker, and then go from there.


Server-side "remote file inclusion" vulnerabilities are sometimes classified as XSS, because they include server-side script from another site. I suggest not to use this classification because most people associate XSS with JavaScript.

That being said, JavaScript XSS may lead to a server side remote include: Assume there is a function which allows administrators to upload plugins. If there is a XSS vulnerability somewhere in the same domain, an attacker can use it, to gain access to the administrator-session and upload arbitrary program code, such as phpshell.

Furthermore the upload function might not even be intended for plugins but just for images. It might not properly validate the upload, and put the uploaded files into a directory in which .php files are executed, for example.

This might either be a bug because the developers were not aware of the risks, or just a dangerous omission based on the assumptions that only trustworthy people upload files. That's were the XSS vulnerability comes into play.


Where should I store a private key for a web application?

So, let's get it out of the way first - there's no point in encrypting the key.  Because to decrypt it, you'll need THAT key, which will then need storing.  It becomes a chicken and egg problem - ultimately, you need something stored in cleartext SOMEWHERE.

So where.  The traditional answer is in a file on the filesystem with only read access for the user whom the application is running as.  You then ensure that only this application runs as that user and that is about as secure as you can do.

There are other options, though.  You can use a Hardware Security Module (HSM) to store the key.  They have some more sophisticated options for accessing the key.  This is pricey, whether you are hosting yourself or hosted externally (and not all hosting providers offer dedicated HSMs).  You could also host a key management system, like Hashiko's Vault or KeyWhiz (preferably on another system, only accessible to this system).  These are designed to solve this problem and have some more sophisticated options for accessing the key as well.

You'll probably want to be on a dedicated host regardless, though - shared hosts add extra security concerns and layers that will cause you to be uncertain about exactly who has access to what.


Generating temporary passwords/tokens using RNG

Since it looks like you are using Ruby's default RNG, the Mersenne Twister, it is possible for an attacker to obtain the seed of the RNG, and therefore compromise all past, present, and future numbers generated by the algorithm using something like mt_derand. It is probably a better idea to use SecureRandom instead.


Overflowing the buffer yet not jumping to address

Try jumping to 0xe5894855 instead. The 0x06ca migth be just a pointer.


Can someone hack my Facebook if i give them my browser for a while?

Once someone has access to your computer then can get absolutely everything you have access to. If this was not possible, then you would not be able to do those things either.

The way to avoid this is to not give someone access to your computer or your logged in session on the computer. Log out and have them log into another user.


What evaluation criteria would you use for an Oracle scanning tool?

A way to test if one scanner is better than another is to use the scanner against an application that you know is vulnerable to attack.  One of the best examples is Wavsep,  which was used to compare many open source and commercial applications.   All of the results are available, and the only tool to pass all of the tests is Sitewatch,  if you don't believe me,  then you should try it.


Web Application Firewall using web app source code analysis

If you can actually determine the valid input values from static analysis, you can use that to guide proper input validation in your application.  However, with that lack of input validation, most static analysis tools would not be able to determine the appropriate answers.  Web Application Firewalls are used to defend against the unknown vulnerabilities and common patterns (e.g., XSS and SQLi mostly).


Does TCP/IP protocol offer a reliable way of determining who the actual sender was?

The common, low-level attackers (i.e. people in their home) cannot efficiently spoof their IP address for TCP connection because they will not receive answers. Remember that IP routes packets based on the destination address, so if you send a packet with a fake source address, it may still reach the destination. Some routers may be offended at seeing a packet with an "impossible" source address, in the same way that when you see a friend coming back from holidays with a heavy sun tan, and he claims he was in Great Britain, then you don't really believe him. However, chances are that the packet will go and reach its destination.

Any answer, however, will go to the alleged source address, not the real one. The attacker won't see the responses, and thus must work blindly. This is challenging for TCP, because of the three-way handshake: for the connection to be established, the client must be able to send back to the server an "ACK" packet containing the sequence number that the server sent back in its "SYN+ACK". That sequence number is chosen randomly, as a 32-bit integer; modern operating systems now use reasonably strong (unpredictable) random number generators (see RFC 1948). This implies that our spoofing attacker has only one chance in about 4 billions to get it right.

The bottom-line is that when a TCP connection is actually established, then the server has some rather strong guarantee that whoever it is talking to can see the packets sent by the server to the alleged client IP address. Therefore, faking your IP address for TCP connections is possible only if you are very close to the alleged IP address owner (on the same subnetwork / WiFi access point), or if you have control of a router in the path between the server and the alleged IP address. The latter case means that you are a rather serious attacker, not just any script kiddie in his basement.

MAC addresses are purely local: they don't matter, and are not transmitted, beyond the local subnetwork. A remote server won't see it. Changing your MAC address is useful only to fool local switches and access points which employ MAC filtering.


What is the risk that Windows 8's loopback protection feature protects me from?

Fiddler is a proxy server that runs locally on your machine.  For this to work it needs to use the loopback network interface (localhost).  In Windows 8 has a new runtime that allows for the running of Immersive Apps.  For all Immersive Apps, Win8+ runs them in an AppContainer.  All AppContainers are forbidden to use send network traffic to the localhost.  Fiddler falls into this category of applications, but it is obviously a necessity for it to use the localhost interface.
The exemption that you grant simply tells Win8+, "Hey, this application is cool, let it use the loopback interface to do its job."  And Windows says, "Fine!  But we don't like it."  There is no real security benefit, it's just what needs to happen for Fiddler to work.  Microsoft would probably argue that it's actually more insecure for you to allow Fiddler access to the localhost.
I just realized I didn't quite understand your question.  The loopback interface essentially sends packets to itself.  So the Windows kernel would pick them up and process them as best it can.  An exploited application might not have direct access to the operating system yet.  It could bind to the localhost, send a malicious packet through the interface and exploit the operating system this way.  Here's an example.
This link explains more on Fiddler w/ Win8+
Here's a program to manage your exemptions.


Wondering about open port found while using VPN service

NOTE: All of this assumes you are talking about TCP 111 (vs UDP).

If you are using a VPN service, you are sharing that Public IP with many customers and being NAT'd somewhere along the way. This Public IP is generally not directly routable to you as a user of the service, as such, there isn't much to worry about.

That being said, it's hard to know (without more info/probing) exactly what is running on that open port. In general, ports 1-1023 fall in the Well-Known Ports range, though that's not to say that something else can't be running on this port, but it's likely an RPC (remote procedure call) service like SunRPC.

TL; DR You're probably fine, but if you're still worried about, contact the VPN vendor and ask them exactly what it is and what it's used for.


How do you identify a website's form-type?

View the page HTML source and locate the form tag.

Look for the action and method.

e.g. on www.facebook.com the source shows

<form id="login_form" action="https://www.facebook.com/login.php?login_attempt=1" method="post"

Here you can see that it is a https form and that the method is POST.

If there is no action then the default is GET.

How these correspond with the terminology in the individual tools will differ, but learning the different HTTP methods will be useful in order to attack them.


Have any viruses leveraging the GPU been discovered in the wild? What is the mitigation?

The first GPU-assisted malware is considered to be the Badminer trojan reported by Semantec in 2011. Although its GPU leverage level is pretty low and the risk is low too, this is still the first precedence of using the GPU maliciously in the wild.

Another more intrusive example of the same idea is RiskTool.Win32.BitCoinMiner.

Then antivirus designers started to think really hard. No AV vendor will invent effective GPU-related protection until high-risk GPU-assisted malware starts to appear in large volume and more traditional AV approaches fail. It won't happen very soon. Meanwhile, it's just not feasible to protect against a still imaginary danger.

Everything is a potential attack vector as soon as it becomes more and more profitable. There's no such thing in the world that is not attackable or misusable in some form. Regarding particular WebCL, from Wikipedia: "Currently, no browsers natively support WebCL, seeing as it is new. However, non-native add-ons are used to implement WebCL."


Bypassing the command/script specified in /etc/passwd

Assume there is a (probably unintentional) backdoor.

The default /etc/passwd on Sun workstations of the early 1990s included an entry something like this:

games::0:0:games:/nopath:/bin/false

In other words, an account named 'games' with no password.  Apparently the genius who came up with this idea had no imagination, and assigned it a uid and gid of zero (i.e. root and wheel).  Generally, that was okay, as the home directory was meaningless and the shell was set to a program that always exited with failure.  Furthermore, the default settings for any access by network -- telnet, rlogin, rcp, ftp -- were set to prevent access by any uid of zero.  There was a separate passwd entry for root, with a properly-set set password, home directory, and shell.

This meant if you tried to log in as games, the following would happen:

Logging in as games at the console would at first succeed, but then spawn the /bin/false shell, which would immediately exit.
Using telnet or rlogin would outright deny the login.  Even if it had succeeded, the /bin/false shell would immediately quit.
FTP and scp don't use shells, but they were configured to deny access to uid zero, so you couldn't log in this way.
A GUI login would start up the default GUI services, including a window manager, clock client, and a terminal.  The latter would immediately exit because its child shell would immediately exit.  So you would get an empty screen except for a clock.  (More on this below...)
If you really had to log in as root, you would either have to do that from the console, or first rlogin/telnet as another user on that machine and then su root.  Either way uses the root passwd entry rather than the games passwd entry, and thus works they way root should work.

So the games account appeared to always fail, unless you did a GUI login.  In that case, the only thing that appeared was the clock.  However, you could right-click on the background to get a root menu, with a factory-provided list of programs that users would normally customize for themselves.  (Customizing the menu didn't work for the games account; I don't remember exactly why.)  You could try to bring up more terminal windows, which would all fail.  There was a puzzle game (which may have been the impetus for the account in the first place).  Another choice was to log out.  And then there was the graphical debugging tool, dbxtool.

dbxtool was a graphical frontend to the dbx symbolic debugger, similar to today's gdb.  Being uid zero, you could attach to and control any process on the system, although this was not useful because programs provided by Sun were compiled without symbols.  You could launch a shell, but this would use your SHELL environment variable, which was /bin/false.  However, you could also change environmental variables!  This meant you could get a root shell by the following:

Log in via the GUI as games, without password.
Right-click to bring up the root menu.
Start a dbxtool.
setenv SHELL /bin/sh
(Optional) setenv HOME /
Start a shell with !
Because the terminal is not set, do stty sane

Voila, root shell without password!

So, do not assume that a user can't escape out of an invalid shell.


The Luhn algorithm is a very poor choice for this application.  You are looking to apply an easily reversible algorithm for a security purpose.

The Luhn algorithm does one thing:  check digits.  The only purpose it should be applied to is for a small amount of input checking, specifically checking for typos such as missing digits or swapped digits.  It also works for barcode validation, such as checking UPCs or Code 3 of 9s to ensure the barcode reader properly read all the stripes.  But those are the limits of what it should be entrusted with.

For example, in your case I could iterate from "01212301-0" through "01212301-9" until one of them granted me access.  I only have to try ten times at most.  I can easily do this by hand.  The Luhn algorithm can not protect your system.

For use in a security application, it would likely call for a scheme using a cryptographically secure hash, such as SHA-2.  Of course, that kind of change entails a huge change to your system - a Luhn algorithm outputs a value from 0-9, whereas a cryptographic hash produces a digest of 40 hexadecimal digits.  But all of that is probably not relevant, because you would be better off having a system designed to perform access control handling that responsibility.  A system like Active Directory or LDAP is designed exactly to enable this kind of functionality in a secure fashion, and solves the insecurities of your home-grown solution.


Protecting Database Content against leaks

The only reason not to encrypt data inside the database columns that I am aware of  is performance/data duplication concerns. Are you going to be doing joins or lookups from the database based on the data in question?  If you don't need to do that, feel free to encrypt the data in the database columns

I believe the proper way to do it would be to encrypt the columns in the database, and store the encryption key in a separate datastore, such in a file in the filesystem.  The decryption should happen on the fly in the web application whenever the data is requested.  That way if the database is ever compromised via SQL injection, the attacker will be able to retrieve encrypted data.  Keep in mind that you if you do not have a unique key per user, it's possible for an attacker to determine two users which have the same phone number since the same plain text ciphered with the same encryption key will give the same cyphertext.  Please keep proper key rotation in mind as well.


That tool requires you to use ASCII armored encrypted files.  Your example has issues as the encoding on a binary file as displayed in a text-editor is not unique (and the web application doesn't know how to interpret it properly).

The easiest way is to just use the command line with gpg (gpg and PGP are generally compatible when they follow the OpenPGP standard except in a few rare cases).  For a complete example, you create a trusted key pair (again for this demo I chose no passphrase on the key) with:

$ gpg --gen-key
gpg (GnuPG) 1.4.20; Copyright (C) 2015 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Please select what kind of key you want:
   (1) RSA and RSA (default)
[...]
Your selection? 1
[...]
Key expires at Thu 26 Oct 2017 01:58:43 PM EDT
Is this correct? (y/N) y

[...]
You selected this USER-ID:
    "john doe (don't use) <j@j.com>"
[...]
gpg: key DA65E019 marked as ultimately trusted
public and secret key created and signed.

which in my case created a new trusted keypair called DA65E019.

Then I can encrypt a file without ASCII armoring it (basically encrypting in base64 with linebreaks):

$ gpg --encrypt --recipient DA65E019 test.txt

that creates a file called test.txt.gpg or with ASCII armoring it:

$ gpg --encrypt --armor --recipient DA65E019 test.txt

which creates an ASCII armored file called test.txt.asc.

-----BEGIN PGP MESSAGE-----
Version: GnuPG v1

hIwDLaGCjcd4AvcBA/wLm/sLb5yha7dPIz4288dtgR0a4zdynB+MZ1ikH8aVWi8x
w6aR3DoA5IyOQkg7whC2vWlWHaJLkrSOWYwnvHVSNm/bXVtXkLq9ZLWnvLVjux+E
+GVQDr8nCSdGR04ZfQ741LjDWubUzlZFacIlMuSmvMrfepIcl5i1ydr4UNA9OtJR
Ac0pgzY3odsl8nmcO+v9XmRpekDm8O3TTHAHN5ci1+iqxI6W/VOEHeuan8HW00Hh
E10+X0Sb5cNCNJBtrIE4G06F2JMKt53o4kTULiSPjT8A
=WEJE
-----END PGP MESSAGE-----

I can use your tool to decrypt this message with your online tool, by exporting my secret key:

$ gpg --armor --export-secret-key DA65E019
-----BEGIN PGP PRIVATE KEY BLOCK-----
Version: GnuPG v1

lQHYBFnw0OUBBADpSAnz6pdZYIyeRHJDi4AuTyEAmZTzFNbbS5Ble0wRnydzkl0o
/1pF0FpnkpFcutN2U1fQA/wVi2mYnUT5m3dY9kQVM9qaOShELg21wuqbvEjE+Y1f
+8+aTNY8f1eeLO6sDPZcpaGhiPxWfpb+uM5dke6DQ1wO+wZM/zXlRNjVAwARAQAB
AAP/W6pK/uV3g09E8gvDOndebtP5C9tNhBb0NkeC/d1tDp+TSP6CTNHKDxTH8VrO
c7mVzjEBmGN4cp7NZ4Kkz9AfHL3N9J2Y0VwoxtwkVgCFktvYFZZRBGI8tw5utxt1
T0dhPkBMDsPqoLushbooymPKbl9vGTZGMmPD1PWCRBc/yUECAO7qowO1J7PAoR0+
p3Z1mWfUXqD1eRuT5WL/MpP8+aUf5LxjeFqBweC3IWRSO6F6GdfGi6OPR+9rQ5IS
NKIbuJUCAPn2QDWUZiUTTregWgpVe4QkYW5l2h5+GXwdIJAr2mda7hvnR7QWXRbr
uYeN9kLxJsKw1AWZ8+EnyzjluM/fOTcB/j2E/SOel+N5q9fBTZNRjoVTaP8SS4mV
Oqljhdb25j6Dbk7Hn39yr6oQMGQlpF3oe7e4FTynSVvaLDMutqPrcHqjBLQeam9o
biBkb2UgKGRvbid0IHVzZSkgPGpAai5jb20+iL4EEwECACgFAlnw0OUCGwMFCQAB
UYAGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJEBD5wEzaZeAZZIsD/0sF0CMg
uzc8YH/hJT0WyGRKAOvqVrZxoRuSSmcZtBiM4yXXHZfByfuCqNwssJ+MnRyC7n3h
JbqI8CqI2Vfp+Bij9qZQEhhEiZVan62jtzv5ta9SSEoJTIzJNdhi3gmirzTXVM19
Mc0ZqSMGQRwku/TmLb5dfhNeIpnh8j2tlh4mnQHYBFnw0OUBBACzHMrc3YDGu4tj
PBdTFG7ziDOq3pb9pRrIvDDfTnkD5A+WWsOhuk201gnE1fmVoiPN9HiewLIMBekH
oYgFqz2QvIoGe5aGs1vsPb3iTYbLPHkNU2NCmMvDo4eH9pwf0aq/dVOY8LOO/pKy
S0pj0zXdpQJ61emGzCLMky4ScI1U9wARAQABAAP7BDZAh4pGd70wG+Ob0VoZy3gx
VnwryuTkumTkWGnK3HQ+cQwcimwdulFTenu2kZMBp4n690BfPgcL6pSdE2KBiglZ
1APeiPuSM5zYyHJBd2qJdB4s9PEWIIpJFR/XchTMy+1OzpsMZ8xF5dkzx8jwt6JG
U1bpzJIHEH89e07BSV0CAMMfOJr9PxtxsHDUcvdObZvwGcRFffuon9m0N0oG/v0B
j2GM/8Z2xM6ICRCDyH1KNgnxwPxOYtN6JgSq0tUY8GUCAOr+3JsUlsXnmw6iOu/4
d6kiTJaZ/f2Rh6St4Sxc/tfDBKT8bNZZdkG67C+cH0gn09aCemLWDWLm+dk+XWKH
5CsB/RXJdJ2G/0J3ZwQ83YqiFFIc9B1cC5b1Ji5u/prjPVeWVBHA1+gTptWiYgZi
PAugw5HilG4ec9egBJdVGGPPCQ+jNoilBBgBAgAPBQJZ8NDlAhsMBQkAAVGAAAoJ
EBD5wEzaZeAZHoMD/j92pvKe1mr8usWzYFecmZx8uyb1WouxqP+UeEQtry0+IfNJ
Qmlo5UbxYvn5KPg1WIcMOAXlDpm0neBuG/FCIhuUbXq4JVxV5tKJYw2I+Px6jiCD
HivTQ+/NgZdVMcB8k9PqyA96yVyct18KrDAAQ6l8xqzzxXefJRbUaqj8usG7
=yKJT
-----END PGP PRIVATE KEY BLOCK-----

or directly decrypt the binary file test.txt.gpg with gpg in the commandline:

$ gpg --decrypt test.txt.gpg
gpg: encrypted with 1024-bit RSA key, ID C77802F7, created 2017-10-25
      "john doe (don't use) <j@j.com>"
this is a file

In your example, you'll have to import the private key:

$ gpg --allow-secret-key-import --import secret_key.gpg.asc

and then should be have the private key and can use it for decryption.


Is it possible to bypass SNI-based censorship using IP fragmentation?

It's unlikely that IP fragmentation will be able to evade SNI-based censorship. The reason is that SNI is part of TLS, not raw IP. This means that it's very likely that the equipment doing deep packet inspection (DPI) will be statefully re-assembling fragmented IP packets before analyzing them. The days of evading firewall restrictions by fragmenting IP addresses is long over.

The only real solution is to use an encrypted or obfuscated proxy or VPN, with the proxy server operating outside of the range of the SNI filter, such as in another country. There will be a slight hit to latency, especially when connecting to South Korean websites, but it is necessary.


Advertisement on Skype tried to download a file to my computer using Javascript

It seems to me that Skype is using the areyouahuman.com ad tech to only deliver their ads to "humans".

Why it wants to download the file? If you see at "Type" it says: Undecided. Which could be a bug in the areyouahuman server which failed to set the content-type header. In the case of browsers, they normally display the "download file" pop-up when the type is not recognized (similar to what happened to you).

It can be that Skype is using an embedded browser instance to execute the banners. I don't know it that is true, but that seems to be the case.

Does it pose a security risk? I'm sure it is. If Skype is rolling their ads allowing Javascript, someone could potentially inject malicious code into them.

How bad can it get if that happens? If what I stated before is true, my guess is that it can get as worst as any browser vulnerability.

Better to contact Microsoft and report that bug.


Our company needs to conduct an audit of a large ASP.NET solution that was developed for us by a development company.

As mentioned in the comments, likely for this the best option would be to get in an external company with expertise in this area, if it's something your organisation doesn't have experience of.  That said there's several things you could consider in terms of what you want to get from the review which could help you get the right company and commission the right piece of work, some things to consider :-

Are there any specific concerns you have with the application?  Are you worried about back door code, or is it more that you're interested in general security good practice.  Reviewing for back doors is pretty tricky as it can be very hard for automated tools to find them and manual review of large codebases is expensive.
Have you reviewed the processes that the development company used to write the application?  For ASP.NET a common approach would be to follow Microsoft SDL.  If the company used something like this there should be documentation they can provide you around the output of their internal code reviews, threat(risk) modelling and the like.  It's not a guarantee but if they've got a good internal process it's more likely that the application will have a decent level of security.
Do you want the 3rd party review company to do a code review (white-box) assessment, or a more traditional web application test which is usually more of a black-box affair?
Are there any regulatory concerns (eg, PCI).  Things like that can help frame a minimum level of security that the application should have and focus the assessment.


Is mega.co.nz using my Browser for cracking passwords?

Yes, it is possible. But, based on my testing, it's not likely.

What are these files?

During my tests, I was able to locate binary files in my Firefox profile directory at this path:

<PROFILE DIRECTORY>/storage/temporary/https+++mega.nz/asmjs/

This suggests that the files contained therein are temporary files for asm.js. Information about these files is sparse, but this tweet from a self-reported Unity employee provides some substantiation (because Unity worked with Mozilla on game development with asm.js).

On my system, these names of these files followed the template module<NUMBER>. While investigating the contents of these files, I was unable to find any likely passwords, even after registering for an account inside the add-on.

Where did these strings come from?

The strings you pulled from those files are certainly suspicious. I have been unable to recover anything similar on my own system, but there is another explanation.

The add-on includes Dropbox's zxcvbn library for calculating password strength. It is possible that asm.js attempted to optimize that code, resulting in password-like information being stored to your hard drive.

Using only words found in zxcvbn's dictionary, I was able to reconstruct some of the potential passwords you listed:

monoethanolamine: mono + ethanol + a + mine
monoethylamine: mono + ethyl + a + mine

The other passwords were likely generated using other rules (such as character substitution).

What can we conclude?

The files you found are most likely temporary files generated by Firefox. Specifically, when asm.js tries to optimize the zxcvbn code, it likely generates the temporary file containing some of the strings you found.

However, it could also be the case that the extension is using the zxcbvn wordlist to perform bruteforce attacks. A more extensive review of the code is needed to determine if that is the case.


Does the ECDSA signature value (of an OCSP response) need to be DER encoded

According to ISO/IEC 8825-1:2003 BER/DER encoded Integers should be:

  8.3.2 If the contents octets of an integer value encoding consist of more than one octet, then the bits of the first octet and bit 8 of the
  second octet: a) shall not all be ones; and b) shall not all be zero.
  NOTE – These rules ensure that an integer value is always encoded in
  the smallest possible number of octets.

apparently dumpasn1 does check exactly this:

    if( i == 0 )
        {
        if( ( value == 0x00 ) && ( ( ch & 0x80 ) == 0x00 ) )
            warnNonDER = TRUE;
        if( ( value == 0xFF ) && ( ( ch & 0x80 ) == 0x80 ) )
            warnNonDER = TRUE;
        if( warnNonDER )
            {
            intBuffer[ 0 ] = ( int ) value;
            intBuffer[ 1 ] = ch;
            }
        }

See: https://github.com/clibs/dumpasn1/blob/master/dumpasn1.c#L1398

So since the encoding says it is BER/DER encoded INTEGER, it should be.


WPS - Wifi Protected Setup. Technology used to provide connection by 8-digit PIN code. When you are try to connect with pin code, router will check first 4 digits (10^4). If it is not right, you will receive a disconnect after M4 packet. If it's right - we will know a half of PIN. Last half it 3 digit (3^10) + 1 digit (hash sum). It's fastest way to crack the router but not always. Some routers can block wps if it can see brutforce. And signal must be strong.

WPA - you need a handshake to crack a router. But you need to use password list for brutforce.

WEP - I don't remember, it seems, that it very easy to crack and you dont need a password list for that.

For your question - to crack wpa you need:
 1. Enable monitor mode with airmon-ng
 2. Start airodump-ng
 3. Start aireplay-ng in another terminal, read help and send deauth packects to router
 4. After that you will see "Handshake found!!" in airodump terminal.
 5. Save them to file
 6. Start Aircrack-ng with password list and hope, that needed password will be in your password list.


Prove that a Breach Didn't Result in a Leak

Forensic analysis can be conducted, even without auditing on the filesystem, to determine file access and piece together the potential scope of a breach.   Basically all filesystems in use on modern computers are journaling file systems, which contain a sort of circular log trail.  Using tools to read deleted/overwritten disk sectors, one can begin to see what files were accessed when.  If no sensitive files were accessed during the time of a breach, a forensic security analyst might be opt to declare the breach did not result in release of sensitive data.

However, as you point out; these forensic methods may not conclusively determine the extent of a breach.  Your stance is definitely the more conservative and realistic option.

Companies will spend a lot of money on forensic security analysts and push them to declare (this forensic evidence being admissible in Court, at least in the USA, if done properly) the breach didn't release sensitive data in order to dodge reporting requirements.


What to do about "approved" direct banking MITM sites like sofort.com?

After all of us effectively signed a "don't ever disclose your login details to anybody else under any circumstances, or else" agreement with our banks, how is this possible?

Sofort AG is a german company, so I'll focus on Germany: There was an antitrust proceeding, and as a result of it, most banks changed their terms and conditions to allow this (at least according to Wikipedia). It doesn't seem that the proceeding actually resulted in new laws though.

The european Payment Services Directive is currently being updated, and would then also cover third party payment providers (TPPs), so as I understand it, it would then also regulate Sofortüberweisung (the correct name for a service like this seems to be Payment Initiation Services). See also this interpretation here in English.

  is there anything end-users can do except voting with their wallets?

Well, you can lobby politicians, write news articles, search for and expose security flaws, etc. Or you can hope that there are valid alternatives and use them instead.

Security

The implied question here seems to be if this is secure or not.

it adds an additional company which can screw up, and thus reduces security (for no or few benefits).
you have to trust the company (in this case Sofort AG), as they could also just take all your money if they wanted to (but this is the case with a lot of payment options, paypal for example allows any shop to withdraw a random amount of money).
it might increase inexperienced users willingness to enter their password ("I did this so many times, and never did something bad happen before") and thus increase the success and amount of phishing attacks.


Nmap stealth scan shows that port is filtered

When nmap scans a TCP port (e.g. TCP/80 for HTTP traffic) a filtered response means that nmap did not get any response to the packet it sent.  The other options for TCP ports are "closed" which means that in response to the SYN packet nmap sent, the host sent a RST packet (essentially indicating that there is no service listening on that port) or "open" which means that nmap got an ACK packet back from the port (generally indicating that there is a service on that port which is happy to receive connections).

If you can connect to the webserver on port 80 on the machine in question from another system then that indicates that port 80 is open and receiving connections, so if you carry out an nmap scan from the same machine you browse from, you should have received an open response as the server is there and available for connection.


Program or method to create an encrypted bulk file container

If a zip/tarball is an option for you, you can try using PGP to encrypt/decrypt your backup.

PGP uses key pairs for encryption/decryption.

gpg -er <email> -o <encrypted_archive> <raw_archive>

The above solution does require re-encrpyting the whole archive...

If you want file system behavior to allow adding/modifying files, without re-encrypting the whole output - You may want to try eCryptFS with tar for incremental backups (and then you can just use tar to update modified files).

tar -uf myarchive.tar ~/.ecrpytfs/


Secure transactions (on or off the internet) with a credit card

Here in the UK, Visa offers Pre-paid cards. This means that the cards are completely compatible with the current EMV system in the UK, but you have significantly lower exposure to things like identity theft and card fraud.

These cards are not immune to the above, but they limit how much damage can be done with one. Other providers probably offer similar service, but I've never heard of them.

As for "Secure Transactions", all you'd have to do to overcome the problems with the current EMV system is to disable physical signature authentication on the cards, and force them to fix the pre-play attacks that can be carried out on EMV cards due to faulty implementation, and it'd be fine (Not mentioning fixing the ATMs and the EMV POS devices, but that's less the card's fault, and more the infrastructure's fault).


Why do some people really hate security via client-side?

What you've described isn't improving the security of the system.  Its not a matter of opinion or emotion, security just doesn't work that way.   In your example the hash(salt+password) is now your password.  If it wasn't over https,  then an attacker could just replay that value.     Also you didn't really address owasp a9 aka "firesheep" style attacks.


Do spammers use legitimate email marketing companies?

Most of the marketing companies will only bother you with spams(some of which may be non-security scams), but like you mentioned for unsubscribing we usually click on the link it guides us to a (3rd-party) safe email marketing sites.
But the question here is , how can we ensure that email marketing website(on which you are landing ) is not compromised?

Even i have faced this conundrum, so i usually create a separate email-id mainly for signing up on various blogs (like stackoverflow )
That way you never have to worry, even if the spammers know that your email is active.

Lastly, the only way i feel you can determine is if any marketing company is trustworthy enough is by adding a tag to where ever you subscribe (Ex: if email is name@org.com , give your email as name+site@org.com, you can test you by sending test mails). Refer to this link for more info!
That way if a company does not honor your unsubscribe request or sells your information you can find out(as you will get that tag in incoming email!)


Why is my VPN changing my ipv4 address but not my ipv6?

Your IPv6 traffic is leaking. This is because most VPN networks are not compatible with IPv6.
To ensure you don’t have IPv6 traffic running outside the VPN tunnel :

Online Service to Check IPv6 Support : http://ip6.nl/
If it says No IPv6 connectivity, your IPv6 traffic isn’t leaking.

If it is leaking, consider disabling it in your operating system:
(google search) : disable ipv6 (your-operating-system)

How to disable IPv6 or its components in Windows
How to disable IPv6 or its components in OSX


If the user agent contains information that could potentially be abused, why would every browser send it to every website?

Originally the User-Agent was used to custom code for browser variants, the most common example being the way both HTML and Javascript was implented by Microsoft verses everyone else. Most of this has now been mostly standardized now, although I still occassionally encounter web interfaces that don't work correctly unless IE is used.

It's still used to adjust for things like mobile browsing in order to reformat pages to flow better for phones vice a big screen.

Unfortunately it's also misused in many ways. Microsoft web sites were notorious for sending non-IE browsers in circular link loops. Change the User-Agent in Firefox to say "IE" and suddenly the site worked properly.

User-Agent is also used for statistics, but the necessity of that is in the eye of the beholder. There are many plugins available to make User-Agent say anything, so I'm not sure how useful User-Agent is anymore.


WebRTC does not connect to another adapter
WebRTC have a method to enumerate all local addresses, so it can employ a wide range of NAT tunneling. It does not force a connection to use any adapter. The connection itself is handled by the OS, and WebRTC cannot change the adapter in any way.

Disable STUN/WebRCT system wide is not easily feasible
WebRTC is a technology embedded on web browsers, not on a system level. You can disable it on all your browsers if you want. Disabling STUN system wide is a lot more tricky. Every program have its own way of using it, some can be disabled by the user, some cannot.

You could try disabling UDP system wide, but this will give you a lot of headache, and you can expect innocent services failing for no reason. But you can run suspicious programs on a virtual machine, so even if some program leaks your local IP, it will only leak the internal networking used by the virtual machine, something like 192.168.1.10, and not your public IP.


Is a LAN to LAN with different subnet configuration secure?

By "secure", I'll assume you mean secure as in devices on one network are not able to communicate with devices on the other network.
In your scenario, you are physically connecting two networks together, since router A's network is plugged into a switch port on router B. This means that they are both part of the same broadcast domain and link-local network.
So, using the above definition of "secure", this is not secure at all. While devices configured this way will not be able to talk to the other network, all it takes for them to do so would be to add a secondary IP address that is on the other network. Attacks such as ARP spoofing are viable across the networks.
The proper solution would be to physically separate the networks, and manage traffic between them using firewall rules.


Why is Stack Overflow not using HTTPS for all its pages?

To answer your questions in order:

1) Mixed content.  The typical StackExchange page combines content from a number of sources (ad servers, imgur, gravatar, etc.), and not all of these support HTTPS yet.  Browsers react in varying ways to pages that contain a mix of HTTP and HTTPS content, but the most common is to refuse to load the insecure content, leaving you with a broken page.

2) Yes, it's a security issue.  It's not as much of one as it could be, though, since the login pages use SSL.

3) Maybe.  It depends on if StackExchange is using session fixation techniques to prevent session stealing or not.


Doesn't persisting previous passwords pose a vulnerability?

I can see a couple of potential issues with a solution like this:

If a users (old) password is compromised, then an attempt to log in with it can be used to confirm that the user exists, and has an account - probably not a big deal in the context of FB, where most accounts are searchable anyway, but I still think the principle holds in general.
If someone suspects that they have your password, this can be used to at least confirm that the user has a specific password previously. For the average users, chances are good that that same password will be used for any number of other services too then.

Those two hold even if a user has a good password (ie. a long string of hard-to-guess characters). Since the average FB user is likely to use the name of his or her cat/dog/child/hamster/boyfriend/girlfriend/whatever instead, then being able to confirm the previous use of a certain password can provide insight that may help someone guess a new password too.

As a concrete example, I know of someone who for a long time used the following scheme based on the names of their children (names changed, obviously):

First child: Mark
Second child: Emma
Third child: Carl

Based on those, the user would switch between passwords like this:

MarkEmmaCarl
MaEmCa
MarEmmCar
...and so on.

Sure, guessing a next password based on some quasi-random scheme like this may still require a significant amount of work, but a lot of it can be automated, and it will in any case be far easier than for a random string.
If you can establish a pattern by confirming the existence of one or two previous passwords like this however, then you have a pretty strong incentive to keep trying...


How could Firefox password manager talk to Chrome password manager?

Encryption in the user space usually works by storing the key in an encrypted keychain (keychain in OSX, Gnome Keyring, KDE wallet, whatever name Microsoft uses in Windows...). This keychain is either locked by a custom password or more traditionally by your user password, so whenever you log in, your system automatically unlock it.

This is pretty much what @deviantfan said in his third comment above. Another user can't view your passwords unless he knows your user credentials to be able to log in as you, or the master password to unlock the keychain if it's accepting a custom password for it (Gnome keyring and KDE wallet do).

So, why Firefox can read Chrome's passwords? Because the local password manager is unlocked upon you log in. I'm not sure you can do it the other way around (haven't tried). If you lock Firefox's password with a master password, can you import them to Chrome? It shouldn't unless you type the password during the importing process.

edit

You have more info in the following link, explained by Chrome's security teach lead. https://news.ycombinator.com/item?id=6165708


Is laptop "secure sleep" mode theoretically possible?

Yes. It could be easily achievable, although it would require kernel support do this properly.

In the suspend-to-RAM case, the key should be deleted from the RAM, and in the suspend-to-disk case, from the RAM and also from the disk (or it can be stored encrypted on the disk).

A minimal input should be also provided to get the key/reauthentication credentials in the early boot/wakeup stage.

I don't see any technical obstacles; the probable reason that it wasn't developed until now was the lack of interest. Scenarios where direct RAM access of a working laptop is a real security risk are very rare.


How can I use openssl to decrypt AES-encrypted data using the key and initialization vector?

When using the password form of the command, the salt is output at the start of the data stream. When using -a you are encoding the salt into the base64 data.

The Key + IV method does not need salt, and openssl does not remove it from the decoded base64 string.

You should try again by encoding with -nosalt at the start of your encoding command.

Edit: as @forest said in the comments, do not use the password option with -nosalt, it is unsecure and the Key/IV method supposes the pair has been secured securely.

If you need to first use the password method, I suggest that you read about how the salted data is inserted at start of the data stream, and remove it. It might be incompatible with the base64 output.


In hashing, does it matter how random a salt is?

No. A salt is simply supposed to be unique so that you can't use an attack (such as rainbow tables) that computes a password hash once and uses that result against multiple password hashes.

If you're interested in making reversing the hash impossible without some secret knowledge, then append a site-specific password to the provided password (in addition to the salt) before hashing. A salt is stored with the hash, so making it hard-to-guess is pointless.

@Honoki:
If it's a global value or site-specific, then what you're thinking of isn't a salt, it's something else. That's not to say it's not a good idea, but it's not a salt. Typically an installation-specific secret is called a "site key" or "site password".

But salts are typically stored with the hash. For example, here's the current way Unix/Linux login passwords are stored. The password here is "foobar":

$5$BcjmguyyH.Qrf$ADRXhi/5xb.dYU67I.JdY57uoFjel/rqMqj14QJmTQ1

$ is the field delimiter
5 is the hash algorithm specifier (in this case SHA-256)
BcjmguyyH.Qrf is the salt (not disguised in any way)
ADRXhi/5xb.dYU67I.JdY57uoFjel/rqMqj14QJmTQ1 is the hash


IPv6 Blocking my Connection to the Internet

Those IPv6 addresses do not see like nothing to worry about.

Probably just regular browsing that goes through IPv6. I guess you're most likely using either Chrome or FireFox which support Happy Eyeballs (https://en.wikipedia.org/wiki/Happy_Eyeballs), which in summary allows you to connect using the most responsive connection (IPv4 or IPv6), and in this case these sites support IPv6 (Actually Google, Facebook, Akamai are quite big IPv6 supporters) and this may be the reason why your browswer is picking IPv6 over IPv4.

From the addresses you show in your netstat output:

2a03:2880::/32 -> Addresses block assigned to Facebook
2600:1406:3f::/48 -> Addresses block assigned to Akamai
2607:f8b0::/32 -> Addresses block assigned to Google

You can use a BGP Looking glass to have a clue where that address belongs to. For example I recommend you to use HE BGP. For example to check one of those addresses you pointed out:  https://bgp.he.net/net/2a03:2880::/32

Hope it helps.


Why is pastebin considered a high risk service

This depends on your company's risk management strategies and security policies and, therefore, is entirely environmental rather than Pastebin being publicly rated as a high risk service.
Information Security SE might be a high risk service, too: after all you are able to share potentially confidential details on your company's security policy here. Likewise, Pastebin allows leaking information like source code or configuration files and make it publicly available. From this perspective, the decision seems reasonable and possibly even experiential.


Secure Image Upload, or Bypassing PHP mime-type Check

Why is the result different if I pass a magic file (shouldn't it still accept the file as an image file, as that is what it actually is?), what exactly is a magic file, and what does PHPs inbuilt magic file look like?

A magic file is the description of some heuristics to determine the file type. Different results can be caused by different magic files but also different implementations of the heuristic engine.

  Can I check beforehand if the system has a magic file that will result in correctly identifying a non-image or an image which contains PHP code?

The various file magic functions are designed to detect the file type only by looking at a few bytes at the beginning. They are not designed to find out if there is PHP code hidden inside the file. It should be possible to create a polyglot document which is both valid PHP and a valid image.

Which means checking the content/mime is not a sufficient validation.

  If I can't, is there a better approach to check if an image file contains PHP code?

It's better not to just check but instead to make sure. This can be done by converting the image into a different format and stripping all meta information.

  store uploaded files in non-executable directory outside the webroot

That's actually the best way. But make also sure that you cannot be tricked to include the file in another PHP script, i.e. Local File Inclusion.


All of the weaknesses in your protocol can be summed up as "use SSL" or even "use SSL, dammit !".

In more details:

All the protocol is of course vulnerable to impersonation, specifically the double impersonation that is also known as Man-in-the-Middle attack.
Similarly, if any of potential attackers that can eavesdrop on the line decides to do a modification of the data in transit, then he can, and your client and server will be none the wiser.
Experience shows that saying "encrypt all the data with that key" and then doing it correctly is awfully complex. SSL itself took almost 15 years to do that, and many implementations are still not up to it. Padding oracles, predictable IV, MAC verification timing, verified closure, protection against resequencing and replay of packets...

As an overall assessment: don't do that.


Secure way to distribute and verify OpenPGP public keys?

You want to guarantee that the key you give out isn't compromised on the way to the recipient. The easiest way is to use an authenticated, encrypted communications channel such as HTTPS (as you mentioned in your question). Sites that fit this criteria and are publicly available, and are made specifically for distributing keys already exist and are easy to use. A common site is https://pgp.mit.edu/ but there are others as well.

Really, the biggest benefit to a site like MIT's is that you don't have to worry about setting up HTTPS. If you have your own HTTPS site already set up then you could just as easily add a page with your organization's public keys.

Some other options that I think are less convenient:

Send the recipient an email that you signed with your key. This includes the public key by default. If you are concerned that the email will be tampered with, then call that person and have him verify the key's fingerprint. It is short enough that over the phone verification isn't unreasonable.
use a VPN to create a secure channel and transfer the key over the VPN.
get a mutually trusted certificate authority to sign your public key.


What is best method for retest blind sql vulnerability

Apart from manual testing you could first try SQLMap, which is the standard tool for automated SQL exploitation.


Public key authentication: what gets signed?

Consulting RFC 4252 on the SSH authentication protocol, we find in section 7 (on pages 8 and 9):

To perform actual authentication, the client MAY then send a signature generated using the private key... The signature is sent using the following packet:
 byte      SSH_MSG_USERAUTH_REQUEST
 string    user name
 string    service name
 string    "publickey"
 boolean   TRUE
 string    public key algorithm name
 string    public key to be used for authentication
 string    signature

That much you knew already, more or less, but we haven't actually found out what the final string field signature contains. The section immediately following actually answers your question:

The value of 'signature' is a signature by the corresponding private key over the following data, in the following order:
 string    session identifier
 byte      SSH_MSG_USERAUTH_REQUEST
 string    user name
 string    service name
 string    "publickey"
 boolean   TRUE
 string    public key algorithm name
 string    public key to be used for authentication

By consulting sections 1, 5, and 6, we can understand the meaning of these values:

the session identifier (a per-connection value obtained prior to the client authentication protocol),

the username used by the client,

the name of the service being requested (here, "ssh-userauth"),

the client's public key, and

some static values ("publickey", TRUE, SSH_MSG_USERAUTH_REQUEST (which is the value 50)).


Can I test/determine all decryption types on an unkown filetype. I do have the password

stackexchange.  This question can't be answered by security experts; you need to contact the person who generated the encrypted file and/or learn how to use Kruptos 2.  This site isn't for supporting how to use specific applications like Kruptos 2.  The extension of .~enc tells little by itself.  enc is a common extension for encrypted files, but ~enc doesn't seem to be a common convention; though as users are always free to rename files.  And possibly you have a case where the original file was blah.~ and became blah.~enc when it just appended enc to the file.  I'm not familiar with Kruptos 2.

The file utility saying data just indicates that the file seems to have binary data (that is not an executable), as opposed to ASCII or unicode plaintext.  The mimetype application/octet-stream is simply stating that it is a stream of bytes (octets) and that there's no meta-data it can infer about what created it.

df -T file doesn't tell you anything relevant -- it just states that the file is stored on a partition that is ext4 (df doesn't tell you anything about the specific file, it only tells you about the partition that the file is being stored on).

Hexeditors only show printable ASCII characters in the right hand column showing the decoded text.  They generally show unprintable letters as a period (.), though your first hexeditor seems to be attempting to encode the symbols in iso-8859-1 (latin-1), which means the byte displayed as a copyright symbol is really an A9 in hex (See: iso-8859-1 (latin-1) codepage layout.

There are an unlimited number of ways to encrypt a file, so you can't just try all of them.  There's an infinite number of ways you can generate a key from a password (e.g., the first 128-bits of iterated 5000 rounds of a SHA-256 hash function combined using the IV as a salt), many types of encryption algorithms (AES, Serpent, Blowfish, Threefish, DES, RC5, CAST, Salsa -- and this is just for symmetric ciphers; there's also a variety of asymmetric encryption algorithms), and many tweakable settings for each type of method (key size, rounds, block size, block cipher mode (CBC, OFB, CFB, CTR, etc), where to store the IV, how to encode the data, etc.


Risk associated with Exchange email address as username when AD authentication is enabled

Management is expressing the risk of user enumeration and suggesting "security through obscurity" as a solution. A determined adversary will find this technique as nothing more than a speed bump. A better way to approach this is to identify:

Excessive failed login attempts. This is two fold since you need to identify any attempts to brute force an account. Where many passwords are used against a single user account. The other aspect is identifying password spraying where a single password is attempted against many user accounts or where these techniques are distributed across multiple IP addresses. Identifying and taking action against these techniques will be a significant win since there's virtually no way for the adversary to be successful. Where this technique really succeeds is when the adversary has unfettered access to go through their lengthy password lists. By limiting these attempts, it just isn't feasible for the adversary to guess a password.

Logins from questionable IP addresses. Many large companies offer this functionality where an alert is generated upon successful login from unknown locations. I would suggest sending the alert to a helpdesk account or your central IT to follow-up. This is because an adversary could delete the email while logged in. To get this reporting setup will take development cycles. Hopefully someone can offer a solution that I'm not aware of as it would be quite useful.

Risk from other Services
While your question was only for Exchange there are often other services/applications/websites within an organization. All of which could be a playground for an adversary to use the aforementioned techniques. There have been countless breach disclosures where a forgotten server in a closet was the entry point. So take inventory of services exposed to the public internet and ensure they have similar protections. Then continue to services only accessible to internal users. For internal services, identifying excessive failed logins is probably sufficient since access from an unknown IP wouldn't necessarily make sense. Note that I've seen user's go through a password change without updating cached service credentials and triggering alerts for failed logins. So beware of false-positives! That being said, identifying legitimate abuse of an internal service will be a sufficient indicator of compromise to invoke your incident response process.
WebsiteFailedLogins
Warning: shameless plug. I'm currently finishing up a significant re-write of WebsiteFailedLogins. It's a PowerShell module, which leverages Logparser, to parse IIS logs (a component of Exchange) and identify excessive failed logins. Admittedly it's been many years since I've administered an Exchange server thanks to O365. However, I'm confident IIS will log the appropriate codes where this will be useful. Have a look at the README and Wiki for more information as I think it would make a great fit!


This is available in Microsoft's Security Advisories and Bulletins from MSRC:

  In this library you will find the following security documents that have been released by the Microsoft Security Response Center (MSRC). The MSRC investigates all reports of security vulnerabilities affecting Microsoft products and services, and releases these documents as part of the ongoing effort to help you manage security risks and help keep your systems protected.


How to prevent users to access my files?

I think this other question answers yours

https://serverfault.com/questions/22577/how-to-deny-the-web-access-to-some-files

You could use Files/FilesMatch and a regular expression:

<Files ~ "\.log$">
    Order allow,deny
    Deny from all
</Files>

or redirect any access of .log to a 404:

RedirectMatch 404 \.log$