Understanding how to prevent rapid-fire login attempts I'm having problems to fully understand how to prevent rapid-fire login attempts. My questions basically come from the The definitive guide to form-based website authentication.

The final recommendation is setting a login throttling, setting a time delay between failed attempts. Something as:

1 failed attempt = 5 sec delay
2 failed attempts = 15 sec delay
3+ failed attempts = 45 sec delay

A few questions that easily come to mind are:

If we're trying to protect our system from brute-force or dictionary attacks, how is it that the delays are so restrictive?. One of the examples shows an increase of 2**2 per invalid attempt. Wouldn't a fairly minor amount of time discourage already an automated attacker?.
In this protection scheme, what would be the client? How would it be identified?. Are we talking about an IP+account or just account?. If we are talking about just an account without taking into account the IP, isn't that likely to bother legitimate users trying to access their account?.
I have never seen any reading material talking about humans trying to access accounts?. I understand that this case would be highly unlikely (more if we assume password policies in place) but, what if an attacker has built a list of likely passwords via some method (social engineering). Shouldn't that be protected too?. Because in that case, and being the client identified by IP+account, being very restrictive would make a lot of sense, trying to block the IP that he is using.
How does throttling failed logins make a real difference between just simple throttling?. With simple throttling, I mean a throttle over the 'login' endpoint that controls the number of times that you try to log-in, but without taking into account if these attempts were successful or not.

Assuming this previous definition for what I meant with a simple throttle, let's assume that I am controlling  the number of times that you can call the login endpoint for one account given a span of time:

For each account, the login endpoint can be called 3 times each minute.

Would that be enough to stop a brute force attack?. Does adding this delay mentioned before when the attempt is invalid yield better results?.

I would be super grateful if anyone could shed some light here.

The main idea here is to quickly slow down the window for brute-forcing an attack.
You normally implement this like:

Track on an account base. (so each account has its own wait time)
Increase the wait time exponentially.
Have an reset mechanism for the password and or wait time through some person (Admin / service desk / etc.)

The main difference between normal throttling and the login throttle is the wait time mechanism. the exponential factor means that you quickly have to wait for more than a day per password entry (effectively blocking that account), making detection of abuse much more likely, and normal throtteling you count connections / throughput per time, and have a stable amount of allowed actions in each slot. (so its a constant rate of attempts instead of a quickly diminishing amount).


How can I set a lower trust level for Let's Encrypt in Firefox? (In this question I ask about Let's Encrypt because it's a hot topic, but the same question could also be asked for CloudFlare's Universal SSL solution or other automated CAs)

I like that Let's Encrypt has made it very easy for everyone to secure their servers with HTTPS and it Just Works™.  On the other hand, I dislike that the only thing that's required for Let's Encrypt is a DNS entry or a file on a webserver.

What I'd like is for Firefox to show me that I'm on a site that's secured with Let's Encrypt.  It should still validate certificates signed by the CA, because it is a bona fide CA, but I'd like it to show a warning sign in the address bar anyway.  The reason I want this, is that I feel a site with a Let's Encrypt certificate is only moderately trustworthy, and I'd think twice before entering personal information on such a site.

So far I haven't found a setting in Firefox for selecting trust for a CA, other than distrusting it entirely, which is not what I want to do.

Answers suggest only trusting EV-certificates and not DV-certificates.  This is already a distinction I use; I won't enter payment information on a site with a DV-certificate.  My purpose of this question is to have a more fine-grained distrinction between DV-CA's.  Not every DV-CA has the same validation procedure, and I trust some validation procedures more than others.

As Matthew says, the difference isn't between Let's Encrypt and other CAs, it is between Domain Validated (DV) and Extended Validation (EV) certificates.  That's what you want to distinguish, since the vast majority of CAs do automated DNS or file existence checks for Domain Validated certificates, while Extended Validation certificates require much more paperwork and manual intervention.

Fortunately, browsers already identify EV certificates - often by putting the domain in green - check your browser docs.

There's no significant difference in Domain Validation techniques between Let's Encrypt and, say, Comodo CA certificates sold through NameCheap (example only).

Good luck, though, in sticking with only EV certificates - the vast majority of sites out there have DV certs.


How do you securely delete httpOnly cookies previously used for login? I am using Angular 8 with Node.js (Express.js) to make a login system. It needs to be secure. I have set the cookies using httpOnly:true, which contain a JWT token and it should be deleted by the server-side, since httpOnly cookies can only be deleted by the user manually (not an option) or by the Web Server.

How do I accomplish this successfully? Should I somehow redirect to a page which deletes cookies upon clicking on logout? Proof of concept would be great.

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


Returning the wrong HTTP response code on purpose? I'm writing a simple REST API, and I want to restrict access to my mobile-client only. In other words, I'm trying to prevent a malicious user from e.g. using curl to make an unauthorized POST request.

Of course, this is impossible. However, there are certain countermeasures that make it difficult for a hacker to succeed. Right now, I am encrypting all requests with a private key, stored client-side (obviously, this is not ideal, but the difficulty in reverse-engineering an iOS app will hopefully deter all but the most determined hackers).

One simple idea I had is to return the wrong HTTP response code for an unauthorized request. Rather than return a "401 Unauthorized," why not return e.g. "305 Use Proxy," i.e. purposely being confusing. Has anyone ever thought about doing this?

Has anyone ever thought about doing this?

Yes, there was actually a talk about exactly this at defcon 21 (video, slides).

Their conclusion was that working with response codes as offensive security can sometimes result in severely slowing down automatic scanners, non-working scanners, and a massive amount of false-positives or false-negatives (it will obviously do little to nothing for manual scans).

While security by obscurity should never be your only defense, it can be beneficial as defense in depth (another example: it is recommended to not broadcast version numbers of all used components).

