What types of hacking attacks happen alongside a DOS or DDOS attack?

Spoofing. When the actual services go down, attacker tries to spoof as if he's the service provider and starts collecting secret information. For example, within an enterprise network, one could DoS a DNS server and start dummy instance of DNS (with same ip, but probably different MAC -- even same MAC sometimes by spoofing) and wrongly resolving the domain names to malicious IP and then further installing a honeynet to collect various secret info. At Internet scale DDoS generally is done only to bring down certain services, but if a targeted attack is being carried out then probably the assumption at application level of availablity of certain service might not hold and hence may lead to certain specific security hole (its very situation specific, one needs to study the application architecture to understand implication of certain services going down).

Found that this is a duplicate of Does a DDoS attack have other purposes beyond a lack of availability? (which is in itself a duplicate of another question, pls follow link)


Techniques for bypassing zero length check in javascript?

The test you have:

if (!username || !password)

Checks if either username and password values are javascript falsey values.  A falsey value in javascript is any one of these : null, undefined, 0, false, NaN or an empty string.

An empty string in javascript is a zero length string so if it has at least one character in it (any character will suffice), then it is not an empty string.

So, if because of the way your code is structured, you know that both username and password will always be strings, then the above code is just checking to see if either of them are empty strings.

There is no character that could be in those strings that would pass the above test.  One of the strings must be completely empty (zero length) to pass that test.


Vulnerability of challenge-response (authentication) protocols to on-line man-in-the-middle attacks

Your assumption is true if Alice and Bob must rely solely on this single communication channel and have no kind of knowledge about the other party before establishing the connection.

But consider the case that Alice has a key pair where the public key is public and thus known to Bob but the private key is only known to Alice. In this case of existing previous knowledge Bob can send a challenge to Alice which she can sign with the private key. This signature can be verified by Bob using the public key. A man in the middle cannot fake it since he has no access to the private key.

This mechanism can be made more flexible with a Public Key Innfrastructure (PKI) so that Bob does not need to know all the public keys of all possible Alice's but only need to trust a certificate agency which issues certificates for these Alice's. And this is basically the way the server is authenticated in SSL/TLS in order to detect man in the middle attacks.

Note that public key cryptography is not the only way previous knowledge could be used to defend against such man in the middle attacks. A secret shared between both sides of the communication would work too as long as the man in the middle attacker does not know the secret. But public key cryptography using a PKI scales better if many parties are involved.


Are MariaDB's encryption and compression functions secure?

While MySQL currently provides other encryption modes, MariaDB appears to still only support the insecure ECB mode. In MySQL, you can set the mode to the slightly better CBC mode with:

SET @@session.block_encryption_mode = 'aes-256-cbc';

If you cannot do this on MariaDB, then it does not support any alternate mode. Even on MySQL where it is supported, CBC is not a great mode. What is really needed is authenticated encryption. Since neither MySQL nor MariaDB support that, it should be up to the application using the DB.

The password hashing is also poor. By default, you are (unfortunately) encouraged by the documentation to hash the password with SHA-1 or SHA-2, which are fast hashes but are not designed to be a KDF. Due to the speed, they can be attacked very effectively. This danger is amplified because no salt is used by default. Unless the "password" is a randomly generated string, this is inadequate for security. You must use a secure KDF, which is not natively provided.

As for the compression functions, what would make them secure or insecure? They use whatever compression library MariaDB has been compiled with and just return compressed data. Security in terms of arbitrary code execution should lie primarily with the linked library being used (e.g. zlib).

  Do you recommend a cloud native app (12 factor) to offload Encryption to the database (in my case MariaDB)? Can my example code be improved to be more secure (but only with MariaDB functions)?

Unfortunately, product recommendations are off-topic for this site. You should design the application which uses the database such that it supports solid, authenticated encryption with a strong KDF. If you merely need to encrypt all of your database with the same key and only care about data-at-rest security, you can simply put the database files in an encrypted directory.


Does the padlock on my browser really indicate a reasonable assurance against eavesdropping?

Browsers use the padlock to show that they use SSL. If:

your browser is recent enough;
you did not play with the security settings;
the browser did not display a Scary Warning (not always red, but definitely scary);
nobody installed on the machine some funky software (including software from your specific organization, which could install a custom trusted certification authority);

Then yes, the padlock gives reasonable assurance that you are really talking with the server you expect (not really the one you think of, rather the one with the name in the URL) and nobody spying on the line may see what you are exchanging with the server. The assurances are up to the competence of the 80+ certificate authorities which your browser or operating system trusts by default. Strangely enough, big mishaps on the CA side seem to occur only rarely, about once per year on average (in the whole world !).

Of course, if your browser is not recent then it has serious vulnerabilities and your machine is as good as hacked. If you played with security settings then you may have enabled cipher suites with little or no security. If your browser displayed a big warning and you ignored it, then you are on your own. If hostile software is running on your machine then it no longer is your machine.

And SSL only protects the transport medium. The server on the other side is free to goof up in arbitrary ways. When credit card numbers are stolen, they are not eavesdropped on the line; they are plundered directly from the server's database. The padlock says nothing about robust and secured the server is.


How to use Java method override to attack?

When you create a .jar file, deploy it on a system and run it, it's per-se not more or less vulnerable than any other application developed with any other technology.

The attacks described in these articles are relevant when the attacker can already inject Java code into your application. For example, when your application loads classes at runtime with a ClassLoader from a source which isn't under your (or your user's) control. The articles just reiterate what every application developer should already know: Do not load and execute untrusted code. When you don't do anything like that, there is nothing you need to worry about.

The articles mostly debunk the misconception that it could be possible to build a sandboxed plugin execution environment by relying on JAVA visibility features. Let's say you want to build a Java application where users can download extensions from the web. This works by downloading the .class file and load it at runtime with ClassLoader. But you want to limit what these extension can and can't do. Could you just declare any data you don't want these extension to access as private? No, that doesn't work, because there are tricks to subvert these access modifiers.


Should I use sudo with the normal user or root or sudo with another user?

Normal user and sudo, always: you want to spend as little time being root as possible.

As a bonus, the act of sudoing before giving a command reminds you to be careful.


Do ISP Detect and Block Pen Testing Tools?

First of all, there is a difference between performing a penetration test and an automated scan (low hanging fruits) where automated scans generate a lot of traffic.

Then there is a difference between infrastructure and (web) application penetration tests and then it depends on the type of test:

Black Box
Grey Box
White Box

Infrastructure Penetration Tests

For infrastructure penetration tests I can see where a Black Box PT might get you in trouble with your ISP. In my opinion, you should never recommend to this type of test to your clients because you might not get anything out of it.

While with a Grey or White Box approach you can analyse what an attacker could have done if no information was given (e.g. Black Box approach)

Application Penetration Tests

For (web) application penetration tests, this is done manually, which means this should be considered "normal" traffic. If an ISP would block your connection, chances are they're using DPI (Deep Packet Inspection) but this is considered illegal in some countries.

I have performed hundreds of penetration tests from my home internet connection and I have never ever been warned or blocked by my ISP. (Even when performing automated scanning tools such as Nessus and Acunetix)

So all in all, I think penetration tests can be executed without getting blocked, but that's from my own experience.


Safe storage for multiple passwords for multiple accounts

Password managers are the accepted and recommended solution to this problem:
NCSC (UK):
https://www.ncsc.gov.uk/blog-post/what-does-ncsc-think-password-managers
CERT (US):
https://us-cert.cisa.gov/ncas/tips/ST04-002
ENISA (EU):
https://www.enisa.europa.eu/news/enisa-news/tips-for-secure-user-authentication
NISC (Japan):
https://www.nisc.go.jp/security-site/campaign/files/aj-sec/handbook-all_eng.pdf
NIST (Standards body):
https://pages.nist.gov/800-63-3/sp800-63b.html
And password managers have been the recommendation of the experts here since the site began 10 years ago.
Here's a list of password managers to get you started. This type of software has been around for about 20 years.
Features:

Software may be online and synced between devices, or off-line and only stored locally
Some are open-source (so experts can review the program code for problems)
All software encrypts the data to prevent password disclosure in case the device it is on is stolen or accessed without authorisation
Most (all?) includes note-taking functionality to include extra info, like secret questions, etc.
Most (all?) will generate random passwords for you
All software is tested to some extent by security researchers trying to find weaknesses. The more popular the program is, the more attention it gets from researchers hoping to make the news with a finding.

In practice, you do not need to put 100% of your passwords in one password manager. It can make sense to break up your work passwords and personal passwords into different software and use the software that has the features you need for your work environment. Some work environments provide a commercial password manager to all staff for work passwords. Others have a commercial password manager for IT departments to remember all the passwords for the thousands of systems they administer.
In reality, even a password manager with weaknesses is more secure than trying to generate your own passwords and remember them. A long, random password is the most secure, and your brain can't generate or remember those.
Writing them down is another option to consider, but that suffers from a lack of encryption and a lack of backup.


Can anyone spy on my traffic if they know my MAC address, local and public IP?

If they are connected to your personal or ISP-issued router, then they are considered to be in your network, and might be able to read all of the traffic meant for you.

