complete url verifications
This commit is contained in:
@@ -23,10 +23,10 @@ public class CommonConstants {
|
|||||||
public static final String CLASSIFY_UNSAFE = "UNSAFE";
|
public static final String CLASSIFY_UNSAFE = "UNSAFE";
|
||||||
public static final String CLASSIFY_UNKNOWN = "UNKNOWN";
|
public static final String CLASSIFY_UNKNOWN = "UNKNOWN";
|
||||||
|
|
||||||
public static final String CAT_BENIGN = "benign";
|
public static final String CAT_BENIGN = "Benign";
|
||||||
public static final String CAT_DEFACEMENT = "defacement";
|
public static final String CAT_DEFACEMENT = "Defacement";
|
||||||
public static final String CAT_MALWARE = "malware";
|
public static final String CAT_MALWARE = "Malware";
|
||||||
public static final String CAT_PHISHING = "phishing";
|
public static final String CAT_PHISHING = "Phishing";
|
||||||
|
|
||||||
public static final Integer GMAIL_ACTIVE = 1;
|
public static final Integer GMAIL_ACTIVE = 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,9 @@ import java.util.UUID;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class URLEntity {
|
public class URLEntity {
|
||||||
|
@Column(name="classifications")
|
||||||
|
private String classifications;
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
@GeneratedValue(generator = "UUID")
|
@GeneratedValue(generator = "UUID")
|
||||||
|
|||||||
@@ -432,11 +432,19 @@ public class URLVerificationService {
|
|||||||
String category = predictionService.predict(urlModel);
|
String category = predictionService.predict(urlModel);
|
||||||
|
|
||||||
//update in category in url table
|
//update in category in url table
|
||||||
|
urlModel.getDetails().setClassifications(category);
|
||||||
|
|
||||||
// return classification results
|
// return classification results
|
||||||
if (category.equals(CAT_BENIGN)) {
|
if (category.equals(CAT_BENIGN)) {
|
||||||
if (!urlModel.getDetails().getTrackingDescriptions().isEmpty()) {
|
if (!urlModel.getDetails().getTrackingDescriptions().isEmpty() || // contains tracking
|
||||||
|
urlModel.getData().getInfo().getPrefix().equalsIgnoreCase("http://") || // uses http
|
||||||
|
urlModel.getDetails().getSslStripping().contains(true) || // has SSL stripping
|
||||||
|
urlModel.getDetails().getHasExecutable().equalsIgnoreCase("yes") || // contains executable
|
||||||
|
!urlModel.getDetails().getJavascriptCheck().isEmpty() || // contains javascript
|
||||||
|
!urlModel.getDetails().getHasIpAddress().isEmpty() || // contains IP address
|
||||||
|
urlModel.getDetails().getHostnameEmbedding() != null // contains hostname embedding
|
||||||
|
|
||||||
|
) {
|
||||||
return CLASSIFY_WARNING;
|
return CLASSIFY_WARNING;
|
||||||
}
|
}
|
||||||
return CLASSIFY_SAFE;
|
return CLASSIFY_SAFE;
|
||||||
|
|||||||
Reference in New Issue
Block a user