LDAPS connection failing with "PKIX path building failed" since AD controller certificate renewal We have several Linux and Windows servers using LDAPS authentication to a MS AD controller for the applications they host, that is presenting a certificate signed by our internal root CA.

Recently, the AD controllers renewed their certs automatically. From this point on, most of the Linux hosted servers failed to authenticate to this AD controller, while Windows hosted server continued to work.

Nothing on these servers changed during that time, only the AD controller certificate, sub and root certs are unchanged.

Our first thought was that the Linux hosts might not have the internal root cert imported as trusted, but why did it work before then?

Some digging revealed that this AD controller is not presenting the full certificate chain, which means the root CA cert is missing.

Importing the root CA cert to most of the systems fixed it.

How can it have been working before the renewal on these Linux machines that do NOT have the root / sub certificates trusted? Even with a correctly presented certificate chain, this connection shouldn´t be trusted, as the root CA is not known by the system.

Unfortunately, I have no access to the certificate and chain that has been used before, so I cannot compare them, but there was no key length change or similar.

Depending on the actual software that is doing the certificate chain validation, there are several possibilities how this might have worked before the renewal:

The old certificates were directly trusted locally w/o basing trust on a CA at all.

While this is strictly not possible (as valid certificate chains must start with a root certificate), most implementations allow for this options (such that, for example, self-signed certificates can be trusted without adding the overhead of a CA setup).
The software does not use the trust store you are looking at.

Obiter Dictum:

  Even with a correctly presented certificate chain, this connection shouldn´t be trusted, as the root CA is not known by the system.

That does not exactly hold true. Even though the root CA might be untrusted, a intermediate CA might be cross signed by another CA that the system in question has established trust in.


Why do SSL enabled sites don't reply back according to "hosts" file record? I was playing with the hosts file under my linux distro. Added an entry

 192.168.3.121   www.facebook.com

in the /etc/hosts file. Created 2 servers which link to an index.html file at ports 80 and 443. Now when trying to access www.facebook.com through  firefox or chrome, I get the below errors.

Also on the server 192.168.3.121 logs, I do receive some hex strings from the browser

 192.168.3.121 - - [11/Jul/2016 14:30:55] code 400, message Bad request syntax ('\x16\x03\x01\x00\xb9\x01\x00\x00\xb5\x03\x030_x\xe6\x13\xa5x\xe4\xcdHQ\x9d\x8c\xcd\xe9\x9co\xa0LpO\x81}\xad\x1b}"\x83\xceM\x98\xdd\x00\x00\x16\xc0+\xc0/\xc0')

While when I try with a website which doesn't uses SSL, I can successfully redirect the browsers to my home website on 192.168.3.121.
What internal security are the Browsers implementing and is there a way by which I can make the browsers redirect an https website to my ip 192.168.3.121  ?

The error message indicates that the server expected a HTTP request but got a HTTPS request: \x16\x03\x01\ is the start of an TLS record. This probably means that your server configuration is wrong, i.e. that the server expects HTTP on port 443 and not HTTPS.


How does malware get past NAT routers? How does malware, like the software used to create the botnet that recently DDoS'd Dyn, get past NAT? On a computer, I can see the user can be tricked into downloading untrusted code, or browser vulnerabilities can be exploited. But on internet-connected devices like security cameras, I can't imagine how it would ever connect to an untrusted server without malicious physical access. I'd expect most of them to be behind a NAT router, so how does the malware get in?

A lot of these devices will use Universal Plug and Play (UPnP), a service that runs on many consumer routers and devices, allowing network devices to effectively add port forwarding rules on the router. Many consumers are unaware of this behavior and will thus have their devices exposed to the internet. This is just another example of IoT manufacturers choosing convenience over security.


XSS between tags when only  are encoded? Let's say we have . Our website takes the value of a query parameter and adds it between the tags so we have Hello!.

If we sanitize the parameter by replacing < with &lt; and > with &gt, is XSS still possible in the case where the untrusted data is inserted between HTML tags?

I have seen example of various odd encoding working but not in modern browsers

If you only filter for script tags, yes.

For example:

Or

Or an infinite number of other vectors.

You need to properly filter the entire contents when you write them out to the page, using whatever encoding function is appropriate for the output encoding (e.g. HTML, XML, JSON, etc.) and available in the language you're using.

Examples for various languages:

ASP.NET
PHP
Java

I also recommend reading the XSS Prevention Cheat Sheet.

EDIT: After your update, yes, this is still possible.

Imagine you filter < and >, but then put content in an attribute:

I can then use this payload:

" style="display: block; position: absolute; top: 0; left: 0; width: 9999px; height: 9999px; z-index: 9999" onmouseenter="alert(1)" foo="

This turns your span into a block element which fills the entire page, executing the onmouseenter event as soon as the user's mouse enters the page.

Ok, so you're still not convinced.

People have spent a LOT of time making XSS work in all sorts of simple filter-based environments. The number of tricks is astounding, getting into all sorts of madness like tricking the browser to misinterpret the page as having a different character encoding so that UTF-8 or other Unicode codepoints sent as input later get treated as distinct ASCII codepoints containing HTML-affecting characters like > or ".

As an example, let's say you're using UTF-8 as your character set on your server. I put the 㱁 character into your page, but then through various tricks (this is browser dependent and complicated, but can be achieved trivially if you've got a header-splitting bug on your server) trick your browser into assuming the encoding is simple ASCII. The UTF-8 codepoint for 㱁 is U+3C41, which when interpreted as ASCII is simply <A. Your browser sees this as the opening of a tag.

Example payload:

㱁 href="x" style="display: block; ..." onmouseenter="alert(1)"㸠foo

The huge number of pitfalls makes it impossible to handle yourself. You need a proper XSS filtering library which is encoding-aware to take these issues into account.


Fingerprinting the webpage content I'm moderating a closed section of a forum - think 'covered by NDA' (not actually, but it's a good equivalent of the situation), with restricted access.

Sometimes we find screenshots from that forum posted by some rogue user anonymously in places where they definitely shouldn't appear. And the screenshots being anonymous, with no discernable features, don't let us find the rogue and draw consequences.

I'd like to learn of some way to affect page appearance so that a screenshot of it could be traced to the author of the screenshot - maybe some kind of steganography that can survive lightweight compression, or other inconspicious elements that would allow to identify, whose account these screenshots were made from? Specifically, possible to appear broadly enough that even a relatively small part of the screen (say, one post) is sufficient to identify the culprit?

I tried "cooking my own" embedding something akin to low-contrast barcode in borders around posts, but it was neither inconspicious enough nor durable enough to survive 85% quality JPEG compression.

This looks like a classical Canary Trap. Basicly I would suggest to hide encrypted information about the user in different ways:

obvious QR-Code  (as suggested by slugster)
different colors (as suggested by Nick Wilde)
page viewed as username - footer on each page
replacing certain words with synonyms
code information in spaces and interpunction within the text

If the user compresses/reduces the size of the screenshot, you can still guess / measure the different interpunction of the text - combined with another measurement the user might "forget" to remove all of them.

Regardless of the stenographical method I would suggest to encrypt the data with an public/private-key meachnism to ensure that if someone reads out or assumes that there is data and tries to read it out, the person isn't able to find it easily.


How can I protect my WiFi if I have two routers? I have a main desktop computer in my basement.  It is connected to a modem box that my ISP gave me, which is also wireless.  They also recommended a stronger wireless router, from Linksys, that would better carry the signal upstairs, to my laptop.  How do I better protect myself from intruders?  Is it necessary to change both the passwords from the modem AND the Linksys?

There is not so much you can do with securing wireless network from a router standpoint, but key points to hardening are:-

Change default password.
If available use WPA, not WEP.
Disable remote administration
Change the default SSID name
Enable router firewall
Disable SSID broadcast
Enable wireless MAC filter


Why is a CA certificate required for EAP-TLS clients? When setting up clients with WPA2 EAP-TLS, most clients (ie: my phone, my computer) require both a client public/private keypair (for obvious reasons) and a certificate authority certificate.

It's this second parameter which I'm not sure of the use for. My current setup looks like this:

.
└── root-ca
    ├── wifi-client-ca
    │   └── client1-client-cert
    └── wifi-server-cert

I have a single self-signed root CA (root-ca) which branches off underneath. My RADIUS server uses wifi-server-cert as the SSL certificate, and uses the wifi-client-ca certificate authority for validating client certificates.

I use chain certificates in deployment everywhere, both for the client and serverside certificate components.

I haven't had any trouble connecting using client1-client-cert and wifi-client-ca on my Ubuntu machines, but I haven't been able to connect on Android using these same certificates. I'm thinking that the problem lies in the fact that Android isn't climbing the certificate chain properly.

This breaks down into two similar questions:

Why is a CA certificate required for EAP-TLS clients/what does it do?
Which CA certificate should be used on my clients, the root-ca certificate (which directly signs the wifi-server-cert) or the wifi-client-ca?

EAP-TLS really encapsulates a SSL/TLS handshake, in which both server and client send each other a certificate. This has the following properties:

When the server sends a certificate, it actually sends a certificate chain, including the CA which issued it, and the CA above it, and so on, up to the root (the root itself may be sent, but this is optional).
Similarly, when a client sends a certificate, it also is as part of certificate chain.
The client validates the server's chain, the server validates the client's chain.

Therefore, on the client side, with your notations:

The client must know wifi-client-ca because it must send it as part of its "client chain" to the server.
The client must know and trust root-ca in order to be able to validate the server's certificate (this is crucial for security: this protects the client from talking to a fake access point).

