SSL traffic manipulation through ettercap MitM and iptables

The best solution is when ettercap does not MiTM the SSL connection, just forwards it to Burp, and Burp can be set up as a transparent SSL MiTM proxy. In this case, the client will see Burp's server certificate, which has to be trusted by the client. As you can see on the following, only 2 SSL connection is set up.

           SSL1            SSL2
Client <--Ettercap--> Burp <--> SSL Website

Although both ettercap and Burp can be set up as SSL MiTM, it makes things only more complicated. In this case, the client will see ettercap server certificate only, so you don't have to add the Burp's certificate to the store. In this case we will have 3 different SSL connections, but it does not have any advantage compared to the previous one.

       SSL1          SSL2      SSL3
Client <--> Ettercap <--> Burp <--> SSL Website

To answer your questions:
Yes, as a real world attacker the above would probably be one of the methods you might just use to launch an attack.

SSH-ing into the Android device and using Shark won't be enough. You won't be able to manipulate the traffic. You will be only able to decrypt the traffic if you have the TLS/SSL server keys (which is usally not the case) and perfect forward secrecy is not used.


Wireshark reveals suspicious UDP traffic sending to a bogon IP address

It's multicast traffic used for BT Local Peer Discovery. See https://en.wikipedia.org/wiki/Local_Peer_Discovery.

The Local Peer Discovery protocol is an extension to the BitTorrent file-distribution system. It is designed to support the discovery of local BitTorrent peers, aiming to minimize the traffic through the Internet service provider's (ISP) channel and maximize use of higher-bandwidth local area network (LAN).
Local Peer Discovery is implemented[1] with HTTP-like messages on User Datagram Protocol (UDP) multicast group 239.192.152.143:6771 which is an administratively scoped multicast address. While it is implemented in several clients (µTorrent,[2] BitTorrent/Mainline,[3] MonoTorrent,[4] libtorrent[5] and its derivatives, Transmission 2.0,[6] aria2 [7]) and implementation is very simple, no formal specification had been created as of December, 2009. Alternative multicast protocol extension is published as BEP 26.


Website attack: What is the attacker's goal?

I would like to understand what the attacker is trying to achieve in order to evaluate if this is a threat.

From the points you listed, the symptoms points to DOS attack. Try captcha (only a suggestion: google recaptcha v3) as a means of protection against BOT based resource consumption attacks for web facing tech.

Why would he send password requests for an account just created by themselves a minute ago?

The accounts are all valid and password reset link works as mail bombing attempt. Kindly implement captcha or alternative control to prevent this from occurring.
If the mails are tagged spam instead of receiver hitting unsubscribe due to multiple similar pointless mails, it may hurt your reputation in long term and mails from your domain will soon be blocked my multiple spam filters regularly.


ASP.NET MVC uses a variation of synchronizer token pattern. In a typical implementation, syncrhonizer token pattern works by generating a large random token and preserving it in two locations:

Session state (either on server or client)
In a hidden form field

When a form is submitted, server will check that both values match and fail if they don't. This works because an attacker can't get the token value in advance.

ASP.NET MVC slightly modifies this pattern by not using session state, instead using session cookie. Token also contains some additional data depending on whether it is a cookie token or form field token:

    /* The serialized format of the anti-XSRF token is as follows:
     * Version: 1 byte integer
     * SecurityToken: 16 byte binary blob
     * IsCookieToken: 1 byte Boolean
     * [if IsCookieToken != true]
     *   +- IsClaimsBased: 1 byte Boolean
     *   |  [if IsClaimsBased = true]
     *   |    `- ClaimUid: 32 byte binary blob
     *   |  [if IsClaimsBased = false]
     *   |    `- Username: UTF-8 string with 7-bit integer length prefix
     *   `- AdditionalData: UTF-8 string with 7-bit integer length prefix
     */

Both tokens are encrypted and authenticated and thus not readable on the client side. See the implementation of serializer here. Given the anatomy of the token above you can see that they are not even identical on the client side, both will encrypt to two different ciphertexts and can't be validated there.

You can probably change the behavior in a way that cookie is not needed by storing CSRF token server side in session state. But you really need two of them and you really need to compare them to make CSRF protection work.

EDIT

To answer more directly to your original question

  What is the purpose of the default header/cookie in an MVC
  anti-forgery token?

To give a complete solution that will work all the time and for any application.

It even has an ability to protect login pages:

  Anonymous authentication

  The anti-XSRF system contains special support for anonymous users,
  where "anonymous" is defined as a user where the
  IIdentity.IsAuthenticated property returns false. Scenarios include
  providing XSRF protection to the login page (before the user is
  authenticated) and custom authentication schemes where the application
  uses a mechanism other than IIdentity to identify users. To support
  these scenarios, recall that the session and field tokens are joined
  by a security token, which is a 128-bit randomly-generated opaque
  identifier. This security token is used to track an individual user's
  session as she navigates the site, so it effectively serves the
  purpose of an anonymous identifier. An empty string is used in place
  of the username for the generation and validation routines described
  above.

As per your comments, you are wondering whether you can do it without cookie by including encrypted username and expiration date into a hidden form field. The answer would be it depends.

Such token could be stolen with an XSS attack whereas an authentication cookie (or CSRF token cookie) marked with httpOnly couldn't. This would make your solution vulnerable in the time frame of your expiration. Whether this is acceptable or not depends on you and the type of the application. For example, a net banking application wouldn't tolerate any kind of CSRF vulnerability but a simple online game could.

You can avoid CSRF altogether if you don't use cookies for storing authentication tokens.


Resetting password upfront, before getting email

This is not as secure as one might want it to be:

Assume an attacker visits a site and pretends to be some user of that site and to have fogotten the password. On the password reset page they can pre-enter the desired future password and a mail to the real owner of the account is sent.
The real owner receives the mail and perhaps clicks the link because

they didn't have their morning coffee yet
for anti-malware purposes they have an automatism that
automatically GETs any links in mail to pre-scan the content
they think they didn't request a change, but now that the mail is
in, it might be a good idea to actually change the password on the change form they expect behind the link
any other reason

Now the attacker's password has been validated and they can access the account accordingly. Of course, the victim could initiate another password reset to limit the damage to a few minutes, but the average user would not think of that. Also, the attacker could initiate a second reset as well and how should the victim decide which of the mails arriving shortly is the right one?


Scanning a binary against YARA rules dictionary

YARA allows you to specify multiple rules files to be used (as the latest version).

yara64.exe path/rule/file1 path/rule/file2 path/rule/file3 malwareFile

I don't know what the limit to the number of rule file paths you can specify is in a single YARA invocation, but this should make it considerably easier to script.


Does SOC-2 compliance require password rotation

SOC 2 Type 2 does not have specific technical requirements. What you have to do is to satisfy your assessor.

And if your company cannot satisfy your assessor, then there is a mechanism called "management response" where the company gets to explain away the findings from the assessor.

And if your assessor is 4 years behind in their understanding of best practices in this area, then perhaps you need to find a new assessor ...


Because asymmetric cryptography is slow.
Asymmetric encryption and decryption has some wonderful properties, but speed is not one of them. In fact, asymmetric cryptography is among the slowest encryption and decryption algorithms there are.
As such, if you wanted to download a very large file, then the process of encrypting that file on the server and decrypting it on the client would take very long. Magnitudes longer than it does now.
On the other hand, symmetric cryptography is very fast. AES-128-CBC can be as fast as 600 MB/s for encryption and 2300 MB/s for decryption. The problem with symmetric ciphers is that you need to distribute the keys somehow.
As such, by combining symmetric and asymmetric cryptography, we can share the key (which is rather small by comparison, just 16 or 32 bytes) using asymmetric cryptography, and then encrypt the actual data using fast, symmetric cryptography.
Because you want forward secrecy.
Wikipedia defines Forward Secrecy as follows:

In cryptography, forward secrecy (FS), also known as perfect forward secrecy (PFS), is a feature of specific key agreement protocols that gives assurances that session keys will not be compromised even if long-term secrets used in the session key exchange are compromised.

What that means is, imagine an attacker captures HTTPS traffic between you and a server, and it's all simply encrypted by RSA - no master key, no symmetric ciphers. This alone doesn't compromise anything, but an attacker can keep the captured data and wait. Later, the private key of the server is leaked or otherwise compromised, and suddenly your communication with the server from back then can be decrypted.
On the other hand, if a cipher with Forward Secrecy is used, then the master key is generated for this session alone. Compromise of the long-term secret - in this case, the private key of the server - does not lead to compromise for the previously captured message.


DHT nodes randomly generates node ID by themselves.

def generate_id(length):
id = ""
for i in range(length):
    id += chr(randint(0, 255))

return id