On the other hand, a REST API should be as clean as possible, and replying with purposely wrong HTTP codes may be confusing for developers and legitimate clients (this is a bit less of a problem for browsers, where users don't actually see the codes). Because of this I wouldn't recommend it in your case, but it is still an interesting idea.


How to run nmap HTTP scripts on unusual ports How can I make nmap run the HTTP-scripts on ports that are unusual for HTTP, say TCP port 123? On something like nmap -n --script="http* ..." -p123 target nmap does nothing except to check that port 123 is open and runs no scripts against the port. (I verified that with nmap's tracing options.)

Is it HTTP? The version scan does not recognize the nature of the service but the fingerprint output is very clear about that:

==============NEXT SERVICE FINGERPRINT (SUBMIT INDIVIDUALLY)==============
SF-Port123-TCP:V=6.47%I=7%D=4/27%Time=553D8163%P=i686-pc-linux-gnu%r(Gener
SF:icLines,1BA,"HTTP/1\.1\x20400\x20Bad\x20request\r\nContent-Type:\x20tex
SF:t/html\r\n\r\n<!DOCTYPE\x20HTML\x20PUBLIC\x20\"-//W3C//DTD\x20HTML\x204
SF:\.01\x20Transitional//EN\"\x20\"http://www\.w3\.org/TR/html4/loose\.dtd
SF:\">\r\n<link\x20rel=\"stylesheet\"\x20href=\"/minishare\.cs
SF:s\"\x20type=\"text/css\"><title>400\x20Bad\x20request</title><bo
SF:dy>
400\x20Bad\x20request

<p\x20class=\"versioninfo\"
[...]

The other answers here are very good. However, there are a couple ways to do what you want that will work without editing the scripts:

You can teach Nmap to recognize this service. Nmap's service fingerprints are in the nmap-service-probes file. Nmap already recognizes some versions of MiniShare with this match line, added in Nmap 6.00:

match http m|^HTTP/1\.1 200 OK\r\nContent-Type: text/html\r\n\r\n.*<title>MiniShare</title>\r\n.*Total: (\d+) files	([^<]+)
\r\n
\r\n

MiniShare ([\d.]+)|s p/MiniShare http interface/ v/$3/ i/$1 files, $2 shared/ o/Windows/ cpe:/o:microsoft:windows/a

But your service responds a little differently, and does not match. Please follow the instructions Nmap provides to submit this service fingerprint so that other users will benefit. In the meantime, you can construct a similar match line so that the service will be identified as "http" with -sV and the script will run.
As a general rule, you can try updating to a newer version of Nmap. At the time of this writing, 6.47 was the latest version, so this won't help you, but it may help someone reading this answer later.
You can force NSE scripts to run against all open ports by prepending a "+" to the script name. For example, --script +http-title will try to request a page and retrieve the title for every open service on the target. This can be dangerous and slow because the scripts were not written to be run against arbitrary services, and may time out or crash the target services.

One final warning: requesting --script http* will try to run a lot of scripts that you may not intend, including (in the development version): 23 "exploit", 1 "dos" (denial of service), 51 "intrusive", and 10 "external" category scripts. A better way to specify this would be --script "http* and safe" or --script "http* and default"


Is a password really necessary? For the purposes of security, is there any difference in having a 50 character randomly-generated secret username accompanied by a 50 character randomly-generated secret password, versus a 100 character randomly-generated secret username with no password?

I think it depends on how you define "username".
Usually a username is something that is derived from the name of the user.
So it is guessable.

A username is often displayed in the Application at some kind of user preferences. So the username is visable.

Then a username is sometimes used to reset a password, and thus the username might be sent over the wire - maybe via smtp. So the username can be fetched from the traffic.

Sometimes users need to communicate to each other - so the username becomes a public data.

However, if you think of some kind of authorization token as a username, you could very well take a 100 characters long "string" to authenticate. But do not think of that as a "username"!


Potential risks of publicly uploading a Wireshark trace with TLS-related information? Say I were to upload a Wireshark trace to a website that was publicly available. Say, with it, the SSL key log, certificate information, etc were available. If someone had the link to the trace, what dangers would there be?

Obviously, the content and information of the given trace session is visible to everyone, what about a past or future session that occurred? What about sessions that occurred with other clients or other servers? Could I be in danger of something like a Replay Attack or a Man-in-the-Middle attack?

If the wireshark trace was made from the perspective of a passive eavesdropper, then there is nothing in the trace that could be used to tamper with future SSL/TLS connections.

Keep in mind that there are many entities that are in a position to make the same trace that you made, including wireless hotspot operators, ISPs, backbone carriers, data centers, etc.  If it were possible to tamper with future SSL/TLS connections using the trace that you made, then any of these entities could do the same thing.  SSL/TLS was designed specifically to be resistant to this type of tampering.

Even if you run the trace at the client, and log session information to the SSLKEYLOGFILE, the information in this file will not be useful for tampering with future SSL/TLS connections, as this file contains only ephemeral keys and session keys used only for the session when the trace was made.


Access to other local files from a local HTML file I tried this question on programmers site with no luck

Do you see any reason to block a local html file from accessing another local files located in the same folder?

I mean, if a user downloaded an html app (consisting of several html files) and opened it in her browser, why would she want to block this local app from accessing another files in the same folder? Traditional desktop apps have much broader access rights. Normally users won't save html files and open them in a browser. Why block local access?

The actual rules of which files a local html file may access are browser depended. Chrome is a lot stricter than other browsers. Firefox allows access to files in the same folder and down the folder hierarchy as far as I remember.

Ordinary people with little in-depth background knowledge may save a html file with a cooking recipe, a book extract, a travel guide, etc. to their home folder. They don't except such a document to be dangerous. Keeping that in mind, it seems sane, to prevent saved .html files from accessing other local files.

To quote someone on the referenced bug report:

  who cares if a webpage can read your credit card numbers by blinding guessing filenames in your profile directory, it can't actually do anything with them if access to internet resources is properly restricted.

The condition in the "if" part is not met: The same origin policy does not apply to image files and scripts loaded via the script tag, to name just two examples. So a locally running JavaScript can leak information to a server on the internet by encoding it in an URL.

Especially saving to the home folder is problematic, because at - least on unix systems - there are well known files with sensitive information such as: mbox, .gnupg/secring.gpg, .ssh/id_rsa, .ssh/id_rsa.pub.

Providing an installationless local http server is a workaround for this issue.


SQLi Filter Bypass with banned table/column names I've studying and practicing different approach to SQLi filter bypass and I faced a challenge. What if the WAF filters look for specific strings rather than SQL keywords?
Example:
Filter: /UNION/
SQLi: UnIoN

Filter: /UNION/i
SQLi: un/**/ion

Filter: /UNION/i and no comments
SQLi: un%0bion

So far, so good. There are lots of valid articles that explain how to surpass filters based on keywords. What if the banned string is a table/column name, or a part of it?
Filter: /user/i
SQLi: SELECT username FROM users; # deny. username matches /user/i

Filter: /or/i
SQLi: SELECT password from users; # deny. passwORd matches /or/i

I tried with double encoding, unicode encoding, splitting the column names use``rname (which doesn't work) but no approach seems to be working. Mostly because my understanding is that it's the web application that decodes the input before it's passed to the Mysql database and, therefore, the syntax must be correct before the query is processed by the database, but still encoded at the time the WAF Filters are applied.
Is there a generic approach to deal with this scenarios?

You can do things to reference the table or column name from the schema instead of supplying the actual name.


Securely notify users about account changes I am developing a web application (using PHP) and I am wondering what the best way is to notify users that someone updated their account information? The information that can be updated includes:

First name
Last name
E-mail address
Password

To be more elaborate, should the old or new email be used to send the account update notification? What information that was changed should be sent in the e-mail (ie: name, e-mail, password)? Is it necessary to have a activation e-mail sent if the e-mail address is changed? I should also note that the e-mail address is being used as the username.

You should always assume that registration information is what your real user wants, any later change and the user should be notified, especially when it comes to critical information such as username and password.

When the email address is changed, an confirmation email should be sent to the new address containing a link to activate the new email address. A notification email should be sent to the old address as well (containing a link to revoke/report this change).
When the password is changed, a notification email should be sent to the current email address containing a link to report/revoke the change.
First name and last name are a special case. They're non-critical information, but they're unlikely to change very often. So I'd say go with what best suits your application.
Other information such as age, about me, likes, sports, hobbies, etc... are clearly non-critical information. Personally, I'd like to have the option to be notified about them, so it's nice to have an opt-in checkbox for that.


Passwords being sent in clear text due to users' mistake in typing it in the username field Upon reviewing the Logs generated by different SIEMs (Splunk, HP Logger Trial and the AlienVault platform’s SIEM) I noticed that for some reason quite a few users tend to make the mistake of typing their passwords in the username field, either in the OS Domain logon, or within web applications. I am guessing those are people who cannot type without looking at the keyboard and in trying to do so, doing it fast, end up typing their passwords in the wrong field. This means that the password is sent in plain text everywhere in the network and end up recorded on the logs with an event that says something along the lines:

User P@$$w0rd does not exist [...]

Or

An account failed to login: P@$$w0rd [...]

(where P@$$w0rd is the actual user's password)

It becomes pretty obvious to work out to whom the passwords belong: usually the previous or very next  (un)successful event on the same log file will tell you an event triggered by the same user.

Any other Analyst, looking at the logs, could get someone else’s credentials without the due owner even being aware of that; the worst case scenario is network eavesdropping, or actual log file compromise.

I am looking for a general guidance to help preventing this. I assume simply masking the username is not feasible and even if it were, this would probably eliminate a lot of the log analysis for not being able to tell who did what.

Note: There is already a post on a similar issue, but I am trying to address a way to prevent it.
What's the risk if I accidently type my password into a username field (Windows logon)?

Accepted Answer: I wish I could select a few answers from the list. Unfortunately I have to stick to just one in the forum, but in practice I can combine them. Thanks very much for all the answers; I see there is no single solution. As I agree that adding 'things' add complexity which increase likelihood of security holes, I have to agree with most of the voters that @AJHenderson has the most elegant and simplest answer as a first approach. Definitely SSL and a simple code verification on the server or even at the client side. As I am looking to mitigate not against malicious users, but the distracted ones, this will do fine. Once this is in place, we can start looking at expanding the implementation to ill-intended users if appropriate. Thanks ever so much again for everyone's input.

One thought is to not allow form submission if there is not a value in the password box.  Generally if they accidentally entered the password in the username, then there likely isn't going to be anything in the password dialog.

It is worth noting that this does not have to be simply done client side, but could also be done on a server as long as the transport used is secure and the input is not logged until after passing a check about the password field not being empty.


Why did Apple think OS/X was virus proof? In such articles as this one at Examiner.com, we see that Apple had long "advertised" the immunity of its desktop OS to viruses. It had to dilute that assertion when the Flashback virus appeared.

What was it about OS/X that made Apple so confident that it was immune to PC viruses?

Compared to Windows, Mac OS X has:

Smaller user base: Means it is less interesting to malware creators, thus fewer viruses. Although there are viruses for Mac OS X, they're not as much as Windows malware. In the past few years, this has been changing, and it's backfiring. Because people think they're less prone to malware, they tend to develop bad usage habits, such as trusting, downloading, and executing everything.
Better access control: Unlike Windows, with Mac OS X you don't have access to root/admin account by default. Starting with Vista, Windows starting using UAC, which is way better than nothing, but still provides easy access to root/admin privileges.

Apple never explicitly said that Mac is virus-proof (there are many nasty viruses for Mac out there), but they implicitly manipulated the users into thinking so. While keeping that in mind, it's also good to know that on average (and with an average usage behavior) you'll definitely be less likely to be infected by malware while using Mac OS X than using Windows.


How can I access the certificate transparency logs? Am I going crazy or is there no way to access any of the "known logs" listed on Google's Certificate Transparency site? Every single one of the links listed there 404s, even though the list is allegedly up to date. Is there some arcane way of accessing them that everyone is already supposed to know? The website says nothing about how to go about it.

I did find this library, which seems to provide some sort of interface with a log, but it appears to be using regular HTTPS in order to access them, just as a browser or curl would (to my understanding), which is what is 404ing for me. Am I missing something here or is every single link in the Known Logs list really dead?

(And yes, I posted this question on their forums but no one has answered.)

EDIT: I'm looking for a way to access them via an API, not through a human-computer interface like a web form.

The CT endpoints are correct, however you need to access it with the correct paths and parameters instead of the root endpoint.

For example, to access the STH (signed tree head), you use the URL: https://ct.googleapis.com/pilot/ct/v1/get-sth

Or to access log entries numbered 1000 to 1100: https://ct.googleapis.com/rocketeer/ct/v1/get-entries?start=1000&end=1100

RFC 6962 describes all the paths and parameters used for CT operations, or you can use a library like https://github.com/google/certificate-transparency.


Could an Encrypted VG/Image compromised? I mean if I encrypt my ""full system"" so that everything (besides the /boot) is in an encrypted VolumeGroup (Linux).
So I store my /boot on a flash drive, thats always next to me.

Q: can the encrypted VolumeGroup (or in any similar solution an encrypted Image) compromised in a way that If I want to "mount" it it steals my password? (I keep my /boot on a flash drive next to me because it's not encrypted and the kernel/crypt drivers could be modified in a way, so that it can stole my password when typing the password to gain access to the encrypted VG.). So.. could this be done? Or is my method secure?

Thanks.

If someone can play with your encrypted volume group, it sounds like they have physical access to most of your hardware.  If that is true, all bets are off - your system is insecure.  They can attack the BIOS, the keyboard, etc.  It isn't clear what threats you would deter by carrying /boot around with you on USB.  See

What are the good use cases for disk encryption?
How can I keep a roommate from seeing my web activity?


Why is the public key in a certificate not signed? I have a naive question about certificates. I know the hash of the public key is signed with the CA's private key. I have an alternative design. Because the public key is being transmitted anyway, so why don't we sign the public key directly and send it? So the browser can decipher it to get the public key? What consideration prevents us from using this design?

For any message that is signed with a digital signature, it is standard to take a hash of the message first, then apply the digital signature algorithm to the hash.

Without applying the hash function first, the message would have to be split into blocks small enough for the digital signature algorithm to act on each block separately.  This would complicate not only the signing process, but the verification process as well.


Trying to firewall ports 1863, 5190 I'm using Debian's arno-iptables-firewall and I've configured it to only allow access on the ports I need.

But nmap shows ports 1863, 5190 open. What gives? How can I interrogate those ports further?

As I said, I'm actually using arno-iptables-firewall, but as that is difficult to 'debug' (it is very complex), I'm providing an example of the problem with a very simple demo 'firewall' (without arno), which should do the job, but apparently isn't:

$ iptables -A INPUT -p tcp --destination-port 1863 -j DROP
$ iptables -L -n
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
DROP       tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:1863

Chain FORWARD (policy DROP)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Then nmap example.com -p1863 (from another host) still shows

host is up (0.019s latency).
PORT     STATE SERVICE
1863/tcp open  msnp

Very confused.

UPDATE: OK nmap from different hosts says different things(!). nmap from somewhere else on internet (but within the same VM hosting company's network) shows the ports closed, as they should be, and telnet from these hosts does not work. But from my office ADSL connection, the ports are open and telnet connects (then gets 'closed by foreign host' shortly after).

CONCLUSION: Having now tested from 6 places on the internet, I can only reproduce this behaviour from my office ADSL. I conclude that it is an issue with local routers or our ISP. Thank you to everybody who helped me dig deeper into this issue - I learnt a lot!

In your example it looks like you're trying to config iptables which is different than Arno IPTables. Check out this link for more info on the different types of firewalls.

To see the iptables rules you're running you can type (which you're already doing):

iptables -L

To block the ports you've listed specifically in iptables, since they're both typically TCP traffic, you can use:

-A INPUT -p tcp --dport 1863 -j REJECT
-A INPUT -p tcp --dport 5190 -j REJECT

Warning: Make sure you're leaving your access open before running something like this, but to reject all non-allowed inbound traffic with iptables you would use:

-A INPUT -j REJECT
-A FORWARD -j REJECT

The trick with iptables is that you'll need to actually save the ruleset since anything that you type via command line is usually flushed on restart.

Arno's IPTables Firewall

For Arno IPTables you can reference the file /etc/arno-iptables-firewall/firewall.conf for additional configuration beyond the scope of the debconf dialogs. To start/stop/restart the firewall from the shell, use the command /etc/init.d/arno-iptables-firewall [start|stop|restart]

According to the firewall.conf file:

  Put in the following variables the TCP/UDP ports you want to DENY(DROP) for
  everyone (and logged). Also use these variables if you want to log connection
  attempts to these ports from everyone (also trusted/full access hosts).
  In principle you don't need these variables, as everything is already blocked

  (denied) by default, but just exists for consistency.

DENY_TCP="" DENY_UDP=""

If Arno IP Tables is running, in theory those ports should already be blocked. Since they appear as though they're not blocked you may only be running iptables.

You can double-check the ports with netcat or try to telnet to them to see if it's a false positive from nmap.

Netcat example:

nc -z your_server 1-6000

For telnet it if the ports are blocked, they'll say:

> telnet your_server 1863
telnet: Unable to connect to remote host

If the ports are still open, then you'll see:

Connected to your_server

This will be followed by the server response.

You should be able to see what's running by typing top.


Caller ID Spoof and Text Spams – How do they work? A lot of people will have at some point received a spam text offering some sort of help via a debt settlement order, or help claiming for an accident that they have never had. I’ve noticed these are prevalent in both the US and UK, and expect other nationals will have similar stories.  For those that haven’t, you receive a text message out of the blue from a seemingly ‘personal’ number, and are then encouraged to “text YES if you’re interested, or NO to stop”. It’s clearly a sham, but some people are inevitably drawn in.

After receiving one myself, I blogged about it (warning people not to reply), and within a month it was getting 1000+ hot and 50+ comments per day (staggering for a small independent blogger like me) – most respondents posting different originating numbers.

I’m keen on doing a follow up story, so, really, my broad question is, how on earth do they work? What I know is based on a lot of guesswork and assumptions, and may be wildly erroneous so something more concrete would be marvellous.

As far as I can tell, when you reply to a message it gets added to a database somewhere, and the record is sold to a company offering that line of business.

My research has lead me to one company (leadex.com – [deliberately unlinked]) that appear to specialise in this sort of harvesting. I’m guessing that their clients have some sort of online alert configured, upon which their operatives can then take action (i.e. call the number). Moreover, I’ve encountered some projects on freelancer.com, posted by people/companies that seem to want this sort of infrastructure set up (click for example project)

I’ve also come to understand that it’s possible the messages themselves are being sent from a single source, which is itself spoofing the numbers to ones that the company is able to monitor. Respondents to the article have also reported that when they call the number it goes through to a standard network provider voice mailbox.

But, I’m still not entirely sure. Can anyone help?

What sort of equipment, infrastructure, software, etc will they require?
How are they able to obtain such large batches of numbers – do the network operators sell them in this way?
Given that they these ‘batches’ of numbers, so how are they able to setup and monitor them (is everything redirected to a single source).
How permanent/transient is this setup? I.e. are numbers only ‘Live’ for a short period of time.

And absolutely anything else, which might be of relevance/interest

I’ll be linking back to this question from the post, and including any relevant links that people include as well – happy to link to personal blogs as well.

I got one of these messages the other day and so did a few of my friends, so I know exactly what your talking about. I did not txt back and as I'm sure you know you shouldn't txt back unless you know its a legitimate service. Unfortunately one of my friends did txt back saying STOP and now he's getting loads of spam messages as they know his phone is active.

I previously worked for a phone company, so I have an idea of how a lot of this stuff is pulled off.

The answers to your questions all really depend on what scam they are trying to pull. Are they just interested in getting a list of active numbers for a sucker list of future scams or are they trying to actually scam them using this message.

What sort of equipment, infrastructure, software, etc will they require?

You can spoof a CallerID to perhaps persuade the user that you are someone that you are not by using a voip account and a server running Asterik. See this article Caller ID Spoofing w/ Asterisk

How are they able to obtain such large batches of numbers – do the network operators sell them in this way?

Depending on the numbers if they are actually mobile numbers and they need a reply as part of the scam, its more than likely that they have just got a hold of a load of SIM cards you can buy them in bulk from eBay and other places. Just have a google you can get sim cards for less than 50p a go.

Given that they have these ‘batches’ of numbers, how are they able to setup and monitor them (is everything redirected to a single source).

Asterik again can be used to handle large volumes of numbers. They may also use a third party to redirect their calls.

How permanent/transient is this setup? I.e. are numbers only ‘Live’ for a short period of time.

Dependant on how they get the numbers its most likely they will only be live for a short period as the network providers are usually quite hot on cutting off scammers.


Encrypt files on FTP server I have a practical situation here, my company is a FTP server provider for some clients. The clients are sharing their files on our FTP server and have had no problem with access management and privacy policies so far.

Recently, our clients want to encrypt their files for one reason: " They don't want FTP server admin has access to their files".

Also, our company wants to enhance our FTP authentication method with digital signature.
I know we can implement PGP encryption for sending file to FTP server, but the problem is when encrypted files receive, they will be decrypted by server with its private key and then the Admin have full access to those files.

By deployment of Public Key Infrastructure, each client needs to have a smart card in order to log-on to FTP server with digital signature. But it is not possible for our clients to encrypt their files based on receiver's public key. Because there might be a situation that there is several file recipients and one should encrypt a single file using dozens of public keys which takes forever!

So, My question is: "Is there a solution to encrypt files on FTP server which can be deployed in this situation?" Any help would be greatly appreciated.

Recently, our clients want to encrypt their files for one reason: " They don't want FTP server admin has access to their files".

With this requirement the encryption should not be done at the server side. Otherwise an administrator could just grab the content before it gets encrypted. And of course the management of the passwords/keys should also be accessible to the client only.

This leaves only encryption at the client side. There are several solutions for it, like password protected archives etc. Or, one could use PGP and help clients by setting up a private PGP key server to make exchange of public keys easier. The keys itself should of course by generated by the client itself and the private key should be kept at the client side.


Is it safe to store secrets in LDAP? Many systems store secret or sensitive information in LDAP attributes. For example, IEC/TS 62351-8 prescribes storage of user tokens in LDAP.

Is it safe to store secret or sensitive information as an attribute in LDAP? Can LDAP be configured in such a way as to make it secure?

It is as safe to store a secret in LDAP (using Access Control Lists) as it is in say a database with row security or a file system with access control lists

The secrets won't be encrypted, so they can be viewed by a superuser. But they are protected from other users

You would need to use end-to-end encryption to hide secrets from a superuser

Passwords are generally hashed in LDAP


Test if an email address is spammer's How can I test if an email address is a spammer's?

I received a reply to my Craigslist post, with a gmail address in the email body.
Craigslist uses some way to hide my email addresses, if I choose to reply directly.
But I replied to the gmail address provided, and immediately got an email which I recognized as spam.
At the same time, I regret having revealed my true email address.

Now I received another reply to my Craigslist post, with a different gmail address provided in it. I replied via Craigslist, and have not received anything yet.
I wonder how I can test if the gmail address provided is spammer's?

Thanks.

There have been experiments with mail services, where the recipient must complete a CAPTCHA before reading your message and revealing your true identity and e-mail address.

Google has had a "mailhide" API up and running for website developers, but I haven't looked into a way to be useful to end users.

To answer your question directly - unfortunately, I do not think there is a direct way of finding out whether an e-mail address is used by spammers or can be trusted. If you receive an e-mail and look up the headers and sender identity, then you can lookup their reputation based on IP address, domain SPF and other criteria, but it isn't a guarantee. That's probably one of the reasons why we have been having this cat-and-mouse game with spammers for years - reputation is based more or less on the domain name rather than the reputation of an individual e-mail account.

The trust domain for e-mails has typically been that if you are sending a message to an e-mail address, then you implicitly trust that the address is genuine, whereas the focus has been more or less on filtering the incoming messages (spam filters, junk mail folders, etc.). Maybe it's a great feature that we're missing in our e-mail clients and servers?


Pre-filling username for access to online web application When sending web application users a reminder email, is it reasonably safe to include a link in the email to take them to the web application sign in form whereby the link has their username as a parameter? This is to save the user having to enter both their username AND their password.

Our team's current thinking is this should be fine so long as the password used is of sufficient length and complexity.

I can't see any problem with including the username within the email.

However, it's generally considered bad practice to include a link to a login form in an email as it trains users to click through links given in an email which may be phishing attacks.  Secondly, it may make your (actual, legitimate) email look like phishing/spam to some filters and/or skeptical users as in this article by Sophos.

Best practice is to tell the user to type in your address at the url bar; this ensures that the user actually goes to your website and none other.


Can an application modify files that are in a password protected folder? Specifically regarding Win 10 and this method of password protecting a directory.

Would a malicious application be able to modify files placed in this directory or would it be stopped?

Thanks for your time!

Yes, absolutely, a malicious application could easily modify the files placed in a directory “protected” like this. The reason for this is that the method outlined in the article, doesn’t provide any protection whatsoever. All that’s happening here, is that when you ‘protect’ the folder, you set a marker that prevents windows from showing the files (it sets the ‘system’ and ‘hidden’ attributes). After you enter the correct password, this 'marker' is removed again.

This gives the illusion of protection because by default windows is set up so that ‘hidden’ and ‘system’ files are not shown to the user.

However, in fact your files are not protected at all – they remain accessible all along. Applications completely ignore the system & hidden setting. Users can enable "show hidden files" and disable "hide protected operating system files" to make the files appear again. Once this is done, they can use the files at will, completely bypassing the password protection in literally a few clicks.

Properly password protecting files without additional software so that no one (whether human or application) can access/modify them (without the correct password) is a feature that Windows simply doesn’t have, so the only way to actually password protect your files is to use additional software. If you are looking for an easy-to-use solution, I would suggest Safeplicity (https://www.safeplicity.com), but I am biased, so don’t take my word for it and be sure to check out some alternatives. If you’re looking for a free open-source solution, VeraCrypt is probably the best.

One last word of caution: when choosing the software, make sure that it not only password protects your files, but also encrypts them. Password protection without encryption (like the one suggested in the article) can be bypassed by any computer-savvy person (or well written app) with ease – we have seen many lives ruined because of this. Password protection with encryption cannot be broken by anyone (unless you believe in conspiracy theories).


Memory address problem in GNU Debugger I'm new to gbd. I've wrote a simple program which will print hello world 10 times(I've listed the program in the screenshot). Then I've  displayed the assembly language and set the break point to main and after running the program untill main, I've displayed the content of the rip register.
Now the confusion is, in the assembly code, the memory addresses are 0000...and then some number, but in the rip register the addresses are 55555...and then some number. For example in the line 4, containing mov instruction, the adderss is 0x000000000000113d and in the rip register the address is 0x55555555513d. I'm assuming those two addresses are same based on the common ending (13d), although not sure. But the previous digits are different. Why?

This is because your program was compiled as a position independant executable (PIE). Instead of the addresses being hardcoded into the binary, they are only stored as offsets from 0, which explains how you are seeing addresses such as 0x000000000000113d. At runtime, a randomized base address is generated, and all sections of the executable will exist at offsets from that base.
When you are running disassemble main, gdb is disassembling the executable itself without taking into account the runtime addresses. In fact, there are no runtime addresses yet since you haven't started the binary. If you want to see the actual addresses, you will need to try to disassemble again after execution has started.


Why does openssl enc -aes-256-cbc -a -salt increase the file size? I'm using openssl enc -aes-256-cbc -a -salt for automated differential backups to Amazon Glacier. But I noticed that using this command increases the file size almost perfectly by 35%.
In my understanding, a block cipher shouldn't change file size this much, with my current knowledge I know it adds at most 16 bytes to the end to create the padding. But that doesn't account for 17MB+ on my backups.

What is causing this increase in size?

Log lines:

09:09:16 Created tarbal of 165 files of size            106M
09:09:50 Created /archief/2014-05-10.encrypted of size  143M

09:09:11 Created tarbal of 186 files of size            132M
09:09:52 Created /archief/2014-05-17.encrypted of size  179M

The main increase is the -a flag which means it base64 encodes your ciphertext.

From man enc:

NAME
   enc - symmetric cipher routines

SYNOPSIS
   openssl enc -ciphername [-in filename] [-out filename] [-pass arg] [-e] [-d] [-a] [-A] [-k password]
   [-kfile filename] [-K key] [-iv IV] [-p] [-P] [-bufsize number] [-nopad] [-debug]

   [...]

   -a  base64 process the data. This means that if encryption is taking place the data is base64 encoded
       after encryption. If decryption is set then the input data is base64 decoded before being
       decrypted.

Base64 encoding means that for every three bytes of binary data (a byte is an 8-bit number meaning it has value 0 to 28-1=255) you have are encoded in four bytes of 6-bit data (with value 0 to 26-1=63, though represented in printable ASCII symbols).  Base64 is convenient as the symbols for the 64 values can be chosen to be printable ASCII characters (e.g., typically 0='A',1='B',...25='Z',26='a',...51='z',52='0',...,61='9',62='+',63='/' though the last two often are defined differently in different variants).  Note three bytes 8*3 has 24 bits, as does four groups of base64 encoded numbers 6*4.

For example if your ciphertext was three bytes (in hexadecimal): f0 bb 5c (240, 187, 92) in binary the bits grouped into three bytes would be:

 11110000 10111011 01011100

in base64 it would be the same bits, except grouped into four groups of 6 bits:

 111100 001011 101101 011100

which map to the values 60, 11, 45, 28, which on a typical base64 table would map to the printable ASCII characters 8Ltc which will take four bytes on the disk (instead of the three bytes it would have taken without base64 encoding).

Thus base64 encoding should account for roughly a 33% file increase.  It's slightly more than that as openssl also adds a newline characters every 64 characters of base64 encoded ascii (so the text wraps at 64 bytes).  These two features together account for a general file size increase of (4/3 * 65/64 - 1) = 35.4%

There's also a bit of overhead from your scheme.  Specifying -salt takes your plaintext password and concatenates a random eight byte salt to the message along with a header Salted__ specifying that a salt was used, and these will also be base64 encoded.  (The purpose of the salt is to make it less cost-effective for an attacker to pre-compute rainbow tables for common passwords).  If I encrypt a random file in your scheme (specifying the salt as DEADBEEFDEADBEEF using openssl enc -aes-256-cbc -a -salt -S DEADBEEFDEADBEEF the first row of my encrypted file was

U2FsdGVkX1/erb7v3q2+7ybJfdPaLlVzOp7lKpOljvNK8ONCrgFrQpaJHQ8EqO1X

which decodes to (using python):

>>> import base64
>>> base64.b64decode("U2FsdGVkX1/erb7v3q2+7ybJfdPaLlVzOp7lKpOljvNK8ONCrgFrQpaJHQ8EqO1X")
'Salted__\xde\xad\xbe\xef\xde\xad\xbe\xef&\xc9}\xd3\xda.Us:\x9e\xe5*\x93\xa5\x8e\xf3J\xf0\xe3B\xae\x01kB\x96\x89\x1d\x0f\x04\xa8\xedW'

So combining the base64 encoding, the linebreaks, the salt, the initialization vector (for CBC mode), and the padding (to be evenly divisible to be 128-bit blocks for AES), an overhead of ~35% seems perfectly reasonable.

EDIT: Actually, openssl doesn't store an initialization vector when deriving a key from a password with a salt.  From man enc:  "When a password is being specified using one of the other options, the IV is generated from this password.".  Using this and doing a couple test files, the file sizes match up perfectly.  The salt 8 bytes plus Salted__ adds 16 bytes to the file.  The file is padded to be a multiple of 16 bytes (adding at most 16 bytes).  If you don't base64 encode the file size match up perfectly, and then you can get a file that exactly matches the base64 version if you then apply base64 --wrap=64.


How is the correct key chosen when decrypting OpenPGP messages? I own multiple PGP key pairs and receive a PGP-encrypted email. How
does PGP know which key has been used for encryption, i.e., which key should be used for decrypting the email?

The key used for encryption is stored in the OpenPGP message's meta data, so your implementation of OpenPGP can just look up the proper key in the message. Unless the "hidden recipient" feature is used by the sender, in which case the application will just try through all available private keys until it finds the matching one (the OpenPGP CFB mode includes mechanics to understand whether the decryption was successful).


Achieve total anonymity on public wifi using Android Would this be enough to achieve total anonymity on public wifi with an Android device:

use Orbot
spoof your MAC address
turn off location services
turn off cellular data

Are there any other services that should be disabled?  For example under 'Running services,' I see 'Android Core Apps,' 'Google services,' etc.

How would we do the following:

turn off GPS (I can ask this question on the Android exchange if this doesn't belong here)
emergency calls, such as 911, can be use without cellular data.  Is emergency call tracking information continuously transmitted?  If so, is there a way to turn it off?

First, with your phone manufacturers OS you can never be sure what is running and which applications send data where.

So as a first step you have to install a operating system where you can know what is inside. The best choice would be Replicant because it is 100% free software and you can get the source code for all parts of it.

Because Replicant supports a very limited number of devices, you might have to resort to LineageOS. Some parts of it are non-free, so you can never be 100% sure what it does, but still a lot better than your stock OS. Under no circumstances install the Google Apps package!

Then you switch the phone to flight mode and disable GPS and WiFi location services. Then you switch your MAC address and then enable only WiFi.

You can then surf the internet with Orbot and Orfox somewhat safe.

This will prevent websites from knowing where you are. Of course you still have to be very careful to not enter any personal details in any form on a website. Also, of course, you can only use Orfox to browse the web, never download any other apps and run them.


How to overwrite ebp on stack alignment? I want to exploit a simple program

#include <stdio.h>
#include <string.h>
int main(int argc, char** argv)
{
    char buf[128];
    strcpy(buf, argv[1]);
    return 0;
}

The disassembly of main:

push %ebp
mov %esp, %ebp
and $0xfffffff0, %esp
... (and the rest follows)

My question is since esp's last 4bytes are getting null-ed, the actual location of the ebp with respect to buf[]'s starting address becomes RANDOM. So how am I supposed to know exactly after pushing how many characters I am supposed to reach ebp? &buf[0] on my computer is showing 0x2c(%esp) and the stack frame is occupying 0xb0 bytes. But just with this "fixed" information, how am I supposed to reach ebp? There remains a missing element...the initial content of esp. Please help me exploiting this basic program.

I wrote that exact code into an overflow.c file, and got the following main().  I disassembled with objdump --disassemble overflow
0804846d <main>:
 804846d:       55                      push   %ebp
 804846e:       89 e5                   mov    %esp,%ebp
 8048470:       83 e4 f0                and    $0xfffffff0,%esp
 8048473:       81 ec a0 00 00 00       sub    $0xa0,%esp
 8048479:       8b 45 0c                mov    0xc(%ebp),%eax
 804847c:       89 44 24 0c             mov    %eax,0xc(%esp)
 8048480:       65 a1 14 00 00 00       mov    %gs:0x14,%eax
 8048486:       89 84 24 9c 00 00 00    mov    %eax,0x9c(%esp)
 804848d:       31 c0                   xor    %eax,%eax
 804848f:       8b 44 24 0c             mov    0xc(%esp),%eax
 8048493:       83 c0 04                add    $0x4,%eax
 8048496:       8b 00                   mov    (%eax),%eax
 8048498:       89 44 24 04             mov    %eax,0x4(%esp)
 804849c:       8d 44 24 1c             lea    0x1c(%esp),%eax
 80484a0:       89 04 24                mov    %eax,(%esp)
 80484a3:       e8 98 fe ff ff          call   8048340 <strcpy@plt>
 80484a8:       b8 00 00 00 00          mov    $0x0,%eax
 80484ad:       8b 94 24 9c 00 00 00    mov    0x9c(%esp),%edx
 80484b4:       65 33 15 14 00 00 00    xor    %gs:0x14,%edx
 80484bb:       74 05                   je     80484c2 <main+0x55>
 80484bd:       e8 6e fe ff ff          call   8048330 <__stack_chk_fail@plt>
 80484c2:       c9                      leave
 80484c3:       c3                      ret

Unfortunately I don't think there is a way for you to know how much the stack is going to be aligned at that point. You do know that it won't be more than 16 bytes. A dirty solution would be to write the 0x84 bytes to reach the alignment section. Then write the 4 byte value you want to overwrite EBP and/or the return address with 6 times. This would also smash the stack completely if the alignment was less than 16 bytes. But if you gain execution you could fix it up to a working state in your shellcode.

To go a bit further lets perform this same operation in a different function.  Which would be a lot more likely of a scenario than a main().  So now we have the following:
  1 #include <stdio.h>
  2 #include <string.h>
  3
  4 int function(char **argv) {
  5     char buf[128];
  6
  7     strcpy(buf, argv[1]);
  8
  9     return 0;
 10 }
 11
 12 int main(int argc, char **argv) {
 13     return function(argv);
 14 }

Which disassembles to:
0804846d <function>:
 804846d:       55                      push   %ebp
 804846e:       89 e5                   mov    %esp,%ebp
 8048470:       81 ec a8 00 00 00       sub    $0xa8,%esp
 8048476:       8b 45 08                mov    0x8(%ebp),%eax
 8048479:       89 85 64 ff ff ff       mov    %eax,-0x9c(%ebp)
 804847f:       65 a1 14 00 00 00       mov    %gs:0x14,%eax
 8048485:       89 45 f4                mov    %eax,-0xc(%ebp)
 8048488:       31 c0                   xor    %eax,%eax
 804848a:       8b 85 64 ff ff ff       mov    -0x9c(%ebp),%eax
 8048490:       83 c0 04                add    $0x4,%eax
 8048493:       8b 00                   mov    (%eax),%eax
 8048495:       89 44 24 04             mov    %eax,0x4(%esp)
 8048499:       8d 85 74 ff ff ff       lea    -0x8c(%ebp),%eax
 804849f:       89 04 24                mov    %eax,(%esp)
 80484a2:       e8 99 fe ff ff          call   8048340 <strcpy@plt>
 80484a7:       b8 00 00 00 00          mov    $0x0,%eax
 80484ac:       8b 55 f4                mov    -0xc(%ebp),%edx
 80484af:       65 33 15 14 00 00 00    xor    %gs:0x14,%edx
 80484b6:       74 05                   je     80484bd <function+0x50>
 80484b8:       e8 73 fe ff ff          call   8048330 <__stack_chk_fail@plt>
 80484bd:       c9                      leave
 80484be:       c3                      ret

Since it's not a main function you don't have that pesky and esp, 0xfffffff0 operation in there.  You can perform your subtraction just like you normally would have expected.
I hope this answers your question.


What is the difference between the many identifiers in GnuPG? GnuPG seems to have number of different ways to refer to a (sub)key(pair):

Key IDs
Fingerprints
Keygrips

Additionally, gpg --list-sigs seems to show hexadecimal identifiers for signatures and such as well. Sometimes such IDs are abbreviated.

All of this is quite confusing, and I hope someone can shed some light on this.

What different types and forms of identifiers (key IDs, signature IDs, fingerprints, keygrips, ...) does GnuPG use? What is their format and purpose? Which of these can be used in abbreviated form? Are there any (security) reasons to prefer the use of one type or form to another?

Information regarding the key fingerprint/key id calculation is available in RFC4880 (and RFC4880bis). For RSA-only v3 keys (now deprecated), key id was low 8 bytes of RSA modulus, and fingerprint was MD5 hash of the key-specific data.
For v4 keys key id is rightmost 8 bytes of the fingerprint, which itself is SHA1 hash of some key-specific data + key material.
For v5 keys fingerprint will use SHA256 hash.
Key grip is used internally in GnuPG, and it is SHA1 hash of key material with some additional formatting, but without OpenPGP-specific data.
Grip is used to build filename of the secret key(s) in GnuPG keyring, and probably it's the only usable information about it :)


How to decrypt a file when I have its key? How could I decrypt a file (encrypted with AES-128) using openssl ?
I do not remember the passphrase I used to encrypt it, but I saved the key generated and used to encrypt my file. How could I use this key to decrypt my file ?

The quick answer is NO, you can not.
A detailed answer: On this official documentation, you can read:

  When only the key is specified using the -K option, the IV must
  explicitly be defined. When a password is being specified using one of
  the other options, the IV is generated from this password.

IV stands for Initialization Vector. You can understand quickly how it is used with the combination of the key within CBC algorithm as shown on this figure:


Why a salt?
In my mind, a salt is a little add to make more flavour. Normaly, the salt is stored in same database than the hashed value himself.
Adding a salt won't add security and won't minimise chance of collision. At all, if collisions are possible, they will just be moved! Don't think you may compensate bad hash method by adding salt!
If you combine first 3 fields with such a secret phrase, you'll be able to make the verification. But chance to obtain collisions are clearly related to number of rows. If your goal is to make hard to an hacker to build proper hash, you have to use a secret phrase. Mostly if you're awaiting for many row in your database!
More youre database is big more i'ts easy to crack them by brute force! So care about hash method!
Other ways
Using server feature, like mysql binlogs to report each operation in a secured backup server (could be a NAS in write only).
A simplier way could be to make secured differentials backups and watch about diffs transactions packets (backup procedure could be trigged very closely if whole database may stay in RAM.).
Or finally, you could add triggers to database engine to be alerted and watch for alterations on database files, by using system tools like FAM ou Inotify.


Is this attack vector possible? I had some suspicious pdf files on my linux computer. I opened it in firefox and Evince pdf reader and I forgot to use VM or any other sandbox. Is it possible the pdf to be infected with any kind of spyware and they infected my linux machine?

After that I downloaded a new linux iso and burned it on usb with unetbootin. Is possible for that virus to infect my new linux installation and my new machine to be with any spyware/trojan?

How can I scan my linux machine for spyware? I had all latest updates and installed and my linux was regularly updated.

Is this attack vector possible?

I would say it is possible because there is no 100% secure software. In this specific case you are using Evince which is using the poppler PDF library which had several security problems in the past and there is the chance that there are some unknown vulnerabilities either in evince or in poppler or the libc library etc. And while you probably did this as an unprivileged user there were privilege escalation attacks in the past in Linux and there will be probably more in the future. And once the attacker has access to the kernel space there is not much which will protect against full permanent system compromise, which might also include your downloads, downloaded keys for verification of downloads etc.

But a VM would not have fully protected you too because there were bugs in the past in XEN, VirtualBox, KVM/QEMU etc, i.e. every virtualization software.

  How can I scan my linux machine for spyware?

While I think that this attack is possible in theory I very much doubt that it can be easily done. Which means that this attack could only be done by a very knowledgeable attacker who will probably also be able to bypass any spyware scans, because such scans only employ some heuristics and can be tricked.

If you feel that your system is compromised in such a deep way you must be very paranoid. But if you deal with secrets some government or criminal organisations are very much interested in this paranoia might be justified. In this situation your only choice would probably be to throw away your existing system and get a new one. But remember, that the new system might also be compromised already by the vendor or gets compromised during delivery or that that data you restore from backup might already be compromised from earlier infection or that your router might be infected etc.

There is no such thing as 100% security and you have to find out for yourself how valuable your data or systems might be and how probable it is for you to be a victim of very targeted and expensive attacks. And if you just opened the typical PDF malware which uses bugs in Acrobat Reader then you are probably safe because it is highly unlikely that these attacks work against Evince too.

  I had all last updates and installed and my linux was everytime updated.

While it helps to have the latest updates you should understand that updates are often done because security problems where found. And often these security issues are used in exploits before the update gets released, i.e. often the update is only done because some new exploits where found in the wild which used previously unknown bugs. Thus having the updates only fixes against the problems which are already known and fixed and not against the unknown or unfixed problems.


Obtain NetNTLM/NTLM hash or login In one CTF, I encountered a task that is solved by getting NetNTLM \ NTLM or just getting username.

Tell me, please, is there any protocol that automatically sends NetNTLM / NTLM or username, when the connection is initialized?

The victim uses Windows 10.

UNC paths:

\\myserver\resource

The types of attacks that use this is sending a word document with an image embedded in it using a UNC path as the reference

\\192.168.0.1\image.jpg

Your machine will try to authenticate to the share to get the image and in doing so pass along the NetNTLM hash.


Enter as guest into another server folder I have a PC using Windows 7 in 192.168.0.10 where there is a folder, lets call Data, that i want to make avaliable for any computer connected to this network ( 192.168.0.X )

I have shared that folder to everyone and to the guest account.

The problem i have is that when i enter from another location, it always asks me for a user/password, and what i want is that when i type \192.168.0.10\ is that the system drive me directly to the folder Data.

Thx for help

Share permissions are different from NTFS (file system) permissions.  Check the NTFS permissions on your shared folder.  You might need to allow the Everyone NTFS group read access.


Is there a way to find the SSL certificate used for one specific browser-server SSL communication? Chrome has a history of HTTPS sites I have accessed, I would like to know if there is somewhere Chrome would have stored details about the SSL certificate used to establish the connections to the various sites?

Currently there is no way yet for a Chrome extension to get access to SSL fingerprint information. According to this SO thread support for this was recently added to Firefox 62 and there is code yet to be merged in Chrome to allow this.

Once this code is merged into Chrome it would be possible to update the enhanced-history chrome extension to store and display this information.


Is it okay to omit the 'Version:' line in a PGP public key? The software I use to generate my PGP keys doesn't include the 'Version:' line that most PGP software includes by default.

Almost every public key I've seen begins like this:

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.9 (GNU/Linux)

But mine doesn't contain the Version: line.

Will this cause any problems (compatibility/decryption/etc. issues)?

The Version header is purely informative; my guess is that it's included to make compatibility bugs easier to discover (e.g. if a client is unable to decrypt 10 messages, and all 10 were made by the same version).

Source: https://superuser.com/a/823907


How to subscribe to information about new vulnerabilities in selected products? In order to be informed about critical vulnerabilities in selected products I'd want to subscribe to some list about them. I'd want to configure the list of products by myself.

The question: Where can I get security breach alerts? gives information on general lists, however these provide vulnerability information across all products the list knows about, and all I want to see are advisories about the products/applications/services in my network.

Can I subscribe to CVEs for specific products?

Go to CVE Details' Product or Vendor pages. There is "Vulnerability Feeds & Widgets" link there.

It allows you to subscribe to CVEs about selected vendor/product.


If perl/python is not guaranteed to be installed on a target system why are those scripts useful to hackers? If you don't install perl/python on your system then hackers can't use it (or they would make themselves obvious if they installed it)?
I am just trying to understand why these languages are apparently useful for hackers. Seems bash/dos would be more useful.

Not every attack requires running Perl/Python scripts on your machine. Exploiting buffer overflows, SQL injection via a network interface and others have no requirement for Perl/Python. Using those languages can make creation and delivery of the payload much easier
Yes, an attacker could install their own interpreter. Depending upon the level of compromise (rootkit) and the common usage of the system (prod vs test) the installation may or may not be detectable and may or may not be dismissed if detected
These languages were once the new, hot, sexy thing to learn, much like ruby and jquery are now. Many security experts wanted to learn these languages and so used them to create tools.
Today, there are multiple tools that use these languages. This creates some amount of momentum to continuing to use these interpreters.
These interpreters are pre-installed on many operating systems and run pretty consistently on different platforms. This makes development, test, and reuse easier. It also makes exploit easier when victim systems already have the interpreter installed.
These interpreters have many highly useful libraries that provide extremely useful functionality. This makes tool development much easier. Tis functionality may not be as easily available with sh/dos. Especially so, consider that sh/dos relies on other programs to do most of the work, and can provide minimal builtins.
Dos provides very limited scripting capability. It's very difficult to do something really complex with a dos script.
Just like your interpreter of choice may or may not exist, the same may be said of almost any other software. Unix systems don't actually require a shell to operate. Missing the shell makes it more difficult to maintain, but it will still run.
In situations where an interpreter is used on a system, both the interpreter and script may contain vulnerabilities. Hackers may enjoy exploiting these preinstalled vulnerabilities. Well known vulns make it even easier.

There are probably other considerations that make your common interpreter of choice no worse than and probably better than sh or dos, but I am too lazy to write more.


Cookie without secure flag but with httponly I have a cookie that is httponly but without the secure flag. Under this condition, can an attacker capture the cookie, although the site is only on HTTPS?

You should still set the secure flag, even if your site is only served over HTTPS. A single unencrypted HTTP call is all it takes to leak a cookie, and it can even be to an endpoint that doesn't exist or isn't served over plain HTTP. The only way to prevent all such calls is to use HSTS with preloading. And even then, setting the secure flag costs you nothing, so why not do it?

As for the HttpOnly flag, it is for protecting cookies in case of an XSS vulnerability. It is completely unrelated to the secure flag or any other issues related to HTTPS. It does not protect you against MITM attacks, which is what the secure flag is meant to protect you from.


Does password protecting an archived file actually encrypt it? For example if I use WinRAR to encrypt a file and put a password on the archive how secure is it? I keep a personal journal and am thinking of doing this, or is there a better way? It's just one huge .docx file.

Summary: yes, but use VeraCrypt instead.

From the documentation:

  WinRAR offers you the benefit of industry strength archive encryption using AES (Advanced Encryption Standard) with a key of 128 bits.

So yes, the data is encrypted. This is only one of the elements of security, however. Another important element is how the key is derived from the password: what kind of key strengthening is performed? The slower the derivation of the key from the password, the more costly it is for an attacker to find the password (and hence the key) by brute force. A weak password is toast anyway, but good key strengthening can make the difference for a reasonably complex but still memorable password. WinRAR uses 262144 rounds of SHA-1 with a 64-bit salt, that's good key strengthening.

An academic paper has been written on the security of WinRAR: On the security of the WinRAR encryption feature by Gary S.-W. Yeo and Raphael C.-W. Phan (ISC'05). Quoting from the abstract (I haven't read the full text, it doesn't seem to be accessible without paying):

  In this paper, we present several attacks on the encryption feature provided by the WinRAR compression software. These attacks are possible due to the subtlety in developing security software based on the integration of multiple cryptographic primitives. In other words, no matter how securely designed each primitive is, using them especially in association with other primitives does not always guarantee secure systems. Instead, time and again such a practice has shown to result in flawed systems. Our results, compared to recent attacks on WinZip by Kohno, show that WinRAR appears to offer slightly better security features.

The advantage of using the encryption built into the RAR format is that you can distribute an encrypted RAR archive to anyone with WinRAR, 7zip or other common software that supports the RAR format. For your use case, this is irrelevant. Therefore I recommend using a software that is dedicated to encryption.

The de facto standard since you're using Windows was TrueCrypt. TrueCrypt provides a virtual disk which is stored as an encrypted file. Not only is this more secure than WinRAR (I trust TrueCrypt, which is written with security in mind from day 1, far more than any product whose encryption is an ancillary feature), it is also more convenient: you mount the encrypted disk by providing your password, then you can open files on the disk transparently, and when you've finished you unmount the encrypted disk.
Sadly TrueCrypt is no longer in active development but it's successor VeraCrypt is. VeraCrypt is based on TrueCrypt and is compatible with the old TrueCrypt containers.

  Out of curiousity can what someone writes in their journal be used to incriminate someone in court?

This depends on the jurisdiction, but in general, yes, as they say in the movies, anything you say or write can be used against you. You may be legally compelled to reveal encryption keys, and may face further charges if you refuse.


Twofish gpg:WARNING: message was not integrity protected I get this warning while I decrypt a Twofish-encrypted file in GPG.

  WARNING: message was not integrity protected.

From what I found online, this warning should only come up for CAST5, not for AES256 or Twofish. Why does this occur? And is there a way to prevent this warning?

I use GPG on Ubuntu 12.04 GNU/Linux.

How was the file encrypted? OpenPGP provides an option to integrity protect your ciphertext, called MDC.  Please note this is not the same as MAC or a signature.


What is this compromised-looking result under the google.co.uk main search result? I noticed this where it used to say something about the search engine.
I noticed it when searching for "google".

Has Google been compromised or something? I am not going to click this link to see what it is.

I think it's kind of Easter Egg of Google.
If you change language code in hl parameter to xx-hacker then you will get 1337 speak at many places on result.
It's safe


Decoding SMS in Chinese extracted from a Blackberry I have a bunch of SMSs in Chinese from a forensic extraction of a blackberry bold 9780  via Cellebrite UFED. While messages in English are clear-text readable (making me feel that this has nothing to do with encryption), I simply cannot represent these (Chinese) messages. It's obviously a problem with UFED's analysis software in the long term, but in the short term, I just want to know how I can make these messages readable. These Chinese texts are readable on the phone itself, but I don't have that anymore.

Here's three texts (via an export to html):

N mwyûR¨geu5cÐN:`¨g R¡ÿ�0�0�9�0�5�3�2�2�1�3�0�0�8�9S÷xW(�2�0�1�3^t�0�3g�0�6eå�2�3�:�3�8bèbSÇ`¨vbKg:ÿ÷SÊeöVÞu50

Y)s+UFWÎmilýQÀl4VheàPOS[cÿQí¤Áx�8�0�1�1bèbS�4�0�0�8�2�0�2�6�6�7bSÖN÷P<�2�5�8�0QCQÀl4VhN�Sð00milýs¯OÝ0

�(�1�/�3�)NûOUbRONýDg,g`gFÿN mwN¤Y'mwY[fbê�0�6^t_�R0 yÁRß¡gCNN ^D`;Ásí0NågeÇ|û~ßþz¾nÿNÎUFN0N¤Y'mwY0

Can anyone decode the three messages above? I will give you a million props if you can tell me how.

The source data is clearly UTF-16. In your post it is displayed interpreted as ISO-8859-1, and has become slightly mangled in the process - some bytes have been converted to �.

There are also either some missing bytes caused by the copy-paste, or there are some control bytes in the middle of the sequence, which disrupt the two-bytes-per-character flow. Hopefully the former - can you post the raw bytes (eg as hex dump)? If this is the case, you should be able to just decode them as UTF-16 (probably UTF-16LE).

For what it's worth, trying to recover the original bytes, with � interpreted as null (as the most common byte in UTF-16) using Python:

>>> data= ur'''N mwyûR¨geu5cÐN:`¨g R¡ÿ�0�0�9�0�5�3�2�2�1�3�0�0�8�9S÷xW(�2�0�1�3^t�0�3g�0�6eå�2�3�:�3�8bèbSÇ`¨vbKg:ÿ÷SÊeöVÞu50\0\0Y)s+UFWÎmilýQÀl4VheàPOS[cÿQí¤Áx�8�0�1�1bèbS�4�0�0�8�2�0�2�6�6�7bSÖN÷P<�2�5�8�0QCQÀl4VhN�Sð00milýs¯OÝ0\0\0�(�1�/�3�)NûOUbRONýDg,g`gFÿN mwN¤Y'mwY[fbê�0�6^t_�R0 yÁRß¡gCNN ^D`;Ásí0NågeÇ|û~ßþz¾nÿNÎUFN0N¤Y'mwY0'''
>>> bytes= data.replace(u'\uFFFD', u'\0').encode('iso-8859-1')
>>> print bytes.decode('utf-16le', 'replace')
>>> print bytes.decode('utf-16be', 'replace')

Then pick the characters you find most fitting from each line of:

⁎睭ﭹꡒ敧㕵큣㩎ꡠꅒÿ0090532213008匹磷⡗㈀　㄀㌀瑞　㌀g0收å23:3戸拨읓ꡠ扶杋Ｚ号旊囶痞〵ぜぜ⥙⭳䙕칗業ﵬ쁑㑬桖佐孓｣솤x801戱拨S400820266户홓㱐㈀㔀㠀　䍑쁑㑬桖N〰業ﵬ꽳�尰尰0(1/3丩俻払佒﵎杄本杠ｆ⁎睭ꑎ❙睭孙扦ê0帶彴刀‰셹�枡乃⁎䑞㭠珁ロ敧糇绻ﻟ빺ｮ칎䙕ぎꑎ❙睭す
丠海移动来电提为您朠务＀　　㤀　㔀㌀㈀㈀㄀㌀　　㠀㥓在2013年03最　㙥㈀㌀㨀㌀㡢叇您癢䭧㫿쩥�㔰尰尰天猫商城浩泽净水器无偏卛揿凭꓁砀㠀　㄀ㅢ匀㐀　　㠀㈀　㈀㘀㘀㝢取价值2580元净水器一台〰浩泽环保ぜぜ　⠀㄀⼀㌀⥎ﭏ啢剏份䑧Ⱨ恧䛿丠海交大海奛晢　㙞瑟R〠私募ꅧ䍎丠幄总셳以来일ﭾ�窾滿从商丰交大海夰

eg something like:

丠海移动来电提为您朠务0090532213008匹在2013年03最0623:38戸Ｚ号旊囶痞㔰尰尰天猫商城浩泽净水器无偏卛揿凭x801戱拨S400820266户取价值2580元净水器N浩泽环保0(1/3啢剏份杄本杠䛿丠海交大海奛晢0帶彴刀私募枡乃⁎䑞㭠珁ロ以来敧糇绻窾滿从商丰交大海夰

which is as near as I can get to intelligible given the mangled input.

ETA:

  Here's a hex dump of a longer SMS:

OK this is straightforward, it's UTF-16BE (with a couple of lead control bytes and some trailing ones):

>>> print '0848674376CA90FD4E0D80FD4FDD969C76845BA26237300262404EE573B05728770B6765FF0C516C53F85B81613F9AD86210672C9AD84E8E6052592971364EF7683C53BB57F9517B6276630151764ED676844F9B5E945546FF0C4ECE957F671F770BFF0C7EE77EED51CF5C11548C605259297136768454084F5C657091CF548C53606BD43002000000084900'.decode('hex').decode('utf-16be')
ࡈ权益都不能保障的客户。所以现在看来，公司宁愿高成本高于恒天然价格去培养扶持其他的供应商，从长期看，继续减少和恒天然的合作数量和占比。䤀

  The corresponding encoded/analyzed SMS.Body was:

OK, so that is another string of UTF-16BE bytes that has been interpreted as ISO-8859-1. Recovering the control characters from your post we get:

>>> u'q\x8ae\x87cw:N\nk!u5\x8b\xddN_T\x8cO`\x8b\xf4N\x86\xff\x0c`RY)q6v\x84\x88LN:\x8b\xa9QlS\xf8\x8b\xa4N:\xff\x0c`RY)q6N\nf/b\x11N\xecv\x84b\x18ueT\x08O\\O\x9b^\x94UF\xff\x0cZ\x03T\xc8T\xc8[\xf9`RY)q6ge\x8b\xf4\xff\x0cN\xc5N\xc5f/NN*fn\x90\x1a[\xa2b7\xff\x0c\x80\x0cN\x14f/kc^8gCv\xca\x90\xfdN\n\x80\xfdO\xdd\x96\x9cv\x84[\xa2b70\x02b@N\xe5s\xb0W(w\x0bge\xff\x0cQlS\xf8[\x81a?\x9a\xd8b\x10g,\x9a\xd8N\x8e`RY)q6N\xf7h<S\xbbW\xf9Q{bvc\x01QvN\xd6v\x84O\x9b^\x94UF\xff\x0cN\xce\x95\x7fg\x1fw\x0b\xff\x0c~\xe7~\xedQ\xcf\\\x11T\x8c`RY)q6v\x84T\x08O\\ep\x91\xcfT\x8cS`k\xd40\x02\n'

Undoing the misdecoding:

>>> print _.encode('iso-8859-1').decode('utf-16be', 'ignore')
熊文捷㩎੫ⅵ㖋彔豏悋蛿ౠ剙⥱㙶蒈䱎㪋ꥑ汓ꑎ㫿ౠ剙⥱㙎੦⽢ᅎ葢ᡵ敔ࡏ屏魞鑕䛿ౚ͔졔졛怒剙⥱㙧斋౎앎앦⽎
个普通客户，而且是正常权益都上能保障的客户。所以现在看来，公司宁愿高成本高于恒天然价格去培养扶持其他的供应商，从长期看，继续减少和恒天然的合作数量和占比。

As you can see, the second part of this string is the complete message of which the above was a partial hex-encode.

The first part (before the 个普通客户...) is a mystery. It decodes as valid UTF-16LE (ie no need to 'ignore'), which would normally be an indication that the byte alignment had slipped (again, maybe as a result of character mangling from posting it to SO?). The result of this decoding even fits mostly inside the han character block, but it is:

話蝥督为權甡謵仝呟侌譠仴ﾆ怌奒焩瘶袄乌謺冩卬诸交Ｚ怌奒焩丶昊戯丑盬抄甘呥伈作庛喔ｆ娌吃哈寈惹奒焩朶譥丌仅曅丯

which from my limited understanding of Chinese text appears to be gibberish.

I'm not too impressed with this Cellebrite thing, especially if it is including those control codes directly in XML! (This is not well-formed.)


How secure are the new TLDs ( .us, .io, ...) and do they compare to .com? The introduction of the new top level domains (TLDs) such as .music, .books, etc. will increase the number of people and organisations adding and removing entries into the root DNS servers (.) for their own TLD.

Given the TLDs "me." and "in.", this means they will have different protections in place to create and manage subdomains ( myna.me. , bitco.in. ).  Sure the root servers have an established protocol to work with TLDs, but what's to say that the TLDs ability to interact with the root servers hasn't been spoofed or intercepted by an adversary.

Question

The risk I'm concerned about is, what is to prevent a malicious actor from adding or removing NS hosts?  If a hacker could add a rogue NS for a TLD, that would obviously give the attacker complete control over all subdomains, the DNSSec records, and many other aspects of security including SSL.

There are other security issues to be concerned about, such as is the registration process for the TLD's registration web portal, are the correct controls in place?  Have audits been done?

Are there any documented cases of DNS hacking at the TLD level?
What mitigates this risk?
Is there a standard, accreditation, or assurance that I can rely on before using a given second level TLD?
Is any third party that watches the DNS roots of .COM / .NET / .ORG (etc) and monitors them for changes?

This risk is particularly concerning as more and more people rely on URL shorteners to make "cute" URLs.  In essence they are allowing a 3rd party, whose government may not allow for privacy protections, lawsuits, or other support we would otherwise expect, if that DNS provider were to be hacked.

Example of different TLDs that have some name servers, how do we know these servers are correct?

> com.
Server:  a.root-servers.net
Address:  198.41.0.4

Name:    com
Served by:
- m.gtld-servers.net
          192.55.83.30
          com
- l.gtld-servers.net
          192.41.162.30
          com
- k.gtld-servers.net
          192.52.178.30
          com
- j.gtld-servers.net
          192.48.79.30
          com
- i.gtld-servers.net
          192.43.172.30
          com
- h.gtld-servers.net
          192.54.112.30
          com
- g.gtld-servers.net
          192.42.93.30
          com
- f.gtld-servers.net
          192.35.51.30
          com
- e.gtld-servers.net
          192.12.94.30
          com
- d.gtld-servers.net
          192.31.80.30
          com

> biz.
Server:  a.root-servers.net
Address:  198.41.0.4

Name:    biz
Served by:
- a.gtld.biz
          156.154.124.65
          2001:503:7bbb:ffff:ffff:ffff:ffff:ff7e
          biz
- b.gtld.biz
          156.154.125.65
          biz
- c.gtld.biz
          156.154.127.65
          biz
- e.gtld.biz
          156.154.126.65
          biz
- f.gtld.biz
          209.173.58.66
          2001:500:3682::12
          biz
- k.gtld.biz
          156.154.128.65
          2001:503:e239::3:2
          biz

> me.
Server:  a.root-servers.net
Address:  198.41.0.4

Name:    me
Served by:
- ns2.nic.me
          89.188.44.88
          me
- ns.nic.me
          89.188.44.44
          me
- b2.me.afilias-nst.org
          199.249.127.1
          2001:500:4f::1
          me
- a2.me.afilias-nst.info
          199.249.119.1
          2001:500:47::1
          me
- d0.cctld.afilias-nst.org
          199.254.62.1
          2001:500:28::1
          me
- c0.cctld.afilias-nst.info
          199.254.61.1
          2001:500:27::1
          me
- b0.cctld.afilias-nst.org
          199.254.60.1
          2001:500:26::1
          me
- a0.cctld.afilias-nst.info
          199.254.59.1
          2001:500:25::1
          me

>

The security of DNS is independent of the particular name hierarchy, as typical DNS-related attacks happen at the resolver instead of at the authoritative server.  Furthermore, DNS without DNSSEC is not assumed to be secure any more than telnet is assumed to be a safe remote shell protocol. Security must be layered on elsewhere, such as in TLS.

But to answer your question: each registrar and TLD owner is responsible for his own security, and the reputation of each should reflect that. There is no prescribed security apparatus other than the built-in mechanisms through which DNS operates and the rule and regulatory framework which comprises it.


Has anyone used this ICLOAK USB device? Does anyone know about this ICLOAK USB device? Opinions or how well they work?  I'm looking for a security solution when I'm using PCs where I work.  Occasionally we have to log into to web sites, from work, to check sensitive information regarding our pay stubs, pay rates, retirement plans etc from work.  They are pretty relaxed about our personal usage of the internet and everything I just want to make sure 'mainly' that my log in credentials can't be intercepted between the the time they travel from my browser to the web sites I'm logging into. Like that there is nothing in the middle that can intercept or meddle with unencrypted info

One of the bullet points on their web-site https://icloak.org/ says (Use it at work and keep your employer from tracing or tracking your online footprints) Could this ICLOAK really achieve this feat?

Snake oil, this is just a glorified Linux live-USB with lots of bold claims to fool naive customers (they advertise it as a silver bullet solution for anonymity and privacy, which is impossible to do by just inserting an USB stick in a machine - does it magically detect hardware keyloggers or compromised firmware?).

You can make your own by installing Tails on an USB stick. I was about to rant over their proprietary OS but it looks like they're based on Ubuntu but even then, there is no clear download link for the source code so I wouldn't trust it.

If we assume their solution isn't malicious, this still isn't a silver bullet for anonymity and security; let's break down some of their claims :

  Use it at work and keep your employer from tracing or tracking your online footprints

This doesn't protect against hardware or low-level (in the firmware for example) eavesdropping, while I doubt most employers would use this, it's definitely possible and this solution won't protect you against that. If you must do something privately, do it on your own computer, not your employer's one.

If you use it on your employer's network they will definitely know it - while it's true that they won't know what you're doing (assuming you're accessing HTTPS sites or using Tor), they will definitely notice some encrypted flow on the network and that will raise suspicions (and use of anonymity software may be prohibited which means you're fired).

  Plug ICLOAK Stik into the USB drive of any Mac or PC device, reboot and you have 100% anonymity and privacy in under a minute.

Again, this doesn't take into account low-level nastyness like a compromised firmware or hardware keyloggers - if you need privacy or anonymity you should not be using a machine over which you don't have full control. Internet kiosks/cafés, employer-provided PCs, etc... shouldn't be trusted at all.

So, while it can indeed provide anonymity if you know how to use it properly (only on your own machine, check for hardware keyloggers, etc), I'd say this is snake oil because their target market is the "average Joe" who has no clue about IT security and will blatantly believe they can make any machine safe just by plugging an USB drive in it, which is obviously false and dangerous for them.


Accessing a hidden token file in a website using RFI? In class, I was given the task of using LFI and RFI to find tokens hidden in specific web pages. I completed the first two tasks fine, however, there is another task, the final boss if you will, that I am stumped on.

We are meant to find a token in /var/www/token.txt but when using LFI it doesn't work. It comes up with a pop up saying "In order to get this token you need to get a shell on the box and run the file you can find in /var/www/".

How do I open a shell/what does that mean? And how do I make it so I can run the file?

"Open a shell" means that you upload code to the site that it will run, which will give you command access to the server. There are shells you can download from various sites to meet your needs (PHP, Java, etc.). You upload the shell using the same process you used for RFI.

The shell runs as the same user as the web service, so it should give you access to /var/www since that's typically the root directory for the webserver.


How does the "Service Identity" feature of Azure ACS compare (and contrast) to a real IDP? It appears that the ACS has IDP-style features within the "Service Identities" section.  How does the ACS treat these in comparison to a real IDP?  What is missing?

Some examples I'm thinking of include: Account Lockout, Auditing, Token Replay, etc.  These come more into light when comparing the credentials to a "real" IDP such as CA SiteMinder, ADFS 2.0, and Ping

Given the contrasting examples, what is ACS + Service Identities missing?
What features matter?
What is the resulting intended (or non intended use) AS-IS today?

From my testing I have only found one reason to use a Service Identity as opposed to a real IDP, and that is with OAuth Delegation.

When an OAuth Delegate-e authenticates with the ACS, it requires a redirect URL after the ACS returns.  This property is stored within the Service Identity and is only visible by the API and not visible by code.

Considering that Microsoft doesn't want to be an IDP for your applications.  They rather have OpenID, LiveID, Facebook, Gmail, Yahoo, or ADFSv2  (user/pass, 2-factor, or certificate) handle authentication.

Disclaimer

Considering that I'm answering my own question I'm interested in hearing other people's opinion and experience.  I just want to share this information regarding OAuth Delegation


How Secure is Googles Saved Password feature? So I signed into my google account to check my privacy settings. I found a Feature called "Saved Passwords" which had in it about 50 various accounts which I have signed into and clicked "Save password". An example of this is shown below:

As you can see from the screenshot there is a small "Eye" icon which allows you to see the password in plaintext.

So there are two problems here from what I can see;

Firstly, If I can see my password plaintext does that mean my password is being stored unhashed somewhere, perhaps on a google server? which already sets alarm bells ringing and Secondly, If someone accessed my account they would unlock a goldmine of websites and their corresponding usernames and passwords.

So my question is: Is Googles saved passwords feature secure?

Came across this post:

How they work: Browsers store your passwords in encrypted databases or registry entries stored locally on your computer. If the browser has a feature to sync your data between your computers and other devices, the information is saved in its encrypted format to an online account (e.g., Google if you're using Chrome or your Firefox Sync account on Mozilla).

Security weaknesses: The biggest problem with saving your passwords in your browser is that it's not hard for someone who gains access to your computer to also access all your passwords. In Chrome, for example, you (or anyone who hacks into your computer) can just go to the browser's settings and click on the show button in the preferences tab to reveal any saved password. Internet Explorer is more secure because it doesn't let you view saved passwords, and it also doesn't sync your data across computers. Both IE and Chrome, however, use your computer login password as the cipher for the encrypted data. Because of this, it's easy for your passwords to be revealed with tools such as Nirsoft's WebBrowserPassView. If third-party utilities like this can recover the data, malware running under your user account might also be able to access the data.

Link to full article:
http://lifehacker.com/5944969/which-password-manager-is-the-most-secure


Malicious(?) PHP / BASH Script. What is it? I'm not sure if this is against the rules of the site. If it is, please let me know and I'll delete the question.

I've seen variations of this script floating around recently. What the heck is it, and what does it do?
http://pastebin.com/1XcMTsiL

You can see a list of sites that have been hit with it here:
(For the love of god, DON'T click these links unless sandboxed).

https://www.google.com/#q=%22**+*++Use+this+function+for+update+scripts+*++the+output+of+Update%28%29+*%2F+function+Update%28%29%22&hl=en&prmd=imvns&filter=0&bav=on.2,or.r_gc.r_pw.r_cp.r_qf.,cf.osb&fp=bb242dc4ab43ba95&biw=1920&bih=1043

There is a discussion here as well:
http://www.webhostingtalk.com/showthread.php?t=1033395

It looks like a set of different malicious things to do when a system is compromised. The script is no more dangerous than the security issue that allowed it to be inserted in the first place. Consider it to be a remote controlling toolkit once the hacker got in.

Once installed it can rewrite itself or other files on the server to be this script, modified to it's current environment. Then tricks the visitor that triggered this script to be redirected to a different website. This script could be used for defacing or (considering it contains stats tracking) trying to generate income by tricking the user into viewing or opening ads and possibly more uses.


penetration testing first step I've started a course about Penetration testing and CEH on cybrary. The course begins with an introduction that quickly describes each step of pentesting. The first step is essentially to gather information. So that's my question, what I can do if I can't get any (or only irrelevant) information about my target? What can I do next? I should just try some random attack?

Before you embark on the "fist step" of information gathering.  You may want to consider step 0: "What are you attacking,  and what is your goal?".  The point of gathering information is to determine your target's attack surface, and what attacks are applicable.

Is this a web service or web application?  You might want to gather information about
what platform this web service is built on. What language was it
written in,  ect. Dirbuster and spidering help enumerate attack surfaces. BURP and ZAP will build a sitemap of your target(s) and have tools to expand the sitemap.
Is this a mobile app? You might want to sniff traffic to find backend
services.  Or decompile the app to see if they are protecting the
source.
Is this a network assessment?  You might want to use nmap -sV,  or
google hacks,  or use DNS to acquire targets.
Is this a VoIP or Telephony assessment?  You might want to start with
determining the range of your target, and wardialing.
Is this a wireless assessment?  What wireless networks are running?
Are they protected?  How are they protected?
Is this a hardware assessment?  You might want to start by
looking the controller board and its manufactures.  Write down any ID numbers you see on integrated circuits,  and google them. After components have been identified,  try fining developer manuals.

There are many other types of security assessments that follow penetration testing methodologies,  however the ones above are really the most common types I am familiar with.


How can salted, hashed password storage be combined with a plaintext, nonce and hash based authentication? My understanding is as follows:

To securely store a password (e.g. in a database), you use a hashing algorithm designed for this purpose (designed to be slow, e.g. bcrypt), and you use a unique salt for each password.
This makes it hard/slow for an attacker with access to the database to recover passwords, because they can't use a rainbow table, and each brute force attempt takes more time than a simple md5 or sha1.
To securely authenticate a password over a plain text protocol (i.e. not SSL), the server sends the client a nonce, and the client combines the password, and the nonce (and maybe also a timestamp), runs a hashing algorithm on them, and transmits that hash to the server, who runs the same algorithm and compares. This avoids sending the password in plain text, and also makes replay attacks impossible, as long as the server can't be tricked into accepting the same nonce twice.

The problem is, for the authentication part of this the server needs to know the actual plaintext password. So you can't store them securely as in #1.

Now, the server could transmit the salt to the client, and the client could calculate the salted, hashed password first and then do #2. But then the salted-hashed password effectively becomes the plaintext password, and so you still don't really have #1.

So my question is, is there a way to do both #1 and #2?

Take a look at the Secure Remote Password protocol (wikipedia, Stanford). It uses a hash of the password (pick your favorite slow, salted hash) on the client side, but the server only gets a "verifier" derived from that hash by discrete exponentiation. The actual authentication takes place by an asymmetric key exchange using two random numbers (one client-generated, one server-generated), the hash (client-side only) and verifier (server-side). It's intended that the generated key be used to encrypt the rest of the session, but it could simply be verified and discarded.

Advantages:

The key exchange itself is effectively a zero-knowledge proof, meaning that a listener, man-in-the-middle, or server impostor gains no information about the password. If these were the only types of attack possible, a single-letter password would be sufficient for security.
An online dictionary attack (client impostor) can test only one password per attempt (early versions of the protocol allowed two).
If an attacker copies the server's database of verifiers, they can run an offline dictionary attack only by running each candidate password through the slow hash and exponentiation. They cannot use the verifier to impersonate the client.
As long as the server's verifier remains secret, the exchange transaction effectively verifies the server to the client (as well as the client to the server).


Double user-agent. Malware? The place where I work sometime is receiving some alert from the NIPS stating :

[1:30918:2] "MALWARE-CNC User-Agent known malicious user agent - User-Agent User-Agent Mozilla"

The user-agent in the paquet is :

User-Agent: User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.64 Safari/537.31

It is coming from some clients accessing our website. It basically changes IP address. Either that or multiple client are infected. The rule indicate that the client would be infected with some virus trying to connect to an command and control server. It's a good thing that this paquet comes from outside, because the opposite would mean that we would be infected. What I don't understand is why is it trying to communicate with us? Obviously it's not a legit navigator like chrome or firefox, but rather a script trying to look like it. Shouldn't it try to communicate with the C&C server? Does this mean that our servers are infected (or were infected at some point) with some kind of C&C hop/proxy that redirect the information?

Web clients have the right to pass any User-Agent string they like. There is no good reason to deny access just because your NIPS can not make sense of the user-agent string. If you let it do that, then you might deny access from legitimate users with non-mainstream browser configurations.

I would recommend you to configure your NIPS to stop blocking these requests, unless it can find something which is actually fishy about them. Something actually fishy could be if the string contains an attempt to do a SQL injection or XSS injection (hoping that the user-agents gets stored in a database and/or displayed in a web interface and those do not sanitize their input properly).