SSH Log: "Accepted password for user..." I have only port 29999 open for SSH connections. But in the log file I see entries like this:

Accepted password for user1 from 190.101.200.100 port 55805 ssh2

saying that a connection was accepted from port 55805. What does it mean? that someone was able to hack the server?

That port number is the client's source port, not the destination port.


Who (Designer or User) Should be Resposible for the Correct/Secure Usage of a Tool Intended for Developers/Admins? There is a healthy debate around a series of stack overflow posts that refer to the "RunAs" command. Specifically the discussion is in reference to design decision that the folks at Microsoft made a long time ago, to users of this command to enter the users password in one specific way, Raymond Chen accurately summarizes one side of the argument quite clearly:

The RunAs program demands that you type the password manually. Why
doesn’t it accept a password on the command line?
This was a conscious decision. If it were possible to pass the
password on the command line, people would start embedding passwords
into batch files and logon scripts, which is laughably insecure.
In other words, the feature is missing to remove the temptation to use
the feature insecurely.
If this offends you and you want to be insecure and pass the password
on the command line anyway (for everyone to see in the command window
title bar), you can write your own program that calls the
CreateProcessWithLogonW function.

I'm doing exactly what is being suggested in the last line of Raymond's comment, implementing my own (C#) version of this application that complete circumvents this restriction. There are also many others who have done this as well. I find this all quite irritating and agree with sentiment expressed by @AndrejaDjokovic who states:

Which is completely defeating. It is a really tiresome that idea of
"security" is invoked by software designers who are trying to be
smarter than the user. If the user wants to embed the password, then
that is their prerogative. Instead all of us coming across this link
are going to go and search other ways to utilize SUDO equivalent in
windows through other unsavory means, bending the rules and wasting
times. Instead of having one batch file vulnerable, i am going to
sendup reducing overall security on the machine to get "sudo" to work.
Design should never smarter than the user. You fail!

Now while I agree with the sentiment expressed by Microsoft and their concern with "embedding passwords into batch files" (I personally have seen poor practice myself way too many times), it really does strike me as wrong what Microsoft has done here. In my specific example I'm still following best practices and my script won't store credentials, however I'm forced to resort to a workaround like everybody else.
This decision really follows a common pattern at Microsoft of applications acting in ways that are contrary to the needs of the specific users with the intention of "helping" the users by preventing them from completing a action that is viewed as unfavorable. Then obfuscating or purposely making the implementation of workarounds more difficult.
This leads us to a broader question, extremely relevant to this issue, who is the true responsible party when it comes to security around credentials, the user of the software or the designer of the software? Obviously both parties hold some responsibility, but where is the dividing line?
When you create tools for other developers should you seek to the best of your ability to prevent them from using your application in an insecure manner, or do you only need to be concerned about the application itself and whether it's secure internally (irregardless to how the user invokes it)? If you are concerned about "how" they are using your application, to what extent do you need validate their usage (example: should "RunAs" fail if the system is not fully "up to date" i.e. insecure in another way), if that example seems far fetched, then define that line, in the case of "RunAs" the intention is quite clear, the developers who created it are not only concerned about managing credentials securely internally with their application but also care deeply about the security implications of how you use it. Was their decision correct in validating the usage in this case, and if so/or not where should that dividing line be for the applications that are created in the future?

Many forms of restricted usability exist to protect developers from negative perceptions resulting from widespread misuse. It's a numbers game. If RunAs was less restricted, related security failures would be the fault of the script authors (IMHO), but the industry might believe that the underlying software was insecure. If a junior admin got in trouble for embedding passwords in their scripts, they might also get angry that the mistake was so easy to make.
The "Right to Repair" discussion has a similar reasoning. It's partly about preventing shoddy repairs from being associated with the brand. If a "reconditioned" iPhone breaks easily, it's likely Apple that will be blamed to some extent, even if the reconditioning itself was at fault. It comes down to control over the quality of a product after it's in the hands of the user.
Who is responsible? Whoever is most likely to be blamed when something goes wrong. Perception is reality, especially when money is at stake. RunAs can be used in so many ways... the "misuse surface" is huge, which was likely a factor in their decision. It makes sense, even though the resulting annoyance factor is obvious.
Where should the line be drawn? Where enough users can't reasonably blame the developer for something that the user had control over. This is usually a function of how competent the user/team/company is when it comes to articulating their level of due diligence and ability to mitigate issues that arise. How much risk is acceptable vs. how many users will complain.
What design responsibilities do developers have? Developers should strive to provide idiot-proof security measures, while still allowing super users the flexibility they need. Elegant solutions do exist, and we should have enough empathy for the users to seek those solutions out.


What is a YubiKey and how does it work? How do YubiKeys work? Are there any alternatives?

Here is a picture of one:

As I understand it, Yubikey acts like a USB keyboard. You plug it in your computer, place the cursor in a form field, press the button on the Yubikey, and it sends out a text string of 44 characters to the computer like you are typing those 44 characters. The computer doesn't know the difference between you typing it or the Yubikey generating it.

A website like a Wordpress site with Yubikey plugin, or the Lastpass addon in Firefox, or any other website that has a Yubikey option, has a login form with username, password, and Yubikey password. You enter your username and password, place the cursor in the Yubikey field, then press the Yubikey button, and it enters the Yubikey password into the field.

Then the form is submitted, and the Yubikey is validated in the Yubicloud. The website checks if the entered Yubikey password is valid. The Yubikey itself does not connect to the Yubicloud. It's just a device generating a string sending it out acting like a keyboard, and it does not connect to the internet or anything except as that keyboard.

Before all this works, you need to update your account on the website to use Yubikey. That means you need to link your key to the account. That way the Yubicloud can check the generated code and validate it against your account.

The website of course needs to implement the Yubikey functionality, which is available as a free service for website owners.

If the Yubikey gets lost, you can use the normal recovery methods the website has to recover your account and disable the Yubikey. Normally this means that you get a password recovery link via email, and that link disables the Yubikey function in your account.

I mailed Yubikey support to see if this answer is correct. They said this explanation was correct, except that it explained only one part of the way the key works.

The other answers here don't give any real explanation. Even the Linuxjournal article doesn't explain it this way. The accepted answer gives a black-box answer - not what I was looking for when I opened this page. I hope this answer gives a better explanation and writing it made me understand the Yubikey better.


Problem capturing the WPA handshake I have an Alfa AWUS036NHA wifi external card. I use Kali Linux 2.0 with Wifite. And i'm unable to capture any handshake. The program deauthenticate the device correctly but no handshake captured. I tried it with a lot of different networks but i can't figure out the problem. Can someone help me?

You need a good signal to capture. -69 or less, tending toward 0. You can remove some noise by placing your sniffer card inside a metal container (like a BUCKET), with the top facing toward the target WLAN. The container must have a diameter of at least 12.5cm (2.4GHz wavelength). Yes, I know cantennas have a smaller diameter, just trust me on this. You can also use a metal bowl, or one of those meshed bowls for keeping fruit in, as long as it has a fairly fine grid.

Copper, gold and silver are best. Aluminium is pretty good. Steel is not so good, but better than lead. Hehe. You are not building an antenna, you are building a filter for interference. Most of the irrelevant radiation around you will not pass into your sniffer card.

silver 422 W/mK
copper 402 W/mK
gold 298 W/mK
aluminium 226 W/mK
steel 73.3 W/mK
lead 34.8 W/mK

Your mother's silverware? Use it.

ALFA cards have sort of poor reception, it's best to use nice expensive radio card for sniffing. Make sure you are running off battery on your laptop, or there's gonna be even poorer reception. It also helps to change the case to one made from aluminium (connect it to ground).

Remember to deauth using one wifi card, and pick up the handshake using another. Wifite is weird. Just use kismet.

Edit:
I just used an ALFA adapter for a bit, and noticed reception got a bit worse as the board inside heated up. I added more uh, passive cooling outlets, and heatsinks. Behold:

Amazingly, the adapter is now as good as my builtin mini pci card for wireless, although a bit slower to respond when issuing commands to change modes etc. Everything electronic from china should be heatsinked. Perhaps it will also help A LOT to put it in a metal box!

Edit2: Poked around a bit more, and it definitely helps to use short USB cables with ferrite bead(s). You can buy these cables with beads attached (typically used for harddisks), or just buy snap-on ferrite beads and attach them one by one until you stop seeing improvement in reception.


Google certificate gcp.gvt2.com untrusted / expired? My antivirus noted gcp.gvt2.com certificate is expired today, gvt2.com alegently used by google analytics.
It might to do with Google distrust of Symantec https://security.googleblog.com/2018/03/distrust-of-symantec-pki-immediate.html. Is that possible that google is late updating its own certificates?

No, that the certificate expired today (as shown in the screenshot) is unrelated to the Symantec untrust.

  Is that possible that google is late updating its own certificates?

Well, it is possible.

Note that gcp.gvt2.com doesn't resolve here, though.


How to Check Open Source Code for Vulnerabilities? I am a member in bug bounty platform. There are some programs that make their source code available to the hackers to find vulnerabilities. For example, their PHP, JS, C++, or ruby code.

I want to know

How Hackers sanitize these code to understand it?
How Hackers work to find vulnerabilities?
What tools they need (besides a vulnerabilities scanner)

It largely depends on what it is you are trying to find bugs for. And I can tell you now that there will never be a one size fits all approach to this. Finding bugs in something like OpenSSL will be quite different than finding bugs for a public facing web application.

Since you mentioned bug bounty platform and a number of web scripting languages (maybe not so much C++), I would assume the platform is more for public facing web apps/sites than anything else.

In my experience with hacking web apps, if you have access to the source code, and even if you don't, the best place to start is with the mindset of: As an outside user, how can I make this app fail in ways that are beneficial to me.

You could start looking at what input you can and can't to send to the app. If you have access to the source code, you can kinda cheat and just go look at how the app handles user input. Perhaps the app just appends the input to a mysql query string. That would be a bug worth reporting.

Another place to look could be in how the app serves its content, a lot of web apps use misconfigured apache and nginx instances, but sometimes web apps serve themselves and people misconfigure that often too.

As far as tools go, you may be able to find some general tools for exploiting common web apps (like wordpress), but by and large you'll be writing your own tools. If the app's language and/or framework supports unit tests you could write some and execute it against a running instance of the source code.

The main takeaway from this post should be that there will never be a one size fits all approach to this. and if you want to be a hacker searching for bug bounties in web apps, your best place to start is by thinking: As an outside user, how can I make this app fail in ways that are beneficial to me.


Bounds checking using Intel's MPX Intel has recently added new instructions to their instruction set to support bounds checking.  Intel calls them the Memory Protection Extensions (MPX), and they are described in Chapter 9 of this manual.  In a nutshell, you can use the new MPX instructions to load a base and upper limit into special registers before doing a memory operation; the processor will then check that the memory address is within bounds and will trap if not.  Basically, this is hardware-level support for bounds checking.

This looks highly intriguing.  Up until now, one of the major challenges with deploying automatic bounds-checking for C and C++ programs is performance: if a compiler option will slow down your program by 50%, or 10%, many developers may be reluctant.  This hardware extension sounds like the sort of thing that could potentially address the performance address, and maybe also make it easier for compilers to enable automatic bounds-checking with less complexity in the compiler code.

So, is this useful in practice?  Do any existing compilers offer support for hardware-accelerated bounds checking using these instructions?  Are there any measurements on what the performance overhead of this kind hardware-accelerated bounds checking?

There is apparently a development branch of gcc that includes support for bounds-checking using the MPX extensions.  It looks interesting.  No performance numbers are provided.

The AddressSanitizer project has experimented with using the MPX extensions in their project, but their reactions are mixed.  They predict that for some programs this approach might be very fast, but for others it might be slow.  It's hard to know for sure.

One challenge is that no shipping processor supports the MPX (at present), so it is hard to know exactly how well or poorly this will perform.  All we can do right now is run the code inside an emulator, not run it on an actual hardware CPU.


Is there any way to get infected by opening an email i.e., if an image is attached to the email? I am curious about infections via email and how likely it would be possible to get infected through just opening an email, in various situations.

I have been reading about people talking about 1x1 pixel images that could contain malware, or be a tracking pixel, as well as images in general containing malware,
so I'm curious if it's possible to get malware from an included image in an email?

Since a lot of sites are using HTML markup, as well as images in email to be fancy, I am curious about those being used as attack vectors?  I would assume email clients would put in protections for us users against this?  From what I have read, email clients usually protect against execution of JS and other code in the email client, but I am curious about images, and how that plays a role if there is malicious code embedded, compared to just a script executing?

I am also curious about the possibility of infection if one were to use the option of "View Source" which I saw as an answer to this question.

https://superuser.com/questions/327224/how-can-i-safely-open-a-suspicious-email

It seems that in the "View Source" case we are just given a bunch of text, and the only way that we could be attacked is if there was a vulnerability in the actual viewing source mechanism which would execute malicious code?

I also post the above link because it is similar to my question, but it is older, and possibly lacking in new knowledge of vulnerabilities and such that have been found in the last bunch of years.

Emails are one of the many routes malware take/use to infect hosts. While it was more common in the previous years yonder with ILoveYou (see link below), and other such pieces, email is becoming less of an infection route because:

Less people use mail client software, and more use web based email (eg. Gmail).
Software and OS security has drastically improved.
Spam filters, and DKIM (along with other mail system improvements) mitigate risks.
People are more generally more aware of what happens when you open bad/unknown emails.

Still, it's used to some degree, especially with spear phishing and whaling attacks. Some attacks are sophisticated to use HTML code to attack the email client (which are popular in enterprises/corporations).

The critical part as other answers have brought up is that double extensions can trick users into thinking an attachment is safe to open. Again, this is on of the many parts that allowed ILoveYou to spread with ease.

It is more common place to see attachments within attachments. For example, you can place files inside a PDF file which can house other files. Some AVs do not scan these files, some do.

Depending on the operating system, malformed images can also be spread through emails, which allows code to be executed. You can see more about this in the last two links.

Easy ways to safe guard yourself from email malware:

View all emails as text. Some email clients support this.
A follow up is to request text-only emails. Reputable sites allow for this.
Do not open emails from unknown/unfamiliar emails, or emails sent at unexpected hours.
Ensure you use up to date email clients, or use online web based email.

https://en.wikipedia.org/wiki/ILOVEYOU

https://social.msdn.microsoft.com/Forums/vstudio/en-US/7010cefa-e596-45af-b193-40206451dd90/how-can-i-load-an-emf-file-into-wpf?forum=wpf

https://www.symantec.com/security_response/vulnerability.jsp?bid=30594


Should admin users confirm their password before changing a user password? In a hypothetical website, there are two types of users, admin users and normal users.  Normal users can change their own password, and in keeping with best practices are required to provide their current password when doing so.

Admin users can change the password of any user.  Should they be required to confirm their password when doing so?

This is an anti-pattern of least privilege principle.
In common case, a "reset password" button should be enough, which will lead a target user to password reset form.

But if you need exactly "set new password" button, then you shold consider two relevant attack vectors - CSRF and XSS. If you'll mitigate them well - that should be pretty enough without additional authentication.


SQL Query Sanatization It seems to me SQL injection could be avoided by just converting everything to a simple encoding like base64 that doesn't have any harmful symbols.

In the classic query "SELECT * FROM users WHERE username = '${username}'", if the user inputs, say, ' OR 1=1;--, then that would turn into "SELECT * FROM users WHERE username = '' OR 1=1", and I'm pretty sure most of you can see the problem with that.

However, if simple base64 encoding was used, that would instead turn into "SELECT * FROM users WHERE username = 'JyBPUiAxPTE7LS0='", and could then be decoded when retrieved. This would also allow for symbols and spaces in usernames/passwords.

Unless I am severely misjudging something, this seems a lot simpler than just blacklisting certain words and symbols.

This would also allow for symbols and spaces... blacklisting certain
  words and symbols...

What you are talking about? What blacklisting? From the security point of view passwords can contain anything you want. To prevent SQL injection any reasonable application uses prepared statements: Java, C#, PHP. In your case it will generate following SQL, which return no result (unless you really have such a strange user name):

"SELECT * FROM users WHERE username = ''' OR 1=1;--'"

Blacklisting of some symbols is done for better usability, not for security. How would user count spaces, how will he distinguish if there are 2 or 3 spaces in a sequence? How would user enter TAB symbol?

Blacklisting of some passwords like "123" or "abc" is done to prevent guessing them, to prevent dictionary attacks.


What does this javascript file do? Is this a virus? While searching on Google I found a website that shows one set of content to the Google Bot and an other to users (by redirecting to a new domain), and also a very suspicious Javascript file. Maybe it's a tracking cookie or a virus/malware, I don't know, so I am asking here if someone can help explain the code?

If the site is "safe" why does it redirect a search engine to a normal website, and users to a blank page by loading this .js file? Why should it have a getpassword.asp hosted on the second redirected domain (from sucuri scan) ?

document.write ('\n');
var a1156tf="51la";var a1156pu="";var a1156pf="51la";var a1156su=window.location;var a1156sf=document.referrer;var a1156of="";var a1156op="";var a1156ops=1;var a1156ot=1;var a1156d=new Date();var a1156color="";if (navigator.appName=="Netscape"){a1156color=screen.pixelDepth;} else {a1156color=screen.colorDepth;}
try{a1156tf=top.document.referrer;}catch(e){}
try{a1156pu =window.parent.location;}catch(e){}
try{a1156pf=window.parent.document.referrer;}catch(e){}
try{a1156ops=document.cookie.match(new RegExp("(^| )a1156_pages=([^;]*)(;|$)"));a1156ops=(a1156ops==null)?1: (parseInt(unescape((a1156ops)[2]))+1);var a1156oe =new Date();a1156oe.setTime(a1156oe.getTime()+60*60*1000);document.cookie="a1156_pages="+a1156ops+ ";path=/;expires="+a1156oe.toGMTString();a1156ot=document.cookie.match(new RegExp("(^| )a1156_times=([^;]*)(;|$)"));if(a1156ot==null){a1156ot=1;}else{a1156ot=parseInt(unescape((a1156ot)[2])); a1156ot=(a1156ops==1)?(a1156ot+1):(a1156ot);}a1156oe.setTime(a1156oe.getTime()+365*24*60*60*1000);document.cookie="a1156_times="+a1156ot+";path=/;expires="+a1156oe.toGMTString();}catch(e){}
try{if(document.cookie==""){a1156ops=-1;a1156ot=-1;}}catch(e){}
a1156of=a1156sf;if(a1156pf!=="51la"){a1156of=a1156pf;}if(a1156tf!=="51la"){a1156of=a1156tf;}a1156op=a1156pu;try{lainframe}catch(e){a1156op=a1156su;}
a1156src='(0-a1156d.getTimezoneOffset()/60)+'&tcolor='+a1156color+'&sSize='+screen.width+','+screen.height+'&referrer='+escape(a1156of)+'&vpage='+escape(a1156op)+'&vvtime='+a1156d.getTime();
setTimeout('a1156img = new Image;a1156img.src=a1156src;',0);

Let's clean this up and look at it more closely, I've also replaced some HTML entities with their text equivalent:

Add a linked image to the page, Chinese characters were encoded but I don't think this is suspicious:

document.write('\n');

Initialize a bunch of variables, mostly with attributes about the browser and page, such as the HTTP referrer and the current URL, date, browser resolution, etc.

var a1156tf = "51la";
var a1156pu = "";
var a1156pf = "51la";
var a1156su = window.location;
var a1156sf = document.referrer;
var a1156of = "";
var a1156op = "";
var a1156ops = 1;
var a1156ot = 1;
var a1156d = new Date();
var a1156color = "";
if (navigator.appName == "Netscape") {
    a1156color = screen.pixelDepth;
} else {
    a1156color = screen.colorDepth;
}
try {
    a1156tf = top.document.referrer;
} catch (e) {}
try {
    a1156pu = window.parent.location;
} catch (e) {}
try {
    a1156pf = window.parent.document.referrer;
} catch (e) {}
try {

Appears to be looking for any existing cookies set by this application in order to keep a count of how many pages have been visited. This value is incremented and stored in a cookie.

    a1156ops = document.cookie.match(new RegExp("(^| )a1156_pages=([^;]*)(;|$)"));
    a1156ops = (a1156ops == null) ? 1 : (parseInt(unescape((a1156ops)[2])) + 1);
    var a1156oe = new Date();
    a1156oe.setTime(a1156oe.getTime() + 60 * 60 * 1000);
    document.cookie = "a1156_pages=" + a1156ops + ";path=/;expires=" + a1156oe.toGMTString();

It basically seems to be trying to record how many distinct pages you've viewed. Again it uses a cookie to help remember if you've already visited.

    a1156ot = document.cookie.match(new RegExp("(^| )a1156_times=([^;]*)(;|$)"));
    if (a1156ot == null) {
        a1156ot = 1;
    } else {
        a1156ot = parseInt(unescape((a1156ot)[2]));
        a1156ot = (a1156ops == 1) ? (a1156ot + 1) : (a1156ot);
    }
    a1156oe.setTime(a1156oe.getTime() + 365 * 24 * 60 * 60 * 1000);
    document.cookie = "a1156_times=" + a1156ot + ";path=/;expires=" + a1156oe.toGMTString();

Miscellaneous stuff, probably just to cater to differing browser capabilities and settings, such as cookies being disabled.

} catch (e) {}
try {
    if (document.cookie == "") {
        a1156ops = -1;
        a1156ot = -1;
    }
} catch (e) {}
a1156of = a1156sf;
if (a1156pf !== "51la") {
    a1156of = a1156pf;
}
if (a1156tf !== "51la") {
    a1156of = a1156tf;
}
a1156op = a1156pu;
try {
    lainframe
} catch (e) {
    a1156op = a1156su;
}

Write all this information as GET parameters in the source attribute of an image. Your browser will load this then their server can record the data.

a1156src = 'http://web.51.la:82/go.asp?svid=8&id=17211156&tpages=' + a1156ops + '&ttimes=' + a1156ot + '&tzone=' + (0 - a1156d.getTimezoneOffset() / 60) + '&tcolor=' + a1156color + '&sSize=' + screen.width + ',' + screen.height + '&referrer=' + escape(a1156of) + '&vpage=' + escape(a1156op) + '&vvtime=' + a1156d.getTime();
setTimeout('a1156img = new Image;a1156img.src=a1156src;', 0);

Basically it's tracking you, including the page you're viewing, how many times you've viewed the site, how many pages you've viewed, what your browser resolution is, etc.

This could be malicious depending on the circumstances, although most websites run tracking of some form such as Google Analytics. It doesn't pose a threat to the integrity of your machine as someone viewing the site, but it might be a threat to your privacy.

The odd variable names do make it seem like obfuscated malware, but I suspect this is to avoid variable naming conflicts with other JavaScript.


Is there a simple way to withstand a Tor correlation attack? Suppose my opponent watches the traffic between my provider and the first relay in the chain and also between the output relay and the website that I visit.
Is there a simple way in this case to make it difficult for the enemy to match the traffic at both ends?

Is there a simple way in this case to make it difficult for the enemy to match the traffic at both ends

No. Tor is a low-latency anonymization network; these all fail when an adversary can run a correlation attack such as you describe. The correlation attack can probably be done with packet timing alone; the longer your session persists, the more confident a correlation becomes. There is no way around this except to change Tor so it either delays packets at each node or adds cover traffic. The second one unlikely to work without wasting a huge amount of the already scarce bandwidth of the network.

The first one (adding delays) would make correlation attacks much harder, but in order to be useful, the delays would most likely have to be so high as to make Tor unusable for any kind for interactive browsing.

Trying to add cover traffic yourself

Edit: Alexander asks whether watching a YouTube video to generate some cover traffic on your end will make correlation harder.

I'd say it doesn't really.

Assume there are two users communicating with the website in question: A (that's us) and B. Also assume A watches a Youtube Video (Y) to generate some cover traffic.

So an attacker might see packets A A B B A B A A B B leaving the web server. He will observe packets Y A Y Y A Y A Y Y Y Y A A Y Y coming in from the network to A's computer. Of course he doesn't know which packets on the server side are A's and which are B's, and he doesn't know which packets on the client side are Youtube packets, but since all the A packets should come in more or less in the same order as they leave the server, and at the same time (plus a small network delay), and with the same sizes, it should be fairly easy to correctly match up the A packets on the client and server side.


Is it possible for someone to reverse my hash function if he has access to the assembly code? My application is written in C and the password is checked by obtaining the user's input and doing some string/math operation on each character, then the sum of each character ascii code is added up (to make it more difficult for crackers).

My question is: if a cracker has access to the EXE file and thus, can view the logic of my code from the assembly code, can they reverse the process and arrive at a password that can defeat the hash function?

I know that they will have to do some trial and error with millions of guesses, but can they arrive faster if they know how my hash function works?

From the brief description of your hash function, yes, it's likely.

It shouldn't be, if it's a good system (for more on this, see Kerckhoff's Principle).  But when you roll your own crypto, you are almost certainly going to do it wrong (see Schneier's Law).  Please don't.

If you use a cryptographic hash function, then knowing the source is irrelevant, as the algorithms are all public and proven to be secure.

Also, merely hashing a password is not a proper way to store it.  There is much more information on this topic on the third most-upvoted question on this site, How to securely hash passwords?.


Security loopholes while mapping .kube/config file on to docker as volume I have a scenario where I have to install Kubernetes on a public cloud and access the Kubernetes via kubectl from a VM on my laptop.
Kubectl accesses .kube/config to connect K8S API-Server to do the required operation.
There is an application that is running as docker inside the VM and connects to K8S using .kube/config that is mapped as volume. That is -v $HOME/.kube:/home/test/.kube
Is there any security loopholes should I be aware of?

If you give an application access to your Kubeconfig file you're giving it effectively your rights to every cluster defined in that file.
Kubeconfig files contain credentials for one or more clusters generally either as client certificates or as JWT tokens. An application with access to that file can then access those clusters.  If the application running in the Docker container is malicious they could possibly exfiltrate that information and try to access the clusters defined in your Kubeconfig file (assuming they can reach them at a network level).
You should make sure that you're happy to trust the application running in the Docker container with access to these credentials.


Why is JavaScript disabled in the Tor Browser Bundle? Didn't Tor create a local socks proxy? Why doesn't all the Web traffic go over this local socks proxy and why is JavaScript disabled in the Tor Browser bundle?

If you would connect with firefox for example to a normal socks proxy, could javascript still reveal my real ip?

Short answer: JavaScript isn't a threat per se, but it can become one. So disable it in critical situations just in case.

JavaScript is globally enabled in Tor Browser Bundle by default. JavaScript, per se,  won't reveal your IP address, it's just that many times there are security problems with the JavaScript components in your browser that would allow evil people to execute malicious code on your computer. That malicious code can reveal your IP address, MAC address, and a lot more information.

You use Tor to protect your privacy, so you'd want minimize the risk as much as possible. That's why you disable JavaScript, Flash, Java, and other components. You don't disable them because they'll compromise you all the time, you disable them just in case, which is a good practice in situations where you want to be careful about your privacy and identity.

As for your other question, Tor creates a local SOCKS proxy and other applications needs to connect to that proxy. So far, Tor doesn't have a user-friendly way to route all system traffic through it, but there are some ways to do it. I highly recommend using Tails, you can easily install it on your USB stick and it will load a full operating system configured for your privacy, with everything routed through Tor.


Difference between a security analyst and a security engineer? Looking out for jobs/internships, I see these two designations used almost interchangeably at times and at other times they mean different things.

So as someone who have no experience in security, what is the difference between these two?

There's no strict definition, and some organisations or recruiters will interchange the terms arbitrarily.

Generally speaking, a security analyst will work more on the attack side, performing penetration tests and identifying security issues. A security engineer will work more on the defence side, building secure systems and resolving security incidents. There is often overlap between the roles, particularly when a security analyst is working internally within an organisation (e.g. internal pentest team), rather than as an external consultant (often referred to as a security consultant, penetration tester, or ethical hacker).


How can I prevent requests from the browser console while still using ajax? I have a publicly available API endpoint. I have to prevent a simple $.ajax script from downloading all of the exposed data within seconds and at least force a page refresh everytime a new request wants to be sent. While this wouldn't entirely protect it, it would help mitigate attacks while non-technical limitations allow us to protect it in a better way.

The problem is CSRF tokens can just as easily be retrieved from the page with javascript and the CSRF cookie is sent along with the ajax request. It seems like a request sent from a browser developer console looks just like a legitimate one. How can I differentiate them?

As a little note, I considered using a nonce in the cookie but that would also mean a page refresh for legitimate clients that need to query the data twice or thrice and that isn't allowed.

You can't.

Any legitimately authenticated user can absolutely manipulate any http request made to your API. Using a proxy such as Fiddler or Burp or just the browser console they can adjust headers, copy cookies pretty much anything.

If you need to rate limit something you have to maintain some sort of state on your server. A per session token in the auth cookie will let you do that, every request with a given cookie gets recorded and requests can be denied if too many requests are made within a certain cut off


Browser based VPN vs network based VPN I travel for work a lot and need to use a VPN on my personal laptop over open hotel wifi. I have a browser based VPN extension as well as a network based VPN with a connection to my university's network.

What are the differences between a browser based VPN (in the form of extension for example) vs a network based one. I know the browser based solution only works for information sent through your browser, where the network based option will work for any application sending or receiving data. Is that the only difference or are there others?

Thanks.

Correct, the main difference is what is sent trough the VPN. The browser based one obviously just covers the browser data, whereas the network based VPN should cover all network activity (depending on the VPN and its configuration.

Don't forget that with the browser plugin DNS requests may very likely leak, partially revealing your activity.

Other than that, the encryption itself and therefore the security of the tunnel may widely differ, depending on the type of VPN. If your browser "VPN" is for example the Opera VPN, it's more of a proxy than a VPN.

The third party, aware of your activity also changes. With the browser plugin, the providers of said plugin may have insight in your activity, whereas with the university VPN, they probably know what you're doing.

A "network based" VPN very much depends on the configuration, you can have a VPN active and connected and nothing is sent over the tunnel, because it's not configured that way. It's a question of routing and default gateways, as of what is sent over the tunnel.

There are quite a few differences and one could go into detail on every single attribute, but I think the vital point is, what do you want to protect and against whom. Starting from there, you can decide what makes more sense for you.


AWS serverless site security. Anything else I should add? I have an AWS static site in an S3 bucket, accessible through CloudFront and a bunch of lambda functions that form the backend of the site. Is there anything else I can/should do security wise to guard against someone unauthorized running any of the lambda functions? Since I wanted to make sure the webpage didnt offer any additional holes it is behind its own WebACL. Since I know the IP's of my users I set up:

a web ACL for the API Gateway that allows a whitelist of ips (US-east)
a web ACL for the CloudFront endpoint that allows the same ips (global)
a simple lambda login function that matches a hardcoded password. Successful login sets a token which gets passed to a lambda authorizer.

I have a question is it not possible to spoof here, I am assuming I get to the landing page once I get the ip right?

Then we have the hardcoded password which I am not a fan of.

https://www.owasp.org/index.php/Use_of_hard-coded_password

These are the ones in correlation to your statement I would suggest you go through

https://www.cloudconformity.com/knowledge-base/aws/CloudFront/

These are places to start I guess, also
I am Sorry for the formatting issues I have not gotten used to the mobile version.


Should you care about DoS attacks if your server is using bcrypt? (I just asked this question on "cryptography SE" and was suggested to ask it here instead)

EDIT I just realized my question is mostly a dupe of: Prevent denial of service attacks against slow hashing functions?

If someone chooses bcrypt isn't the server(s) particularly exposed to a DoS attack that would try to max out the CPU?

If we take, say, a webserver: even if it has a gigantic network bandwith it looks like remotely hammering the server with HTTP POST login requests could give the CPU a hard time.

If the server doesn't rate limit anything it looks like even from a single machine / IP it wouldn't be too hard to force the serve into doing lots of computation.

Is this something to worry about (for example do you need to add some kind of special rate-limiting firewalling specifically taking "remote bcrypt attacks" into account) or am I just being paranoid here?

bcrypt is slow, which definitely increases the risk of an easy DoS attack, but there are a number of ways you could rate-limit clients before they get to the bcrypt step:

Keep track of IP addresses and ignore anyone trying to log in too quickly (maybe start out by pausing for certain amount of time before authenticating, then work your way up to a blacklisting IP's).
Put login attempts in a priority queue and set priority based on how many failed login attempts a particular IP address as made recently. This will leave your server under heavy load, but legitimate users should be able to get in.
Add a CAPTCHA. CAPTCHA's are annoying, so only require this if you detect an attack in progress or you get too many attempts from a single IP address.
Make the client's machine do something expensive as part of the login process, like cracking a short hash or finding the prime factors of a small number. This has the advantage that using a different IP won't help, but it would mean JavaScript is required to log in.
Detect when a user is attempting to log in from a new location and send them an email. Don't even bother trying to check the password until the IP address is authenticated. This has the disadvantage that attackers could annoy (and scare) your users if they have a sufficiently large number of IP addresses to work with.


Usage of SSL_CTX_use_certificate While building a context through openssl, if I do not provide a certificate by using the function SSL_CTX_use_certificate, would all the connections from that context default to anonymous diffie-hellman? Or can there be another reason for that.

In order to use ADH (anonymous diffie-hellman) the relevant ciphers need to be enabled by both client and server. This is by default not the case for OpenSSL and for common clients (like browsers) and that's why ADH will not be used.


Can you tell if an attack is successful by looking at IPS logs? In my organization, we have an IPS behind a firewall. Each time a security event is triggered, I am left to wonder if the attack is really successful. For events that are set to drop in inline, we can be assured that the attack is most unlikely to be unsuccessful. But how do we determine if an attack is successful for events that are set to alert only?

In cases like these, I would look at the payload and PCAP to grab as much information as I can. However, most of the time, I still can't determine if the attack is successful.

For cases like these, how do we determine if an attack is successful?

A successful attack by definition will not be detected by IPS or IDS.

What IPSs and IDSs are good for is weeding out script kiddies, worms and similar attackers.

If you want to have a relatively secure web application you need to use a web application firewall with a default deny rule set. Yes, it hurts to configure it this way and it will take a bit of time, on the other hand, it is really a "fire and forget" solution. The only time the rule set has to change is when the application changes (which you know about), not when attackers think about a new way around IPS or IDS (which you, or your IPS/IDS supplier, don't know about).

IPSs and IDSs "enumerate badness" and this just doesn't work any more: The Six Dumbest Ideas in Computer Security


security issues in JWT storage I'm creating a JWT login mechanism for a site.

There are two very opposing opinions on how to store the JWT.
Stormpath swear by cookies httponly: https://stormpath.com/blog/where-to-store-your-jwts-cookies-vs-html5-web-storage
Auth0 swear by localStorage: https://auth0.com/blog/cookies-vs-tokens-definitive-guide

At first I sided with Auth0, then with Stormpath, but now I'm back to thinking localStorage is best. The pitfalls of localStorage is an xss attack can capture the JWT, the pitfall of auth0 is an csrf attack can steal the cookie.

It seems like the developer can make the cookie method really difficult for the hacker to gain access through CSRF, but not impossible. However, if the developer users localStorage and manages his codebase and sanitizes his inputs, it seems that the hacker has no way in, is this wrong?

The main argument for local storage seems to be this:

  it is easier to protect against XSS than protecting against XSRF

The argument for that is that XSS is supposedly solved by automatic input sanitation, while CSRF is difficult to understand.

The second point may or may not be true, but - as your source states - complete protecting against CSRF is relatively simple. If your application is restful it is simply a matter of checking all POST requests for a CSRF token*.

XSS on the other hand is not that simple. Input sanitation is not the solution, encoding the output is. And the problem is that this encoding depends on context. Different encoding is for example needed if you are in a JavaScript or HTML context.

While some frameworks do provide templating engines with automatic encoding, others do not. And automatic encoding generally only HTML encodes, but does not consider XSS in a JavaScript context. Adding to that that many developers skip the templating engines in some cases and output user inputs directly, I would argue that XSS is more difficult to defend against than CSRF.

* This is a bit simplified, and there are other things to consider. HTML injection for example may leak CSRF tokens, and the application may actually use GET requests to change the server state.

Conclusion

I would disagree that XSS is easier to defend against than CSRF. As this is the main argument for local storage, I would go with the cookie approach. It provides small mitigation for XSS and also has the added benefit of ensuring that relevant data is only send over HTTPS (via the secure cookie attribute).


How to get private key used to decrypt HTTPS traffic sent and received from my own browser with wireshark I am working with a website that sends API requests.
I would like to write a client to make the requests myself, but in order to do so I would need to first see the request payloads. However, the connection is secured and therefore I can't see the data in wireshark just like that.

I found out that Wireshark supports SSL decryption: http://wiki.wireshark.org/SSL

However, it doesn't explain how the private key file should be obtained or generated, so I went and looked around and found this blog entry: http://blog.stalkr.net/2010/03/codegate-decrypting-https-ssl-rsa-768.html

After finding the appropriate packets as shown in the images, I exported the certificate, but unlike the challenge they were doing, the connection established for me uses RSA-2048 and does not provide the factorization (I'm assuming real certificates do not provide that, only the ones for games and such).

Is it possible for me to decrypt HTTPS packets that are sent to 3rd party websites?
How would I generate the key file required?

Wireshark is a very powerful tool. In most cases, the (addon-less) debug consoles of the browsers firefox and chrome should be enough. Both have network monitors that are sufficient most time. Be aware that the firefox' monitor doesn't support websockets yet.

If you still wanted to use wireshark, then consider utilizing the SSLKEYLOGFILE file, more help at this and this, and your linked wireshark wiki page.


Firewall hole punching I'm interested in doing my thesis on Firewall hole punching.

Hole Punching: A way to exploit NAT to open a connection TCP or UDP between a Client and a Server. What I'm looking for is a reason this would be a valid research area, and how it would help for me to do research on this.

Firewall hole punching is what we call security through obscurity, which is never a good idea because your whole security mechanism may relay on the hidden information, which is in this case the process of opening a port in the firewall.

Because this process is hidden you may think your system is 100% safe. Think about cases such:

MITM - someone sniffing your data and taking notes of the hole punching process. Boom your security is gone with the wind.
Brute forcing the process - what happen if I try to guess your punching process? Remeber there are only 65536 ports.

You see? there is always a need for a lower/higher level security mechanism to protect your system anyway. Someone may argue it is a waste of resources only.

You get the idea...


Using Netcat to detect the webserver type In order to know which server a site is running I can use netcat.

Through the following command I can gather information about the type of server installed.

netcat -vv www.example.com 80

But if immediately after that I typed GET / HTTP/1.1 what actually would I do?

try this:

$ netcat example.com 80 <<END
HEAD / HTTP/1.1
Host: example.com

END

The $ is a command prompt; not actually typed.

It's about as simple an HTTP request as you can get without breaking 1.1 compatibility. You'll get a Server: header which will identify the destination server software.

Alternately (and perhaps more interestingly) just use a real http client, either something like wget or curl or perl's libwww commands. Just display response headers and there you go.


Are there any reviews or user experiences with Secretsync? I haven't been able to find much in the way of professional reviews for Secretsync - http://getsecretsync.com/ss/

But i'm wondering how it compares to Boxcryptor and Truecrypt. How secure is Secretsync really?

It's fairly straightforward to understand SecretSync, in my opinion. It looks like they require Java, and one HOPES they are using the built-in crypto libraries to provide their 256-bit AES symmetric key crypto rather than rolling their own implementation.

HOWEVER, they are not as secure as you may require.

According to their FAQ, they do one of two things:

Give you an encryption key
Allow you to derive one from a passphrase using PBKDF2.

If they give you a key, then they know the key, but they don't have access to your files (DropBox is the file distribution medium).
If you use your own passphrase, then they STILL use their own key, but it becomes a salt value for the generated key from the PBKDF2 function.

So they do not appear to use a different key per file, but rather one key for all files.  This wouldn't normally be a problem with AES, but it suffers from problems associated with all of the other deficiencies in their model.

Having a symmetric key generated FOR you is an issue regardless of the asymmetric relationship between secretsync and dropbox.  I'd like to know what security the organization has on their end.

According to the FAQ they appear to be susceptible to a denial of service (regardless of how they spin it): "Will I be able to decrypt my files if your service is no longer available?"

Also, because the account is web-accessible, any number of social-engineering attacks can allow the SecretSync account password to be changed by having access to the account email address.  Having this account access will mean you get access to the secret key from their server.  This would be more tricky to access if you generated your own key, but the complexity of the function is reduced from one of finding an AES 256-bit key to one of brute-forcing passwords (or phrases).  We know humans are the weak link in security.  Having access to ONE encrypted file, plus access to their server-generated key means you can decrypt any file you want (with a possible side-challenge of needing to first brute-force the user's password they may have set when signing up).

It is also not clear to me what happens if you need to change your password on the key.  Do they re-encrypt everything?  This is a deficiency as well.


Windows network specific attacks I have limited experience with Windows networks and certainly no experience with AD forests or anything related.

I have experience and understanding how to secure and maintain a unix style network.

I am wondering if the extra stuff like AD and whatever other windows specific technologies there are allow for Windows specific attacks, or is the AD stuff just the equivalent of LDAP?

Are there any Windows specific attacks specific to windows technologies(without a unix equivalent) on a windows network? Any sources to links or documentation would be appreciated

No real information on specific attacks, but as for how the network looks...
For the most part it would be mostly the same, though with different common services around (in addition to implementations of regular, common protocols).

One big difference, though, would be SPNEGO/NTLM all over the place, though by now it should be mostly Kerberos anyway.
Also SMB (for file sharing).

I'm not sure this is really the answer you need, but it may be able to help you narrow your focus to ask a more specific question.


Can be SQL Queries sniffed through the client network adapter? This may not be a fully Security Question but here's the thing: We have a really old software (released in 2000) that manages some data in the company. Right now we have to create a report from this software like how it manages the employees information. This software connects to a database that is in our server (SQL Server). So I would like to know if there's a way to read the SQL statements that are being sent to the  server from the client.

Some details:

It's a .NET  2.0 desktop application
Running on Windows 7

Unless the established connection between your software and the SQL server is encrypted by your software, then most likely the traffic can be intercepted and viewed using a network traffic analyzer like Wireshark. By default, SQL server runs on TCP port 1433, so if you have the ability to set up a packet capture, those packets would contain your SQL queries.


airodump-ng also transmitting? I recently started using airodump-ng to monitor nearby WLAN network packets. I noticed it was picking up a WPA signal with almost perfect signal strength. I then noticed ifconfig was reporting transmissions. It seemed to me airomon and/or airodump was retransmitting everything it was receiving, as the amount of data being received was the amount of date being sent. I have since started manually setting up my wireless card, and am using wireshark to read from the device:

iw wlan0 set monitor none && \
ifconfig wlan0 up && \
iw reg set 00 && \
iw dev wlan0 set txpower fixed 0 && \
wireshark -i wlan0 -k -s 0 -w /root/cap/name_me.pcap

I believe the original commands were something simple like:

airmon-ng check kill
airmon-ng wlan0 start
airodump-ng wlan0mon -w output.pcap

This setup does not transmit, and any transmissions i make accidentally shouldn't get very far. How was I misusing Aircrack-ng?

Sounds like you were looking at the loopback (lo) interface. Without the output from your ifconfig command, it's impossible for us to tell.

One thing you may want to do before running airmon-ng start is

airmon-ng check kill

This terminates any network programs that might interfere with airmon-ng/airodump-ng. You are right though, nothing should be transmitted.


Can websites send WhatsApp messages without my permission through the WhatsApp API? I want to know if it is possible for websites to send messages through my WhatsApp without my permission. I read about the WhatsApp API, but I haven't done much PHP so it did not make much sense to me.

Is it also possible for a website to view my contacts, as well as post messages to existing chats that I have not deleted?

No.

It no way possible can they do this with out having you security token (Lets call it your login credentials).
The PHP API you saw is an unofficial API and requires logging in when starting it up.

What can a website do?

There is something called WhatsApp URI which lets websites build a custom link that upon pressing will redirect you to WhatsApp so you can share their content (See more here).


How does time-limited trial software work? I'm curious about how time-limited (e.g. 30-day trial) software works.

I know how serial keys are generated and designed, but the time-limiting part is more complicated to understand, because it is not simple to ensure that the system's time is correct (e.g. user change it manually).

Full or "perfect" protection is impossible, but I'm curious to see some proof-of-concept or any suggestions.

I guess that used a trusted NTP server is an early solution, but it's not perfect (required Internet connection).

From my own experience, I have seen software with very robust time-limiting mechanism (impossible to cheat, even if we shut down network, change time manually or so)!

There is no cryptography in there. It is all a matter of state. The application can access the system time, also the hardware clock (that's the clock with a battery which keeps time when the computer is off). The application can also look at the modification dates of various files to try to detect foul play with the system clock; and it can measure elapsed time while it runs and accumulate it (in one of its files).

IF you install the software in a virtual machine, then snapshot the whole VM, and, later on, restore that snapshot completely, taking care to set back the (virtual) hardware clock back to the date of the snapshot and to deactivate the network, then you will be able to fool the time limit. The economic efficiency of this kind of time limit relies on the idea that VM snapshots and clock games are too cumbersome for most customers to use them on a regular basis.


Runtitme Error page is being displayed for XSS or SQL injection payloads When I have manipulated the URI of an application with some SQL or XSS payloads I am able to see a runtime error page. Can we come to a conclusion that the application is vulnerable to SQL Injection or XSS attacks.

Please Suggest

Can we come to a conclusion that the application is vulnerable to SQL Injection or XSS attacks.

Why would you think so?

If the injected XSS payload is not shown, there is no XSS vulnerability (at least not reflected; we cannot say anything about persistent).

We cannot say anything about SQL injection. There may or may not be one, the presence of an error message doesn't tell either way, you need to perform further tests (and enable error messages if you can).

The fact that you get a generic error message only tells you that your request was invalid, but not why. It could be that the application expected an integer but got a string, and thus shows an error (this is how it should be). It could also be that you injected into a query and broke it, and thus got an error message (this shouldn't happen), or it may be a number of different issues.


Privacy risk in using Google APIs If I use JQuery from Google APIs: http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js

Is there a privacy risk to my site? E.g. does this link enable Google to read my pages, track my site usage, etc.?

Technically, yes, Google could do a lot of this. Namely, when you "use JQuery" in your site, you actually mean that the pages of your site reference that piece of Javascript, and whoever browses your site will automatically download it from Google's servers, allowing Google to easily know who downloads it, when, and in which site the link was found (because of the Referer header). This is easy to do, undetectable on your side, so one should assume that Google does it (if they are up to their reputation, that is).

Reading your pages is another matter. They could play nasty tricks by modifying the contents of that jquery.min.js file, in order to do various things with your site pages, including reading parts of it and sending them back to some server. However, this would entail a risk of detection, since that would be an active attack. Google's motto is "don't be evil" and they can maintain it only on the condition that they never look evil. Indulging in active attacks could seriously damage their image, and I doubt they would risk that for something as trivial as reading back your Web site (well, I don't know what your Web site does, but I doubt that what it contains would match the net worth of Google itself -- I hope you won't feel offended at the comparison).


VPS - scope of responsibility I'm thinking  about getting an VPS to install OpenVPN on it to connect in a secure manner to the Internet  from free Wi-Fi networks. My question is, what is the scope of my responsibility, to keep my VPS secured? If compromised, is there any chance, that an attacker can gain access to other VPS or basically the software/hardware that the company relies on, to deliver their VPS service? Can I be held responsible for this ?

In theory (and out of few exploit to gain host control) a VPS is isolated from others VPS.

If your VPS gets compromised and the attacker can compromise the host and other VPS, that should be the hosting provider matter as this mean a vulnerability inside the host hasn't been fixed properly. I said should as some providers will put the burden on the first compromised VPS, read carefully the contract.

Usually your VPS security is still your responsibility in all cases, if it gets compromised and is used to attack something, you'll be accountable for the use of this VPS in the attack.


Is there anyway to analyze memory dynamically? I do malware analysis by using memory forensics to gather more useful information but as far as I know, the result of memory acquisition is just one memory dumped for a specific time (snapshot). So, is there anyway or solution to acquire or analyze memory dynamically that including changes?

If you happen to use a tool like IDAPro, you can debug your malware and check the content of the memory and registers

When reaching any pre-selected debug breakpoint
Instruction per instruction

As mentionned here (https://www.hex-rays.com/products/ida/support/idadoc/1470.shtml), you can use IDAPro to take snapshots while you are in a suspended state (waiting in a breakpoint)

So basically you will dynamically see the content of the memory change after each instruction


Mandatory vacation as a security control? I recently came across the concept of mandatory vacation as a management security control. Employees are forced to take at least one week of consecutive vacation to provide the company to audit their work and possibly discover fraudulent behavior by employees.

I am wondering how effective this control really is? Shouldn't there be better controls in place to prevent and/or detect fraudulent behavior in the first place, other than sending the employee out for at least a week? Also, since it's reactive, employees with a malicious intent are aware they will be sent out on mandatory vacation at a certain point in time. Doesn't this allow for them to look for ways to circumvent this control and obfuscate their malicious activity even better?

Actually, it is pretty effective.  Yes the person can prepare for it but almost always something somewhere is overlooked.  Will you catch it while that person is off?  Not necessarily, but it causes them to have to think further ahead about malicious intent.  That makes things more complicated and forces greater possibility of making a mistake.

We actually caught someone at a previous company who was stealing the company's phone lines and using them for his personal hobbies with this.  He set up his own 800 number back in the day along with a number of other things.  The VP caught it when something went wrong and he wasn't around to fix the problem himself.

The better approach I've seen is that instead of requiring 1 week, require 2.  This has multiple benefits.  1.  The person is away from work for 2 weeks and that forces the person to actually relax meaning that he or she will come back more rested.  2.  Being gone 1 week, normally things can wait for that person's return.  Being gone for 2 almost always ensures someone has to take a hold of your responsibilities.  This leads to both oversight into what someone is doing and it forces cross training.  It's a win/win.


How to secure automatic SSH connection I have Raspberry PI 3 which has 4G modem dongle attached to it. It works autonomously and every one in a while has to connect to my server via ssh. This is done by service script either with password or with key authentication which both require password/passphrase to be present in a script or in a file. The problem is that anyone can take out RPi SD card and take that password/passphrase or id_rsa key itself.
Are there any secure solutions for this?

The most secure solution is to have SSH keys encrypted with a passphrase and managed with a key agent (e.g. ssh-agent). However,

  if your system reboots, it requires human intervention to reload the
  keys, making it inappropriate for some uses where automatic system
  recovery is needed. If you find yourself trying to think of ways to
  automatically load the keys into the agent, then you don't really want
  to use the agent.

(from the O'Reilly definitive guide to SSH at http://www.snailbook.com/faq/no-passphrase.auto.html)

If you must use a key without a passphrase, the guide says to be sure the key resides on a local disk (the SD card in this case), and you should also use restrictions on the public key such as "from=" and "command=" so that theft of the key (or the SD card on which it resides) can be mitigated.


FIPS 140-2 C# Password Hash Is the following algorithm, using RNGCryptoServiceProvider & Rfc2898DeriveBytes, sufficient to implement a FIPS 140-2 password hash on Windows Server 2008R2?

var provider = new System.Security.Cryptography.RNGCryptoServiceProvider();
byte[] salt = new byte[8];
provider.GetBytes(salt);
var iterations = 100000;
var pbkdf2 = new System.Security.Cryptography.Rfc2898DeriveBytes(password, salt, iterations);
var hash = pbkdf2.GetBytes(32);

https://stackoverflow.com/questions/3811694/is-rngcryptoserviceprovider-as-good-as-a-hardware-rng
Reference implementation of C# password hashing and verification

Password hashes are, in and of themselves, not part of FIPS 140-2.

To try to answer anyway, that depends - do you just need to use FIPS 140-2 algorithms?  For hashing, that's SHA-1 and the SHA-2 family.  For a random number generator, FIPS 140-2 doesn't apply - those are in completely separate NIST special publications.

RFC2898DeriveBytes is PBKDF2-HMAC-SHA-1; there are also nonvalidated C# example of PBKDF2-HMAC-SHA-256/384/512 by @JimmiTh at my GitHub collection, if you'd like to use those as well.

If you actually need to use FIPS 140-2 validated solutions, first you need to know what level validation you need (level 1, 2, 3 or 4), and then you need to find solutions that were validated by NIST at that level.

In both cases, you need to dive into precisely what "password hashing" means in the context of FIPS 140-2, since "password hashing" itself isn't part of FIPS 140-2.  Get legal or regulatory advice on exactly how you're allowed to use the algorithms FIPS 140-2 details; PBKDF2-HMAC-SHA-xxx is probably allowed, but make certain.

It's possible that your organization's interpretation of the letter of whatever regulations are pointing them at FIPS 140-2 contradicts normal best practices.  Once you're referring to any national government's standards, you need to know much more about the requirements.


best practice for encrypted filesystem inside a file This is an extension of my question on UNIX.
Let's suppose I create a file, map it to /dev/loop0, and create a LUKS partition inside

dd if=/dev/zero of=myfile bs=1M count=1000
losetup /dev/loop0 myfile
cryptsetup -c aes-cbc-essiv:sha256 -s 256 -v -y luksFormat /dev/loop0

I then open the encrypted partition

cryptsetup luksOpen /dev/loop0 myfile

Now, I have my encrypted file appear as a disk /dev/mapper/myfile. I need to create a filesystem before I can use it.

My Question:

What would be best practice in general regarding my setup. In particular, are there any filesystem options/parameters that I should change from defaults? Any suggestions as to which filesystem to use? Journal? Any other suggestions or comments?

With respect to the cipher to chose -- that is aes-cbc-essiv:sha256 (the old default) versus aes-xts-plain64:sha256 (the new default) -- I've explained all this before in this answer:

How secure is Ubuntu's default full-disk encryption?

As for which filesystem to use -- obivously using a partition directly is going to give you the best performance: there's no second translation layer getting in the way between your pseudo block device and your real block device.

Since that appears to not be an option for you, then I'd recommend one of the EXT filesystems rather than one of the newer copy-on-write ones, since random-access to a large file with a COW filesystem would be messy. EXT4 is obviously the most recent and arguably most resilient of the lineage, though if you only have one large file then most of the FS features don't come in to play. So in that sense it probably doesn't matter a whole heap which filesystem you use. You're not really using the filesystem features.

As long as you allocate your file entirely at creation (as you've demonstrated in your question, as opposed to creating a sparse file), your file will be one contiguous block and the filesystem becomes largely transparent to your operation. Also, allocating your file BEFORE putting the other files on the FS will get your file closer to the start of the disk, which makes its access sometimes a bit faster.

As for security: (a) don't give out your password, (b) don't let anyone touch your computer. There's not a lot to it. Since you're running on an unsecured device, there's really no meaningful additional protection that can be put in place. If you encrypt your whole computer then perhaps you'll have something, but as it is, just be careful of how it gets used.


Segmentation fault trying to exploit printf vulnerability I am trying to learn more about printf vulnerability. I understand the theory but I am unable to put it into practice.

TL;DR

All my attempts to write a single byte into memory result in a Segmentation fault.

What is the most likely reason for the failure? My guess is that it may be some sort of protection in modern compilers/OS (I am running that on 64 bit Ubuntu Xenial), but I don't know much about it.

Details

I am able to read stack. I found that that the call I am trying to exploit puts 6*4 bytes in front of my input:

Your choice: AAAA.%08x.%08x.%08x.%08x.%08x.%08x.%08x
You entered: AAAA.00000001.00000005.f76c7d60.0000000a.09787008.ff9c9e48.41414141

I disassembled the binary and found the memory location(s) I want to change. I tried various addresses, both code and data with the same result. For instance, the address of the string Your choice: is 0x0804b795.

$ gdb -batch -ex "x/s 0x0804b795" ./a.out
0x804b795:  "Your choice: "

I am able to write that address to the payload:

$ echo "the binary ignores the 1st line" > ./payload
$ echo $(printf "\x95\xb7\x04\x08").%08x.%08x.%08x.%08x.%08x.%08x.%08x >> ./payload
$ cat payload - | ./a.out

Your choice: You entered: ?.00000001.00000005.f76f5d60.0000000a.09844008.ff8ff1d8.0804b795

Then I replace the last %08x with %n to write into that address. The number of printed chars would be 4 (for the address) + 6 * 8 (padded %x) + 7 (dots) = 59 which puts the value to be written in ASCII range; 59 stands for semicolon - a suitable character to write into a string.

$ echo "the binary ignores the 1st line" > ./payload
$ echo $(printf "\x95\xb7\x04\x08").%08x.%08x.%08x.%08x.%08x.%08x.%n >> ./payload
$ cat payload | ./a.out

To my best knowledge that should work and I was hoping to see ;our choice prompt on next iteration but I am getting

Your choice: You entered:

Segmentation fault

To confirm:

$ gdb a.out

(gdb) run < payload

Your choice: You entered:

Program received signal SIGSEGV, Segmentation fault.
0xf7e58dff in vfprintf () from /lib32/libc.so.6

(gdb) bt
#0  0xf7e58dff in vfprintf () from /lib32/libc.so.6
#1  0xf7e5df66 in printf () from /lib32/libc.so.6
#2  0x080487b4 in getInput ()
#3  0x0804b206 in programMain ()
#4  0x0804b3b0 in main ()

What am I missing? What else can I check?

I recommend you to check if the 0x0804b795 address is writable.

You can see the different regions of a running process in /proc/PID/maps. For example:

$ sleep 10 &
[1] 1438
$ cat /proc/$(pgrep -f 'sleep 10')/maps
08048000-0804d000 r-xp 00000000 08:01 399565     /bin/sleep
0804d000-0804e000 r--p 00005000 08:01 399565     /bin/sleep
0804e000-0804f000 rw-p 00006000 08:01 399565     /bin/sleep
084b4000-084d5000 rw-p 00000000 00:00 0          [heap]
[...]

In this case only the addresses between 0804e000-0804f000 and 084b4000-084d5000 are writable.

Inside GDB, you can use info proc or info inferior to get the PID of the debugged program.

Also, keep in mind that %n will write an integer value, not a single character. I mean, in this case it will write 4 chars (in little-endian). But you can use %hhn to write a single character.

I recommend you to read http://jbremer.org/format-string-vulnerabilities/ and to look at the printf(3) documentation.


OpenSSL: How to set default_crl_days to infinite / never expiring? How can I set default_crl_days for my OpenVPN CLR to infinite days?

I'm planning to issue certificates to employees and if an employee leaves the company I just revoke their certificate in my CLR.

However as the CLR has an expiration date this seems very inconvinient to regularly renew the CLR.

Is there a way to set it to inifinite days / never expiring?

The nextUpdate field (i.e. what you treat as expiration date) is a timestamp. There is no way to specify an infinite time but you can specify a time far far away. But note that if you set nextUpdate too far in the future you have to somehow guarantee that anybody checking the CRL is still using the latest one and not some old (but still valid) version which does not contain critical revocations.


An ad seems to be downloading malware into my epub file How can an ad add malware to a website download link?

When I download from dailyuploads, If adblock is running, the file generally downloads clean, but if its not I get an Auto.KMS infection. This happens not just when I DL zips, but also Epubs as well.

Now, Dailyuploads requires all users to disable adblock.

Is there any other way to safely DL the file with adblock disabled?

You might want to rethink your use of DailyUploads. When I tried to get to it, Chrome warns me off saything that it is compromised - undoubtedly why you are getting inserted malware.

As such it seems very unlikely that it is safe to go there at all let alone with adblocking disabled.

Any site that disallows adblocking should be avoided if at all possible. There are far too many rogue adverts around that can bypass most protections.


When should user invite links (tokens) expire? We have a system in which external users can be invited to our identity management system.
The users are not employees of our company, but of our customers. The administrators of the
customer do not have access to the system the users are invited to.

Currently we send invite emails to the users email addresses that contain links that are
valid for 7 days. The problem is that not all users can or want to respond to that mail within
the 7 days - for example because they are on holiday.

This leads to manual "re-issuing" invite mails to users which is a lot of work. It is done by our employees, because the customer administrators do not have access to the system - as mentioned above. We'd like to minimize this manual intervention but we're not sure if the measures we proposed are a good idea from a security perspective. I specifically ask about user invites, because in this case the user does not initiate the invite themselves, and have no control over when the invite happens. Can you please help us out?

Should user invite links expire at all - if so, what would be a good expire time?
Would it be a good idea to let users "extend" their invite if they click on it after it has already expired - for example by sending another email with a new invite link?

Should user invite links expire at all - if so, what would be a good expire time?

That is a question that doesn't have a general answer: it depends on the value of the resource you're protecting, who are the people receiving your invitations, how secure is the channel you use to transmit these invitations and what are the threats you're trying to protect against.

However, generally speaking, never-expiring invitations aren't a very desirable property: in most cases, it doesn't make much sense for someone to accept an invitation 10 years after it's been issued but it does open a (slight) security risk in the sense that very old, but still active, invitations will grow the size of the valid key space in relation of the total key space. In other words: an attacker trying out every potential key has more chance of finding a valid one.

Would it be a good idea to let users "extend" their invite

I can't think of any scenario in which this would be a desirable functionality: it's effectively the same thing as having unlimited lifetime for the invitation except that it's more complex for everyone (developer as well as user).


Application security architecture framework I'm writing a security architecture for the application I'm working with. I'm struggling  in finding a framework to follow for this task. I can find a lot of frameworks like TOGAF and SABSA that works with enterprise security, but my task is more specific to an application.
Have anyone worked with such a framework?

If you're looking for more specific application security architecture guidance, I'd be inclined to look at OWASP materials as they're more focused in this area.

Project like the OWASP Developer Guide, OWASP Application Security Verification Standard or OWASP Software Assurance Maturity Model could be of use in this context


Insecure https connection to reputable companies' domains? I'm getting notifications of untrusted https connections on reputable domains such as paypal.com and skype.com. Since big companies like those probably employ the top security professionals and best practice, I'm inclined to think the problem must lie at my end, or in transit. Can someone advise me what I should do to narrow down the problem?

Here are some screenshots from paypal

I find it interesting that FF and Chrome give different errors, and that Chrome shows up a green padlock in the address bar, despite the "obsolete cryptography".

And some screenshots from skype

Note that this is not the login page (my browsers accept the https certificate there), it is the page where I want to top up my balance.

P.S. I want to reiterate that I'm not trying to blame Microsoft or Paypal. I'm inclined to trust them as corporations, and suspect that the problem lies somewhere else. On the other hand, I got in touch with both of their support departments a week ago, and have not had anything back other than an automated response.

Yes, www.paypal.com is really using RC4 as their preferred cipher, even though this cipher is considered broken for a while. It does support some better ciphers like AES256-SHA but unless the browser explicitly denies support for RC4 (like recent Firefox versions and IE11 do by default) it will use RC4. See also the analysis of SSLLabs.

Interestingly paypal.com (w/o the www) is a different server and supports the more modern GCM ciphers and also enables them by default. It will use RC4 only with older clients not supporting TLS1.2. See also the SSLLabs analysis.

Apart from that none of these servers support any ciphers with forward secrecy, which means if somebody gets hold of the private key of the server (by accident or by law) they can decrypt all the traffic they captured in the last time.

As for www.skype.com: they do support forward secrecy and use it by default, but they don't support any of the modern TLS1.2 AEAD ciphers and thus chrome considers the cryptography obsolete. See Chrome showing cryptography as 'obsolete' and Google Chrome "Your connection to website is encrypted with obsolete cryptography" for more information.

Note that using RC4 as the preferred cipher as done by www.paypal.com is considerable different from offering RC4 as the last resort for clients which don't support better ciphers. RC4 is considered insecure and RFC7465 from 02/2015 goes so far as to explicitly prohibit its use with all versions of TLS:

  ... However, RC4 has long been known to have a variety of cryptographic weaknesses, e.g., see [PAU], [MAN], and [FLU].  Recent cryptanalysis results [ALF] exploit biases in the RC4 keystream to recover repeatedly encrypted plaintexts. ... As a result, RC4 can no longer be seen as providing at sufficient level of security for TLS sessions.

In the context of www.paypal.com the cipher might probably currently still be safe enough, since not enough data with known plaintext will be transferred with the same key. When used for long-lived TLS based VPN tunnels it might be more problematic. Also, attacks only get better and NSA is known to have top experts in cryptography and might even have better attacks than known to the public.


Extracting as much information from a browser request as possible? I am currently working on project that involves identifying spammers who are creating fake accounts on my site. I am interested to know what type of information I would be able to extract.

First of all, there is browser fingerprinting. According to the library https://github.com/Valve/fingerprintjs2, there is about 25 features that I can use.

Then there is platform detection, available at https://github.com/bestiejs/platform.js/. This library seems to be able to extract some information about the uesrs' platforms.

And then I could also extract information from my http server by inspecting the request environment.

Are there any other techniques I could use to extract information from my requests?

Most spammers aren't actually humans, but automated scripts sending forged requests to your site. Identifying them though JS is pointless, because they won't run it. Identifying them based on server headers might work for a while, but they will likely look just like a normal user's, and the spammer might well change them if you start blocking their requests.

A more reliable ways of stopping spammers is CAPTCHA (use reCAPTCHA and leave the hard work of identifying bots to Google - these days they don't even show anything to the user!).


Are there any same origin issues (SOP) with TOR? Are there any issues with Same Origin Policy (SOP) with TOR or *.onion addresses?

I'm thinking of

cookies
Plugins (Silverlight, Flash, Java, etc)
Javascript

I haven't actually examined Tor, but theoretically there is no problem with any same-origin policy. I don't easily find any mention of problems occurring in practice, either.

Here's a sketch of the theory. The same-origin policy is tied to three values. First is the Application Layer protocol in the form of the URI protocol scheme such as "http" or such as "https" that combines HTTP with encryption via SSL/TLS. Next is another Application Layer protocol, the domain-name system DNS, in the form of the hostname. Last is one little value from the Transport Layer protocol TCP, specifically the port number. You can use the internet for years without ever noticing that port numbers are in use because most sites use the "well known" port number for each Application Layer protocol. Well known port numbers include port 80 for http and port 443 for https.

In the abstraction called the OSI Model, a Transport Layer protocol carries any Application Layer traffic without either layer caring very much about the details of what goes on in the other layer. In reality TCP doesn't really conform to the OSI Model, but for present purposes it's close enough. Tor works at the level of TCP, a Transport Layer protocol, so that's almost all that we need to say about it.

The client software that makes the connection to a Tor node creates a SOCKS proxy connection. SOCKS is an Application Layer protocol that can carry a Transport Layer protocol, specifically TCP. That really is all that we need to say about it. But I'm going to write more anyway.

Just to bolster our intuition, here's a quick description of what happens next. With the SOCKS proxy connection in place, network client software can send normal TCP traffic over that connection and into the onion-routed network. When TCP traffic enters the onion-routed network, Tor's manual says that Tor negotiates a virtual circuit, a TCP network path that is persistent (in the short term). The virtual circuit permits the normal client software's normal TCP traffic to pass right through, except for the important fact that it gets onion-routing wrapped and unwrapped around it on the way. At the exit node from the onion-routed network, the important ventriloquism effect occurs. It appears to anyone on the far side of the onion-routed network that the Tor user's software is sending and receiving at the exit node.

The recommended Tor client-side software, which is called the Tor Browser Bundle, helps to preserve anonymity by making each Tor user's client-side software practically the same. The bundle provides the NoScript extension for Firefox. This copy of NoScript is explicitly configured not to prevent sites from executing JavaScript in the browser. That gives me extra confidence that JavaScript is expected to work and therefore that there's little or no difficulty with the same-origin policy. JavaScript's same-origin policy (SOP) is actually a little more restrictive than the SOP for other web client features such as cookies and plugins, so I feel confident that they work fine, too.


What is a simplest "Crash an application" demonstration to get access to a system? For a presentation (10-15 mins) purpose what is the simplest demonstration of "crashing an application" on a machine can be done.

Typically buffer overflows are good - it is generally easier to make one give a crash result than a useful compromise result.

And in general looking at the security advisories lists will be your best bet for current exploits that will crash a server, app or platform.


Is it necessary to force a newly registered user to login? In a web application, is there a security advantage to forcing a newly registered user to manually log into their account, or is it safe to automatically log in a new registration? Assume that the user is registering using a local registration/login strategy, and their credentials are an email address and password they specified at the time of registration.

This is a perfectly reasonable thing to do.
If you don't require a user to verify their e-mail address before using your service (or perhaps you only require a username and password to sign up in the first place), then granting a user a session upon completing registration is a reasonable thing to do.
However, if you require the user to verify their e-mail address first, then you should only  grant a new session upon verification, not upon sign-up.


How do I create a secure public wireless network? How do I design a secure public wireless network. I want to offer guest network. But how do I make it secure without making my customer get authenticated with password or username.

I have read about hotspot and the use of double NAT, but i am not clear about those things. Can someone guide me how do I create a secure public network.

Thanks.

NAT, whether single or double, doesn't have anything to do with security.

Security is ultimately the end user's job. You could just throw up some unsecured AP's, and provide a warning that anybody using those AP's needs to do their own due diligence to make sure they're only communicating with valid servers over valid HTTPS connections, or using a trustworthy VPN.

You really can't make the network itself secure without requiring your users to authenticate somehow. At the very least, basic WiFi security requires the use of WPA2 "Personal" and a shared key. You have to provide the key to every user. You could just hand it out on business cards or tear-off tabs on a bulletin board or put it on a sign on the wall. Even if you try to keep it semi-private, your users are going to share it. But at least individual devices will have a uniquely encrypted connection to the Access Point and won't be able to sniff each other. On the other hand, somebody could set up a rogue AP using the same key, your users would connect to that rogue AP, and the bad guy would be able to sniff all their traffic.

As far as the users themselves being secure on your network, that's really ultimately up to them. They need to only use websites and apps that utilize the HTTPS protocol, or use a VPN. More than that, far too many apps don't use HTTPS appropriately, completely bypassing the necessary checks to verify that the SSL/TLS certificates from servers are valid. Programmers too often have trouble getting the verification checks to work, so they give up and throw a switch that makes the protocol "just work," but at the expense of bypassing the verification checks. When they do that, the packets are encrypted, but they could be encrypted by a rogue key, possibly via DNS poisoning pointing the user at a bad server, with a bad guy picking up the whole conversation in the clear.

So you can't really guarantee secure communications for your public WiFi users. That's their job.


Identifying SSL traffic? How does DPI basically identify SSL data traffic? Just by the number “443” in port section or the SSL traffic has some other particular properties other than “443”?

Thanks in advance,

SSL/TLS has a very specific on-the-wire format for data: data is sent as records. Moreover, at the start of every connection:

The client talks first.
The client sends a "handshake" record containing a handshake message of type ClientHello.

So the very first byte from the client will be 0x16. It is then followed by the protocol version, which will be two bytes: 0x03, then a byte of (normally) value 0x00 (for SSL 3.0) to 0x03 (for TLS 1.2). Then the record length as two bytes. Within the record payload is found the handshake message header: a byte of value 0x01 (type for a ClientHello) followed by a three-octet length.

At some point, I had used a multiplexer for SSL and RDP on the same port: since the RDP connection begins with a byte of value 0x03 from the client, while the first byte of SSL is 0x16, so I could write a simple program which forwarded the data to either the Web server or the RDP server, depending on that first byte.

Not all DPI systems are sophisticated, and some can be fooled by applying variants of the protocol. For instance, the client can split the ClientHello message into several records, and possibly begin with a long stream of empty records. Some server implementations will actually tolerate an initial sequence of a thousand alert messages (of type "warning") which may evade the DPI system scrutiny in several ways:

The DPI system may expect a first byte of value 0x16, and deem it non-SSL if any other byte is sent (e.g. a 0x15 for an "alert" record).
The DPI system may expect the ClientHello to be contained within a single record, without fragmentation, and thus not recognize the SSL handshake.
The DPI system may expect the ClientHello within the first packet of the TCP connection, and all the extra empty records or alert record may push the ClientHello arbitrarily far into the TCP connection.

The trick here is to find variants which are accepted by SSL server implementations (who themselves have some more-or-less arbitrary limitations) but are not covered by whatever DPI system you are trying to hide from.

(If unsure, try to implement a custom SSL library -- for learning, not for production use, of course. This will teach you a lot of things on the details of the protocol.)


SQL-Injection file upload when database and webserver are on different machines I have two servers, one for the database (mysql) and one for the website (apache) and there is a sql injection on my web application. Is it possible now to upload a shell to my webserver or does the file_read, INTO outfile, INTO dumpfile, etc. only work on the database server?

Is it possible to upload a shell to the webserver when database and webserver are on different machines?

Everything depend on how you separate the data from web application code.

The answer is a YES for most of the Web CMS (Content management System) that allow developer to put code directly into the CMS and execute the code on the fly.

If your web application doesn't use on-the-fly generated CMS , and you sanitize the data transfer from the database (which doesn't render any data as script) ,then the answer is NO.

(update)

Attacker can upload ANYTHING they want to the DATABASE server once they successful perform the SQL injection. Theoretically, SQL injection WILL NOT compromised the web server integrity (it doesn't matter whether web server reside in the same server or not).

HOWEVER, many website are using CMS, that will use some sort of database itself. Once CMS database is compromised, it will also affect the web server, that's why I mentioned the data separation.

I.e.
Imagine you have a separate database server, your web server will read data from database and will render it directly, without sanitize.  So now the database is compromised by SQL injection,  and since you didn't sanitize data from database, when the attacker upload web server compatible shell code to the database, your web server will happily execute those code.


rsa certificate authorities google.com's X.509 certificate issuer:
http://www.flickr.com/photos/31717414@N06/6543437881/

The certificate authorities installed in my browser:
http://www.flickr.com/photos/31717414@N06/6543437849/

I see plenty of Thawte stuff but no Thawte SGC CA and Thawte Consulting (Pty) Ltd. stuff.  Shouldn't the name of the issuer of the google.com cert match the name of one of the certificate authorities exactly?

SGC is server gated cryptography which allows older browsers (e.g., 40-bit security) to connect to 128-bit; see for example: http://www.sslshopper.com/article-say-no-to-sgc-ssl-certificates.html

But anyways the certificate for www.google.com was issued by:

CN = Thawte SGC CA
O = Thawte Consulting (Pty) Ltd.
C = ZA

and Thawte SGC CA was issued by

OU = Class 3 Public Primary Certification Authority
O = VeriSign, Inc.
C = US

which your browser probably has as a trusted certificate authority.


How to test if my server is secure? I'm using a debian7 VPS for hosting my websites. I have only installed webmin, apache, mysql, SSH and a wordpress website. I always update my packages and wordpress version.
What is the best (free) user friendly tool to test my server for any possible security weaknesses? Also feel free to give me any tips that i would need to know!

Thanks in advance.

As you are running a VPS you should be able to gain sufficient access, usually via SSH, to configure and install helpful software to automate some of the tasks required.

You should  look at tools such as LSAT and Lynis that support the process of doing a security audit:
https://packages.debian.org/wheezy/utils/lsat
https://cisofy.com/lynis/

You should also spend time studying the OWASP site and running tools like Zed on your domains / IPs:
https://www.owasp.org/index.php/OWASP_Zed_Attack_Proxy_Project

All of these tools are free, you might also like to read more about auditing Linux here:
http://linux-audit.com/

Hope that helps.


Why do I need a firewall on my router? I just bought a new router, and as usual the router manufacturer make a big deal out of the firewall.

I have never understood why the firewall is needed, sure, stopping dos attacks (such as syn-floods) is great, but that's the only useful thing I can think of.

As long as the services I expose to the external interface (by manually adding nat-entries) haven't got unpatched exploits isn't my lan already secure against external agents?

Please read the following previously asked questions:

How important is NAT as a security layer?
How can someone hack my PC if I am connecting to the internet through NAT?
What kind of attacks against home router's NAT do exist?

They answer all of your questions.

The short version is:

NAT does not automatically imply that all inbounded connections are blocked.  NAT and firewalls are, in principle, orthogonal.  Generally speaking, most NAT boxes also happen to provide some firewall-like protection: they tend to block incoming connections.  This is not an inherent or necessary property of NAT; it is just that most consumer devices that provide NAT also happen to provide this sort of firewalling as well.
Blocking inbound connections (whether you want to attribute it to the firewalling functionality or the NAT functionality) provides a basic level of defense that works pretty well against a common class of attacks.  That makes it a good thing.
No, neither a firewall nor a NAT implies that your network is totally secure against external agents.  Blocking inbound connections provides a level of defense against certain attacks, but not by any means all attacks.

But you really need to read the prior answers.  I'm not going to repeat all of the excellent points made there.