Some clients might be convinced to trust wifi-server-cert directly, but not all of them permit such direct trust, and it would mean trouble when that certificate expires.

It may be enlightening to consider the following: the client's certificate is for the server, not for the client itself; thus, the client needs not trust its own certificate. In a generic way, the root CA for the server certificate, and the root CA for the client certificates, may be distinct and unrelated to each other. Still, the client must know (but not necessarily trust) the chain for its own certificate in order to send it to the server, as SSL/TLS mandates.


Defence methods against tailgating This is a follow-up question to this one: Roles to play when tailgaiting into a residential building

How do you protect yourself or your company against tailgaters? What is the best answer when you are asked by, let's say the delivery guy, to let you in?

This is not a problem that has a social solution. No amount of corporate policy will save you. Humans are social animals. In the end, if people can let other people in, they will.  Even if you may be very security aware and not let anyone in, 95% of your collegues will act differently.

You have to work with human nature, not against it.

So if you want to stop tailgating, you'll need one of these, perferably placed in a reception with human supervision:


2000 Sets of Personal Information So the story goes like this..

I recently rediscovered an old website i used to go on quite often but i couldn't remember my login. The site is poorly made and hasn't been updated in about 5 years, so i tried a simple SQL-Injection to gain access to my old account and lo and behold, i was in. The problem is that i (and anyone else with a bit of SQL knowledge) have access to ~2000 users:

Email
Password (Plain/text)
Full Name
Date of Birth
Private Messages

So i did the right thing, I sent an email to the owner of the site. It's been over a month and no response or changes to the site.

My question being:

What should i do in this position? Should i try to take down the site in a "not so legal" way? i doubt the owner will do anything about it. It's an old site with not more than 10-40 people online at one given time but a lot of people reuse emails and passwords so i bet that a lot of them could work on other more important accounts.

Do absolutely nothing else with or at the site.

Don't make things worse.

In many jurisdictions you may have already crossed the line into not so legal. (You should get legal advice from a computer crime specialist lawyer in your jurisdiction about what you've done, by the way.)

You have notified the site owner, which we commend you for, and your lawyer will yell at you for. If they ignore it, that's down to them.

Lastly, if you've used that password anywhere else, change it there immediately.


what attacks are possible on outdated versions of TAILS? I know using outdated software is a bad idea, but until recently I have only been able to boot TAILS from LiveCDs that come with some Linux magazines.  Since these arrive in my country late, I end up using some outdated version. I haven't had any problems with it until this happened.
With recent updates to TAILS, I'm guessing a LiveCD from a downloaded image should probably boot on my computer now.

For obvious reasons, downloading TAILS on an unencrypted and unanonymized connection is not an option, but now I'm worried about downloading TAILS using a possibly vulnerable version as well.

I'm aware that tor, and especially TAILS are somewhat safe from mitm attacks and tampering, but I assume this is mostly true for the most up-to-date versions.

What kinds of attacks and exploits are possible on outdated versions of TAILS?
Would it be safe to download the newver versions using one?

Every new release of Tails lists the vulnerabilities fixed in this version. For example if you go to https://tails.boum.org/ and look down at "Security" heading, you will see "numerous security holes in ".

So indeed, there are vulnerabilities in the older versions of Tails. However for the sole purpose of downloading a new version of Tails those are less relevant, and many of those won't even apply. While it is still possible to attack you using those exploits (for example, by patching the downloaded image as you're writing it to USB), the effort required to implement and execute such attack is enormous. So unless you consider yourself a desirable target of a three-letter agency, you likely are ok.

Please keep in mind that most people download the new version of Tails on their regular operating systems, so security-wise they might be even worse than old Tails.


Diffie Hellman master secret TLS1.2 I have been trying to calculate the master secret used to encrypt some data using the client public key B, the server private key a and the client and server random values. I have calculated k=B^a, which to my understanding gives me the premaster secret. I then input this together with the random values into the following PRF function (page 15 of this pdf):

def prf(secret,label,seed,numblocks):
    seed=label+seed
    output = ''
    a=hmac.new(secret,msg=seed,digestmod=hashlib.sha256).digest()
    for j in range(numblocks):
        output += hmac.new(secret,msg=a+seed,digestmod=hashlib.sha256).digest()
        a=hmac.new(secret,msg=a,digestmod=hashlib.sha256).digest()
    return output
def master_secret(pms,client_random,server_random):
    out=prf(pms,"master secret",client_random+server_random,2)
    return out[:48]

According to the RFC specification for TLS1.2, this should output the master secret, but when verifying it with the data I have, it is wrong. Where is my mistake?


Popular Security "Cargo Cults" In Information and IT Security there is a nasty tendency for specific "best practices" to become inviolable golden rules, which then leads to people recommending that they are applied regardless of whether they are appropriate for a given situation (similar to Cargo Cult Programming)

A good example of this is the common approach to password policies which applies a one-size fits all 8-character length requirement combined with high complexity requirements, 12 previous passwords stored in a history to stop re-use, 3 incorrect attempt lockout and 30 day rotation.

The 30 day rotation is intended to lower the window of opportunity for an atacker to use a stolen password, however it is likely to lead users to use sequence passwords meaning that if an attacker can crack one instance they can easily work out others, actually reversing the intended security benefit.

The high length and complexity requirements are intended to stop brute-force attacks.  Online brute-force attacks are better mitigated with a combination of sensible lockout policies and intrusion detection, offline brute-force usually occurs when an attacker has compromised the database containing the passwords and is better mitigated by using a good storage mechanism (e.g. bcyprt, PBKDF2) also an unintended side affect is that it will lead to users finding one pattern which works and also increases the risk of the users writing the password down.

The 3 incorrect lockout policy is intended to stop online brute-force attacks, but setting it too low increases account lockouts and overloads helpdesks and also places a risk of Denial of service (many online systems have easily guessed username structures like firstname.lastname, so it's easy to lock users out)

What are other examples of Cargo-Cult security which commonly get applied inappropriately?

Closed source is more secure than open-source as attackers can view the source code and find and exploit vulnerabilities.  While I'm not claiming this is always false, with open source software it's at least possible for outside experts to review the software looking for gaping vulnerabilities/backdoors and then publicly patching them.  With closed source software that simply isn't possible without painstakingly disassembling the binary.  And while you and most attackers may not have access to the source code, there likely exist powerful attackers (e.g., US gov't) who may be able to obtain the source code or inject secret vulnerabilities into it.
Sending data over a network is secret if you encrypt the data.  Encryption needs to be authenticated to prevent an attacker from altering your data.  You need to verify the identity of the other party you are sending information to or else a man-in-the-middle can intercept and alter your traffic.  Even with authentication and identification, encryption often leaks information.  You talk to a server over HTTPS?  Network eavesdroppers (anyone at your ISP) knows exactly how much traffic you sent, to what IP address, and what the size of each of the responses (e.g., you can fingerprint various webpages based on the size of all the resources transferred).  Furthermore, especially with AJAX web sites, the information you type in often leads to a server response that's identifiable by its traffic patterns.   See Side-Channel Leaks in Web Applications.
Weak Password Reset Questions - How was Sarah Palin's email hacked?  A person went through the password reset procedure and could answer every question correctly from publicly available information.  What password reset questions would a facebook acquaintance be able to figure out?
System X is unbreakable -- it uses 256-bit AES encryption and would take a billion ordinary computers a million billion billion billion billion billion years to likely crack.  Yes, it can't be brute-forced as that would require ~2256 operations.  But the password could be reused or in a dictionary of common passwords.  Or you stuck a keylogger on the computer.  Or you threatened someone with a $5 wrench and they told you the password.  Side-channel attacks exist.  Maybe the random number generator was flawed.  Timing attacks exist.  Social engineering attacks exist.  These are generally the weakest links.
This weak practice is good enough for us, we don't have time to wait to do things securely.  The US government doesn't need to worry about encrypting the video feeds from their drones - who will know to listen to the right carrier frequencies; besides encryption boxes will be heavy and costly - why bother?
Quantum Computers can quickly solve exponential time problems and will break all encryption methods.  People read popular science articles on quantum computers and hear they are these mystical super-powerful entities that will harness the computing power of a near infinite number of parallel universes to do anything.  It's only part true.  Quantum computers will allow factoring and discrete logarithms to be done in polynomial time O(n3) via Shor's algorithm rendering RSA, DSA, and encryption based on those trap-door functions easily breakable.  Similarly, quantum computers can use Grover's algorithm to brute force a password that should take O(2N) time in only O(2N/2) time; effectively halving the security of a symmetric key -- Granted Grover's algorithm is known to be asymptotically optimal for quantum computers, so don't expect further improvement.


Is my developer's home-brew password security right or wrong, and why? A developer, let's call him 'Dave', insists on using home-brew scripts for password security. See Dave's proposal below.

His team spent months adopting an industry standard protocol using Bcrypt.  The software and methods in that protocol are not new, and are based on tried and tested implementations that support millions of users. This protocol is a set of specifications detailing the current state of the art, software components used, and how they should be implemented. The implementation is based on a known-good implementation.

Dave argued against this protocol from day one. His reasoning was that algorithms like Bcrypt, because they are published, have greater visibility to hackers, and are more likely to be targeted for attack. He also argued that the protocol itself was too bulky and difficult to maintain, but I believe Dave's primary hangup was the fact that Bcrypt is published.

What I'm hoping to accomplish by sharing his code here, is to generate consensus on:

Why home-brew is not a good idea, and
What specifically is wrong with his script

