Password management for kids - what's a good way to start? Consider a young (primary-school age) child who is starting to collect passwords for online services.  How can a parent (or equivalent) help them manage their passwords?

An example to make things clearer: My daughter might want to log on to http://scratch.mit.edu from several locations/devices to show her projects to the family.  She also has a couple of email addresses, one of which she's likely to be using herself soon (under supervision).  While her own device will be logged in, she may need access from others.

So far I take care of it for her: I know her password and (pseudonymous) user ID, and store them in my KeePass.  That's appropriate at this stage, but it's not much help if she needs them without me (short of sending login details in plaintext to her grandparents, for example).  There should also be a solution that doesn't require me to possess these details, from the point of view of sticking to the general rule of keeping your login details secret.  Memorising a really strong master password is probably a bit much to ask, and she's likely to mislay any physical storage.

I like to plan ahead, so moving forwards: What's the best approach to take for a young, fairly bright child, to keep logins safe and train good practice in advance of more important accounts?

Maybe the lesson for children should be less about how to use tools to manage a password, and more about understanding why managing passwords is important?

Let them write their passwords in a notebook. Have fun with devising a method for obfuscation in case the notebook is lost. Teach them about backups- keeping a copy someplace safe. In my experience, kids and old people are a lot alike when it comes to password (mis)management

Until they were skilled enough to manage their own password database, I also kept the kids logins in a "family KeePass". This is the same one where the aged family members stuff is- because people die and sometimes you need to recover things for otherwise unable people. The trust/risk calculus is different in a family group than in a work or social circle. There is also a difference between sharing access to a password and sharing a password.

It is awesome that you are thinking about this early. Good luck!


How can a network be secured against attacks coming from the inside? (updated to (hopefully) be less broad)

No matter how well one secures a network there's always the chance of an attacker gaining access. In a shared home + home office network (eg. for a remote worker and their family) there is considerable risk of this from friends and family using the network insecurely or on potentially compromised devices.

For lack of better terminology I'll refer to two types of users of the network:

Guests - (typically transient) users who only need access to WAN, not LAN.
Privileged users/devices - those who are consistent/persistent users and need to communicate with other devices on the LAN. For example, a remote worker and their direct family.

Now, let's assume the following:

Insiders "going rogue" isn't a concern.
I assume that the attacker therefore would not have any prior knowledge of the network setup beyond what can be obtained prior to breaking in.
WiFi is used both by guests and privileged users for mobile devices and laptops.

Privileged devices on WiFi would like to be able to communicate securely with other privileged devices (both wired and wireless) and vice versa.

Guests sometimes connect via the wired connection as well (eg. using an Ethernet port in a guest room).
The WiFi can't be trusted to be encrypted since not all privileged users can be trusted to not inadvertently leak the password.
The network includes some LAN services such as shared printers, a file server/NAS, etc. Assume that they have appropriate authentication/authorization enabled (passwords, SSH keys, etc.)
The network does not include any publicly accessible services (eg. no web servers accessible from the internet).

I can see two ways for an attacker to gain access to the network:

Via a device they have access to being added as a guest device (eg. by cracking the WiFi, or having compromised a guest's device). In this case they presumably haven't (yet) gained access to any privileged devices or passwords or secrets used by privileged devices or LAN communication.
By compromising a privileged device. In this case they presumably now have or can gain access to any secrets used on or by the device.

What threats do these scenarios present and how can they be mitigated via network setup? (Mitigating them via antivirus etc. is a whole different can of worms)

Note: the use case I'm interested in is for remote workers running shared home + home office networks - solutions that can be implemented by someone who is proficient technically but not necessarily in networking would be preferred.

One of the easiest ways to protect against internal attacks is by isolation: in other words, having multiple sub-networks. For example, (this even works in a small home network), the wifi network might be 10.0.1.0/24, and there could be another internal network where the wired desktops and servers reside, perhaps call it 10.0.2.0/24. Now even if someone hacks into the wireless network they are constrained to computers in the 10.0.1.X space, and would be unable to access the desktops and servers. You could even have specific routes so that both networks can share a printer which is in one of the networks (or a third network), without exposing anything else.

As for sniffing wired traffic on the same network, this isn't an issue unless the network uses hubs rather than switches. With switches the traffic is only sent through the device ports of the recipient, so other devices cannot "sniff" that traffic. (That is an oversimplification but the general concept should be clear.) In order for someone to sniff traffic under normal circumstances, they would have to have admin access to a switch with promiscuous capabilities.

Note that with just these basic concepts, you don't really need to worry about encrypting wired traffic within an internal network, because it is already (generally) secure. This is why when you talk about encryption, it is usually within the context of traffic over the public internet.

Outside of those basics, it is difficult to go into more detail because this is a huge topic. But that should at least clarify your initial thoughts and get you on the right track.


What Same Origin Policy related risks are there with static pages? I am wondering what risks there are if you have static pages on the same host that don't trust each other.
A key concept of Javascript and web security is the Same Origin Policy (SOP), which is also the reason why we need to avoid XSS. If there's e.g. a blog on example.org with an admin interface on example.org/admin and an attacker can place some javascript on example.org/foo then the attacker can execute javascript that e.g. will create a new admin account or perform other actions on behalf of the admin. I generally understand how this is happening.

However I wonder the following: If the pages on example.org are all static, i.e. no forms that perform actions or endpoints that act on POST requests, does the SOP still matter?

I was thinking of attacks like: Can example.org/foo/ open example.org/bar/, but with manipulated content? This could be useful e.g. if example.org/foo hosts downloads that an attacker can manipulate or redirect. I have tried a few things, but I wasn't able to perform such an attack. (One way might be ServiceWorkers, but they are path constrained, which limits possibilities quite a bit.)

And are there other attacks that one should care about in purely static scenarios?

XSS generally impacts integrity and confidentiality (an attacker can read and modify data they shouldn't).

If you only have static pages with no authentication and/or user-specific content, then confidentiality may not be as important (an attacker may eg still be able to log which specific pages a victim user views, which depending on the nature of the site may not be desired).

Possibly of higher interest is that the integrity of the site is in danger. An attacker can show what they like to a user, eg a login page, or as you note, they can replace all links. A very simple example would be:

var w = window.open("http://example.com/a.html",'_blank');
w.onload = function() {
    var links = w.document.getElementsByTagName("a");

    for (var i = 0; i < links.length; i++) {
        links[i].href = "http://evil.com"
    }
}

Additionally, you may run into problems if another origin trusts the vulnerable origin (eg https://blog.example.com is vulnerable to XSS, and https://admin.example.com has a CORS policy trusting all *.example.com domains).


Decrypting encrypted traffic with hacking an app I am thinking how does telegram ensure that messages are secret. I understand they use the public key to encrypt and private key to decrypt. Why is it not possible for an attacker to download the telegram app to obtain the private key.

Is a private key fixed? Or it is a random generated number. In what way does telegram or any other applications for that matter ensure that their private key is not compromised since the application is freely downloadable.

telegram probably will use features that are built in a mobile phone operating system to keep those cryptographic keys, for example Android key Store or Apple's Keychain.
these key store mechanism will in turn utilising the hardware provided by mobile phone to prevent key extraction.


Is a certificate's thumbprint considered private? I have a command line to sign an executable using Microsoft's signtool, and one way to identify my certificate is with a sha1 thumbprint. The command looks like:

signtool sign [...] /sha1 <sha1_thumbprint> [...] file.exe

My question is: is the thumbprint considered private? Can I commit the command line to a repository, or is it better to avoid doing that?

No, thumbprint is not considered private. This is because, thumbprint is a result of one-way hashing function (SHA1 or other).

By definition, hashing functions accepts messages of variable length as input and produce fixed-length output. Output length depends on actual hashing function. As the result, it is impossible to recover input message by knowing only it's hash (thumbprint). So, you can post thumbprint value in public when necessary without worrying that someone will recover input message that produced specified thumbprint.


Location Obfusication and Email/remote login Would it be possible for a user of a 3rd party VNC software package and email client to obfusicate/spoof their location, so that an employer would be unable to determine the location from which the user is working remotely?  Could one potentially set up a home server to pass connections through - so as to appear to be operating from home?

The short answer is yes, there are a variety of ways to achieve this, if I'm understanding your question correctly.

A basic example would be that a user could set-up Team viewer on their home PC, then connect to it from anywhere in the world.  they could then use VNC into the office over the Team Viewer connection and appear (from an IP address perspective) to be coming from home.


Why isn't this XSS working? I'm learning DOM XSS and I have this code :

<html>
 <body>
     Select your language:
     <select>
        <script>
        document.write("<OPTION value=1>"+document.location.href.substring(document.location.href.indexOf("default=")+8)+"</OPTION>");
        document.write("<OPTION value=2>English</OPTION>");
         </script>
     </select>
 </body>
</html>

but I don't understand why this payload doesn't trigger any XSS :

t.html?default=test</option><img src=x onerror=alert(1)/>

It looks like the symbols are encoded and I don't understand why...

I took the script from https://www.owasp.org/index.php/DOM_Based_XSS so I guess it's vulnerable but I don't know how to exploit it...

It doesn't work because the payload is URL-encoded.

If you navigate to

https://example.com/?foo=<>"

you will see the literal characters <>" in your URL bar, but the browser has actually requested

https://example.com/?foo=%3C%3E%22

. That is, your browser always URL-encodes some characters in the query string, including quotes and angle brackets.

So, if you access location.href via JS, the payload in your example will be returned as

test%3C/option%3E%3Cimg%20src=x%20onerror=alert(1)/%3E

. This does not produce any HTML tags unless you URL-decode it first.

Note: As far as I know, all modern browsers now behave that way, but historically, some implementations have implicitly URL-decoded values for the location interface. In these browsers, your attack would have worked.


What is a secure method to send pdf files with private information? An employer wants me to send an i-9 form, which has my social and date of birth, via e-mail to their HR department.  This seems quite baffling to me why they would want me to just send the form in this method.

I was wondering if I was being too paranoid and if I should just send the form?  Or, if I'm not, how to send such a file securely without too much tech-work on the HR end?

I was thinking to send a password protected zip file containing the pdf.

The easiest solution is to employ both zip encryption and also password protecting the PDF file. I'm quite partial to services like onetimesecret for sharing the actual passwords, but calling them with the actual passwords would work as well. The point is to make it easy for HR to access your documents but not thrown out in the open like you want. GPG encryption is of course much safer and the recommended method, but in this case you don't control the other end and they'd be less open to using this sort of solution.


Is it safe to share your `gitconfig`'s `user.signingkey` value with the world? I'd like to publish my .gitconfig file on GitHub, which includes a signing key.

As far as I understand, since this is related to code signing, the key referenced there is the ID of my private GPG key.

How safe is it to share it with the world?

Is it safe to share your gitconfig's user.signingkey value with the world?

Yes, that is safe.

The signingkey value is your GPG key ID (the lower 64 bits of the fingerprint) which is derived from your public key and does not carry any secret information. Therefore you can publish it to the same extent you would publish your public key. (Instead of the shorter key ID, you could also use the full fingerprint for the signingkey value.)


Limit file access to admin and application on Windows 10? I'm looking for a way to secure special made config files on an Windows 10 installation:

A user without admin rights must not have direct access to the unencrypted text file.
A closed source application which the user needs must have unrestricted access to it's config file.

How can this be achieved?

There's no really easy way, I'm afraid. The assumption in most of computer security, dating clear back to the first multi-user systems, is that anything a program running under a user can see, then another program running under that user (such as Notepad) can also see. This has been changed somewhat by the introduction of app sandboxing, but all that does is let you make it so some specific program(s) can see less than other programs; it doesn't give them the ability to see more.

To do this, you'll need to create a new account (or use the Administrator account, but that's needlessly dangerous) for the program to run in, and then create a way for a non-admin user to launch that program as that user without being able to launch any other program as that user. On Unix-like operating systems that's relatively easy - the "setuid" bit in file permissions would let you do this - but it's harder on Windows.

Here's one way, if you don't mind doing a little work for each non-admin user and are using Win10 Pro or Enterprise (or other recent "Professional-or-higher" Windows edition):

Create the "SecureApp" user.
Set the app's config file to be full access for the new SecureApp user, but no access for anybody else (at least, any other non-admin).
Create a shortcut that uses the runas.exe program with the /savecred parameter. The full command will look something like this: runas.exe /savecred /user:SecureApp C:\path\to\the\application.exe. See this forum post for a step-by-step.
Run the shortcut once for the non-admin user, and enter the password of the SecureApp user when prompted.

The user can then run that shortcut to launch the program. Launching the program directly won't work, and you may need to do step 4 once for each non-admin user who needs access (even if they all log into the same computer and you put the shortcut on the all-users desktop or similar). Also note that the program won't have access to the user's own files or settings (more accurately, won't have access to the user's profile directory or current-user registry); if the program needs such access you will have to manually give the SecureApp user access to those items. Also, you need to make sure that your users never find out the password for the SecureApp user, or they can invoke runas themselves with some other program (like notepad) to go edit the config file.


Do I have to make any more check if I use prepared statements for integers? I am currently using PDO with prepared statements for some integer values (see PDO::PARAM_INT). That means I call PDO like this:

$stmt = $conn->prepare("SELECT `lastMove` FROM ".GAMES_TABLE.
                " WHERE `id`=:gameID AND (`whiteUserID` = ".USER_ID.
                " OR `blackUserID` = ".USER_ID.") LIMIT 1");
$stmt->bindValue(':gameID', $_POST['gameID'], PDO::PARAM_INT);
$stmt->execute();

Do I have to make any checks on $_POST['gameID']? Which vulnerabilities might exist?

PDO and integers

Krzysztof Kotowicz made a great comment. He said that PDO treats integers as Strings. So I enabled the MySQL general_log:

open /etc/mysql/my.cnf
set general_log to 1 and add the path to general_log_file (e.g. /var/log/mysql/mysql.log)
Restart your MySQL server: sudo /etc/init.d/mysql restart
Take a look at the file: tail -f /var/log/mysql/mysql.log
Call the following snippet:

test.php:

$stmt = $conn->prepare("SELECT `lastMove` FROM ".GAMES_TABLE.
                " WHERE `id`=:gameID AND (`whiteUserID` = :uid".
                " OR `blackUserID` = :uid) LIMIT 1");
$stmt->bindValue(':gameID', "abc", PDO::PARAM_INT);
$stmt->bindValue(':uid', "1'", PDO::PARAM_INT);
$stmt->execute();
$result = $stmt->fetch(PDO::FETCH_ASSOC);

This is the result:

111114 17:32:54   241 Connect   chessuser@localhost on chess
          241 Query SELECT `user_id` FROM `chess_users` WHERE `user_id`='1'  LIMIT 1
          241 Query SELECT `lastMove` FROM chess_games WHERE `id`='abc' AND (`whiteUserID` = '1\'' OR `blackUserID` = '1\'') LIMIT 1
          241 Quit

So obiously it doesn't make it to an int on the PHP-side (PHP Version 5.3.2-1ubuntu4.10)

First off: You're not making full use of prepared statements.  That could expose you to to SQL injection problems.

You should not be using string concatenation to build up the argument to $conn->prepare().  Instead, you should be using a string constant as the SQL query, and relying upon bindValue() to fill in dynamic values.  In an ideal world you could write something like this:

$stmt = $conn->prepare("SELECT `lastMove` FROM :table".
            " WHERE `id`=:gameID AND (`whiteUserID` = :userid".
            " OR `blackUserID` = :userid) LIMIT 1");
$stmt->bindValue(':gameID', $_POST['gameID'], PDO::PARAM_INT);
$stmt->bindValue(':table', GAMES_TABLE, PDO::PARAM_STR);
$stmt->bindValue(':userid', USER_ID, PDO::PARAM_STR);
$stmt->execute();

However, PDO prepared statements don't let you specify the table name in this way, so you're forced to use string concatenation for the table name, like this:

$stmt = $conn->prepare("SELECT `lastMove` FROM ".
            mysql_real_escape_string(GAMES_TABLE).
            " WHERE `id`=:gameID AND (`whiteUserID` = :userid".
            " OR `blackUserID` = :userid) LIMIT 1");
$stmt->bindValue(':gameID', $_POST['gameID'], PDO::PARAM_INT);
$stmt->bindValue(':userid', USER_ID, PDO::PARAM_STR);
$stmt->execute();

Using string concatenation with any non-constant string to build up the first parameter to prepare() introduces a danger of SQL injection attacks, so you need to be careful here.  You need to check carefully that GAMES_TABLE is a constant and can never be influenced by the attacker (you might consider inlining it).  Also, you might want to sanitize/escape it just in case, as in the code I've shown above.  It is an annoying limit of prepared statements that they can't handle this for you.

Rule of thumb: prepared statements are safe from SQL injection, as long as the SQL query itself is a constant string.

Unfortunately, you may discover a few cases where prepared statements are too limiting, such as dynamic ORDER BY or LIMIT parameters -- as well as dynamic table names, as illustrated above.  For these cases, you will probably need to use string concatenation.  In these cases, you must be extremely careful, as using string concatenation re-introduces the risk of SQL injection vulnerabilities.

In any case, you should still use prepared statements for everything you possibly can, such as for USER_ID, as it is less error-prone than doing the string concatenation yourself.  Also, because prepared statements make it easier to verify you have avoided SQL injection flaws, it is to your benefit to use prepared statements instead of string concatenation everywhere you can.

Additional checks: To answer your original question, if PDO implemented its API properly, you would not need any other checks on an integer value to prevent SQL injection problems.  Unfortunately, @Krzysztof Kotowicz has pointed out that PHP PDO library is buggy: it ignores the PDO::PARAM_INT argument and treats everything as a string, regardless.  Therefore, you probably ought to do the extra coding that's needed to make up for this flaw in the PDO library.  In particular, you should coerce (cast) the value to an integer, before passing it.  Thus, I suggest something like the following:

// don't use $_POST['gameID'] elsewhere; use $gameID
$gameID = (int) $_POST['gameID'];

$stmt = $conn->prepare("SELECT `lastMove` FROM ".
            mysql_real_escape_string(GAMES_TABLE).
            " WHERE `id`=:gameID AND (`whiteUserID` = :userid".
            " OR `blackUserID` = :userid) LIMIT 1");
$stmt->bindValue(':gameID', $gameID, PDO::PARAM_INT);
$stmt->bindValue(':userid', USER_ID, PDO::PARAM_STR);
$stmt->execute();

Separately, you need to make sure that, if an attacker can guess a valid gameID, it does not help the attacker bypass any access control checks in your code.  See, e.g., OWASP's insecure direct object reference vulnerability category.

For string values, it might also be prudent to sanitize the data to ensure it matches some regexp that is appropriate for that value.


When do shared disks "leak" data to other VMs, and how is that mitigated? Inspired by this answer, I would like to know what are some common threats and mitigation techniques used to prevent one VM from leaking data to another via the shared storage infrastructure.

Possible vulnerable scenarios include

EMC SANs that promote/demote data from SATA to FLASH based on IOPS
A server that attempts to secure erase may not erase both locations of the promoted data
VMs that allocate space on demand on an expanding VMDK
Native OS APIs that can read raw partitions
IO errors that act as an Oracle to expose secrets
Storing the encrypted data and the key on the same VM (Bitlocker)
A variant of row hammer (a shared memory exploit) for disk IO Blocks

Possible mitigations might include

The server using a structured REST interface that hides subtle IO errors (e.g. I can't think of a way an Azure Cloud or Page blob can expose this)
On disk encryption managed by the OS (Bitlocker)
A hypervisor that automatically zeros out data upon release of the host

My goal is to come up with a checklist of sorts so I can investigate both the big names (Azure, Amazon, Rackspace, Google Apps, EMC, etc) but also independent niche shops for long tail scenarios.

Cloud providers can provide single tenant hardware so your VMs are isolated from other customers and clients. A number of financial regulators are expecting this to be enabled for confidential / regulated data when stored in the cloud.

For example, Amazon AWS has the concept of a 'dedicated instance' (link)

If you select this option your EC2 instances will be on dedicated hardware for your account, you of course pay a premium for this service with the benefit of reducing side channel attacks against your shared infrastructure at OS level.


Why does my web server receive so many TCP resets from some clients? I run a web server and log connections that are dropped. Occasionally, I get a burst of TCP RST packets from some of my clients, like this:

Feb 11 11:56:29 SRC=1.2.3.4 TTL=57 SPT=38383 DPT=80 WINDOW=0 RST URGP=0
Feb 11 11:56:29 SRC=1.2.3.4 TTL=57 SPT=38383 DPT=80 WINDOW=0 RST URGP=0
Feb 11 11:56:29 SRC=1.2.3.4 TTL=57 SPT=38383 DPT=80 WINDOW=0 RST URGP=0
Feb 11 11:56:29 SRC=1.2.3.4 TTL=57 SPT=38383 DPT=80 WINDOW=0 RST URGP=0
Feb 11 11:56:29 SRC=1.2.3.4 TTL=57 SPT=38383 DPT=80 WINDOW=0 RST URGP=0
Feb 11 11:56:29 SRC=1.2.3.4 TTL=57 SPT=38383 DPT=80 WINDOW=0 RST URGP=0
Feb 11 11:56:29 SRC=1.2.3.4 TTL=57 SPT=38383 DPT=80 WINDOW=0 RST URGP=0
Feb 11 11:56:29 SRC=1.2.3.4 TTL=57 SPT=38383 DPT=80 WINDOW=0 RST URGP=0
Feb 11 11:56:29 SRC=1.2.3.4 TTL=57 SPT=38383 DPT=80 WINDOW=0 RST URGP=0
Feb 11 11:56:29 SRC=1.2.3.4 TTL=57 SPT=38383 DPT=80 WINDOW=0 RST URGP=0
Feb 11 11:56:29 SRC=1.2.3.4 TTL=57 SPT=38383 DPT=80 WINDOW=0 RST URGP=0
Feb 11 11:56:30 SRC=1.2.3.4 TTL=57 SPT=38383 DPT=80 WINDOW=0 RST URGP=0

Is this a RST flood attack, DDOS attack, TCP reset attack or some other phenomenon?

There is a few things that could be going on. Its possible that this is related to ECN on firewalls which can cause this, but I can assure you this in probably not any type of flooding attack or DDOS.

One reason a device will send a RST is in response to receiving a packet for a closed socket.

It's hard to give a firm but general answer, because every possible perversion has been visited on TCP since its inception, and all sorts of people might be inserting RSTs in an attempt to block traffic.

But as I said before, this looks more like a firewall is throwing up requests. I wouldn't be to concerned. You could do a more verbose look into that SRC see who's doing what.


Securing REST API with HMAC and basic auth I was wondering if giving users choice of a method for securing their access to API would be a good idea.

Background:

We are creating and deploying applications for our customers, which help them do their work more efficiently. Each of our clients is running a self-contained application and we plan to create an API that will allow them to integrate their third party tools or what have you. It will not be a public API but a private one.

Now, when researching the subject I came into an understanding that using basic auth, even through HTTPS is not a very good idea. Apparently, preferred method would be using HMAC with nonces. I am all for securing the fort, however HMAC solution presents one problem - its more complicated and requires developer to firstly create HMAC and then feed it into a request, basically making whole API not easily discoverable (like you cant just type in curl https://my.url/api/endpoint/ and see what happens).

It cam to my attention that people at Stripe do use basic auth with token as a user so their curl request looks like this: curl -u sk_test_mysecretrandomkeywhatever https://my.url/api/endpoint/

This is my book is a big advantage and if its good enough for payment processing company then perhaps it will be good for us too?

Then I got thinking - what if we offer both as a choice? You want to use basic auth only? Fine, you can use only that. One of your clients is a security freak and wants to make sure that your system is secure? Enable HMAC authentication and start playing with HMACs etc. Is that a feasible solution or would you say it is a security travesty?

Please shed some light on the subject or at least point me in a right direction.

It is not clear for me which kind of problem you are trying to solve and it might not even be clear to you. If you have a clear idea what you are trying to achieve with the authentication than you would not need to offer the client multiple authentication schemes but stick with the one which solves your problem.

If you fear a compromise of the authentication credentials because the connection might be sniffed simply use TLS. In this case basic authentication, session cookies or similar "clear text" authentications offers enough protection since the secret is protected during transfer.

If TLS is not possible you might use challenge response methods where you have a pre-shared secret key. This protects the authentication but does not protect against hijacking of the connection, i.e. a man in the middle could pass the authentication and then modify any actions done inside the authenticated connection. With proper use of TLS this would not be a problem but then you could also use simpler authentication methods.

There are other authentication methods (like mutual TLS authentication) but I recommend you first determine what needs to protected and what kind of misuse you want to be protected against. Once this is done you can select from the existing methods the one which matches your problem best.


Can data be stolen from RAM in use The limits of my knowledge on the subject (on any subject) may render this a stupid question.
Regardless; Could a malicious program theoretically steal data from primary memory (RAM)?

Scenario:

I currently store password data on a heavily encrypted USB, with layers of encryption currently impractical to break. In the event that this USB is stolen, I know exactly what accounts to quickly change passwords for, despite the practical security of the encryption.
Although the passwords.txt file is only 'stored' in permanent secondary memory on the USB, it will briefly appear within the RAM of the computer which I use to mount the USB, decrypt the data, and open the file. It is here that I suspect a weakness my reside.

To clarify: It is of course more realistic that this 'malicious program' simply reads the file once the USB is mounted and its contents decrypted, however I am asking specifically about compromising this data through RAM.

In summary:

How realistic is the threat of a program stealing data from RAM, theoretical or otherwise?
(Side question): Aside from the obvious Anti-Virus solution to mitigate a malicious program, how may RAM be protected?

How realistic is the threat of a program stealing data from RAM, theoretical or otherwise?

Its easy. With the right permissions there are several ways of doing this. From taking a memory dump of the program to reading/writing to it directly. Unless you have explicitly checked the permissions of all code running on your machine you should assume any code running as admin/root or as the user running who owns the process you are worried about can do it. In Windows for example there is ReadProcessMemory and WriteProcessMemory.

  Aside from the obvious Anti-Virus solution to mitigate a malicious program, how may RAM be protected?

Don't run any code you don't trust.
Run the code as a separate user under which no users other than admin have access rights.
Use methods like address space layout randomisation and memory encryption to make identifying where data is more difficult (although with full memory access it can still be done - afterall your program has to know where it is).


Reliability of Certificate Authorities and Certificates in 2015 I just happened to stumble upon this Article in Netcraft. The article claims that many of the major CAs have given out hundreds of Certificates to false organizations.

Are there any truth to these claims? Is there any data to support it?

It is also worrying that these fake certificates were issued by many of the major CAs. In the past I've never heard of a similar incident in such a massive scale(I may be ignorant here, feel free to enlighten me). Has the Quality of PKI for the web gone down lately?

Are there any truth to these claims? Is there any data to support it?

What data you need to support the claims apart from the ones already in the article? Netcraft is usually not a company which makes unfounded claims.

  Has the Quality of PKI for the web gone down lately?

I don't think so. But since more and more users link SSL with security and phishing sites want to look secure the existing system of lousy checks by the CA gets more abused. Most users don't understand that SSL only protects the transport and does make any statements about the security of the site itself.

But actually, from the perspective of a potential victim a site like https://phypal.com (example from the Netcraft article) is probably not more trustworthy than https://paypal.secure-payments.toplevel or https://support.toplevel/paypal/ which you could probably easy create even when stricter checks are done by the CA. There are usually lots of ways to make your site look trustworthy. In my opinion it is much more important to educate users what kind of security they can really get from SSL, and what it does not protect against.


Stop large requests to my server (TOR) I am being attacked right now from Tor nodes which are doing 404 requests to my HTTP server. It is from one IP but when i use the DROP iptables rule, it starts again from another IP in a matter of seconds.

It started to ask requests to the cgi-bin folder, but now it is doing requests in my images folder. So based on my investigation it is a tool connected to TOR looking for something and right now it drives me mad.

I tried fail2ban, mod_evasive and mod_security, but those programs get triggered when the other side is looking for one thing or banging at the door at one port. But this tool is looking at every request for a different file.

45.63.100.91 - - [26/Dec/2016:03:27:17 +0100] "HEAD //images/imgsupport.php HTTP/1.1" 404 - "-" "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; MATBJS; rv:11.0) like Gecko"
45.63.100.91 - - [26/Dec/2016:03:27:17 +0100] "HEAD //images/imgppexg.php HTTP/1.1" 404 - "-" "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; MATBJS; rv:11.0) like Gecko"
45.63.100.91 - - [26/Dec/2016:03:27:17 +0100] "HEAD //images/imgppantivirussoft.php HTTP/1.1" 404 - "-" "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; MATBJS; rv:11.0) like Gecko"
45.63.100.91 - - [26/Dec/2016:03:27:17 +0100] "HEAD //images/imgwin95.php HTTP/1.1" 404 - "-" "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; MATBJS; rv:11.0) like Gecko"
45.63.100.91 - - [26/Dec/2016:03:27:17 +0100] "HEAD //images/imgnws.php HTTP/1.1" 404 - "-" "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; MATBJS; rv:11.0) like Gecko"
45.63.100.91 - - [26/Dec/2016:03:27:17 +0100] "HEAD //images/imgroundcorner.php HTTP/1.1" 404 - "-" "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; MATBJS; rv:11.0) like Gecko"
45.63.100.91 - - [26/Dec/2016:03:27:17 +0100] "HEAD //images/imgppcdl.php HTTP/1.1" 404 - "-" "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; MATBJS; rv:11.0) like Gecko"
45.63.100.91 - - [26/Dec/2016:03:27:17 +0100] "HEAD //images/yellowbuy3.php HTTP/1.1" 404 - "-" "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; MATBJS; rv:11.0) like Gecko"
45.63.100.91 - - [26/Dec/2016:03:27:17 +0100] "HEAD //images/imgvirusinfo.php HTTP/1.1" 404 - "-" "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; MATBJS; rv:11.0) like Gecko"
45.63.100.91 - - [26/Dec/2016:03:27:17 +0100] "HEAD //images/escan4.php HTTP/1.1" 404 - "-" "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; MATBJS; rv:11.0) like Gecko"
45.63.100.91 - - [26/Dec/2016:03:27:17 +0100] "HEAD //images/imgredline.php HTTP/1.1" 404 - "-" "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; MATBJS; rv:11.0) like Gecko"
45.63.100.91 - - [26/Dec/2016:03:27:17 +0100] "HEAD //images/imgonlinescan.php HTTP/1.1" 404 - "-" "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; MATBJS; rv:11.0) like Gecko"
45.63.100.91 - - [26/Dec/2016:03:27:17 +0100] "HEAD //images/ram1.php HTTP/1.1" 404 - "-" "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; MATBJS; rv:11.0) like Gecko"
45.63.100.91 - - [26/Dec/2016:03:27:17 +0100] "HEAD //images/imgmanualscan.php HTTP/1.1" 404 - "-" "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; MATBJS; rv:11.0) like Gecko"
45.63.100.91 - - [26/Dec/2016:03:27:17 +0100] "HEAD //images/userdefine.php HTTP/1.1" 404 - "-" "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; MATBJS; rv:11.0) like Gecko"
45.63.100.91 - - [26/Dec/2016:03:27:17 +0100] "HEAD //images/betterinterface.php HTTP/1.1" 404 - "-" "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; MATBJS; rv:11.0) like Gecko"

You see it is looking in the folder images for a specific .php file, but at every request it is looking for a different php file. So, what the hell is this thing doing?

This also eats up my bandwidth, so I am really desperate what I need to do now. Anyone an idea how I can block this?

Server setup: CentOS 7 (OpenVZ, so I am stuck with a kernel where ipset isn't working) with Apache.

You could drop packets from tor nodes all together if you like with ip tables.
List of tor nodes can be found at:

Ref 1: https://check.torproject.org/cgi-bin/TorBulkExitList.py
Ref 2: https://www.dan.me.uk/tornodes

Here is a bash one liner to block all traffic from tor to your web server. There are currently about 2000 tor nodes online now that support port 80. So you will be inserting quite a few iptable's wouldnt really call this a long term fix but should stop the attack.

wget "https://check.torproject.org/cgi-bin/TorBulkExitList.py?ip=8.8.8.8&port=" -O /tmp/ip.lst && sed -i -e '1,3d' /tmp/ip.lst && for i in $(cat /tmp/ip.lst); do iptables -A INPUT -p tcp -s $i --match multiport --dports 80,443 -j DROP; done


What makes twitter different than other sites regarding users anonymity Why do we hear everyday about people getting prosecuted because of comments they made on twitter but not on Facebook or reddit?

I know very little about social media but it's not that difficult to hide your identity online unless NSA is after you for terrorism.

It's not about your anonymity, but about your audience. As @darkf mentioned, Twitter doesn't have the same level of privacy settings that Facebook does. A user's tweets are either all protected or all public. This means that you have less control over your audience. A message that you meant as a sarcastic comment could be retweeted (repeated with attribution) by a friend who thinks it is funny, but someone you don't know could miss the sarcasm and interpret it as a terroristic threat and report it to the authorities. At this point, because of the public nature of Twitter, the authorities do not need a warrant or a subpoena to view your statement; depending on the level of personal detail in your profile, they might not even need Twitter's cooperation to identify you directly.

Facebook's privacy settings are really not any protection against law enforcement, since Facebook will comply with legal requests to access your content. Its real "benefit" in this situation is your ability to control your audience: if only your friends see your sarcastic statement, it is much less likely that they will turn you in to the authorities for making terroristic threats, since they are more likely to understand your tone and the unlikelihood that you are seriously making a threat.

EDITED TO ADD:

I didn't address Reddit. Because a large part of its structure is as a link aggregator, the opinions and statements of its users are primarily found in the comments, a lower-status area that doesn't get as much attention for a few reasons:

Perception based on other sites that the comments section consists of loonies.
Reduced ability to search comments for terms of interest. (Does Reddit even offer this natively?)
Widespread use of joke or throwaway accounts.

In other words, the signal-to-noise ratio is too high to make monitoring Reddit (or taking threats there seriously) of much worth to law enforcement. Twitter is really in the sweet spot between strong identity links (people using their real names and investing in their account's status) and openness of content to observation. Twitter's API even makes it easy to monitor for threats: you could have a feed consisting solely of tweets using the word "bomb" that originate in Birmingham, for instance.


Hydra not matching password provided in file I was pen-testing my TP-Link router yesterday and tried performing a Hydra attack on it. I wrote the following line on the terminal:

hydra -l admin -p passwords.txt 192.168.0.1 http

The username and password for the router is admin and the second password provided in the passwords.txt file is admin but the output is:

1 of 1 target completed, 0 valid passwords found

Hydra parameters are case-sensitive.

In your specific situation, -p is used as password input parameter, while -P is used as input for reading a file (Official syntax: [-p PASS|-P FILE] ).


How does a CA add www and raw domain names to my cert when my CSR doesn't have them? I'm in the process of buying an SSL cert, and I'm confused by this part: Many CAs say they'll add www. to your domain, so that e.g. if you buy a single-domain cert app.example.com, they'll also add www.app.example.com as a matching domain name in your cert.

A related example is that if you buy a wildcard cert, say *.example.com, some CAs also say that they'll give you a cert that covers example.com (I know that if your CN only has *.example.com, it will not match example.com).

In both cases, they only seem to ask me to specify one CN – app.example.com or *.example.com.

Which makes me wonder: How do they add the www. part (www.app.example.com for app.example.com) or the bare domain part (example.com for *.example.com) when they issue me the cert?

In addition, when we create a self-signed cert, can we also use the same technique? If so, is there any example using OpenSSL to do it? I already know how to create a self-signed cert and have your users trust your "in-house root CA cert", so I'm curious about what it takes to add additional CNs (or is it the subjectAltName field?) to your CSR or the eventually-issued cert.

The CA puts exactly what it wishes to put in the certificate it issues. The certificate request that you send poses no constraint whatsoever on the CA. The certificate request is just a vessel for your public key and, possibly, additional information that you might like to find in the resulting certificate, such as a specific server name. The CA is free, both technically and legally, to disregard or alter such information as it sees fit.


Genuineness of Application Pentest On Jailbroken iOS Device Having read books on iOS Pentesting, I noted almost all security testcases or tool(s) require a jailbroken device.

I looked for information about this, because it is needed to perform those tests or to use those tools, and I understood it.

But I cannot find an explanation around:

In the real world not all devices are jailbroken, so how relevant are test results using a jailbroken device in a real context?

EDIT

Can I assume that an application vulnerability once found in a debugging environment, it should be replicated on a non-jailbroken device to become validated?

Generally iOS Security assessments (a.k.a penetration testing) are targeting applications running on an iOS device and not the Operating System/platform itself (which has already been subjected to a large number of assessments).

In order to effectively assess the security of an application running on iOS a jailbroken device is needed as debugging and examining the application code and runtime behaviour is difficult without access to the underlying OS.

Most security assessment companies keep a stock of Jailbroken devices, pretty much for this purpose.

Edit to address your added question. I think replication on a non-jailbroken device would depend on the issue at hand.  As an example a security issue with an application might be that it stores sensitive data such as credentials in clear text.  Now on it's own this may not be exploitable, but it's still bad security practice.  Most security assessments I've seen would show evidence of the problem but wouldn't necessarily require replication on a non-jailbroken device every time.


Can't solve format for Salted SHA1 hashes with Hashcat? I am attempting to understand the format for this Salted SHA1 hash for an assignment. The line of text I was given was:

nameExample@email.com,nameExample,nameExample@email.com,nameExample,,,aadefeff82b5c1a2272079151dc489822aeaa6ca,7391178a855af48e59ced36447c6bc2b9ade2536,f0c06e699ca51d75d97225fdabf1f04e8d1cffe7,a52e60313972af51e0787d8c3eb20abaa33eb7e1,,,,2012-06-01 12:29:15,2014-11-08 20:38:14,1,0,38526305,6,,,,BAh7BzoSYWNjZXB0ZWRfZXVsYXsGbCsHgF37U2wrBzB/XlQ6G2dhbWVfY2VudGVyX2FjY291bnRfaWRpA2C0Lw==,33481266665,

I got numerous errors (Separator unmatched, Token length exception) when I tried running Hashcat on the string of text with the following arguments:

hashcat64.exe -a 0 -m 110 hashExample.txt dictionaryExample.txt -r rules/best64.rule

hashcat64.exe -a 0 -m 120 hashExample.txt dictionaryExample.txt -r rules/best64.rule

hashcat64.exe -a 0 -m 130 hashExample.txt dictionaryExample.txt -r rules/best64.rule

hashcat64.exe -a 0 -m 140 hashExample.txt dictionaryExample.txt -r rules/best64.rule

Any tips on how to sift through the jargon and find the format for the Salted SHA1 hash?

hashcat wont do this for you, you need to extract the fields you want

using the seperator (-p) and ignore username (--username) switches might help, but you are going to have to get the text into a format hashcat understands first.

looking at your extract there are 25 fields:

9 empty
4 username/email
4 Hex SHA1 hashes
3 single digits
2 timestamps
an 11 digit number
an 8 digit number
a base 64 encoded SHA512 hash

If this is consistant theres not many options


What is blind injection and how to simulate the issue? What is blind SQL injection, and how does it differ from normal SQL injection? How can I simulate an issue of blind injection?

As the name implies, the technique injects SQL, but while being "blind": In response to the request, you won't receive an error message that displays the presence of the SQL injection vulnerability, such as:

  Unclosed quotation mark after the character string ' '.

The fact that you can't deduct the presence of the vulnerability doesn't mean it's not there.

A common method to test for this is to let the server impose a delay in responding: If the server responds immediately, it is not vulnerable. If it takes more time (say, 10 seconds), it is vulnerable.

OWASP has a great page on it, and (much) more information is available on SlideShare  and on the InterN0T forum.


Is library version specification (Java's pom.xml, Python's requirements.txt, etc) fundamentally insecure? Everytime I see a pom.xml file or requirements.txt that says that a given project requires a specific legacy version of a library, it makes me cringe. Am I right when I assume that it's usually insecure to specify maximum (or exact) versions of a library in project's requirements?

I'm asking because I find the popularity of such approach quite confusing - while quite a lot of programming languages allow that, I can't see that adopted in - for example - most Linux package managers that basically "force" developers to port their software to new versions of libraries.

Am I right when I assume that it's usually insecure to specify maximum (or exact) versions of a library in project's requirements?

It depends.

If the requirement is due to a possible API change in later versions then this requirement makes sense. You will often find that Java applications require a specific version of Java since there are lots of small changes between the Java version which might (not necessarily will) break the application. Sometimes the requirement only says with which software stack it was tested and that no support will be given if used with another software stack.

It is bad and insecure if this requirement means that you cannot upgrade the software stack in case of vulnerabilities.

  ... most Linux package managers that basically "force" developers to port their software to new versions of libraries.

Not really. Most Linux distributions do not enforce the newest library in case of vulnerabilities with the older version, but instead try to port the bug fixes back to the older version. Only when a new distributions gets released they include newer versions of the software stack, but also often include additionally older versions to give existing software the (older) libraries they need.

At the end each developer has only limited time to test and thus testing is done only with a few variations of the software stack. And most developers don't have the time to adapt and test their software with each new version of a library or programming language etc.


Are Bell-LaPadula and Biba models used in real big software security design? I am currently studying both Bell-LaPadula and Biba models, I found this models too theoretical as I see the examples and I can see that there are used for designing particular services that needs particular security design that can be achieved with Bell-LaPadula or Biba model.
However, I cant see that this models fit for Operating Systems for example, as in general we can read and write files. Or maybe, another example like a professor that has a level "Expert {Science}" and wants to read and modify exams of the students that have "Student {Science}"

So, Are Bell-LaPadula and Biba models used in real big software security design? Or is for special features? So in that last case, operating Systems like Unix implement other models that maybe have features that are implemented with models like Bell-LaPadula or Biba.

https://thumbs.gfycat.com/AcrobaticLegitimateAnura-mobile.mp4

As the name suggests, these are models, and not implementations. Bell-LaPadula provided a framework that guided how to think about confidentiality (and that significantly impacted the military clearance system) but it is not actively the source of any modern systems security.

from:

  Limitations of BLP Restricted to confidentiality.
  No policies for changing access rights; a complete  general downgrade is secure; BLP intended for  systems with static security levels.
  BLP contains covert channels: a low subject can  detect the existence of high objects when it is  denied access.
  Sometimes, it is not sufficient to hide only the
  contents of objects. Also their existence may  have to be hidden.

As you can see from these limitations, the model is not sufficient for a modern system security design.

Here is a previous question that asks for practical examples, and you can see that the answers discuss how the model influenced thinking, not how it provided a map for implementation.
Practical non-government uses of Biba, Bell-LaPadula, etc. models


Combining Boxcryptor and encrypted cloud service I want to store highly critical documents on a cloud storage as an additional backup. I am using boxcryptor which encrypts files before these get synced to cloud. Boxcryptor encrypts files using AES-256 cipher.

I am using a cloud storage service which encrypts the data at the client before storing on the cloud. So data remains encrypted at rest also. This service also uses AES-256.

Does dual encryption weakens the security?

== Edited ==

Keys are different.

Dual encryption increases security, makes usage less practical and introduces problems when you want to recover your files.

So if you have to use dual encryption (because cloud service encrypts again no matter what) it's fine. But if you have freedom to choose, it's more practical and less troublesome to use a more complex key instead of encrypting two times.


Zero-Day Exploit targeting Internet Explorer Versions 9 through 11 Few days ago, FireEye has found a vulnerability, which affects all versions of IE (even the latest 11). Microsoft has official statement regarding this issue.

FireEye wrote a technical article on their blog which explains details:

  The exploit leverages a previously unknown use-after-free
  vulnerability, and uses a well-known Flash exploitation technique to
  achieve arbitrary memory access and bypass Windows’ ASLR and DEP
  protections.

and exploitation. Although I think I understood the main point, I would be happy if someone would explain it in a simpler terms. I really enjoyed reading explanation about heartbleed vulnerability in openSsl, and hope that someone can explain it in a similar fashion.

I really have no idea what level of technical competency the asker or any/everyone here is coming from so let try to start from the very bottom and work up and do in the simplest language I can. Please don't be offended if you have a masters in computer science or you're some ROP legend or whatever...

In order to understand the exploit in question, even at a basic level, you need to have some understanding of how a computer computes, ie you need to understand the fundamentals of a 'stored program controlled' machine. Once you have some grasp of that, we can talk about general buffer overflow attacks. Then once we understand buffer overflows we have an understanding of both of those things can we start to look at specific examples, non the less, relatively advanced examples making use of several of these more advanced techniques and hope to actually understand them in any detail.

Starting at the very bottom, let's briefly talk about how a computer computes or how processor processes... In your computer you have a CPU and the CPU has various registers on which it can do direct mathematical operations. The computer also has memory, where programs are loaded and run from. There's a special register called the instruction pointer and it's job is to point to location in memory where the current running program's instruction is located so the CPU can fetch and execute it. It does this one by one executing instructions until it gets to a jump or branch or return, etc. Then it will change the instruction pointer so it points to different place in memory and continues execution. This instruction pointer is very important. If you can hijack it, you might be able to get the computer to run things you put in other places in memory. Ever seen those t shirts which say “Got EIP?” That's what we're talking about here. If you can control EIP, you can control the machine.

Now, let's move 'up' a bit from this 'machine level.' Most modern programing languages have this concept of a subroutine call. This will cause the instruction pointer to jump to new area of memory where the function 's code is located. The function will run until it's finished and then control will return to the main program causing the instruction pointer to be set back to the place in the main function where execution left off before. To simplify that a bit.. So you've got this program running, and it runs until it gets to a function call. The function call will move execution to a different place in memory. It will then run in the new place until it gets to a return. At which point it will have to return to the main function. It should be clear that the machine is going to have remember that initial value, the value of the initial instruction pointer otherwise it wont know here to return to. This is known a return pointer.  So the return pointer contains the address of the calling function and is stored in a data structure (in memory) called the stack. The stack works in a LIFO manner, last in first out, hence why it's referred to as a 'stack.' The last one in is the first one out. Generally the stack contains things associated with function calls. Think of the stack as a sort of post it note for little things to remember. So when a function call gets made, the first thing that gets pushed on the stack is the function call arguments.. if there are any.. it then pushes the value of the instruction pointer in the main program on the stack (the return pointer).  then the function itself is invoked and it allocates space on the stack for local variables of the function itself. The function does it it's thing until it gets to its return. At which point those local variables come (pop) off the stack, then the return pointer is popped off  and which, once again, gets set as the instruction pointer - and we return to execution in the main program. This is literally happening millions of time per second on the computer in front of you.

Now, lets get into buffer overflow bugs. Buffer overflows in a class of bugs known as code errors. Buffer overflows have been known about many decades, but didn't became mainstream until back in 1996 with Aleph One's seminal paper called “Smashing the Stack for Fun and Profit” which appeared in Phrack magazine issue 49.  It's a worthwhile read, even today. Buffer overflows  allow an attacker to send data to a target machine and get some code executed ie, getting root/admin on the box. Some work locally and other work across the network. The basic idea is that a program which accepts user input, but doesn't properly check the size of the data before moving it around. It's about not having proper bounds checking on the input field. Think of shoving something very large into a small box. I won't get into an actual example of some vulnerable C code for the sake of both simplicity and brevity, the later of which is probably already out the window.

CHECK BACK IN A FEW HOURS. I have to go right now. I will be back. I will talk about the specific exploit in question. Sorry if this non-typical or usual behavior for this site, I am new here. Only been on a handful of times.


What information can be gained from an Email Header? What information is present in an Email Header that can be used to track a sent mail? For example, are some of these present?

Web Browser used?
Operating system
Type of Network (broadband/dial up)?
Type of system Laptop/Desktop etc.

The RFC 5322 defines what email message headers should look like, and some of the required ones like From, Date, and Message-ID. Most email headers are actually optional and appended to the message by the client and email relays for traceability, usability, and debugging purposes. The email message can contain any number of the 350+ recognized ones. It can also contain any number of custom headers.

Nothing stops Hotmail, GMail, or others from appending the browser's user-agent field to the email headers. Nothing stops Thunderbird from appending your connection type and details about your operating system. However, currently, email clients (web-based or desktop) don't append such information to the email message headers. We're also not aware of web-based email services appending information they have on you to the email message headers.


vulnserver - Can't find JMP ESP in ntdll.dll This tutorial shows how to find a JMP ESP in nttdll.dll
http://sh3llc0d3r.com/vulnserver-trun-command-buffer-overflow-exploit/

Find address for EIP

In this step we have to check the registers and the stack. We have to
find a way to jump to our buffer to execute our code. ESP points to
the beginning of the C part of our buffer. We have to find a JMP ESP
or CALL ESP instruction. Do not forget, that the address must not
contain bad characters!
Open the executable modules list in OllyDbg (press the E letter on the
toolbar). Select a module, for example the ntdll.dll. (Vulnserv would
not be a good choice as its address contains zero!)
Press right click on the code and select Search for/All commands.
Enter JMP ESP. A couple of possible address is displayed. Select one.

I've followed the steps but couldn't find JMP ESP instruction in nttdll.dll.

There are a few executable modules in your screenshot. In your case, nttdll.dll doesn't has JMP ESP instruction.
The right tool for this is mona.py

mona.py is a tool written in Python and available with Immunity
Debugger that helps finding a reliable JMP ESP instruction.

https://www.whitelist1.com/2016/11/xstack-overflow-1-exploiting-slmail.html
To find all addresses with JMP ESP, use !mona jmp -r esp command.
This command will search in the loaded executable modules for a memory address that has JMP ESP.
https://medium.com/@johntroony/a-practical-overview-of-stack-based-buffer-overflow-7572eaaa4982


Secure Development Environment for University dealing with private data We are a development team within a state public university. Much of our development deals with working with private student and employee data.  Some applications push data from internal databases out to cloud-based solutions via secure file transfer or web services. New rules are coming down from the state-wide University System which governs us requiring protection between systems that access the Internet and access internal private data.  These rules do not define what type of separation is required.  The problem is not separation between development, staging, and production (which we already have) but rather protecting development workstations that can access private data from Internet-based attacks.

Other than client-based anti-virus and anti-spam, and network-based firewalls and proxy servers, what are reasonable steps that can be taken to protect development stations, or production servers that need to talk to cloud-based applications, from being a conduit to private data?

Take a look at the PCI standard, it has a lot of guidelines on how to secure credit card data that can also be applied to any confidential data:

https://www.pcisecuritystandards.org/

Not everything will apply to your environment, but it's a good starting point. It covers things like encryption of the data, key management, keeping audit trails, anonymizing data for test/dev machines, securing workstations that have access to the data, etc.

Build and Maintain a Secure Network

Install and maintain a firewall configuration to protect cardholder data
Do not use vendor-supplied defaults for system passwords and other security parameters

Protect Cardholder Data

Protect stored cardholder data
Encrypt transmission of cardholder data across open, public networks

Maintain a Vulnerability Management Program

Use and regularly update anti-virus software on all systems commonly affected by malware
Develop and maintain secure systems and applications

Implement Strong Access Control Measures

Restrict access to cardholder data by business need-to-know
Assign a unique ID to each person with computer access
Restrict physical access to cardholder data

Regularly Monitor and Test Networks \

Track and monitor all access to network resources and cardholder data
Regularly test security systems and processes

Maintain an Information Security Policy

Maintain a policy that addresses information security

(those steps are supposed to be numbered sequentially to match the PCI DSS steps, but StackExchange is smarter than I am and ignored the numbers I typed and started at "1" for each heading)


MySQL Access Control? I have read somewhere that it is better to have two different MySQL logins in order to prevent hacking. What I mean is having one MySQL login for read access (SELECT permission) and another login for write access (INSERT, UPDATE, CREATE, and DELETE permission). Is it beneficial to have it setup like this and would it work with something like a PHP script?

Developers make bugs. One (sadly) rather common bug type in Web applications with PHP and SQL is SQL injections. A consequence of such a bug is that hostile outsiders can inject some arbitrary SQL code to be evaluated by the database.

If you have two accounts to access the database and one of them only has read permissions, then any SQL injection bug in requests made by that specific read-only account will only grant read-only access to the attacker.

That's like the inner doors in a submarine. These doors are designed to resist pressure and will be closed in case of emergency. That way, if the hull is pierced, then water will only flood part of the submarine, which will then sink slower, and the chances of survival for the crew will be greatly improved. Using separate read and write accounts for MySQL is the same kind of protection. You'd still prefer not to get hit by a torpedo at all, though; i.e. it is best if you do not allow SQL injections to happen, by using SQL properly (with prepared statements).


Can attackers intercept my credentials on an insecure site if I log in through a 3rd party service? I recently visited a forum using non-secure protocol (HTTP) - Chrome flagged a warning at the top saying I shouldn't enter any passwords or personal information onto the site, as they could be intercepted by attackers.

The forum has an option to authenticate via Google. If I use this authentication method without entering my password, can attackers still intercept it?

They probably can't intercept credentials, but you might have a problem with tokens if you are using insecure pages and they could potentially authenticate in your name in future instances (as the Facebook Hack of last year).


Are payment card PINs safe to send via SMS? I have signed up with a new current account in the UK for day-to-day transactions. The account comes with a payment (debit) card. The banking institution's security handling of PINs for payment cards is something that I think would be interesting for an audience of security professionals, and I wonder if it is not good enough.

Here is the instructions that accompany the card sent via postal mail:

  How to activate your card

  When you receive your digipass [electronic OTP code generator] and digipass PIN, log onto your internet banking
  To retrieve your six digit access code click on 'Account Management' and then the 'Cards' tab
  Using your mobile number you provided in your application, text '{BANKNAME} PINACT' followed by your access code, followed by the last four digits of your card number (e.g. {BANKNAME} PINACT 123456 7890) to {SMS number}
  You'll be sent your debit card PIN via text
  You're ready to use your card (remember to sign the back). The first time you use it you will need to enter your PIN - at an ATM or within a store

I went through the instructions, and received this SMS:

  Your card is active and the PIN for your {bankname} Bank Debit Card ending with XXXX is YYYY. Please delete this message after reading.

I take the view that security is a balance between convenience versus the attractiveness of a target. In this case, the target is a supply of PIN codes for payment cards, for presumably tens of thousands of customers, sent in an unencrypted channel over the public telephony system. I note also there are no encouragements that PINs should be changed when they are received.

Moreover, it seem strange that one obtains a one-time security code from an internet banking site (secure and encrypted) in order to obtain a permanent PIN code via SMS (interceptable). Should that not have been the other way around?

In the UK it is common practice for customers to be told not to reveal their payment card PINs to "anyone, not even the police". And yet this bank has provided PIN codes for all of their customer's payment cards over a plaintext comms channel (and thus, by extension, the police, who have realtime access to all unencrypted comms in the UK).

There are three mitigating reasons the bank may have:

PINs are useless without a physical card, and they are not used for "cardholder not present" transactions
Most card providers support PIN changing at ATMs
Tens or hundreds of thousands of UK customers have been served their PINs in this fashion, and none of them have been defrauded as a result of SMS interception†

However, I am still not certain good practices have been followed here. Am I right in believing this security could be improved, and would my suggestion of using SMS for one-time codes and the (HTTPS) banking web app to show PINs, offer better overall security?

† I don't actually know this, I am just guessing what the bank might claim.

Am I right in believing this security could be improved, and would my suggestion of >using SMS for one-time codes and the (HTTPS) banking web app to show PINs, offer better >overall security?

Yes, I believe you're right on. A better schema would be to send a one-time-code via SMS and to reveal the PIN via HTTPS (or even better, not reveal the PIN at all once it has been set). As well, the bank should recommend that users change their PIN upon receipt.


SSL/TLS - Certificate chain validation result in "Invalid authentication type: DHE_RSA" I have an application that connects to a remote web service deployed on HTTPS.
Our application uses FIPS-140 Level-1 for SSL/TLS connectivity, and is based on JCE providers of RSA (the company).

com.rsa.jsse.JsseProvider.JsseProvider()
RsaJsse version 6.14

com.rsa.jsafe.provider.JsafeJCE.JsafeJCE()
JsafeJCE version 6.11

Recently the web service team made changes on their end to enable DH ciphers.  After that change, the cipher that gets selected for SSL is TLS_DHE_RSA_WITH_AES_256_GCM_SHA384.  However, the certificate chain validation seems to fail with below exception:

java.lang.IllegalArgumentException: Invalid authentication type: DHE_RSA
    at com.rsa.sslj.x.cj.checkClientTrusted(Unknown Source)
    at com.example.MyX509TrustManager.checkServerTrusted(ReloadableX509TrustManager.java:65)
    at com.rsa.sslj.x.aE.a(Unknown Source)
    at com.rsa.sslj.x.bg.a(Unknown Source)
    at com.rsa.sslj.x.bg.a(Unknown Source)
    at com.rsa.sslj.x.bg.a(Unknown Source)
    at com.rsa.sslj.x.aH.a(Unknown Source)
    at com.rsa.sslj.x.aH.a(Unknown Source)
    at com.rsa.sslj.x.ap.c(Unknown Source)
    at com.rsa.sslj.x.ap.a(Unknown Source)
    at com.rsa.sslj.x.ap.j(Unknown Source)
    at com.rsa.sslj.x.ap.i(Unknown Source)
    at com.rsa.sslj.x.ap.h(Unknown Source)
    at com.rsa.sslj.x.aS.startHandshake(Unknown Source)
    at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:261)
    at org.apache.http.impl.conn.HttpClientConnectionOperator.connect(HttpClientConnectionOperator.java:118)

Can anyone please guide me what is the meaning of "Invalid authentication type: DHE_RSA"?   Prior to DH Cipher enablement in back end webservice, this authentication type used to be "RSA", and we never faced any issue.

I read in the comments of this question that this error can come if algorithm is not FIPS-140 approved.   Can that be the case here?

Please note that method com.example.MyX509TrustManager.checkServerTrusted does not do anything special - it is written to skip certificate chain validation in certain special cases, else it will delegate to java.net.ssl.TrustManager#checkClientTrusted - in this case TrustManager is instance of an RSA class whose name is obfuscated in RSA jars.

UPDATE:

It seems that com.rsa.sslj.x.cj.checkClientTrusted expects the algorithm used in public key should be DHE_RSA,  since the algorithm used in remote web service's certificate chain is RSA - it reports an error saying Invalid authentication type.   Remote web service team had recently added dhparam to their SSL configuration to avoid logjam vulnerability, but they have not done any changes to their certificate.   Not sure why our SSL client has started failing to connect to remote service since then, and is there anything I need to do for our application or remote web services team need to something.  Any inputs in this regard will be highly helpful

Your custom checkServerTrusted should not be forwarding to the standard checkClientTrusted but to the standard checkServerTrusted. The authType for Server is a keyexchange name, but for Client it is an algorithm name -- THESE ARE NOT IN GENERAL THE SAME and in the case you just encountered they are and should be different.

FIPS140 only specifies and restricts algorithms, not higher-level constructs like TLS keyexchanges, ciphersuites, and protocols. DH is approved (by 800-56A) only with some constraints that don't work for TLS, but it is allowed for a case that covers DHE_RSA by the FIPS1402 Implementation Guidance D.8 and is listed as implemented that way in almost your JSAFE version at CMVP #2057. OTOH SP800-52 does restrict TLS for most of the same systems as FIPS140, and r1 in 2014 does not allow DHE_RSA, but #2057 predates 2014. So I'm pretty sure there's no FIPS problem here.


Asymmetric public-key cryptography: can either key be used to encrypt or decrypt? Key exchange describes a public key encrypting plaintext and the private key decrypting, while in digital signatures the reverse is true where the private key is used to encrypt a hash that the companion public key decrypts.

Should I think of asymmetric keys along the lines of one key encrypts and the other decrypts or can either in a pair be used to encrypt or decrypt?

What I’m getting at is, are the public and private key names just logical in that in a key exchange, the public key is shared on an unsecured medium making it “public” yet the private key needs to remain a secret in order to protect the shared key?

I hope this question makes sense and I’ll try to clarify if needed but this the best way I could word it at the moment.

I think you are mixing terms. Untangling them might help your understanding. (In the order you used them):
Key Exchange is one of a number of methods for taking a symmetric key that you have (say an AES key) and exchanging it with another party such that no eavesdroppers can learn it in the process.
Key exchange and encryption are (almost) unrelated concepts. Key exchange is often accomplished by using asymmetric encryption, but there are key exchange methods that have nothing to do with encryption.
Public key / private key encryption and digital signatures: you are correct in that with encryption, you encrypt for the recipient's public key and then they can decrypt with their private key. With signatures you sign with your private key and then anyone can verify with your public key.

Are public keys and private keys interchangeable?
Trying to generalize it like you have done gets messy really fast because there are many asymmetric (or "public key") cryptographic algorithms (paraphrased from wikipedia):

Examples of well-regarded asymmetric key encryption and key exchange techniques for varied purposes include:

Diffie–Hellman key exchange protocol
ElGamal encryption algorithm
Elliptic curve Diffie-Hellman key exchange
Various password-authenticated key agreement techniques
Paillier cryptosystem
RSA encryption algorithm (PKCS#1)
Cramer–Shoup cryptosystem
YAK authenticated key agreement protocol

Examples of asymmetric key algorithms not widely adopted include:

NTRUEncrypt cryptosystem
McEliece cryptosystem

Examples of notable – yet insecure – asymmetric key algorithms include:

Merkle–Hellman knapsack cryptosystem

There is a similar, but different, list of digital signature algorithms (also from wikipedia):

Some digital signature algorithms

RSA-based signature schemes, such as RSA-PSS
DSA and its elliptic curve variant ECDSA
Edwards-curve Digital Signature Algorithm and its Ed25519 variant.
ElGamal signature scheme as the predecessor to DSA, and variants Schnorr signature and Pointcheval–Stern signature algorithm
Rabin signature algorithm
Pairing-based schemes such as BLS
Undeniable signatures

You'll notice that RSA and ElGamal are the only algorithms that appears on both lists, ie the same algorithm can be used for both encryption and signatures. I'm personally not familiar with the math behind ElGamal, but RSA signatures work the way you describe - that a hash of the message which can be decrypted by the public key. However that description does not work in general for all crypto algorithms, for example DSA which is for signatures and does not have an encryption variant.

Summary
To answer your question "Should I think of asymmetric keys along the lines of one key encrypts and the other decrypts or can either in a pair be used to encrypt or decrypt?", the answer is "It depends which algorithm you are talking about."
What you state in your question is (mostly, slightly simplified) true for RSA, but certainly is not true for any other asymmetric encryption or digital signature algorithm. It's better to think of them as four separate cases:

Encryption public key encrypts
Encryption private key decrypts
Signature private key signs
Signature public key verifies

That's the most specific you can get and still have it apply to all encryption and signature schemes because the details of how the math works varies wildly from one algorithm to the next.


How to crack password hashed using SSHA? Is it possible to crack a password hashed using SSHA if I know the salt? How can I do it?

SSHA,  or more commonly known as salted SHA1  can be easily cracked with John the Ripper.


Can I get a virus from connecting to a WiFi network? Let's say I connect to a local WiFi hotspot with a particularly bad security.

I am aware that a hacker may be able to perform the following:

Man-in-the-middle attack
Snoop on an unencrypted network traffic

But my question is: can a hacker distribute a virus to my device via the WiFi network?

And, if so, what can I do to protect myself?

Depends on your OS and a lot of variables but in general yes.

Because the attacker may perform a man in the middle attack on a poorly designed update mechanism (not windows update) and or (again depending on your setup) abuse windows' local features like printer sharing as an attack vector.

As with everything there is no 100% solution but a very good start is using a VPN in order to fully encrypt all in/outgoing traffic and verify its integrity.


Boot Attacks possible on encryption keys used in virtual machines Is it possible for an attacker to restore passwords or encryption keys that one has used in  a virtual machine the same way like restoring keys that have been used in a standard system applying a boot attack?
I guess there should be no difference since the virtual machine is using the same hardware RAM like the guest operating system.

Let's say a virtual machine uses full disk encryption to encrypt its virtual disk.

If I have access to the host on which the virtual machine runs, I can simply dump the portions of RAM in use by that virtual machine and recover the encryption key for the virtual disk. Not to mention anything else that happens to be in RAM.

In this scenario you (1) have to trust the host, and (2) would be better served by having the host do the disk encryption, assuming you control it, which would defeat the above attack (though you still have to worry about the cold boot attack and other compromises of the host).


Hacked Ubuntu server, probably hacked commands (netstat, ps, ...), how to replace them? An Ubuntu server of my company has been hacked to carry out a DoS attack. I found the shellshock bug had not been fixed by my colleagues, and I think it's the problem.
Then, I found an ELF file that sends thousands messages, and the script is auto-generated by something. Even if I try to remove it, it creates newly by itself by using a new name (in /boot, /etc/init.d).
Besides, I see the netstat command doesn't show me all real open ports. Maybe has the command been replaced? How is it possible to re-install it?

You should "nuke it from orbit": wipe and reinstall the OS and applications from clean source media, and then carefully restore the data from backup.


If nmap shows all ports are filtered or closed, what would be the next logical step to take to get more information? If nmap shows all ports are filtered or closed, what would be the next logical step to take?
Does that mean I would need to get physical access to the device? or is there any other ways to get information?
I'm trying to scan my own smartphone and all the ports are closed, and I did the same with my laptop and all the ports were filtered, so, I'm kind of stuck.
On the other hand, all the information I found on the Internet is relying on getting more results with different nmap scans.
Is there any other software, technique or anything to do that's not involving nmap?

Checking for open ports using nmap only does a comparably dumb check if services are directly accessible on the device. In the default setup it will only check a few ports and thus will not find any services running on unusual ports.
But even when checking all ports it will not find services restricted to specific source IP addresses or protected by port-knocking or otherwise magic packets or packet sequences. Access to these services does not require physical access to the machine, but it requires specific knowledge about the kind of protection used and also possible secrets involved - none of this is involved by just a dumb nmap.
And even if no services are accessible on the machine it does not mean that physical access is needed. There might be outgoing connections from the machine where the response from some external server gets processed on the machine. This is done when reading mail on the machine or browsing the web but also when checking for updates or other automatic actions. Injecting an unexpected response might allow an attacker to attack the system from inside. But again, this requires no physical access but knowledge of what the system is actually doing and lots of knowledge about potential vulnerabilities in the installed software, OS, social engineering to make the user install some software etc.
And there is more which does not involve physical access: there might for example be vulnerabilities in the Bluetooth or Wifi stack which can be used to attack the machine.

...  what would be the next logical step to take?

Gain more knowledge about the system you are trying to attack, the installed software and its weaknesses, weaknesses of the end user etc. In a way it is like when you are trying to steal something: checking for open doors (nmap) is only a very simple step and very likely the doors are closed. But there might be weak locks, windows, gullible residents which open the door for you etc.


Open ports on my NetGear router I ran an nmap scan on my home router and I am seeing a ton of open ports. Is this normal? How do I go about closing them?

$ nmap 192.168.1.1
Starting Nmap 7.70 ( https://nmap.org ) at 2019-03-16 20:34 EDT
Nmap scan report for 192.168.1.1
Host is up (0.0030s latency).
Not shown: 989 filtered ports
PORT      STATE SERVICE
53/tcp    open  domain
80/tcp    open  http
548/tcp   open  afp
631/tcp   open  ipp
5000/tcp  open  upnp
8200/tcp  open  trivnet1
9100/tcp  open  jetdirect
9101/tcp  open  jetdirect
9102/tcp  open  jetdirect
9103/tcp  open  jetdirect
20005/tcp open  btx

Nmap done: 1 IP address (1 host up) scanned in 17.04 seconds

The router has (at least) two interfaces. Your nmap 192.168.1.1 scans against the internal interface and lists the services the router is providing for your LAN (DNS, web interface for administration etc.). That's a different set of services than the services it's providing for the wild Internet on the WAN interface. Scan from the Internet should only list the services you have planned to expose; possibly none on a home gateway.

You can log into your router (http://192.168.1.1) and browse the web admin interface to disable all the services you don't need. E.g. if you don't use HP JetDirect, it's a good practice to disable it even if there's no current vulnerabilities involved. On the other hand, Universal Plug and Play (UPnP) can be used to open inbound ports, exposing your LAN devices to the Internet, and can be consider as a threat.

Port by port with a little help from NETGEAR R6400v2 User Manual. (Usually I wouldn't dig this deep for a single product I don't own, but the arrogant attitude on the NETGEAR Community made me.)

53/tcp (domain). There's no option to turn DNS service of, and it is required as the DHCP server on the router always introduces itself as the resolver.
80/tcp (http). Used for network administration and can't be closed.

Also used for file sharing from USB drive and enabled by default; I'd recommend disabling it (from ADVANCED > USB Functions > ReadySHARE Storage).

548/tcp (afp). Apple Filing Protocol is related to file sharing; disabling ReadySHARE might affect.
631/tcp (ipp). Mac OS X Printer Sharing. (Same explanation as for 9100-9103/tcp.)
5000/tcp (upnp). Like explained, this should be disabled (ADVANCED > Advanced Setup > UPnP).
8200/tcp (trivnet1). This isn't Trivnet. It's MiniDLNA Media Derver (Chapter 8, p. 94).
9100-9103/tcp (jetdirect). NetGear calls this ReadySHARE Printer Utility (Chapter 9). It's controlled with an external utility. Not sure if could be disabled.


server certificate expired handshake failed? is it possible that the TLS handshake will fail if the server presents a certificate that is expired ? I can see CLient Hello, and next Server Hello + Certificate from Server and next the receiver  is sending a FIN packet to close abrupt the connection. May it be because the certificate expired few months back ?

thanks

Absolutely.  An expired certificate is not a valid one.  A certificate should only be accepted if :

it is signed by a valid authority - ie, there is a valid certificate chain back to a trusted root certificate authority
it is for the subject that is being connected to - ie, hostname of the machine being connected to matches the subject name in the certificate (or subject alternative name)
it is within date
it has not been revoked (either by being included on the client's revocation list or through an online certificate status check from the certificate authority)

Get a valid cert.


Necessary to wipe Encrypted LVM LUKS Is it necessary to wipe (using shred or similar) the drive or partition again even though it was already encrypted? Threat model for securing the drive is for potentially physically losing the drive and files getting stolen.

Modern encryption schemes are trying to achieve ciphertext indistinguishability (AES and others). It means that you cannot distinguish a ciphertext from a random sequence of bytes (no more than with probability of 50%).

This said, if your disk was encrypted, and if you consider that your opponents cannot break the cipher algorithm that you were using (at least not before the data in your disk will becomes obsolete), you can leave your disk as it is.

But, you definitely need to erase (and shred), all the key information (key slots) from any places where it might have been stored (because a physical access may lead to the recovery of it if a flaw is discovered).

Whatever, my personal advice is:

  Shredding does not take so much work (start it on a Friday afternoon and get your disks back on Monday morning clean and ready to be used). Just do not try optimize security, it is just wrong.


Is ESP without AH considered noncompliant with FIPS 140-2? I have a CentOS 7.4 box running kernel 3.10 that has the fips=1 parameter defined in the kernel grub statement.  If I attempt to add an IPSEC SA with the following command it fails:

  ip xfrm state add src 0.0.0.0 dst 192.168.121.138 proto esp spi 0x201
  enc des3_ede 0x8a718c734f68865738a3d9780e49cc2f52c40ef9fa368acc mode
  transport

  RTNETLINK answers: No such file or directory

If I remove the fips=1 parameter from the kernel statement it succeeds.  Does anyone know why?

Alternatively, if I leave the fips=1 parameter in the kernel grub statement but include an AH key (even if it's an empty string) then it succeeds.

  ip xfrm state add src 0.0.0.0 dst 192.168.121.138 proto esp spi 0x201
  auth sha1 "" enc des3_ede
  0x8a718c734f68865738a3d9780e49cc2f52c40ef9fa368acc mode transport

You seem to have some misconceptions about IPsec. Using integrity protection for ESP has nothing to do with AH. So that's not an AH key you are specifying with auth sha1 "", but an integrity protection/authentication key and algorithm for ESP (with "" you just get an all zero key).

Using ESP encryption without integrity protection is generally not recommended (for instance, directly in the introduction of RFC 4303 that specifies ESP) and the kernel prevents you from doing that in FIPS mode. If you check crypto/testmgr.c in the kernel sources (4.14.15 linked here) you'll see that there is no definition for authenc(digest_null,cbc(des3_ede)), which is what your SA uses, with fips_allowed = 1 (actually, there is no authenc definition with digest_null at all).

Combining ESP with AH is possible and requires defining separate ESP and AH SAs and then IPsec policies that combine them. So on Linux in FIPS mode that's apparently only supported if ESP is still used with integrity protection. By setting the ICV truncation for ESP to 0 you could probably avoid the additional overhead on the network but the computational overhead of having two integrity protection services would remain (the use of a combined mode algorithm like AES-GCM for ESP might improve that a bit).

Anyway, combining ESP and AH is not that common and not recommended, instead using ESP with a combined mode algorithm like AES-GCM or ChaCha20/Poly1305 (not yet FIPS certified) is the general recommendation due to their efficiency, see RFC 8221.


ids - How do I match any string in a list of snort contents? If I do something like

alert tcp any any <> any any (content:"TestA"; content:"TestB"; sid:1000000; msg:"Syntax correct!";)

then the syntax is correct, but, what I would like to do is to match either "TestA" or "TestB". So if I get "TestA" from somewhere to my local IP I am alerted and if I respond with "TestB" I am also alerted. This config only activates when both are present.

Is there a way to do this in the same line or do I have to just define new rules? Optimally it would be something like

alert tcp any any <> any any (content:["TestA","TestB"]; something-else-to-do-or-over-the-list; sid:1000000; msg:"..";)

But do not find anything in the manual that can do that, the closest is a content-list but have not gotten that to work as I want either.

Pcre also seems like it could be an alternative, but it want me to insert some text into content before I can use regex. Is there even an OR operation in snort?

It is correct that it is possible to use pcre. In this example it would look like this

alert tcp any any <> any any (pcre:"/TestA|TestB/"; sid:1000000; msg:"Syntax correct!";)

As of now I do not know any other way of doing it


Is filling up the empty space in a disk with any data enough measure against file recovery If I have an important data in a disk (flash, SSD or HDD) and I deleted them, I know it is easy to recover these deleted data (even by using free software like recuva. Now if I fill this disk with any data, let's say a large movie file or so until the disk has no more empty space then deleting these dummy files again, will this be enough measure to stop people from recovering the deleted files? isn't that a rewrite?

This is enough, or not, depending on the disk technology, the budget of the attacker, and some other details.

When you fill a disk with zeros, you force the filesystem to reuse free blocks, and rewrite them. So, as first order approximation, this looks good for you: your file contents are overwritten. However, there are details:

On some operating systems and filesystem, filling the disk completely is a reserved privilege. Typically, on Unix-like OS, the last 5% of the disk are reserved for the root user. So do the filling as root.
Some filesystems do tail-merging: a file uses blocks of a given size (say, 4096 bytes), but the last block of a file is often not completely filled. Most filesystems just keep that unused space, but some strive to optimize the space allocation and will regroup the "tails" from several files into a single block. The consequence, here, is that "filling up" the disk with a big file full of zeros may fail to reclaim all free "tail space" (because a big file full of zeros is still one file, with a single tail). The final bytes of your file may thus avoid overwriting.
There is a neverending debate about whether old data may be recovered from an hard disk even after being overwritten. The short answer is: "probably not for a modern magnetic hard disk, plausibly yes (partially) for SSD". See this question and also that one. But such recovery will entail some non-trivial costs (opening the disk in a clean room, hooking extra circuitry...) so rational attackers will do it only if the data is worth it.

If the confidentiality of the data you want to wipe out is valuable, then the cautious course of action is to physically destroy the storage device (shredding, melting, degaussing,... there are several possibilities, with various degrees of efficiency, price and fun). If your data secrecy is not worth the 100$ for a new disk, then you can probably do a simple fill-up of the disk with dummy files: low-value data implies cheap, unmotivated attackers.

Next time use disk encryption. If data never makes it unencrypted to the disk, then wiping the data out is as simple as forgetting the key. This abstracts away physical details of the disk.


How to become a great cybersecurity professional? I am scheduled to graduate college with a BS in cybersecurity in October. However, whenever I look up different cybersecurity topics and such I find that there are many many topics that I have no exposure to. I understand that there is a lot to cybersecurity and I am trying to be the best of the best. So my question is, what can I do further enhance myself and become a great cybersecurity professional?

I would suggest taking up entry-level or actually intermediate infosec certifications, as you do already have a degree in Cyber Security hence intermediate would seem like a good fit.

  I find that there are many many topics that I have no exposure to

As I can tell from your post that you are seeking more on knowledge than the prestige that the certifications might bring.

CompTIA Security+
Certified Ethical Hacker (CEH)
GIAC Security Essentials (GSEC)

These certifications might give you the initial foothold & exposure you need.

  I am not quite sure which one I should go for as so many jobs list so many different certs as qualifications

Do not take up certs for the purpose of getting specific jobs that lists them as requirements. The certifications I mentioned above are general-purpose certs that cover a wide range of topics and it is should not be taken as a specialization of a certain skill/topic in this field.

Gain interest in the certs you want to pursue, obtain them, then start looking for jobs that list them as prerequisites. But for now, worry about obtaining that broad skill set that you said you were originally lacking.


Luhn algorithm applied to file access I am in the following setup: given department ids, employee ids and file ids I want to check whether employee xy of department AB is allowed to access file f.

E.g. department id = "012", employee id = "123" and file id "012"

Then the application of Luhn's algorithm to "012123012" or some variation of the algorithm
should deny or grant access. I am faced by this problem because the man who set up the algorithm has left.

Is there any well-known application or variation of Luhn's algorithm to this kind of problem?

The Luhn algorithm is a very poor choice for this application.  You are looking to apply an easily reversible algorithm for a security purpose.

The Luhn algorithm does one thing:  check digits.  The only purpose it should be applied to is for a small amount of input checking, specifically checking for typos such as missing digits or swapped digits.  It also works for barcode validation, such as checking UPCs or Code 3 of 9s to ensure the barcode reader properly read all the stripes.  But those are the limits of what it should be entrusted with.

For example, in your case I could iterate from "01212301-0" through "01212301-9" until one of them granted me access.  I only have to try ten times at most.  I can easily do this by hand.  The Luhn algorithm can not protect your system.

For use in a security application, it would likely call for a scheme using a cryptographically secure hash, such as SHA-2.  Of course, that kind of change entails a huge change to your system - a Luhn algorithm outputs a value from 0-9, whereas a cryptographic hash produces a digest of 40 hexadecimal digits.  But all of that is probably not relevant, because you would be better off having a system designed to perform access control handling that responsibility.  A system like Active Directory or LDAP is designed exactly to enable this kind of functionality in a secure fashion, and solves the insecurities of your home-grown solution.


How to detect ELSA installation on Windows? ELSA is a CIA tool used to track down location of any Windows and of its current user through Wi-Fi environment tracking.
This tracking is operating, whatever the Windows GUI says about the Wi-Fi connection state:

https://wikileaks.org/vault7/#Elsa

http://securityaffairs.co/wordpress/60511/malware/cia-elsa-malware.html

In short I would name such a tool a locationlogger.

How is it possible to detect that ELSA is installed on a Windows?

Interesting to note:

  (S) Elsa currently makes no provisions for automatically beaconing or
  exfiltrating collected data off of the target machine. Therefore the
  operator must extract the Elsa log file from the target machine
  through other means.

Otherwise, the same way you would check anything else:

Compare known checksums of the variants of the malware against all files on the hard drive. CIA could potentially use some kind of crypter or other obfuscation of this malware - but they also may not have since the population of targets was probably very low.
Use Autoruns from Microsoft's TechNet site on another computer to examine an offline image/disk of a suspected infected system. ELSA does not appear to be very advanced, so its persistence across reboots relies on very visible techniques like startup tasks/boot time loading of modules.

a. Use known good checksums/digital signatures while examining any items launching alongside the OS.

b. Validate that only programs and drivers from known publishers, whose digital signatures are intact, are loading. If an unsigned file is loaded by a signed file, this is a big and often non-obvious attack surface. Compare the unsigned file against the version published by the manufacturer.
Monitor network traffic of a system for connections to Google's Location Services while no other applications are generating traffic. Since ELSA uses these 3rd party geolocation APIs to generate its logging, it will likely connect to these services at certain intervals. You can probably fully disable the use of these services in your browsers' settings and use the browser normally while watching for these connections, in case ELSA tries to only obtain this information while there is some sort of other traffic being generated by the host.