def generate_node_id():
hash = sha1()
hash.update(generate_id(20))
return hash.digest()`

Node ID is generated randomly. Node ID is a 160-bit SHA-1 hash so the keyspace is 2^160. It is unlikely that one node has the same Node ID as the other node. Even if a malicious node impersonates another node, nothing will happen.

That node continues to function as usual without facing denial of service. Other nodes will continue to query that node for lookup search as that node has stayed longer in DHT than a malicious node and is known to other nodes. Whereas the malicious node has to propagate his presence in DHT which can take some time.

The situation will look something like same node ID but with two different routing tables. Some new nodes will query that malicious node as they discover him and he may return false responses but as the data in DHT is replicated very quickly, even if a single node is acting malicious that doesn't affect other nodes in DHT. Instead a threat actor signs up thousands of random nodes in DHT to propagate false information. This is called Sybil attack.

Cloning node ID is not really a problem because nodes die very quickly. By the time a malicious node will propagate his presence, the victim is probably gone offline and come back with new node ID. Though BitTorrent spec recommends to keep the same node ID as earlier because your earlier node ID might be still in other's routing table.


PKI - Hybrid - root ca in the Datacenter

The formal answer is: "Check your Certificate Policy (CP)"

But as you've asked this question, it's fair to assume that you haven't got a CP.

The CP will define your policies covering the generation, storage, usage and management of keys and other factors such as training, physical and network security, policy for requesting certificates etc. CPs follow a pre-defined format for convenience, which is defined in RFC 3647

However, your proposal is a pretty standard design these days, given the proliferation of cloud based deployments.

Have your root CA offline, with a HSM.  If you  can, use a USB or PCIe HSM for this and only use it to sign the issuing CA(s) certificates and to generate CRLs.

Your issuing CA could be in the cloud with a cloud HSM.

Do bear in mind though that with a setup such as this, the CA's image (such as the live disk image or a backup) may be accessible to the operators of your cloud provider.  There is a risk here that they (or some third party) may be able to gain access to any passphrases, certificates or keys required to access your HSM.

An alternative would be to also host this within your datacentre, where you may trust the operators more; or a hybrid where your CA is in the datacentre and the HSM in the cloud (again, depending on your level of trust of these providers).

In the end, this is your decision, which would normally be formally defined in your CP.


Why is it considered safe to install something as a non-root user in Linux environments?

We always hear...

Do we? I don't.

Installing some untrusted program as a normal user is a bad idea with Linux the same it is with Windows or Mac: this program has access to all your data and can delete these data, send these data to somebody else etc. Moreover it can make screenshots, control other applications running on the same X windows screen (even if they run as a different user), can grab keys (i.e. keylogger),... For details see The Linux Security Circus: On GUI isolation.

Apart from that we regularly have privilege escalation bugs even in Linux bugs which can be used by an unprivileged user to get root or even kernel level permissions.

Thus don't install any untrusted programs on any kind of system unless you are willing to compromise this system or the data stored on it.


How secure is Secure Erase option in BIOS?

Once you have run a certified secure erase function even once, data recovery is almost impossible on an HDD. Note that things are different for a FLASH drive.

To expand on this for clarification, HP Secure Erase does NOT overwrite data on the drive - it is designed for SSDs ONLY. HP used to have another option available for HDD's that did overwrite data.

SSD's (solid state memory) work differently than a traditional HDD. Overwriting an SSD is kind of useless with the way SSD's store information, and would lessen the lifespan of the drive CONSIDERABLY. Because an SSD stores information electrically, the HP Secure Erase option basically sends a voltage spike to your whole drive at once, which forces all of the sectors to reset, and wipes everything securely.

As for transparency, HP has released a technical whitepaper on how Secure Erase works, which can be viewed here: http://www8.hp.com/h20195/v2/GetPDF.aspx/4AA7-2608ENW.pdf


SQL injection not returning expected results

There is no fault in the code. You are using the OR condition. For the first row having the data of the user JBloggs, the username is not admin but 1=1 is true for the first record. Since the two conditions have an OR between them, any single true condition will make the whole statement true that is why you are getting the record of the first row.


Basic simple encryption with already installed tools

In short: no, there's nothing that's guaranteed to be installed on those operating systems.

PGP is probably your best bet. It operates on the OpenPGP standard, which any software is free to implement. There are compatible clients for Windows, Linux, BSD, and OS X, and it also nicely integrates with most mail applications (e.g. Thunderbird / Outlook). Many of these applications and plugins are free or open-source, though some are commercial. However, it's not quite as simple as just setting a password; PGP operates on the idea of each user having a key that identifies them, and encryption involves using the target user's public key to secure the data. As such you need to be able to pre-share the public keys (e.g. via a key server, or just by sending it as base64-encoded text) in order to perform encryption.

One alternative is an archive format that supports inbuilt encryption, but finding compatible software across all operating systems is going to be a pain. 7zip might be a good choice, but I can't say I've got any experience with it on OS X. Other formats like PKZIP (.zip) and RAR tend to have discrepancies in the way that encryption is done, not only across operating systems but even between tools.


Backup personal email on VPS - privacy, security and trust risks

The CISSP - Business Continuity Planning section deals with the problem of secure backups.  Implementing a secure backup system is predominantly a problem where Nature is main threat,  and an insecure backups create the possibility of data compromise.  By addressing one threat,  you are introducing a different threat.

When building any new security system it is best to start with a Threat Model.  In this model you must clearly define Actors,  your adversary and the resources you are protecting.  In the case of email backing up email.  State sponsored actors will already a copy, so it is too late to address this threat.

To address some of the threat imposed by nature; backup data to a
replicated storage device such as RAID-1,  Amazon-EBS devices are
also replicated.
To address the threat of data compromise on a VPS or backup device; sensitive data must always be encrypted at rest.  Most backup software has this feature,  Bacula is a secure example.  The "decryption master-key" must not be stored on the backup device.  Data is downloaded from the backup device to a trusted machine and then decrypted for use.
To address the threats imposed by data transfer; ensure that all
backups are transmitted over a SSL/TLS connection. SFTP, HTTPS, or a VPN
can be used to satisfy this requirement.


How safe is it to allow JS CDNs in a HTTP content security policy?

Hopefully , it will be very hard to insert clearly malicious code into a CDN.

Is CDN code highly likely not to be malicious? Yes

Should you the CDN domains be whitelisted for an ecommerce ? No (*)

It is possible that a CDN can be compromised. They have in the past (and there are many kinds of CDN, and each will have their own security practices), but I find very unlikely that a malicious file placed there.

In my opinion, the main risk would be a downgrade attack, Since these CDN usually have many versions of the libraries, an attacker that was unable to load his own code could take advantage of that in order to force it to load a vulnerable version of $LIBRARY instead of the latest one which it used. A 'vulnerable version' in this context could be for instance one that didn't sanitize parameters and allowed injecting specific javascript where only a file injection was possible before. It would require quite a deal of skill to craft such escalation, though (then any script-kiddie could copy it).

Now, if you were tasked with securing your company store(s), I would argue that you should not allow these third parties to load javascript on your site. Not as much for there being a big risk, but because it would be trivial to counter it. Suppose that the site does end up being compromised, with credit card data stolen. I would expect to be asked "You put a nice security measure (CSP) here, why did you exempt these hosts?" and "I thought it would be hard to compromise them" doesn't seem a like specially strong reason.

Perhaps you could find out a formal reason for excepting them, such as them holding X certification or passing certain security audits. This is probably what you will do for excepting the payment processor, ("it is eligible for being exempted as it is PCI-DSS certified"). But while some CDNs will probably pass that bar, here it is much easier to just copy locally the few files you need.

Having a clear policy will also be helpful when someone requests a new exemption (why won't you allow shadyhitcounter.com? You are already allowing GoogleCDN!), and requiring an approval process for adding a new script ("why do you need to load this script deprecated 10 years ago? Here, see this improved version over the sample you copied from the web").

Now, while my answer for that is a straight No if you were securing your shops, I softened it to No (*) given that you seem not to be protecting your own stores, but to be in a middle situation, such as a hosting provider struggling to secure them in a best-effort basis but no control over the content.

Needless to say, it is obviously preferable to have a weak CSP than no Content Security Policy at all. And the fact that untrusted people routinely get admin privileges seems like a security nightmare on its own!

(note that by "untrusted" I do not mean you have to be malicious, it may just mean that you have not proved that you are not a security inept)

I'm not sure how CSP-ready Magento is. In the likely event that you need to allow unsafe-inline, an attacker that could write javascript there will be able to come up with a way to exfiltrate it (even if it requires a bit of user interaction for navigation).

As important as getting a sane-enough policy, it is IMHO that you set a report-uri and actually review them somehow, as they are very likely to provide an early heads-up on any site compromise. Be aware however that there will be false positives, and impossible blocks. I have seen CSP block URLs that are nowhere to be found in the page. I ended up concluding that in some cases they must have been added by browser plugins (maybe malicious, maybe not).

Regarding the difficulty of moving the code locally, please note that -since you are apparently in control of the webserver- it would be quite easy to replace the CDN domains in the html output with the local hostname / your own domain used for cdn resources, with minimal risks.

Finally, let me link you to the I’m harvesting credit card numbers and passwords from your site. Here’s how. article by David Gilbertson. Their objections FAQ are really valuable on how a careful attacker might sneak by.


Risks of giving developers admin rights to their own PCs

At every place I have worked (as a contract developer) developers are given local admin rights on their desktops.

The reasons are:

1) Developers toolsets are often updated very regularly.  Graphics libraries, code helpers, visual studio updates; they end up having updates coming out almost weekly that need to be installed.  Desktop support usually gets very tired of getting 20 tickets every week to go install updated software on all the dev machines so they just give the devs admin rights to do it themselves.

2) Debugging / Testing tools sometimes need admin rights to be able to function.  No admin access means developers can’t do their job of debugging code. Managers don't like that.

3) Developer tend to be more security conscious and so are less likely to run/install dangerous malware. Obviously, it still happens but all in all developers can usually be trusted to have higher level access to be able to do their work.


Exploiting a buffer overflow in ubuntu terminal

echo -en '\x34\x89\x04\x08' | your_program


What is the best way to mitigate malicious bot traffic on a Node Express server?

There are likely many tools and custom scripts out there that accomplish what you are trying to do. However, I think fail2ban is a good example. It ships with profiles "apache-badbots", "apache-noscript", and others that that will follow your logs and temporarily ban anyone who is in violation of the rules, e.g. trying to access .php pages on a NodeJS server. These profiles can be modified to suit your configuration.

That said, this type of activity is very normal on the internet, and there is likely very little risk in leaving it be.


Pentesting - is there a way to check file permissions on linux remotely - KALI

I'm trying to modify a PHP file through a plugin on wordpress. Everything goes well, but I had to modify the permissions to 666 manually via terminal on the victim's machine ...

The plugin has access to check the permissions of the file. Whether or not you as an end user can obtain that information through the plugin is a different matter.

  Is there a way to discover if the file on a remote machine has >=666 permissions, without the manual access to it's console?

Usually this is not the case. While most Wordpress plugins and webapps have access to this information, they will not usually give this information publicly.

Now, you did mention that you have an Admin login. In that case, some plugins may publish this information, or allow you to enable some type of directory listing with permissions. However, looking for a plugin that does this is a more specific question than what you have asked so far.

  I'm using kali, ubuntu, windows, everything.

The OS of the attacker's computer is not really relevant. Any attack that can be made from Ubuntu can also be made from Windows, usually with the same level of difficulty.

The OS of the server sometimes makes a difference, but I don't think that is what you are getting at.

I hope this answers your 'main question'. :-)


Is drag-and-drop safer than using the clipboard when it comes to protecting sensitive data from keyloggers?

Though it's better in the sense that communication is automatically between two windows (and you can hope the object disappears after it's transferred), I'm voting no¹ because:

It uses Automation, its interface is public
It's not thread-safe (so it's global)
Windows in Windows can be hooked

The only protection I saw was at the process level: you can't DnD from a non-elevated process to an elevated one (prevents shatter attacks).

¹ I don't have a Windows system to test on so I'm just referencing things that seem to disprove it.


Is there a point to set up passwords for services like MySQL, Redis etc. if we disable their related ports?

Security is all about defense in depth. Most breaches happen not because someone left a door open, but because a number of small vulnerabilities can stack up to make an unexpected and much larger problem. What if you accidentally make a mistake in your firewall configuration? What if someone gains physical access to your network? There are a lot of "what-ifs" that can happen that can make your assumption - "no one else is on my network" very questionable.

I can't find the article at the minute but I remember reading about some ATM attacks that allowed hackers to withdraw hundreds of thousands of dollars from ATMs in southeast Asia. The attacks started with the attackers hacking into the London offices of the bank, and from there to move laterally through the network and eventually access the ATMs in southeast Asia due to lack internal Network security on the part of the bank. Better security In just one more place might have stopped the whole thing, but the bank assumed that they only had to worry about external security.

The point here should be obvious. If you only have one line of defense you are fine up until that line of defense is breached. With multiple layers of defense you improve the odds that even if there is a sscurity failure in one place your systems may stay secure.

Of course, security is not an absolute concept. Perhaps there is not anything of any real value in your MySQL server. Perhaps you have regular and reliable backups in place so that even if a hacker maliciously drops your data just because they can, you can be back up and running in no time. Maybe this is just a personal project so there is nothing at stake anyway. I don't know what your systems do, and if it is nothing important and you are willing to risk intrusion to make managing your systems easier, then that is certainly a choice e you can make.


Are emulators isolated from the host for malware testing?

Barring any unknown vulnerabilities in the emulator, the general idea is that the emulated system is isolated from the host. This isolation may be reduced if you share filesystems and other resources with the emulated guest.
The level of security may also vary based on the emulator you are using. Interestingly, qemu's docs notes that it shouldn't be relied on in non-virtualization (pure emulation) mode:

Users with non-virtualization use cases must not rely on QEMU to provide guest isolation or any security guarantees.

However, any security promises may only be true for full system emulation. There's also user-space emulation (e.g. qemu-user), which allows you to run programs for another architecture within you current userspace. In this case, the program has the same access as any other program you run on your system.


Is there a way to make linux pass ls require decryption?

First sentence of the pass website:

  Password management should be simple and follow Unix philosophy. With pass, each password lives inside of a gpg encrypted file whose filename is the title of the website or resource that requires the password

In other words, no, encrypting these within pass is not technologically possible. pass depends on the file name to be the account name.

Personally: You could have a 100MB filesystem image that you encrypt with AES, through cryptsetup / LUKS. It will only be readable for as long as you mount that filesystem – as soon as you unmount it, the files contained in that filesystem cease to "exist" at their known position.


If my protonmail password is compromised, does that potentially mean that my whole account is, permanently?

No.

According to the ProtonMail Team, ProtonMail uses perfect forward secrecy:

  We use PFS in our TLS cipher suites for both web access and SMTP, and have since the beginning

This means, that if correctly implemented, it gives assurances that session keys will not be compromised even if the private key of the server is compromised.

It protects past sessions against future compromises of secret keys or passwords.


TL;DR Skip to the last paragraph

Not quite. To encrypt the file, the passphrase and the one-time random salt are combined to encrypt the one-time random key. The salt must then be stored unencrypted along with the encrypted file data. Then, to decrypt the file, the passphrase and the salt (obtained from the encrypted file) are combined again to decrypt the one-time random key which is then used to decrypt the file.

According to an answer to your previous question, the purpose of the salt is to fix the problem that most passphrases will be rubbish (low entropy) and adding salt will help to improve them. This might sound unlikely to really work since the salt is available to an adversary but presumably it must increase the computational task of decrypting the one-time random key (i.e. similar to the situation with password hashing where salt means that there's no possibility of using rainbow tables to speed things up).

An answer to your previous question claimed that adding salt does help and there was a link to more information on the use of salt in cryptography: https://en.wikipedia.org/wiki/Salt_(cryptography) but that page only refers to the use of salt in password hashing, not key encryption. It doesn't sound convincing based on that statement alone. I'm sure that the authors of gpg must have good reasons for adding salt but I don't know what those reasons are (IANAC = I am not a cryptograper). This isn't the same situation as password hashing where the hash is stored and might become available to an adversary.

Having said that, strong passphrases definitely are essential. They are usually the weakest part of cryptography. Even with salted password hashing, a bad, short, well-known password will still be cracked quickly even without rainbow tables (unless bcrypt/scrypt/argon2 is used).

If you don't trust this salt technique (and I'm not suggesting that you should or shouldn't), use a great passphrase. A six-word Diceware passphrase should take the NSA 3,500 years to crack (even if they know it's a Diceware passphrase). Although it's only 77 bits of entropy. To get 128 bits of entropy, you need a ten-word Diceware password. A good place to get Diceware passwords is https://www.rempe.us/diceware/#eff but there are others.

Actually, forget the above. I think whoever told you that symmetric encryption involves a one-time random key was wrong. Having read the links thoughtfully provided by RubberStamp, it seems that the passphrase and the salt are the inputs to the s2k (string2key) key derivation function to create the symmetric key that is then used to encrypt the data. So there is no random key for symmetric encryption. I think whoever said that there was was confusing gpg's asymmetric encryption with its symmetric encryption. With asymmetric encryption, there's a random symmetric key which is encrypted using the public key and decrypted using the private key. With symmetric encryption, there is only the passphrase and the salt. So, yes, the strength is entirely dependant on the strength of the passphrase (see above). The purpose of the salt is not to strengthen the passphrase. It's to ensure that the actual key used to encrypt a file is unique to that file so that, even if you use the same passphrase to encrypt every file, and you are compelled by the authorities (or other threat actors) to hand over the key to an encrypted file, instead of giving them the passphrase which could decrypt all of your files, you can just give them the session key obtained with the --show-session-key option, and then they can use the --override-session-key option to decrypt the one file that they are interested in without automatically having access to all of your other files that may have been encrypted using the same passphrase. This makes much more sense. Actually, it was RubberStamp who said that symmetric encryption uses a random key but I didn't get that impression from reading the section of the RFC that was linked to. And if there was a random key, there would be no compelling need (that I can see) for a salt. The per-file uniqueness of the symmetric encryption key can be achieved either by a random key or by salt. It wouldn't require both.


Asymmetric/Symmetric Encryption of a TPM key hierarchy

Because of the limited size of the possible payload of an RSA encryption, most systems use a hybrid approach. The details are usually hidden from the user: you never see the symmetric session key used in TLS or OpenPGP behind the scenes.

The TPM takes care of the symmetric key that is used to encrypt something using an asymmetric key.

When you ask the TPM to create an "RSA 2048" key, it creates a "RSA-2048 RSAES-PKCS1-v1_5 AES-128-CFB" key, and it uses the AES key in Cipher Feedback mode to encrypt stuff. You can control the details (e.g. use OAEP instead of bad old padding, use AES-256 instead of AES-128), but basically the TPM handles it - don't worry.

Pedantically, the asymmetric key stores the configuration of how to generate the symmetric key, not the symmetric key itself, but that doesn't matter. It is the same way it stores which padding scheme should be used and whether the key should be used for encryption, signing or both.

You can read about it in chapter "22.4 Symmetric Encryption" in "TCG TPM 2.0 Part 1: Architecture" from TCG TPM 2.0 publications, but it's not a fun read.


Attacker able to install screen capturing software in Windows 7 guest account

That something is installed under guest account does not mean it operates under those priveledges, the priveledges of the program are checked on startup by the user, it could still run in the background (i.e. the keylogger).

And even so, if you install it yourself, there is a high chance you installed it as the Administrator, mostly when a program is installed, its installed for all users (if the users are local).

Best course of action is te delete any programs that seem off from your PC using the build-in software removal tool, or something like CCleaner.

Also, make sure after removal, or if you cant find anything off, you scan your system with a good malware scanner like Malwarebytes, or your own preferred AV/AW, after you made sure it's up to date ofcourse.


No. PHP will parse the php file looking for either <?php, <? or <?= (depending on the value of short_tags)

However, outputting <?php to the screen would not execute code. It would need to have been evaluated (eg. saved to a .php file in the server that you then run). This form is probably vulnerable to XSS, though.


Can I serve a self signed SSL certificate for domain B from domain A, then MITM connections to domain B with it after it's been accepted?

If the user adds an explicit connection for a certificate while visiting a site this exception is only added for the combination of this specific target site and this specific certificate. In your specific example it means that the certificate will be accepted only for example.com but not for www.google.com since this exception is only added for the target example.com. It does not matter that the certificate contains a subject alternative name for www.google.com too.

As far as I remember the behavior was actually different long ago where the exception was added for a certificate independent of the site. It was fixed to defend against exactly the scenario you've outlined.


TAP is basically at Ethernet level (layer 2) and acts like a switch where as TUN works at network level (layer 3) and routes packets on the VPN. TAP is bridging whereas TUN is routing.

From the OpenVPN Wiki:

  TAP benefits:

  behaves like a real network adapter (except it is a virtual network    adapter)
  can transport any network protocols (IPv4, IPv6, Netalk, IPX, etc,    etc)
  Works in layer 2, meaning Ethernet frames are passed over the VPN    tunnel
  Can be used in bridges

  TAP drawbacks:

  causes much more broadcast overhead on the VPN tunnel
  adds the overhead of Ethernet headers on all packets transported over    the VPN tunnel
  scales poorly

  TUN benefits:

  A lower traffic overhead, transports only traffic which is destined    for the VPN client
  Transports only layer 3 IP packets

  TUN drawbacks:

  Broadcast traffic is not normally transported
  Can only transport IPv4 (OpenVPN 2.3 adds IPv6)
  Cannot be used in bridges


What should I tell my client if I see that their site is susceptible to SQL injection?

They have experienced attacks, they just don't know it.

You should tell them:

Assume that all data in the site has been compromised.
Tell them what you told us:  The site needs to be re-written.


ROP on MIPS Doesn't Land Where Calculated

Well, after talking to numerous people and playing around with Ghidra and a few top gadget finders. This appears to be a common occurrence and isn't actually surprising. I was able to find the gadget I was looking for through trial and error and calculating where the offset sent me relative to where I wanted to be.


How does the 'QuantumInsert' attack work?

Well the most effective defense would likely be operating under non-standard conditions to complicate the use of known attacks.  For example, if you VMed your browser, then a compromise wouldn't matter unless they could also break out of the VM, but when dealing with an attacker that is directly targeting you and has massive resources, it's probably not safe to assume that they don't have a way to break out of the VM as well, but if you can externally limit what can connect in to your system (through an external firewall) and you can make sure that only the sites you want to go with are allowed to be visited, this would theoretically provide decent protection.

Alternately, if you only loaded HTTPS content, it would prevent insertion of third party content as long as you verify the certificate (and the site you are interacting with has not allowed their private key to be compromised).  Otherwise, it is reasonable to assume that any party capable of controlling a large number of routing nodes on the Internet could potentially modify your traffic if they so desired and inject a man in the middle attack.

Really it comes down to general best practices for untrusted browsing and using typical man in the middle protections.  It isn't really a new threat, just confirmation of a threat we've all known was a possibility for a long time.


Routing is a black box

You generally have no way to tell how your communication is routed through the internet. You never know which routers pass on your communication and who controls them. Routers can be configured to divert certain traffic to go across non-trustworthy servers and the endpoints have really no way to detect this. You might know about the traceroute (UNIX) or tracert (Windows) program which discovers the route between you and another host, but the network traffic generated by this tool looks and behaves a lot different than normal traffic, which makes this tool quite unreliable. Normal traffic might take an entirely different route than what traceroute shows you.

Address spoofing

Each IP packet includes both the IP address it is sent to as well as the address it orginates from. However, there is by default no verification that the source address is really the address of the host which created the message. This allows any host to forge an IP packet with the source IP of any other host and claiming it is routing it from it. This problem is much more serious for UDP/IP than TCP/IP, because TCP/IP requires a SYN/ACK/SYN-ACK handshake to establish a connection, which only works when the source-IP of the packet which makes the connection is correct. However, there is also...

Sequence number guessing

When two hosts have established a connection, each packet they exchange is numbered. When an attacker knows that two hosts are communicating with each other and they can guess the next sequence-number, they can spoof such a packet to inject forged data into the communication.

And another application of address spoofing is:

SYN-Flooding

This is a denial-of-service attack where the attacking host sends lots of SYN-packets (requests to open a connection) to the target host. However, it spoofs the source-IP with random addresses, so the server sends an ACK-packet (acceptance of the connection) to a host which never asked for it. It will then wait for the SYN-ACK packet (acknowledgment of acceptance by the initiator) until timeout. This can bind a large amount of resources on the host and prevent it from accepting legitimate connections. While this does not result in any data exposure or data manipulation, it is still a frequently used method to temporarily prevent users from reaching a certain host.

But what if you actually need to read the response of a host to a spoofed packet? Well, then you have:

ARP spoofing

Strictly speaking, this is not a flaw in TCP/IP but in the related Address Resolution Protocol which binds IP addresses to network interfaces. However, it affects the security of IP communication, because it allows one host to "steal" the IP address of another host so that any future IP packets get redirected. ARP spoofing usually only works in the same network segment. Also, an ARP poisioning attack can be detected and enterprise-grade network equipment is usually able to prevent it.

By the way: Needless to say, using any of the methods described here are illegal in many parts of the world. Nevertheless they are frequently used by criminals and government institutions all around the world.


Do LUKS2 encrypted partitions with Keyfiles use a KDF?

Yes you can use the key file instead of a password: simply specify the file at the time:
cryptsetup luksAddKey /dev/the /your/key/file
When you wish to unlock, cryptsetup open ... --key-file /your/key/file /dev/the (My understanding is that cryptsetup will still use a KDF though, just one that requires no user input.)
If you wish to have a key file and a passphrase, you need to 'unlock' your key file using some tool that demands user input, then make this file available to cryptsetup. (If this is your goal let me know and I'll update this answer later on with some options.)
If you use 10k iterations and 2GB of ram, you'll be waiting a long time for Argon2 to complete. 10 iterations might be more usable (at the time of writing) and still provide good security, as long as your password is 'good', eg: b/pz8prnzx2sv.r2o/y3khykkacqja6ghx9u442o (which, according to KeepassXC, provides "228.40 bits" of input to key derivation functions!)
MASTER KEY As you pointed out in your comment, LUKS stores a hash-digest for the master key in the header. This value MK-digest is PBKDF2-derived from the master-key with MK-salt and MK-iterations as input. The underlying hash function is the algorithm you specify using cryptsetup luksFormat --hash, by default, SHA2/256 on my version of cryptsetup: 2+. The number of iterations is 1000 and I don't believe you can change this, however, this may be incorrect. (See the LUKS1 spec, Figure-4, p10)
KEY-SLOTS Each attempted key-slot derivation becomes the key to decrypt that key-slot's copy of the master key, as described in this answer. It's not clear from the spec whether a key-slot file is also fed into a key-slot's corresponding password-based KDF, however, I believe it is because if you tune an Argon2 slot to take a few seconds, it will take the same time regardless of whether its via --key-file or a typed password.
This answer gives a good overview as well as details about the LUKS header arif '19.
So yes, an attacker can perform an exhaustive search to find an input that produces the MK-digest that is stored in the header. This input will be the master key. You want your adversary to be in the worst-case position of having to search, on average, half the key-space to find a match. (More follows subsequently on exhaustive searches.)
You can provide the master key to cryptsetup at the time of creation with the --master-key-file option. By default, cryptsetup will draw random bytes in accordance with its default setting, or, if you specify a random input file. Read the man page carefully, as you can provide the master key file at time of luksFormat, at open, as well as other circumstances.
You can also open the LUKS volume directly with your master key, however, I personally think the better option is to unlock the key-slot and then somehow destroy the insecure copy of your key-file. (I like modprobe brd and shred.) This leaves the kernel to manage the master key. It also allows you to have two or more separate copies of the master key, in case of hardware failure, but this will double etc. the likelihood that an attacker can find your volume master key.
You also need to think about what file-system the master key file or any key-slot file will be stored on during its use, because this has the potential to hang around in its unencrypted form.
RANT ON KEY SIZES From a security persepective, there's no point producing more than 256 bits of high-quality random input for your aes-xts-plain64 key derivation. The reason why is, that this is an impossible wall to climb when it comes to guessing... but feel free to provide as much as you're comfortable with - there might be other good reasons to produce large input. (It's a lot easier to lose small things!)
Joking aside, in fact you can't even enumerate each possible number in a fraction of this range with present-day technology, (in your lifetime), let alone test them all in an exhaustive search. To put it into perspective, the newer AntMiner s19 can hash 95 T-hash/sec of SHA2/256, so if your security rests on this primitive, then to test say 70 bits of truly random input, it will take this single piece of hardware 2⁷⁰ ÷ (95 × 10¹²), or ~12 million seconds, say, 3k 24-hour periods. Also remember that PBKDF2 has a tunable number of iterations which you'll then need to divide 95 × 10¹² by. (Ps. I'm not suggesting 70 bits is enough, but this is a tractable number for people to understand - remember - each additional bit doubles the previous search space.)
(Incidentally, the same computation shows why a poor choice of password falls swiftly in the face of parallel, offline dictionary attacks. Also of note, the AntMiner s19 operates at roughly 8-times the rate of the s9, ~12 T-hash/sec, for roughly 3-times the power consumption.)
The point is: you want any key to come from a sufficiently large, non-deterministic and equally likely number of possibilities, ie. you want it to be of high entropy.


Android app isolation risks & implementation

This is a very broad question.

First you can start by reading https://source.android.com/devices/tech/security/ to get some feeling.

If you have experience with UNIX, then you will quickly see how the base of security in android works - every application has its own UID by default, which prevents it from doing may things to other applications on a system. This is basically THE application sandbox on Android (compare to desktop where every user application generally runs as the logged in user).

But of course all the inter-process communication still exists:

files readable/writable by other applications
UNIX domain sockets
network sockets (if application has INET permission)
any "classical IPC" (explicitly shared memory, semaphores...)
Binder IPC (Activities, Services, Broadcast Receivers, Content Providers).

For all these it's application's responsibility to not allow arbitrary application to interface with it.

Then there are of course a bunch of side-channel attacks, like the one @lzam mentioned. You can also monitor process times, memory consumption. You might be able to get the activity that's currently displayed, see network connections from application, etc., etc.


How can I see whether the e-mails I exchanged with someone have been encrypted?

Many (but not all) SMTP server report receiving over encrypted channel in Received: header.
You may use it to check encryption over "the last SMTP hop" if your incoming/MX server reports it.

Sample Received: header with encrypted link indicator:

Received: from mail.mpap.mp.br (HELO webmail.mpap.mp.br) ([186.249.223.20])
          (envelope-sender <x@mpap.mp.br>)
          by mx.example.net with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP
          for <x@example.net>; 30 Sep 2017 07:39:42 +0000


How to avoid clickjacking in HTML and Javascript

Hide the whole page:

<style id="antiClickjack">
  body {
    display: none;
  }
</style>

And remove that style element if this window is the lop level window:

<script type="text/javascript">
   if (self === top) {
       var antiClickjack = document.getElementById("antiClickjack");
       antiClickjack.parentNode.removeChild(antiClickjack);
   }
</script>


The Good Practice Guide 13 (gpg13) recommends a number of  controls for baseline protective monitoring and information security measures. Also have a look at the link belows for some network security good practice guidelines.

These should provide a baseline to aim for. They will need to be tailored to your environment and compliance needs.You may want to look at hardening guides for servers and clients as well.

Have a look at these links. They both offer general primers and pointers in how to secure your network and the information flowing over it. Hope this suit your needs better.

Guidelines on general information Security;

10 security best practice guidelines for businesses

An article about network segmentation;

Improving Security via Proper Network Segmentation

  Regulatory Guidance and Best Practices

Standards such as PCI-DSS provide guidance on creating clear separation of data within the network – in the case of PCI, cardholder data should be isolated from the rest of the network, which contains less sensitive information. An example would be to ensure that  Point-of-Sale (PoS) systems and databases are completely separated from areas of the network where third parties have access. In this example a PCI Zone would be created with stringent constraints allowing connectivity for as few servers and applications as possible.

Routes to Achieve Proper Segmentation

Firewall and VLANs provide a route to partition the network into smaller zones, assuming you have defined and are enforcing a ruleset which controls the communication paths. A sound security policy entails segmenting the network into multiple zones with varying security requirements and enforcing a rigorous policy of what is allowed to move from zone to zone. Anything designated in the PCI zone, for example, should be isolated from the rest of the network as much as possible – without impacting the overall business.

Here are a few, but not an exhaustive list of tips to consider:

•   Implement controls at multiple layers within the network architecture. The more layers you can add at each level (e.g. data, application, etc.), the harder it is for a cybercriminal to gain unauthorized access to sensitive information. Of course this has to be manageable from an operations standpoint and it can’t be to the point where business processes come to a grinding halt.

•   Apply the rule of least privileged. For example, a third party vendor may need access to your network, but they most likely don’t need access to certain information. Access should only be provided to the user or system that is absolutely needed and nothing else.

•   Segment information access based on your security requirements. Define your different zones based on where your sensitive information resides. For example, you want to make sure that sensitive information isn’t easily accessible by a third party that has no need for this access. Take a step back when looking at your network architecture and determine if there’s unnecessary access or too restrictive access in different places. You may be surprised by what you see.

•   Leverage a whitelist or hybrid approach. Instead of trying to block all of the bad things out there, which puts you into a never-ending game of cat and mouse, define what you know to be acceptable communication paths and block everything else.

By Nimmy Reichenberg of securityweek.com


Why don't folks seem to use ECC for TLS root certificate signature?

There's a slide deck on NIST by Rick Andrews, Senior Technical Director and Distinguished Engineer of Symantec, titled Symantec’s View of the
Current State of ECDSA on the Web (published 2015) providing great insight:

  What is holding back the market for ECDSA certs?

  Legal/IP concerns were not allayed by the 2003 NSA-Certicom license
  Distrust in Suite B curve choices after Snowden, especially in Europe
  Lack of client support (Windows XP and non-traditional devices like smart TVs
  and Japanese feature phones)
  RSA isn’t broken; risk of trying new algorithm; general lack of awareness
  Lack of dual-stack support in web servers (except Apache – see
  http://httpd.apache.org/docs/2.4/mod/mod_ssl.html#comment_970)
  Clients supporting ECDHE may not have ECDSA root; difficult for servers to know
  ECDSA root may not be EV-enabled
  Client-side performance penalty (ECDSA slower than RSA for signature
  verification for commonly-used key sizes)
  "Heard there was some technical problem with ECDSA" – (if a cryptographically
  secure random integer is not selected, the private key can be determined)

  Impact of New Curves

  Impact will likely be muted if IP issues are not cleared up
  CAs need support in their HSMs and software toolkits
  CAs will most likely sign keys from new curves using existing P256 or P-384 roots, to avoid delay of deploying roots using new
  curves
  Signing with existing RSA roots or intermediates carries IP risk, but
  mitigates root ubiquity issue
  Even though CAs may not initially create intermediate CA certs
  with new curves, we need to perform Proof of Possession of key.
  Usually done by checking signature on CSR, requiring support of
  new key curve in the CA’s HSMs and software toolkits.
  Browser and web server vendors must support new curves


Mechanisms to offer inexpensive https to all second level .wiki domains

I don't think this is going to work. Some of the hostnames under .wiki will be under your control. But a wildcard cert for the TLD would allow you to masquerade as the authoritative server for any .wiki hostname, even ones that you don't provide hosting for.


How could ASP.NET forms authentication session leak into a different site?

The most likely reason is that a machineKey node is set in the web.config for each of the web applications, and the node has the same values for both.   This node contains the key for encrypting and decrypting the authentication cookie, and by default (if the node doesn't exist) the server will create unique keys for each application.  If, however, you specify a machineKey node (which, for instance, if you had a single web application with multiple web serves and you needed an auth cookie to be created or consumed on any arbitrary node) the key that you specify will be used.   This can create a vulnerability if the same values are used on multiple web applications (or made public) because you end up with the situation you describe.  A valid arbitrary authentication cookie from one application can be re-used as a forged authentication token for another application.


I just received a phishing text message, how could this have worked?

To investigate what a booby trapped web server might try to do on your system, you will have to pretend to be one of the leading targeted browser: Internet Explorer.

With wget and curl this attack reverse engineering can be conducted with the use of the argument --user-agent. Here is a typical example:

wget --user-agent "Mozilla/5.0 (compatible, MSIE 11, Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko"

Here is one of the easy reference web where you could get other valid user-agent to test in this attack reverse engineering:

User agent string

As a basic protection rule, I advise you to run these tests in a dedicated user environment which won't risk anything at your system level and at your network level. For this create an ad hoc new user which isn't priviledged and which isn't known on any of your directory servers (LDAP or AD) so as to avoid any lateral attack by creating a large access user on other systems.


have opened HTTPS port but still no response

A TCP port is considered open if a client can connect to it. This means that there 1) need to be a service on this port and destination host and 2) that it the service is reachable from the client. Configuring a packet filter like Watchguard to let packets pass just lets the client reach the service if there would be any but does not create the service itself.


How exploitable is the recent UseRoaming SSH vulnerability?

Like Steve Sether said, this is not a man-in-the-middle attack.

How dangerous is it?

In some cases, buffer overflow attacks are possible.
Your private SSH keys can be leaked to an attacker.

According to the page:

  SSH roaming enables a client, in case an SSH connection breaks
  unexpectedly, to resume it at a later time, provided the server also
  supports it. The OpenSSH server doesn't support roaming, but the OpenSSH client supports it (even though it's not documented) and it's enabled by
  default.

For starters, this feature is enabled by default in OpenSSH. Even worse, it is undocumented in the ssh_config(5) man page.

Note that this is two exploits:

CVE-2016-0777

An information leak (memory disclosure) can be exploited by a rogue
SSH server to trick a client into leaking sensitive data from the
client memory, including for example private keys.

CVE-2016-0778

A buffer overflow (leading to file descriptor leak), can also be
exploited by a rogue SSH server, but due to another bug in the code
is possibly not exploitable, and only under certain conditions (not
the default configuration), when using ProxyCommand, ForwardAgent or
ForwardX11.

Regarding the buffer overflow attack, note that it's only vulnerable under certain conditions, when you have ProxyCommand, and ForwardAgent or ForwardX11 enabled. Those are non-default options, so while it's possible it won't be exploited in a large majority of cases, it is possible.

In the case of a successful buffer overflow attack, assume everything accessible by the SSH client is breached.

More Information

I would read the Qualys Analysis. This paper will explain this attack in great detail far better than most of us, including myself.


What is the logic behind Microsoft recommending that creation of "god group" / Tier -0 in their Red Forest model for AD?

Tier 0 is where the crown jewels are kept.  Specifically, forest and domain administration privileges.  If you isolate those activities and accounts that have that level of access to Tier 0, you can isolate use of DA privileged accounts to that forest.  Thus, an attacker who compromises a Tier 1 (server) or Tier 2 (workstation) can never harvest DA creds from one of those machines and elevate to that level.

It's a way to limit an attacker's ability to move laterally within the network to some degree, but more importantly to limit their ability to elevate to an account that would allow them to own the entire network.

A more comprehensive overview can be found here: Active Directory administrative tier model if you would like more in-depth information.


It seems like it first deleted some visual basic scripts in the directory it was executed in, the scripts had this kind of name: YOUR_USERNAME.vbs

Then it downloaded an executable from this website https://coid.xyz/ which has a name like this: icarian_[x86 OR x64].exe and saved it on you computer as: YOUR_USERNAME.exe

The website had the default Apache landing page, which is unusual for a legit well configured website.

I then runs that executable and places the output in a visual basic script in the format YOUR_USERNAME.vbs and then executes it.

I do not know how dangerous it is, but I would be concerned myself since this is very shady, the website has a certificate issued from lets encrypt but don't know how much that would help.

check the contents of the visual basic script to see what it does, since this just downloads the stuff to your computer and runs it.


Can there be any vulnerability in the code which is rendering images in PHP?

There could be any vulnerability anywhere, but there is no evidence of one here. Here is what happens:

you browser sends a request for a page to a server
the server sends an HTML page containing a reference for an image ()
the browser analyses the HTML page (eventually begins to display it) and sees that it needs to ask for an image at URL original_page_URL/rendering-image.php
the browser sends a new request at that URL, problably saying that it wants an image
the server sends back the data of the image and declares in the HTTP headers the type of the image
the browser expects an image, reads the response, finds the type of the image, gets its data and displays it

The problem when you directly write the URL in your browser, is that browsers often use the extension part to guess the type of the response, and here it wrongly guesses that php should return text. But other things could happen here:

as the browser has no idea of what is rendering-image.php, it could declare that it want text/html data
the server obeys and declare to also send text, but still sends the image data

You should use a tool like wireshark to get the headers of the request and response to know exactly what has happened.


Is there a practical way to identify security vulnerabilities that were published following a full disclosure policy?

One of the methods you can use to create a baseline would be to go to sites like PacketStorm find say the last 50 vulnerabilities/exploits disclosed, then find out whether or not they have CVEs issued on Mitre. A baseline will give you just that, a baseline average. There are a few things to take into considerations:

Not all exploits/vulnerabilities are always disclosed by researchers
or vendors
Not all vulnerabilities/exploits end up having a CVE

In regards to #1, I have CVEs issued to me for vulnerabilities that although the vendor has patched, I didn't see a need to start writing vulnerability disclosures to send to full disclosure, bugtraq, or other similar sites. This is usually for a few reasons 1) I am too busy to be bothered 2) there is no fix and therefore no need to raise the level of attacks (if someone else finds it, so be it) 3) vendors can be 'tough' to deal with. I once reported a vulnerability to a networking equipment manufacturer, and it took them 2 years to fix. This consisted of weeks on end of me giving away free time explaining things, re-testing, and so forth.

As for your other comments: "Same day patch" is non-existent. Any company willing to put forth a patch in one day would be doing so recklessly. Programmers need to ensure legacy applications can still function, and things aren't broken with a patch/update/fix. This is a time consuming process, and any application development house has processes and policies in place that follow rigorous testing/fixes. As for the '45 day' disclosure this is not set in stone:

  Q: Will all vulnerabilities be disclosed within 45 days? A: No. There
  may often be circumstances that will cause us to adjust our
  publication schedule. Threats that are especially serious or for which
  we have evidence of exploitation will likely cause us to shorten our
  release schedule. Threats that require "hard" changes (changes to
  standards, changes to core operating system components) will cause us
  to extend our publication schedule. We may not publish every
  vulnerability that is reported to us. http://www.cert.org/vulnerability-analysis/vul-disclosure.cfm?

Good luck with your research, at best I can see you only getting a baseline. There are too many variables, and the output may be tainted. For example: Microsoft, Cisco, and other big name vendors may be targeted as "stellar" or "unappealing" but what are you comparing them to? myjoomlasoftware.v1, or myhomebackedGitHubProject2.0? Open source, closed source, big vendor, small vendor, petprojects, githhub? These are things to take into consideration, either of which can skew your data immensely.


How to check for vulnerability against WPAD / HTTPS attacks?

https://technet.microsoft.com/en-us/library/cc985352.aspx

  You can use the Group Policy settings to manage the default browser settings on your users' computers. For administrators managing users' computers in an Active Directory® environment, the Administrative Templates in Group Policy provide policy settings for locking most configuration settings in Internet Explorer 8 after deployment.

This page may be out of date, but I imagine the capabilities still exist, and should basically solve the concern for IE and perhaps Chrome browsers in your AD domain.  I believe group policy settings will stick for laptops temporarily unconnected to your domain, but it's been a long time since I had to use group policy.

I haven't found clear information on the current state of Chrome and Firefox, but it appears these browsers default to 'no proxy' which doesn't attempt to grab these pac files.  Unfortunately, this doesn't guarantee that these settings weren't imported from older versions or changed by the user, and I'm not aware of a clean way to check them remotely.

You might be able to bind the standard location of the pac files to localhost using the hosts file, or you might detect these machines on your network using an IDS audit.


Why is home Windows 10 machine listening on port 8080 by default?

I think port 8080 is being used by Java apps, check if you have installed programs like Tomcat or anything else, also run: netstat -ba with administrator account and this will give you :

-b tells netstat to output executable name of the socket owner.

-a tella netstat to list all listening and client sockets.

Is there installed Apache by any chance ?


The only generic approach to preventing SQL injection is to use parameterised queries, also known as prepared statements. These essentially separate out the data from the query language at the protocol level, so the DBMS software will not try to parse any query language from the parameters.

The mechanism you described looks like it's filtering requests with blacklist patterns, which isn't necessarily a bad thing (defense in depth is good!) but seems pretty redundant if queries are being handled properly, and can never replace real solid security practices.


The text you quote basically means: the file is signed with RSA, and the signature is appended "as is" to the file. There is nothing about certificates here; signatures use keys. Certificates are ways to bind public keys to identities. The passage you quote, though atrocious in many ways, is still relatively clear about the certificates: there are none here.

Signatures make sense only relatively to verification:

The signature is produced with, as inputs, the data to sign (the entire file) and the private key.
The verification takes as input the signed data (the entire file, again), the signature, and the public key, and tells you whether the signature is good or not.

As you describe the problem, the database expects input files to be signed with a specific private key, corresponding to the public key that the database will use for the verification. If you do not have that private key at hand, then you will not be able to generate signatures. You need that key if you want to sign a file of your own. Otherwise, that's an absolute no-way.

If you have the private key in some format or another, you will still need to write a little piece of code to compute the signature and append it to the file (this simple "appending" process is not a standard signature format, so you won't get a standalone off-the-shelf tool to do it). This can be done in many programming frameworks, e.g. with Java (using java.security.Signature) or C (with some library like OpenSSL).

Anyway, in cryptography, you can do no decent testing "from the outside". The best you can do is to take an existing signed update file, that the database accepts; then modify the signature (change the value of one of the bytes of the signature, which should be the last 256 bytes of the signed file, from your description), and see that the file with the modified signature is no longer accepted by the database. This would demonstrate that the database "verifies something", not that it does it correctly. Knowing whether a cryptographic system does its job adequately is not done by testing but by auditing the code.


Metaploit: Exploits and its relevant payload

If you check also here you can see that when you are 'inside' the exploit you want to use by hitting 'show payloads' it gives you back the compatible payloads with that exploit.


L2TP/IPSec: Mutual authentication BEFORE user can access VPN

EAP-TLS is just an implementation of SSL/TLS.  Which does not bind any particular client to a machine.  EAP-TLS uses X.509 certificates to authenticate clients to a server.  But certificates aren't tied to a specific machine.  ClientA's certificate isn't bound to IP address 1.1.1.1, it's just what is presented to identify the client.

L2TP/IPSec however does provide both user and machine authentication.  IPSec establishes a secure tunnel by using security policies.  An IPSec security policy is stored in a table and is referenced using a Security Parameters Index (SPI).  Each SPI is bound to an IP address.  If an incoming encrypted packet does not have both the correct SPI and IP address it won't be processed.  L2TP provides the user authentication mechanism.  Once the IPSec tunnel is established an L2TP tunnel is brought up.

L2TP's RFC2661 Section 9.4:

  IPsec also defines access control features that are  required of a compliant IPsec implementation. These features allow filtering of packets based upon network and transport layer characteristics such as IP address, ports, etc. In the L2TP tunneling model, analogous filtering is logically performed at the PPP layer or network layer above L2TP.  These network layer access control features may be handled at the LNS via vendor-specific authorization features based upon the authenticated PPP user, or at the network layer itself by using IPsec transport mode end-to-end between the communicating hosts. The requirements for access control mechanisms are not a part of the L2TP specification and as such are outside the scope of this document.

This implies that IPSec provides network layer access controls as I stated above, but not performed by L2TP.

L2TP provides user authentication in a kind of first cousin twice once removed type of way.  L2TP is a tunneling protocol that runs Point-to-Point Protocol (PPP) through that tunnel.  PPP provides mechanisms for user authentication;  using either Password Authentication Protocol (PAP, which is deprecated) or Challenge Handshake Authentication Protocol (CHAP).


I understand any site can be hacked, any site can be injected with malware that exploits for example “dumb asses” like me. My somewhat naive thought is that; if any of the sites are compromised, I'm going to get noticed, and can take action if that happens. Is this only wishful thinking?

Yes, this is wishful thinking.

For a well crafted exploit, you will likely never notice if it's running on your machine, unless of course, it wanted to be noticed.

Also, for the news sites you frequent, here's an article talking about how one major news site was hacked by chinese hackers. Even Google was the target of an attack of sorts (although, this particular attack would likely not succeed if you were using Google Chrome).

I would suggest either:

Getting a 64 bit OS (I'm not sure how little RAM your machine has, but 4GB is enough to justify and support 64bit)
Moving to a browser that supports 32 bit and is updated. My understanding is that Chromium supports 32 bit still but don't quote me on that.


Is it possible to get All IP's that belongs to given zip code?

The only valid ways to do that are:

Request it from the provider
Buy the list from the black market

If you're asking if you can find this by some type of GGE-like databases: no, they are often quite inaccurate.


eM Client auto-downloads avatars for e-mail senders, including spammers. Can this be used against me?

In short, I doubt it.
I realize that's not a great answer in itself so here's a breakdown of my thought process.

This sort of tactic usually requires a 'unique' resource. For example a tried and true tactic is to embed a link to a 1 pixel image with a unique name/url in a message. If the image gets downloaded later then you know they opened the message.
The key is it's one-to-one.

I haven't used Gravatar before but from what I'm seeing it looks more like a many-to-one relation (many users downloading one image). I don't know what kind of tracking data Gravatar may make available to it's users but I imagine at best (worst?) it would contain the IP addresses of where it was downloaded from. Even assuming the user does have access to that data (which I seriously doubt) I can't think of any way that by itself could be used to correlate a users email.

(Though now that I think about it Gravatar itself might make an interesting vector for confirming email addresses. Generate random email address, attempt to download Gravatar, if successful email address is (more likely to be) legit. But I digress.)

For someone to pull off this sort of thing with a domain icon would probably require a unique domain for each message...doable but not likely.

As for the 'or more', nobody can really answer that without knowing what the 'or more' is. I looked at the site, found the same post you pasted here and I can't seem to find any more detail than that on the 'or more'.

tldr; Probably not but if it bothers you check your settings, maybe there's one to turn off this default behavior. If there isn't you might try reaching out to the devs and suggest the ability to do so.
If you do reach out and they don't seem to be going for the 'security angle' try the 'data angle'. "I don't want it to auto download these images because it's using up my data".
Hope that helps.


Is providing authentication data for other web applications unsecure?

I started to work on a company whose software engineers tried to reinvent everything

Does this mean all things they are not using frameworks, coding standards, policies, procedures?  How do you know this?  What is your position in this?

  They did not use(or know) industry standards and for authentication

What do you mean by this?

protocol (LDAP, SAML, etc)?
framework (PHP:code igniter, NodeJS, etc)?
libraries? (JQuery, etc)
coding guidelines (CamelCase variables, etc)?
philosophy (KISS, etc)?

Are they even interested in security?
Is the data in the application valuable or worth protecting?

  I think there are security vulnerabilities

There may be.

But maturing development processes will get more bang for buck, acceleration in productivity, and as a byproduct catch vulnerabilities and bugs as everyone synchronises into 'doing the same thing' together.

Maturing processes can take time and a roadmap.


Unseen.is encryption claims revisited with their proprietary, patented "xAES" algorithm

From what you describe, what they do is that they tunnel data in some SSL (this is reasonable) but add an extra encryption layer in Javascript (this is not reasonable). The whole reasoning is faulty. Indeed, either the SSL ensures security of transmissions, in which case the extra layer is simply useless; or the SSL does not ensure security of transmission, and then attackers can modify the sent Javascript code, thereby nullifying any security gain that could be hoped to be obtained from that extra encryption.

In practical terms, if the SSL is not enough, then you are already doomed. There are basically two ways in which a SSL connection can be intercepted:

The attacker could plant in the client machine an extra root CA certificate under his control; then he runs a Man-in-the-Middle attack by generating on-the-fly a fake certificate for the server, signed with the attacker-controlled CA. This method is commonly applied in some big organizations, using products such as Blue Coat's ProxySG appliance.
The attacker could plant some software in the client machine that hooks into the SSL libraries used by the client browser, and reads data directly from the source, before it gets encrypted (or after it gets decrypted, for incoming data).

The first method is what nosy but honest sysadmins do; it scales well and is robust against browser upgrades. It is also less discreet than the second method, since the user can always click on the padlock icon, have a look at the apparent server certificate chain, and notice the extra root CA.

Both methods require the same kind of initial access to the client machine, so if an attacker could use one then he could just as well use the other one, and you would be none the wiser. In simpler words: if the SSL is not enough then your machine was compromised and resistance is futile. Whoever could break through the SSL could also, and probably more easily, simply plant a key logger on the machine and don't even bother with the SSL any more.

The "xAES" thing deserves its own section.

First, there is no such thing as a "patented proprietary algorithm". A patent is a publication and that is even its raison d'être. Patents are a deal by which an invention is published, in exchange of a temporary monopoly for its usage. The whole idea was to prevent inventions from being lost because the inventor relied on secrecy, and then died. Whether patents "work" for software is an open (and acrimonious) debate, but the basic property remains: that which is patented is also published, by definition.

Therefore, if the algorithm is really patented, then a patent should exist and they should be able to send you a reference to it (the patent number). But without any reference, one has to assume that the patent may be inexistent, which would imply that they are lying to you (a great way to build trust).

Now let's see some details. AES is an algorithm with a precise definition, built over some elementary components of an algebraic nature. The interactions between these components have been studied at length in the last 15 years, and the overwhelming consensus on the subject is that these things are subtle, and it is not easy to make sure that any given definition ensures the appropriate level of security. Thus, any single change can be highly detrimental to security, and there is no obvious way to detect such an occurrence.

The notion of using a "much complexer & longer polynomial (in step MixColumn)" does not make sense. That step is defined in the AES standard to correspond to a multiplication of a column, taken as a polynomial in GF(256)[X], by a constant polynomial P, modulo a specific degree 4 polynomial M. Since there are four bytes in a column, M can only have degree 4; there is no other choice; and since the operation is done modulo M, then the degree of P cannot exceed 3. Thus, using a "longer polynomial" is meaningless.

(Or, maybe worse, they do multiply with a polynomial P' with a much larger degree, without realising that this is equivalent to multiplying with a polynomial of degree 3 or less when done modulo M.)

The role of the MixColumns transformation in AES is to ensure some avalanche effect. A simplistic view would be that "more avalanche" is better, but that would first require that the standard MixColumns is defective in that respect, which is an unsubstantiated assertion. Moreover, a stronger avalanche effect does not actually correlate with the polynomial seeming "more complex" in the eyes of a human being.

The 8192-bit key size is, of course, highly laughable. 128 bits are already enough and there are strong reasons for that. Key size is not a weakness in symmetric cryptographic algorithms; it used to be a weakness back when Disco was a novelty, because there were some widespread algorithms with really short keys (in particular DES). But things have changed, and symmetric keys were expanded to be safe from brute force attacks, not only from existing hardware, but also from hardware which will be invented in the foreseeable future.

When someone says "I use 8192-bit symmetric keys", what I hear is: "I have no idea what cryptography is, but I really love big numbers".

Last but not least, a common theme in cryptographic research of the last decade is that side-channel attacks are a possible concern, and should be taken care of in the implementation of cryptographic algorithms. There has been a lot of research on that subject, in particular optimized circuit-based descriptions of the AES S-box (e.g. this one) to promote constant-time bitslice implementations. By modifying algorithm elements, they simply forfeit all that research.

Summary: I would recommend avoiding this product, because:

They make claims which are not backed up, or make no sense (e.g. a patented algorithm which is also kept secret).
If they really do what they claim, then they basically destroyed all attempts at external review, which is a problem because all the security in a cryptographic algorithm comes from external review.
The security model does not hold up; or rather, they don't describe any security model where all their extra custom crypto would have any tangible effect on security.
The description of the cryptographic algorithm is full of buzzwords that are usually correlated with an utter lack of cryptographic skills.
In any case, all of this boils down to: you send your precious data to these people, and you have no way to know what they do with it. All the crypto talks are about the security in transit but the real weaknesses are always at the endpoints. In their Web site, they address that concern with a generic "we are based in Iceland". How exactly living on top of active volcanoes or having a thriving fishing industry are supposed to improve data security, is kept untold.


Why should authorization servers document the size of client identifiers?

Some identifiers may be stored in a database or another format which specifies the size of fields.

It would be a pretty common case where a developer wanted to store authorization tokens in their database.  Here's a real world example.

In the case I linked above, the token used to be under 255 characters, which would fit in a VARCHAR(255), but Facebook has been sending access tokens with more than 255 characters.

This may not seem like much of an issue, because a developer could set their varchar to 8000 or whatever their DB max size is, but in some MySql instances, having a UTF-8 VARCHAR over 255 can lead to issues indexing the tables.

There's a lot of nuances that could inform design decisions, if the developers know what they're going to be getting back from a authorization server, and if it changes, it's better to have that documented somewhere, rather than just have it fail one day and have no idea what happened.


Do the most used browsers have similar security?

I know of two examples of differences in browser security:

The SameSite cookie flag is a countermeasure against CSRF. Currently Chrome and Opera are the only browsers that support it.

For an extreme example, there is Chromodo, a customized version of Chrome that disables some important security features.

So it definitely matters which browser you are using, but it may not be possible to objectively say one browser is "more secure" than another.


can you have reflective xss through a POST parameter?

The HTTP method does not matter for Cross Site Scripting attacks (XSS). It is even possible to get XSS trough the HTTP TRACE method.

  Is it possible to have reflective XSS through POST requests?

Most definitely!


No.

The whole point to encryption is to produce a cipher-text that is indistinguishable from random noise.

Absent any outside hints, the ONLY way to determine what encryption mechanism is used is to run the decryption routine with the correct password and check the result to see if it looks correct.

On a related note, likewise the only way to determine whether you're using the correct password is to run the decryption routine with the correct cipher and check the result.


Should entire domains always be blacklisted?

are there reasons for blacklisting some subdomains of a domain but not
  the whole domain?

Yes. For example, a free domain hosting service such as http://000webhost.com would offer their users a domain address such as PICKYOURSUBDOMAIN.abc.com. Here the user using the free web hosting service could pick their own name for the subdomain and multiple users are sharing abc.com.

Malicious user M can now host, let's say, a phishing page on malicious.abc.com and you would need to blacklist it. However, another user might be hosting a perfectly legit website at legit.abc.com on the same domain. Hence, it is more effective to block malicious.abc.com than abc.com.


Things that you should do:

Update the firmware
Use a strong password and WPA2 for wireless connections.  Don't use WEP.
Change the SSID of the router to something non-standard.  This is because the SSID is used as a salt for the wireless password, and having a non-standard SSID protects against an attacker using rainbow tables generated for standard SSIDs.
Disable WPS - it is inherently insecure.
Disable remote administration.  This includes access from any mobile apps - do you really need to remotely change settings on your router from an app?
Use a strong password for the router admin webpage, and if possible change the admin username.  I use a long random password saved in a password manager.
Remember to log out of the admin webpage when finished.
If possible, enable HTTPS for admin webpage connections.
Disable uPnP.  Review any other services that your router may be running (FTP, SMB, telnet, ssh) and disable if necessary.
Be very careful about opening up ports for incoming connections.

Things that you may consider:

Set up a guest network for visitors to keep them segregated from your main network.  If your visitors can only access the internet and not any other machines on your network this should prevent them from infecting any of your devices with malware.  This also means that you don't have to share your main WPA2 key.
Use a non-standard network range (i.e. not 192.168.0.x or 192.168.1.x).  This may help against a scripted attack that uses a default network range and it will help in future if you ever need to set up VPN connections.
Turn on logging and review the logs.

Things that are a probably waste of time:

Hiding the SSID.  This is security by obscurity, and finding a hidden SSID is an easy task
Use MAC filtering.  A determined attacker can easily spoof a MAC address.


Is there any way to discover why Windows Smartscreen is flagging your download?

The best starting point would be to investigate its logs and see if it gets you anywhere. By default, SmartScreen does not log events as per Microsoft's documentation:

  Logging: By default, SmartScreen Filter does not log events. However, if you use the Application Compatibility Toolkit to enable logging for application compatibility events, SmartScreen Filter logs an event when a warning is shown for a website.

Here is the link to Microsoft Application Compatibility Toolkit 5.0


Risks of Mullions in High Security Areas

It depends on the construction of the mullion. Some are bolted on, some frames come as a solid piece including the mullion, and some mullions are a cosmetic fascia. If it is bolted on as long as the bolts are good quality and bolt into a metal frame then it's as good as a one-piece metal frame for most purposes, it's when it's a cosmetic piece that you have a problem.

Some mullions are simply a piece of 2x4 covered in drywall and plaster. These won't keep out anyone with a crowbar for very long.


What is a good XSS vector without forward slashes and spaces?

No space, no slash:
<svg•onload=alert(1)>

The • above should be a form feed character (0x0c), but SE does not allow it in posts. See how it runs here.


Does TRESOR protect against attacks like HeartBleed

No. TRESOR only provides a method of storing AES encryption keys in the CPU. It will not prevent an attacker from stealing certificates, user information, password, or whatever else may present in the server's RAM


Native app, token authentication without login/password

What is your threat model?

If every connection is sent over SSL, you do not need to worry about anyone sniffing your communications.  This is actually the strongest part of your system.  Good job choosing something standard.

Because SSL is ensuring nobody is listening in on your communications, we should look at the endpoints.  Your UUID is basically a shared secret.  Anybody with this UUID will be able to imitate your users.

As for cypting it or hashing it, no.  Do not bother.  If they have access to your encrypted UUID, they certainly have access to the source code for your game, which would have to contain the password.  Anything which could prevent an attacker from authenticating also would prevent a customer from authenticating.

You need to develop a threat model.  What would an attacker do if they got their hands on a UUID?  If all they can do is in game purchases for that account, then there is very little they can gain from having a UUID.  They could try to piss off a customer by stealing the UUID and using it to buy a whole lot of stuff the customer didn't want, but if you are able to refund that, then they can't piss off a customer much either.

On the other hand, if UUIDs can be used to purchase things that are useful for others, then you have more incentive for attackers to steal them.  If they could be useful to the mafia, then you have an even bigger threat, because they might throw one of their botnets at your system.

All security is based off of a threat model.  Nothing is perfectly secure.  As Kevin Mitnick once said, "The only completely secure computer is one which is disconnected from the internet, turned off, encased in concrete at the bottom of a silo guarded by armed guards.  Even then, I'd check on it once in a while."


Is it safer to run executable file (not safe, may contain virus) on VBox

The anti-virus program will only quarantine files that are on the host machine, as the anti-virus program has no access to the virtual-drive, hence the name virtual drive.

However, since in order for virtual box to let its virtual machines access the internet it must pass web requests into the host machine.  To windows it will look like as if Virutal box is asking to connect to that specific Public Ip address.  This is the only thing that is within the scope of ESET.  If the web address or the Public Ip being requested is on the Public Blacklist, then it will block it.  Anything happening in the VM is contained in the VM as long as CPU microcode security patches are installed.

Windows 7 also comes with Windows Firewall/Antivirus by default.


Is it safe to open virus infected EXE with Telerik JustDecompile?

That depends on how advanced the malware is. Most likely it will be safe, although it may be highly obfuscated and difficult to understand in a decompiler. There is a small chance that it is intentionally designed to execute correctly on real hardware, but exploit a bug to escape sandboxes or gain extra privileges on a decompiler. If you are simply asking if a decompiler needs to execute a program in order to decompile it, no it does not. It is, in theory, completely safe.


How to Insert data into a table with sqlmap using its sql-query command

Most databases do not allow you to just insert data using SQL Injection (Unless of course you are already in an insert query and even then you usually can't control the table name).  You can't simply stack queries,  that is only allowed in Microsoft SQL Server, PostgreSQL and comic books.  You can use a sub-select or union select to access data from another table, and SQLMap is doing this behind the scenes.

SQLMap's real strength is in data exfiltration.  If you want something more complex,  like a multi-staged attack that gives you a shell,  then you need to write an exploit.  Take off the training wheels and be man (or woman).


Anomaly-based Malware Detection in Web Applications

I'm currently doing some research in the area of network security, where my topic is anomaly detection for log messages. However, I hope that I will be able to provide some insights for your problem.

(1) Signatures are ugly, but they do work. Although everybody is talking about anomaly detection and similar topics, nowadays signatures remain the most reliable way to detect malicious code/activity/etc. So you should continue using them and do not hope, that some anomaly detection will be able to fully replace it.

(2) The signatures are, of course, very limited and they cannot identify novel type of malicious code/attacks/etc. Then there are attempts to solve this problem with anomaly detection. The main disadvantage of anomaly detection is that it always produces false positive alerts that you should process and filter out. The current trend is to build a hybrid systems: first apply signatures and maybe some queries, and then perform anomaly detection in addition to it.

(3) It should definitely be possible to create an anomaly detection approach for your problem based on some machine learning techniques (based on your list of conditions; theoretically, it can be also possible to analyse PHP code i.e. perform static code anomaly detection, but this could be rather complicated/big project). However, I won't expect that it will catch all malicious code. The realistic number could be something like 70-80% detection rate with 10-20% false positive rate. So if you check 1000 files and 10 of them are malicious, probably in the best case you will be able to develop a system that will return you 100 alerts, where 8 of 10 malicious files will be detected, but the rest (let's say 92 other alerts) will be false positive. Also, probably 6-7 of these 8 you can have already detected with signatures and queries.

I hope that I'm not too pessimistic here. Sometimes, for specific use cases, it is possible to achieve 98-99% true positive rate with 1-2% false positive rate, but I'm not sure if you will have so much luck in your case. Also I do not know enough details about your use case to make any predictions.

(4) However, if you will be able to rank your results, then the top of the anomaly detection output will contain more true positive and less false positive alerts. For example, if your system will return 100 ranked alerts, you can only look on top 30 of them. And these 30 will contain 6 true positive results and only 24 false positive (which is to some extend better than 8 true positive and 92 false positive). Next, if you look at 5 most highly ranked alerts, they will probably contain 1-2 true positive and 3-4 false positive. And this is what you can check on the daily basis in addition to your signature-based detection results.

You can hire a data mining/machine learning expert to build such a system for you, or try to do it yourself, if you have enough skills.

I have not found too much relevant research papers (which is not a good sign), but I hope that the following can be relatively useful for you:

Learning to Detect Malicious Executables in the Wild. However, this should be a misuse detection, not an anomaly detection.
A static heuristic approach to detecting malware targets

Finally, there should be some alternative solutions to this problem. I have googled for it and here is what I have found so far:

PHP malware finder

Also not too much (just one link), but I hope you can try to search more, there should be some techniques like sandboxing. Maybe you can check this pdf for relevant info.


Does forwarding email result in an extra "persistence" of it's copy?

In some cases, yes.

Client

It depends on the MUA/client, but forwarding a message will cause a copy to be stored in that person's sent items.  That counts as a copy, as does the copy in the inbox.

Outlook/Exchange can store these copies either on a local PST, on the Server, or both in the form of an OST

Server

Every MTA (server that touches the message) can store the message, and copy it into a monitoring / compliance queue, and still send the message on to the next destination.

This may be required to maintain compliance with certain federally mandated record retention laws.

Bottom line, if you forward a message, and it's routed to a network, the quantity of servers it touches increases.  Any server can be configured to transparently archive a message.