If they are a neighbor who happens to have the same ISP as you, and use their own personal or ISP-issued router, then they are not in your network, and the only way that they can see any traffic related to your computer is if you sent that information to them.

In most modern setups, your ISP will have a router somewhere in your neighborhood, and will send your traffic directly from their neighborhood router to your own router. If your computer is physically connected to the router, then in most cases, the router will send the traffic directly to your computer.  If you have someone malicious who is also physically connected to the router, they can make the switch broadcast your traffic to all ports, rather just the port connected to your computer.  If you're both connected through wireless, then you can't assume any privacy, either.  However, someone who is connected through wireless is not going to be able to eavesdrop on someone with a physical connection, and vice-versa.

The only way that someone can snoop on your traffic without being connected directly (through a physical wire or through wifi) to your router, is if they have somehow compromised the router in your neighborhood, or have compromised other routers in the ISP's network... but the further away the attack is, the less of their traffic they'll be able to intercept.


What is the risk of a PDF "infected" with BC.Pdf.Exploit.CVE_2017_3033?

Determining if this is a false positive or not is impossible without actually looking at the files.

The vulnerability in question seems to be a classical out of bounds read and probably exploitable but it's hard to tell until somebody actually puts in the work to write an exploit.

Maybe you should consider telling the ClamAV people to look into this. A similar problem has apparently already been fixed: https://lists.gt.net/clamav/users/69581


BitLocker uses something called surrogate keys. The data on the disk is encrypted with a random key (surrogate key), and that key is then encrypted with a second key derived from your password (header key). The encrypted surrogate key is then stored in the volume header.

When you type your password in, the system derives the header key from it, then uses that to decrypt the surrogate key, which is in turn used to decrypt the data. Changing your password just re-encrypts that volume header with a new header key, rather than the entire disk.


How can I make sure if my computer is infected and know if I have to nuke it from orbit?

There is no reason to nuke it from orbit just because it showed you a scam once. If malware is capable of installing itself automatically (a drive-by infection), it would not be trying to trick you into downloading an executable. In general, if malware is to install through a browser vulnerability on its own, it will do so without making itself known. All you saw was malware so limited that it requires the user to execute it manually to do anything harmful.

So, why did you only see it once? There are several possibilities:

The malware came from an embedded advertisement, and the ads are on rotation.
The malicious download is only presented every n website visits to avoid suspicion.
The site was hacked, but no longer is. Compromise can be very brief.
As you say, it could simply be that it does not show the same person the scam twice.

The first two possibilities are the ones that I would suspect. Advertisements are almost always outsourced to ad companies, and some of these companies are less reputable (or less secure) than others. It is not uncommon to accidentally approve a malicious ad on a legitimate website. Scams or malicious code is also often served on a random basis. I know of one shock website which creates popups and does other benign (but highly annoying or offensive) activities, but every once in a while will serve actual malware. A site that is not consistent with its malice will last.

If it is browser redirect malware, you still don't need to nuke it from orbit. Browser malware is common and tends to be limited to controlling the browser. This malware, being unable to perform arbitrary actions on your computer, must resort to trying to trick the user into downloading real malware from their browser, because they trust their browser. If you do have redirect malware, reinstalling your browser to remove all settings and plugins is usually sufficient to remove it.


How do Intrusion Detection Systems (IDS) work?

You typically have two kinds of IDS, network-based and host-based, and these can be signature or statistical response types.

Signature IDS's are simple, fast, and can be updated easily. Usually vendors supply signature files - similar to the way anti-virus vendors supply virus signatures. For this reason most IDS's use signature recognition. The downside is that they will not identify a new attack unless it has a signature which matches an existing attack.

Statistical or heuristic IDS's learn what 'good' or normal traffic looks like and alert on anything which isn't normal. This does mean they are much better at spotting new attacks, but does require learning periods when initially installed and regularly on the implementation of new servers, services and when any new traffic types or volumes are expected.

Network based IDS's are usually implemented at the perimeter of an organisation, and they have visibility of all traffic entering (and sometimes exiting) the organisation. Where traffic has indications that it may be malicious it is logged or flagged to a response system or person.

For a large organisation, the amount of different valid traffic types can be very high, and the traffic types can vary over time so the ongoing configuration and tuning of a perimeter network based IDS can take a lot of resource. For this reason, the majority of large companies outsource this to vendors who provide the service to many organisations. These vendors have better visibility of attacks happening, a scale advantage on tuning and response, and the ability to update signatures for all their clients at once.

Host based IDS's are more usually implemented in-house for specific high-value servers. The traffic types and load are usually much lower and more predictable so the resource requirement is usually lower.

Also have a look at this question - some discussion on anomaly based (statistical) IDS.


Can I block the true IP address using X-Forwarded-For header in IIS?

I would proceed with caution using a HTTP header for IP filtering considering they can be controlled by the client unless your webserver takes this in account when it forwards your request.

What happens if I as not authorized send X-Forwarded-For in my headers? Will your webserver add an extra X-Forwarded-For? Will it add it below or above mine? Which one will the IIS use to validate on?

These are questions you need to be able to answer before implementing any trust in the header value.

Edit: I dont know of a better alternative, but if you are going for the one you're question you should be able to answer the questions first. I am not talking about passing through multiple proxies, but instead what happens if I put my own X-Forwarder-For header on the bottom of my request? Will your proxy add another one further up? Will there be two X-Forwarder-For? Which one will the webserver look at?


How much data can an app gather from my Android device?

Can the app see my wi-fi SSID?

Yes.

  Can it get my internal and/or external IP address?

Yes.

  My physical coordinates?

Yes.

  In addition, if two or more devices are connected to the same wi-fi network, would it be possible for the app to "know" that both of those devices are connected to it?

Yes.

An app can actually do all that, except from knowing your physical coordinates, without requiring any permissions. This is evident on an app I use, Net Analyzer. The only permission it asks for is Location. When revoking this permission, it can still see a large amount on information regarding your network such as internal/external IP addresses, MAC addresses, other devices on your network, the services running on these devices, etc.

Note that without any permissions your external IP address can be identified - this gives the opportunity to locate your position, although it won't be very accurate.

To stay safe from an app obtaining too much information, I would recommend disabling unnecessary or dangerous permissions as shown on this article. Some app developers show their permissions along with an explanation of why they are required which is a good way to identify why the permissions are needed, and what permissions can be denied without affecting the performance of the application. It's very difficult to know exactly what an app is doing behind the scenes, and the only real way to know is to decompile the app and view the Java source code.


How can an attacker identify the encryption method with only ciphertext?

What you describe (figuring out which cipher was used, given only the ciphertext) is a type of distinguishing attack.  Modern ciphers are generally highly resistant to such attacks: the ideal cipher produces output that is indistinguishable from random noise.


Encrypting mobile user data in event of PIN/device compromise

How do I protect users if their device or pin has been compromised?

The best way is to avoid storing data on the device in the first place. This however means that the app won't be able to work offline, needs to re-download data each time and might have performance impact.

In the end it depends on the risk you want to accept and the user experience you want to give to your users. One possible solution is to require the user to setup a separate pin/password in the app which is used to derive an encryption key. Keep in mind however that in case of a physical compromise of the device, the data is vulnerable to offline brute force attacks. The security of this data depends thus on:

A strong password policy
A solid encryption scheme

Basically once the data is out there, it's only a matter of time.


How can a network observer identify computers running old versions of Java?

Well, obviously, whatever heuristics the ISP employs are wrong in your case, since you do not have Java at all. We can imagine a few scenarios:

The ISP detection is based on tracking downloads from Oracle's site: their system failed to detect any download of an update from your machine, and therefore concluded that your Java "must be old". (It would be a quite stupid, unreliable detection system.)
There is a University Web page that you have visited, outside of your VPN, and that Web page includes some Java plugin detection mechanism (like this one). Some detection methods involve only some Javascript which looks at the browser properties, and that Javascript may have become quite confused about your browser which happen not to be Internet Explorer, and not to run in Windows at all.
The ISP uses dynamic IP addresses, and the Java detection system is not aware of it. Someone else's computer has an old Java, and was using an IP address which was then allocated to you, and the detection system decided that you were the culprit.
Due to malice or (more often) misconfiguration, another user with an old Java temporarily used your IP address as his own. Same result as the previous scenario: the report on unpatched Java goes to the wrong guy (you).

To detect what version of the Java plugin is installed in a user's browser, something must happen with that browser: the browser must be up, and run a Java applet, or some Javascript which scans the browser properties. Apart from making your browser connect to a site they control, their only remaining non-stupid method is to passively scan for HTTP requests; when some Java code does an HTTP connection to some server (many applets talk back to their source server as part of their operation), the HTTP request will include a User-Agent header line with the Java VM version included at the end (e.g. as "Java/1.5.0_19"). I can imagine a "Java detection system" which just waits for such a string to appear as part of a User-Agent header in network traffic.


Can anyone explain what Ret2plt means and how it works?

In short, jump to the address of the PLT entry for the function = call the function.

Ret2plt is a similar concept to Ret2libc regarding DEP. DEP/Data Execution Protection works by making some memory non-executable (heap, stack..). This works to prevent code execution if the malicious code is smuggled into those non-executable areas. But if we could call code that has to be executable, like libc code, then it will be executable. At the assembly level we could even pass it our own parameters.

