How to check if a server is not vulnerable to Logjam? In response to Logjam I want to prove I've hardened my services.
I know that the DH param has to be 2048 bits at least and self generated. But I am unable to find a way to actually check this for something other than an HTTPS site.
(thats I can do here)
I would like to check my other SSL protected services for this as well:

Mail (Postfix and Dovecot)
SSH
VPN
Any other

I got as far as openssl s_client -starttls smtp -crlf -connect localhost:25 But that yielded:

CONNECTED(00000003) depth=3 C = SE, O = ME, OU = Also ME, CN = Me again verify error:num=19:self signed certificate in certificate chain

verify return:0 Server certificate

-SNIPED SOME VALUES-

--- SSL handshake has read 6118 bytes and written 466 bytes

--- New, TLSv1/SSLv3, Cipher is ECDHE-RSA-AES256-GCM-SHA384 Server public key is 2048 bit Secure Renegotiation IS supported Compression:

NONE Expansion: NONE SSL-Session:
    Protocol  : TLSv1.2
    Cipher    : ECDHE-RSA-AES256-GCM-SHA384
    Session-ID: 6EAA8A5B22E8C18E9D0E78A0B08447C8449E9B9543601BC53F57CB2059597754
    Session-ID-ctx:
    Master-Key: <MASTERKEY>
    Key-Arg   : None
    PSK identity: None
    PSK identity hint: None
    SRP username: None
    Start Time: 1432213909
    Timeout   : 300 (sec)
    Verify return code: 19 (self signed certificate in certificate chain)
--- 250 DSN

How can I test the DH parameters? and what should I watch for to know if I'm at risk?

Do the smoke test: (stolen from OpenSSL blog. (Archived here.))

openssl s_client -connect www.example.com:443 -cipher "EDH" | grep "Server Temp Key"

  The key should be at least 2048 bits to offer a comfortable security margin comparable to RSA-2048. Connections with keys shorter than 1024 bits may already be in trouble today. (Note: you need OpenSSL 1.0.2. Earlier versions of the client do not display this information.)

(If the connections fails straight away, then the server does not support ephemeral Diffie-Hellman ("EDH" in OpenSSL-speak, "DHE" elsewhere) at all and you're safe from Logjam.)

[...]

  Finally, verify that export ciphers are disabled:

$ openssl s_client -connect www.example.com:443 -cipher "EXP"

  The connection should fail.

In other words:

get OpenSSL 1.0.2.
add the -cipher "EDH" option to your connect string.
assume vulnerability if export ciphers are enabled on the server
assume vulnerability if 512 bit (or anything less than 2048 bit) turns up.


How can we get into the user's mindset? As security folk, we tend to over- or under-estimate the capabilities and educatedness of our users, especially in terms of resistance to social engineering attacks.

Stereotypically, this is due to us all being basement-dwelling social rejects, but more often it's a case of us not interfacing with our users very often. This can be a problem, especially with social engineering attacks, because we might miss critical problems or direct our attention and resources into the wrong thing. We might think of users as people to train, but often the reality is that we need to train ourselves instead.

How can we better understand our users, in terms of security awareness?

Are there cost-effective ways of interviewing users within a business environment?
Any particular questions we should ask them?
Any other tips to improve our understanding?

I think you have hit the nail on the head when you say, "...not interfacing with our users very often"

You absolutely must work with the end users to understand their view - most end users have no interest in understanding what 0-day even means, let alone why they should care.

A lot of what I do is that interface between technical security teams and non-technical clients, and the best approach, in my opinion, is to sit down with the user and understand what their job demands of them. What are the easy and difficult aspects?

As an example, do they have old laptops which take ages to boot? If so, you will find they will not want to do a full shutdown every night but instead may just hibernate their machines. Which will obviously break the protection offered by full disk encryption. So your essential security feature is wiped out despite everyone knowing it is valuable. The solution then requires liaison with more senior levels to articulate the problem, possibly referring to data protection legislation, and then with IT.

Do you understand the drivers for your users? If you don't talk to them, you won't - and by talk I really don't mean evangelising about security. I mean listen to them, listen to their rants about IT not working, listen to what they think they need to do as part of their day job, then go away and analyse what impact their drivers and aspirations have on your security aims.

Because at the end of the day in many organisations security is seen as a blocker, something that just stops people being able to work; and then when the organisation is hacked it is the security team's fault for not making them secure.

Awareness at grass roots level first - then build your security strategy to support the IT strategy and business strategy. Support at user level will make it much simpler to have security built in to improvement projects and BAU.


Are there any meta-formats for crypto? Are there are any (properly specified) meta-formats / schema formats for describing cryptographic message structures?

I'm looking for a way to describe the format (where some channels might want symmetric/asymmetric encoding or signatures) that's not just "This uses scheme #5 - see the docs for more".

Having it computer-readable would let me do some fun tinkering - things like programmatically deducing what information has to be pre-shared for the scheme to work, deducing which parts of the message have integrity, producing a report of the scheme's properties (including errors due to insufficient padding etc.) - but it also just feels neater to me to have a language to express things in.

As illustrative (not actual syntax!) examples, something like:

random-iv[128] + CTR[AES](shared-secret[256], iv, message) - IV, followed by AES-256-CTR encoded message (shared secret unspecified)
message + your-key[2048].public + RSA[DECODE](your-key[2048], random-padding[256] + SHA256(message)) - message followed by public key and RSA signature of SHA-256 hash
HMAC[SHA256]({0x123456...}, message) + message - HMAC first (secret as literal), concatenated with message
RSA[ENCODE]({0x...my-key-literal}, random-iv[128] + random-key[256]) + CTR[AES](random-key[256], random-iv[128], message) - specify my encryption key, and use AES-256 for message with random key

If there weren't any hard-coded values (e.g. the HMAC secret wasn't a literal), then it would describe the generic scheme.

With hard-coded values you could describe the data expected on a particular channel, and even verify that it's a subset of the generic scheme.

This is slightly analogous to things like ASN.1 for structured data (which lets you describe the internal structure of a binary stream, and even the bitwise layout when combined with something like PER), but possibly more like an equation/functional-expression, with cryptographic primitives and unknowns etc..

It seems like it should be possible, but I couldn't find anything.  Are there existing meta-formats for this for crypto?

It's not exactly what you requested but at least these two are worth a look in my opinion.

There's a general and abstract notation for describing security protocols, which is being used to describe quite complicated stuff such as Kerberos. The Needham-Schröder protocol can also be expressed this way. Again, not really what you were looking for, but made me think of it.
On a more fundamental level, I suggest you take a look at the Cryptol language which attempts to make implementation of crypto closer to what one would see in a textbook. However, the point of Cryptol is more in decribing functions than messages.

Anyway, first post here after years of lurking and feeding on others. Hope this helps a bit.


Is RSA usage in combination with Java Socket secure? I want to create a java program for server client communication. Therefore first the client creates a RSA keypair. Then the client sends the public key to the server.
After that the server will create a RSA keypair and also send its public key to the client.
Is it safe to say that now (after key exchange) it is safe to send all kind of data between server and client?

Or is it smart to create a SSLSocket? I honestly have no idea how the authentication with the certificats work and I also do not want to have a certificate which needs an update every now and then.

... it is safe to send all kind of data between server and client?

No. You just blindly assumed that you've send your key to the right server and that you get a key from the right server back. But it could have been actually some man in the middle, you simply don't know.

  Or is it smart to create a SSLSocket?

Much better. This is using an established standard where lots of experts had a closer look at. Don't run your own crypto.

  I honestly have no idea how the authentication with the certificats work ...

So you think you are better at designing something yourself when you don't even have an idea how established secure communication methods work and why specific security related design decisions were made? Unlikely that this will actually result in something secure.

  ... and I also do not want to have a certificate which needs an update every now and then.

TLS is not actually tied to certificates but it scales much better with publicly issued certificates since it can derive trust relationships from this instead of just blindly hoping that no attacker is there when exchanging the key as you do.

For comparison just rephrase your question in the context of health: would you recommend to design your own medicine with practically no understanding of how this stuff works or would it be better to rely on established methods even if they require that you visit the doctor from time to time?


why not use hashed password as password Why dont we use our mobile phone tho hash a password and then enter the hash on a website as the password ?

This way the password for the website would be much more complex.

Would this even increase security ?

Example

Mobile phone: p4ssword --hashing--> 527fcfb9b03f2813eadd840a2ae0fb56
Website: Enter '527fcfb9b03f2813eadd840a2ae0fb56' as password.