/** Dave's Home-brew Hash */

// user data
$user = '';
$password = '';

// timestamp, random #
$time = date('mdYHis');
$rand = mt_rand().'\n';

// crypt
$crypt = crypt($user.$time.$rand);

// hash
function hash_it($string1, $string2) {
    $pass = md5($string1);
    $nt = substr($pass,0,8);
    $th = substr($pass,8,8);
    $ur = substr($pass,16,8);
    $ps = substr($pass,24,8);

    $hash = 'H'.sha1($string2.$ps.$ur.$nt.$th);
    return $hash
}

$hash = hash_it($password, $crypt);

/** Dave's Home-brew Hash^H^H^H^H^Hkinda stupid algorithm */

// user data
$user = '';
$password = '';

// timestamp, "random" #
$time = date('mdYHis'); // known to attackers - totally pointless
// ^ also, as jdm pointed out in the comments, this changes daily. looks broken!

// different hashes for different days? huh? or is this stored as a salt?
$rand = mt_rand().'\n'; // mt_rand is not secure as a random number generator
// ^ it's even less secure if you only ask for a single 31-bit number. and why the \n?

// crypt is good if configured/salted correctly
// ... except you've used crypt on the username? WTF.
$crypt = crypt($user.$time.$rand);

// hash
function hash_it($string1, $string2) {
    $pass = md5($string1); // why are we MD5'ing the same pass when crypt is available?
    $nt = substr($pass,0,8); // <--- BAD BAD BAD - why shuffle an MD5 hash?!?!?
    $th = substr($pass,8,8);
    $ur = substr($pass,16,8);
    $ps = substr($pass,24,8); // seriously. I have no idea. why?
    // ^ shuffling brings _zero_ extra security. it makes _zero_ sense to do this.
    // also, what's up with the variable names?

    // and now we SHA1 it with other junk too? wtf?
    $hash = 'H'.sha1($string2.$ps.$ur.$nt.$th);
    return $hash
}

$hash = hash_it($password, $crypt); // ... please stop. it's hurting my head.

summon_cthulhu();

Dave, you are not a cryptographer. Stop it.

This home-brew method offers no real resistance against brute force attacks, and gives a false impression of "complicated" security. In reality you're doing little more than sha1(md5(pass) + salt) with a possibly-broken and overly complicated hash. You seem to be under the illusion that complicated code gives better security, but it doesn't. A strong cryptosystem is strong regardless of whether the algorithm is known to an attacker - this fact is known as Kerckhoff's principle. I realise that it's fun to re-invent the wheel and do it all your own way, but you're writing code that's going into a business-critical application, which is going to have to protect customer credentials. You have a responsibility to do it correctly.

Stick to tried and tested key derivation algorithms like PBKDF2 or bcrypt, which have undergone years of in-depth analysis and scrutiny from a wide range of professional and hobbyist cryptographers.

If you'd like a good schooling on proper password storage, check out these links:

How to store salt?
Do any security experts recommend bcrypt for password storage?
How to securely store passwords?


Practices for storing username/password in Web applications I have read the following question: Storing password in Java application but I don't find the answers useful for my case.

So here is my question somehow related to that. I have a Java Web application with a back end DataBase secured access with username and password.

Right now the username/password sits in a .properties file on the web server. The server is secure, but having it like that in plain text kinda bothers me.

Tried at some point to use secure stores to encrypt/decrypt the username and password but the stores are themselves protected by a password so where do I store that? I'm back to square one.

So? What is the best way to store username/passwords for connecting to other systems (database, web service etc)

The server needs to be able to access some resource R. If an attacker has full control of the server then that attacker can by definition now access any resource the server can access. There is absolutely nothing you can do about this except secure the server.

If the attacker doesn't have full control of the server but has access to the server's file system then the question is if the server needs to boot autonomously (without any external help). If the server needs to boot autonomously then all the data required to access resource R must reside somewhere in the server's file system and are thus available to the attacker. The best you could do is to try and obfuscate the password - good luck with that.

If the server can use external help to boot then the best option would be to require an administrator to enter the password during boot (and keeping the password stored in RAM).   If that's not a practical option (it usually isn't) then you could secure the password using a USB token (e.g. store an encrypted password and use the USB token to decrypt it).

TL;DR: Assuming you can't manually enter the password every time you boot the server there's not much you can do except protect the server itself.


Identify Network of Wireless Packet When sniffing wireless packets from multiple networks, how do you tell which network a packet belongs to?

The best guess I have right now is that you need to see the handshakes and get the mac addr from the Ethernet frame. This seems inconvenient

These are worth a read:

https://wiki.wireshark.org/Wi-Fi
https://wiki.wireshark.org/CaptureSetup/WLAN

Some network cards will provide 802.11 headers (including the SSID which you can use to identify the network), other network cards strip those and present WiFi as regular Ethernet.


No where to run, no where to hide - suggestions to improve personal security needed I think that as a windows user, I have no where to run and no where to hide.
In the windows world no matter how many precautions I take, I can get infected by -

1 - Drive by on legal and popular websites due to malicious scripts and browser bugs.
2 - Lame malware protected by crypting, packing etc.
3 - Malicious advertisements

(Feel free to add anything else to this list)

What did I do to protect myself -

1 - Paid antivirus
2 - NoScript in Firefox (and regularly updated chrome)
3 - Sandboxie (Ok, I did not use it all the time)
4 - Almost regular update of AV, Software (browser, pdf reader, java etc) , Windows

Do I need to keep everything inside a VM to feel a little more safe?
What should I do to be way more secure, maybe 99.99% ?

To be safe, I used to do all my web surfing in my linux distro which is installed in dual boot. But, its inconvenient when you want to use windows software at the same time.

A workable method is to use a virtual machine. Run a VM with a Linux in it, and do your browsing from that VM. VirtualBox "seamless windows" may help making the integration with your Windows system easier.

Of course:

This may protect your Windows system from whatever occurs in the Linux side of things, but remember that at least part of your sensitive data is in the browser itself -- e.g. authentication cookies for various sites.
If you, as a user, want to download a Windows application from a site, and then run it on your Windows machine, and the application turns out to be hostile, then no amount of Linux or VM will save you. Just don't do that.

(This is an indirect advantage of the Linux ecosystem: on Linux, virtually every application you will run on your machine comes as an "official" package, with secured distribution. On Windows, you install software from many sources, and you have to verify yourself whether the source is trustworthy or not -- which is a lot of work and nigh impossible for the non-technically inclined end user.)

Most of security comes from not doing anything insecure, especially what advertisements ask you to do in a very insistant way. If you cannot resist ads, then don't browse the Web.


How do you get a specific .onion address for your hidden service? .onion addresses normally should be made of a base32 string of the first 80 bits of the SHA1 hash of the private key of the server (see .onion address specification).
Today I ran into a service which clearly doesn't have an arbitrary address: http://sms4tor3vcr2geip.onion/
How does that work and is it secure?

Shallot is an older program, there are newer alternatives available now:

Scallion - uses GPU hashing, needs .NET or Mono: http://github.com/lachesis/scallion

Eschalot - uses wordlist search, needs Unix or Linux: http://blacksunhq56imku.onion

Eschalot can find longer human-readable names like seedneedgoldcf6m.onion, hostbathdarkviph.onion, etc.

The performance chart quoted above is a bit obsolete now, 8-10 character long .onions are easy enough to find.

There was a discussion back in the day, when shallot first surfaced, about whether custom names for hidden services are bad or not.

Problem number one: generated keys have a much larger public exponent than the standard keys produced by TOR, which puts a somewhat higher load on the TOR relays.

Answer: it was concluded that the difference is negligible compared to the other encryption tasks the relays perform constantly. In eschalot, the largest public exponent is limited to 4294967295 (4 bytes).

Problem number two: TOR developers can decide to filter and block all the custom names.

Answer: yes, they can, but they have not yet and there is really no reason for them to do so. They can just as easily change the standard for the random names too and cause chaos and mass exodus on the network.

Problem number three: generated names are easily spoofed, since the visitor clicking on a link somewhere out there can be tricked by the seemingly right .onion prefix without checking the whole thing. To demonstrate, which one is the real SilkRoad?

silkroada7bc3kld.onion
silkroadqksl72eb.onion
silkroadcqgi4von.onion
silkroady3c2vzwt.onion
silkroadf3drdfun.onion
silkroadbdcmw7rj.onion

Answer: neither, I generated all of them to demonstrate the problem. If you recognized that those were all fakes, you probably spend more time on the SilkRoad than I care to know about :).

To be fair, completely random addresses are even worse - if somebody edits one of the onion links wikis and replaces one random address with another, the casual visitor using that wiki would not know the difference.

Solution: it's essentially up to the person to pay attention which site he is really visiting, but the site owner can create a human readable address that is easier to remember, even if it's a completely random gibberish. As long as it's long and easy to memorize and identify. Some examples:

fledarmyusertvmu.onion
wifefeelkillwovk.onion
ladyfirehikehs66.onion
woodcubabitenem2.onion

I did not spend the time to intentionally generate good names, just picked some from the list I had left after testing eschalot. With a (very) large wordlist, unique looking names are easy to generate, but it will take time to go through
the results and manually locate the ones that are decent.

Well, that was my opinion and it could be wrong.

--
Hiro


Social engineering testing methodology? Is there anything that could be used as a social engineering testing methodology from any sort of organisation (example: ISO, SANS, PCI DSS etc.)

I'm assuming by methodology you are looking for a social engineering framework. At a really high level, you'd follow the same sort of steps that you would with any other attack.

