Is there any irule or configuration on F5 for blocking ultrasurf? I try to use ip intelegence irule on LTM,it did not work because the destination ip address is not registered as bad reputation ip address. I have checked the ip using iprep_lookup or on brigcloud webroot web.
I have also write irule to block on traffic client ssl hello traffic, but i dont know why ultrasurf is still work. Below is the irule
when CLIENT_ACCEPTED {
if { [class match [IP::local_addr] equals block_ip_ultrasurf ] } {
Hi Nitass,the irule is only block the client ssl hello that have signature 804c010300003300000010 (in hex) , not all ssl, because on my testing the ultrasurf have that signature on the client ssl hello.
Hi Petruk, was thinking if LTM is placed as proxy before traffic outgoing, will the clientssl be used? kind of changing the game into reverse proxy instead. Nonetheless I heard there is forward ssl proxy coming up that may be more applicable. As long as we can terminate the ssl I believe blocking should be trivial.
the irule is only block the client ssl hello that have signature 804c010300003300000010 (in hex) , not all ssl, because on my testing the ultrasurf have that signature on the client ssl hello.have you seen the log (in CLIENT_DATA) in ltm log file?
The client ssl hello for that pattern is blocked by this irule, there is no server ssl hello. But i dont know why i still see encrypted traffic.have you tried “reset” instead of “drop”?
----> we found error on the ltm log file:
Oct 11 18:13:44 tmm err tmm[7531]: 01220001:3: TCL error: /Common/ultrasurf1 - can’t read “payload_hex”: no such variable while executing “class match $payload_hex equals signature_clientsslhello”
Oct 11 18:13:44 tmm err tmm[7531]: 01220001:3: TCL error: /Common/ultrasurf1 - can’t read “payload_hex”: no such variable while executing “class match $payload_hex equals signature_clientsslhello”
Oct 11 18:13:44 tmm err tmm[7531]: 01220001:3: TCL error: /Common/ultrasurf1 - can’t read “payload_hex”: no such variable while executing "class match $payload_hex equals signature_clientsslhello"you may check if binary scan return 1 before referring to payload_hex variable.
e.g.
if {[binary scan [TCP::payload 11] H22 payload_hex] == 1} {
if {[class match $payload_hex equals signature_clientsslhello]} {
log local0. "payload_hex = $payload_hex"
drop
}
}
You might try adding some debug logging of [TCP::payload 11] as that should return 11 bytes of the collected payload. I don’t see how binary scan wouldn’t return a value for payload_hex if [TCP::payload 11] returns 11 bytes.
Anyhow, can you try logging this:
[binary scan [TCP::payload 11] H* payload_hex]
If that returns more than 22 characters, you might try replacing the H22 with H* and use
if {[class match $payload_hex contains signature_clientsslhello]} {
Also, I’m not sure if you want to continuously collect the payloads. Can you collect enough bytes just once in the initial connection to find the bad byte pattern?
when CLIENT_ACCEPTED {
if { [class match [IP::local_addr] equals block_ip_ultrasurf ] } {
log local0. "block ip = [IP::local_addr]"
drop
} elseif {[TCP::local_port] == 443} {
TCP::collect 100
}
}
when CLIENT_DATA {
binary scan [TCP::payload] H* payload_hex
log local0. "payload_hex ([string length $payload_hex] chars) = $payload_hex"
if {[class match $payload_hex contains signature_clientsslhello]} {
drop
}
TCP::release
}
Thanks Nitass and Hoolio, the error log is not appeared again. But we still cannot block ultrasurf , eventhough the client ssl hello is droped or rejected.
Ultrasurf is still able to send the ssl encrypted traffic, . I test this with version ultrasurf 10.0.1
we checked on the pcap file there is no ssl server hello send from ultrasurf server to client, Is it possible to create ssl encrypted traffic without client ssl hello or server ssl hello?
if the port is no longer 443, which is quite unlikely but I have small suspicion on StartTLS else it is not doing standard SSL if there is no Hello as expected. Cant we assume them to negotiate SSL with F5 instead to break their direct SSL with the proxy server (option in Ultrasurf config?). Else block them in their DNS request to known Ultrasurf DNS server … Remove the Ultrasurf cache files in user temp directories, if there is automated way to always do discovery req that can be blocked
Some past info, not usre for now on v10, in Ultrasurf versions 6.6 and 6.7, the connection travelled to port 443 but was not SSL. Beginning with version 8.8, Ultrasurf began to use what appears to be an anonymous SSL connection, where the server side does not respond with a certificate.
[IP::local_addr] called in a clientside event like CLIENT_ACCEPTED will return the client’s destination IP address (the VS IP for a host VS). As BT says, you’d want to use [IP::client_addr] or [IP::local_addr] which both return the client IP in CLIENT_ACCEPTED.
We previously try to block the ultrasurf , by destination ip address[IP::local_addr] using ip intelegence . The VS use wildcard 0.0.0.0:443.
We log the[IP::local_addr] on eventwhen CLIENT_ACCEPTED , but when we check the log and check the ip addrss with ipreplookup and also from brightcloud, it’s is not detected as malicious ip.That’s why i cannot use the ip intelegence to block ultrasurf.
[IP::remote_addr] will fit your case as this is the actual address to be submitted for IP intel checks as well in the quarantine IP blacklist maintained in session. local_addr either give you the VS ip or the SNAT src (if enabled) in client and server respectively. I know previously the IP intel did block the Ultrasurf hence why I am asking why not for your case … unless Ultrasurf has changed in v10 or later. Will you be able to share that Ultrasurf Dest IP you used for checking?