I guess it depends on what the server does, but it doesn't add much protection either way (or is even worse). (Also, does the average user know how to compute a hash on mobile? Sounds quite a hassle to me.)
1. Server stores hashed password
This means client sends H = hash(password) to the server, server looks up clients hashed password H' in the DB and validates client by checking H == H'. This is really bad. Now if a DB breach happens the attacker can enter the hashed password that was stored in the DB to login. It essentially removes the point of hashing in the first place and is as if the plaintext password was stored.
2. Server stores hash of hashed password
This means client sends H = hash(password) to the server, server looks up hash of clients hashed password H' in the DB and validates client by checking H' == hash(H). Now if a DB breach happens the attacker must check if hash(hash(guess)) == recovered_hash, so the cost to the attacker is about 2x what it would be with no client-side hashing (i.e. the attacker can check passwords 50% slower which isn't much of a win). The security in this case still depends on hash being a (non-invertible) function resistant to dictionary attacks, client side hashing does little to help.
Summing up, the best thing to do is have the client enter the password in plaintext, transmit the password to the server over HTTPS, and hash the password on the server with something like bcrypt or scrypt, storing only the hash on the server. The reason your construction isn't an improvement is that the "seed" if you will does not gain any entropy and is just as easy (or not easy) to guess, you are just adding an intermediate stage.


What security risks are associated with DLP Systems? Some high level risks with DLP that I can identify (with the monitoring componant):

1- Abuse of authority: people with access to the system can look into other users private data.

2- Loss of service availability: Specially within large organizations where DLP is unable to keep up with network traffic demands.

3- loss of user data confidentiality: If all traffic is monitored, user information like Bank account and health records can be intercepted and confidentiality of users compromised.

Anything else you can think of?

The most predominant issues with DLP I currently see are in regards to what it can actually retrieve. Often this already omits encrypted connections such as HTTPS (unless SSL certificates are used to implement a MiTM).

Furthermore there are some legal issues in most European countries regarding privacy and proportionality of collecting data which is one of the biggest reasons DLPs are not really selling over there.

There are some strict guidelines regarding data retrieval and processing in the EU:

Notice—data subjects should be given notice when their data is being
collected;
Purpose—data should only be used for the purpose stated and not for
any other purposes;
Consent—data should not be disclosed without the data subject’s
consent;
Security—collected data should be kept secure from any potential
abuses;
Disclosure—data subjects should be informed as to who is collecting
their data;
Access—data subjects should be allowed to access their data and make
corrections to any inaccurate data; and
Accountability—data subjects should have a method available to them
to hold data collectors accountable for following the above
principles.

In comparison to the US for instance, if a European employee has a folder on his computer titled "personal", even on a company machine, the data within this folder may not be accessed. The definition of personal has also been kept quite broad allowing for wide interpretation. And personal data is not allowed to be processed unless certain conditions are met:

Transparency (subjects should always be notified what data is being processed)
Legitimate purpose
Proportionality (When sensitive personal data (can be: religious beliefs, political opinions, health, sexual orientation, race, membership of past organisations) are being processed, extra restrictions apply.)
The data itself can also not be sent to other countries outside of
the European Union, unless certain conditions are met

Violating (even accidentally ) any of the above rules will make you legally liable and can cause a lot of hurt to your company. So a machine collecting almost everything which passes over your network (and which decrypts SSL streams) is a real risk if something goes wrong with the data it collected or if someone decides to take a peak in it, as your company will be held responsible for it.


What is the safest way to use Bitlocker with TPM? I started using bitlocker yesterday and I have a TPM2.0 in my laptop. I enabled the option to enter a pin when starting and I enabled the option to use AES256 before encrypting. I don't really understand how it is safe to have the TPM unlock the drive automatically when starting. It has to start the OS so it has to decrypt it before starting windows right? If this is done automatically an attacker can just come to my laptop and start it and my data isn't encrypted, this seems very unsafe so I'm probably just understanding it wrong. Which is the safest way to use Bitlocker?

If this is done automatically an attacker can just come to my laptop and start it and my data isn't encrypted

This is the procedure. It isn't secure. For the average person, BitLocker and TPM is more secure than not using full-disk encryption. TPM is a secure microcontroller with cryptographic capabilities designed to provide basic security-related functions involving encryption keys. now the specifics BitLocker seals the master encryption key in the TPM and only allows the key to be released when code measurements have not changed from a previous secure boot. - Trusted Platform Module (TPM) and BitLocker Support

This is done with support from secure boot. Hence, directly booting and circumventing the normal boot procedure is not allowed. However, if you can find a vulnerability within Windows, you can circumvent this, as you do not physically need the decryption master key. E.g. Windows will boot to the lock screen, if you can identify a vulnerability here (when the drive is decrypted) you have access. Windows ’sticky keys’ exploit exploited a vulnerability where startup recovery would print the diagnostics within Notepad.exe with elevated administrator privileges. Notepad could open Windows Explorer and rename a program which would run at the login screen, sticky keys are one example. Renaming cmd.exe to sethc.exe allowed cmd.exe to be run with elevated administrator privileges at the login screen.

  Which is the safest way to use Bitlocker

Use a strong password on BitLocker or setup a USB key. The USB key, will be a USB flash drive, just like TPM. Except you will control the storage mechanism, also you can easily remove the drive. However, both the options I said here can introduce other problems. This is very subjective depending upon your OpSec requirements. Bitlocker: USB Key vs Password?


How insecure are PHP's rand functions? There are some pseudo-random-number generators in PHP: rand(), srand(), mt_rand(), mt_srand(). You can look at their code here.

I understand those functions are insecure, but how insecure are they?

For example, if those functions are used for generation of anti-CSRF tokens, tokens in file download links how easy will it be for attacker to guess those of other user? How he can do it?

Update: The paper I Forgot Your Password: Randomness Attacks Against PHP
Applications seems to be a canonical reading on the subject and contains detailed response to this question. However, it's quiet long and complicated so I'd want to see a more short excerpt that will point or show existence of exploit algorithm using which those functions can be broken.

PHP's rand() generator is a based on the system implementation, which is usually a weak LCG or LFSR (see Andrey's comment below). For more info on why these types of generators are bad, take a look at How insecure are non-cryptographic random number generators?

The mt_rand() function uses Mersenne Twister, which isn't much better. You can determine the internal state and all future values after observing just 624 values.

Don't use either in any situation where you require cryptographic-strength randomness, including CSRF / password-equivilent tokens. A better alternative is the openssl_random_pseudo_bytes function, or reading from /dev/urandom. You could also look into implementing Blum Blum Shub, which is a strong (albeit slow) PRNG.

EDIT (Feb 2017): As of PHP7 the correct method to generate secure random bytes is the random_bytes() function. For more detailed advice about secure RNGs in a variety of languages, take a look at this article.


Is it possibel to inject php code to roundcube errors log file via LFI vulnerability? i tried to inject php code to roundcube errors log file, with no success. i think there is something filtering injected php code.

The short answer is: no. Stored code injection and LFI vulnerabilities are 2 different kinds of vulnerabilities.


How to protect your anti virus program or logging agent? its a very simple question but might not be too trivial. Imagine an attacker has access to your device and gained SYSTEM privilege. Your company has installed a logging agent on your device to capture all these malicious activities, is there any ways to prevent an attacker from stopping the logging agent and send "Green" traffic back to the logging server?

One way that I can think of is using something similar to cred guard in windows 10, you have a hypervisor and running the agent in a separate "god" mode memory region. So the agent can oversee all the malicious activities and attacker wouldn't be able to modify it. (This requires hypervisor mode to be enabled.)

Sandboxing might help here, but let's just assume the attacker gained OS level privilege.

Will using an external electronic device help here? (Touchbar in mac)