Pick a target
Study the target
Identify vulnerabilities
Create plan to exploit identified vulnerabilities
Execute the plan
Walk out unscathed

Much like a technical hack, there may be many hops from entry to final destination within a company. A remote attacker might need to know Linux, macOS, Windows, and a few scripting languages to make it through the barriers. A social engineer needs the ability to build trust and think on their feet as they iterate through their targets, especially in live environments (say pentesting a bank).

For some good, free, social engineering information I highly recommend digging through social-engineer.org. They not only run their own seminars but frequently work with DefCon to create the social engineering village. A good place to start is here:

https://www.social-engineer.org/framework/general-discussion/


How did Evernote detect the security breach? http://blog.evernote.com/blog/2013/03/02/security-notice-service-wide-password-reset/

Evernote's official message says little about technical details of the attack and how it was detected.

Questions:

0) Speculate: How did Evernote detect the security breach?

1) How can unauthorized database access with valid credentials be prevented and detected?

2) How can database or file storage data leak be prevented and detected?

If this are too abstract questions, assume:

This is a rich client web application with database backend and Node.JS in between.
Apache Cassandra is the primary data store and ElasticSearch is a search index/engine
SQL Injection attack vector is not applicable or has been mitigated.

Speculation: they look to hire people who have experience with:

OSSEC (host-based IDS)
Tripwire and Samhain (file integrity)
Splunk (log aggregation, reporting & alerting)
Nagios
firewall & threat management
grsecurity/pax/suhosin etc
Nmap, BackTrack, and Metasploit (proactive security tools)

When the perimeter was breached, their monitoring and system management worked.
Assuming a least-privilege model, non administrative accounts accessing tables/data to which they do not have access (logged violation); or queries which do not match "known good" patterns (adaptive or anomaly detection); or queries which match "known bad" patterns (SELECT * FROM USERS), i.e. signature based IDS; or atypical system load patterns; or atypical data volume per query.
DLP, i.e. outbound content filtering/inspection for canary values, or suspicious values (the classic case being strings that are valid credit card numbers or SS numbers)


Intel How Strong is Your Password page, good advice? I came across this Intel How Strong is Your Password? page which estimates how strong your password is.

It has some advice on choosing better passwords including that you should use multiple passwords.

But then after it says this:

  Step 3: Diversify your social passwords for added security
  "My 1st Password!: Twitr" "My 1st Password!: Fb" "My 1st Password!: Redd"

Does this increase security over just using "My 1st Password!"?

I thought the reason not to use the same password more than once is so that if a site compromised, your passwords for other sites are still safe.

But if your password here was "UltraSecurePassword: StackExchange" wouldn't it be easy to guess your Facebook password would be "UltraSecurePassword: FB"?

Yes you are right. Using a pool of passwords is definitely recommended but the passwords should not follow a pattern, but that is how we think (we are security guys). May be the writer was thinking from a common user's point of view because most common users simply don't want to take the headache of remembering multiple passwords and having a common pattern in all the passwords may encourage them to use different passwords because now the passwords are much easier to remember (and easier to guess by a smart hacker).

I personally prefer to maintain a pool of passwords.Nowadays you have to create an account with a number of random websites and you don't know how they are handling your passwords. I remember once on a job portal (read monster.com) I clicked on forgot password and then they mailed me my original password in plain text (they are still doing it!!!). Here in our community we have some great discussions on password management but there are people out there who do not care for your security.

One should never use his bank related and other important passwords any where else. You can always remember a comparatively simpler password for these random websites.


Can an employer see cellular network traffic routed through company-owned device? When on the road, I have a company issued iPad with Verizon service, my personal ipad (wifi only version), and my iPhone.

If I turn on the hotspot on my company iPad, then connect my personal devices, can my employer see the websites I visit or the passwords I'm typing in or any other network traffic? I know they can see how much data is being used on the bill each day and what time of day and all that.

If they can see some info, will turning on a vpn connection in my personal devices stop that? Or would I have to turn a VPN on on the company iPad? or would I have to do both? And if I have to do both, wouldn't that greatly slow down the Internet connection?

I don't work in an office, I work out of state and stay in hotels. Hotel wifi is routinely very slow, sometimes to the point of not even being able to use it at all. For those reasons, I sometimes like to use company LTE. I like to use the hotspot for surfing the web, face timing my family, sending pics and text through iMessages.

Any explanation of what they can and can't do, or what info they might could get from the carrier would be great.

Some carriers have (very expensive) plans that connect the IP part of the mobile connection to an L2TP or IPSec gateway, making your mobile appear as if it were on the company's network. If such plans are in use, then it's the same as if you were browsing directly from the company's Wi-Fi or Ethernet networks.

Using a VPN terminated on your mobile device will help in regards to network monitoring (your company will only see an outgoing VPN connection to a server you control), that is, if their network will actually allow you to VPN out to an untrusted (to the eyes of the company) server - after all, outgoing encrypted connections can be used for sensitive data exfiltration or malware traffic. If this even works, it'll most likely be forbidden by your IT acceptable use policy and definitely raise some red flags on the sysadmin's side.

Note that no matter which network monitoring solutions might be in place, you still can't be safe as the company-provided device shouldn't be trusted - it's most likely managed by an MDM solution and the sysadmins have root access to the device. See the nice picture your girlfriend sent you ? The sysadmins are already looking at it. The super secure HTTPS-enabled webmail you're used to accessing ? The sysadmins can look at them because their CA certificate is in the device's trust store and they can thus impersonate any site by issuing valid (to the eyes of that device) certs.

I suggest you at least make it clear with the IT department whether you're allowed to use company-provided mobile network access for personal usage and whether you can VPN out to your personal server (or a third-party VPN service). If you are allowed, you should initiate the VPN connection from a trusted (non-work) device like your computer, and only use the company-provided hardware as a hotspot. In any case, don't trust their hardware with personal files even if they allow you to do so - the fact that you're allowed to use them doesn't mean they aren't allowed to look at what you do.


Improving the privacy of a casual Web user I am interested in improving the privacy available to me as a casual internet user with a default browser.  I think that Tor is too slow and that the "Privacy Mode" in browsers isn't really practical.  I don't care about hiding the history from myself in fact I like having a local history.  I care about companies tracking me and profiting from it.  There are a lot of Firefox addons for "Privacy and Security".  But which ones work,  and why do they work?

Interesting TED talk: Tracking the Trackers.

Below is a response to the title "improving the privacy of a casual internet user". As for individual plugins, you'll have to research and ask on an individual basis.

Block ads. This is an easy way to cut off forced interaction (e.g. image and iframe loads, popups, etc.) and prevents someone from getting paid for your clicks/views. If you are using Firefox, checkout Adblock Plus

Lie. During registration processes, don't be afraid to omit or falsify your age, phone number, location, etc. Within the extent of the law, of course. If you want help, seek this identity generator

Think about what information you're disclosing. Remember that things like emails (both sent AND received) and search queries are fair game for the companies who provide the service.

Keep informed. If these topics matter to you, stay current with the EFF and other whistle blowing groups.


Sending arbitrary request despite form constraints I have a flask web application which is configured with HSTS (no man in middle) and it has a login form.
Inputs to the login form have necessary constraints and HTML disallows incorrect formats. My question is if a user is on my site's login page, he would have the keys to the secure connection. Is it possible that he sends a malicious post request which doesn't follow the constraints of the html form on his side? How probable and difficult is it?
Can anything be done that such a thing is prevented at the client end itself?

Any validation done client-side shouldn't be trusted, because it can easily be ignored, bypassed or broken. It's trivial to post requests to your login form handler without using the actual page hosting the form, so that handler should always validate all input it receives.


Should I be worried if somebody uses my email to sign up for accounts? I recently received e-mails from two services: Paytm and Uber. They both seem like legitimate services. However I have no idea why I received these e-mails or why somebody would want to create an account with my e-mail.

The first e-mail provided a link to remove my e-mail from the system. I was wary to put my e-mail in, but considering that it had a valid HTTPS certificate and seemed legit on Google, I went ahead and did it (and received another e-mail confirming this action.) I also sent an e-mail to support for the other service and have not heard back yet.

What I want to know is:

Did I perform the right steps? Have I exposed myself to more risk by contacting these services?
Should I be worried? It seems that my e-mail account hasn't been compromised. I know that sometimes, companies will tell you to ignore e-mails if the action was not taken by you. However, I'm concerned because these seem like services that are easy to sign up for, but hard to disassociate with. I also don't want somebody just doing stuff willy-nilly with my e-mail.

I would have performed the same actions.  Confirm the validity of the website, and request the account be removed.

I don't believe you've exposed yourself to more risk at all by contacting these services.  The key to performing the above is to not actually click the link in the email.   Go to the service's webpage separately where you can verify the certificate, and if everything checks out email their support team about the fraudulent account.  This allows you to do your homework first without clicking on possible phishing links within emails.

You should always remove accounts that are linked to your email.  Even if your account isn't compromised malicious actors could be using the appearance of your email to gain the trust of others.

As far as a compromised account; if you're worried then I would change your password for the account, and ensure it's a good one.  16 characters will various symbols and numbers.  I would also turn on 2 Factor Authentication if your email service provides it.  This will lock down the account, and help you manage who is logging in.


