Beispiel #1
0
    protected void GSBTestLink_Click(object sender, EventArgs e)
    {
        GSBTestOutputLabel.Text = string.Empty;

        //  The api is not that good right now. Will wait for the next version.

        string url = GSBTestInputTB.Text.Trim();
        if (!string.IsNullOrEmpty(url))
        {

            try
            {
                Subkismet.Services.GoogleSafeBrowsing.GoogleSafeBrowsing gsb = new Subkismet.Services.GoogleSafeBrowsing.GoogleSafeBrowsing();

                Subkismet.Services.GoogleSafeBrowsing.CheckResultType resultType = gsb.CheckLink(url);

                GSBTestOutputLabel.Text = "Output: "
                    + "Is this link valid: " + resultType.ToString()
                    + gui.LineBreak;

            }
            catch (Exception ex)
            {
                GSBTestOutputLabel.Text = "Exception while Testing the Safe Browsing Lists"
                    + gui.LineBreak + gui.LineBreak
                    + "Message: " + ex.Message
                    + gui.LineBreak + gui.LineBreak
                    + "Stack Trace: " + ex.StackTrace;
            }
        }
        else
        {
            GSBTestOutputLabel.Text = "Please Enter a valid URL."
                   + gui.LineBreak;

        }
    }
Beispiel #2
0
 public SpamDetection()
 {
     gsb = new Subkismet.Services.GoogleSafeBrowsing.GoogleSafeBrowsing();
 }
Beispiel #3
0
    protected void GSBUpdateLink_Click(object sender, EventArgs e)
    {
        GSBUpdateOutputLabel.Text = string.Empty;

        //  The api is not that good right now. Will wait for the next version.

        try
        {
            Subkismet.Services.GoogleSafeBrowsing.GoogleSafeBrowsing gsb = new Subkismet.Services.GoogleSafeBrowsing.GoogleSafeBrowsing();

            // Update phishing black list
            bool phishingBool = gsb.UpdateList(Subkismet.Services.GoogleSafeBrowsing.BlackListType.Phishing);

            // Update malware black list
            bool malwareBool = gsb.UpdateList(Subkismet.Services.GoogleSafeBrowsing.BlackListType.Malware);

            GSBUpdateOutputLabel.Text = "Updated the Safe Browsing Lists"
                + gui.LineBreak + "Phishing: " + phishingBool.ToString()
                + gui.LineBreak + "Malware: " + malwareBool.ToString()
                + gui.LineBreak;

        }
        catch (Exception ex)
        {
            GSBUpdateOutputLabel.Text = "Exception while Updating the Safe Browsing Lists"
                + gui.LineBreak + gui.LineBreak
                + "Message: " + ex.Message
                + gui.LineBreak + gui.LineBreak
                + "Stack Trace: " + ex.StackTrace;
        }
    }