If the attacker is logging from a bot or an automated remote tool: Possibly - by discovering that node and having an ISP trace the connections on it (White Hat) or by sniffing it and establishing a connection and locking out the controls. (Kind of difficult to do if it's on an active system being human monitored without locking out the attacker from their own system and even then they would pull the plug.)


What is the point of gibberish spam I fairly often happen across forums spammed with messages such as:

  Arugula (Eruca sativa) is an quarterly green, pretended or roquette.
  It's been Traditional times, overclever 20 flat has be useful to
  "foodie" movement.Before impediment 1990s, thrill was norm harvested
  foreign wild. Colour has naturalized reactionary world, on top of
  everything elseloftier Europe addition North America. Arugula is all
  round Mediterranean region, wean away from Morocco and Portugal,
  eastern Lebanon plus Turkey. Roughly India, adult seeds are
  songeffortless Gargeer. Solvent is scour (Brassicaceae) family, rod is
  quite a distance rocket, which is public ...

What is the purpose behind such spam?  It's annoying, yes, but one assumes that the spammer has some purpose other than to simply annoy to go to the effort of doing this.  I don't see any URLs or hot links in the message, and no apparent "funny" formatting that might exploit something.

Is this somehow trying to influence web crawlers?  (And, if so, to what purpose?)  Does it somehow exploit some sort of weakness in the forum software?  What?

Added:  Not really related to the original question -- more of a tangential comment, but I thought it would be worthwhile to keep it in the same place, in case someone else comes looking:

The nature of the "strange" posts on the forum I'm mainly thinking about (http://forums.finehomebuilding.com/) has largely changed.  What we get now (once/twice a week) are posts that parrot details from previous posts in the thread (often a very old thread), or perhaps details gained from a web search on the thread's topic, but they are generally pointless (at best a "me too" nature) and the English, while technically proper, is a hair stilted and clearly not that of an English speaker (neither British, American, Indian, nor African, all of whose dialects I'm at least passingly familiar with).

My best guess is that these are people, probably in China, who are learning English and are using the forum as a sort of test, to see if their post goes undetected.  I don't know, however, if this is simply a game, a test for an English class, or a test/practice for a wannabe spammer.  (It's unlikely that they're trying to "curry favor" with the spam filter, as the thing ("Mollom") is notoriously flaky and happily lets spam through on the first try while rejecting legitimate posts.)

But wait -- there's more!!

For about the past year the forum of which I speak has been regularly (at least weekly, and sometimes several times a day -- twice so far this morning) bombarded with posts such as:

  Kitchen Units For Sale. Thirty Ex Display Kitchens To Clear.
  www. e x d i s p l a y k i t c h e n s 1 .co.uk £ 595 Each with appliances.

(URL slightly corrupted so as to not encourage these folks.)

Apparently this is a major spammer operating out of Europe (and our forum is about 99% US-oriented), so it's pointless at best.  The oddest thing is that the constant spamming has apparently "poisoned" the URL for Google (and likely other search engines) such that you have to pretty much spell out the URL to get a "hit".

(The other odd thing, of course, is that the system operators seem incapable of blocking this, even though the URL is always the same.)

Another question --

Since, as I observed earlier, the "kitchen spam" posts (seen on dozens of other BBs as well) have apparently "poisoned" the associated web site for Google, is it possible that the spam is actually intending to do this, and is instigated by someone (a competitor?) who wishes ill for that web site?

They are trying to do Bayesian poisoning.

By sending lots of correct words and a few words which are used in spam, like viagra, those words get a lower spam notification (over time).

This means that after a while they can get real spam with links through to the filter.


What is the disadvantage of using spoofing protected version of ARP protocol I read this article about man-in-the-middle arp poisoning  and how it works , it seems that arp poisoning programs exploits the fact that ARP protocols trusts any packet  to be true and modify its table based on it .
Question is : why the ARP modified versions hasn't been used on large scale yet ? (or has it ?) i saw many papers at IEEE describing what they called "enhanced versions " of ARP (couldn't read it cause it needs log in ) that suppose to be immune to "man-in the-middle-attacks" and arp poisoning in general .  are there disadvantage for any of the mechanisms used to verify arp replay packets ?  in other words is the simplicity of ARP essential that cant be changed?

Question is : why the ARP modified versions hasn't been used on large scale yet ?

What is the cost of addressing this versus the risk?  ARP is a local subnet issue. If someone is already successfully on your LAN you probably have a much bigger problem because they can still do attacks at higher layers of the communications stack. Is this where you want to spend your dollars versus other problems?

Port level authentication such as 802.1x, TLS, VPNs, and other protocols may provide adequate protection in the view of a risk assessment or you may be implementing protections at the switch/bridge. There is also likely the cost and complexity of management versus the return on investment. Then again, there may also be a marketing issues where no one has commercialized and convinced the people with the check book to spend on this, especially when things like DLP and SIEM are just so much sexier, costly, and fun.


Encryption and Hash algorithms explanation I am using Veracrypt and there are encryption and hash algorithms

Can anyone explain simply what do each algorithm does?

Encryption algorithms encrypt your data/file, Hash algorithm hashes your password so it creates a key of some sorts and then when you want to open that said file and you input your password and from that password, it uses that key to verify its correct one and the opens the file.

Encryption describes a method to encrypt and decrypt data. In other words, you can get the original data back, if you know the key.
Encryption can further be divided into symmetric encryption and asymmetric encryption. With symmetric encryption, the same key is used for both encryption and decryption. With asymmetric encryption, two separate keys are used (public and private keys), one for encryption and the other for decryption.

Hashing describes a method to compute some output, based on your data. In contrast to encryption, the output from a hashing algorithm cannot be transformed back into the input. However, since the same input always results in the same output and there is no (feasible) method to predict the outcome of a cryptographic hashing algorithm, you can use a hash to, for example, create a key from a password (although it is quite a bit more complicated that that, with many pitfalls).


Is firefox disabling of insecure TLS fallback part of the HSTS spec? I've been looking into HSTS, and I can see that Firefox has supported it since version 4, but I can also see that you could click through untrusted cert browser warnings until Firefox 37.

Is the disabling of this insecure TLS fallback part of the HSTS spec that all browsers should adhere to, or is it some value add thing that Mozilla have added themselves?

HSTS, the HTTP Strict Transport Security mechanism, is defined by RFC 6797.

The relevant section is section 12.1, No User Recourse, which states (in part) that (my emphasis):

  Failing secure connection establishment on any warnings or errors
  (per Section 8.4 ("Errors in Secure Transport Establishment")) should
  be done with "no user recourse".  This means that the user should not
  be presented with a dialog giving her the option to proceed. Rather,
  it should be treated similarly to a server error where there is
  nothing further the user can do with respect to interacting with the
  target web application, other than wait and retry.

  Essentially, "any warnings or errors" means anything that would cause
  the UA implementation to announce to the user that something is not
  entirely correct with the connection establishment.

The above is non-normative implementation advice. However, the referenced section 8.4, Errors in Secure Transport Establishment is normative, and states (in full) that (my emphasis):

  When connecting to a Known HSTS Host, the UA MUST terminate the
  connection (see also Section 12 ("User Agent Implementation Advice"))
  if there are any errors, whether "warning" or "fatal" or any other
  error level, with the underlying secure transport.  For example, this
  includes any errors found in certificate validity checking that UAs
  employ, such as via Certificate Revocation Lists (CRLs) [RFC5280], or
  via the Online Certificate Status Protocol (OCSP) [RFC2560], as well
  as via TLS server identity checking [RFC6125].

Here, "UA" means "user agent", which is the technical term for among other things a web browser. In RFCs, "must" really means "must":

  MUST   This word, or the terms "REQUIRED" or "SHALL", mean that the
  definition is an absolute requirement of the specification.

So if a client connects to a website over HTTPS, which announces HSTS in its HTTP response, then if the web browser allows the user to proceed with the connection in light of an untrusted certificate, it is acting in violation of certainly the intention and very likely the letter of the HSTS standard.

Note the term known HSTS host; because a HSTS header is delivered only after the first request has been sent, and a TLS connection must be established before the first request can be sent, the browser cannot know before that has been done whether or not the remote host uses HSTS. This vulnerability can be avoided by the owner of the web site using HSTS Preloading. Once a UA has established a host as a HSTS host, whether through preloading or through a HSTS header in a response, that information is supposed to be cached, ideally persistently, by the UA for the indicated amount of time.

TL;DR:

For the reasons outlined above, in the presence of any SSL/TLS problems with a host announcing HSTS, absent HSTS preloading, the first request might succeed (because the non-HSTS behavior of allowing clicking through a SSL/TLS warning is the default, and the host has not yet had the chance to announce anything else). However, any connections initiated after the first request completes (assuming this happens within the HSTS max-age period) or in the presence of HSTS preloading are required to fail because at that point the host is a known HSTS host.

It seems reasonable to state that failure of the UA to comply fully with the MUST requirements of a relevant, implemented specification is a bug. For that reason, the behavior you describe of Firefox 4 through 36 would appear to have been a bug.


Is it desirable to obtain a brand ssl certificate for a password generator? I need an advice. I have created a password generator, which creates strong passwords on local PC (its a Progressive Web App).

But there is one problem: most site visitors are distrustful to the service. Should I buy a brand SSL certificate to get the site more trustworthy or it doesn't matter?

A certificate does not mean trust of a product - malware and phishing sites now use legitimate SSL certificates from Let-Encrypt.

Also as mentioned by AndrolGenhald no one should trust a password generated from an online service for a large number of reasons - First being they don't control the source and cannot guarantee uniqueness or that it hasn't been recorded or served up from a list.


memcached enumeration issues I have a reverse shell from an application called openEMR to my kali host. Im trying to enumerate memcached manually however I get an error failed to listen on TCP port 11211: Address already in use
any help would be appreciated. Ive tried to use the automated tools like nmap, metasploit, libmemcached-tools however they cant resolve the rhost being that the app is running on a vhost under hms.***
kali ~/Downloads # memcstat --servers=hms.***
kali ~/Downloads :( # memcstat --servers=10.10.10.188
kali ~/Downloads :( #

if anyone has any ideas how to resolve that issue as well it would be appreciated.
oh and yes I've added the vhost to my /etc/hosts file

My issue ended up being a misunderstanding of the correct way to enumerate memcached. I was pointing my netcat, nmap, whatever tools at the web app ip address. Eventually I tried pointing it at 127.0.0.1 11211 and it worked. Why? Because I had a reverse shell i was querying the target application from its server. All I had to do was query the localhost for the memcached server. Im not sure if thats clear but Im trying :)


security reviews of third party code I am not familiar with all the steps involved in a full-fledged
information security review of an in-house developed application,
so I am wondering whether or not the following scenario is commonplace.

A web application is created, and runs on top of Microsoft's .NET framework.

Under the terms of the security review, all third party code,
defined here (however rightly or wrongly) as code not written in-house,
needs to be reviewed.

Thus, even the .NET stack itself - not just the in-house code written on top
of the .NET stack - needs to be audited. So besides the initial audit
of the code, any Microsoft updates would have to be audited. For instance,
suppose the app is using MVC 5.2, and Microsoft releases MVC 5.3, and the
app upgrades to MVC 5.3; in this case, the app could not pass review
until (among other tests) the MVC 5.3 codebase itself is run through
auditing/review.

Is this part of normal information security reviews?

Is it standard practice to conduct a security review of Microsoft's own code base when you build an app on the Microsoft stack?

How could one assume an internal auditing and review process (using
whatever third party tools) would be more sophisticated
than the tests Microsoft itself would run?

And where does this cycle stop?
Who is to say the third party tools and/or internal tests are up to par?
I guess there should be an audit of those processes as well.
And then an audit of those audits...etc., etc., etc.
At some point, this has to stop and there has to be a level of trust, right?

Is it standard practice to conduct a security review of Microsoft's
  own code base when you build an app on the Microsoft stack?

No. One reason being is that you will not have access to proprietary (Windows, IIS, .Net, patches) code unless you reverse engineer it and the effort of it would outweigh the benefits.

The common approach is to define trusted 3rd parties and accept the risk. If you wanted to cover 100% of 3rd party components, you would have to review not only .Net, Windows, device drivers, firmware, BIOS, but also the hardware as well.


What is the role of IP spoofing in DDoS attacks? I've read that IP spoofing is often used in denial of service attacks, and I've also just recently read about ingress filtering, which attempts to use blacklisting to filter out spoofed IP addresses to defend against DDoS attacks.  I'm wondering how spoofing comes into play in DDoS attacks.  Isn't it usually zombie computers infected with worms launching pings or TCP SYN packets?  How would those packets be detected as spoofed when they're coming directly from the zombie computers?  It seems like they would read as perfectly valid IP addresses, the IP addresses of the zombie computers.  Where does spoofing enter the picture?

There are several kinds of DDOS attacks and IP spoofing is used in reflection and amplification attacks. In these attacks the attacker sends a small request with a spoofed source IP address to some servers and these send a much bigger response to alleged sender of the request, i.e. the spoofed IP address. This way an attacker can cause a bandwidth eating attack against some target by using only a small bandwidth himself. TCP SYN does not matter here because these attacks are done with UDP and not TCP. For more information read about NTP-based DDoS attacks or DNS-based DDOS attacks.


Using OpenSSL v1.0.1g, am I creating SSL certificate or TLS certificate? So confuse right now between SSLv3 and TLSv1.2, I tried to find some answer on the Web but didn't seems figure it out so I am asking you guys.

Is using the latest release of OpenSSL make me creating TLS certificate ? If yes, how can I verify this ? Is it possible to look into the certificate to find in wich version it was signed ?

Thanks

SSL and TLS are the same thing.

To be precise, SSL is the "old name": it means Secure Sockets Layer. It was the name of the protocol originally defined by Netscape. The last version of that protocol (SSL 3.0) has been later on published as RFC 6101.

In early 1999, the protocol was turned into an IETF standard, not something owned by a private corporation. This implied a change of name, both to symbolically assert the will to push the protocol into the public, implementable by anybody, and also to avoid intellectual property issues. The new name is Transport Layer Security, aka "TLS". This also expresses the idea that TLS can be applied to various transport channels, not just sockets.

So TLS 1.0 was published as RFC 2246. The authors took the opportunity to iron out a few historical quirks, meaning that TLS 1.0 is very similar, but not completely bit-to-bit equal, to SSL 3.0. Down on the wire, TLS 1.0 clients and servers actually announce the protocol version as "SSL 3.1".

As for the certificates, there is no difference. "SSL certificate" is the colloquial term for "a certificate that is fit for a SSL server". Such a certificate would work equally well for a TLS server, and vice versa. Certificates exist outside of SSL/TLS, and there is no notion of SSL/TLS protocol version which would apply to certificates. There is no place within a certificate where it would be written "this certificate is for SSL 3.0" or "this certificate is for TLS 1.0".

OpenSSL is called OpenSSL and not OpenTLS because it is a derivative of an older library called SSLeay, which was written years before the name change to TLS. A contrario, the GnuTLS library, a competitor to OpenSSL, was started after the name switch, and is sponsored by people who value naming correction over pedagogy (let's face it, the "SSL" acronym remains much more widely known and understood than "TLS").


Is it possible to completely wipe a flash memory? i have a 64 gb micro SDXC memory card that has sensitive files on it and i want to completely erase it but i heard it was impossible to be sure that your data was erased because of wear leveling ? The manufacturer (SanDisk) doesn't provide special tool for a secure erase.
What if i delete the files then use a software like eraser to erase unused disk space, would this work ?

This topic has already been covered here and there. To sum up:

If you simply overwrite the complete disk (as a block) with data (random, null bytes... it does not matter), then there may be parts of surviving data, which could potentially be recovered by extracting the chip and reading from it directly.
You cannot know what data has survived without taking the chip apart.
Overwriting the whole disk repeatedly should eradicate (almost) all the data, but you cannot be sure of it, and it will severely diminish the lifetime of the card.

It is safer, and (in the long time) cheaper, to simply physically destroy the card. Next time, use disk encryption.


Spoofing domains in Facebook Over this past week my Facebook's timeline have been flooded by people posting "teenagers sex videos" and tagging a lot of people.

It's common in Facebook to see this kind of malware spreading to people that believe and click on everything, but what I see different this time is that the domain of the "video" is apple.com.

How is it possible?

For example:

I think the question is "how such a spoofing possible"? It's not a question how a domain owner protects it, because you can't control the whole web. The spoof IS a kind of lie, so EVERYTHING is possible here. The purpose is to shock you, so if you will see a BBC or CNN domains under this XXX videos - feel no surprise.


What does two IP-addresses using the same MAC-address mean? When doing forensics, I saw the same MAC-address being used by two different IP-addresses in a splunk logfile:

139...  4681.791993  Apple_5a:77:9b  Apple_69:38:cc  ARP  64    192.168.1.64 is at 00:1f:f3:5a:77:9b
133...  4380.593992  Apple_5a:77:9b  Apple_69:38:cc  ARP  64  169.254.90.183 is at 00:1f:f3:5a:77:9b

What does that mean?

I would read your logs as follows:

192.168.1.64 is the IPv4 address the physical interface with MAC 00:1f:f3:5a:77:9b is using. I would tend to assume the IP was handed out via DHCP, but you would see a similar IP <-> MAC map if it was statically assigned (you simply would not be likely to see it from a DHCP server)
169.254.90.183 is a link-local address (https://en.wikipedia.org/wiki/Link-local_address), which in effect means it is an autoconfigured address the machine assigned to itself when all other IP assignment mechanisms failed (typically, this would happen when a node cannot get a DHCP assignment, potentially because the DHCP server has no free IPs to hand out, or because it is busy).

If the first two columns in your output are a reasonable proxy for timestamps, I would take all this to mean DHCP failed temporarily, before working again and providing the host with an address.

As a link-local address, traffic from 169.254/16 will not leave the broadcast domain, so in a forensic context, unless something happened within the broadcast domain, I would disregard it.

There is one specific use of this range that would possibly be worthwhile worrying about, which is a host announcing itself as 169.254.169.254 within a cloud environment (see https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html)


Is re-prompting a user for credentials an effective measure to prove a user's identify I'm upgrading the authentication of an application from self hosted forms authentication to OpenID Connect through Azure Active Directory B2C (AAD B2C) and have found a few pages which re-prompt the user for a password before a transaction is submitted. It's a financial application.

AAD B2C doesn't support the Resource Owner Password Credentials Grant flow so I'm forced to look for alternatives.

I feel like like re-prompt forces a user to think about the transaction (as opposed to accidentally hitting a button) and protects the application from a user who is authenticated, but walks away from their machine and leaves it unlocked.

What is the common approach to this problem? Email a PIN to the user, secret question, reduced session timeout?

Is re-prompting a user for credentials an effective measure to prove a user's identify

Yes, this is quite common and generally more effective than not.

Typically this is used to assert that the user sitting at the keyboard is the same person that logged into the app at some point in the past. This prevents scenarios where a user has left their computer unlocked, or left themselves logged in on a public terminal, or where the user is accessing the site through a weaker form of authentication like a "magic" login link in an email.

There are lots of other solutions but the only one you get for free (by virtue of having already collected the email and password) is to challenge the user to re-enter their password.

  and have found a few pages which re-prompt the user for a password before a transaction is submitted ... AAD B2C doesn't support the Resource Owner Password Credentials Grant flow so I'm forced to look for alternatives.

You should definitely not use the Resource Owner Password Credentials Flow for this purpose, which allows an RP to collect a plaintext password and forwards it to he IDP for verification.

OIDC provides a purpose-built alternative: You should perform a new authorization flow using the prompt parameter to instruct the IDP to force the user to re-enter their password.

Initiate a new Code Flow but include prompt=login, and the IDP will (or at least SHOULD according to the spec) reauthenticate the user.

prompt and the values it supports is defined in the OIDC core spec under 3.1.2.1.  Authentication Request.


Setting up secure network for home From the security perspective; how would you advise on setting up a secure computer network at home?

Current state (as-is):
Currently, there's only a laptop making Internet (ADSL) connection through a wireless modem provided by an ISP.

To be / target state:
Setup a secure network which will be used by a couple of laptops as well as a mini-server accessing Internet. Laptops will be used to connect to the Internet as well as to the mini-server. Mini-server should accept connection over SSH from outside of the home network.

Would appreciate particular advise on what type of gear should be used e.g. router, switch and etc.

Many thanks.

If I were to diagram your network, it sounds like you want everything inside the home to communicate with each other freely, and to be protected by a border firewall.  Because your ISP gives you a single IP address to serve the whole house, you'll need the firewall to also perform Network Address Translation (NAT), which virtually all home routers do these days.  You need a wireless access point so that your laptops can connect, and you probably want a wired Ethernet cable to connect your mini-server to the router.

This is a simple architecture, and an ordinary home router/firewall should serve you well.

Outside the home, you have wires coming in to an ADSL modem.  The ADSL modem is already providing you a wireless access point.  From this description, it sounds like the modem is already likely providing all the router/firewall/NAT services you need, and you may not have to buy anything else.  That really depends on whether or not you have the admin password and authority to configure your modem, or if your ISP runs it for you.

Assuming you have the authority, all you need to do is learn how to add some "port forwarding" rules to your router, and make a few configuration changes to improve your security.

First, log in to your router.  It will help to download the user manual for it, if it wasn't provided by your ISP.  If you don't know your router's address, view the network settings on your laptop and look for a "default gateway".  It should be a number like 192.168.1.1, 192.168.0.1, or something fairly similar.  Open your browser and navigate to http://192.168.1.1 (or whatever your gateway address is).  You'll be greeted by the logon page.  Type in the admin name and admin password for your router.

You'll probably see a "main setup" page.  There are a few things you should look for here.  First, you'll want to change the default password.  There's no sense in leaving this as a security risk.

Next, you'll need to know the IP address of your mini-server.  If you haven't assigned one already, look for the router's DHCP server settings; then look for a way to reserve a specific IP address for your server.

Next, look for a "Port Forwarding" configuration; it could be under a category named something like "Applications and Gaming".  It will have a table with at least 4 columns:  Internal port, External Port, Protocol, and Internal Address.  This is how you will externally SSH into your mini-server from the internet.  In both the Internal Port and External Port columns, type the number 22 (the SSH port).  For the protocol, select TCP.  And for the Internal Address, type the IP address of your mini-server.

I recommend shutting off UPnP support.  This will prevent any devices from automatically opening port forwarding holes without your knowledge.

Finally, you'll need to know your home IP address so you can SSH in while you're away from home.  Your ISP provides you with an IP address using DHCP, but that's dynamic and can change without warning.  Many companies offer "dynamic DNS" services, some offer free or low cost plans that let you piggyback on one of their assigned names so you can create something like alicelebi.dyndns.org.  Keeping the address up to date requires software running in your network to update their DNS servers (some home routers have this update feature built-in; again check the manual for your ADSL modem.)


How do I protect security camera footage from an adversary? I am interested in installing a security camera in my car, but I am worried about an adversary gaining physical access to the camera, and destroying the footage; leaving me with no evidence. Unfortunately, I can't just lock the security camera DVR in a room, like I could with a building. Uploading the data to a server would work, but if there's no service (or IMSI catchers, jammers, etc.) my footage is gone. So, how would I go about protecting the footage from an adversary with physical access, while optimally not using the Internet? I intend to use a Raspberry Pi with the camera, but solutions don't need to match my hardware and OS.

Are you sure physical access to the camera is your biggest concern here? I mean, if a thief breaks into your car, are you more worried he will see the security camera (and breaks it) or that your complete car will be gone? Besides using RF technologies (cellular networks being the most easy, common, and cheap) there is no way of securing the camera footage externally.

I would go for a more common GPS tracker, which activated by movement (geofencing), and reports back its coordinates through SMS. You can buy these for just 30 or so dollars, and can be easily installed in such a way no one would notice (especially not by a regular thief who's in a hurry to move a stolen car).


How can I protect myself from one of my AWS EC2 instances being subverted and creating other instances? I'm running a custom server program on a free tier EC2 instance. I'm not a security professional, so while I've taken every step I know how to to secure my software, it's very likely that there's some vulnerability in my code or any other program running on the instance that could allow an attacker to take control.

I've heard horror stories of hackers subverting an EC2 instance and then using the EC2 API to buy tens of thousands of dollars worth of compute in order to mine bitcoin on your EC2 account, leaving the victim with the bill.

Since I have no use for the ability to dynamically alter my EC2 instances from within the VM anyway, how can I turn this off, or otherwise mitigate this kind of attack?

AWS maintains the notion of "Roles" for EC2 instances. When launching a new instance you are able to assign the server a role. The role must be applied during the build and cannot be added to an already running server. In the Identity and Access Management (IAM) area you can define what a role has permission to do (e.g., launch additional compute units, stop servers, delete EBS volumes, etc).

The best practice is to create a role that does not allow the server to perform any AWS operations that are not necessary for the server's intended purpose.

You can read more about AWS role-based access for EC2 here.

And about roles in general here.

Additionally, depending on the need the server has to communicate with the outside world, consider firewalling it off. In AWS, this is done with Security Groups.


Are there any signs for an end-user of cellular calls being routed through a Stingray device? The Stingray is a small device that mimics cellular towers. From the user's endpoint side, is there any way to detect you are being routed through a rogue cellular tower?

On Android Devices you can monitor all cellular Towers you are connected to with AIMSICD (https://github.com/CellularPrivacy/Android-IMSI-Catcher-Detector/wiki) so if you connect to an unknown cellular Tower (an attacker) in an area where it already knows the "good" cellular towers the device normaly connects to it warns you.

Quoting the github Page:

  AIMSICD attempts to detect IMSI-Catchers through detection methods such as these:

  Check Tower Information Consistency
  Check LAC/Cell ID Consistency
  Check Neighboring Cell Info
  Prevent silent app installations
  Monitor Signal Strength
  Detect silent SMS
  Detect FemtoCells


Security issue with form action $_SERVER['PHP_SELF'] I read that there is a potential security issue with forms like this (action $_SERVER['PHP_SELF'])

<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
    <input type="text" name="search">
    <input type="submit" value="Suchen">
</form>

Could someone explain how this could be manipulated? Could this somehow turn into a security issue? I personally use $_SERVER['REQUEST_URI']; as action for form actions on the same page.

Think about the following:

    http://www.example.com/foo.php/">script>alert('hello');/script>

It will still load your page but also include it within the output as well.

    form method="POST" action="/foo.php/">alert('hello');/script>">

    /form>


Identify malicious hosts in our network by sending valid domain credentials We are currently whitelisting the hosts owned by our company on our Cisco switches to prevent private hosts in our network. This works pretty well but someone can still spoof the MAC address of his host.

Now we had the idea to create a domain user with literally no rights but to logon to a host over the network. The Idea behind this is to identify hosts that aren't able to verify this credentials because they aren't a part of the domain.

Every host that isn't able to verify the credentials or isn't running the needed services is definitely an unwanted device. This is because it only concerns the workstation network which is heavily regulated using Group Policies.

Is this a good idea or am I missing something?

// I'm not searching for a way to prevent a specific type of attack my primary intend is the identification of malicious devices.

AFAIK Cisco switches base their forwarding decisions based on MAC; regardless of what authentication occurred first.

You can use port-security to enforce MAC auth, but as discussed that is easy to spoof.

A better option is 802.1X  (Cisco just refers to it as dot1x);
whereby as a port comes up it asks the client to authenticate, back-hauls that auth to a radius/TACACS server, and based on the response enables traffic forwarding on that port (on server defined VLAN)

This can also be used for NAC -- if a legitimate host doesn't pass health checks (up2date AV/Windows updates) it can be quarantined to a remediation VLAN to update itself before being allowed to join the main network.

Ultimately, however, if a host has passed dot1X authentication, any frames sourced on that port, with the expected MAC address will be forwarded without further authentication.

A much more resilient option ( which also covers remote Layer3 traffic ) is IPSEC; My main experience with this is Windows, though Linux is capable (Racoon? - though more complex to administer) you can enforce IPSEC traffic policies whereby the individual IP packets have an authentication header to prove the identity of the sender (computer, user, or both); and if the receiver cannot validate that info the packet is dropped even before passing up the stack to (possibly vulnerable) application.
It does by definition cause inter-operability problems with external or non-domain devices (eg. printers)- which can be addressed with domain trusts (given similar IPSEC policy) or device certificates (from trusted chain)

You can configure IPSEC policy not only to authenticate connections, but to encrypt the data; which renders most MitM attacks useless.

You could identify attempts at non-IPSEC secured connections (or those that fail authentication) in event logs.


Switching to new encryption method (without losing data?) Let's say you have a website that provides a service of some kind. Users can log in, they can store some kind of data, and there's various types of encryption in place to keep it all safe. Passwords are salted and hashed, user data is encrypted, the keys are kept securely, it's all good.

One day, the bad guys find a vulnerability in the encryption algorithm you're using. The details of what the vulnerability is or which algorithm it is etc. are irrelevant; the important part is that some or all of your data is no longer as safe as it was - it's now possible in real-life practice to get the user data back from the encrypted data you have stored.

How do you deal with this situation?

In the case of passwords, you could just invalidate everyone's passwords, issue reset notices, and hope that the email accounts you just sent those passwords to aren't similarly vulnerable... is this a good idea?

For the other data... Well, it's stored using reversible encryption, so I suppose you could run through decrypting it and re-encrypting it using the new non-broken method, but for that you need the keys, which will presumably (hopefully) be stored like passwords, using one-way enrcyption, so you're kind of stuck. Obviously your safest course of action is to scrub the data, but that seems rather drastic, and your users will likely be somewhat miffed at losing all of their data in the face of some hypothetical risk which may be very small and may never materialise.

One thought I did have was that you could take the encrypted data you have and encrypt it again with a different (non-broken algorithm), so that you know it can't be recovered using the new vulnerability, and then next time the user logs in, use the old method followed by the new method, and if it works, wipe the field and store a new version that just uses the new method. With salted hashes, you'd have to store the old and new salts as well, but that's no big deal. So, your table would need an extra column for a flag that lets you know whether or not that user has been migrated to the new system yet, and in the case of salted hashes, another column for the extra salt. Would this work, or is there a vulnerability in this that I haven't spotted? I'm aware that combining two cryptographic methods can sometimes produce a vulnerability that isn't present in either method when used alone, but if your current data is encrypted using a method that you now know to be insecure, my theory is that you might as well treat it as plaintext, at which point adding encryption can only make it safer.

The best way to do this is simply to migrate the crypto when a user logs in, or invalidate their password and data if this hasn't occurred after a few months.

So, for passwords, the user logs in, we know their plaintext password, so we just compute the new hash. Optionally force the user to pick a new password. For encrypted data, the user logs in, we know their password again, so we just re-encrypt.

The problem with re-encrypting is that you still need to know the password for the new cipher to use. It's also prone to situations where the underlying cipher is weak against timing or power analysis attacks.

The problem with re-hashing is that any collision vulnerabilities in the first hash scheme are perpetuated into the new scheme.

So for both, it's better to just wait for the user to log in and then migrate them over.

An alternative is to double-hash or double-encrypt as a temporary measure, then migrate on login. It's more development work, but works out a bit safer.


Does every recipient receive a different version of "encrypted" email using PGP? If I understood it correctly, PGP encrypts email by using receiver's public key. In a multiple-receiver scenario, does that mean each receiver will get a different version of "encrypted" email but the same version of "decrypted" email?

Also, it is possible to decrypt email with sender's public key?

In a multiple-receiver scenario, does that mean each receiver will get a different version of "encrypted" email but the same version of "decrypted" email?

Usually not.  PGP supports something called "Multi-Key Encryption"; multiple recipients public keys are used to encrypt the data encryption key, which is minimal overhead on top of what is already being encrypted.  Here's a Question that can tell you more about that.

  Also, it is possible to decrypt email with sender's public key?

No, public keys are used to encrypt and to verify signatures.  A single key half (either the public or private key) can't be used to both encrypt and decrypt; they're one-way tools.


Is is safe to skip virus scanning for image files? Among other things, I use clamscan on my web servers website directories to help find compromised websites.   Unfortunately the time to do this scan is becoming onerous.
Are there any good reasons not to ignore the scanning of .jpg and .png files to reduce the load on the scanner?

Are there any good reasons not to ignore the scanning of .jpg and .png files to reduce the load on the scanner?

One reason is that if you ignore certain files based on their file extension (e.g., ".jpg" or ".png") then attackers can upload malicious files of any type as long they just change the file extension (e.g., replace ".exe" with ".jpg").


Prestashop + mod_security concerns Running a shared hosting service, a client contacted me if I could disable mod_security for their webapp. The thing is, there is this patchwork webshop CMS called Prestashop with some hair-raising solutions (I'm not here to complain about that), and for it to function properly one of its technical requirements is that you must not use mod_security at all.

I was instantly thinking, if I really had to do this, I'd need to change everything, like put all websites into isolated docker containers running different webservers and put an nginx reverse proxy in front of all this, this would be a huge job. Is there any other solution to achieve that malicious requests get filtered on this specific installation without having to make in-depth changes to the server and expose prestashop as a single point of failure?

Updates mod_security and its rules.

Get help from the pros and their specific community:
https://modsecurity.org/help.html

While you wait for a response try some of these things.

http://www.inmotionhosting.com/support/website/modsecurity/find-and-disable-specific-modsecurity-rules

grep ModSecurity /usr/local/apache/logs/error_log | sed -e 's#^.*\[id "\([0-9]*\).*hostname "\([a-z0-9\-\_\.]*\)"\].*uri "#\1 \2 #' | cut -d\" -f1 | sort -n | uniq -c | sort -n

Results in

129 990011 example.com /feed/
4668 950004 example.com /wp-content/themes/drone/jquery.cookie.js
29070 950004 www.example.com /wp-content/themes/drone/jquery.cookie.js

echo "SecRuleRemoveById 950004" >> /usr/local/apache/conf/userdata/std/2/userna5/example.com/modsec.conf

Obviously the paths won't be the same on your server.

I would also recommend trying to modify the rules before disabling them.

Additionally, you can also use snort to monitor your traffic.

https://www.tipsandtricks-hq.com/apache-mod-security-update-how-to-fix-error-406-or-not-acceptable-issue-259

Apparently you can modify the config with unique .htaccess in each folder.  Therefore, you could disable it for per site.  However, I recommend investigating modifying option 2.


Intruder playing games with my home connection? Was checking my home router and this appears in my logs just as I try to log in.

The log shows system issues, and after my login which is the listed IP, there's a message of a 'DNS' query with a clear troll saying

'DNS query failed: Name: its_better_to_play_this_game_when_no_one_sees_you.ttcg.com, Type: 1, Error: no such name'.

I'm pretty sure there's no legitamate DNS server with that name that's trying to be retrieved. I've had a strong suspicion something has been going on but I have barely the nuts and bolts understanding of Protocol security to know how this has happened.

Can someone please help shed light on this. I've no idea how this has happened and if someone can explain the further implication that someone can have access to my Server DNS query responses, i.e someone having full access to my home network, I will be ever grateful.

That's probably nothing to worry about. To achieve these things it is enough that you visit a website where somebody has included an image from some non-existing or no longer existing domain, i.e. something like this in the HTML code of the page:

<img src="http://its_better_to_play_this_game_when_no_one_sees_you.ttcg.com/img.gif">

This way the browser will try to load this image from the given site and for this the browser needs to do a DNS lookup of the given name, i.e. resolve it to an IP address so that a connection to this site can be established and the data received. Since no host with this name exists an DNS the lookup will fail and will result in the log entry you've seen in the router.

In short: nothing to worry about and that's why it's only shown as "notice" in the log file. And this does not indicate some kind of hack against your system.


How to know if a web page is valid and not a man in the middle fake page? Recently, the facebook page changed on my computer (on others from the same router, I get the regular page). I checked the ssl certificate, and it seems to be authentic, however, as the page does not look professionally designed, I am worried it is a man in the middle attack. How to be sure if it is legitimate or not ?

Certificate information :

Unless you have installed any certificates in your operating system or browser trust store, you can be fairly confident that any page using HTTPS is not the result of a MITM attack. In your particular case, it sounds more like a CSS resource failed to load, resulting in the corrupted layout you briefly observed.

An attacker who is sophisticated enough to perform a MITM attack against a TLS connection without getting you to trust their certificate manually is likely going to also be sophisticated enough to correctly copy a web page design so that it is completely indistinguishable from the original, legitimate layout.

You should verify that:

You have not installed any certificates that you don't trust.
The domain you are visiting to really is the domain you want to visit.
Your browser and operating system are up-to-date.


AES, RSA, ECC Key size It is generally said that 2048-bit RSA keys are roughly equivalent to 112-bit symmetric keys and 2048-bit RSA keys are "sufficient for commercial use until around the year 2030" (https://security.stackexchange.com/a/65180/189448).

What is a rough estimate for when AES, RSA, and ECC keys of n bits are unsafe for amatuers?

"Unsafe" as in a tech-savvy person of medium income can decrypt a given message within 2 years.

For this kind of purposes, there is a website, keylength.com, that uses various academic and private organizations mathematical formulas to approximate.

If you select 2030 you will get the results.


What is the fastest way to scan all ports of a single machine I am doing some research and I need a very quick way to scan for open ports on a single machine. To provide some context, I know that my machine will have a port open waiting for UDP packets for about 3 seconds. That is all I have. I also know that it is in the range of port 50000 to 62000.

Long story short, how can I scan 12000 ports in less than 3 seconds?

I tried to find the answer myself first. I put my hopes in zmap but it seems to work on different IPs, not different ports for a single IP.

I played with nmap with -T5 and --min-parallelism/max-parallelism but it takes minutes to scan those 12k ports.

Are you explicitly specifying a UDP scan in nmap (-sU)?

I would be surprised if you can get the time down to 3 seconds. Also be aware that using -T5 can cause issues, such as DoS or inaccurate results.

Also be aware that there is no requirement for UDP ports to reply to your packets, which is why UDP scanning is more difficult than TCP.

Ref: https://nmap.org/book/man-port-scanning-techniques.html

Edited to add: Doing a bit more searching I found this question which has some methods to speed up UDP scans, and their drawbacks.


NTLM security and password complexity A client that allows to respond to the server with LM and NTLM, with a password which is simple,, is it insecure.

Isnt a more secure way is to have all the communication with NTLMv2 scheme? and in addition to that have a complex password.

is it true that a weak password can be cracked even in NTLMv2?

Allowing the storage and use of LanMan (LM) hashes is a security weakness as Lan Manager splits the password into two case insensitive 7 character pieces before hashing, which makes cracking the password hash much easier.

In general forcing NTLMv2 and disabling the storage of LM hashes is a good idea from a security perspective and as no supported version of windows requires LM hashes, would seem like a pretty safe bet these days.

A weak password can almost always be cracked if the attacker gets a hold of the hashed version of it that is stored on a system.  An attacker can use a dictionary attack which is usually pretty quick to crack many weak passwords, and for short non-dictionary passwords rainbow tables can be acquired to speed up the cracking process.


Can subdomains of trusted domains be registered for malicious use? I was working on a rule that reports phishing sites, and I wanted to exclude known domains, such as .microsoft.com etc, and a doubt arose: can someone register a subdomain of a known site to phishing purposes? I came across this article, where there is a video demonstration.
So, 2 questions:

Is it possible to register a subdomain of a known company for malicious use?
In the video, I imagine that "under the hood" two queries are sent, one to the legit site, the other one to the malicious one; if I have a rule, like a firewall rule, prohibiting communication with domains that are not legit, do I avoid the threat exposed in the video?

Two separate items come to mind here: Hijacking of existing subdomains and creation of new subdomains. (I'll skip the obvious third item: take over an existing subdomain's host.)
The links in this question refer to hijacking abandoned subdomains: an attacker can take advantage of an existing subdomain that was defined as a CNAME to another domain that was available for registration. Simply register that other domain and accept mail for the CNAME and you can gain an SSL certificate. Your rogue host will work until the domain owner yanks the CNAME.
Creating a legitimate domain's subdomains can be done by hijacking its DNS (e.g. phishing their GoDaddy credentials). This is known as domain shadowing:

Domain shadowing is the process of gathering domain account credentials in order to silently create subdomains pointed at malicious servers without tipping off the actual owner.

This technique is most commonly used to compromise small less-tech-savvy sites since the site admins aren't likely to notice (they'd have to log into their registrar and notice a new subdomain is present). It's not at all likely to come from a domain like microsoft.com, which is big enough to have an information security team protecting it.


How is OAuth2 secure vs man-in-the-middle attacks I'm currently researching on securing internal API calls and became interested in request signing since it seems quite secure (using a secret that you won't be sending to anyone to sign your request feels pretty safe).

My problem is that most API Gateway services offer OAuth2 mechanisms. I have serious doubts about its security.

Can someone explain if it's actually secure to send your credentials to obtain a token and use that in an Authorization header?

I can't help but feel anyone that can successfully obtain the information of the first request will have all he needs to impersonate you on future API calls.

You brush upon an important part of the OAuth2 standard.

Namely, all access is bound to IP and is time-limited. (as in x minutes).
After that you need to request a new token through the authentication mechanism.

Another part of the standard inplace to secure against eavesdropping is that all OAuth2 Acces providers MUST implement a TLS or SSL connection. (no HTTP allowed).

But you are correct in that if someone can actually eavesdrop the full connection from the start (as in first authentication with the full oauth  authentication and authorization process) has all the information to connect to the service from your IP.

This is however the same whether you would logon directly to the service.


Tools and methodologies to share pentest and/or source code analysis results I would like to hear from you which tools (commercial and open source) do you use to share results during collaborative penetration test or source code/binary analysis. Well-known Dradis framework helps at some level, but it would be nice to see other possible solutions, methodologies how teams work and exchange their results effectively.

HP AMP and HP Fortify 360. HoneyApps Conduit. Denim Group Vulnerability Manager, Veracode, Aspect Security ARMS.

Atlassian Crucible, Friendpaste, SyntaxHighlighter, Smartbear Software CodeCollaborator


Why does TLS require TCP? I have an upcoming oral network security exam and know that in past exams, the professor asked about why TLS requires TCP. I know that there is DTLS but it wasn't part of the lecture. So the question is about what advantage TLS gains by requiring its underlying protocol to be TCP, I guess. I already heard some wild guesses but no convincing arguments.

In the beginning of the RFC, it says:

  At the lowest level, layered on top of some reliable
     transport protocol (e.g., TCP [TCP]), is the TLS Record Protocol.

Seemingly everywhere else (according to my judgment), the RFC doesn't only require "some reliable transport protocol" but TCP in particular.

TLS requires a reliable transport. On the internet, this leaves only TCP, as UDP does not offer reliability.

TLS does require a reliable transport because (in compliance with the layered architecture of the ISO/OSI reference model) it does not handle transport errors, lost packets or other disturbances that may occur with IP.

TLS is designed to offer a secure channel on top of a reliable transport and it does this quite well. DTLS does (I assume) the necessary error handling within the protocol.

If TLS was to be performed over UDP, connections and handshakes could fail just because a packet got lost in transit and no one noticed.

Mitigation of such problems is (according to the ISO/OSI reference model) the designated task of a reliable transport. Any reliable transport works theoretically, yet for all practical purposes of IP networks, this usually implies TCP.


Is OAuth always the right choice (and when isn't it) I am creating a mobile application which needs to interact on a per-user basis with an API. Having worked on several projects as a client of third-party APIs, my initial thought was to go with OAuth.  However, I have been thinking about it, and I don't plan to open the API up publicly to other consumers - the only consumer will always only be my mobile app, so was thinking if OAuth is actually the best fit? Or is it overkill?

I then read this article advising on a process from Google, which suggests the following approach for exactly this scenario:

Embed a webview in your app with a normal web based login form
on successful login, pass secure cookie to mobile app which has secure token
use token in future API requests

(assuming all over https etc)

This seems a lot simpler than any OAuth implementation, and could quite easily be done using Spring Security Filter/authentication chain (My server side code is Java & Spring MVC/Secutiry etc).  It seems interesting that is the recommended approach from Google, which to my mind has added some credibility to the solution.

Assuming with the above solution I also included a mobile app key etc (just to stop any mobile hitting the form/API), it seems like it would have the same problem as OAuth in as much that I have to include my app key embedded in the mobile code (that could be decompiled etc).

I also read this article about the Amazon approach (apparently similar to an OAuth 1 implementation), which seems like it could be a reasonable extension to the google proposed solution above and rather than send the token to the server, use it as the key to hash the request data.

I am pretty new to implementing anything in security beyond normal web based user/password security - so would appreciate thoughts on when to use OAuth for mobile apps and if the above two solutions (amazon & google) are fit for purpose of if they have been superseded by OAuth 2.

The answer to the first part of the question is easy: no protocol is always the right choice.

OAuth solves (well, offers a solution to) a lot of little nagging problems like authorizing clients and protecting resources in a semi-granular way across browsers, active clients, and whatever is in between.

It can be overkill, which is a good reason not to use it. It doesn't do authentication (OpenID Connect is the authn extension to OAuth), and it doesn't offer certain behaviors that other protocols do, e.g. SAML, but on the other hand that might be a good thing.

The solution offered by Google has a lot of characteristics of OAuth, but relies heavily on the cookie, and doesn't look like it would scale well for public use. If you don't care about exposing the APIs publicly it might be fine, but if you ever want to then OAuth would be a better approach relative to that solution.

If you do go down the OAuth route you will likely want to support the latest version as that gives you access to OpenID Connect. Otherwise you're stuck building out your own means of authentication, and all clients will have to implement against your custom design.


Advantages of http CONNECT method over TLS I wonder what the advantages of http CONNECT request over TLS are.

I understand that the CONNECT request data from client to proxy is encrypted. But I want to know more specific advantages.

Which attack is possible when the data between them is NOT encrypted? Is it fatal and must I establish SSL session between client and proxy?

The main advantage of accessing the proxy with TLS is that somebody who can sniff the traffic between the client and the proxy cannot see sensitive or private data. This means of course the domain the client is accessing (i.e. endpoint of the requested tunnel) but also any credentials used for proxy authentication.

Additionally TLS might also protect the payload between client and proxy. The payload of CONNECT is not always HTTPS: For example plain WebSockets (i.e. ws://) will use CONNECT when a HTTP proxy is involved and WebRTC might also fall back to it if no better way (i.e. direct UDP connections or using TURN) is possible. But note that this protection will only happen between client and proxy and the connection between proxy and will not provide any additional protection between proxy and server.


Can my company track my web history when Opera VPN is active? Today I brought my personal laptop to the office. My laptop connects to the personnel wi-fi automatically (not actual intranet). To mention, my work ID and password are needed to connect this network. I was working on Google Chrome and i wanted to look at something that is not work related, so i opened Opera Browser. And i saw that NSFW url on the tab (it was cached at home and it seems i forgot to close it) I closed the browser as i saw it even before any content was loaded. And now, i am worried about this situation.

The thing is, after i returned home, i opened Opera and i saw Opera VPN was active. And history was clean in working hours (Well, i can't tell for sure because i am pretty worried so i can't think straight. And i cleaned the whole history)

Long story short, it was a personal computer (not a work computer). It was on a company network with validation. Opera VPN was open.

1) Is it possible that my visit didn't get logged in history as i mentioned above ? (due to fact that VPN was trying to start up and i closed the browser immediately)

2) Can Opera attempt to send that request without VPN as i open browser when VPN starts up?

3) Do you think it was logged by my employer?

4) What should i do in this situation? (It was a total mistake, i didn't attempt to visit any NSFW website at work, i just forgot to close it and i didn't stay there even a second. I even didn't get to see if website was blocked or not)

P.S. I am working in a finance sector, so there is full security

Long story short, it was a personal computer (not a work computer). It was on a company network with validation. Opera VPN was open.

  1) Is it possible that my visit didn't get logged in history as i mentioned above ? (due to fact that VPN was trying to start up and i closed the browser immediately)

With a VPN in place (although I am not sure of the details around Opera's VPN) it is very unlikely that anything related to that visit would have been logged anywhere other than your browser.

  2) Can Opera attempt to send that request without VPN as i open browser when VPN starts up?

Entirely dependent on how it's implemented. If I were to guess, I'd say no, as that would have been a pretty big flaw in the process. If the VPN is meant to ensure access isn't logged, if the feature is enabled, reasonable effort should be implemented to ensure that access outside the VPN does not occur.

  3) Do you think it was logged by my employer?

No.

  4) What should i do in this situation? (It was a total mistake, i didn't attempt to visit any NSFW website at work, i just forgot to close it and i didn't stay there even a second. I even didn't get to see if website was blocked or not)

Don't worry. It's even likely that the wireless network you connected to is designed to have untrusted peers with limited bandwidth and potentially few or no content filters.


Reverse-proxy not a solution to DDOS attacks when hosted on PaaS? We run our apps on Heroku and use Cloudflare as a CDN and to protect against DOS attacks. However, we recently experienced (a relatively minor) attack that managed to easily bypass Cloudflare by simply sending requests to one of the routing servers that Heroku hosts on AWS while setting the requests' Host: header to our site's hostname. This worked because Heroku's internal application routing is entirely based on that header.

I asked Heroku if they could do anything about this and they suggested handling it at the middleware layer (which we are, using nginx rules). But this still allows the attacking traffic to hit our dyno and while this attack was managed using that strategy I would think that a larger attack would slow down nginx, even if the server was 403ing the connections en masse.

Short of us running our own reverse proxy, does anyone have a suggestion for a better strategy? Isn't it a major weakness of Heroku's architecture that they route to apps based on the Host: request header rather than assigning IP addresses to dynos? Is that typical for PaaS?

There are 2 ways to solve your problem:

Put an AWS Cloudfront distribution between Cloudflare and Heroku. You can use them together and Cloudfront is suitable for dynamic content.
Override the Host header in Cloudflare. As of early 2016 it requires an Enterprise subscription.

In both cases, you remove the front-facing domain from Heroku control panel, effectively preventing direct requests from hitting your dyno.

P.S. Just to be clear, you set the Host header (origin for Cloudfront) in both cases to something like evening-sands-32400.herokuapp.com.


Security reason that Card Security Codes (CVV/CVC) are usually on the back of a card? My friend recently got an Amazon Credit Card. Interestingly, all the information could be found on the back of the card including name, expiration, number, and CVV. Here's an image I found of the front of the card. Name is on both sides.

I then discovered that American Express prints the CVV number on the front of their cards.

This number is usually on the back while the rest of the information in usually on the front. Wikipedia backs me up here. It seems this makes reading this information more difficult so there must be a reason. I was always under the impression that the CVV was on the back of cards for a security reason. Seeing this has me wondering if that's true and if so, what that reason is.

Why are CVV codes usually on the back side of a credit card?

Older people will likely remember the older way credit cards were handled.

Carbon copy forms were the de facto method of proving to the credit card processor that you in fact did have the physical card present. Not only was it faster, but allowed for a very unique process to capture the credit card details.

This process involved the card, a carbon copy form, and a device with a sliding weight. The clerk would place the credit card on the device, overlay the carbon copy form on top, then slide the weight over top from one side to another. Any raised type would be captured, which included the customer information, and more critically the card number and expiry.

When the internet eventually came around, and phone transactions proved to be much more common place, CCV2 was used for these "card not present" transactions

These "2nd generation" CCVs were introduced to curb credit card theft, as it introduces a "something you have" for online/phone transactions. A malicious store clerk can't simply double swipe your card to clone it. Copying down the number becomes obvious, and can't be done with sliding the card through a reader. You can think of it as a simple PIN, tying a true card holder to the card in question. Only the card holder should have/know the CCV.

On to the major question, why do some credit cards have it on the front, where as some have it on the back?

There doesn't seem to be any standard to this, and seems to be a preference of the credit card issuer.

Visa will have the CCV on the back, and does make some sense. On first glace, someone can't see the security code without flipping over the card. There are countless cases of people taking a photograph of their card to "show off". On a AMEX, the CCV code is on the front, and this would prove disastrous. Do you recall the old method of capturing credit card details? Nothing on the back of the card was captured, this includes the CCV.

In reality, it doesn't really matter where the number is. If you have access to the physical card, you have the ability to view the CCV, no matter where on the card it is placed. Placing it on the front is more convenient as all the relevant details are in one place.

Credit card signatures are another demonstration, a bit less "technical" of security. Can you honestly recall the last time someone verified your signature against that on the card? How many people do you know have their cards unsigned? Arguably this is more secure than a CCV, but does require the card holder to be present with the card.

The future seems to hold that "rolling" CCVs are the next thing. Changing at a set time (every hour), these would prove to be much more secure than current offerings.


Are preview thumbnails for links a risk? I received a message from a friend with a link. I never clicked it, but the thumbnail image shown pretended to be an image preview for a YouTube video. Some of her other friends clicked it and it took them to a fake Facebook page where it asked them for username and password.
I always would prefer to disable such link previews as you can in Safari on iPhone, but sadly in Messenger there is no such option. Obviously images can contain malware and the fact an image displays means it has been processed by the Messenger app. What is the risk of malware from a URL preview image that has not been clicked? Just the preview that automatically displays in link shares?
I am not sure if these previews have risks such as steganography or pixel trackers linking to XSS attacks or any other risks?

You have correctly identified the primary threat, which is social engineering. The image prompts the user to view what they believe is a harmless video, they're misdirected into a phishing scam.
There is another interesting threat I believe you've outlined quite well: an attacker crafts the contents of a website so that when processed by a thumbnail generator, the resulting image can cause arbitrary remote code execution on the end-user's device. While this attack sounds very interesting, and might be plausible, I would imagine that an attacker would be more interested in remote code execution on the Messenger platform. The thumbnail generating parser may be vulnerable to remote code execution on Messenger's servers. Even if the user does not engage the link/preview, the existence of this preview functionality increases the attack surface for malicious software. Should the thumbnail generating service be compromised, it follows that an attacker may then be able to provide arbitrary thumbnails, perhaps even arbitrary responses in the Messenger service. In other words, the presence of the feature puts Messenger at risk and therefore it puts end-users at risk.
As for the possibility of fuzzing the thumbnail generator or causing the generator to pass remote code execution exploitation within the image served by Messenger? I can imagine that it is a possibility, but I'm not certain. It seems to me that this would be computationally intensive, require privileged information about the thumbnail generator, and is an attack that would be very easy to spot in the wild. If I were threat modelling for the security considerations of installing the Messenger app, this particular attack would be lower priority.


Dangerous file extensions in Linux? There are many dangerous file extensions in Windows with which an attacker could execute arbitrary commands on the target system. For example .exe, .js, .com, .wsh or .vbs. My question is now, are there such dangerous extensions in Linux or Unix systems.

Unix does not use file extensions that much, they are mostly introduced in Linux. Still then, the shell interpreter in Linux is activated when a file has execution permissions. Then the language specific interpreter specified on the first line is called with the current file as argument. This is different from Windows, where most files are bound to a extension class (HKEY_CLASSES_ROOT). One can call the interpreter directly and supply the file-to-execute as an argument, in this case there is no need for +x on the file itself.

Files that are executable by themselves (ELF in Linux and most Unices, Mach-O in OS X) always need the execution flag. They are executed when called, regardless of the extension (or contents).

#nerd note: Executable programms can be run with only a +r flag, if the ld-linux.so was called first.


Why WPA2 Client Devices Respond to Any Deauths A great number of attack methods for WPA2 involve getting a handshake capture. To capture one the fastest way involves sending deauthentication packets to the client forcing him to initiate the handshake while you capture the entire transaction with tools such as airodump-ng.

Why do clients respond to any deauth request they hear instead of verifying the origin? It seems to me this would be a basic thing that should have been implemented as part of WPA2 to prevent easily giving away of the handshake and to prevent someone from doxing the connection.

Also, will this be addressed in the upcoming WPA3 standard?

Why do clients respond to any deauth request they hear instead of verifying the origin?

They don't respond to any deauth/disassoc frame they hear, they only respond to such frames that are addressed to them and sourced from their AP MAC address. And yes, this by the nature of 802.11 wireless would include frames with spoofed source addresses.

  Also, will this be addressed in the upcoming WPA3 standard?

No. First, WPA3 is not a standard, it is a specification for getting a particular certification(s) from the Wi-Fi Alliance for a device. The IEEE defines the 802.11 wireless standards and there are no working groups working on any amendments that change the essentials of 802.11i (which the WFA's WPA2 certification is based on). Please see my answer here for more on what WPA3 is if you like.

Second, there is no need to do so. This was addressed in an amendment by the IEEE that was ratified in 2009, namely 802.11w. The issue is that implementation of support for this amendment has been slow by certain vendors outside the enterprise environment. Check out my answer here for more.

  It seems to me this would be a basic thing that should have been implemented as part of WPA2 to prevent easily giving away of the handshake and to prevent someone from doxing the connection.

PSK as defined by 802.11i (WPA2) was meant for basic, personal use. It was intended for simplicity and ease of use. If an entity wanted better security, 802.11i defined the use of 802.1X and RADIUS to provide such.


Why is Norton Safe Web flagging my site as dangerous when it reports on PHP files/urls that don't exist? I'm in a bit of a quandary over Norton Safe Web's rating of my company's website.

My question is: is it possible for someone to fool Norton Safe Web into thinking that our website has PHP files which don't exist? Could there be some sort of Spoofing going on, or could someone be manipulating a Norton tool on their machine to tell Norton Safe Web that our site has malicious files?

We host our own website on our in-house web server, and have properly configured firewalls up to layer 7. Mcafee scans our site every day for vulnerabilities and has found no such files, and Google Transparency Report does not report anything malicious.

None of the reported threatening links exist or (to my knowledge) have ever existed on our website. We stopped using PHP a long time ago, and yet Safe Web reports them on our website.

I've included the Threat Report below. I've only replaced my website with "MYWEBSITE" and removed the HTTP and WWW so it would not post as a link:

  Drive-By Downloads: Threats found: 5

  Threat Name: Web Attack: Wordpress Arbitrary File Download 4 Location:
  MYWEBSITE.com/wp-content/themes/TheLoft/download.php?file=../../../wp-config.php

  Threat Name: Web Attack: Wordpress Arbitrary File Download 4 Location:
  MYWEBSITE.com/wp-content/plugins/history-collection/download.php?var=../../../wp-config.php

  Threat Name: Web Attack: Wordpress Arbitrary File Download 4 Location:
  MYWEBSITE.com/wp-content/plugins/google-mp3-audio-player/direct_download.php?file=../../../wp-config.php

  Threat Name: Web Attack: Joomla Component Local File Inclusion
  Location:
  MYWEBSITE.com/news/index.php?option=com_macgallery&view=download&albumid=../../web.config.txt

  Threat Name: Web Attack: Wordpress Arbitrary File Download 4 Location:
  MYWEBSITE.com/wp-admin/admin-ajax.php?action=revslider_show_image&img=../wp-config.php

  Viruses: Threats found: 1

  Threat Name: Web Attack: Joomla Component Local File Inclusion
  Location:
  MYWEBSITE.com/news/index.php?option=com_macgallery&view=download&albumid=././web.config.txt

Notice they are all PHP and mention WordPress and Joomla, NONE of which we have nor use.

We are in the process of disputing the report with Norton, but this is the second time that this has happened, and the dispute process is taking quite a while. Meanwhile people are being told that our website is not safe and we are losing customers. I know there is nothing more I can do to speed up the process with Norton, but I would like to understand how this is even possible and I would like to be able to prevent this type of thing reoccurring in the future.

So in summary, what I'm trying to understand is: is it possible for Norton Safe Web to have been tricked into giving a false report of our site, or is the only possibility that someone put a file on our site in time for Norton to scan then took it off before we found it?

I'll greatly appreciate any input.
Thanks!

This is a Norton Security/Safeweb false positive. Their threat scanning engine is flawed when handling reponses from these 'hacked' URLs, which in vulnerable systems can do damage. The problem is that they interpret the response incorrectly, so sites that have no PHP/WordPress etc get flagged in error.  This is hugely damaging to customer goodwill of course. And they do not make it easy or fast to dispute. Additionally, they do not notify the domain holder (in our experience at least), so often the first to report is from a customer. In our case, it was a prospective customer who first reported the problem. They did not buy a website from from us due to this false warning, and the delay in getting it resolved.

It is not your site per se, but rather the response that the site returns to what is essentially a bad URI. If they get anything other than a hard 404 response, they take that to mean the URL is valid, and therefore a vulnerability.

My guess is that your firewall returned a 301 redirect to the initial request, which shows(redirects to) the file not found page.  This is called a soft 404. A common way to download a file is via a 301 redirect, so this raises a red flag to the scanner.

You need to make sure the actual response is a hard 404 in these cases. If not, the Norton threat scanner assumes the URL found the vulnerable file/page, and you get flagged.


Is a ptr mechanism in an SPF record secure? If I understand http://www.openspf.org/SPF_Record_Syntax correctly, any machine with an IP that points to my-domain.com can send email as if it's from my-domain.com if I'm using ptr in my SPF record.

Anyone can create a PTR record for his IP(s).

Then isn't it a security risk to use ptr in your SPF record? It essentially enables anyone to send mail as if it were from your domain.

According to the specification, it isn't recommended to use this mechanism, because it results in many DNS lookups. However, it doesn't say anything about security.

Background: recently, GMail has started marking email (manually sent) from my domain as spam on several accounts. I'm carefully going through my DNS records, server logs, etc., to find the cause and resolve this issue. I removed the mechanism already from my DNS records, but I'm still curious as to why this mechanism doesn't impose a security risk.

PTR records are a security issue in my opinion, and I'm surprised it's not called out in either the Security Considerations or Eratta.

This is an opportunity for someone to submit such a security note regarding this.