What does it mean to get an email from someone with a different actual sender? I got a strange email and I just want to confirm my suspicions.
For background, I have my own email server which I set up using iRedMail on a VPS. I have an acquaintance who most likely has me on their address book, although I don't have them on mine.
I got a highly suspect email with "Urgent! <acquaintance's name>" as the subject, and a body that just said they need a favour. Looking at the headers of the email, I see that the Sender field is an unrelated university email address from another country, while the From field is my acquaintance's name and a different email address than the one I had communicated with them in the past.
My hypothesis is that their account got hacked, the hacker stole their address book and is sending a scam to all of their contacts.
My fear is that my own server got hacked, or something. My email setup did not complain about this email even though I have virus scanning, and I expect that the regular checks (DKIM, SPF etc.) were done.
Can anyone confirm my hypothesis?

It is still easy to spoof mail, as explained for example here and here. Which means your question basically asks how the sender got the combination of sender and recipient address in the first place.
While you suspect that the spammer got this combination from a compromised client and hopefully not from compromising your server it is impossible for us to say just based on this information where the spammer got these addresses from. There is no kind of identifier in a address itself which provides this information and all what you have are these addresses. And apart from the possibilities you've mentioned it might also be possible that the addresses where collected from public mailing lists or forums.


Is a one time session key okay? I was wondering if the following would be okay.

I want to have users connect to a server running SSL that authenticates user credentials, and sends them back a one time session key.  Users can then connect to a non-encrypted server and use this session key to login to their account.

One possible situation that could be sticky would be a classic MITB, and it would be easier due to having no encryption.

Thanks!

Most justifications for a non-encrypted sessions / information serving stems from not owning visitor (client) security concerns. i.e., "My server / my data won't be harmed, so I'm okay". If that's all you want and you're only serving content to authenticated/authorized users (not allowing them to change anything), then your strategy will work.

So I suggest you use encryption. Getting and using a LetsEncrypt certificate costs nothing these days (other than a few minutes of your time). It won't be long before browsers and search engines start warning users away from unencrypted sites.

  ... classic MITB, and it would easier due to having no encryption

For web applications, MITB has practically the same impact as client compromise. So "encryption" or other defenses don't help at all.

From the Wikipedia - MITB Article:

  A MitB attack will be successful irrespective of whether security mechanisms such as SSL/PKI and/or two or three-factor Authentication solutions are in place. A MitB attack may be countered by utilising out-of-band transaction verification, although ...


ncat ssl generates input/output error I'm currently attempting to use ncat to bind a cmd shell in Windows for remote access in Kali Linux.

On Windows, I first run:

ncat --exec cmd.exe -vnl Port --ssl

On Kali Linux, I then run:

ncat -v WindowsIP Port --ssl

I then receive a cmd prompt on Kali Linux, however, upon attempting to run any commands, I am met with no response. After pressing Enter multiple times, I receive an error:

Ncat: Input/Output error.

With no further details. I am running Ncat 7.31 on Kali Linux and Windows.

I have attempted using a different port, generating my own certificates and keys in a .pem format using openSSL and specifying these certificates and keys using --ssl-key and --ssl-cert to no avail.

Try using the --sctp option with both of your commands.


Which method of an port forwarding is more secure? I am at the design stage of an embedded system which requires an incoming connection to be forwarded through a consumer-grade router. This will carry an encrypted connection eventually.

I see three options here:

Setup port-forwarding from the router to the system with HTTPS.
Use UPnP to setup temporary port forwarding with HTTPS.
Use UDP hole punching and custom encryption on top.

The other end of the connection is a mobile device which will not have a public IP with a controllable firewall, so cannot be connected to in the other direction.

If I clearly get your question. You have three option to do a P2P connection with remote party. 1) UPnP 2) Port forwarding 2) UDP hole punching. I think UDP hole punching will be secure one, but it is hard to establish P2P connection using UDP hole punching when one of the party behind Symmetric NAT.

UPnP: Generally this concept has some security issue. Administrative credential does not required during port allocation using UPnP protocol. So if you enable UPnP in your router/NAT device then there is high possibility to allocate port by malware programs and pass information from your computer to a remote point.

Port forwarding: This is old technique, if the forwarded port disclosed to some other third parties then there is high possibility to DoS attack.


CSRF protection - 'back pages' OWASP suggests that when implementing CSRF protection any attempt to go 'Back' in the browser will cause issues as Interaction with this previous page will result in a CSRF false positive security event at the server.
I've seen online banks handle this by destroying the session as soon as you hit back, but i'm wondering if there's any alternative ways around this?
Ideally, i'd like to keep the session but just redirect the user to the front page (that they land on after logon) but i'm not sure if that's a safe way of doing things.
This is presumably a common issue in web applications, what options do I have?
Thanks

It's perfectly possible to use the Synchroniser Token pattern together with proper navigational/multi-tab support. It's only if you take the questionable advice:

  To further enhance the security of this proposed design, consider randomizing the CSRF token parameter name and or value for each request

that you have problems. In reality there is no good reason to do this on every request.

There is only a benefit to cycling the CSRF token at the point where a session elevates authorisation - typically on login and other paths that changes logged-in state (eg registration, account recovery, switch-user). These are the points at which you should also be cycling your session identifier, so it makes sense to do both at once. Changing the session ID prevents session hijacking through session fixation; changing the CSRF token prevents a CSRF attack through session fixation.

Navigation back to a cached page in the logged-out or previous-login state (or holding one open in another tab) and then trying to do something will indeed break, but most people probably won't be expecting that to work at that point.

You can put in some JavaScript to detect that situation if you like, checking that the session cookie matches the one that was used at page creation time. (Or an associated cookie that isn't the identifier and isn't httponly, as appropriate.) Then if it doesn't match you can add a warning div and reload link to the page, and/or prevent active form controls on the page from being responsive. You'd run that check onload, plus onpageview for bfcache if you're allowing caching, and potentially on an occasional poller to catch the multi-tab case. (This can also be of use to catch session timeout on the client side and present a friendlier error.)


Is LastPass secure enough? They said:

  Private Master Password:
  The user’s master password, and the keys used to encrypt and decrypt
  user data, are never sent to LastPass’ servers, and are never
  accessible by LastPass.

  Local-Only Encryption:
  User data is encrypted and decrypted at the device level. Data stored in the vault is kept secret, even from LastPass.

This raises a few questions:

If LastPass doesn't have my password, how does it know that the password I entered is correct?
How does LastPass decrypt my passwords on a new device?
Is LastPass secure?
What if I forget my Master Password?

From this support thread on the LastPass website:

  LastPass says they never receive my Master Password. Don’t I send it to the LastPass servers when I log in?

  No, when you login to LastPass, two things are generated from your Master Password using our code discussed previously before anything is sent to the server: the password hash and the decryption key. This is all done locally.

  The password hash is sent to our servers to verify you. Once verified, we send back your encrypted Vault. We are only sent your hash, not your Master Password.
  The decryption key, which NEVER leaves your computer, is then used to decrypt your Vault once it comes back.

So to answer your questions:

  How does LastPass know that my password is correct?

LastPass only has access to your vault in an encrypted form; they can't read it without knowing the key.  When logging in, your client only sends the hash of your password, and LastPass simply compares it to the password hash they possess.

  How does LastPass decrypt my passwords on a new device?

The decryption key is a function of your password.  As a result, the same input (your password) will always produce the same output (hash + the decryption key).  That's all your new device needs to know in order to decrypt your vault.

  Is it really secure?

The answer to this depends on how much you trust LastPass.

If it works exactly the way they say it does, then a sufficiently strong password should be relatively secure.

If at any point they obtain access to your password (whether it be intentional or accidental), you should probably consider it to be compromised, and should not only change your LastPass password, but the password for every account you have in your vault.

  What if I forget my Master Password?

If you forget your password, you lose access to your vault.  LastPass can't send it to you or reset it..

For users who are willing to trade away some of their LastPass security in exchange for a "safety net", LastPass allows you to produce and use One-Time-Passwords, and you can even enable Emergency Access to provide access to your account from specified users.

LastPass Help Desk - One Time Passwords

  One Time Passwords

  If you are using an untrusted public computer and need to access your LastPass data but are hesitant to do so because of potential keyloggers, LastPass provides One Time Passwords (OTPs) as one option for securely accessing your account.

  While using a trusted computer, go to https://lastpass.com/otp.php to create a list of random passwords that can be used only once to log into LastPass. You must be logged into the plugin to manage your OTPs. From this page, you will be given the option to Add a New One Time password, Clear All OTPs, or Print your OTPs.

  Each time you generate a new OTP, it will be added to your list. These passwords can be printed or carried with you on a portable storage device. You can then revisit the above page to login using this password and you can be certain that, even if captured, the password will not allow access into your account in subsequent attempts because it expires after you login with it once.

  You can even use OTPs with another form of multi-factor authentication (Yubikey, Google Authenticator, Sesame or GRID), to be even more secure when you are not using a trusted computer.

LastPass Help Desk - Emergency Access

  Emergency Access

  Do you worry about your family, friends, partner, or spouse having access to important accounts should something happen to you? Do you want an easy way to give them the passwords and logins they’d need to manage accounts on your behalf? Prepare for the unexpected and ensure your loved ones don’t get locked out of important accounts, like paying bills or the mortgage, and that they can manage your digital legacy.

  With the Emergency Access feature, you can give trusted family and friends access to your LastPass account in the event of an emergency or crisis. Your designated Emergency Access contact(s) can request access to your account and securely receive the passwords and notes without knowing your Master Password. You decide how much time should pass before they’re given access once they request it, and you can decline access if it’s requested unnecessarily.

  Emergency Access can also be used as an alternative account recovery feature, if you worry about ever forgetting your master password and want to ensure you have a backup way of recovering your vault.

  Please note: the person you share access with will need their own LastPass account as well.