Described here: Rafal Wojtczuk, 1998, return to PLT uses the procedure linkage table to indirectly call libc functions.

The PLT is necessary because library code is not loaded into memory at fixed addresses, usually it is position-independent code (PIC). So procedure calls into shared libraries are made through the PLT. If we return into the PLT, then we are effectively calling those shared libraries linked by the PLT.

The main limitation is that you can only call functions that are already being used by the program, or else they won't have a link in the PLT.


Proper method of block ads/tracking on VPN Server for Clients

Looking at the dnsmasq man page, it looks like that'll definitely work.

As stated in the man page,

  It is possible to use dnsmasq to block Web advertising by using a list
  of known banner-ad servers, all resolving to 127.0.0.1 or 0.0.0.0, in
  /etc/hosts or an additional hosts file. The list can be very long,
  dnsmasq has been tested successfully with one million names. That size
  file needs a 1GHz processor and about 60Mb of RAM.

Which looks like exactly what you're trying to do.


I also would like to know if it would be theoretically possible (whilst obviously difficult) to translate an existing JIT compiler (e.g. .NET CLR) that produces code that automatically encrypts its user-mode memory.

This might be quite difficult for the OS to do on behalf of a program. The reason for this is that the virtual pages allocated by the operating system are in fact controlled by the CPU - the OS instructs the CPU as to what it wants in terms of storage areas and the CPU then computes the offsets on that basis for each program and applies the result directly. Have a read up on the MMU and Paging on x86.

In short, when your program makes the computation mov eax, [edi+something], the MMU/paging handles the address translation and issues a page fault when the page is not found. That allows you to then load the page out of storage, should you need to.