Can any Android apps log my clipboard and upload it to their server without my permission? Everyday we copy paste texts that are sometime very important and we don't want anyone to see that. Can any Android app log our clipboard and upload it to their server without my permission?
I have checked settings to disable permission of an app that provides clipboard service but I didn't see any permission about it.

Asking this question is like asking whether apps that you install on windows can hack you. The answer is that while the answer is supposed to be no, in reality it is a resounding yes. Somewhere in the world, there is going to be at least one hacker who can exploit Android's local AV systems. It's called spyware. So while it is SAFER to stick with the google play store, if you are concerned about this I would recommend installing a secure AV or switching to a more secure OS. And even then, you are never going to be ENTIRELY safe from spyware attacks.


tools automating logins/hashes grabbing Lets assume I have access to the windows machine.

I want to grab raw info about logins/hashes from both system and installed apps, dump and analyze it later.

I could manually dump things like SAM database, saved passwords preserved in browser, im client, etc, but this seems to be rather time-consuming and I need to know what exactly to dump for every specific app.

Is there a way to automate the process? I.e. I'd like to run process that will search the system/apps to see what is installed and grab sensitive files, so I could try to crack them later.

Use metasploit with meterpreter scripts to invoke post_ modules.

http://en.wikipedia.org/wiki/Metasploit_Project

http://www.offensive-security.com/metasploit-unleashed/Writing_Meterpreter_Scripts


Can I determine actual origin of spoofed text message? Can I determine the actual sender of a spoofed text message? I received a text message yesterday that appeared to come from one of my contacts, but he did not send it. I contacted my carrier (Verizon) and they said that because the sender used third party software, they couldn't tell me where it originated. But they did say that the sender had to enter both of our numbers into the software, so we were targeted specifically. We have a rental business and have been threatened recently over evictions we're doing. I'm concerned for security reasons.

Your carrier is definitely able to tell who sent the text, as the sender's carrier's servers obviously connected to your carrier's ones to deliver the message and everything was logged.

They just don't want to go through the effort of diving into log files which would require paying for engineer time because the people who work at their customer service are only trained to sell stuff and don't even know what is a "spoofed SMS" (the incorrect explanation they told you proves it, no matter what software sent the message they should still have a log of where the message came from, whether it's their network or some other carrier).

Your friend should take legal action for identity theft, then the police will force your carrier to disclose any info they have about that SMS, including the origin carrier, from there they contact that carrier and they should be able to give them the identity of the person who sent the text (or at least, some possibly anonymous IP if it's an SMS API provider, but it's still worth a try).

The caller ID or SMS sender is just a string field without any particular meaning, while you can't spoof that using your mobile plan because your carrier always puts your number in that field on their side, you can definitely spoof it if you are a carrier yourself and have direct connections to other carriers, in which case you can pretty much put anything in there and your call/SMS will be delivered just fine with that (spoofed) caller ID/sender. Most SMS APIs offer that as a service so companies can send marketing messages originating from "company name" instead of a phone number, but of course the actual sender is logged on their servers for obvious purposes.


Lock Windows to a specific app Is it possible, using some program or application, to lock Windows 7 so only a specific app can be used, for example Word, until a password is entered?

The use case you are describing is perfect for a White Listing application.  In the past I have use Savant Protection and have had good success.  Savant allows you to specify what applications are allowed to execute though either a configuration file or by "training" it.  Savant will take all of the white listed applications, calculate their hash values and stoarge location and place all of this information into an encrypted database.  Before an application is allowed to execute, savant compares the current state against the database.


Would turning a Diceware phrase into a sentence decrease its security? Diceware passphrase lengths are on the rise - up to six or seven words now. The old adage that passphrases are easier to remember may be true for shorter phrases, but six truly random words can be tough to remember. On the other hand, full sentences may be easier for some to remember.

Take for example the Diceware-generated passphrase tracy optic renown acetic sonic kudo. We could turn that into a (nonsensical) sentence such as Tracy's optics were renowned, but her acetic sonic cost her kudos.

The Diceware passphrase has an entropy of 77.4 if the attacker knows you're using six Diceware words (12.9 per word), and 107.219 (according to this calculator) if they don't. The sentence form has an entropy (according to the calculator) of 255.546. However, it's not fully random any more, which is supposed to be one of the big benefits of the Diceware approach.

Assuming that the attacker somehow knows that you're using this method of passphrase generation, does the sentence form decrease the security of the passphrase in any way? For example, perhaps they can use some kind of analysis of English sentence structure to narrow down their required guesses?

Assuming the answer to the above is "No, sentence form does not decrease security," then here's another consideration:

One benefit of the sentence format is that it's very long and includes non-alphabetical characters (eg. the apostrophe and comma). However, that's a definite downside when trying to type it on a mobile device. Say we shorten the Diceware phrase to three words - tracy optic renown - and then turn that into an [a-z] sentence - tracy is optically renowned or perhaps tracy is optically renowned worldwide (to further distinguish it from the Diceware wordlist).

If we were to use three Diceware words and the attacker knows we're using Diceware then we have an entropy of 38.7. However, tracy is optically renowned worldwide is 100.504 bits of entropy according to the calculator.

Given the differences between the three word Diceware phrase and the short sentence form, which entropy calculation is more accurate - the Diceware calculation (ie. the differences are too slight to matter) or the calculator's calculation (dictionary/brute-force/etc.)?

Note: assume that any length or combination of characters is acceptable for the password

It does not decrease the security.  What is actually happening is that your "entropy calculator" is giving you a false measure of entropy.  It can only give an approximate estimate, after all.  There's actually interesting proofs that show that one can never actually know the amount of entropy in a particular string of text unless you know something about how it was constructed.  A pass string 1000 words long created by a "physical random number generator" like a resistor noise network will appear to have the same amount of entropy as a pass string 1000 words long generated using a Mersene Twister, until you realize that the Mersene twister actually leaks all of its seed information in any contiguous block of 624 values.  Entropy calculators can only make heuristic assumptions about how random the data actually is.

This, of course, is why we have Diceware.  It can prove [an underestimate on] entropy because randomness is built into the process.  To prove the security of a pass-sentence like you are looking at, consider an oracle test.  I select a bunch of words using Diceware, and then I build a sentence out of them.  I then provide you with an oracle which constructs sentences out of them.  It is guaranteed that, if you provide the oracle with the correct set of selected words from Diceware, it will provide exactly the sentence I used.  For all other sets of words, it will produce an arbitrary sentence using them.  It is trivial to see that the entropy of my password cannot possibly be lower than the entropy built into the Diceware words I selected.  Even with this immensely powerful oracle to reduce the very human process of sentence formation to nothingness, the randomness from diceware will remain.  You cannot guess my password any faster than you could guess the original set of Diceware words I selected.

Now there are a few caveats.  If you use fewer diceware words, like your later example, you get fewer bits of entropy from the diceware layer.  This means that oracle I mentioned above becomes more and more helpful for breaking the sentence based password.  Also, some of the sets of words you get from diceware can be particularly difficult to turn into sentences.  If you ever reject a set of diceware words as part of your pass-sentence building process, you are calling into question the perfect randomness that diceware relies on.

Now, why the oracle attack?  Oracles are very powerful tools for testing cryptographic theory.  In reality, tracy is optically renowned worldwide is actually probably quite a lot stronger than the 38.7 bits from the diceware words tracy optic renown.  Breaking that sentence will take more work than the words, though probably not the full 100.504 bits the entropy calculator heuristically estimates.  So how much stronger? We don't know.  That's the point of oracle attacks.  In an oracle attack we say "let's just assume this hard to calculate part of the process offers zero increased security.  None at all.  Is the process still secure?"  If it is secure under this extreme assumption, then it is clearly secure against real life attacks where the attacker doesn't necessarily have such a magically powerful oracle at their disposal.


What are the security implications of net.ipv4.conf.eth0.route_localnet=1 / route_localnet? sudo sysctl -w net.ipv4.conf.eth0.route_localnet=1

What are the security implications of route_localnet?

The documentation for this options shows the following:

route_localnet - BOOLEAN
    Do not consider loopback addresses as martian source or destination
    while routing. This enables the use of 127/8 for local routing purposes.
    default FALSE

In essence it tells the kernel not to treat local routing for as a danger and refuse it. As long as net.ipv4.ip_forward is 0 you shouldn't need to change route_localnet. In most cases you only need this when you do some PREROUTING and/or FORWARD with iptables.

The security risk is limited if this isn't on a public facing network interface and otherwise you want to make sure ingress and egress filtering is done correctly. This to reduce the effects of spoofed traffic.


Use of openssl could be a weak point in an Android App? I'm reviewing an Android app (consists of Java and C source).

There are complicated obfuscation steps in the build process (for content protection).
But it uses statically linked openssl library for AES encryption/decryption.

I'm not a binary hacker but it seems ironical to me.
Why use (almost) public open-source binary library when obfuscation is required?

Can the linked openssl library led to compromises?

Is it rational if I suggest as below?
1) get rid of openssl binary modules
2) find other open-source AES implementation
3) build the AES source with obfuscation

Obfuscation is "required" when either of the three following situations applies:

The application does something which is inherently weak such as embedding a secret value in the source code.
The application designer wants to "feel safe", and is sufficiently incompetent at cryptography so that obfuscation provides that feeling (ignorance is bliss).
The application vendor wants to protect his "intellectual property". Code obfuscation will not ultimately prevent copiers from understanding how the code work, but it may delay their reverse-engineering efforts by a few days (not much more than that); more importantly, obfuscation is a way to make it obvious that the code contents are not meant for external inspection, which helps in obtaining legal qualification of forbidden reverse engineering in some jurisdictions.