So the memory access doesn't go through the kernel per se and as such can't be hooked and processed as a file read or write can (your read and writes are translated through the appropriate system calls into the appropriate file system structure. As such, the OS sees the data as it passes through. You don't need a system call to write to RAM. You could make one, but it would only work for programs that call it and so not most programs).

However, that doesn't mean to say a JIT process couldn't do this on behalf of an application, or the application itself couldn't keep data encrypted until it needs to load it into registers, decrypting it as it passes over the data.

In that case, you're into the issue SteveS covers well - you have a key storage problem. The key itself must also be in RAM somewhere. This is a turtles all the way down problem - fundamentally it's impossible to keep that key "secure".

Finally, since being able to read another application's RAM requires supervisor mode access to the CPU (i.e. kernel space) you probably have bigger issues if your concern is software interception. If your concern is hardware, I think physical security might be a better way of mitigating the risk.

Edit I had a look for papers. Here's one called CryptKeeper. Their technique is to have a large encrypted "RAM disk" as the swap file and swap all their pages out to that when not used:

  We mitigate this vulnerability with Cryptkeeper (CK), a
  software-encrypted virtual memory manager. Traditional pro-
  cessors cannot operate on encrypted data, so CK segments
  RAM into a smaller working set called the Clear, and a
  larger encrypted RAM device called the Crypt. As the working
  space fills, pages are automatically swapped into the encrypted
  portion of memory, and are decrypted on demand.

Apparently the performance isn't too bad, but I don't think there are any implementations of it yet.

Edit 2 So it turns out CryptKeeper and the OpenBSD Swap Encryption mechanisms work on a very similar level; it does not actually encrypt physical memory but uses physical memory as a swap structure, forcing page faults and encrypting/decrypting data in resolution.

EDIT from question author, December 2018: AMD now supports the SME instruction set extension which allows for hardware encryption of RAM pages, plus TSME for full-memory encryption, and SEV for use with encrypted memory in virtualisation. This appears to enable full-system memory encryption on modern AMD64 platforms.


I don't see how there could possibly be a security risk or other vulnerability as a result of implementing the feature you suggest. The reason is simple: since there is no security risk or other vulnerability to not having a CAPTCHA in the first place (with the possible exception of a DOS attack if the action the CAPTCHA protects is a slow action), any modification you make to the CAPTCHA should not create a new security risk. The purpose of a CAPTCHA is simply to prevent pointless actions to reduce the resource footprint by the host, but none of those actions should be related to security, as humans can do them too.

So, even if you mess up the feature and make the CAPTCHA easier to beat, there shouldn't be any new security vulnerability as a result of doing so.

As for whether or not it's a good idea, in my experience users rarely accidentally refresh the page, and a good UI will highlight the required fields, so the most likely error during submission is the CAPTCHA itself, which you probably want to change after each attempt if the only error was the CAPTCHA (to prevent a bot from getting multiple attempts at the same CAPTCHA). I think you're fine though; the worst case scenario is a bot is slightly more likely to beat it. No big deal...


Secure way to inform user of their new password

Based on discussion in the comments, I would suggest a

one-time link, that links to web page displaying the new password to the user.

Some upsides of this:

Transmitting the actual password happens (/should happen) in HTTPS.
The password is only ever exposed in the browsers cache and server-side. (This means that future breaks on a clients device will not leak the password)
You can use further authentication methods on the web page, which will ensure that the new password is kept secret.


Are there any security reasons for an organization to disable browser session restoration?

Restoring sessions means that there is a token saved in the browser that automatically logs the user in to that service.

The security issue with this is that the only thing protecting the online accounts is the device's local login. Once someone gets that, then they automatically get access to all the web services that were open. That kind of leverage is not the best.

In addition, it might be possible to obtain that token from the network and log in without access to the device.

It is better to have proper layers of protection that can be enforced:

device login
network login
web services login

Each with their own sets of credentials and with expiring sessions.


Can a router be attacked without being associated to it's WiFi?

Given the other side of the router is attached to the internet, I'd say, yes.

https://techcrunch.com/2019/05/22/tp-link-routers-vulnerable-remote-hijack/
https://www.pcwrt.com/2020/06/netgear-router-vulnerability/
https://latesthackingnews.com/2020/07/22/cisco-patched-numerous-critical-vulnerabilities-in-vpn-routers/

The list goes on and on...


Exploitation of missing is_uploaded_file check?

To answer your questions:

  The comments mention that move_uploaded_file performs the is_uploaded_file check itself, it that true?

It does. You can see in the source code of move_uploaded_file() that the checks it performs are (almost) the same as the ones done in the is_uploaded_file() method.

  Is tmp_name user controlled in any way?

No, the user cannot control this value. It is assigned by the interpreter and is random everytime. Even if you upload the exact same file more than once, it will have a different tmp_name every time.

  Is there a realistic scenario where is_uploaded_file is actually required when uploading a file - or when performing any other action such as reading, deleting, etc. - , as there would be a vulnerability without it? Or is the function completely useless?

As a PHP developer myself, I've personally never used it. Since it's already incorporated in the move_uploaded_file() method. I've never encountered a scenario where I wanted a file to be uploaded, but not moved to a location of my choosing and just remain somewhere in the temporary upload directory under a random name. I guess you could use it if you just want to display the contents of the uploaded file, but not keep it stored on your server, like the example #1 in the docs suggests. A scenario that pops into my mind is if you would run a pastebin service with upload functionality or such. You could allow the file to be uploaded, read it's contents from the temp dir, use that as input for the textarea and then immediately remove the file again from it's temporary location (or have a cleanup cronjob do that periodically).


Is spam more likely to be sent to info@example.com? Would I be better off using a different address?

So it sounds like you're asking if a some emails are more likely to be spammed than others. I suspect that the primary source of emails for spams is bots collecting any emails you mention on your site. Therefore spam bots will pick up "support@example.com" just as often as "randomgiberish@example.com?". In any case you should rely on your spam filter to do it's job and use the more professional email.


Open-Source Hardware Security Modules (HSM)

I am not aware of any. Developing an HSM is a lot of work, especially if you are complying with FIPS level 3 / 4 physical tampering and side-channel resistance. I could imagine a world where a group of tech giants get fed up with specialty HSM vendors and decide to come together to develop an open hardware standard and jointly invest the money and time to get it certified, but I don't think that's the world we're in today.


Yes, Please do it . It is still better than a network without any firewall. looking at the link, this is a simple network firewall with DHCP, DNS and SNORT. It does not decrypt your SSL traffic because it is not a Proxy. the Main function of this firewall is to protect your LAN from attacks (including some commonly known DDoS attacks as well).

as far as I know, the Linux network stack is pretty solid and there are some factory made routers running Linux as well.

SSH is called the poor man's VPN and is quite secure. use RSA with a key size of atleast 2048 bits or more(4096 bits even, if Pi can handle it) so that you don't get brute-forced.
 also, as the guide says, try signing the Host and User key with Certificates to make SSH more secure by enforcing Validation. Also SSH is not a requirement, you can have it turned off, if you don't want to connect to the firewall remotely.

  For a home network is it better to rely on basic, pre-configured security and OS/ISP firewalls, or is there benefit to implementing advanced security via online guides/answers?

There is always a benefit to implementing advanced security, like this firewall will detect tools like nmap used to survey the network, apart from filtering network traffic.

if you are just going to copy/paste whatever configuration is on that link without understanding why its done, then you are making a compromise there. another thing to be aware of, is that you might end-up blocking legitimate traffic, as most firewalls DENY ALL traffic by default. so, this is really a question for yourself on how much time and effort you are willing to spend on tweaking the firewall without affecting functionality.

  I think the worst case scenario is the machine is hijacked and instead of being a defense turns into a self-made MITM attack... is that accurate and/or are there more dire concerns (immediate - not dependent on the MITM concern)?

This firewall works in the network layer(mainly) of the OSI reference model. however most threats occur in the Application Layer and some of them can be quite dire. In a MITM senario, all unencrypted Text passing through the firewall can be read, however this firewall cannot decrypt SSL(HTTPS). So a compromised Laptop can be a much more dire situation than this compromised firewall.


Is it a security risk that browsers can freely get images (and/or other resources) cross-domain?

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

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

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

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

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


Should I use a separate SQL Server instance for a database with PII?

If the existing database has strong security controls then there's no reason to have a separate one. If there are not strong controls on the existing database, and setting up strong security controls is not possible on the existing database then you will need to have a separate database to better protect the data.


Is attacking a password manager on android with root access a plausible concern?

There are a number of mitigations you aren't considering.  To directly answer your question: Yes, provided an attacker has full purview over all phone activity (some android phones are difficult/impossible to "root" so this is not a given even at that level) they could capture the cloud part of the key and brute force the combinations within a short time (probably more than milliseconds since they have to test-decrypt the password file with every pass, there is no magic indicator that it worked after computing the key).

But, most cloud password managers allow for remote privilege revocation (i.e. disallow device from fetching key from cloud until it fully authenticates again) which should be practical for you to execute before the attacker roots your device, since it is very simple to do.

Second, mobile device management allows you to permanently wipe the contents of your phone should you find it stolen, again only effective if you act quickly but still should be possible to log in and hit wipe device before the attacker has even had a chance to size up his options with attacking your device.

Third, full device encryption with a strong pin (available in all android versions for a few years) would negate all of the attack vectors in one go, since the attacker would be required to know your pin in order to do anything to the phone at all.


Shellshock Exploit evidence - is this a successful attack

Now as I understand it this is using the refresh technique to display a blocking.asp page of some sort.

The page that was returned when you requested http://[redacted]/bo.pl is a blocking page served up by your Asus WRT:
https://github.com/RMerl/asuswrt-merlin/blob/master/release/src/router/www/blocking.asp

["Home Protection", "78", "Malicious site blocked", "", "Sites used by malicious programs, including sites used to host upgrades or store stolen information."]

The bo.pl should have been a perl script.  The attack attempted to download and execute it, then remove it from the system.  If you have system execution logs, you should be able to see if it was run.

Try and do the same thing to your server.  Only difference I see in your request is the HTTP version used (1 vs 1.1), so it may have served up a different amount of bytes.


Does using WPA2-Enterprise just change the attack model vs WPA2-PSK?

WPA2-Enterprise is (in my opinion) considerably more secure than PSK.  Reasons

WPA2-PSK has a single shared key amongst all devices.  that means that if one of the devices is compromised the key is lost, so the more devices you have the risk of loss or compromise increases.  As against this WPA2-Enterprise has per user secrets, so not the same problem.
Using WPA2-Enterprise each user can change their credentials as required, whereas with WPA2-PSK changing the secret could be a major undertaking, depending on the size and make-up of the user/device population.  This increases the potential severity of a compromise as key rotation will be much slower (in most cases) than password rotation so if a credential is compromised, it's likely to remain so for longer with PSK.
With WPA2-Enterprise you can make use of stronger authentication mechanisms (e.g. 2-factor if needed)
With WPA2-Enterprise you can add certificate authentication to stop random attackers brute-forcing the users creds to get access.


Why does the ProtonMail Android app require Identity permissions?

You can find more details on the link below for the permissions ProtonMail Android app is using, along with information why each of them is needed.

https://protonmail.com/support/knowledge-base/android-permissions/

  Identity: Allows push notifications when you receive new messages
  through the ProtonMail app. Unfortunately this is the only solution to
  provide push notifications at this time. We will continue to look for
  alternate solutions.


Which BCP/DRP sections are solely related to the software vendor?

Read The Contract.

You didn't say whether you are the vendor or the buyer. If the contract wasn't drafted well enough to protect you, fire your lawyer. (For legal advice consult a licensed attorney.)

I don't see how any complete DR plan can possibly be written without knowledge of the infrastructure, operating environment, etc.

If you find yourself in a position where you are the software vendor, and you are stuck writing these documents, you will have to elicit the relevant information from your customer. You might want to CYA and fully document all contacts with the customer so that, if you are unable to obtain the information you need, you will have a record that you tried.


Techniques to make a login page safe without using SSL

Why are you refusing to use TLS? It works, it has a good track record (some minor exceptions aside). Refusing to use good tools without a compelling reason does not engender confidence and does not immediately suggest professionalism.

Additionally, do not roll your own authentication system. That is silly, and you will make mistakes. Instead, since you expect your users to have a facebook account, use OAuth2 to consume federated identity and authentication. Even better, outsource this to a federation service who has mastered it and even provides code-snippets (https://oauth.io/ comes to mind).

Don't make your life difficult.


Does Logging out of Windows make my computer much safer than only locking?

[The question "what could go wrong" is rather broad, so this is not a definitive answer. I am also not a Windows certified security professional, I'm just spitballing.]

@CaffeineAddiction points out that when you leave a computer locked, all your user-level processes are still running. Imagine that an attacker is able to plant a backdoor, like running an FTP server; this would remain running while you're locked, but would the process would get killed when you log out. (That said, this only really stops script kiddies since hacker groups with enough money to buy black market exploits will probably be able to do privilege escalation and run that FTP server as admin).

RAM, cache files and network access: I don't claim to be an expert here, but I would assume that when you log out, Windows clears RAM and tmp files of any processes and data owned by your user. This would thwart a cold boot attack, or any other attack that allows the user to take a dump of your RAM. Windows domains also typically load your Documents folder - and often a user-specific network drive - from a network share. Logging out will close down the connections to these network shares - both preventing an attacker reading your data from the server, or planting viruses to the server.

I do agree with your skepticism though: if an attacker has physical access, why not plant something that will do all of the above the next time you log in? The old trick of crawling under your desk and sticking a malicious USB device in the back, for example.


Should I validate authentication form inputs?

Sorry, I do not get the part on your concern with timing attacks. As long as the passwords are properly hashed and the comparison is done on the hashes, your application should be safe from this kind of side channel attack. Whether a database call has been made or not (2s vs 1s) does not leak any information on your password.

It is always good to validate form inputs, regardless of whether they are stored in the database, in case your database query is susceptible to an SQL injection. This strategy is known as defence in depth. You never know when your query parser is made vulnerable by some weird user input like the recent shellshock exploit.

There is really not much of a security issue whether you report the failed login by showing individual errors of or by grouping them together. What an attacker can gain from here (whether an email address is valid) can also be gleaned from the registration page by trying to register with that email address.


How can Microsoft Wi-Fi Sense share just the internet connection?

MS Wi-Fi Sense is simply going to share your pre-shared key for your Wireless network with the contacts that you have stored (Outlook, Facebook, and Bing I think?) so that your (presumed) friend can use your network without having to manually tell them the pre-shared key.

Now - the reason Microsoft states that your guest won't be able to access other computers, devices, or files store on your home network is because Network Discovery is turned off by default once someone connects to your network using Wi-Fi Sense. So, it would be more difficult, but certainly not impossible or even that challenging for someone with average skill level to see other computers and devices on your network once they are connected up.

And also, no, the guest computer does not connect directly to the computer. It's going to connect to your wireless router just like normal.

Hope this helps.


How do you securely delete httpOnly cookies previously used for login?

you cannot,
you have make another request to backend from there you can remove the cookies.


How can one trace and prove who leaked a document?

It quickly changes from a technology based solution into an armed guards standing in the room solution. You can use a unique watermark on each page, you could make minute changes to characters on a page, but anyone can still retype the document if they are given unrestricted online access to it.

You could approach the problem slightly differently if you make two groups of secret information, the type you need the whole digital document for "this is a photo of bigfoot" and the type you just need to look at and remember "the next wining lotto numbers are going to be 11,16,23,34,43,44". But this only works if someone leaking the first type of information just sounds like a crazy person "The DEA have a photo of bigfoot, I've seen it!".


Disabling CBC ciphers does not stop Chrome from negotiating to use CBC ciphers

It's not up to the client no negotiate that. The server has the last word in this. Chrome can not pick anything the server is not offering.

Check your server with SSL Labs (be sure to check the "Do not show the results on the boards" checkbox)
https://www.ssllabs.com/ssltest/


Addressing unsubscribe link leakage when an email is forwarded

Many mailers use the mailto trick where one needs to send an email with "Unsubscribe" in the subject to unsubscribe.

Create a mailto link in your newsletter. Perhaps add a body with some text telling the user that sending this email will unsubscribe them from the newsletter.

Unsubscribe

When the user clicks the link, their mail client should pop up a new email with the To and Subject pre-filled and ready to send the "unsubscribe" email.

When you receive the email on your server, extract the From field to find who to unsubscribe and if the Subject is "unsubscribe", then unsubscribe them. Of course now you need to deal email forging, if that is something worth tackling.

Additional information: If you want to go the standard way, RFC 2369 explains the commands for mailing lists. (EDIT: As clarified by @AdamKatz RFC 2369 is largely obsoleted these days. Check RFC 8058 for the latest functionality of email headers).


How to use msfvenom elf approach for metasploitable 2?

After several retries to slightly adjust the payload. To no avail. I reinstalled Metasploitable 2.
I Remade the payload again as originally intended.
I ran sudo ./test.elf on the metasploitable machine and it worked.
I had ran sudo ./test.elf before and it gave me command not found on the other install.
It seems to work now. After making several payloads they all work now. I assume it was a bad installation or I somehow messed up the other Metasploitable 2.


The SSL server certificate is meant to convey the public key of the server. This is the method by which you can know that you are talking to the right server, not a fake one setup by some attacker intent on grabbing your password or credit card details. If you browser warns you about the certificate, then this guarantee has evaporated (like dew in the morning Sun, as the usual metaphor goes).

The sane reaction when faced with a certificate-based warning from the browser is to stop accessing the site altogether. Proceeding with HTTP or HTTPS on that site is at your own risks.

If you MUST really browse that site, then just consider it as unreliable and unprotected. You don't really know if you are using the genuine server, or a fake one. Don't send any sensitive information to that server. Don't consider that any information sent by that server is true.

(In that situation, HTTPS is still "better" than HTTP in the following sense: if the error is due not to an actual attack, but a thorough misconfiguration, then HTTPS will still do some SSL which will offer some protection against passive attackers, who spy on the line but don't try to interfere with data exchanges. This is not a big protection, because passive-only attackers are rare.)


How to secure web directories allowing only me to access them

If the secret files and PHP application is on the SAME server:

Put them outside of the "web home".

Eg, normally you have a directory like:
/public_html/cgi-bin/file.php
that maps to: http://www.example.org/cgi-bin/file.php

What you then, do, is to put these files above the public_html folder, like:
/somesecretdb.db

The file /public_html/cgi-bin/file.php can then access somesecretdb.db by just opening ../../somesecretdb.db
But the file won't be accessible from the "outside".

If the secret files and PHP application are on DIFFERENT servers:

Then you can use IP authentication, where you create an access or firewall rule, that only allows access to the file from the server hosting your app.

If the file server is intended to be only used by the PHP application server, you can configure the firewall at the file server, to only pass requests from the PHP application server to port 80.

If the file server is both intended for public usage (eg some files must be directly accessible for users) and private usage, you can instead configure the webserver, using .htaccess or configuration file, to tell it to disallow requests for private files unless the source IP is same as the PHP application server.


Can my ISP provide my parents with what sites I visit?

All the sites you visit regardless of what you use software wise (incognito mode etc) need to do a DNS resolution, i.e query the domain name for an IP address.

If you are in the UK your ISP will have a record of all this, I cannot comment on other jurisdictions but would be surprised if the vast majority did not have the same level of data.

If the sites you are visiting are HTTPS, then that is all the ISP will have just the domain name of the site, if however the site is only HTTP, your ISP will also have full visibility of the sites content.

If your dad is tech savy he can also see all of this if he wants. At the very least he can view router logs and see the site domain names.

Your best defence here is to use a hardware based VPN, again you could use a software VPN but there is a chance it may be interrupted and you device would just revert back to the regular network while it re-establishes a connection (There are way to stop this but it requires some know how).

Another option is TOR, however this may be more trouble that it is worth if you are not familiar with it. It would allow you to mask all your internet traffic from both your family and your ISP but there is a learning curve with it.

Some valid arguments against your dad for using such devices include:

Getting round content restrictions
Using a lot of public WiFi, you want to be sure you are safe
Your uni/school/place of work have request it
you don't want your ISP knowing what you are doing


How would you make a comprehensive list of Google domains?

Maybe a better solution would be to lookup the IP classes owned (registered) by Google and blacklist (deny) them in a firewall (iptables).

To get the IP classes owned by Google, you could start by gathering IP addresses from different classes (maybe using DNS to resolve different well-known Google domains) and using one of the many online WHOIS services (an example) which indicate how much of that class (the subnet mask) is owned by Google.

Just a side note: getting the IP classes is not quite practical and probably not the only way. Not sure if you can find them somewhere already published...


Securely connecting a wifi client to an AP using a generated password

It sounds like 802.1x over WPA2 is the way to go. I won't say that this is necessarily easy to configure, but it may fit your requirements.

You'll need a CA. This could be your AD server for simplicity, you're enterprise might have one already, or you could designate any server you trust sufficiently to be an internal CA (if you're really a martyr, you could even use a public CA so long as you don't mind it taking weeks to add new clients and racking up thousands of dollars in fees). This will need to sign certificates for your RADIUS server and clients.

You'll need a RADIUS server. This can be the NPS service in Windows Server, FreeRADIUS on RHEL, pfsense, even some routers can do it (But if you make your router into a RADIUS server, I wouldn't admit it on the InfoSec Stack Exchange). This will need a signed cert to validate its identity to your clients. This will serve to authenticate your clients, it can be configured to do so by username/password, or it could do so by validating the client possesses a valid, signed cert. In some cases, you can configure the RADIUS server to check an LDAP directory (such as AD, IPA, openLDAP, etc.) which associates each identity (certificate in this case) with a set of groups. These groups could control which networks the user is authorized to connect to.

Your APs will need to be set to use WPA2 Enterprise, and configured to route authentication requests to the RADIUS server. Configuration varies wildly based on the make of your AP.

Your clients will need to have a signed cert loaded onto their system and configured to provide that cert as 802.1x authentication for the WiFi connection to your AP(s). Again this varies wildly depending on the device and configuration is left as an exercise to the reader. This is using client-authentication TLS over EAP and is thus usually decorated as the EAP-TLS option in many configs that I've seen.

Anti-Patterns

The issues with this depend on your environment and risk-acceptance. But these concerns should be addressed.

Getting certs to the client
You'll need a way to get certificates onto the client device. In a passwordless environment, that certificate allows network access and must be protected like a password and thus a secure method of transmission must be devised (in this regard, it might undermine the whole reason you're considering this option).

For laptops, if you can wire it into the network, do some automated validation (MAC Address, Active Directory credentials, or whatever you devise), then you could load a signed cert onto the system (or have the system generate the cert and send a CSR to your CA).

But if your environment has phones/tablets, the problem becomes trickier. Options might be transferring certs by USB flash drives connected to OTG connectors (make sure you sanitize that drive after each time you connect it to a yucky user device). Perhaps you could provide an easier-to-access WiFi network on its own isolated network/VLAN, this could use a single PSK that you rotate as needed, and on this network all you can do is validate your device and be issued a cert. These options come with their tradeoffs, send them through your own risk analysis.

Cert Compromise
The other concern is that certificates get compromised. Most likely this would only happen if a user's system is owned, but there could be a few other scenarios where a valid certificate is leaked. If you can identify this compromise early, you can have your RADIUS server validate against OCSP or a CRL. To combat against unknown compromises, you could set the certificates to expire quickly, but you have to have an infrastructure set up to automatically renew and install users certificates and ensure that most users connect at least once before their certificates expire. The best idea is probably a little bit of both and locking down network resources so that being on the network doesn't necessarily give you access to anything (i.e. don't use the same client certificates to authenticate to other network resources).

P.S.

This is not a quick and easy set-up, but it can be a robust one if you find a good level of trade-offs between providing access to users and protecting access from attackers. And it can allow you opportunities to expand and add additional functionality once you become more comfortable with your implementation.


How secure is the fingerprint sensor in the Pixel 3?

For the sake of ergonomy, smartphones are equipped with small fingerprint sensors which means they are able to obtain only partial images of a given fingerprint. The chances of a partial fingerprint being incorrectly matched with another "user" fingerprint is relatively high. (cf: MasterPrint: Exploring the Vulnerability of Partial Fingerprint-Based Authentication Systems)

Recently (18 Oct 2018) researchers introduced the concept of DeepMasterPrints which is basically based on training a neural network on a set of real fingerprint images in order to create a synthetic fingerprint able to fool a fingerprint sensor, this is roughly done this way (cf: this paper):

So to answer your question:

  This work directly shows how to
  execute this exploit and is able to spoof 23% of the subjects
  in the dataset at a 0.1% false match rate. At a 1% false match
  rate, the generated DeepMasterPrints can spoof 77% of the
  subjects in the dataset.

And Google Pixel cannot be an exception.

This said if you're locking your phone to answer a"normal life" need...You do not have to worry :)


How to check for null byte injection in Java webapp

Correct.  If you allow untrusted input to affect any part of a filename, then you should apply proper input validation to protect yourself from attacks.  You will need to protect yourself against not only null byte injection, but also path traversal and other attacks.

My recommendation is to apply the following checks:

Ensure that the filename is not "" (the empty string), "." (the current directory), or ".." (the parent directory).
Ensure that the untrusted input does not contain any slashes, as they can be used to separate directories and thus might enable a path traversal attack.  To be portable and secure, I suggest you check that it does not contain any instance of File.separatorChar (the directory separator) nor of '/' (as '/' also works as a separator on Windows, even though it is not the value of File.separatorChar).
Ensure that the path does not contain any '\0' characters (NUL bytes), as they can be used to mount a nul byte injection attack.
Check that the filename corresponds to a normal file, using File.isFile().  The purpose here is to ensure that the file does not correspond to a platform-specific special file.

For instance, on Windows, the filename PRN is reserved and treated specially: it refers to the printer.  Moreover, PRN is interpreted globally: if you access the file \Foo\Bar\PRN, Windows interprets this as referring to the printer (and in general, PRN is special in every directory).  There are a range of Windows reserved files like this.  You want to make sure the attacker is not tricking you into opening one of these reserved files.

Note that checking with File.isFile() before opening the file is not atomic in the presence of concurrent updates.  Therefore, if there are other processes on the system that might concurrently modify the filesystem and might be influenced by untrusted inputs, this check might not be sufficient: you might want to explicitly check whether the last component of the path matches any of the Windows reserved filenames.  Here's the list of Windows reserved filenames I'm aware of: CON, AUX, COM1, COM2, COM3, COM4, LPT1, LPT2, LPT3, PRN, NULL.  (I suspect that this list is probably incomplete.)

If you want to see some code from a separate project that contains these sorts of checks, albeit for a slightly different purpose, here's an example.


I confirmed with the support team. There is no way you can disable the modules in Metasploit Pro. You can only choose the ranking of the exploit modules. I also confirmed that there are no Denial of Service modules used with "Great" or "Excellent" ranking modules.


Why does the revocation sent to the OpenPGP keyservers not show up?

The key server network does not consists of a single server, but a whole bunch of servers that synchronize through "gossipping". keys.gnupg.net actually points to pool.sks-keyservers.net, which again randomly serves IP addresses of key servers operated by individuals. This will take a while, expect some time between few minutes and multiple hours.

If the key shows up as revoked locally and you recently uploaded it, just wait for some time and check again. You could select multiple servers from the SKS keyserver pool and upload the key directly to different of them to speed up the process, for example by running

gpg --keyserver hkp://keyserver.erat.systems --send-keys 3C76732B

(keyserver.erat.systems is the one I'm running). You don't have to upload to all of them, probably synchronization would actually be faster than you selecting the servers manually. As already explained, uploading to one (or one of the pool addresses) is sufficient if you wait for some time.


That's all. What you see in robots.txt is all there is.

What makes it useful for attackers is that site administrators sometimes use robots.txt to hide sensitive information. If "https://www.example.com/sensitive_info" should remain hidden, it shouldn't be crawled by bots, so it should be in robots.txt. However, putting it there exposes it to attackers as well.


How to restrict access to unwanted sites?

I advise you to install squid.
It is a highly customisable web cache providing many configuration possibilities to protect of most of the attack web servers.
I'm using it to protect my network of add web servers, spying web servers,
any web servers without a DNS name, and many other sorts of attacks.

I'm testing many a priori filtering, and most of them are successfull:
when checking afterward the blocked web server I often discover a well
of malware.


Remove Malware from files? (Except Anti-Virus)

Generally speaking, you create fresh copies of the files, transcribing only the parts that you can verify clean using methods that you can verify secure.  This may be risky.

For example, if you have a document that might be infected, you might re-type it on another computer.  Obviously, don't type parts of the document that might be virus-related, e.g. a macro you can't 100% prove to be non-malicious.  Then the new copy would, ideally, be safe.

Theoretically, if someone's got a lot of documents, they might try to automate the process:

Create a server that constructs new documents on a clean computer.
Create a client that dictates from the infected documents on the old computer.
Obviously, don't have the server simply copy everything – instead, have it recreate only content that's definitely safe; everything else will be lost (unless you want to take some calculated risks).
Allow the client to connect to the server over a secure format that you're willing to bet the infection can't side-channel through.

For example, if you copy it by hand, then you're betting the virus can't hack your brain.
For example, if you copy it by a network socket, then you're betting that the virus can't hack the server through whatever network protocol is involved.

I'd speculate that someone's probably set up a service centered around this where:

They operate a server with appropriate security measures.
Users can download a client onto their infected machine.
The client dictates the files to the server, which allows reproduction of verified-clean material.
Users can download the verified-clean documents from the server onto a new device.

That said, I can't recommend a service that does this.. just seems like there should already be one, or else it could be a potentially great side-project for someone.  Obviously, you'd need to be able to trust the service provider.

Finally, to be clear, trying to recover infected content can be dangerous.


What precautions should I take when creating users that will be used by applications and not by people?

Identification and tracking become important but surprisingly difficult.

First, tag the accounts in the directory so you can identify them as non-user IDs.

Each non-user account needs to be associated with an account owner, someone responsible for securing the system it accesses.  Store the owner's identity in the non-user ID's directory entry, so if you go hunting these down later, you know who should be contacted.  Remember that owners come and go with employee promotions, turnover, etc., so you might need a department or other organizational tag to go with the employee ID.  Group membership can help here.  Also, as employees leave, their directory accounts may be deleted, rendering an unknown ID useless - a name is at least someone other people can help you track down.

It may also be helpful to know what machine the accounts are associated with.  Keep that information in your directory, too.

If you have a formal request system, where people enter their requirements for requesting the account, the machine, etc., I'd store the request number in the directory entry.  But keep in mind that request tracking systems can be changed, and that information associated with tracking numbers issued 5 years ago may no longer be available.  I recommend you still keep the owner and machine info on the record, too.

If you don't already have a formal review process for your accounts, consider that when you do implement one, you'll have a big pile of non-user accounts in your directory.  This data will help you identify the reviewers (the system owners should review these for appropriateness on a periodic basis.)  Consider keeping the review data with the record; you may even want to keep 'last reviewed on/by' information in the directory to provide to auditors.

The main reason to keep this information is in case of a compromise.  During the response phase, you need to be able to rapidly identify the people associated with the account so you can change the passwords, scan the systems, and track them down quickly, with a minimum of effort.  Keep in mind that you may need to do this activity without alerting the system owners, at least while the investigation is active.  You may also need to provide review information to investigators.  It's a sad reality that the compromise may originate from an internal source.

To answer the rest of your question, you should generate a lengthy password, using a cryptographically strong password generator (not javascript's random()).  If you can assign these accounts and passwords without involving humans, using a password management tool, that's even better.  There are commercial systems that tie into ldap servers to do much of this (since you're an Oracle shop, you should check with your account rep because they sell such a system.)


Don't do it. Reason: general principles. ("Don't roll your own crypto.")

You're deriving a key (something secret) from something else secret. You don't need to invent a procedure for yourself. Go with an established key derivation function. Something like PBKDF2.


Which authentication at the end of the Secure Remote Password protocol?

At the end of SRP, client and server are implicitly authenticated to each other. "Implicit" means: "I do not know if I talked with someone who really knows the shared secret, but I know that he knows the symmetric key I just got from the protocol only if he knows the shared secret". If you want to make sure of that, challenge the peer: have it use the symmetric key.

Now it is not as easy as it seems. In particular, an attacker could try to make a machine talk to itself. To ensure security, you shall derive several symmetric keys from the one which was produced by SRP: one key to encrypt from client to server, another distinct key from server to client. And a pair of keys for integrity checks, too. This is hard to get right, so it is highly suggested to use a protocol where all those details were painfully tuned through years of attacks and counterattacks -- namely, TLS. Did I talk about RFC 5054 ? TLS includes the Finished messages which are, basically, the challenges I am talking about. When a machine has received a Finished message from the peer, and it could be processed (proper MAC, proper value when decrypted), then the peer is duly, explicitly authenticated.


Is disabling Remote Desktop Services sufficient to protect a Windows device from the BlueKeep vulnerability?

"... Remote Desktop Protocol ... Microsoft advises to disable it until the latest patches have been applied..."

https://en.m.wikipedia.org/wiki/BlueKeep


Are there any standards that *require* companies to use specific Uptime Institute Tiers for data centers?

Are there standards that explicitly state "thou shalt use a minimum of Tier X datacenters!"

You won't find any standards or government rules on that. You might find similar language in contracts where a business/government is setting an expectation for you to meet, but there are no regulations on the matter.

As for the example you provided, "good enough" is determined by a Risk Assessment of your business and infrastructural needs. Try this example:

You have flagship application which is responsible for 2/3 of your companies revenue. You teams regularly test fail-over scenarios across your data centers. One evening, while your team is testing a fail-over, a storm takes out the utility to the data-center. The data-center is tier 1, so it doesn't have redundant power. Thus it's completely down until power is restored.

How much man hour were lost because teams could not test?
What if the transfer failure caused an error which a DB could not be roled back until power came back on?
How many man hours are lost because your data-center team needs to go restart all the services?
What if the power comes back on and the surge blows a breaker?

A tier 1 might be fine for a small business who could be down for a day an survive, but a companies size increases, the expense for downtime on a system does up, not just in man-hours, but also in lost revenue.


It is difficult to say what nationstate intelligence agencies will do with people who use tor, since they don't generally reveal their procedures. However, there are approximately 2 million connected users at any given time, which is a fairly large pool. Many of us use tor for everyday, uninteresting traffic partially so that the use of tor doesn't become an interesting "signal".

Now, even if you get put on some sort of list, theoretically that doesn't matter unless you're breaking the law. There's a lot more that can be said here, but that particular subject is not on topic for the information security stack exchange.

One thing that's important to know is that tor by itself does not provide full anonymity (and it introduces a man-in-the-middle, which can be a security attack). You should always use tor in connection with https when possible. See also Is it safe to download internet files over tor?


The best you can do is read the References associated with a CVE.  The CVE Date Entry Created isn't useful because, as they point out,

  Disclaimer: The entry creation date may reflect when the CVE ID was
  allocated or reserved, and does not necessarily indicate when this
  vulnerability was discovered, shared with the affected vendor,
  publicly disclosed, or updated in CVE.

The References section, however, may include announcements of the vulnerability and announcements of fixed versions, which will likely provide the dates you're looking for.

The downside of all this is that it's clearly a manual process, and your success at finding dates will vary from one entry to the next - again, as the MITRE site says, "The [References] list is not intended to be complete."


Spike in TCP port 5904 activity - what for?

I don't know what vulnerability they might be looking for, but VNC uses that port. http://www.cyberciti.biz/faq/linux-iptables-open-vncserver-port-6000-5800-5900/

Maybe one of the vulnerabilities listed here that applies to VNC servers. http://web.nvd.nist.gov/view/vuln/search-results?query=vnc


What are solutions to combat spam bots beyond captcha?

The primary method of understanding a "bot" is behavior based. Fail2ban is an example of a behavior-based software that blacklists an IP for "behavior" - in this case, brute-forcing an SSH. Other behaviors are excessive comments, posting obvious XSS scripts in comments and having many directory/URL requests within a short period (e.g. the use of dirBuster).  Usually behaviors are identified by using some sort of algorithm or software that detects when an IP/user/role is doing something far more quickly than a human could (whether posting comments or scanning IP's.

Moreover, many firewalls, bot filters and  spam filters have massive lists of domains and IP's that are already known for bad behavior. These RBLs et al. are updated constantly and more well known sites like spamhaus work to keep compromised IP's at bay.

Also noteworthy is that the predominant majority of bots come from certain geo-based IP blocks. I can expect with high regularity daily scans on my work network from East-European, African and Asian IP's. This is where greylisting comes in handy, because a lot of reputable people live in those areas and want to consume whatever content we're serving up, but that area also produces a lot of bots.


Can we prevent DNS-based attacks with SSL/TLS?

No.  This is exactly why we have PKI - to prevent this type of DNS poisoning attack that you are describing.

Here is what would happen in the case that you are describing (including the comments), after Bob clicks the link to https://PayEasy.com.  First, Bob's browser would do a lookup DNS lookup for PayEasy.com.

Let's assume that the attacker (Bob's ISP or his WiFi provider) managed to return a false IP address for PayEasy.com, and returns an IP address to a web server that the attacker controls.

OK, so now Bob's browser connects to the attacker's web server.  But - here lies the problem - the attacker's web server serves up a certificate for PayEazy.com.  At this point, Bob's browser knows that something is up, because the browser requested PayEasy.com, not PayEazy.com!  Bob's browser would show him a warning of the certificate mismatch, and Bob would be wise to cease connecting with the site.


Partially controlling LDAP BindDN parameter

The following points are worth considering in any attempt to leverage this, though I don't believe anything except attempts at denial of service would work.

Where LDAP URLs are used, these do not support in-band credentials in the URL, as the (now deprecated) method that HTTP URLs used "http://user:password@host/". There should be no way to inject a malformed bind username into such URLs (typically used for search queries) to alter their effect. However, some directory implementations support non-DN usernames in a bind operation — specifically Active Directory (userPrincipalName); or OpenLDAP with SASL and/or olcAuthIdRewrite/ olcAuthzRegexp. If OpenLDAP is configured to take a non-DN bind username (in the form of an email address or uid @realm), or otherwise uses the rwm overlay to rewrite in bindDN context, and formulates an LDAP search URL to determine the real user DN, this will only be as robust as the administrator's rewrite instructions, and could be subject to injection of malformed usernames. This is fairly unlikely, and probably very difficult to do blind (without being able to inspect the rules). I suspect it's simply an AD backend here though.

On the wire, the bind request will be a DER encoded structure of the form

 0   53: SEQUENCE {
 2    1: . INTEGER 1
 5   48: . [APPLICATION 0] {
 7    1: . . INTEGER 3
10   33: . . OCTET STRING
       : . . . 63 6E 3D .. ..            cn=user,ou=...
45    8: . . [0] 'password'
       : . . }
       : . }

An anonymous bind will already have been created, establishing the connection. Unless there is some horrible bug in the underlying ASN.1/LDAP library (e.g. to let you formulate a username with a DER parseable trailing password of your choosing, for brute force) then the best you can probably do is exercise the parsing, escaping, or UTF-8 encoding layers, or determine the maximum size of a DN (not defined by LDAP schema).

The best you might be able to achieve is:

denial of service, possibly through the use of very long or dubiously escaped/quoted usernames
lockout of an arbitrary user - assuming the directory implements this, e.g. AD policies, and the directory service is not otherwise accessible (in which case it's probably trivial to achieve in other ways)
attempt to enumerate other users in the same domain/directory, how practical  this will be depends on feedback during the authentication attempts (see this for LDAP error codes)
attempt to find another user with the same password as this user (though how that might be useful, I don't know)


Security of adding letter in front of passphrase

This is a bad idea.

You need your passwords to be unique. Re-using 95% of a previous password doesn't respect this rule, so you should really avoid it.

If an attacker manages to get access to one database with cleartext passwords, he will most likely understand how your password was generated, and will be able to guess all your other passwords.

You should use a password manager instead, they will generate random & unique passwords for you.


openssl SubjectDN parameter, abbreviaton of argument keys and how to add extra ones

In an X.500 distinguished name the "keys" represent Object Identifiers abbreviated OIDs. This includes the Subject and Issuer names in an X.509 certificate and also the Subject name in a PKCS10 CSR, and quite a few other things.

I could not find a complete list of the allowed keys.

There is no complete list. The OID assignment scheme allows unlimited hierarchical expansion -- this is like asking for a complete list of all URLs in the world. OpenSSL predefines a fixed but large set of OIDs that have been standardized or at least widely used; see the header obj_mac.h on your system if you have a 'development' version of OpenSSL installed (i.e. headers and libraries suitable for compiling your own code, rather than merely running precompiled code) or if you have source code the crypto/objects.txt file from which obj_mac.h is derived or in the repository. In the former file the LN_ string is the 'long name' and SN_ is the 'short name' or abbreviation, if different. In the latter file these are just columns on one line, with the short name first or empty to indicate there is no distinct abbreviation.
For example CN is the short name and commonName the long name for the OID 'X509 3' which, using other definitions in the file, expands to the actual OID 2.5.4.3.
If you -- or (more likely) someone or something you are interoperating with -- needs an OID outside of OpenSSL's predefined set, either because it's standard but rare and/or new, or because it's not standard at all, then you can still use it in OpenSSL by defining it in your configuration file; see the oid_file and oid_section items in the man page for req or for ca or the generic config for other commands like x509.
Typically the OIDs defined in X.509, and those defined for X.509 in PKCS9 (such as emailAddress), are commonly used in X.509 subjects, but technically any OID can be.
As you can see in the predefined list(s), there is an X509-scope OID for long name organizationIdentifier with no different short name -- this MAY be what your specifier wants, although it may not. There is no such obviously applicable OID for a URI, or URL; ask them to be precise about what they want, or to give/show you an example that shows precisely what they want.

I need to create a certificate with the following extentions:
Is it possible ... the addtext argument must be used? [You mean -addext in req]

These are not extensions. X.509 certificates have name fields containing attributes, which are one thing and the thing you want, and separately (but similarly identified by OIDs) they have extensions, which are a completely different thing that you do NOT want. Or at least not for this purpose; as you proceed you may find you also want extensions for something completely different that the specifier 'forgot'.


mXSS is a new type of XSS attack by Mario Heiderich. I actually saw him present this very talk at Syscan 2013 this year.

The vulnerability in question comes from innerHTML which allows direct manipulation of HTML content, bypassing the DOM. An elements innerHTML is non-idempotent. The browser manipulates the contents to fix and optimize errors with the HTML. This is very visible in the example given in the slides. The problem with this manipulation is that it sometimes introduces flaws that is not apparent at first sight. One good example is also in the slides.

The big deal about this attack is that it bypasses (at the time of the talk, situation may be better now) most of the existing XSS filters and sanitizers.

As far as I know, there isn't any other available information about this class of XSS attack besides whatever information is present in the presentation slides.


Depends on the virus, and on the type of file. Also, bear in mind that a "virus" technically describes a self-replicating form of malware - there are other forms of malware which can be concealed within files using similar techniques. So:

Executables: Most executable files are relatively sparse - there are big gaps between the legitimate code and data for various reasons. Can be for performance reasons, or to take advantage of compiler optimisations, or just because various compiler flags weren't set to squeeze the output size to the minimum. Some viruses take advantage of this, and insert their instructions in these gaps, which changes the resulting hash of the file (note that a different hash means the contents are different, not just that the file size has changed). By hijacking the program entry point to execute the virus code before or instead of the legitimate code, a virus can be executed when the application is started.

Note that in this case, executable files include things like DLL files - they are essentially Windows executables which expose functions, rather than being self contained applications. There are some technical differences, but in terms of infection, they are pretty much identical - just hijack a call and make it point to your code rather than the original.

Linux executables are very similar, in having empty space, but the file system may also attempt to enforce rules as to whether specific files are treated as "executables" or "data", which can slightly complicated the issue.
Data files: Some data files, especially media files (images, sounds, videos), use a block structure, where a number of distinct types of data are stored in distinct blocks. For example, a PNG file is comprised of, at minimum, three "chunks": a header, the image data, and an end of file marker. In these files, it's often possible to add extra blocks using the correct form, and add arbitrary data: in a PNG file, this could be adding an "iTXt" chunk, which is just a block of Unicode text.

However, data files generally can't execute themselves, so there will normally be either a modified executable file as well, or a targeted flaw in a processing application. For example, if there was a command line image processing tool which took a folder of images and processed them in some way, it might be that a flaw could be found that meant by providing a specific input file it added data to all files in the folder processed after the "evil" file making them behave in the same way. This could be classified as virus-like behaviour, but wouldn't meet some definitions of a computer virus.

For some file types, it's valid to add data after the legitimate file content too. For example, JPEG files can still work if you simply append text files to them - exactly as your mental image. This could be used by a virus, but due to the the lack of executability, is unlikely to be the only part of a virus.

Other forms of malware make use of similar techniques: there are whole families of malware which are inserted into PHP files and then execute when someone accesses the related page. Ransomware is often distributed by hijacking Javascript files and adding malicious code to them. In these cases, though, the code isn't usually self-replicating, so doesn't meet all the technical details of being a virus.


Detect a Host on my Network that is Conducting Web Scraping on External Systems

If you're not above getting your hands dirty with a bit of scripting, you could make a simple Python script using the Scapy library. This script would watch for HTTP traffic to the external company's site and log the IP.

Upon review of the capture file, the most recurring IP address should be the culprit of the scraping.

If this external company's site is accessed frequently by users on your LAN, then you may want to watch for requests that result in a 404 error response from the outside company's site, as this would be a sign of the scraping tool attempting to access URIs that don't exist during the scraping process.


Can ransomware hide in cloud storage/backup environments?

Probably not... but yes it can.

There are many places: Exe files, MSI, PDF, Word files (Macros)
I would recommend you to inspect all files with a Virus Scanner and/or a tool that detects the exact Ransomware you have just removed...

In general you should avoid storing some files in your backups (like .EXE or .MSI)

For example:

Ransomware owns your system
Ransomware detects dropbox and infects your cv or .exe with trojan or another version of himself
Ransomware encrypt your files and delete originals from your harddrive and dropbox
You get rid of ransomware and restore previous version of dropbox files
Previous version was infected in step 2 (smart ransomware developer)
Back to square 1


How does the "Privacy Protection" option from domain names registrars work?

They "technically" work by providing the company name and address to the whois database instead of yours.  That's it.

The main advantage is that you don't get your domain revoked for providing bogus information.  And you can still be contacted through the registration company where needed.


Since you will be generating an API key for each user, you could do exactly like you suggest- which is essentially treating each token like you would a password. You could store the id, the salt, and the hash of the token in your database. Hashing is great as long as you never need to get the original key back.

Note that since this is something your system is generating, it isn't as important to hash it in the first place (unlike for a user generated password). But this depends on your threat model. If someone hacks your server, would you care if they had a list of everyone's API key? If yes, then hashing them is the way to go.


Is SWIFT (banking) Software Architecture Secure?

Among other things, Swift is a cooperative organization of financial institutions who agree to using the same standardized messaging system for financial transactions. As such, they publicly promote the use of ISO 20022 as their primary standard for messaging between financial institutions. That said, each member may implement this standard using a very wide variety of software on different platforms each of which can have its own security vulnerabilities. The standard itself is a bit dated and probably could be improved, but the bigger issue creating vulnerabilities for financial institutions is each entity’s implementation and choice of security controls.

The ISO 20022 standard is accessible for review but each vendor’s implementation of it is probably not. As far as certification goes, these components would most likely be certified for ISO 20022 compatibility if anything, and not for security from an attacker’s perspective; so this is probably not something meaningful from the standpoint of your question.

I think it would be wise for the organization to create a more rigorous set of security standards which members must adhere too, possibly similar to but stronger than PCI-DSS, but I suspect there would be a lot of objections to this from member organizations that do not want the additional requirements. That said, I think you are bringing up very valid points and I think it would be very wise for organizations using Swift to put pressure on their peers to help address the security needs. More importantly, I think a lot of these member organizations are currently stuck using traditional security methods to fight much more high-tech adversaries. Now would be a great time for that organization to put a stronger emphasis on increasing the strength of its network to reduce future expenses related to breaches.

One thing that seems to also have emerged during the recent string of attacks is that SWIFT put out a request to all of the connected banks asking them to report potential breach information and cyber-attacks. As such it appears that SWIFT left a lot of the security responsibility in the hands of the individual banks and did not account for banks which would not perform appropriate security measures to defend the SWIFT network. Aspects of the attacks which have occurred may also imply that there is very little internal monitoring of SWIFT transactions from a purely fraud-detection standpoint. The following Reuters article points out that it appears that the relationships between banks is also fragile and that many of the weaker banks are unlikely to admit their security short-comings and that these short-comings may be somewhat common among all of the smaller banks participating in the network. Likewise the article goes on to talk about the importance of SWIFT participants to also increase their own non-SWIFT verification methods to add security to the less secure SWIFT process as such it would appear to imply that industry insiders don't have a lot of faith in the security of the SWIFT network and that it's a known risk in many ways.

http://www.reuters.com/article/us-cyber-heist-swift-specialreport-idUSKCN0YB0DD

Finally it should be noted that the ISO 20022 standard does not have much in the way of security within the standard itself. This is a very old communication standard without requirements for many modern security controls which would probably be required if a similar network were architected today.

SWIFT
SWIFT Standards
ISO 20022


64bit buffer overflow fails with SIGILL, cannot understand the reason

First off (only because you mentioned "realistic"), this is not exactly a realistic scenario for a 64-bit system. The main reason is that the address space is much much larger, which makes it much more difficult to predict and land within your NOP sled. For a more detailed explanation, see this answer. Also, no-execute-stack (NX) is almost universally enabled these days.

Instead, you typically will want to use return-oriented programming (ROP).

That said, let's address your current scenario. I spent way too long trying to figure out what was wrong, but it looks like you may be doing everything correctly (assuming you have the correct address to return to).

Looks like that's actually a 27-byte shellcode, but you had the correct amount of padding anyway to equal 40 bytes to the return address, so that's fine.

Turns out, the way you get it to work is to try it from outside of GDB. You may notice, if you step through it more slowly, that the SIGILL is actually occurring past the syscall instruction, but GDB is somehow fudging it so it seems to happen prior. I scrolled back up while stepping through, and it appears the push rbx instruction was throwing off GDB; it was trying to dereference 0x68732f6e69622f (which is just /bin/sh in hex representation) and complaining about that, which maybe caused other things to go wrong (GDB was also inserting segfaults and ghost instructions for me as well). Maybe somebody else has a better explanation for why this occurs.

So, try running it outside of GDB. You will almost certainly need ASLR to be turned off, and you'll need a way to get the address of the buffer. You can add a print statement to the original source to print the address with %p.


Facebook connect is pretty much oauth openid connect with a few changes. So in order to understand the security model, it can behelpful to understand how oauth works. There are a lot of resources on that available on the net.

Your question isn't quite specific enough to give you a specific answer. I'll assume you're designing a server application designed to be used in browsers (user agents) and that you don't actually worry about which application did the original login request to authenticate the user,  but rather that you want to avoid a scenario where a user which isn't authorized to use your server application can use it because he successfully authenticated himself to facebook earlier on, either directly on fb or using another app that uses facebook connect.

The comments to your original question already provide answers to this question:

When you get an access token from fb connect, you must verify it. There's an endpoint facebook provides in order to do that, so your server application must send a verification request to that endpoint. If you don't verify it, just as you fear, you could end up with an access token that wasn't meant for your app, or for another user, or had expired. If you do verify it, you will get back a json reply from the verification endpoint that contains a user id and an app id. You can compare the app id with your own app id to see if the token is meant for your application. An attacker shouldn't be able to produce a token with your app id (partly because your app id shouldn't be known to anyone but FB and you). But I the main reason why nobody can act as if they were your app is because you must provide the app secret as part of the verification process. Only you and FB know that secret. So FB can fail the verification if app secret and the app id in the token don't belong to the same app (there's actually another step involved before verification - you must first get an app access token, in order to use it with the verification endpoint, and in order to get the app token, you must provide your app id and secret).

From the verification response, you can also see whether the user id is what you expect it to be. One you've verified the token, it's authenticated and you can trust what it says about who and which app the token is for. Until you do verify tokens, they're just claims that anyone could make.