Removing and/or obfuscating OpenSSL will not really help if the application embeds secrets or try to do "content protection"; the endeavour is hopeless anyway (that's case 1). As for case 3, there is no intellectual property to protect in AES because AES is already public, and is not the vendor's property to begin with. However, obfuscating OpenSSL (or removing it and replacing it with a homemade implementation, or any other ritualistic incantation) can go a long way towards helping the designer sleep at night; if that's what it takes to make him happy...

The underlying idea is that despite what some people strongly believe or claim, obfuscation does not work. Well, it does not break the code, the software still works after obfuscation; but it does not increase technical security against reverse-engineering, and does not improve content protection. The one point which may make obfuscation a rational decision is legal qualification; and that one does not apply to OpenSSL, which is already open-source.


How to establish VPN connection through Tor? How do I connect to a VPN network via Tor? Is it more anonymous than the other way around (VPN-->Tor)?

Actually, tor only provides a socks proxy. So your OpenVPN, for example, needs one additional line:

socks-proxy 127.0.0.1 9050

Additionally, you have to exclude tor traffic from vpn, which will not be too easy, and there is plenty room for mistakes.

Actually, I don't see any advantage for you, using vpn over tor, as it might be very unstable and break when changing the exit node, which will happen from time to time.

But if you run tor over vpn, you have better protection againts dns leaks, or misconfigurated apps. Also, if the vpn connection breaks, there is still tor.


Storage of the One Time Password Seed I'm a student and I'm working on an OTP authentication systeme based on
OATH using smart phones as tokens for the clients.
My problem is the protection the OTP seed at both client and
validation server; encrypting the seed using a passphrase or a PIN
is a solution. My question is if there is another methods to ensure the
security of the OTP seed ?

Thanks in advance.
Have a nice day.

Your title asks about storing data. The body of your question asks about transmitting data. The purpose of a one time password is to only use a password once. They do not need to be protected, but that's assuming the network is safe which is a matter of cryptographic authentication or a matter of trust in the network.

Entering secret data defeats the purpose of one time passwords. Since pins are so short you could reverse the encryption by brute force. Your description is so vague, I am certain there are be various other problems in the scheme as you understand it.

I beleive Wikipedia has multiple concise articles about different one time password algorithms.


Protecting the user from unauthorized access So we are planning on adding a feature to our app that is similar to what Google does, but a little stricter:

You have a list of sessions that are tied to a user agent and IP address(?) (google shows a location)
2FA is only needed when you try to login from a device that hasn’t been approved for the last 30 days.
If a login attempt is made from a new user-agent/IP pairing, we would like to send a link with a token to their email address to approve the login.
When they click the link, if 2FA is active, we will ask for 2FA to approve the login.

A few things we are wondering about:

By making the user take action to approve logins, rather than Google where it just tells you of the login... we hope to prevent a higher number of unauthorized logins. (Currently we send a mail every time the user logs in and we tell them the user-agent and region.)
By requiring 2FA to utilize the link, we hope to further protect unauthorized login (while you can password reset with email access, we require 2FA auth before you can get to the page for entering the new password after clicking the reset link.)
Our biggest concern is that we aren’t going to accidentally make some mistake and some user will have to jump through this hoop a billion times in the same session because their mobile carrier is switching their IP constantly... etc etc

So I am getting an idea that IP based restriction is probably not too good... so maybe look up the region via IP and just whitelist the region? But then a hacker could just easily spoof user-agent and use a proxy.

Note: I understand this is not our stop-all for security, but we would like to add this layer to help lower the instances of unauthorized access.

My question: What overall model for session/login restriction will strike a good balance between “preventing newb hackers / jerks from logging in as you when they guessed your password / phished it” and “not annoying the user all the time with mail auth links”?

To be honest, there is no "right answer" and this will probably require some trial and error. I use a VPN all the time and hop IP's - but I know when I do that my bank requires 2FA every single time. That's a choice I'm willing to make, whereas your users may not. Most people with unusual IP's will accept this part of privacy, and those who use the same ISP subnet connecting from the same place (their house or place of business) will expect consistency, so a Malaysian IP will look odd and 2FA will do exactly what it's supposed to do here.

Generally, a mobile user will not have to jump through hoops unless you connect and reconnect to new networks while using your application. If using cellular data, they should be fine and maintain a consistent session.

Depending on what sector and how critical the data is you're protecting, its almost always better to lean on the side of caution. Make sure to put in a login note to tell users why and how you're protecting their data and they will either understand or whine and deal with it anyway. Breaches are in the news daily due to people trading convenience for security, and I would never want to explain to my CEO why a squeaky wheel client changed my mind about blocking an IP or using 2FA resulting in a fully compromised server and a .csv on pastebin with 1 million of our customers creds.


Difference Between Web and Chain of Trust I have a basic understanding of the "Web of Trust" used in PGP. I would like to know how the "Web of Trust" differs from the "Chain of Trust" that's used for SSL certificates?

The primary difference is that PGP does not trust a set of central authorities while SSL does. In SSL the certificate authorities do the required checks and then certify that the identity of the certificate holder is correct for the level of certification. We trust the CA's decisions and trust who they trust.

The different certificate types theoretically correspond to different levels of background checks. For a basic certificate this is as simple as verifying that the requester controls the domain. For an EV this requires significantly more checks (incorporation, place of business etc).


How to report vulnerabilities without being regarded as a hacker? I just discovered that my university alumni's login page is just plain HTTP.  Wireshark confirmed that the credentials are sent using an HTTP POST message.  I did a bit of research and, as I thought, HTTPS should always be used on the login page (See Is it secure for a site to serve the login page with HTTP, but have the actual site in HTTPS?).

First of all, I'd like to do my university a favour, but how can I make them to take some actions?  It's highly probable that my personal data, such as degree and year graduated, is store on the alumni database.  It's not surprising that some organizations don't take such a report seriously (See
How do I report a vulnerability to a large organization that doesn't believe it has a problem?).  I've emailed the university's IT helpdesk using my alumni email account, but the personnel asked me to direct my inquiry to a general alumni inquiry email.

On top of the technical details, how can I make sure that no police will arrest me for hacking?  I have not attempted to steal any personal information.  I am not interested to report this vulnerability to some security forum before the university takes some action.

P.S. I'm embarrassed that my CS degree was from that school.

Simply reporting that it is using HTTP rather than HTTPS for login and that that is insecure shouldn't get you accused of hacking.  It is something immediately publicly visible from looking at the site.

There are many ways of detecting vulnerabilities which could actually be considered hacking (for example, running a vulnerability scanner against a target you aren't authorized to run it against), but I'm not aware of any jurisdictions that would consider looking at the page and recognizing a flaw that is immediately visible to be hacking. It would be a bit like walking by a house, noticing that someone was leaving their door open when they were leaving and being accused of being a thief when you pointed out to them they left the door open (while you aren't even standing on their property.)


Do dynamic certificates for SSL-Interception pose a security risk due to weak entropy? When you think about typical SSL-Interception in Firewalls, depending on the number of TLS-Connections, loads of Certificates get faked "on the fly" in a very time critical environment.

In my experience on running a VPN Service based on OpenVPN you'll always want your entropy high enough to be sure that there is always enough entropy for creating "good" new certificates.

So, considering the massive amount of generated certificates, how do typical firewalls ensure they have enough entropy? Do they even do that?
And if not, is this just a theoretical security risk or are there know attacks based on the possibly weak entropy?

Yes, there is a risk here, though it is almost entirely limited in scope to the network/users of such  proxy/firewall devices. Low entropy could also have a very minor effect on the client nonce in the TLS handshake impacting outbound connections from the proxy/firewall device.

Low entropy might mean guessable primes, which means guessable private keys, which can lead to viable MITM attacks. If there's a low-entropy issue on such a system, and the CA key is the first thing generated, then you might have a real problem.

(There's an obvious beartrap with such systems if using a shared or vendor provided key/CA, but that's quite a different problem.)

Greater risk is generally assigned to issues of proper chain and revocation verification, and poor configuration leading to the use of insecure legacy SSL or ciphers, see US CERT TA17-075A HTTPS Interception Weakens TLS Security (to this I would add insufficient protection of private keys, at least one commercial product supports HSMs, though I suspect that only works for the internal CA rather than the on-demand certificates).

The potential issue here is that if the entropy is low, the primes may be predictable — but this alone doesn't make the modulus easier to factorise (to determine the private key). It does make a brute force attack viable, in this case brute forcing PRNG input (the attacker knows the PRNG) to attempt to discover a prime (and hence key) that's in use.
If you happen to be an evil administrator with access to such a proxy that you can harvest keys and certificates from, then you have the deck stacked in your favour if attacking someone else's proxy.
As an evil user you might be able to generate enough traffic to find collisions, but this is less interesting.

In practise (certainly the case with OpenSSL) a PRNG is used to generate the key source material (to search for primes), so very little "real" entropy is required. A proxy is generally a good candidate for harvesting entropy from timing and hardware events (potentially busy network and disk, with many random connections).

I estimate roughly 90-100kiB of PRNG output would generally be required for a 2048-bit key generation (2x 1024-bit primes, with a naïve generate/test/discard algorithm), requiring only a handful of non-PRNG bytes of "real" entropy to seed (32 bytes by observation). The delay in key generation is actually the primality testing.

For the implications of low-entropy keys you can read the (wittily titled) paper Mining Your Ps and Qs: Detection of Widespread Weak Keys in Network Devices (PDF).

There are two useful papers which discuss security issues around the use of such proxies:

The Security Impact of HTTPS Interception (PDF)
Killed by Proxy: Analyzing Client-end TLS Interception Software (PDF)

These raise many other security concerns, but randomness/entropy is only referenced briefly in the second one:

  Entropy during generation.
  It is possible that the entropy
  used during the generation of a new public/private key pair
  in install-time generated certificates is inadequate. In practice,
  since most products we analyzed generate a root certificate
  with RSA keys using OpenSSL, the generation process is
  expected to call certain known functions, e.g., RAND_seed(),
  RAND_event(), RSA_generate_key_ex(); we found
  calls to the last function in many cases. However, we did not
  investigate further the key generation algorithm in CCAs.

See also:

Attacks on keys generated with low entropy


Two factor verification apps IOS I have an iPhone XR with the latest updates.
I use Microsoft Authenticator for some 2 step verification for work related stuff.
Today I enabled the Instagram two factor security option and choose the app authentication.
This prompted me to download an authenticator by DUO security. So I gave that a try.
Once downloaded I enabled Instagram 2 factor again. It now noticed I had installed the DUO authenticator, but instead opened the Microsoft authenticator.
I went through the steps of the Microsoft authenticator and instagram accepted it.
Instagram now uses the Microsoft authenticator whilst it did not recognize it at first.
I am wondering if, somebody with malicious intent, can exploit this.

This prompted me to download an authenticator by DUO security

This was merely a suggested app. It was basically an ad.

It now noticed I had installed the DUO authenticator, but instead
opened the Microsoft authenticator.

No, it didn't. I do not have DUO installed, but on my Instagram, when I tried to set up 2FA, it mentioned DUO, but it opened my Google Authenticator. It looks like the DUO mention is hard-coded on that page of the app.

could one put a fake authenticator (instead of the Microsoft one) on a
phone and fool instagram in using the fake authenticator and thus
extracting user login/password

Yes, it would be possible to put a fake 2FA app on a phone that might be recognised by another app. No, the app is not tied to the password, so there would be no risk to the password.


Linux hardening for privacy/security I'm kinda new to the privacy/security world and currently I'm using Windows in my machine. I want to start over and install a Linux in my machine and take good steps to protect my privacy. Is there any tutorial out there for setting up your Linux to protect privacy and security? I don't need any military security type, just enough to use on a daily basis to work and navigate in the web. I found some guides on the internet but they were very old, so thanks for any help you guys can provide :)

Security and Privacy are really two separate things and as such, really need you to define what you need/want. Here are some examples:

Privacy/Anonymity:
If I want to browse the open internet freely and at will without people logging who I am and what I am doing, I ill do several things.

Have a VPN connection to a VPN provider that does not log data.
Use a browser that has never logged into any of my social media accounts, does not have stored cookies, does not have access to my LastPass, etc.
(Windows) On the operating system level, I use a MAC address changer to switch up My MAC from time to time to help deter OS fingerprinting.
(Windows) Utilize Spybot Anti-beacon
(Linux) machanger -r [interface Name] --> Example:

ifconfig eth0 down
macchanger -r eth0
ifconfig eth0 up

(Linux) Use Tor Ghost
Other options for more privacy would be to look into TAILS OS, and or WHONIX

Now, as for the security part. This largely depends on what you are securing yourself against. Assuming you're just an average user, Linux is a good choice if you know what you're looking at. Make sure you configure your Linux machine properly. Here are a few steps I always take.

Disable root login within /etc/ssh/ssh_config
Disable Password authentication completely for all users.
Enable Key based authentication. Here is a good tutorial
Disable ICMP requests.
Enable UFW and check IPTable Rules
Verify open ports and make sure there's nothing that's open and not being used. If there is, close those ports.


ASLR and how a program can actually call its functions I'm studying protection techniques and I've got a doubt about how ASLR works for a program in a Windows environment.

As far as I know ASLR works by randomizing part of the imagebase address when loading the module into memory so that exploits cannot rely on hardcoded addresses.

My question is: suppose that a program uses the module "kernel32.dll" and loads it into its address space. There are probably CALL instructions inside that program like

...
CALL some_address_inside_kernel32.dll
...
...

how does the program know where to jump to if kernel32.dll function addresses are no longer reliable? Does the loader intervene in this process?

You do not call functions inside the kernel. The kernel resides in another privilege level; its memory pages are not accessible from normal code. To jump into kernel code, application code performs a system call which entails using a specific doorway which handles the temporary privilege escalation. On a 32-bit x86 system running Linux, this is done with int 0x80: a software-triggered interrupt. The system call parameters are provided by the caller in some specific CPU registers; in particular, the %eax register contains the symbolic identifier for the system call which the application wants to perform. The interruption handler (within the kernel) looks at the CPU registers to know what the application wants the kernel to do (whether the system call is granted is yet another issue).

There is no ASLR for system calls; this is not a relevant concept here. ASLR is for DLL. A DLL is a piece of application code which is loaded into the application address space and is accessible to the application under its normal privileges; in particular, the application code can "jump" into the DLL code with a normal "jump" opcode (a function call is nothing else than a glorified jump).

Since the actual address at which the DLL will be loaded is known only when the DLL is actually loaded, application code follows special conventions so that its jump opcodes can be dynamically adjusted to point to wherever the DLL happens to be loaded. This dynamic adjustment is performed by the dynamic linker. This linker uses relocation tables to perform its job: an entry in such a table describes an opcode which needs to be adjusted, and the name of the function which the opcode tries to reach. When the DLL is loaded (by the dynamic linker), the emplacement in memory of that function is known, and the jump opcodes described in the relocation tables are adjusted.

As you see, the whole concept of DLL allows for the DLL to be loaded at an arbitrary emplacement in RAM; that emplacement may differ upon successive executions of the application. The actual emplacement depends upon where there is a sufficiently large "hole" of free memory to do the loading, so it can change depending on what the application does, how much memory it allocates previously, and so on. DLL loading "naturally" implies non-fixed loading addresses. ASLR is just voluntary moving around of DLL: the dynamic linker chooses a random (free) loading address on purpose. This is (almost) completely transparent for the applications.


Should a PCI-DSS certification be renewed? I did not find any mention of the need to renew a self-assesment (PCI DSS SAQ-A or SAQ-A-EP) in the PCI DSS documentation.

There are mentions of renewal for assessors (to maintain their accreditation) and a search over Internet points to random sites with exactly this question (should the certification be renewed) - and the response is "yes, yearly" without any sources.

Is there a primary source for the need to renew a SAQ-A/A-EP questionnaire?

From the intro section 'Scope of PCI DSS Requirement' in v3.2:

  The first step of a PCI DSS assessment is to accurately determine the scope of the review. At least annually and prior to the annual assessment, the assessed entity...

A SAQ is completed in lieu of an assessment and given that the assessment requirement is annual, by implication that SAQ requirement is annual as well.


What are the best practices for naming backend-internal WebSocket endpoints? In the backend I am currently working on I have a servlet (call it S) and a WebSocket endpoint (call it E). S needs to communicate with E, yet, as of now, any WebSocket client may connect to E.

My question is: how should I name the URI of E and how can I enforce that only S is allowed to communicate with E (if that is possible in the first place).

(I am interested in any answer, approximated or exact.)

While I agree with the previous answer that naming should not be considered a strong security control, I would suggest that you avoid naming things in an overtly obvious manner (i.e. "ThisServerHostsMyCrownJewels.company.local" :) )

In terms of how to allow only 'S' to talk to 'E', that is a technical question for which a lot more detailed information on what platforms, versions, etc. are in use. The short answer is it could be done via traditional firewalling, or using IPTables or configurations in the WebSocket server, or perhaps more preferably a combination of two or more of these.


How can an attacker using Kali/Parrot proxychains, no Tor, no logs kept by proxy providers, be tracked down? If an attacker uses proxy list from a US based company, investigators can use the logs to retrace the attacker's real IP address (even if the proxies are in China, logs should be kept).

If the company was based elsewhere, no diplomatic relations with the US/Europe, no logs.

What can an investigator do in this case (not the NSA)?

Particularly, is the proxy chain reversible in some other fashion or will the investigators be forced to follow other leads?

Alas, I couldn't find much info from the perspective of normal security investigators, but I did find:

Does a chain of proxies make tracing the original IP
harder/impossible?
Is using VPN, Tor and ProxyChains together more secure?

However, these are not exactly my question.

Things that come immediately to mind -

Whilst the proxy operator might not keep logs the ISPs may. Especially if they have been asked to for a specific site / user by authorities.
Even if they can't see the entire route on the parts they do they could attempt packet matching. Especially if sending something of a particularly unique size.
If they control the remote server they could attempt browser fingerprinting or exploitation.
If they suspect you then they can attempt to prove your machine has visited that site - i.e. if you have a file that has come from it or it is contained in your browser cache.


Could some one please explain - Remote Post SQL Injection Would anyone be able to post a link to an article which explains how to do a Remote Post SQL Injection and how to prevent anything bad happening. Or even just explain on here.

Any help would be great.

Remote SQL injection is usually a product of poor programming and bad database configuration.

Unescaped characters.
No input validations.
Setting a vague limit in the number of character field.

You check for the metasploit framework and you can learn lots of things from there:

http://www.offensive-security.com/metasploit-unleashed/SQL_Pwnage

Try to read also this post. It should give you a good overview.

http://shiflett.org/articles/sql-injection