├── LICENSE ├── README.txt ├── pom.xml ├── src ├── assemble │ └── distribution.xml ├── main │ ├── java │ │ └── com │ │ │ └── sensepost │ │ │ └── yeti │ │ │ ├── FrmMain.form │ │ │ ├── FrmMain.java │ │ │ ├── YetiApp.java │ │ │ ├── YetiUtils.java │ │ │ ├── common │ │ │ ├── ConfigProperties.java │ │ │ ├── ConfigSettings.java │ │ │ ├── EqualityUtil.java │ │ │ ├── FormatUtil.java │ │ │ ├── Globals.java │ │ │ ├── JIPCalc.java │ │ │ ├── Log.java │ │ │ ├── NetworkTools.java │ │ │ ├── UtilFunctions.java │ │ │ └── update │ │ │ │ └── TldMappingUpdater.java │ │ │ ├── controllers │ │ │ ├── BaseController.java │ │ │ ├── CertController.java │ │ │ ├── CollectorController.java │ │ │ ├── ControllerIFace.java │ │ │ ├── ForwardLookupController.java │ │ │ ├── ReverseLookupController.java │ │ │ ├── RunningJob.java │ │ │ ├── TldController.java │ │ │ ├── WorkflowController.java │ │ │ └── YileController.java │ │ │ ├── controls │ │ │ └── JLinkButton.java │ │ │ ├── dns │ │ │ └── DNS.java │ │ │ ├── gui │ │ │ ├── BaseDlg.java │ │ │ ├── Bundle.properties │ │ │ ├── CertDisplayResults.form │ │ │ ├── CertDisplayResults.java │ │ │ ├── CertInit.form │ │ │ ├── CertInit.java │ │ │ ├── CollectorDisplayResults.form │ │ │ ├── CollectorDisplayResults.java │ │ │ ├── CollectorInit.form │ │ │ ├── CollectorInit.java │ │ │ ├── ConfigManager.form │ │ │ ├── ConfigManager.java │ │ │ ├── DebugDisplay.form │ │ │ ├── DebugDisplay.java │ │ │ ├── DisplayResultIFace.java │ │ │ ├── DoWhois.form │ │ │ ├── DoWhois.java │ │ │ ├── DomainResults.form │ │ │ ├── DomainResults.java │ │ │ ├── ForwardLookupDisplayResults.form │ │ │ ├── ForwardLookupDisplayResults.java │ │ │ ├── ForwardLookupInit.form │ │ │ ├── ForwardLookupInit.java │ │ │ ├── HostResults.form │ │ │ ├── HostResults.java │ │ │ ├── IpResults.form │ │ │ ├── IpResults.java │ │ │ ├── NetworkDisplay.form │ │ │ ├── NetworkDisplay.java │ │ │ ├── NetworkMapview.form │ │ │ ├── NetworkMapview.java │ │ │ ├── ReverseLookupDisplayResults.form │ │ │ ├── ReverseLookupDisplayResults.java │ │ │ ├── ReverseLookupInit.form │ │ │ ├── ReverseLookupInit.java │ │ │ ├── ScriptOutput.form │ │ │ ├── ScriptOutput.java │ │ │ ├── SelectFootprint.form │ │ │ ├── SelectFootprint.java │ │ │ ├── StartFootprintInit.form │ │ │ ├── StartFootprintInit.java │ │ │ ├── TLDInit.form │ │ │ ├── TLDInit.java │ │ │ ├── TldDisplayResults.form │ │ │ ├── TldDisplayResults.java │ │ │ ├── YileDisplayResults.form │ │ │ ├── YileDisplayResults.java │ │ │ ├── YileInit.form │ │ │ ├── YileInit.java │ │ │ └── resources │ │ │ │ ├── ConfigDisplay.properties │ │ │ │ ├── DoWhois.properties │ │ │ │ ├── DomainResults.properties │ │ │ │ ├── HostResults.properties │ │ │ │ ├── NetBlockEditor.properties │ │ │ │ ├── ReportExportSetup.properties │ │ │ │ ├── ResultBase.properties │ │ │ │ ├── TldInit.properties │ │ │ │ ├── YileDisplayResults.properties │ │ │ │ ├── bingDisplayResult.properties │ │ │ │ ├── bingIPInit.properties │ │ │ │ ├── bingSiteInit.properties │ │ │ │ ├── certDisplayResults.properties │ │ │ │ ├── certInit.properties │ │ │ │ ├── debugDisplay.properties │ │ │ │ ├── forwardLookupDisplayResults.properties │ │ │ │ ├── forwardLookupInit.properties │ │ │ │ ├── ipResults.properties │ │ │ │ ├── jobProgressPanel.properties │ │ │ │ ├── networkDisplay.properties │ │ │ │ ├── networkMapview.properties │ │ │ │ ├── portScanResultDisplay.properties │ │ │ │ ├── reverseLookupDisplayResults.properties │ │ │ │ ├── reverseLookupInit.properties │ │ │ │ ├── scriptOutput.properties │ │ │ │ ├── selectFootprint.properties │ │ │ │ ├── startFootprintInit.properties │ │ │ │ ├── tldDisplayResults.properties │ │ │ │ ├── yileDisplayResults2.properties │ │ │ │ └── yileInit.properties │ │ │ ├── helpers │ │ │ ├── CertHelper.java │ │ │ ├── ForwardLookupHelper.java │ │ │ └── TldExpandHelper.java │ │ │ ├── models │ │ │ ├── BaseModel.java │ │ │ ├── CertModel.java │ │ │ ├── CollectorModel.java │ │ │ ├── DataModelIFace.java │ │ │ ├── DomainModel.java │ │ │ ├── FootprintModel.java │ │ │ ├── ForwardLookupModel.java │ │ │ ├── HostModel.java │ │ │ ├── IpModel.java │ │ │ ├── JobModel.java │ │ │ ├── ReverseLookupModel.java │ │ │ ├── TldModel.java │ │ │ └── YileModel.java │ │ │ ├── persistence │ │ │ ├── DataStore.java │ │ │ ├── HibernateUtil.java │ │ │ ├── SQLiteDialect.java │ │ │ ├── dao │ │ │ │ ├── DatabaseEntityDao.java │ │ │ │ ├── DomainAttributeDao.java │ │ │ │ ├── DomainDao.java │ │ │ │ ├── FootprintDao.java │ │ │ │ ├── HibernateDaoFactory.java │ │ │ │ ├── HostAttributeDao.java │ │ │ │ ├── HostDao.java │ │ │ │ ├── InitialDataDao.java │ │ │ │ ├── IpAddressDao.java │ │ │ │ ├── PortDao.java │ │ │ │ └── config │ │ │ │ │ ├── ServerOptionDao.java │ │ │ │ │ └── WhoisServerDao.java │ │ │ └── entities │ │ │ │ ├── DatabaseEntity.java │ │ │ │ ├── Domain.java │ │ │ │ ├── DomainAttribute.java │ │ │ │ ├── Footprint.java │ │ │ │ ├── Host.java │ │ │ │ ├── HostAttribute.java │ │ │ │ ├── InitialData.java │ │ │ │ ├── IpAddress.java │ │ │ │ ├── Port.java │ │ │ │ └── config │ │ │ │ ├── ConfigurationProperty.java │ │ │ │ ├── ServerOption.java │ │ │ │ └── WhoisServer.java │ │ │ ├── plugins │ │ │ ├── AttributePluginManager.java │ │ │ ├── BasePluginManager.java │ │ │ ├── CollectorPluginManager.java │ │ │ ├── DataAPI.java │ │ │ ├── ExportPluginManager.java │ │ │ ├── ImportPluginManager.java │ │ │ ├── ReportPluginManager.java │ │ │ ├── ScannerPluginManager.java │ │ │ └── UtilAPI.java │ │ │ ├── reports │ │ │ └── ResultExport.java │ │ │ ├── resources │ │ │ ├── Cancel.png │ │ │ ├── YetiAboutBox.properties │ │ │ ├── YetiApp.properties │ │ │ ├── YetiView.properties │ │ │ ├── about.png │ │ │ ├── attr.png │ │ │ ├── attr_config.png │ │ │ ├── brick_link.png │ │ │ ├── bullet_blue.png │ │ │ ├── busyicons │ │ │ │ ├── busy-icon0.png │ │ │ │ ├── busy-icon1.png │ │ │ │ ├── busy-icon10.png │ │ │ │ ├── busy-icon11.png │ │ │ │ ├── busy-icon12.png │ │ │ │ ├── busy-icon13.png │ │ │ │ ├── busy-icon14.png │ │ │ │ ├── busy-icon2.png │ │ │ │ ├── busy-icon3.png │ │ │ │ ├── busy-icon4.png │ │ │ │ ├── busy-icon5.png │ │ │ │ ├── busy-icon6.png │ │ │ │ ├── busy-icon7.png │ │ │ │ ├── busy-icon8.png │ │ │ │ ├── busy-icon9.png │ │ │ │ └── idle-icon.png │ │ │ ├── computer.png │ │ │ ├── computer_link.png │ │ │ ├── connect.png │ │ │ ├── flag_blue.png │ │ │ ├── flag_green.png │ │ │ ├── flag_red.png │ │ │ ├── magnifier.png │ │ │ ├── network.png │ │ │ ├── screenshot.png │ │ │ ├── server.png │ │ │ ├── server_compressed.png │ │ │ ├── server_link.png │ │ │ ├── splash.png │ │ │ ├── star.png │ │ │ ├── vuln.png │ │ │ └── yeti7.png │ │ │ ├── results │ │ │ ├── ARecordResult.java │ │ │ ├── CertResult.java │ │ │ ├── CollectorResult.java │ │ │ ├── DomainEntry.java │ │ │ ├── DomainResult.java │ │ │ ├── FootprintData.java │ │ │ ├── ForwardLookupResult.java │ │ │ ├── HostEntry.java │ │ │ ├── IpEntry.java │ │ │ ├── KeyValue.java │ │ │ ├── PTRRecordResult.java │ │ │ ├── Port.java │ │ │ ├── ReverseLookupResult.java │ │ │ ├── SOARecordResult.java │ │ │ └── YileResult.java │ │ │ ├── spider │ │ │ ├── HTMLParse.java │ │ │ ├── Spider.java │ │ │ └── UrlProcessor.java │ │ │ └── treeview │ │ │ ├── Attribute.java │ │ │ ├── AttributeValue.java │ │ │ ├── Domain.java │ │ │ ├── Host.java │ │ │ ├── Hosts.java │ │ │ ├── Ip.java │ │ │ ├── Ips.java │ │ │ ├── Network.java │ │ │ └── Ports.java │ └── resources │ │ ├── bruteforcedata │ │ ├── aaastandard.txt │ │ ├── animals.txt │ │ ├── asterix.txt │ │ ├── botany.txt │ │ ├── ccs.txt │ │ ├── ccswww.txt │ │ ├── colors.txt │ │ ├── discworld.txt │ │ ├── fruit.txt │ │ ├── greek.txt │ │ ├── hosts.txt │ │ ├── lotr.txt │ │ ├── matrix.txt │ │ ├── mix.txt │ │ ├── mythology.txt │ │ ├── names.txt │ │ ├── oxfordwords.txt │ │ └── planets.txt │ │ ├── conf │ │ └── application.properties │ │ ├── db │ │ ├── db.mysql.sql │ │ ├── db.sqlite.sql │ │ ├── default.db.org │ │ ├── hibernate.mysql.properties │ │ └── hibernate.sqlite.properties │ │ ├── geoipdata │ │ ├── GeoIP.dat │ │ └── GeoLiteCity.dat │ │ ├── hibernate-annotation.cfg.xml │ │ ├── scripts │ │ ├── attributePlugins │ │ │ ├── NMap (All Hosts).bsh │ │ │ ├── NMap - All hosts.groovy │ │ │ ├── NMap - HeartBleed (All hosts).groovy │ │ │ ├── NMap - Import XML.groovy │ │ │ └── WhatWeb (All hosts).bsh │ │ ├── collectorPlugins │ │ │ ├── Bing - Search (ip:).bsh │ │ │ └── Bing - Search (site:).bsh │ │ ├── exportPlugins │ │ │ ├── CreateBruteForceFromFootprints.groovy │ │ │ ├── ExportDomainAttributeList.groovy │ │ │ ├── ExportDomainList.groovy │ │ │ ├── ExportHostAttributes.groovy │ │ │ ├── ExportHostList.groovy │ │ │ ├── ExportIPList.groovy │ │ │ └── ExportIPPortList.groovy │ │ └── importPlugins │ │ │ ├── Import Domains (from txt).bsh │ │ │ └── Import Hosts (from txt).bsh │ │ ├── tlddata │ │ ├── tld.txt │ │ ├── tld_full.txt │ │ └── tld_test.txt │ │ └── whois │ │ └── domains.csv └── test │ └── java │ └── com │ └── sensepost │ └── yeti │ └── HibernateAnnotationMain.java └── target └── Yeti-1.0-distribution.zip /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 SensePost 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------- 2 | -- This projected is licensed under the terms of the MIT license. -- 3 | -------------------------------------------------------------------- 4 | 5 | 6 | To use the software: 7 | -------------------- 8 | Download the distribution zip file (target/Yeti-1.0-distribution.zip). 9 | Unzip the (Yeti-X.X-distribution.zip) zip file. 10 | To run Yeti, ensure you have at least Java 7 installed. 11 | Type into the command prompt (in the folder where the zip file was unpacked): 12 | 13 | java -jar Yeti-.jar 14 | 15 | You will be presented with a screen where the configuration of Yeti is done. 16 | 17 | 18 | 19 | To build the source: 20 | ------------------- 21 | 1. download the source 22 | 2. change directory to the source directory. 23 | 4. type the following command: 'mvn clean install' 24 | 2. type the following command: 'mvn assembly:single' 25 | 26 | NOTES: 27 | 1. Maven and Java SDK need to be installed. 28 | -------------------------------------------------------------------------------- /src/assemble/distribution.xml: -------------------------------------------------------------------------------- 1 | 4 | distribution 5 | 6 | zip 7 | 8 | 9 | 10 | ${project.build.directory} 11 | / 12 | 13 | ${artifactId}-${version}-inc.jar 14 | 15 | 16 | 17 | src/main/resources 18 | / 19 | 20 | **/* 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/YetiApp.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti; 2 | 3 | import java.awt.EventQueue; 4 | import javax.swing.UnsupportedLookAndFeelException; 5 | import com.sensepost.yeti.common.ConfigSettings; 6 | import java.io.IOException; 7 | import java.util.logging.Level; 8 | import java.util.logging.Logger; 9 | 10 | public class YetiApp { 11 | 12 | public static void main(String[] args) { 13 | try { 14 | javax.swing.UIManager.setLookAndFeel("com.jgoodies.looks.plastic.PlasticXPLookAndFeel"); 15 | //javax.swing.UIManager.setLookAndFeel("com.jtattoo.plaf.acryl.AcrylLookAndFeel"); 16 | } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) { 17 | java.util.logging.Logger.getLogger(FrmMain.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 18 | } 19 | 20 | EventQueue.invokeLater(new Runnable() { 21 | @Override 22 | public void run() { 23 | try { 24 | ConfigSettings.initConfig(System.getProperty("user.dir")); 25 | } catch (IOException ex) { 26 | Logger.getLogger("FrmMain.FrmMain").log(Level.SEVERE, null, ex); 27 | } 28 | 29 | FrmMain app = new FrmMain(); 30 | app.setSize(1024, 768); 31 | app.setLocationRelativeTo(null); 32 | app.setVisible(true); 33 | app.resetScreens(); 34 | } 35 | }); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/YetiUtils.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti; 2 | 3 | import java.util.ArrayList; 4 | import java.util.HashMap; 5 | import java.util.List; 6 | import java.util.Map; 7 | import java.util.logging.Level; 8 | import java.util.logging.Logger; 9 | 10 | public class YetiUtils { 11 | 12 | private static int[] ipToByte(String ip) { 13 | int[] result = new int[4]; 14 | String[] ipPart = ip.split("\\."); 15 | result[0] = Integer.parseInt(ipPart[0]); 16 | result[1] = Integer.parseInt(ipPart[1]); 17 | result[2] = Integer.parseInt(ipPart[2]); 18 | result[3] = Integer.parseInt(ipPart[3]); 19 | 20 | return result; 21 | } 22 | 23 | public static List genIPList(String startIp, String endIp) { 24 | List result = new ArrayList<>(); 25 | int[] beginIp = ipToByte(startIp); 26 | int[] stopIp = ipToByte(endIp); 27 | //192.168.0.0 192.168.0.255 28 | for (int idxa = beginIp[0]; idxa <= stopIp[0]; idxa++) { 29 | for (int idxb = beginIp[1]; idxb <= stopIp[1]; idxb++) { 30 | for (int idxc = beginIp[2]; idxc <= stopIp[2]; idxc++) { 31 | for (int idxd = beginIp[3]; idxd <= stopIp[3]; idxd++) { 32 | result.add(String.format("%d.%d.%d.%d", idxa, idxb, idxc, idxd)); 33 | } 34 | } 35 | } 36 | 37 | } 38 | 39 | return result; 40 | } 41 | 42 | public static String[] splitToPairs(String Line) { 43 | Line = Line.replace(" + ", ", "); 44 | ArrayList result = new ArrayList<>(); 45 | boolean foundQwote = false; 46 | String pair = ""; 47 | for (int idx = 0; idx < Line.length(); idx++) { 48 | if (Line.charAt(idx) == '"') { 49 | foundQwote = !foundQwote; 50 | } else if (Line.charAt(idx) == ',') { 51 | if (!foundQwote) { 52 | result.add(pair.trim()); 53 | pair = ""; 54 | } else { 55 | pair = pair + Line.charAt(idx); 56 | } 57 | } else { 58 | pair = pair + Line.charAt(idx); 59 | } 60 | } 61 | result.add(pair.trim()); 62 | return result.toArray(new String[result.size()]); 63 | } 64 | 65 | public static Map hastTableFromString(String certLine) { 66 | Map result = new HashMap<>(); 67 | String[] pairs = YetiUtils.splitToPairs(certLine); 68 | for (String str : pairs) { 69 | try { 70 | 71 | String[] keyVal = str.split("="); 72 | keyVal[0] = keyVal[0].trim(); 73 | keyVal[1] = keyVal[1].trim(); 74 | String line = keyVal[1]; 75 | if (result.containsKey(keyVal[0])) { 76 | line = result.get(keyVal[0]) + ", " + line; 77 | } 78 | result.put(keyVal[0], line); 79 | } catch (Exception ex) { 80 | Logger.getLogger("YetiUtils.hastTableFromString").log(Level.WARNING, null, ex); 81 | } 82 | } 83 | return result; 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/common/ConfigProperties.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.common; 2 | 3 | import java.io.IOException; 4 | import java.io.InputStream; 5 | import java.util.Properties; 6 | import java.util.Set; 7 | 8 | /** 9 | * Class written purely to overwrite the default properties that Yeti 10 | * ships with, to have the folder where it is installed in the properties. 11 | * @author Johan Snyman 12 | */ 13 | public class ConfigProperties extends Properties { 14 | 15 | protected static final String INSTALL_FOLDER = ""; 16 | 17 | @Override 18 | public synchronized void load(InputStream inStream) throws IOException { 19 | super.load(inStream); 20 | Set propertyNames = stringPropertyNames(); 21 | for (String propertyName : propertyNames) { 22 | String value = getProperty(propertyName); 23 | if (value.contains(INSTALL_FOLDER)) { 24 | setProperty(propertyName, value.replace(INSTALL_FOLDER, ConfigSettings.getCurrentJarDir())); 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/common/EqualityUtil.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.common; 2 | 3 | import com.sensepost.yeti.persistence.entities.DatabaseEntity; 4 | 5 | /** 6 | * 7 | * @author Johan Snyman 8 | */ 9 | public class EqualityUtil { 10 | 11 | public static boolean equals(Object obj1, Object obj2) { 12 | if (obj1 == null) { 13 | return obj2 == null; 14 | } else { 15 | return obj1.equals(obj2); 16 | } 17 | } 18 | 19 | public static boolean equals(DatabaseEntity obj1, DatabaseEntity obj2) { 20 | if (obj1 == null) { 21 | return obj2 == null; 22 | } else { 23 | return equals(obj1.getId(), obj2.getId()); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/common/FormatUtil.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.common; 2 | 3 | import java.sql.Timestamp; 4 | import java.text.DateFormat; 5 | import java.text.SimpleDateFormat; 6 | import java.util.Date; 7 | 8 | /** 9 | * 10 | * @author Johan Snyman 11 | */ 12 | public class FormatUtil { 13 | 14 | public static String formatTimestamp(Timestamp ts) { 15 | if (ts == null) return null; 16 | DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 17 | Date date = new Date(ts.getTime()); 18 | return format.format(date); 19 | } 20 | 21 | public static String formatDate(Date d) { 22 | if (d == null) return null; 23 | DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 24 | return format.format(d); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/common/Globals.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.common; 2 | 3 | import java.io.FileNotFoundException; 4 | import java.io.IOException; 5 | import java.util.HashSet; 6 | import java.util.Set; 7 | import java.util.logging.Level; 8 | import java.util.logging.Logger; 9 | import com.sensepost.yeti.helpers.TldExpandHelper; 10 | 11 | public class Globals { 12 | 13 | private final static Set tlds = new HashSet<>(); 14 | 15 | private static int currentFootprintID = -1; 16 | private static String currentFootprintName = ""; 17 | 18 | public static int getCurrentFootprintId() { 19 | return Globals.currentFootprintID; 20 | } 21 | 22 | public static String getCurrentFootprintName() { 23 | return Globals.currentFootprintName; 24 | } 25 | 26 | public static void setCurrentFootprintId(int value) { 27 | Globals.currentFootprintID = value; 28 | } 29 | 30 | public static void setCurrentFootprintName(String value) { 31 | Globals.currentFootprintName = value; 32 | } 33 | 34 | public Set getTLDList() { 35 | if (tlds.isEmpty()) { 36 | try { 37 | tlds.addAll(TldExpandHelper.getTldList(ConfigSettings.getTldSourceListLocation())); 38 | } catch (FileNotFoundException ex) { 39 | Logger.getLogger(Globals.class.getName()).log(Level.SEVERE, null, ex); 40 | } catch (IOException ex) { 41 | Logger.getLogger(Globals.class.getName()).log(Level.SEVERE, null, ex); 42 | } 43 | } 44 | return tlds; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/common/Log.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.common; 2 | 3 | import com.sensepost.yeti.gui.DebugDisplay; 4 | 5 | public class Log { 6 | 7 | private static final DebugDisplay debugWindow = new DebugDisplay(); 8 | 9 | public static DebugDisplay getDebugWindow() { 10 | return debugWindow; 11 | } 12 | 13 | public static void debug(String message) { 14 | debugWindow.addDebug(message); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/controllers/ControllerIFace.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.controllers; 2 | 3 | public interface ControllerIFace { 4 | 5 | void pauseJob(); 6 | 7 | void viewJob(); 8 | 9 | boolean startJob(); 10 | 11 | void unPauseJob(); 12 | 13 | void saveData(); 14 | 15 | void setCancelled(boolean value); 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/controllers/RunningJob.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.controllers; 2 | 3 | /** 4 | * 5 | * @author Johan Snyman 6 | */ 7 | public class RunningJob { 8 | 9 | private final BaseController baseController; 10 | private final WorkflowController workflowController; 11 | private final int id; 12 | private String progress = "Running (0%)"; 13 | 14 | public RunningJob(WorkflowController workflowController, BaseController baseController, int jobId) { 15 | this.workflowController = workflowController; 16 | this.baseController = baseController; 17 | id = jobId; 18 | } 19 | 20 | public boolean startJob() { 21 | return baseController.startJob(); 22 | } 23 | 24 | public int getId() { 25 | return id; 26 | } 27 | 28 | public String getType() { 29 | if (baseController.getClass() == TldController.class) { 30 | return "Domain expand"; 31 | } 32 | if (baseController.getClass() == ForwardLookupController.class) { 33 | return "Forward lookup"; 34 | } 35 | if (baseController.getClass() == CertController.class) { 36 | return "Certificate ext."; 37 | } 38 | if (baseController.getClass() == ReverseLookupController.class) { 39 | return "Reverse lookup"; 40 | } 41 | if (baseController.getClass() == YileController.class) { 42 | return "WebSpider scan"; 43 | } 44 | if (baseController.getClass() == CollectorController.class) { 45 | return "CollecterScan"; 46 | } 47 | return "Unknown"; 48 | } 49 | 50 | public String getProgress() { 51 | return progress; 52 | } 53 | 54 | public void setProgress(String value) { 55 | progress = value; 56 | } 57 | 58 | public void viewJob() { 59 | workflowController.getParent().setJobDetail(this.baseController.getDisplayResults()); 60 | } 61 | 62 | public void cancelJob() { 63 | baseController.setCancelled(true); 64 | } 65 | 66 | public void saveJob() { 67 | baseController.saveData(); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/dns/DNS.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.dns; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | import com.sensepost.yeti.common.NetworkTools; 6 | import com.sensepost.yeti.results.ARecordResult; 7 | import com.sensepost.yeti.results.SOARecordResult; 8 | import java.util.logging.Level; 9 | import java.util.logging.Logger; 10 | import org.xbill.DNS.ARecord; 11 | import org.xbill.DNS.CNAMERecord; 12 | import org.xbill.DNS.Lookup; 13 | import org.xbill.DNS.MXRecord; 14 | import org.xbill.DNS.NSRecord; 15 | import org.xbill.DNS.PTRRecord; 16 | import org.xbill.DNS.Record; 17 | import org.xbill.DNS.SOARecord; 18 | import org.xbill.DNS.TXTRecord; 19 | import org.xbill.DNS.TextParseException; 20 | import org.xbill.DNS.Type; 21 | 22 | /** 23 | * 24 | * @author willem 25 | */ 26 | public class DNS { 27 | 28 | public static SOARecordResult getSOARecord(String domainName) { 29 | SOARecordResult newDomain = null; 30 | try { 31 | Record[] recs = new Lookup(domainName, Type.SOA).run(); 32 | if (recs != null) { 33 | domainName = ((SOARecord) recs[0]).getName().canonicalize().toString(true); 34 | newDomain = new SOARecordResult(domainName); 35 | newDomain.setNameServer(((SOARecord) recs[0]).getHost().toString(true)); 36 | newDomain.setAdminName(((SOARecord) recs[0]).getAdmin().toString(true)); 37 | } 38 | } catch (TextParseException tpe) { 39 | Logger.getLogger(DNS.class.getName()).log(Level.SEVERE, null, tpe); 40 | } 41 | return newDomain; 42 | } 43 | 44 | public static NSRecord getNSRecord(String domainName) { 45 | return null; 46 | } 47 | 48 | public static MXRecord getMXRecord(String domainName) { 49 | return null; 50 | } 51 | 52 | public static List getARecord(String hostName) throws TextParseException { 53 | List entries = null; 54 | 55 | Record[] recs = new Lookup(hostName, Type.A).run(); 56 | if (recs != null) { 57 | if (recs.length > 0) { 58 | entries = new ArrayList<>(); 59 | for (Record record : recs) { 60 | ARecordResult foundSubDomain = new ARecordResult(NetworkTools.getDomainFromHost(hostName)); 61 | foundSubDomain.setHostName(hostName); 62 | String ipAddress = ((ARecord) record).getAddress().getHostAddress(); 63 | foundSubDomain.setIpAddress(ipAddress); 64 | foundSubDomain.setLookupType("A"); 65 | entries.add(foundSubDomain); 66 | } 67 | } 68 | } 69 | 70 | return entries; 71 | } 72 | 73 | public static PTRRecord getPTRRecord(String ipAddress) { 74 | return null; 75 | } 76 | 77 | public static CNAMERecord getCNAMERecord(String hostName) { 78 | return null; 79 | } 80 | 81 | public static TXTRecord getTXTRecord(String hostName) { 82 | return null; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/gui/BaseDlg.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.gui; 2 | 3 | import java.awt.event.ActionEvent; 4 | import java.awt.event.ActionListener; 5 | import javax.swing.JDialog; 6 | 7 | /** 8 | * 9 | * @author willemmouton 10 | */ 11 | public abstract class BaseDlg extends JDialog implements ActionListener { 12 | 13 | private static final long serialVersionUID = 1L; 14 | 15 | public boolean cancelled = true; 16 | 17 | public BaseDlg() { 18 | this.setLocationRelativeTo(null); 19 | this.setModalityType(ModalityType.APPLICATION_MODAL); 20 | } 21 | 22 | public void actionPerformed(ActionEvent e) { 23 | throw new UnsupportedOperationException("Not supported yet."); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/gui/Bundle.properties: -------------------------------------------------------------------------------- 1 | TldDisplayResults.miSelectAllNS.text=jMenuItem1 2 | TldDisplayResults.miSelectAllNS.text=Select NameServer 3 | TldDisplayResults.miUnselectAllNS.text=Unselect NameServer 4 | TldDisplayResults.miSelectAllFromNS.text=Select all from NS 5 | TldDisplayResults.miSelectAllFromAdmin.text=Select all from Admin 6 | TldDisplayResults.miUnselectAllFromNS.text=Unselect all from NS 7 | TldDisplayResults.miUnselectAllFromAdmin.text=Unselect all from Admin 8 | NetworkDisplay.btnGroupBy.text=Group by 9 | NetworkDisplay.btnShow.text=Hide 10 | NetworkDisplay.miHideDomainAttr.text=Hide Domain attributes 11 | NetworkDisplay.miHideHostAttr.text=Hide Host attributes 12 | NetworkDisplay.miHidePorts.text=Hide ports 13 | NetworkDisplay.miDomain.text=Group by domain 14 | NetworkDisplay.miIp.text=Group by ip 15 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/gui/DisplayResultIFace.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.gui; 2 | 3 | import javax.swing.table.DefaultTableModel; 4 | 5 | /** 6 | * 7 | * @author willemmouton 8 | */ 9 | public interface DisplayResultIFace { 10 | 11 | DefaultTableModel getModel(); 12 | 13 | void setModel(DefaultTableModel model); 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/gui/resources/ConfigDisplay.properties: -------------------------------------------------------------------------------- 1 | jLabel2.text=jLabel2 2 | txtTldFilename.text= 3 | txtGeoIP.text= 4 | txtBingAPIKey.text= 5 | jPanel7.border.title=Yeti - Configuration 6 | pnlCert.border.title=Cerificate extraction 7 | pnlBing.border.title=Bing/Search engines 8 | pnlWebspider.border.title=WebSpider 9 | pnlDomainExpand.border.title=Domain expansion 10 | pnlForwardLookup.border.title=Forward/Reverse lookups 11 | jLabel18.text=Tld to Whois-server mapping file 12 | btnTldWhoisButton.text=.. 13 | txtWhoIsTldServerFile.text= 14 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/gui/resources/DoWhois.properties: -------------------------------------------------------------------------------- 1 | txtWhoisResult.contentType=text/plain 2 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/gui/resources/DomainResults.properties: -------------------------------------------------------------------------------- 1 | lbStats.text=0 domains 2 | btnRefresh.text=Reload 3 | jPanel1.border.title=Domains found... 4 | jPanel2.border.title=Attributes 5 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/gui/resources/HostResults.properties: -------------------------------------------------------------------------------- 1 | lbStats.text=0 Hosts 2 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/gui/resources/NetBlockEditor.properties: -------------------------------------------------------------------------------- 1 | jPanel1.border.title=IP Ranges 2 | jPanel2.border.title=Block Control 3 | jLabel1.text=Country 4 | lbCountry.text=N/A 5 | jLabel2.text=Block Start 6 | jLabel3.text=Block End 7 | btnAdd.text=Add 8 | btnEdit.text=Edit 9 | btnDelete.text=Delete 10 | jLabel4.text=Auto Block 11 | jButton2.text=Save 12 | btnLoad.text=Load 13 | jPanel3.border.title=Lookup results 14 | txtBlockStart.text= 15 | txtBlockEnd.text= 16 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/gui/resources/ReportExportSetup.properties: -------------------------------------------------------------------------------- 1 | jPanel1.border.title=Export options... 2 | jPanel2.border.title=Text options... 3 | jLabel5.text=Text 4 | txtFilename.text= 5 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/gui/resources/ResultBase.properties: -------------------------------------------------------------------------------- 1 | btnResetFilter.text=Load Filters 2 | btnFilter.text=Filter 3 | jLabel1.text=Filter 4 | cbxCheckAll.text=Check all 5 | jPanel1.border.title=Options 6 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/gui/resources/TldInit.properties: -------------------------------------------------------------------------------- 1 | txtTldFile.text= 2 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/gui/resources/YileDisplayResults.properties: -------------------------------------------------------------------------------- 1 | jPanel1.border.title=Options 2 | cbxCheckAll.text=Select all 3 | btnFilter.text=Filter 4 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/gui/resources/bingDisplayResult.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/gui/resources/bingDisplayResult.properties -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/gui/resources/bingIPInit.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/gui/resources/bingIPInit.properties -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/gui/resources/bingSiteInit.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/gui/resources/bingSiteInit.properties -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/gui/resources/certDisplayResults.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/gui/resources/certDisplayResults.properties -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/gui/resources/certInit.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/gui/resources/certInit.properties -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/gui/resources/debugDisplay.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/gui/resources/debugDisplay.properties -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/gui/resources/forwardLookupDisplayResults.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/gui/resources/forwardLookupDisplayResults.properties -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/gui/resources/forwardLookupInit.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/gui/resources/forwardLookupInit.properties -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/gui/resources/ipResults.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/gui/resources/ipResults.properties -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/gui/resources/jobProgressPanel.properties: -------------------------------------------------------------------------------- 1 | jPanel1.border.title=Jobname 2 | #NOI18N 3 | pbJobProgress.background=255, 255, 255 4 | btnViewProgress.text= 5 | #NOI18N 6 | btnViewProgress.icon=/yeti/resources/magnifier.png 7 | #NOI18N 8 | btnStop.icon=/yeti/resources/Cancel.png 9 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/gui/resources/networkDisplay.properties: -------------------------------------------------------------------------------- 1 | miNmap.text=jMenuItem1 2 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/gui/resources/networkMapview.properties: -------------------------------------------------------------------------------- 1 | jPanel2.border.title=Map 2 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/gui/resources/portScanResultDisplay.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/gui/resources/portScanResultDisplay.properties -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/gui/resources/reverseLookupDisplayResults.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/gui/resources/reverseLookupDisplayResults.properties -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/gui/resources/reverseLookupInit.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/gui/resources/reverseLookupInit.properties -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/gui/resources/scriptOutput.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/gui/resources/scriptOutput.properties -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/gui/resources/selectFootprint.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/gui/resources/selectFootprint.properties -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/gui/resources/startFootprintInit.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/gui/resources/startFootprintInit.properties -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/gui/resources/tldDisplayResults.properties: -------------------------------------------------------------------------------- 1 | jTable1.columnModel.title3=Title 4 2 | jTable1.columnModel.title2=Title 3 3 | jTable1.columnModel.title1=Title 2 4 | jTable1.columnModel.title0=Title 1 5 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/gui/resources/yileDisplayResults2.properties: -------------------------------------------------------------------------------- 1 | jPanel1.border.title=Options 2 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/gui/resources/yileInit.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/gui/resources/yileInit.properties -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/helpers/TldExpandHelper.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.helpers; 2 | 3 | import java.io.FileNotFoundException; 4 | import java.io.IOException; 5 | import java.util.ArrayList; 6 | import java.util.Iterator; 7 | import java.util.List; 8 | import com.sensepost.yeti.results.DomainResult; 9 | import org.xbill.DNS.*; 10 | import com.sensepost.yeti.common.UtilFunctions; 11 | import com.sensepost.yeti.common.ConfigSettings; 12 | import com.sensepost.yeti.common.Log; 13 | 14 | /** 15 | * 16 | * @author willemm 17 | */ 18 | public class TldExpandHelper { 19 | 20 | private static List tldList; 21 | 22 | public static List getTldList(String fileLocation) throws FileNotFoundException, IOException { 23 | if (fileLocation.isEmpty()) { 24 | fileLocation = ConfigSettings.getTldSourceListLocation(); 25 | } 26 | List result = new ArrayList<>(); 27 | if (TldExpandHelper.tldList == null) { 28 | result.addAll(UtilFunctions.fileToList(fileLocation)); 29 | } else { 30 | result.addAll(TldExpandHelper.tldList); 31 | } 32 | return result; 33 | } 34 | 35 | public static List expandDomains(String rootName) throws FileNotFoundException, IOException { 36 | ArrayList result = new ArrayList<>(); 37 | List tlds = TldExpandHelper.getTldList(""); 38 | 39 | Iterator i = tlds.iterator(); 40 | while (i.hasNext()) { 41 | String tld = i.next().toString(); 42 | String domainToCheck = rootName + tld; 43 | Log.debug("Trying " + domainToCheck); 44 | Record[] recs = new Lookup(domainToCheck, Type.NS).run(); 45 | 46 | if (recs != null) { 47 | Log.debug(((NSRecord) recs[0]).getAdditionalName().toString()); 48 | DomainResult newDomain = new DomainResult(domainToCheck); 49 | newDomain.setNameServer(((NSRecord) recs[0]).getAdditionalName().toString()); 50 | result.add(newDomain); 51 | } 52 | } 53 | return result; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/models/BaseModel.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.models; 2 | 3 | import java.util.ArrayList; 4 | import javax.swing.table.DefaultTableModel; 5 | 6 | /** 7 | * 8 | * @author willemmouton 9 | */ 10 | public abstract class BaseModel extends DefaultTableModel implements DataModelIFace { 11 | 12 | String[] columnNames = null; 13 | Class[] types = null; 14 | 15 | protected ArrayList data = new ArrayList<>(); 16 | 17 | public BaseModel() { 18 | if (data == null) { 19 | this.data = new ArrayList<>(); 20 | } 21 | } 22 | 23 | public void setColumnNames(String[] colNames) { 24 | this.columnNames = colNames; 25 | } 26 | 27 | public void setTypes(Class[] types) { 28 | this.types = types; 29 | } 30 | 31 | @Override 32 | public int getRowCount() { 33 | if (this.data == null) { 34 | return 0; 35 | } 36 | return this.data.size(); 37 | } 38 | 39 | @Override 40 | public int getColumnCount() { 41 | return this.columnNames.length; 42 | } 43 | 44 | public void clearData() { 45 | this.data.clear(); 46 | fireTableDataChanged(); 47 | } 48 | 49 | @Override 50 | public abstract void addRow(Object item); 51 | 52 | @Override 53 | public abstract void addRows(ArrayList items); 54 | 55 | public void deleteRow(int row) { 56 | this.data.remove(row); 57 | fireTableRowsDeleted(row, row); 58 | } 59 | 60 | @Override 61 | public Class getColumnClass(int c) { 62 | if (getValueAt(0, c) != null) { 63 | return getValueAt(0, c).getClass(); 64 | } 65 | 66 | return null; 67 | } 68 | 69 | @Override 70 | public String getColumnName(int col) { 71 | return columnNames[col]; 72 | } 73 | 74 | public ArrayList getData() { 75 | return this.data; 76 | } 77 | 78 | @Override 79 | public abstract Object getValueAt(int rowIndex, int columnIndex); 80 | 81 | @Override 82 | public abstract void setValueAt(Object value, int row, int col); 83 | 84 | public Object valueAt(int rowIndex) { 85 | return this.data.get(rowIndex); 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/models/CertModel.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.models; 2 | 3 | import java.util.ArrayList; 4 | import com.sensepost.yeti.results.CertResult; 5 | 6 | /** 7 | * 8 | * @author willemm 9 | */ 10 | public class CertModel extends BaseModel { 11 | 12 | public CertModel() { 13 | super(); 14 | this.setColumnNames(new String[]{"IP Address", "Host name", "Domain name", "Keep"}); 15 | this.setTypes(new Class[]{ 16 | java.lang.String.class, 17 | java.lang.String.class, 18 | java.lang.String.class, 19 | java.lang.Boolean.class,}); 20 | } 21 | 22 | @Override 23 | public Object getValueAt(int rowIndex, int columnIndex) { 24 | CertResult row = (CertResult) data.get(rowIndex); 25 | if (row == null) { 26 | return null; 27 | } 28 | switch (columnIndex) { 29 | case 0: 30 | return row.getIpAddress(); 31 | case 1: 32 | return row.getHostName(); 33 | case 2: 34 | return row.getDomainName(); 35 | case 3: 36 | return row.getKeep(); 37 | default: 38 | return null; 39 | } 40 | } 41 | 42 | @Override 43 | public void setValueAt(Object value, int row, int col) { 44 | CertResult item = (CertResult) data.get(row); 45 | switch (col) { 46 | case 0: 47 | item.setIpAddress(value.toString()); 48 | case 1: 49 | item.setHostName(value.toString()); 50 | case 2: 51 | item.setDomainName(value.toString()); 52 | case 3: 53 | item.setKeep(Boolean.valueOf(value.toString())); 54 | } 55 | fireTableCellUpdated(row, col); 56 | } 57 | 58 | @Override 59 | public void addRow(Object item) { 60 | data.add((CertResult) item); 61 | fireTableDataChanged(); 62 | } 63 | 64 | @Override 65 | public void addRows(ArrayList items) { 66 | throw new UnsupportedOperationException("Not supported yet."); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/models/CollectorModel.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.models; 2 | 3 | import java.util.ArrayList; 4 | import com.sensepost.yeti.results.CollectorResult; 5 | 6 | /** 7 | * 8 | * @author willem 9 | */ 10 | public class CollectorModel extends BaseModel { 11 | 12 | public CollectorModel() { 13 | super(); 14 | this.setColumnNames(new String[]{"Domain name", "Host name", "IP address", "Type", "Extra data", "Keep"}); 15 | this.setTypes(new Class[]{ 16 | java.lang.String.class, 17 | java.lang.String.class, 18 | java.lang.String.class, 19 | java.lang.String.class, 20 | java.lang.String.class, 21 | java.lang.Boolean.class,}); 22 | } 23 | 24 | @Override 25 | public Object getValueAt(int rowIndex, int columnIndex) { 26 | CollectorResult row = (CollectorResult) this.data.get(rowIndex); 27 | if (row == null) { 28 | return null; 29 | } 30 | switch (columnIndex) { 31 | case 0: 32 | return row.getDomainName(); 33 | case 1: 34 | return row.getHostName(); 35 | case 2: 36 | return row.getIpAddress(); 37 | case 3: 38 | return row.getType(); 39 | case 4: 40 | return row.getExtraData(); 41 | case 5: 42 | return row.getKeep(); 43 | default: 44 | return null; 45 | } 46 | } 47 | 48 | @Override 49 | public void setValueAt(Object value, int row, int col) { 50 | CollectorResult item = (CollectorResult) this.data.get(row); 51 | switch (col) { 52 | case 0: 53 | item.setDomainName(value.toString()); 54 | break; 55 | case 1: 56 | item.setHostName(value.toString()); 57 | break; 58 | case 2: 59 | item.setIpAddress(value.toString()); 60 | break; 61 | case 3: 62 | item.setType(value.toString()); 63 | break; 64 | case 4: 65 | item.setExtraData(value.toString()); 66 | break; 67 | case 5: 68 | item.setKeep(Boolean.valueOf(value.toString())); 69 | } 70 | fireTableCellUpdated(row, col); 71 | } 72 | 73 | @Override 74 | public void addRow(Object item) { 75 | this.data.add((CollectorResult) item); 76 | fireTableDataChanged(); 77 | } 78 | 79 | @Override 80 | public void addRows(ArrayList items) { 81 | throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. 82 | } 83 | 84 | } 85 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/models/DataModelIFace.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.models; 2 | 3 | import java.util.ArrayList; 4 | 5 | /** 6 | * 7 | * @author willemmouton 8 | */ 9 | public interface DataModelIFace { 10 | 11 | void addRow(Object item); 12 | 13 | void addRows(ArrayList items); 14 | 15 | int getColumnCount(); 16 | 17 | String getColumnName(int col); 18 | 19 | int getRowCount(); 20 | 21 | Object getValueAt(int rowIndex, int columnIndex); 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/models/DomainModel.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.models; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | import com.sensepost.yeti.common.Globals; 6 | import com.sensepost.yeti.persistence.DataStore; 7 | import com.sensepost.yeti.results.DomainEntry; 8 | 9 | /** 10 | * 11 | * @author willemmouton 12 | */ 13 | public class DomainModel extends BaseModel { 14 | 15 | public DomainModel() { 16 | super(); 17 | setColumnNames(new String[]{"Domain name", "NS server", "Admin", "No. Attributes"}); 18 | setTypes(new Class[]{ 19 | java.lang.String.class, 20 | java.lang.String.class, 21 | java.lang.String.class, 22 | java.lang.Integer.class, 23 | java.lang.String.class,}); 24 | } 25 | 26 | @Override 27 | public Object getValueAt(int rowIndex, int columnIndex) { 28 | if (data.size() > rowIndex) { 29 | DomainEntry row = (DomainEntry) data.get(rowIndex); 30 | if (row == null) { 31 | return null; 32 | } 33 | switch (columnIndex) { 34 | case 0: 35 | return row.getDomainName(); 36 | case 1: 37 | if (row.getNS() == null) { 38 | return ""; 39 | } 40 | return row.getNS(); 41 | case 2: 42 | if (row.getAdmin() == null) { 43 | return ""; 44 | } 45 | return row.getAdmin(); 46 | case 3: 47 | return row.getAttributeCount(); 48 | 49 | } 50 | } 51 | return null; 52 | } 53 | 54 | @Override 55 | public void setValueAt(Object value, int row, int col) { 56 | DomainEntry item = (DomainEntry) data.get(row); 57 | /*switch (col){ 58 | case 0: item.setIpAddress(value.toString()); 59 | case 1: item.setCommonName(value.toString()); 60 | case 2: item.setDomain(value.toString()); 61 | case 3: item.setKeep((Boolean)value); 62 | }*/ 63 | fireTableCellUpdated(row, col); 64 | } 65 | 66 | @Override 67 | public void addRow(Object item) { 68 | data.add((DomainEntry) item); 69 | fireTableDataChanged(); 70 | } 71 | 72 | @Override 73 | public void addRows(ArrayList items) { 74 | throw new UnsupportedOperationException("Not supported yet."); 75 | } 76 | 77 | public void loadData() { 78 | data.clear(); 79 | List domainList = DataStore.getDomainData(Globals.getCurrentFootprintId()); 80 | if (domainList != null && !domainList.isEmpty()) { 81 | data.addAll(domainList); 82 | fireTableDataChanged(); 83 | } 84 | } 85 | 86 | public DomainEntry getItemAt(int index) { 87 | if (index >= 0 && index < data.size()) { 88 | return (DomainEntry) data.get(index); 89 | } 90 | return null; 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/models/FootprintModel.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.models; 2 | 3 | import com.sensepost.yeti.persistence.DataStore; 4 | import java.util.ArrayList; 5 | import java.util.List; 6 | import com.sensepost.yeti.results.FootprintData; 7 | 8 | public class FootprintModel extends BaseModel { 9 | 10 | public FootprintModel() { 11 | setColumnNames( 12 | new String[]{"Name", "Created"} 13 | ); 14 | setTypes(new Class[]{java.lang.String.class, java.lang.String.class,}); 15 | loadData(); 16 | } 17 | 18 | public void reload() { 19 | data.clear(); 20 | loadData(); 21 | } 22 | 23 | private void loadData() { 24 | List list = DataStore.getFootprintData(); 25 | if (list != null) { 26 | for (FootprintData fpd : list) { 27 | addRow(fpd); 28 | } 29 | } 30 | } 31 | 32 | public void reloadData() { 33 | loadData(); 34 | } 35 | 36 | @Override 37 | public void addRow(Object item) { 38 | data.add((FootprintData) item); 39 | fireTableDataChanged(); 40 | } 41 | 42 | @Override 43 | public void addRows(ArrayList items) { 44 | throw new UnsupportedOperationException("Not supported yet."); 45 | } 46 | 47 | @Override 48 | public Object getValueAt(int rowIndex, int columnIndex) { 49 | FootprintData row = (FootprintData) data.get(rowIndex); 50 | if (row == null) { 51 | return null; 52 | } 53 | switch (columnIndex) { 54 | case 0: 55 | return row.getName(); 56 | case 1: 57 | return row.getCreated(); 58 | default: 59 | return null; 60 | } 61 | } 62 | 63 | @Override 64 | public void setValueAt(Object value, int row, int col) { 65 | throw new UnsupportedOperationException("Not supported yet."); 66 | } 67 | 68 | @Override 69 | public boolean isCellEditable(int row, int col) { 70 | return false; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/models/ForwardLookupModel.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.models; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Iterator; 5 | import com.sensepost.yeti.results.ForwardLookupResult; 6 | 7 | /** 8 | * 9 | * @author willemm 10 | */ 11 | public class ForwardLookupModel extends BaseModel { 12 | 13 | public ForwardLookupModel() { 14 | setColumnNames(new String[]{"Domain name", "Host name", "Lookup type", 15 | "IP Address", "Keep"}); 16 | setTypes(new Class[]{ 17 | java.lang.String.class, 18 | java.lang.String.class, 19 | java.lang.String.class, 20 | java.lang.String.class, 21 | java.lang.Boolean.class,}); 22 | } 23 | 24 | @Override 25 | public Object getValueAt(int rowIndex, int columnIndex) { 26 | ForwardLookupResult row = (ForwardLookupResult) data.get(rowIndex); 27 | if (row == null) { 28 | return null; 29 | } 30 | switch (columnIndex) { 31 | case 0: 32 | return row.getDomainName(); 33 | case 1: 34 | return row.getHostName(); 35 | case 2: 36 | return row.getLookupType(); 37 | case 3: 38 | return row.getIpAddress(); 39 | case 4: 40 | return row.getKeep(); 41 | default: 42 | return null; 43 | } 44 | } 45 | 46 | @Override 47 | public void addRow(Object item) { 48 | data.add((ForwardLookupResult) item); 49 | fireTableDataChanged(); 50 | } 51 | 52 | @Override 53 | public void addRows(ArrayList items) { 54 | Iterator i = items.iterator(); 55 | while (i.hasNext()) { 56 | data.add((ForwardLookupResult) i.next()); 57 | } 58 | fireTableDataChanged(); 59 | } 60 | 61 | @Override 62 | public void setValueAt(Object value, int row, int col) { 63 | ForwardLookupResult rowData = (ForwardLookupResult) data.get(row); 64 | if (rowData == null) { 65 | return; 66 | } 67 | switch (col) { 68 | case 0: 69 | break; 70 | case 1: 71 | rowData.setHostName(value.toString()); 72 | break; 73 | case 2: 74 | rowData.setLookupType(value.toString()); 75 | break; 76 | case 3: 77 | rowData.setIpAddress(value.toString()); 78 | break; 79 | case 4: 80 | rowData.setKeep((Boolean) value); 81 | break; 82 | 83 | } 84 | fireTableCellUpdated(row, col); 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/models/HostModel.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.models; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | import com.sensepost.yeti.common.Globals; 6 | import com.sensepost.yeti.persistence.DataStore; 7 | import com.sensepost.yeti.results.HostEntry; 8 | 9 | public class HostModel extends BaseModel { 10 | 11 | public HostModel() { 12 | this.setColumnNames(new String[]{"Hostname", "Domain"}); 13 | this.setTypes(new Class[]{ 14 | java.lang.String.class, 15 | java.lang.String.class,}); 16 | } 17 | 18 | @Override 19 | public Object getValueAt(int rowIndex, int columnIndex) { 20 | if (data.size() > rowIndex) { 21 | HostEntry row = (HostEntry) data.get(rowIndex); 22 | if (row == null) { 23 | return null; 24 | } 25 | switch (columnIndex) { 26 | case 0: 27 | return row.getHostName(); 28 | case 1: 29 | return row.getDomainName(); 30 | } 31 | } 32 | return null; 33 | } 34 | 35 | @Override 36 | public void setValueAt(Object value, int row, int col) { 37 | HostEntry item = (HostEntry) data.get(row); 38 | /*switch (col){ 39 | case 0: item.setIpAddress(value.toString()); 40 | case 1: item.setCommonName(value.toString()); 41 | case 2: item.setDomain(value.toString()); 42 | case 3: item.setKeep((Boolean)value); 43 | }*/ 44 | fireTableCellUpdated(row, col); 45 | } 46 | 47 | @Override 48 | public void addRow(Object item) { 49 | data.add((HostEntry) item); 50 | fireTableDataChanged(); 51 | } 52 | 53 | @Override 54 | public void addRows(ArrayList items) { 55 | throw new UnsupportedOperationException("Not supported yet."); 56 | } 57 | 58 | public void loadData() { 59 | data.clear(); 60 | List hostList = DataStore.getHostDataForFootprint(Globals.getCurrentFootprintId()); 61 | if (hostList != null && !hostList.isEmpty()) { 62 | data.addAll(hostList); 63 | fireTableDataChanged(); 64 | } 65 | } 66 | 67 | public HostEntry getItemAt(int index) { 68 | if (index >= 0 && index < data.size()) { 69 | return (HostEntry) data.get(index); 70 | } 71 | return null; 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/models/IpModel.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.models; 2 | 3 | import com.maxmind.geoip.LookupService; 4 | import java.io.IOException; 5 | import java.util.ArrayList; 6 | import java.util.logging.Level; 7 | import java.util.logging.Logger; 8 | import com.sensepost.yeti.common.ConfigSettings; 9 | import com.sensepost.yeti.persistence.DataStore; 10 | import java.util.List; 11 | 12 | public class IpModel extends BaseModel { 13 | 14 | private LookupService countryLookup = null; 15 | 16 | public IpModel() { 17 | super(); 18 | setColumnNames(new String[]{"Ip Address", "Netblock", "Country"}); 19 | setTypes(new Class[]{ 20 | java.lang.String.class, 21 | java.lang.String.class, 22 | java.lang.String.class,}); 23 | } 24 | 25 | @Override 26 | public Object getValueAt(int rowIndex, int columnIndex) { 27 | if (countryLookup == null) { 28 | try { 29 | countryLookup = new LookupService(ConfigSettings.getGeoIPCountryFile(), 30 | LookupService.GEOIP_MEMORY_CACHE); 31 | } catch (IOException ex) { 32 | Logger.getLogger(IpModel.class.getName()).log(Level.SEVERE, null, ex); 33 | } 34 | } 35 | 36 | if (rowIndex < getRowCount()) { 37 | String rowStr = (String) data.get(rowIndex); 38 | if (rowStr == null) { 39 | return null; 40 | } 41 | switch (columnIndex) { 42 | case 0: 43 | return rowStr; 44 | case 1: 45 | return ""; 46 | case 2: 47 | if (countryLookup != null) { 48 | return countryLookup.getCountry(rowStr).getName(); 49 | } else { 50 | return ""; 51 | } 52 | } 53 | } 54 | return null; 55 | } 56 | 57 | @Override 58 | public void setValueAt(Object value, int row, int col) { 59 | fireTableCellUpdated(row, col); 60 | } 61 | 62 | @Override 63 | public void addRow(Object item) { 64 | data.add((String) item); 65 | fireTableDataChanged(); 66 | } 67 | 68 | @Override 69 | public void addRows(ArrayList items) { 70 | throw new UnsupportedOperationException("Not supported yet."); 71 | } 72 | 73 | public void loadData() { 74 | data.clear(); 75 | List list = DataStore.getAllIPSForCurrentFootprint(); 76 | if (list != null && !list.isEmpty()) { 77 | data.addAll(list); 78 | fireTableDataChanged(); 79 | } 80 | } 81 | 82 | public String getItemAt(int index) { 83 | if (index >= 0 && index < data.size()) { 84 | return (String) data.get(index); 85 | } 86 | return null; 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/models/JobModel.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.models; 2 | 3 | import java.util.ArrayList; 4 | import javax.swing.table.DefaultTableModel; 5 | import com.sensepost.yeti.controllers.RunningJob; 6 | 7 | /** 8 | * 9 | * @author willemmouton 10 | */ 11 | public class JobModel extends DefaultTableModel { 12 | 13 | protected String[] columnNames = null; 14 | protected Class[] types = null; 15 | protected ArrayList data = new ArrayList<>(); 16 | 17 | public JobModel() { 18 | this.columnNames = (new String[]{"Id", "Type", "Progress"}); 19 | 20 | this.types = new Class[]{ 21 | java.lang.Integer.class, 22 | java.lang.String.class, 23 | java.lang.String.class,}; 24 | } 25 | 26 | public void setTypes(Class[] types) { 27 | this.types = types; 28 | } 29 | 30 | @Override 31 | public Object getValueAt(int rowIndex, int columnIndex) { 32 | RunningJob row = (RunningJob) data.get(rowIndex); 33 | if (row == null) { 34 | return null; 35 | } 36 | switch (columnIndex) { 37 | case 0: 38 | return row.getId(); 39 | case 1: 40 | return row.getType(); 41 | case 2: 42 | return row.getProgress(); 43 | default: 44 | return null; 45 | } 46 | } 47 | 48 | @Override 49 | public void setValueAt(Object value, int row, int col) { 50 | if (data != null && row >= 0 && col >= 0) { 51 | RunningJob item = (RunningJob) data.get(row); 52 | switch (col) { 53 | case 2: 54 | item.setProgress(value.toString()); 55 | } 56 | fireTableCellUpdated(row, col); 57 | } 58 | } 59 | 60 | public RunningJob getObjectAt(int index) { 61 | return (RunningJob) data.get(index); 62 | } 63 | 64 | public int getIndexOf(Object item) { 65 | return data.indexOf(item); 66 | } 67 | 68 | public void addRow(Object item) { 69 | data.add(item); 70 | fireTableDataChanged(); 71 | } 72 | 73 | @Override 74 | public Class getColumnClass(int c) { 75 | return getValueAt(0, c).getClass(); 76 | } 77 | 78 | @Override 79 | public String getColumnName(int col) { 80 | return columnNames[col]; 81 | } 82 | 83 | @Override 84 | public int getColumnCount() { 85 | return this.columnNames.length; 86 | } 87 | 88 | @Override 89 | public int getRowCount() { 90 | if (data == null) { 91 | return 0; 92 | } 93 | return data.size(); 94 | } 95 | 96 | public void clear() { 97 | data.clear(); 98 | fireTableDataChanged(); 99 | } 100 | 101 | public void removeItem(Object item) { 102 | data.remove(item); 103 | fireTableDataChanged(); 104 | } 105 | 106 | public ArrayList getData() { 107 | return data; 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/models/ReverseLookupModel.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.models; 2 | 3 | import java.util.ArrayList; 4 | import com.sensepost.yeti.results.ReverseLookupResult; 5 | 6 | /** 7 | * 8 | * @author willemm 9 | */ 10 | public class ReverseLookupModel extends BaseModel { 11 | 12 | public ReverseLookupModel() { 13 | super(); 14 | this.setColumnNames(new String[]{"IP Address", "Hostname", "Domain", "Keep"}); 15 | this.setTypes(new Class[]{ 16 | java.lang.String.class, 17 | java.lang.String.class, 18 | java.lang.String.class, 19 | java.lang.Boolean.class 20 | } 21 | ); 22 | } 23 | 24 | @Override 25 | public Object getValueAt(int rowIndex, int columnIndex) { 26 | ReverseLookupResult row = (ReverseLookupResult) this.data.get(rowIndex); 27 | if (row == null) { 28 | return null; 29 | } 30 | switch (columnIndex) { 31 | case 0: 32 | return row.getIpAddress(); 33 | case 1: 34 | return row.getHostName(); 35 | case 2: 36 | return row.getDomainName(); 37 | case 3: 38 | return row.getKeep(); 39 | default: 40 | return null; 41 | } 42 | } 43 | 44 | @Override 45 | public void setValueAt(Object value, int row, int col) { 46 | ReverseLookupResult rowData = (ReverseLookupResult) this.data.get(row); 47 | if (rowData == null) { 48 | return; 49 | } 50 | switch (col) { 51 | case 0: 52 | rowData.setIpAddress(value.toString()); 53 | case 1: 54 | rowData.setHostName(value.toString()); 55 | case 2: 56 | rowData.setDomainName(value.toString()); 57 | case 3: 58 | rowData.setKeep((Boolean) value); 59 | 60 | } 61 | fireTableCellUpdated(row, col); 62 | } 63 | 64 | @Override 65 | public void addRow(Object item) { 66 | this.data.add((ReverseLookupResult) item); 67 | fireTableDataChanged(); 68 | } 69 | 70 | @Override 71 | public void addRows(ArrayList items) { 72 | throw new UnsupportedOperationException("Not supported yet."); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/models/TldModel.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.models; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Iterator; 5 | import com.sensepost.yeti.results.DomainResult; 6 | 7 | /** 8 | * 9 | * @author willemm 10 | */ 11 | public class TldModel extends BaseModel { 12 | 13 | public TldModel() { 14 | setColumnNames( 15 | new String[]{"Domain name", "Name server", "Admin", "Keep"} 16 | ); 17 | setTypes( 18 | new Class[]{java.lang.String.class, java.lang.String.class, 19 | java.lang.String.class, java.lang.Boolean.class, 20 | java.lang.String.class,} 21 | ); 22 | } 23 | 24 | @Override 25 | public Object getValueAt(int rowIndex, int columnIndex) { 26 | DomainResult row = (DomainResult) data.get(rowIndex); 27 | if (row == null) { 28 | return null; 29 | } 30 | switch (columnIndex) { 31 | case 0: 32 | return row.getDomainName(); 33 | case 1: 34 | return row.getNameServer(); 35 | case 2: 36 | return row.getAdminName(); 37 | case 3: 38 | return row.getKeep(); 39 | case 4: 40 | return row.getRegistrant(); 41 | default: 42 | return null; 43 | } 44 | } 45 | 46 | @Override 47 | public void addRow(Object item) { 48 | data.add((DomainResult) item); 49 | fireTableDataChanged(); 50 | } 51 | 52 | @Override 53 | public void addRows(ArrayList items) { 54 | //data.addAll(items); 55 | Iterator i = items.iterator(); 56 | while (i.hasNext()) { 57 | data.add((DomainResult) i.next()); 58 | } 59 | fireTableDataChanged(); 60 | } 61 | 62 | @Override 63 | public void setValueAt(Object value, int row, int col) { 64 | DomainResult item = (DomainResult) data.get(row); 65 | switch (col) { 66 | case 0: 67 | item.setDomainName(value.toString()); 68 | break; 69 | case 1: 70 | item.setNameServer(value.toString()); 71 | break; 72 | case 2: 73 | item.setAdminName(value.toString()); 74 | break; 75 | case 3: 76 | item.setKeep((Boolean) value); 77 | break; 78 | case 4: 79 | item.setRegistrant(value.toString()); 80 | break; 81 | } 82 | fireTableCellUpdated(row, col); 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/models/YileModel.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.models; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Iterator; 5 | import com.sensepost.yeti.results.YileResult; 6 | 7 | public class YileModel extends BaseModel { 8 | 9 | public YileModel() { 10 | super(); 11 | this.setColumnNames( 12 | new String[]{"Source", "Host", "Domain", "Keep"} 13 | ); 14 | this.setTypes( 15 | new Class[]{java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.Boolean.class, java.lang.String.class,} 16 | ); 17 | } 18 | 19 | @Override 20 | public Object getValueAt(int rowIndex, int columnIndex) { 21 | YileResult row = (YileResult) this.data.get(rowIndex); 22 | if (row == null) { 23 | return null; 24 | } 25 | switch (columnIndex) { 26 | case 0: 27 | return row.getSource(); 28 | case 1: 29 | return row.getHostName(); 30 | case 2: 31 | return row.getDomainName(); 32 | case 3: 33 | return row.getKeep(); 34 | case 4: 35 | return row.getRegistrant(); 36 | case 5: 37 | return row.getIPAddress(); 38 | default: 39 | return null; 40 | } 41 | } 42 | 43 | @Override 44 | public void addRow(Object item) { 45 | Iterator i = this.data.iterator(); 46 | while (i.hasNext()) { 47 | YileResult r = (YileResult) i.next(); 48 | if (r.getHostName().compareTo(((YileResult) item).getHostName()) == 0) { 49 | return; 50 | } 51 | } 52 | this.data.add((YileResult) item); 53 | fireTableDataChanged(); 54 | } 55 | 56 | @Override 57 | public void addRows(ArrayList items) { 58 | //this.data.addAll(items); 59 | Iterator i = items.iterator(); 60 | while (i.hasNext()) { 61 | this.data.add((YileResult) i.next()); 62 | } 63 | fireTableDataChanged(); 64 | } 65 | 66 | @Override 67 | public void setValueAt(Object value, int row, int col) { 68 | YileResult item = (YileResult) this.data.get(row); 69 | switch (col) { 70 | case 0: 71 | item.setSource(value.toString()); 72 | break; 73 | case 1: 74 | item.setHostName(value.toString()); 75 | break; 76 | case 2: 77 | item.setDomainName(value.toString()); 78 | break; 79 | case 3: 80 | item.setKeep((Boolean) value); 81 | break; 82 | case 4: 83 | item.setRegistrant(value.toString()); 84 | break; 85 | case 5: 86 | item.setIPAddress(value.toString()); 87 | break; 88 | } 89 | fireTableCellUpdated(row, col); 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/persistence/HibernateUtil.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.persistence; 2 | 3 | import com.sensepost.yeti.common.ConfigSettings; 4 | import java.util.Properties; 5 | import java.util.logging.Level; 6 | import java.util.logging.Logger; 7 | import org.hibernate.HibernateException; 8 | import org.hibernate.Session; 9 | import org.hibernate.SessionFactory; 10 | import org.hibernate.boot.registry.StandardServiceRegistryBuilder; 11 | import org.hibernate.cfg.Configuration; 12 | import org.hibernate.service.ServiceRegistry; 13 | 14 | /** 15 | * 16 | * @author Johan Snyman 17 | */ 18 | public class HibernateUtil { 19 | 20 | private static SessionFactory sessionFactory; 21 | 22 | private static SessionFactory buildSessionAnnotationFactory() { 23 | try { 24 | Properties dbProps = ConfigSettings.getDatabaseProperties(); 25 | 26 | Configuration configuration = new Configuration(); 27 | configuration.setProperties(dbProps); 28 | configuration.configure("hibernate-annotation.cfg.xml"); 29 | 30 | ServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder().applySettings(configuration.getProperties()).build(); 31 | 32 | sessionFactory = configuration.buildSessionFactory(serviceRegistry); 33 | 34 | return sessionFactory; 35 | } catch (HibernateException ex) { 36 | Logger.getLogger(HibernateUtil.class.getName()).log(Level.SEVERE, null, ex); 37 | throw new ExceptionInInitializerError(ex); 38 | } 39 | } 40 | 41 | public static SessionFactory getSessionFactory() { 42 | if (sessionFactory == null) { 43 | sessionFactory = buildSessionAnnotationFactory(); 44 | } 45 | return sessionFactory; 46 | } 47 | 48 | public static Session getSession() { 49 | if (sessionFactory == null) { 50 | sessionFactory = buildSessionAnnotationFactory(); 51 | } 52 | 53 | return sessionFactory.getCurrentSession(); 54 | } 55 | 56 | public static void resetSession() { 57 | sessionFactory = null; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/persistence/dao/DatabaseEntityDao.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.persistence.dao; 2 | 3 | import com.sensepost.yeti.persistence.HibernateUtil; 4 | import static com.sensepost.yeti.persistence.HibernateUtil.getSession; 5 | import java.io.Serializable; 6 | import java.lang.reflect.ParameterizedType; 7 | import java.util.List; 8 | import java.util.logging.Level; 9 | import java.util.logging.Logger; 10 | import org.hibernate.Criteria; 11 | import org.hibernate.HibernateException; 12 | import org.hibernate.Query; 13 | import org.hibernate.Session; 14 | import org.hibernate.criterion.Criterion; 15 | import org.hibernate.exception.ConstraintViolationException; 16 | 17 | /** 18 | * 19 | * @author Johan Snyman 20 | * @param The DatabaseEntity type of the database table. 21 | */ 22 | public class DatabaseEntityDao { 23 | 24 | private final Class persistentClass; 25 | 26 | public DatabaseEntityDao() { 27 | this.persistentClass = (Class) ((ParameterizedType) getClass() 28 | .getGenericSuperclass()).getActualTypeArguments()[0]; 29 | } 30 | 31 | public E findById(Integer id) { 32 | return (E) HibernateUtil.getSession().get(persistentClass, id); 33 | } 34 | 35 | public List findAll() { 36 | return HibernateUtil.getSession().createCriteria(persistentClass).list(); 37 | } 38 | 39 | public E saveOrUpdate(E e) { 40 | try { 41 | HibernateUtil.getSession().saveOrUpdate(e); 42 | return e; 43 | } catch (ConstraintViolationException cve) { 44 | Logger.getLogger("saveOrUpdate").log(Level.INFO, 45 | "The entity will not be persisted as a duplicate already exists.", cve); 46 | } 47 | return null; 48 | } 49 | 50 | public void delete(E e) { 51 | HibernateUtil.getSession().delete(e); 52 | } 53 | 54 | public List findByCriteria(Criterion criterion) { 55 | Criteria criteria = HibernateUtil.getSession().createCriteria(persistentClass); 56 | criteria.add(criterion); 57 | return criteria.list(); 58 | } 59 | 60 | public int truncate() { 61 | Session s = getSession(); 62 | int rowsAffected = 0; 63 | try { 64 | Class c = getPersistentClass(); 65 | String hql = "delete from " + c.getSimpleName(); 66 | Query q = s.createQuery(hql); 67 | rowsAffected = q.executeUpdate(); 68 | } catch (HibernateException e) { 69 | Logger.getLogger("truncate").log(Level.INFO, 70 | "Could not clear the table.", e); 71 | } 72 | return rowsAffected; 73 | } 74 | 75 | public Class getPersistentClass() { 76 | return persistentClass; 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/persistence/dao/DomainAttributeDao.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.persistence.dao; 2 | 3 | import com.sensepost.yeti.persistence.HibernateUtil; 4 | import com.sensepost.yeti.persistence.entities.DomainAttribute; 5 | import java.util.List; 6 | import org.hibernate.Query; 7 | 8 | /** 9 | * 10 | * @author Johan Snyman 11 | */ 12 | public class DomainAttributeDao extends DatabaseEntityDao { 13 | 14 | @Override 15 | public DomainAttribute saveOrUpdate(DomainAttribute e) { 16 | DomainAttribute da = findByAttributeValueAndDomain(e.getValue(), e.getDomain().getId()); 17 | if (da == null) { 18 | super.saveOrUpdate(e); 19 | return e; 20 | } 21 | return da; 22 | } 23 | 24 | public DomainAttribute findByAttributeValueAndDomain(String value, int domainId) { 25 | String hql = "from DomainAttribute where value = :value and domain.id = :domainId"; 26 | Query query = HibernateUtil.getSession().createQuery(hql); 27 | query.setParameter("value", value); 28 | query.setParameter("domainId", domainId); 29 | List list = query.list(); 30 | if (list != null && !list.isEmpty()) { 31 | return list.get(0); 32 | } 33 | return null; 34 | } 35 | 36 | public List findByDomainNameAndFootprint(String domainName, int footprintId) { 37 | String hql = "from DomainAttribute where domain.name = :domainName and footprint_id = :footprintId"; 38 | Query query = HibernateUtil.getSession().createQuery(hql); 39 | query.setParameter("domainName", domainName); 40 | query.setParameter("footprintId", footprintId); 41 | return query.list(); 42 | } 43 | 44 | public void deleteDomainAtrribute(String domainName, String key, String value) { 45 | String hql = "delete from DomainAttribute where domain.name = :domainName and key = : key and value = :value"; 46 | Query query = HibernateUtil.getSession().createQuery(hql); 47 | query.setParameter("domainName", domainName); 48 | query.setParameter("key", key); 49 | query.setParameter("value", value); 50 | query.executeUpdate(); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/persistence/dao/DomainDao.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.persistence.dao; 2 | 3 | import com.sensepost.yeti.persistence.HibernateUtil; 4 | import com.sensepost.yeti.persistence.entities.Domain; 5 | import java.util.List; 6 | import org.hibernate.Query; 7 | 8 | /** 9 | * 10 | * @author Johan Snyman 11 | */ 12 | public class DomainDao extends DatabaseEntityDao { 13 | 14 | @Override 15 | public Domain saveOrUpdate(Domain e) { 16 | Domain d = findByName(e.getName(), e.getFootprint().getId()); 17 | if (d == null) { 18 | super.saveOrUpdate(e); 19 | return e; 20 | } 21 | return d; 22 | } 23 | 24 | public Domain findByName(String domainName, int footprintId) { 25 | String hql = "from Domain where name = :domainName and footprint.id = :footprintId"; 26 | Query query = HibernateUtil.getSession().createQuery(hql); 27 | query.setParameter("domainName", domainName); 28 | query.setParameter("footprintId", footprintId); 29 | List list = query.list(); 30 | if (!list.isEmpty() && !list.isEmpty()) { 31 | return list.get(0); 32 | } 33 | 34 | return null; 35 | } 36 | 37 | public List findByFootprint(int footprintId) { 38 | String hql = "from Domain where footprint.id = :footprintId"; 39 | Query query = HibernateUtil.getSession().createQuery(hql); 40 | query.setParameter("footprintId", footprintId); 41 | return query.list(); 42 | } 43 | 44 | public void deleteDomain(String domainName, int footprintId) { 45 | String hql = "delete from Domain where name = :domainName and footprint.id = :footprintId"; 46 | Query query = HibernateUtil.getSession().createQuery(hql); 47 | query.setParameter("domainName", domainName); 48 | query.setParameter("footprintId", footprintId); 49 | query.executeUpdate(); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/persistence/dao/FootprintDao.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.persistence.dao; 2 | 3 | import com.sensepost.yeti.persistence.HibernateUtil; 4 | import com.sensepost.yeti.persistence.entities.Footprint; 5 | import org.hibernate.Query; 6 | 7 | /** 8 | * 9 | * @author Johan Snyman 10 | */ 11 | public class FootprintDao extends DatabaseEntityDao { 12 | 13 | @Override 14 | public Footprint saveOrUpdate(Footprint e) { 15 | Footprint fp = findByName(e.getName()); 16 | if (fp == null) { 17 | super.saveOrUpdate(e); 18 | return e; 19 | } 20 | return fp; 21 | } 22 | 23 | public Integer getFootprintId(String name) { 24 | String hql = "select id from Footprint where name = :name"; 25 | Query query = HibernateUtil.getSession().createQuery(hql); 26 | query.setParameter("name", name); 27 | return (Integer) query.uniqueResult(); 28 | } 29 | 30 | public Footprint findByName(String name) { 31 | String hql = "from Footprint where name = :name"; 32 | Query query = HibernateUtil.getSession().createQuery(hql); 33 | query.setParameter("name", name); 34 | return (Footprint) query.uniqueResult(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/persistence/dao/HibernateDaoFactory.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.persistence.dao; 2 | 3 | import com.sensepost.yeti.persistence.dao.config.ServerOptionDao; 4 | import com.sensepost.yeti.persistence.dao.config.WhoisServerDao; 5 | 6 | /** 7 | * 8 | * @author Johan Snyman 9 | */ 10 | public class HibernateDaoFactory { 11 | 12 | private static HibernateDaoFactory instance; 13 | 14 | private HibernateDaoFactory() { 15 | } 16 | 17 | public static HibernateDaoFactory getInstance() { 18 | if (instance == null) { 19 | instance = new HibernateDaoFactory(); 20 | } 21 | return instance; 22 | } 23 | 24 | public DomainDao getDomainDao() { 25 | return (DomainDao) instantiateDAO(DomainDao.class); 26 | } 27 | 28 | public DomainAttributeDao getDomainAttributeDao() { 29 | return (DomainAttributeDao) instantiateDAO(DomainAttributeDao.class); 30 | } 31 | 32 | public FootprintDao getFootprintDao() { 33 | return (FootprintDao) instantiateDAO(FootprintDao.class); 34 | } 35 | 36 | public HostDao getHostDao() { 37 | return (HostDao) instantiateDAO(HostDao.class); 38 | } 39 | 40 | public HostAttributeDao getHostAttributeDao() { 41 | return (HostAttributeDao) instantiateDAO(HostAttributeDao.class); 42 | } 43 | 44 | public InitialDataDao getInitialDataDao() { 45 | return (InitialDataDao) instantiateDAO(InitialDataDao.class); 46 | } 47 | 48 | public IpAddressDao getIpAddressDao() { 49 | return (IpAddressDao) instantiateDAO(IpAddressDao.class); 50 | } 51 | 52 | public PortDao getPortDao() { 53 | return (PortDao) instantiateDAO(PortDao.class); 54 | } 55 | 56 | public ServerOptionDao getServerOptionDao() { 57 | return (ServerOptionDao) instantiateDAO(ServerOptionDao.class); 58 | } 59 | 60 | public WhoisServerDao getWhoisServerDao() { 61 | return (WhoisServerDao) instantiateDAO(WhoisServerDao.class); 62 | } 63 | 64 | private DatabaseEntityDao instantiateDAO(Class daoClass) { 65 | try { 66 | DatabaseEntityDao dao = (DatabaseEntityDao)daoClass.newInstance(); 67 | return dao; 68 | } catch (IllegalAccessException | InstantiationException ex) { 69 | throw new RuntimeException("Can not instantiate DAO: " + daoClass, ex); 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/persistence/dao/HostAttributeDao.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.persistence.dao; 2 | 3 | import com.sensepost.yeti.persistence.HibernateUtil; 4 | import com.sensepost.yeti.persistence.entities.HostAttribute; 5 | import java.util.List; 6 | import org.hibernate.Query; 7 | 8 | /** 9 | * 10 | * @author Johan Snyman 11 | */ 12 | public class HostAttributeDao extends DatabaseEntityDao { 13 | 14 | @Override 15 | public HostAttribute saveOrUpdate(HostAttribute e) { 16 | HostAttribute ha = findByKeyAndHost(e.getKey(), e.getHost().getId()); 17 | if (ha == null) { 18 | super.saveOrUpdate(e); 19 | return e; 20 | } 21 | return ha; 22 | } 23 | 24 | public List findByHostName(String hostName) { 25 | String hql = "from HostAttribute where host.name = :hostName"; 26 | Query query = HibernateUtil.getSession().createQuery(hql); 27 | query.setParameter("hostName", hostName); 28 | return query.list(); 29 | } 30 | 31 | public HostAttribute findByKeyAndHost(String key, int hostId) { 32 | String hql = "from HostAttribute where key = :key and host.id = :hostId"; 33 | Query query = HibernateUtil.getSession().createQuery(hql); 34 | query.setParameter("key", key); 35 | query.setParameter("hostId", hostId); 36 | List list = query.list(); 37 | if (list != null && !list.isEmpty()) { 38 | return list.get(0); 39 | } 40 | return null; 41 | } 42 | 43 | public void deleteHostAtrribute(String hostName, String key, String value, int footprintId) { 44 | String hql = "delete from HostAttribute where host.name = :hostName and key = : key and value = :value and footprint.id = :footprintId"; 45 | Query query = HibernateUtil.getSession().createQuery(hql); 46 | query.setParameter("hostName", hostName); 47 | query.setParameter("key", key); 48 | query.setParameter("value", value); 49 | query.setParameter("footprintId", footprintId); 50 | query.executeUpdate(); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/persistence/dao/HostDao.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.persistence.dao; 2 | 3 | import com.sensepost.yeti.persistence.HibernateUtil; 4 | import com.sensepost.yeti.persistence.entities.Host; 5 | import java.util.List; 6 | import org.hibernate.Query; 7 | 8 | /** 9 | * 10 | * @author Johan Snyman 11 | */ 12 | public class HostDao extends DatabaseEntityDao { 13 | 14 | @Override 15 | public Host saveOrUpdate(Host e) { 16 | Host h = findByNameAndDomain(e.getName(), e.getDomain().getId()); 17 | if (h == null) { 18 | super.saveOrUpdate(e); 19 | return e; 20 | } 21 | return h; 22 | } 23 | 24 | public Host findByNameAndFootprint(String hostName, int footprintId) { 25 | String hql = "from Host where name = :hostName and domain.footprint.id = :footprintId"; 26 | Query query = HibernateUtil.getSession().createQuery(hql); 27 | query.setParameter("hostName", hostName); 28 | query.setParameter("footprintId", footprintId); 29 | return (Host) query.uniqueResult(); 30 | } 31 | 32 | public Host findByNameAndDomain(String hostName, int domainId) { 33 | String hql = "from Host where name = :hostName and domain.id = :domainId"; 34 | Query query = HibernateUtil.getSession().createQuery(hql); 35 | query.setParameter("hostName", hostName); 36 | query.setParameter("domainId", domainId); 37 | return (Host) query.uniqueResult(); 38 | } 39 | 40 | public List findByFootprint(int footprintId) { 41 | String hql = "from Host where domain.footprint.id = :footprintId"; 42 | Query query = HibernateUtil.getSession().createQuery(hql); 43 | query.setParameter("footprintId", footprintId); 44 | return query.list(); 45 | } 46 | 47 | public List findByIpAddress(String ipAddress) { 48 | String hql = "from Host where ipAddresses.address = :ipAddress"; 49 | Query query = HibernateUtil.getSession().createQuery(hql); 50 | query.setParameter("ipAddress", ipAddress); 51 | return query.list(); 52 | } 53 | 54 | public List findByDomainAndFootprint(String domainName, int footprintId) { 55 | String hql = "from Host where domain.name = :domainName and domain.footprint.id = :footprintId"; 56 | Query query = HibernateUtil.getSession().createQuery(hql); 57 | query.setParameter("domainName", domainName); 58 | query.setParameter("footprintId", footprintId); 59 | return query.list(); 60 | } 61 | 62 | public void deleteHost(String hostName, int footprintId) { 63 | String hql = "delete from Host where name = :hostName and footprint.id = :footprintId"; 64 | Query query = HibernateUtil.getSession().createQuery(hql); 65 | query.setParameter("hostName", hostName); 66 | query.setParameter("footprintId", footprintId); 67 | query.executeUpdate(); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/persistence/dao/InitialDataDao.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.persistence.dao; 2 | 3 | import com.sensepost.yeti.persistence.HibernateUtil; 4 | import com.sensepost.yeti.persistence.entities.InitialData; 5 | import java.util.List; 6 | import org.hibernate.Query; 7 | 8 | /** 9 | * 10 | * @author Johan Snyman 11 | */ 12 | public class InitialDataDao extends DatabaseEntityDao { 13 | 14 | public List findByTypeAndFootprintId(String type, int footprintId) { 15 | String hql = "from InitialData where type = :type and footprint.id = :footprintId"; 16 | Query query = HibernateUtil.getSession().createQuery(hql); 17 | query.setParameter("type", type); 18 | query.setParameter("footprintId", footprintId); 19 | return query.list(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/persistence/dao/IpAddressDao.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.persistence.dao; 2 | 3 | import com.sensepost.yeti.persistence.HibernateUtil; 4 | import com.sensepost.yeti.persistence.entities.IpAddress; 5 | import java.util.List; 6 | import org.hibernate.Query; 7 | 8 | /** 9 | * 10 | * @author Johan Snyman 11 | */ 12 | public class IpAddressDao extends DatabaseEntityDao { 13 | 14 | @Override 15 | public IpAddress saveOrUpdate(IpAddress e) { 16 | IpAddress ipa = findByAddressAndFootprint(e.getAddress(), e.getFootprint().getId()); 17 | if (ipa == null) { 18 | super.saveOrUpdate(e); 19 | return e; 20 | } 21 | return ipa; 22 | } 23 | 24 | public IpAddress findByAddressAndFootprint(String ipAddress, int footprintId) { 25 | String hql = "from IpAddress where address = :address and footprint.id = :footprintId"; 26 | Query query = HibernateUtil.getSession().createQuery(hql); 27 | query.setParameter("address", ipAddress); 28 | query.setParameter("footprintId", footprintId); 29 | List list = query.list(); 30 | if (list != null && !list.isEmpty()) { 31 | return list.get(0); 32 | } 33 | return null; 34 | } 35 | 36 | public List findByFootprint(int footprintId) { 37 | String hql = "from IpAddress where footprint.id = :footprintId"; 38 | Query query = HibernateUtil.getSession().createQuery(hql); 39 | query.setParameter("footprintId", footprintId); 40 | return query.list(); 41 | } 42 | 43 | public List findByHostAndFootprint(String hostName, int footprintId) { 44 | String hql = "from IpAddress where hosts.name = :hostName and footprint.id = :footprintId"; 45 | Query query = HibernateUtil.getSession().createQuery(hql); 46 | query.setParameter("hostName", hostName); 47 | query.setParameter("footprintId", footprintId); 48 | return query.list(); 49 | } 50 | 51 | public void deleteIpAddressFromFootprint(String ipAddress, int footprintId) { 52 | String hql = "delete from IpAddress where address = :ipAddress and footprint.id = :footprintId"; 53 | Query query = HibernateUtil.getSession().createQuery(hql); 54 | query.setParameter("ipAddress", ipAddress); 55 | query.setParameter("footprintId", footprintId); 56 | query.executeUpdate(); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/persistence/dao/PortDao.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.persistence.dao; 2 | 3 | import com.sensepost.yeti.persistence.HibernateUtil; 4 | import com.sensepost.yeti.persistence.entities.Port; 5 | import java.util.List; 6 | import org.hibernate.Query; 7 | 8 | /** 9 | * 10 | * @author Johan Snyman 11 | */ 12 | public class PortDao extends DatabaseEntityDao { 13 | 14 | @Override 15 | public Port saveOrUpdate(Port e) { 16 | Port p = findByPortAndIpAddress(e.getPortNumber(), e.getIpAddress().getId()); 17 | if (p == null) { 18 | super.saveOrUpdate(e); 19 | return e; 20 | } 21 | return p; 22 | } 23 | 24 | public Port findByPortAndIpAddress(Integer portNumber, int ipAddressId) { 25 | String hql = "from Port where portNumber = :portNumber and ipAddress.id = :ipAddressId"; 26 | Query query = HibernateUtil.getSession().createQuery(hql); 27 | query.setParameter("portNumber", portNumber); 28 | query.setParameter("ipAddressId", ipAddressId); 29 | List list = query.list(); 30 | if (list != null && !list.isEmpty()) { 31 | return list.get(0); 32 | } 33 | return null; 34 | } 35 | 36 | public List findPortsByIpAddressAndFootprint(String ipAddress, int footprintId) { 37 | String hql = "from Port where ipAddress.address = :ipAddress and ipAddress.footprint.id = :footprintId"; 38 | Query query = HibernateUtil.getSession().createQuery(hql); 39 | query.setParameter("ipAddress", ipAddress); 40 | query.setParameter("footprintId", footprintId); 41 | return query.list(); 42 | } 43 | 44 | public void deletePortFromIp(String ipAddress, int portNumber, int footprintId) { 45 | String hql = "delete from Port where portNumber = :portNumber and ipAddress.address = :ipAddress and footprint.id = :footprintId"; 46 | Query query = HibernateUtil.getSession().createQuery(hql); 47 | query.setParameter("portNumber", portNumber); 48 | query.setParameter("ipAddress", ipAddress); 49 | query.setParameter("footprintId", footprintId); 50 | query.executeUpdate(); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/persistence/dao/config/ServerOptionDao.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.persistence.dao.config; 2 | 3 | import com.sensepost.yeti.persistence.dao.DatabaseEntityDao; 4 | import com.sensepost.yeti.persistence.entities.config.ServerOption; 5 | 6 | /** 7 | * 8 | * @author Johan Snyman 9 | */ 10 | public class ServerOptionDao extends DatabaseEntityDao { 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/persistence/dao/config/WhoisServerDao.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.persistence.dao.config; 2 | 3 | import com.sensepost.yeti.persistence.HibernateUtil; 4 | import com.sensepost.yeti.persistence.dao.DatabaseEntityDao; 5 | import com.sensepost.yeti.persistence.entities.config.WhoisServer; 6 | import org.hibernate.Query; 7 | /** 8 | * 9 | * @author Johan Snyman 10 | */ 11 | public class WhoisServerDao extends DatabaseEntityDao { 12 | 13 | public WhoisServer findByRegex(String regex) { 14 | String hql = "from WhoisServer where regex = :regex"; 15 | Query query = HibernateUtil.getSession().createQuery(hql); 16 | query.setParameter("regex", regex); 17 | return (WhoisServer) query.uniqueResult(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/persistence/entities/DatabaseEntity.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.persistence.entities; 2 | 3 | import com.sensepost.yeti.common.EqualityUtil; 4 | import com.sensepost.yeti.common.FormatUtil; 5 | import java.io.Serializable; 6 | import java.util.Date; 7 | import javax.persistence.GeneratedValue; 8 | import javax.persistence.GenerationType; 9 | import javax.persistence.Id; 10 | import javax.persistence.MappedSuperclass; 11 | import javax.persistence.Temporal; 12 | import javax.persistence.TemporalType; 13 | 14 | /** 15 | * 16 | * @author Johan Snyman 17 | */ 18 | @MappedSuperclass 19 | public class DatabaseEntity implements Serializable { 20 | 21 | @Id 22 | @GeneratedValue(strategy = GenerationType.AUTO) 23 | private Integer id; 24 | 25 | @Temporal(TemporalType.TIMESTAMP) 26 | private Date created; 27 | 28 | public DatabaseEntity() { 29 | id = -1; 30 | created = new Date(); 31 | } 32 | 33 | public Integer getId() { 34 | return id; 35 | } 36 | 37 | public void setId(Integer id) { 38 | this.id = id; 39 | } 40 | 41 | public Date getCreated() { 42 | return created; 43 | } 44 | 45 | public void setCreated(Date created) { 46 | this.created = created; 47 | } 48 | 49 | @Override 50 | public boolean equals(Object obj) { 51 | if (this == obj) { 52 | return true; 53 | } 54 | if (!(obj instanceof DatabaseEntity)) { 55 | return false; 56 | } 57 | 58 | final DatabaseEntity de = (DatabaseEntity) obj; 59 | return EqualityUtil.equals(de.getId(), getId()) 60 | && EqualityUtil.equals(de.getCreated(), getCreated()); 61 | } 62 | 63 | @Override 64 | public int hashCode() { 65 | int result = 1; 66 | 67 | result = 27 * result + ((id == null) ? 0 : id); 68 | result = 27 * result + ((created == null) ? 0 : created.hashCode()); 69 | 70 | return result; 71 | } 72 | 73 | @Override 74 | public String toString() { 75 | StringBuilder str = new StringBuilder(); 76 | 77 | str.append("Id: ").append(id).append(System.lineSeparator()); 78 | str.append("Created: ").append(FormatUtil.formatDate(created)).append(System.lineSeparator()); 79 | 80 | return str.toString(); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/persistence/entities/Domain.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.persistence.entities; 2 | 3 | import com.sensepost.yeti.common.EqualityUtil; 4 | import javax.persistence.Column; 5 | import javax.persistence.Entity; 6 | import javax.persistence.Inheritance; 7 | import javax.persistence.InheritanceType; 8 | import javax.persistence.JoinColumn; 9 | import javax.persistence.ManyToOne; 10 | import javax.persistence.Table; 11 | 12 | /** 13 | * 14 | * @author Johan Snyman 15 | */ 16 | @Entity 17 | @Table(name = "domains") 18 | @Inheritance(strategy = InheritanceType.SINGLE_TABLE) 19 | public class Domain extends DatabaseEntity { 20 | 21 | @Column(name = "domain_name", nullable = false) 22 | private String name; 23 | 24 | @Column(columnDefinition = "TEXT") 25 | private String whois; 26 | 27 | @ManyToOne 28 | @JoinColumn(name = "footprint_id") 29 | private Footprint footprint; 30 | 31 | public Domain() { 32 | } 33 | 34 | public String getName() { 35 | return name; 36 | } 37 | 38 | public void setName(String name) { 39 | this.name = name; 40 | } 41 | 42 | public String getWhois() { 43 | return whois; 44 | } 45 | 46 | public void setWhois(String whois) { 47 | this.whois = whois; 48 | } 49 | 50 | public Footprint getFootprint() { 51 | return footprint; 52 | } 53 | 54 | public void setFootprint(Footprint footprint) { 55 | this.footprint = footprint; 56 | } 57 | 58 | @Override 59 | public boolean equals(Object obj) { 60 | if (this == obj) { 61 | return true; 62 | } 63 | if (!(obj instanceof Domain)) { 64 | return false; 65 | } 66 | if (!super.equals(obj)) { 67 | return false; 68 | } 69 | 70 | final Domain d = (Domain) obj; 71 | return EqualityUtil.equals(d.getName(), getName()) 72 | && EqualityUtil.equals(d.getWhois(), getWhois()) 73 | && EqualityUtil.equals(d.getFootprint(), getFootprint()); 74 | } 75 | 76 | @Override 77 | public int hashCode() { 78 | int result = super.hashCode(); 79 | 80 | result = 27 * result + ((getName() == null) ? 0 : getName().hashCode()); 81 | result = 27 * result + ((getWhois() == null) ? 0 : getWhois().hashCode()); 82 | result = 27 * result + ((getFootprint() == null) ? 0 : getFootprint().hashCode()); 83 | return result; 84 | } 85 | 86 | @Override 87 | public String toString() { 88 | StringBuilder str = new StringBuilder(); 89 | 90 | str.append("Domain:").append(System.lineSeparator()); 91 | str.append(super.toString()); 92 | str.append("Name ").append(getName()).append(System.lineSeparator()); 93 | str.append("Whois: ").append(getWhois()).append(System.lineSeparator()); 94 | str.append("Footrpint: ").append(getFootprint() == null ? "" : getFootprint().getName()).append(System.lineSeparator()); 95 | 96 | return str.toString(); 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/persistence/entities/DomainAttribute.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.persistence.entities; 2 | 3 | import com.sensepost.yeti.common.EqualityUtil; 4 | import javax.persistence.Column; 5 | import javax.persistence.Entity; 6 | import javax.persistence.Inheritance; 7 | import javax.persistence.InheritanceType; 8 | import javax.persistence.JoinColumn; 9 | import javax.persistence.ManyToOne; 10 | import javax.persistence.Table; 11 | 12 | /** 13 | * 14 | * @author Johan Snyman 15 | */ 16 | @Entity 17 | @Table(name = "domain_attributes") 18 | @Inheritance(strategy = InheritanceType.SINGLE_TABLE) 19 | public class DomainAttribute extends DatabaseEntity { 20 | 21 | @Column(name = "attr_key", nullable = false) 22 | private String key; 23 | 24 | @Column(name = "attr_value", nullable = false) 25 | private String value; 26 | 27 | @ManyToOne 28 | @JoinColumn(name = "domain_id", nullable = false) 29 | private Domain domain; 30 | 31 | public DomainAttribute() { 32 | } 33 | 34 | public String getKey() { 35 | return key; 36 | } 37 | 38 | public void setKey(String key) { 39 | this.key = key; 40 | } 41 | 42 | public String getValue() { 43 | return value; 44 | } 45 | 46 | public void setValue(String value) { 47 | this.value = value; 48 | } 49 | 50 | public Domain getDomain() { 51 | return domain; 52 | } 53 | 54 | public void setDomain(Domain domain) { 55 | this.domain = domain; 56 | } 57 | 58 | @Override 59 | public boolean equals(Object obj) { 60 | if (this == obj) { 61 | return true; 62 | } 63 | if (!(obj instanceof DomainAttribute)) { 64 | return false; 65 | } 66 | if (!super.equals(obj)) { 67 | return false; 68 | } 69 | 70 | final DomainAttribute da = (DomainAttribute) obj; 71 | return EqualityUtil.equals(da.getKey(), getKey()) 72 | && EqualityUtil.equals(da.getValue(), getValue()) 73 | && EqualityUtil.equals(da.getDomain(), getDomain()); 74 | } 75 | 76 | @Override 77 | public int hashCode() { 78 | int result = super.hashCode(); 79 | 80 | result = 27 * result + ((getKey() == null) ? 0 : getKey().hashCode()); 81 | result = 27 * result + ((getValue() == null) ? 0 : getValue().hashCode()); 82 | result = 27 * result + ((getDomain() == null) ? 0 : getDomain().hashCode()); 83 | 84 | return result; 85 | } 86 | 87 | @Override 88 | public String toString() { 89 | StringBuilder str = new StringBuilder(); 90 | 91 | str.append("Domain Attrribute:").append(System.lineSeparator()); 92 | str.append(super.toString()); 93 | str.append("Attribute Key ").append(getKey()).append(System.lineSeparator()); 94 | str.append("Atribute Value: ").append(getValue()).append(System.lineSeparator()); 95 | str.append("Domain: ").append(getDomain() == null ? "" : getDomain().getName()).append(System.lineSeparator()); 96 | 97 | return str.toString(); 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/persistence/entities/Footprint.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.persistence.entities; 2 | 3 | import com.sensepost.yeti.common.EqualityUtil; 4 | import javax.persistence.Column; 5 | import javax.persistence.Entity; 6 | import javax.persistence.Inheritance; 7 | import javax.persistence.InheritanceType; 8 | import javax.persistence.Table; 9 | 10 | /** 11 | * 12 | * @author Johan Snyman 13 | */ 14 | @Entity 15 | @Table(name = "footprints") 16 | @Inheritance(strategy = InheritanceType.SINGLE_TABLE) 17 | public class Footprint extends DatabaseEntity { 18 | 19 | @Column(name = "footprint_name", nullable = false) 20 | private String name; 21 | 22 | public Footprint() { 23 | } 24 | 25 | public String getName() { 26 | return name; 27 | } 28 | 29 | public void setName(String name) { 30 | this.name = name; 31 | } 32 | 33 | @Override 34 | public boolean equals(Object obj) { 35 | if (this == obj) { 36 | return true; 37 | } 38 | if (!(obj instanceof DatabaseEntity)) { 39 | return false; 40 | } 41 | 42 | final Footprint f = (Footprint) obj; 43 | 44 | return EqualityUtil.equals(f.getName(), getName()); 45 | } 46 | 47 | @Override 48 | public int hashCode() { 49 | int result = super.hashCode(); 50 | 51 | result = 27 * result + ((getName() == null) ? 0 : getName().hashCode()); 52 | 53 | return result; 54 | } 55 | 56 | @Override 57 | public String toString() { 58 | StringBuilder str = new StringBuilder(); 59 | 60 | str.append("Footprint").append(System.lineSeparator()); 61 | str.append(super.toString()); 62 | str.append("Name: ").append(getName()).append(System.lineSeparator()); 63 | 64 | return str.toString(); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/persistence/entities/Host.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.persistence.entities; 2 | 3 | import com.sensepost.yeti.common.EqualityUtil; 4 | import java.util.ArrayList; 5 | import java.util.List; 6 | import javax.persistence.CascadeType; 7 | import javax.persistence.Column; 8 | import javax.persistence.Entity; 9 | import javax.persistence.Inheritance; 10 | import javax.persistence.InheritanceType; 11 | import javax.persistence.JoinColumn; 12 | import javax.persistence.JoinTable; 13 | import javax.persistence.ManyToMany; 14 | import javax.persistence.ManyToOne; 15 | import javax.persistence.Table; 16 | 17 | /** 18 | * 19 | * @author Johan Snyman 20 | */ 21 | @Entity 22 | @Table(name = "hosts") 23 | @Inheritance(strategy = InheritanceType.SINGLE_TABLE) 24 | public class Host extends DatabaseEntity { 25 | 26 | @Column(name = "host_name", nullable = false) 27 | private String name; 28 | 29 | @ManyToOne 30 | @JoinColumn(name = "domain_id") 31 | private Domain domain; 32 | 33 | @ManyToMany( 34 | targetEntity = IpAddress.class, 35 | cascade = {CascadeType.PERSIST, CascadeType.MERGE} 36 | ) 37 | @JoinTable( 38 | name = "hosts_ip_addresses", 39 | joinColumns = @JoinColumn(name = "host_id"), 40 | inverseJoinColumns = @JoinColumn(name = "ip_address_id") 41 | ) 42 | private List ipAddresses; 43 | 44 | public Host() { 45 | } 46 | 47 | public String getName() { 48 | return name; 49 | } 50 | 51 | public void setName(String name) { 52 | this.name = name; 53 | } 54 | 55 | public Domain getDomain() { 56 | return domain; 57 | } 58 | 59 | public void setDomain(Domain domain) { 60 | this.domain = domain; 61 | } 62 | 63 | public List getIpAddresses() { 64 | return ipAddresses; 65 | } 66 | 67 | private void setIpAddresses(List ipAddresses) { 68 | this.ipAddresses = ipAddresses; 69 | } 70 | 71 | 72 | public void addIpAddress(IpAddress ipAddress) { 73 | if(ipAddresses == null) { 74 | ipAddresses = new ArrayList<>(); 75 | } 76 | ipAddresses.add(ipAddress); 77 | } 78 | 79 | @Override 80 | public boolean equals(Object obj) { 81 | if (this == obj) { 82 | return true; 83 | } 84 | if (!(obj instanceof Host)) { 85 | return false; 86 | } 87 | 88 | final Host h = (Host) obj; 89 | 90 | return EqualityUtil.equals(h.getName(), getName()) 91 | && EqualityUtil.equals(h.getDomain(), getDomain()); 92 | } 93 | 94 | @Override 95 | public int hashCode() { 96 | int result = super.hashCode(); 97 | 98 | result = 27 * result + (getName() == null ? 0 : getName().hashCode()); 99 | result = 27 * result + (getDomain() == null ? 0 : getDomain().hashCode()); 100 | 101 | return result; 102 | } 103 | 104 | @Override 105 | public String toString() { 106 | StringBuilder str = new StringBuilder(); 107 | 108 | str.append("Host").append(System.lineSeparator()); 109 | str.append(super.toString()); 110 | str.append("Name: ").append(getName()).append(System.lineSeparator()); 111 | str.append("Domain: ").append(getDomain() == null ? "" : getDomain().getName()).append(System.lineSeparator()); 112 | 113 | return str.toString(); 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/persistence/entities/HostAttribute.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.persistence.entities; 2 | 3 | import com.sensepost.yeti.common.EqualityUtil; 4 | import javax.persistence.Column; 5 | import javax.persistence.Entity; 6 | import javax.persistence.Inheritance; 7 | import javax.persistence.InheritanceType; 8 | import javax.persistence.JoinColumn; 9 | import javax.persistence.ManyToOne; 10 | import javax.persistence.Table; 11 | 12 | /** 13 | * 14 | * @author Johan Snyman 15 | */ 16 | @Entity 17 | @Table(name = "host_attributes") 18 | @Inheritance(strategy = InheritanceType.SINGLE_TABLE) 19 | public class HostAttribute extends DatabaseEntity { 20 | 21 | @Column(name = "attr_key", nullable = false) 22 | private String key; 23 | 24 | @Column(name = "attr_value", nullable = false) 25 | private String value; 26 | 27 | @Column(name = "attr_type", length = 100, nullable = false, columnDefinition = "VARCHAR(255) DEFAULT 'info'") 28 | private String type; 29 | 30 | @ManyToOne 31 | @JoinColumn(name = "host_id", nullable = false) 32 | private Host host; 33 | 34 | public HostAttribute() { 35 | } 36 | 37 | public String getKey() { 38 | return key; 39 | } 40 | 41 | public void setKey(String key) { 42 | this.key = key; 43 | } 44 | 45 | public String getValue() { 46 | return value; 47 | } 48 | 49 | public void setValue(String value) { 50 | this.value = value; 51 | } 52 | 53 | public String getType() { 54 | return type; 55 | } 56 | 57 | public void setType(String type) { 58 | this.type = type; 59 | } 60 | 61 | public Host getHost() { 62 | return host; 63 | } 64 | 65 | public void setHost(Host host) { 66 | this.host = host; 67 | } 68 | 69 | @Override 70 | public boolean equals(Object obj) { 71 | if (this == obj) { 72 | return true; 73 | } 74 | if (!(obj instanceof HostAttribute)) { 75 | return false; 76 | } 77 | 78 | final HostAttribute ha = (HostAttribute) obj; 79 | 80 | return EqualityUtil.equals(ha.getKey(), getKey()) 81 | && EqualityUtil.equals(ha.getValue(), getValue()) 82 | && EqualityUtil.equals(ha.getType(), getType()) 83 | && EqualityUtil.equals(ha.getHost(), getHost()); 84 | } 85 | 86 | @Override 87 | public int hashCode() { 88 | int result = super.hashCode(); 89 | 90 | result = 27 * result + (getKey() == null ? 0 : getKey().hashCode()); 91 | result = 27 * result + (getValue() == null ? 0 : getValue().hashCode()); 92 | result = 27 * result + (getType() == null ? 0 : getType().hashCode()); 93 | result = 27 * result + (getHost() == null ? 0 : getHost().hashCode()); 94 | 95 | return result; 96 | } 97 | 98 | @Override 99 | public String toString() { 100 | StringBuilder str = new StringBuilder(); 101 | 102 | str.append("Host Attribute").append(System.lineSeparator()); 103 | str.append(super.toString()); 104 | str.append("Attribute Key: ").append(getKey()).append(System.lineSeparator()); 105 | str.append("Attribute Value: ").append(getValue()).append(System.lineSeparator()); 106 | str.append("Attribute Type: ").append(getType()).append(System.lineSeparator()); 107 | str.append("Host: ").append(getHost() == null ? "" : getHost().getName()).append(System.lineSeparator()); 108 | 109 | return str.toString(); 110 | } 111 | } -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/persistence/entities/InitialData.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.persistence.entities; 2 | 3 | import com.sensepost.yeti.common.EqualityUtil; 4 | import javax.persistence.Column; 5 | import javax.persistence.Entity; 6 | import javax.persistence.Inheritance; 7 | import javax.persistence.InheritanceType; 8 | import javax.persistence.JoinColumn; 9 | import javax.persistence.ManyToOne; 10 | import javax.persistence.Table; 11 | 12 | /** 13 | * 14 | * @author Johan Snyman 15 | */ 16 | @Entity 17 | @Table(name = "initial_data") 18 | @Inheritance(strategy = InheritanceType.SINGLE_TABLE) 19 | public class InitialData extends DatabaseEntity { 20 | 21 | public InitialData() { 22 | } 23 | 24 | @Column(name = "data_type", length = 100, nullable = false) 25 | private String type; 26 | 27 | @Column(name = "data_value", nullable = false) 28 | private String value; 29 | 30 | @ManyToOne 31 | @JoinColumn(name = "footprint_id") 32 | private Footprint footprint; 33 | 34 | public String getType() { 35 | return type; 36 | } 37 | 38 | public void setType(String type) { 39 | this.type = type; 40 | } 41 | 42 | public String getValue() { 43 | return value; 44 | } 45 | 46 | public void setValue(String value) { 47 | this.value = value; 48 | } 49 | 50 | public Footprint getFootprint() { 51 | return footprint; 52 | } 53 | 54 | public void setFootprint(Footprint footprint) { 55 | this.footprint = footprint; 56 | } 57 | 58 | @Override 59 | public boolean equals(Object obj) { 60 | if (this == obj) { 61 | return true; 62 | } 63 | if (!(obj instanceof DatabaseEntity)) { 64 | return false; 65 | } 66 | if (!super.equals(obj)) { 67 | return false; 68 | } 69 | 70 | final InitialData id = (InitialData) obj; 71 | return EqualityUtil.equals(id.getFootprint(), getFootprint()) 72 | && EqualityUtil.equals(id.getType(), getType()) 73 | && EqualityUtil.equals(id.getValue(), getValue()); 74 | } 75 | 76 | @Override 77 | public int hashCode() { 78 | int result = super.hashCode(); 79 | 80 | result = 27 * result + ((getType() == null) ? 0 : getType().hashCode()); 81 | result = 27 * result + ((getValue() == null) ? 0 : getValue().hashCode()); 82 | 83 | return result; 84 | } 85 | 86 | @Override 87 | public String toString() { 88 | StringBuilder str = new StringBuilder(); 89 | 90 | str.append("Initial Data:").append(System.lineSeparator()); 91 | str.append(super.toString()); 92 | str.append("Type: ").append(getType()).append(System.lineSeparator()); 93 | str.append("Value: ").append(getValue()).append(System.lineSeparator()); 94 | 95 | return str.toString(); 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/persistence/entities/IpAddress.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.persistence.entities; 2 | 3 | import com.sensepost.yeti.common.EqualityUtil; 4 | import java.util.List; 5 | import javax.persistence.CascadeType; 6 | import javax.persistence.Column; 7 | import javax.persistence.Entity; 8 | import javax.persistence.Inheritance; 9 | import javax.persistence.InheritanceType; 10 | import javax.persistence.JoinColumn; 11 | import javax.persistence.ManyToMany; 12 | import javax.persistence.ManyToOne; 13 | import javax.persistence.Table; 14 | 15 | /** 16 | * 17 | * @author Johan Snyman 18 | */ 19 | @Entity 20 | @Table(name = "ip_addresses") 21 | @Inheritance(strategy = InheritanceType.SINGLE_TABLE) 22 | public class IpAddress extends DatabaseEntity { 23 | 24 | @Column(name = "address", length = 15, nullable = false) 25 | private String address; 26 | 27 | @ManyToOne 28 | @JoinColumn(name = "footprint_id") 29 | private Footprint footprint; 30 | 31 | @ManyToMany( 32 | cascade = {CascadeType.PERSIST, CascadeType.MERGE}, 33 | mappedBy = "ipAddresses", 34 | targetEntity = Host.class 35 | ) 36 | private List hosts; 37 | 38 | public IpAddress() { 39 | } 40 | 41 | public String getAddress() { 42 | return address; 43 | } 44 | 45 | public void setAddress(String address) { 46 | this.address = address; 47 | } 48 | 49 | public Footprint getFootprint() { 50 | return footprint; 51 | } 52 | 53 | public void setFootprint(Footprint footprint) { 54 | this.footprint = footprint; 55 | } 56 | 57 | public List getHosts() { 58 | return hosts; 59 | } 60 | 61 | public void setHosts(List hosts) { 62 | this.hosts = hosts; 63 | } 64 | 65 | @Override 66 | public boolean equals(Object obj) { 67 | if (this == obj) { 68 | return true; 69 | } 70 | if (!(obj instanceof IpAddress)) { 71 | return false; 72 | } 73 | 74 | final IpAddress ia = (IpAddress) obj; 75 | 76 | return EqualityUtil.equals(ia.getAddress(), getAddress()) 77 | && EqualityUtil.equals(ia.getFootprint(), getFootprint()); 78 | } 79 | 80 | @Override 81 | public int hashCode() { 82 | int result = super.hashCode(); 83 | 84 | result = 27 * result + (getAddress() == null ? 0 : getAddress().hashCode()); 85 | result = 27 * result + (getFootprint() == null ? 0 : getFootprint().hashCode()); 86 | 87 | return result; 88 | } 89 | 90 | @Override 91 | public String toString() { 92 | StringBuilder str = new StringBuilder(); 93 | 94 | str.append("Ip Address").append(System.lineSeparator()); 95 | str.append(super.toString()); 96 | str.append("Address: ").append(getAddress()).append(System.lineSeparator()); 97 | str.append("Footprint: ").append(getFootprint() == null ? "" : getFootprint().getName()).append(System.lineSeparator()); 98 | 99 | return str.toString(); 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/persistence/entities/config/ConfigurationProperty.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.persistence.entities.config; 2 | 3 | import com.sensepost.yeti.persistence.entities.DatabaseEntity; 4 | import javax.persistence.Entity; 5 | import javax.persistence.Inheritance; 6 | import javax.persistence.InheritanceType; 7 | import javax.persistence.Table; 8 | 9 | /** 10 | * Generic configuration property to be stored in the database. 11 | * @author Johan Snyman 12 | */ 13 | @Entity 14 | @Table(name = "configuration_properties") 15 | @Inheritance(strategy = InheritanceType.SINGLE_TABLE) 16 | public class ConfigurationProperty extends DatabaseEntity { 17 | 18 | private String propertyName; 19 | private String propertyValue; 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/persistence/entities/config/ServerOption.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.persistence.entities.config; 2 | 3 | import com.sensepost.yeti.common.EqualityUtil; 4 | import com.sensepost.yeti.persistence.entities.DatabaseEntity; 5 | import javax.persistence.Column; 6 | import javax.persistence.Entity; 7 | import javax.persistence.Inheritance; 8 | import javax.persistence.InheritanceType; 9 | import javax.persistence.JoinColumn; 10 | import javax.persistence.ManyToOne; 11 | import javax.persistence.Table; 12 | 13 | 14 | /** 15 | * 16 | * @author Johan Snyman 17 | */ 18 | @Entity 19 | @Table(name = "server_options") 20 | @Inheritance(strategy = InheritanceType.SINGLE_TABLE) 21 | public class ServerOption extends DatabaseEntity { 22 | 23 | @Column(name = "option_name", nullable = false) 24 | private String optionName; 25 | 26 | @Column(name = "option_value", nullable = false) 27 | private String optionValue; 28 | 29 | @ManyToOne 30 | @JoinColumn(name = "server_id", nullable = false) 31 | private WhoisServer server; 32 | 33 | public String getOptionName() { 34 | return optionName; 35 | } 36 | 37 | public void setOptionName(String optionName) { 38 | this.optionName = optionName; 39 | } 40 | 41 | public String getOptionValue() { 42 | return optionValue; 43 | } 44 | 45 | public void setOptionValue(String optionValue) { 46 | this.optionValue = optionValue; 47 | } 48 | 49 | public WhoisServer getServer() { 50 | return server; 51 | } 52 | 53 | public void setServer(WhoisServer server) { 54 | this.server = server; 55 | } 56 | 57 | @Override 58 | public boolean equals(Object obj) { 59 | if (this == obj) { 60 | return true; 61 | } 62 | if (!(obj instanceof ServerOption)) { 63 | return false; 64 | } 65 | 66 | final ServerOption so = (ServerOption) obj; 67 | 68 | return EqualityUtil.equals(so.getOptionName(),getOptionName()) 69 | && EqualityUtil.equals(so.getOptionValue(), getOptionValue()) 70 | && EqualityUtil.equals(so.getServer(), getServer()); 71 | } 72 | 73 | @Override 74 | public int hashCode() { 75 | int result = super.hashCode(); 76 | 77 | result = 27 * result + (getOptionName() == null ? 0 : getOptionName().hashCode()); 78 | result = 27 * result + (getOptionValue() == null ? 0 : getOptionValue().hashCode()); 79 | result = 27 * result + (getServer() == null ? 0 : getServer().hashCode()); 80 | 81 | return result; 82 | } 83 | 84 | @Override 85 | public String toString() { 86 | StringBuilder str = new StringBuilder(); 87 | 88 | str.append("Server Option").append(System.lineSeparator()); 89 | str.append(super.toString()); 90 | str.append("Option name: ").append(getOptionName()).append(System.lineSeparator()); 91 | str.append("Option value: ").append(getOptionValue()).append(System.lineSeparator()); 92 | 93 | return str.toString(); 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/plugins/AttributePluginManager.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.plugins; 2 | 3 | import java.awt.event.ActionEvent; 4 | import java.io.FileNotFoundException; 5 | import java.util.logging.Level; 6 | import java.util.logging.Logger; 7 | 8 | import javax.script.ScriptException; 9 | import javax.swing.JMenuItem; 10 | 11 | /** 12 | * 13 | * @author willemmouton 14 | */ 15 | public class AttributePluginManager extends BasePluginManager { 16 | 17 | protected String args = null; 18 | 19 | public AttributePluginManager() { 20 | super(); 21 | this.setLocation("/attributePlugins"); 22 | } 23 | 24 | @Override 25 | public void pluginMenuEvent(ActionEvent evt) { 26 | if (evt.getSource().getClass() == JMenuItem.class) { 27 | try { 28 | String scriptName = (((JMenuItem) evt.getSource()).getName()); 29 | this.executeScript(scriptName); 30 | } catch (FileNotFoundException | ScriptException ex) { 31 | Logger.getLogger(AttributePluginManager.class.getName()).log(Level.SEVERE, null, ex); 32 | } 33 | } 34 | } 35 | 36 | public void setArgs(String value) { 37 | this.args = value; 38 | } 39 | 40 | public String getArgs() { 41 | return this.args; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/plugins/CollectorPluginManager.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.plugins; 2 | 3 | import java.awt.event.ActionEvent; 4 | 5 | /** 6 | * 7 | * @author willem 8 | */ 9 | public class CollectorPluginManager extends BasePluginManager { 10 | 11 | protected String args = null; 12 | 13 | public CollectorPluginManager() { 14 | super(); 15 | this.setLocation("/collectorPlugins"); 16 | } 17 | 18 | @Override 19 | public void pluginMenuEvent(ActionEvent evt) { 20 | 21 | } 22 | 23 | public void setArgs(String value) { 24 | this.args = value; 25 | } 26 | 27 | public String getArgs() { 28 | return this.args; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/plugins/ExportPluginManager.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.plugins; 2 | 3 | import java.awt.event.ActionEvent; 4 | import java.io.FileNotFoundException; 5 | import java.util.logging.Level; 6 | import java.util.logging.Logger; 7 | 8 | import javax.script.ScriptException; 9 | import javax.swing.JMenuItem; 10 | 11 | /** 12 | * 13 | * @author willemmouton 14 | */ 15 | public class ExportPluginManager extends BasePluginManager { 16 | 17 | protected String args = null; 18 | 19 | public ExportPluginManager() { 20 | super(); 21 | this.setLocation("/exportPlugins"); 22 | } 23 | 24 | @Override 25 | public void pluginMenuEvent(ActionEvent evt) { 26 | if (evt.getSource().getClass() == JMenuItem.class) { 27 | try { 28 | String scriptName = (((JMenuItem) evt.getSource()).getName()); 29 | this.executeScript(scriptName); 30 | } catch (FileNotFoundException | ScriptException ex) { 31 | Logger.getLogger(AttributePluginManager.class.getName()).log(Level.SEVERE, null, ex); 32 | } 33 | } 34 | } 35 | 36 | public void setArgs(String value) { 37 | this.args = value; 38 | } 39 | 40 | public String getArgs() { 41 | return this.args; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/plugins/ImportPluginManager.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.plugins; 2 | 3 | import java.awt.event.ActionEvent; 4 | import java.io.FileNotFoundException; 5 | import java.util.logging.Level; 6 | import java.util.logging.Logger; 7 | import javax.script.ScriptException; 8 | import javax.swing.JMenuItem; 9 | 10 | /** 11 | * 12 | * @author willemmouton 13 | */ 14 | public class ImportPluginManager extends BasePluginManager { 15 | 16 | protected String args = null; 17 | 18 | public ImportPluginManager() { 19 | super(); 20 | this.setLocation("/importPlugins"); 21 | } 22 | 23 | @Override 24 | public void pluginMenuEvent(ActionEvent evt) { 25 | if (evt.getSource().getClass() == JMenuItem.class) { 26 | try { 27 | String scriptName = (((JMenuItem) evt.getSource()).getName()); 28 | this.executeScript(scriptName); 29 | } catch (FileNotFoundException | ScriptException ex) { 30 | Logger.getLogger(AttributePluginManager.class.getName()).log(Level.SEVERE, null, ex); 31 | } 32 | } 33 | } 34 | 35 | public void setArgs(String value) { 36 | this.args = value; 37 | } 38 | 39 | public String getArgs() { 40 | return this.args; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/plugins/ReportPluginManager.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.plugins; 2 | 3 | import java.awt.event.ActionEvent; 4 | import java.io.FileNotFoundException; 5 | import java.util.logging.Level; 6 | import java.util.logging.Logger; 7 | import javax.script.ScriptException; 8 | import javax.swing.JMenuItem; 9 | 10 | public class ReportPluginManager extends BasePluginManager { 11 | 12 | public ReportPluginManager() { 13 | super(); 14 | this.setLocation("/reportPlugins"); 15 | } 16 | 17 | @Override 18 | public void pluginMenuEvent(ActionEvent evt) { 19 | if (evt.getSource().getClass() == JMenuItem.class) { 20 | try { 21 | String scriptName = (((JMenuItem) evt.getSource()).getName()); 22 | this.executeScript(scriptName); 23 | } catch (FileNotFoundException ex) { 24 | Logger.getLogger(ReportPluginManager.class.getName()).log(Level.SEVERE, null, ex); 25 | } catch (ScriptException ex) { 26 | Logger.getLogger(ReportPluginManager.class.getName()).log(Level.SEVERE, null, ex); 27 | } 28 | } 29 | 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/plugins/ScannerPluginManager.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.plugins; 2 | 3 | /** 4 | * 5 | * @author willemmouton 6 | */ 7 | public class ScannerPluginManager { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/plugins/UtilAPI.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.plugins; 2 | 3 | import java.io.BufferedReader; 4 | import java.io.IOException; 5 | import java.io.InputStreamReader; 6 | import java.net.URI; 7 | import java.net.URISyntaxException; 8 | import java.util.logging.Level; 9 | import java.util.logging.Logger; 10 | 11 | import javax.swing.JOptionPane; 12 | 13 | import com.sensepost.yeti.common.ConfigSettings; 14 | import com.sensepost.yeti.common.NetworkTools; 15 | import com.sensepost.yeti.common.UtilFunctions; 16 | import com.sensepost.yeti.helpers.ForwardLookupHelper; 17 | 18 | /** 19 | * 20 | * @author willemmouton 21 | */ 22 | public class UtilAPI { 23 | 24 | public String getRelativeName(String hostName) { 25 | return NetworkTools.getRelativeHostNameFromHost(hostName); 26 | } 27 | 28 | public String showInputBox(String text) { 29 | return JOptionPane.showInputDialog(null, text); 30 | } 31 | 32 | public String saveFileDialog(String extentions) { 33 | return UtilFunctions.saveFile(extentions); 34 | } 35 | 36 | public void launchBrowser(String url) { 37 | UtilFunctions.launchBrowser(url); 38 | } 39 | 40 | public void launchBrowser(String scheme, String host, String path, String payload) { 41 | try { 42 | URI uri = new URI(scheme, host, path, payload, null); 43 | this.launchBrowser(uri.toASCIIString()); 44 | } catch (URISyntaxException ex) { 45 | Logger.getLogger(UtilAPI.class.getName()).log(Level.SEVERE, null, ex); 46 | } 47 | } 48 | 49 | public String getConfigValue(String key) { 50 | String value = ConfigSettings.getPluginConfig("plugin." + key); 51 | if (value == null) { 52 | return ""; 53 | } 54 | return value; 55 | } 56 | 57 | public void setConfigValue(String key, String value) { 58 | ConfigSettings.setPluginConfig("plugin." + key, value); 59 | } 60 | 61 | public String getTempDir() { 62 | return System.getProperty("java.io.tmpdir"); 63 | } 64 | 65 | public String httpGETRequest(String request) { 66 | return NetworkTools.getHTMLFromUrl(request); 67 | } 68 | 69 | public String execCmd(String cmd) { 70 | StringBuilder output = new StringBuilder(); 71 | 72 | Process p; 73 | try { 74 | p = Runtime.getRuntime().exec(cmd); 75 | p.waitFor(); 76 | BufferedReader reader 77 | = new BufferedReader(new InputStreamReader(p.getInputStream())); 78 | 79 | String line; 80 | while ((line = reader.readLine()) != null) { 81 | output.append(line).append(System.lineSeparator()); 82 | } 83 | } catch (IOException | InterruptedException e) { 84 | Logger.getLogger(ForwardLookupHelper.class.getName()).log(Level.SEVERE, null, e); 85 | } 86 | 87 | return output.toString(); 88 | } 89 | 90 | public String getDomainFromHostname(String hostname) { 91 | return NetworkTools.getDomainFromHost(hostname); 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/resources/Cancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/resources/Cancel.png -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/resources/YetiAboutBox.properties: -------------------------------------------------------------------------------- 1 | title = About: ${Application.title} ${Application.version} 2 | 3 | closeAboutBox.Action.text = &Close 4 | 5 | appDescLabel.text=${Application.description} 6 | 7 | versionLabel.text=Product Version\: 8 | 9 | vendorLabel.text=Vendor\: 10 | 11 | homepageLabel.text=Homepage\: 12 | #NOI18N 13 | imageLabel.icon=yeti7.png 14 | #NOI18N 15 | imageLabel.background=255, 255, 255 16 | #NOI18N 17 | aboutBox.background=255, 255, 255 18 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/resources/YetiApp.properties: -------------------------------------------------------------------------------- 1 | # Application global resources 2 | 3 | Application.name = Yeti 4 | Application.title = Sensepost - Network Footprinting Tool 5 | Application.version = 0.0.6a 6 | Application.vendor = Sensepost 7 | Application.homepage = http://www.sensepost.com 8 | Application.description = 9 | Application.vendorId = Sensepost 10 | Application.id = Yeti 11 | #NOI18N 12 | Application.lookAndFeel=com.jgoodies.looks.plastic.PlasticXPLookAndFeel 13 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/resources/YetiView.properties: -------------------------------------------------------------------------------- 1 | 2 | # @Action resources 3 | 4 | showAboutBox.Action.text = &About... 5 | showAboutBox.Action.shortDescription = Show the application's information dialog 6 | 7 | # status bar resources 8 | 9 | StatusBar.messageTimeout = 5000 10 | StatusBar.busyAnimationRate = 30 11 | StatusBar.idleIcon = busyicons/idle-icon.png 12 | StatusBar.busyIcons[0] = busyicons/busy-icon0.png 13 | StatusBar.busyIcons[1] = busyicons/busy-icon1.png 14 | StatusBar.busyIcons[2] = busyicons/busy-icon2.png 15 | StatusBar.busyIcons[3] = busyicons/busy-icon3.png 16 | StatusBar.busyIcons[4] = busyicons/busy-icon4.png 17 | StatusBar.busyIcons[5] = busyicons/busy-icon5.png 18 | StatusBar.busyIcons[6] = busyicons/busy-icon6.png 19 | StatusBar.busyIcons[7] = busyicons/busy-icon7.png 20 | StatusBar.busyIcons[8] = busyicons/busy-icon8.png 21 | StatusBar.busyIcons[9] = busyicons/busy-icon9.png 22 | StatusBar.busyIcons[10] = busyicons/busy-icon10.png 23 | StatusBar.busyIcons[11] = busyicons/busy-icon11.png 24 | StatusBar.busyIcons[12] = busyicons/busy-icon12.png 25 | StatusBar.busyIcons[13] = busyicons/busy-icon13.png 26 | StatusBar.busyIcons[14] = busyicons/busy-icon14.png 27 | jTable1.columnModel.title1=Title 2 28 | jPanel10.border.title=Root terms 29 | tblScriptResults.columnModel.title4=Site 30 | tblCertResults.columnModel.title3=Title 4 31 | tblCertResults.columnModel.title2=Title 3 32 | jTable2.columnModel.title2=Title 3 33 | jTable2.columnModel.title1=Title 2 34 | jTable2.columnModel.title0=Title 1 35 | jTable2.columnModel.title3=Title 4 36 | jMenuItem2.text=Whois 37 | #NOI18N 38 | btnSetFootprint.font=Lucida Grande-Bold-11 39 | miDebug.text=View debug window 40 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/resources/about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/resources/about.png -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/resources/attr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/resources/attr.png -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/resources/attr_config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/resources/attr_config.png -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/resources/brick_link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/resources/brick_link.png -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/resources/bullet_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/resources/bullet_blue.png -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/resources/busyicons/busy-icon0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/resources/busyicons/busy-icon0.png -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/resources/busyicons/busy-icon1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/resources/busyicons/busy-icon1.png -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/resources/busyicons/busy-icon10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/resources/busyicons/busy-icon10.png -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/resources/busyicons/busy-icon11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/resources/busyicons/busy-icon11.png -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/resources/busyicons/busy-icon12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/resources/busyicons/busy-icon12.png -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/resources/busyicons/busy-icon13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/resources/busyicons/busy-icon13.png -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/resources/busyicons/busy-icon14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/resources/busyicons/busy-icon14.png -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/resources/busyicons/busy-icon2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/resources/busyicons/busy-icon2.png -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/resources/busyicons/busy-icon3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/resources/busyicons/busy-icon3.png -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/resources/busyicons/busy-icon4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/resources/busyicons/busy-icon4.png -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/resources/busyicons/busy-icon5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/resources/busyicons/busy-icon5.png -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/resources/busyicons/busy-icon6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/resources/busyicons/busy-icon6.png -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/resources/busyicons/busy-icon7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/resources/busyicons/busy-icon7.png -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/resources/busyicons/busy-icon8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/resources/busyicons/busy-icon8.png -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/resources/busyicons/busy-icon9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/resources/busyicons/busy-icon9.png -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/resources/busyicons/idle-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/resources/busyicons/idle-icon.png -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/resources/computer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/resources/computer.png -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/resources/computer_link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/resources/computer_link.png -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/resources/connect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/resources/connect.png -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/resources/flag_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/resources/flag_blue.png -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/resources/flag_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/resources/flag_green.png -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/resources/flag_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/resources/flag_red.png -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/resources/magnifier.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/resources/magnifier.png -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/resources/network.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/resources/network.png -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/resources/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/resources/screenshot.png -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/resources/server.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/resources/server.png -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/resources/server_compressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/resources/server_compressed.png -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/resources/server_link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/resources/server_link.png -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/resources/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/resources/splash.png -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/resources/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/resources/star.png -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/resources/vuln.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/resources/vuln.png -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/resources/yeti7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/java/com/sensepost/yeti/resources/yeti7.png -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/results/ARecordResult.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.results; 2 | 3 | /** 4 | * 5 | * @author willem 6 | */ 7 | public class ARecordResult extends ForwardLookupResult { 8 | 9 | public ARecordResult(String domainName) { 10 | super(domainName); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/results/CertResult.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.results; 2 | 3 | /** 4 | * 5 | * @author willemm 6 | */ 7 | public class CertResult extends Object { 8 | 9 | private String ipAddress = null; 10 | private String hostName = null; 11 | private String domainName = null; 12 | private boolean keep = true; 13 | 14 | public CertResult(String ipAddress) { 15 | this.ipAddress = ipAddress; 16 | } 17 | 18 | public void setIpAddress(String ipAddress) { 19 | this.ipAddress = ipAddress.replace("\\", ""); 20 | } 21 | 22 | public void setHostName(String commonName) { 23 | this.hostName = commonName.toLowerCase(); 24 | } 25 | 26 | public String getIpAddress() { 27 | return ipAddress; 28 | } 29 | 30 | public String getHostName() { 31 | return hostName; 32 | } 33 | 34 | public void setKeep(boolean value) { 35 | keep = value; 36 | } 37 | 38 | public boolean getKeep() { 39 | return keep; 40 | } 41 | 42 | public String getDomainName() { 43 | return domainName; 44 | } 45 | 46 | public void setDomainName(String domainName) { 47 | this.domainName = domainName.toLowerCase(); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/results/CollectorResult.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.results; 2 | 3 | /** 4 | * 5 | * @author willem 6 | */ 7 | public class CollectorResult { 8 | 9 | private String domainName = ""; 10 | private String hostName = ""; 11 | private String ipAddress = ""; 12 | private String extraData = ""; 13 | private String type = ""; 14 | private boolean keep = true; 15 | 16 | public CollectorResult() { 17 | 18 | } 19 | 20 | public void setDomainName(String domainName) { 21 | this.domainName = domainName; 22 | } 23 | 24 | public void setHostName(String hostName) { 25 | this.hostName = hostName; 26 | } 27 | 28 | public void setIpAddress(String ipAddress) { 29 | this.ipAddress = ipAddress; 30 | } 31 | 32 | public void setExtraData(String extraData) { 33 | this.extraData = extraData; 34 | } 35 | 36 | public void setKeep(boolean keep) { 37 | this.keep = keep; 38 | } 39 | 40 | public void setType(String type) { 41 | this.type = type; 42 | } 43 | 44 | public String getDomainName() { 45 | return this.domainName; 46 | } 47 | 48 | public String getHostName() { 49 | return this.hostName; 50 | } 51 | 52 | public String getIpAddress() { 53 | return this.ipAddress; 54 | } 55 | 56 | public String getExtraData() { 57 | return this.extraData; 58 | } 59 | 60 | public boolean getKeep() { 61 | return this.keep; 62 | } 63 | 64 | public String getType() { 65 | return this.type; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/results/DomainEntry.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.results; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | public class DomainEntry { 7 | 8 | private String domainName = ""; 9 | private final ArrayList nameServers = new ArrayList<>(); 10 | private final ArrayList mailServers = new ArrayList<>(); 11 | private final ArrayList attributes = new ArrayList<>(); 12 | private String whoisResult = null; 13 | private String nameServer = null; 14 | private String admin = null; 15 | 16 | public DomainEntry(String domainName) { 17 | this.domainName = domainName; 18 | } 19 | 20 | public String getDomainName() { 21 | return domainName; 22 | } 23 | 24 | public void setNameServers(List nameServers) { 25 | if (nameServers != null) { 26 | nameServers.addAll(nameServers); 27 | } 28 | } 29 | 30 | public void addNameServer(String nameServer) { 31 | if (nameServer != null) { 32 | nameServers.add(nameServer); 33 | } 34 | } 35 | 36 | public String getFirstNameServer() { 37 | if (nameServers.size() == 1) { 38 | return nameServers.get(0); 39 | } else if (nameServers.size() > 1) { 40 | String result = String.format("%s, (%d) more", nameServers.get(0), nameServers.size() - 1); 41 | return result; 42 | } 43 | return ""; 44 | } 45 | 46 | public String getFirstMailSever() { 47 | if (mailServers.size() == 1) { 48 | return mailServers.get(0); 49 | } 50 | if (mailServers.size() > 1) { 51 | String result = String.format("%s, (%d) more", mailServers.get(0), mailServers.size() - 1); 52 | return result; 53 | } 54 | return ""; 55 | } 56 | 57 | public String getNS() { 58 | return nameServer; 59 | } 60 | 61 | public String getAdmin() { 62 | return admin; 63 | } 64 | 65 | public void setNS(String ns) { 66 | nameServer = ns; 67 | } 68 | 69 | public void setAdmin(String admin) { 70 | this.admin = admin; 71 | } 72 | 73 | public void setMailServers(List ms) { 74 | if (ms != null) { 75 | mailServers.addAll(ms); 76 | } 77 | } 78 | 79 | public void addMailServer(String mailServer) { 80 | mailServers.add(mailServer); 81 | } 82 | 83 | public void addAttributes(List attributes) { 84 | if (attributes != null) { 85 | this.attributes.addAll(attributes); 86 | } 87 | } 88 | 89 | public int getAttributeCount() { 90 | int count = attributes.size() + mailServers.size() + nameServers.size(); 91 | if (admin != null && ! admin.isEmpty()) { 92 | count++; 93 | } 94 | if (nameServer != null && !nameServer.isEmpty()) { 95 | count++; 96 | } 97 | return count; 98 | } 99 | 100 | public String getWhoisResult() { 101 | return whoisResult; 102 | } 103 | 104 | public void setWhoisResult(String value) { 105 | whoisResult = value; 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/results/DomainResult.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.results; 2 | 3 | import java.util.Map; 4 | 5 | /** 6 | * 7 | * @author willemm 8 | */ 9 | public class DomainResult { 10 | 11 | private String domainName = ""; 12 | private String adminName = ""; 13 | private String nameServer = ""; 14 | private String registrant = ""; 15 | private boolean keep = false; 16 | private Map attributes; 17 | 18 | public DomainResult(String domainName) { 19 | this.domainName = domainName; 20 | } 21 | 22 | public String getDomainName() { 23 | return domainName; 24 | } 25 | 26 | public String getAdminName() { 27 | return adminName; 28 | } 29 | 30 | public String getNameServer() { 31 | return nameServer; 32 | } 33 | 34 | public String getRegistrant() { 35 | return registrant; 36 | } 37 | 38 | public void setDomainName(String domainName) { 39 | this.domainName = domainName; 40 | } 41 | 42 | public void setAdminName(String adminName) { 43 | this.adminName = adminName; 44 | } 45 | 46 | public void setNameServer(String nameServer) { 47 | this.nameServer = nameServer; 48 | } 49 | 50 | public void setRegistrant(String registrant) { 51 | this.registrant = registrant; 52 | } 53 | 54 | public void setKeep(boolean value) { 55 | keep = value; 56 | } 57 | 58 | public boolean getKeep() { 59 | return keep; 60 | } 61 | 62 | public Map getAttributes() { 63 | return attributes; 64 | } 65 | 66 | public void setAttributes(Map attributes) { 67 | this.attributes = attributes; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/results/FootprintData.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.results; 2 | 3 | public class FootprintData { 4 | 5 | private int id = -1; 6 | private String name = ""; 7 | private String created = ""; 8 | 9 | public FootprintData() { 10 | } 11 | 12 | public FootprintData(String name) { 13 | this.name = name; 14 | } 15 | 16 | public FootprintData(int id, String name, String created) { 17 | this.id = id; 18 | this.name = name; 19 | this.created = created; 20 | } 21 | 22 | public String getName() { 23 | return this.name; 24 | } 25 | 26 | public int getId() { 27 | return this.id; 28 | } 29 | 30 | public String getCreated() { 31 | return this.created; 32 | } 33 | 34 | public void setId(int value) { 35 | this.id = value; 36 | } 37 | 38 | public void setName(String value) { 39 | this.name = value; 40 | } 41 | 42 | public void setCreated(String value) { 43 | this.created = value; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/results/ForwardLookupResult.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.results; 2 | 3 | import com.sensepost.yeti.dns.DNS; 4 | import java.util.HashMap; 5 | import java.util.Map; 6 | 7 | /** 8 | * 9 | * @author willemm 10 | */ 11 | public class ForwardLookupResult extends Object { 12 | 13 | private final DomainResult domainResult; 14 | private String lookupType = ""; 15 | private String hostName = ""; 16 | private String ipAddress = ""; 17 | private boolean keep = true; 18 | private Map attributes = new HashMap<>(); 19 | 20 | public ForwardLookupResult(String domainName) { 21 | domainResult = DNS.getSOARecord(domainName); 22 | } 23 | 24 | public String getDomainName() { 25 | if (domainResult != null) { 26 | return domainResult.getDomainName(); 27 | } 28 | return ""; 29 | } 30 | 31 | 32 | public String getHostName() { 33 | return this.hostName; 34 | } 35 | 36 | public String getLookupType() { 37 | return this.lookupType; 38 | } 39 | 40 | public String getIpAddress() { 41 | return this.ipAddress; 42 | } 43 | 44 | public void setHostName(String hostName) { 45 | this.hostName = hostName; 46 | } 47 | 48 | public void setLookupType(String lookupType) { 49 | this.lookupType = lookupType; 50 | } 51 | 52 | public void setIpAddress(String ipAddress) { 53 | this.ipAddress = ipAddress.replace("/", ""); 54 | } 55 | 56 | public void setKeep(boolean value) { 57 | this.keep = value; 58 | } 59 | 60 | public boolean getKeep() { 61 | return this.keep; 62 | } 63 | 64 | public Map getAttributes() { 65 | return attributes; 66 | } 67 | 68 | public void setAttributes(Map attributes) { 69 | this.attributes = attributes; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/results/HostEntry.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.results; 2 | 3 | import java.util.ArrayList; 4 | 5 | /** 6 | * 7 | * @author willemmouton 8 | */ 9 | public class HostEntry { 10 | 11 | private String hostName = ""; 12 | private String domainName = ""; 13 | private int hostId = -1; 14 | private final ArrayList ips = new ArrayList(); 15 | 16 | public HostEntry(String hostName) { 17 | this.hostName = hostName; 18 | } 19 | 20 | public HostEntry(int hostId) { 21 | this.hostId = hostId; 22 | } 23 | 24 | public void setHostName(String value) { 25 | hostName = value; 26 | } 27 | 28 | public String getHostName() { 29 | return hostName; 30 | } 31 | 32 | public void setHostId(int value) { 33 | hostId = value; 34 | } 35 | 36 | public int getHostId() { 37 | return hostId; 38 | } 39 | 40 | public String getDomainName() { 41 | return domainName; 42 | } 43 | 44 | public void setDomainName(String value) { 45 | domainName = value; 46 | } 47 | 48 | public void addIps(ArrayList ips) { 49 | this.ips.addAll(ips); 50 | } 51 | 52 | @SuppressWarnings("rawtypes") 53 | public ArrayList getIps() { 54 | return ips; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/results/IpEntry.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.results; 2 | 3 | /** 4 | * 5 | * @author willemmouton 6 | */ 7 | public class IpEntry { 8 | 9 | private int ipId = -1; 10 | private String ipAddress = ""; 11 | private String country = ""; 12 | 13 | public IpEntry(String ip) { 14 | this.ipAddress = ip; 15 | } 16 | 17 | public IpEntry(int ipId) { 18 | this.ipId = ipId; 19 | } 20 | 21 | public String getIp() { 22 | return this.ipAddress; 23 | } 24 | 25 | public void setIp(String value) { 26 | this.ipAddress = value; 27 | } 28 | 29 | public int getId() { 30 | return this.ipId; 31 | } 32 | 33 | public void setId(int value) { 34 | this.ipId = value; 35 | } 36 | 37 | public void setCountry(String value) { 38 | this.country = value; 39 | } 40 | 41 | public String getCountry() { 42 | return this.country; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/results/KeyValue.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.results; 2 | 3 | public class KeyValue { 4 | 5 | private Object key = null; 6 | private Object value = null; 7 | 8 | public KeyValue(Object key, Object value) { 9 | this.key = key; 10 | this.value = value; 11 | } 12 | 13 | public Object getKey() { 14 | return key; 15 | } 16 | 17 | public Object getValue() { 18 | return value; 19 | } 20 | 21 | public String getStrKey() { 22 | return key.toString(); 23 | } 24 | 25 | public String getStrValue() { 26 | return value.toString(); 27 | } 28 | 29 | @Override 30 | public String toString() { 31 | StringBuilder sb = new StringBuilder(); 32 | if (value != null && !value.toString().isEmpty()) { 33 | sb.append(value.toString().trim()); 34 | if (key != null && !key.toString().isEmpty()) { 35 | sb.append(" - "); 36 | } 37 | } 38 | 39 | if (key != null && !key.toString().isEmpty()) { 40 | sb.append(key.toString().trim()); 41 | } 42 | 43 | return sb.toString(); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/results/PTRRecordResult.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.results; 2 | 3 | /** 4 | * 5 | * @author willem 6 | */ 7 | public class PTRRecordResult extends ReverseLookupResult { 8 | 9 | public PTRRecordResult(String ip) { 10 | super(ip); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/results/Port.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.results; 2 | 3 | public class Port { 4 | 5 | private int portNumber = -1; 6 | private String state = "unknown"; 7 | private String name = ""; 8 | private String version = ""; 9 | private String extraInfo = ""; 10 | 11 | public Port(int portNumber) { 12 | this.portNumber = portNumber; 13 | } 14 | 15 | public int getPortNumber() { 16 | return portNumber; 17 | } 18 | 19 | public void setPortNumber(int portNumber) { 20 | this.portNumber = portNumber; 21 | } 22 | 23 | public String getState() { 24 | return state; 25 | } 26 | 27 | public void setState(String state) { 28 | this.state = state; 29 | } 30 | 31 | public String getName() { 32 | return name; 33 | } 34 | 35 | public void setName(String name) { 36 | this.name = name; 37 | } 38 | 39 | public String getVersion() { 40 | return version; 41 | } 42 | 43 | public void setVersion(String version) { 44 | this.version = version; 45 | } 46 | 47 | public String getExtraInfo() { 48 | return extraInfo; 49 | } 50 | 51 | public void setExtraInfo(String extraInfo) { 52 | this.extraInfo = extraInfo; 53 | } 54 | 55 | @Override 56 | public String toString() { 57 | String buff = String.format("%d : %s %s %s %s", portNumber, state, name, version, extraInfo).trim(); 58 | return buff; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/results/ReverseLookupResult.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.results; 2 | 3 | /** 4 | * 5 | * @author willemmouton 6 | */ 7 | public class ReverseLookupResult extends Object { 8 | 9 | private String ipAddress = ""; 10 | private String hostName = ""; 11 | private String domainName = ""; 12 | private boolean keep = false; 13 | 14 | public ReverseLookupResult(String ip) { 15 | ipAddress = ip; 16 | } 17 | 18 | public void setHostName(String hostName) { 19 | this.hostName = hostName; 20 | } 21 | 22 | public void setIpAddress(String ipAddress) { 23 | this.ipAddress = ipAddress; 24 | } 25 | 26 | public String getHostName() { 27 | return hostName; 28 | } 29 | 30 | public String getIpAddress() { 31 | return ipAddress; 32 | } 33 | 34 | public void setDomainName(String value) { 35 | domainName = value; 36 | } 37 | 38 | public String getDomainName() { 39 | return domainName; 40 | } 41 | 42 | public void setKeep(boolean value) { 43 | keep = value; 44 | } 45 | 46 | public boolean getKeep() { 47 | return keep; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/results/SOARecordResult.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.results; 2 | 3 | /** 4 | * 5 | * @author willem 6 | */ 7 | public class SOARecordResult extends DomainResult { 8 | 9 | public SOARecordResult(String domainName) { 10 | super(domainName); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/results/YileResult.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.results; 2 | 3 | public class YileResult extends Object { 4 | 5 | private String source = ""; 6 | private String hostName = ""; 7 | private String domain = ""; 8 | private String registrant = ""; 9 | private boolean keep = false; 10 | private String ipaddress = ""; 11 | private String url = ""; 12 | 13 | public YileResult(String domainName) { 14 | this.domain = domainName; 15 | } 16 | 17 | public String getDomainName() { 18 | return this.domain; 19 | } 20 | 21 | public String getHostName() { 22 | return this.hostName; 23 | } 24 | 25 | public String getSource() { 26 | return this.source; 27 | } 28 | 29 | public String getRegistrant() { 30 | return this.registrant; 31 | } 32 | 33 | public String getIPAddress() { 34 | return this.ipaddress; 35 | } 36 | 37 | public void setDomainName(String domainName) { 38 | this.domain = domainName; 39 | } 40 | 41 | public void setHostName(String hostName) { 42 | this.hostName = hostName; 43 | } 44 | 45 | public void setSource(String source) { 46 | this.source = source; 47 | } 48 | 49 | public void setRegistrant(String registrant) { 50 | this.registrant = registrant; 51 | } 52 | 53 | public void setKeep(boolean value) { 54 | this.keep = value; 55 | } 56 | 57 | public void setIPAddress(String ipAddress) { 58 | this.ipaddress = ipAddress; 59 | } 60 | 61 | public boolean getKeep() { 62 | return this.keep; 63 | } 64 | 65 | public void setUrl(String value) { 66 | this.url = value; 67 | } 68 | 69 | public String getUrl() { 70 | return this.url; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/spider/HTMLParse.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.spider; 2 | 3 | import javax.swing.text.html.*; 4 | 5 | public class HTMLParse extends HTMLEditorKit { 6 | 7 | public HTMLEditorKit.Parser getParser() { 8 | return super.getParser(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/spider/UrlProcessor.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.spider; 2 | 3 | import java.net.URL; 4 | 5 | public interface UrlProcessor { 6 | 7 | void addHostFromUrl(String url, String baseUrl); 8 | 9 | void handleUrlError(URL url, String baseUrl); 10 | 11 | void addEmailAddress(String emailAddress); 12 | 13 | void onDebug(String message); 14 | 15 | void onError(String errorMessage); 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/treeview/Attribute.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.treeview; 2 | 3 | /** 4 | * 5 | * @author willemmouton 6 | */ 7 | public class Attribute { 8 | 9 | @Override 10 | public String toString() { 11 | return "Atributes"; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/treeview/AttributeValue.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.treeview; 2 | 3 | public class AttributeValue { 4 | 5 | private String key = ""; 6 | private String value = ""; 7 | private String type = "info"; 8 | 9 | public AttributeValue(String key, String value) { 10 | this.key = key; 11 | this.value = value; 12 | } 13 | 14 | public AttributeValue(String key, String value, String type) { 15 | this.key = key; 16 | this.value = value; 17 | this.type = type; 18 | } 19 | 20 | public String getKey() { 21 | return key; 22 | } 23 | 24 | public void setKey(String key) { 25 | this.key = key; 26 | } 27 | 28 | public String getValue() { 29 | return value; 30 | } 31 | 32 | public void setValue(String value) { 33 | this.value = value; 34 | } 35 | 36 | public void setType(String type) { 37 | this.type = value; 38 | } 39 | 40 | public String getType() { 41 | return this.type; 42 | } 43 | 44 | @Override 45 | public String toString() { 46 | return String.format("%s - (%s)", this.value, this.key); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/treeview/Domain.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.treeview; 2 | 3 | /** 4 | * 5 | * @author willemmouton 6 | */ 7 | public class Domain { 8 | 9 | private String value = ""; 10 | 11 | public Domain(String value) { 12 | this.value = value; 13 | } 14 | 15 | public String getValue() { 16 | return value; 17 | } 18 | 19 | public void setValue(String value) { 20 | this.value = value; 21 | } 22 | 23 | @Override 24 | public String toString() { 25 | return value; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/treeview/Host.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.treeview; 2 | 3 | /** 4 | * 5 | * @author willemmouton 6 | */ 7 | public class Host { 8 | 9 | private String value = ""; 10 | 11 | public Host(String value) { 12 | this.value = value; 13 | } 14 | 15 | public String getValue() { 16 | return value; 17 | } 18 | 19 | public void setValue(String value) { 20 | this.value = value; 21 | } 22 | 23 | @Override 24 | public String toString() { 25 | return value; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/treeview/Hosts.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.treeview; 2 | 3 | /** 4 | * 5 | * @author willemmouton 6 | */ 7 | public class Hosts { 8 | 9 | @Override 10 | public String toString() { 11 | return "Hosts"; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/treeview/Ip.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.treeview; 2 | 3 | public class Ip { 4 | 5 | private String value = ""; 6 | 7 | public Ip(String value) { 8 | this.value = value; 9 | } 10 | 11 | public String getValue() { 12 | return value; 13 | } 14 | 15 | public void setValue(String value) { 16 | this.value = value; 17 | } 18 | 19 | @Override 20 | public String toString() { 21 | return value; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/treeview/Ips.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.treeview; 2 | 3 | /** 4 | * 5 | * @author willemmouton 6 | */ 7 | public class Ips { 8 | 9 | @Override 10 | public String toString() { 11 | return "IP addresses"; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/treeview/Network.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.treeview; 2 | 3 | /** 4 | * 5 | * @author willemmouton 6 | */ 7 | public class Network { 8 | 9 | String value = ""; 10 | 11 | public Network(String value) { 12 | this.value = value; 13 | } 14 | 15 | public String getValue() { 16 | return value; 17 | } 18 | 19 | public void setValue(String value) { 20 | this.value = value; 21 | } 22 | 23 | @Override 24 | public String toString() { 25 | return this.value; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/sensepost/yeti/treeview/Ports.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti.treeview; 2 | 3 | public class Ports { 4 | 5 | @Override 6 | public String toString() { 7 | return "Ports"; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/main/resources/bruteforcedata/aaastandard.txt: -------------------------------------------------------------------------------- 1 | www 2 | ftp 3 | ns 4 | mail 5 | 3com 6 | aix 7 | av 8 | apache 9 | back 10 | bastion 11 | bind 12 | border 13 | bsd 14 | business 15 | cast 16 | chains 17 | cisco 18 | content 19 | commerce 20 | corporate 21 | cvp 22 | debian 23 | dns 24 | domino 25 | dominoserver 26 | download 27 | dump 28 | e-bus 29 | e-business 30 | e-commerce 31 | e-mail 32 | e-safe 33 | ecommerce 34 | email 35 | esafe 36 | external 37 | extranet 38 | firebox 39 | firewall 40 | freebsd 41 | front 42 | fw 43 | fwe 44 | fwi 45 | gate 46 | gatekeeper 47 | gateway 48 | gauntlet 49 | group 50 | help 51 | hop 52 | hp 53 | hp-ux 54 | hpjet 55 | hpux 56 | http 57 | https 58 | hub 59 | ibm 60 | ids 61 | ips 62 | inet 63 | info 64 | inside 65 | internal 66 | internet 67 | intranet 68 | ipchains 69 | ipfw 70 | irix 71 | jet 72 | list 73 | lotus 74 | lotusdomino 75 | lotusnotes 76 | lotusserver 77 | mailer 78 | mailfeed 79 | mailgate 80 | mailgateway 81 | mailgroup 82 | mailhost 83 | maillist 84 | mailmarshall 85 | mailpop 86 | mailspool 87 | mailrelay 88 | mandrake 89 | mimesweeper 90 | ms 91 | msproxy 92 | mx 93 | nameserver 94 | net 95 | news 96 | newsdesk 97 | newsfeed 98 | newsgroup 99 | newsroom 100 | newsserver 101 | nntp 102 | notes 103 | notebook 104 | noteserver 105 | norton 106 | notesserver 107 | nt 108 | openbsd 109 | outside 110 | pix 111 | pop 112 | pop3 113 | pophost 114 | popmail 115 | popserver 116 | print 117 | printer 118 | printspool 119 | private 120 | proxy 121 | proxyserver 122 | public 123 | qpop 124 | raptor 125 | read 126 | redcreek 127 | redhat 128 | route 129 | router 130 | router 131 | scanner 132 | screen 133 | screening 134 | secure 135 | seek 136 | shoutcast 137 | slackware 138 | smail 139 | smap 140 | smtp 141 | smtpgateway 142 | smtpgw 143 | sniffer 144 | snort 145 | solaris 146 | sonic 147 | spool 148 | spooler 149 | squid 150 | sun 151 | sunos 152 | suse 153 | switch 154 | tip 155 | tipping 156 | tippingpoint 157 | transfer 158 | trend 159 | trendmicro 160 | unseen 161 | upload 162 | vlan 163 | wall 164 | web 165 | webmail 166 | webserver 167 | webservice 168 | webserv 169 | webswitch 170 | win2000 171 | win2k 172 | win2k3 173 | win31 174 | win95 175 | win98 176 | winnt 177 | winxp 178 | write 179 | ww 180 | wwwa 181 | wwa 182 | xfer 183 | siteadmin 184 | -------------------------------------------------------------------------------- /src/main/resources/bruteforcedata/asterix.txt: -------------------------------------------------------------------------------- 1 | asterix 2 | obelix 3 | getafix 4 | dogmatix 5 | vitalstatistix 6 | cacofonix 7 | fulliautomatix 8 | unhygenix 9 | geriatrix 10 | impedimenta 11 | bacteria 12 | panacea 13 | bravura 14 | orinjade 15 | latraviata 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/main/resources/bruteforcedata/ccs.txt: -------------------------------------------------------------------------------- 1 | us 2 | uk 3 | de 4 | fr 5 | fo 6 | uy 7 | uz 8 | va 9 | vc 10 | ga 11 | gb 12 | ve 13 | gd 14 | vg 15 | ge 16 | gf 17 | vi 18 | gg 19 | gh 20 | gi 21 | gl 22 | vn 23 | gm 24 | gn 25 | gp 26 | gq 27 | gr 28 | gs 29 | vu 30 | gt 31 | gu 32 | gw 33 | gy 34 | gz 35 | wf 36 | hk 37 | hm 38 | hn 39 | ws 40 | hr 41 | ht 42 | ie 43 | il 44 | im 45 | in 46 | io 47 | iq 48 | ir 49 | is 50 | it 51 | net 52 | ye 53 | je 54 | org 55 | jm 56 | jo 57 | jp 58 | yt 59 | yu 60 | mil 61 | za 62 | ke 63 | kg 64 | kh 65 | ki 66 | zm 67 | km 68 | kn 69 | kp 70 | zr 71 | kr 72 | zw 73 | kw 74 | ky 75 | kz 76 | la 77 | lb 78 | lc 79 | li 80 | lk 81 | lr 82 | ls 83 | lt 84 | lu 85 | lv 86 | edu 87 | ly 88 | ma 89 | mc 90 | md 91 | mg 92 | mh 93 | mk 94 | ml 95 | mm 96 | mn 97 | mo 98 | mp 99 | mq 100 | mr 101 | ms 102 | mt 103 | mu 104 | mv 105 | mw 106 | mx 107 | my 108 | mz 109 | na 110 | nc 111 | ne 112 | nf 113 | ng 114 | ni 115 | nl 116 | no 117 | np 118 | gov 119 | nr 120 | nu 121 | nz 122 | om 123 | pa 124 | ac 125 | pe 126 | ad 127 | pf 128 | pg 129 | ae 130 | af 131 | ph 132 | ag 133 | ai 134 | pk 135 | pl 136 | pm 137 | al 138 | pn 139 | am 140 | an 141 | ao 142 | aq 143 | pr 144 | ar 145 | as 146 | pt 147 | at 148 | au 149 | pw 150 | aw 151 | py 152 | az 153 | qa 154 | ba 155 | bb 156 | bd 157 | be 158 | bf 159 | bg 160 | bh 161 | bi 162 | bj 163 | bm 164 | bn 165 | bo 166 | br 167 | com 168 | bs 169 | bt 170 | bv 171 | bw 172 | by 173 | bz 174 | ca 175 | cc 176 | re 177 | cd 178 | cf 179 | cg 180 | ch 181 | ci 182 | ck 183 | cl 184 | cm 185 | cn 186 | ro 187 | co 188 | cr 189 | ru 190 | cu 191 | cv 192 | rw 193 | cx 194 | cy 195 | cz 196 | sa 197 | sb 198 | sc 199 | sd 200 | se 201 | sg 202 | sh 203 | si 204 | int 205 | sj 206 | sk 207 | dj 208 | sl 209 | dk 210 | sm 211 | dm 212 | sn 213 | so 214 | do 215 | sr 216 | st 217 | su 218 | sv 219 | sy 220 | sz 221 | dz 222 | tc 223 | td 224 | ec 225 | tf 226 | ee 227 | tg 228 | th 229 | eg 230 | tj 231 | eh 232 | tk 233 | tm 234 | tn 235 | to 236 | tp 237 | tr 238 | er 239 | es 240 | tt 241 | et 242 | tv 243 | tw 244 | tz 245 | ua 246 | ug 247 | fi 248 | fj 249 | fk 250 | um 251 | fm 252 | -------------------------------------------------------------------------------- /src/main/resources/bruteforcedata/ccswww.txt: -------------------------------------------------------------------------------- 1 | www.us 2 | www.uk 3 | www.de 4 | www.fr 5 | www.fo 6 | www.uy 7 | www.uz 8 | www.va 9 | www.vc 10 | www.ga 11 | www.gb 12 | www.ve 13 | www.gd 14 | www.vg 15 | www.ge 16 | www.gf 17 | www.vi 18 | www.gg 19 | www.gh 20 | www.gi 21 | www.gl 22 | www.vn 23 | www.gm 24 | www.gn 25 | www.gp 26 | www.gq 27 | www.gr 28 | www.gs 29 | www.vu 30 | www.gt 31 | www.gu 32 | www.gw 33 | www.gy 34 | www.gz 35 | www.wf 36 | www.hk 37 | www.hm 38 | www.hn 39 | www.ws 40 | www.hr 41 | www.ht 42 | www.ie 43 | www.il 44 | www.im 45 | www.in 46 | www.io 47 | www.iq 48 | www.ir 49 | www.is 50 | www.it 51 | www.net 52 | www.ye 53 | www.je 54 | www.org 55 | www.jm 56 | www.jo 57 | www.jp 58 | www.yt 59 | www.yu 60 | www.mil 61 | www.za 62 | www.ke 63 | www.kg 64 | www.kh 65 | www.ki 66 | www.zm 67 | www.km 68 | www.kn 69 | www.kp 70 | www.zr 71 | www.kr 72 | www.zw 73 | www.kw 74 | www.ky 75 | www.kz 76 | www.la 77 | www.lb 78 | www.lc 79 | www.li 80 | www.lk 81 | www.lr 82 | www.ls 83 | www.lt 84 | www.lu 85 | www.lv 86 | www.edu 87 | www.ly 88 | www.ma 89 | www.mc 90 | www.md 91 | www.mg 92 | www.mh 93 | www.mk 94 | www.ml 95 | www.mm 96 | www.mn 97 | www.mo 98 | www.mp 99 | www.mq 100 | www.mr 101 | www.ms 102 | www.mt 103 | www.mu 104 | www.mv 105 | www.mw 106 | www.mx 107 | www.my 108 | www.mz 109 | www.na 110 | www.nc 111 | www.ne 112 | www.nf 113 | www.ng 114 | www.ni 115 | www.nl 116 | www.no 117 | www.np 118 | www.gov 119 | www.nr 120 | www.nu 121 | www.nz 122 | www.om 123 | www.pa 124 | www.ac 125 | www.pe 126 | www.ad 127 | www.pf 128 | www.pg 129 | www.ae 130 | www.af 131 | www.ph 132 | www.ag 133 | www.ai 134 | www.pk 135 | www.pl 136 | www.pm 137 | www.al 138 | www.pn 139 | www.am 140 | www.an 141 | www.ao 142 | www.aq 143 | www.pr 144 | www.ar 145 | www.as 146 | www.pt 147 | www.at 148 | www.au 149 | www.pw 150 | www.aw 151 | www.py 152 | www.az 153 | www.qa 154 | www.ba 155 | www.bb 156 | www.bd 157 | www.be 158 | www.bf 159 | www.bg 160 | www.bh 161 | www.bi 162 | www.bj 163 | www.bm 164 | www.bn 165 | www.bo 166 | www.br 167 | www.com 168 | www.bs 169 | www.bt 170 | www.bv 171 | www.bw 172 | www.by 173 | www.bz 174 | www.ca 175 | www.cc 176 | www.re 177 | www.cd 178 | www.cf 179 | www.cg 180 | www.ch 181 | www.ci 182 | www.ck 183 | www.cl 184 | www.cm 185 | www.cn 186 | www.ro 187 | www.co 188 | www.cr 189 | www.ru 190 | www.cu 191 | www.cv 192 | www.rw 193 | www.cx 194 | www.cy 195 | www.cz 196 | www.sa 197 | www.sb 198 | www.sc 199 | www.sd 200 | www.se 201 | www.sg 202 | www.sh 203 | www.si 204 | www.int 205 | www.sj 206 | www.sk 207 | www.dj 208 | www.sl 209 | www.dk 210 | www.sm 211 | www.dm 212 | www.sn 213 | www.so 214 | www.do 215 | www.sr 216 | www.st 217 | www.su 218 | www.sv 219 | www.sy 220 | www.sz 221 | www.dz 222 | www.tc 223 | www.td 224 | www.ec 225 | www.tf 226 | www.ee 227 | www.tg 228 | www.th 229 | www.eg 230 | www.tj 231 | www.eh 232 | www.tk 233 | www.tm 234 | www.tn 235 | www.to 236 | www.tp 237 | www.tr 238 | www.er 239 | www.es 240 | www.tt 241 | www.et 242 | www.tv 243 | www.tw 244 | www.tz 245 | www.ua 246 | www.ug 247 | www.fi 248 | www.fj 249 | www.fk 250 | www.um 251 | www.fm 252 | -------------------------------------------------------------------------------- /src/main/resources/bruteforcedata/colors.txt: -------------------------------------------------------------------------------- 1 | red 2 | blue 3 | green 4 | black 5 | almond 6 | amber 7 | amethyst 8 | beige 9 | blond 10 | brown 11 | cream 12 | crimson 13 | cyan 14 | flesh-coloured 15 | grey 16 | ivory 17 | lavender 18 | magenta 19 | navy-blue 20 | ochre 21 | orange 22 | pink 23 | purple 24 | rust 25 | scarlet 26 | turquoise 27 | vermillion 28 | yellow 29 | yellow-brown 30 | -------------------------------------------------------------------------------- /src/main/resources/bruteforcedata/discworld.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/resources/bruteforcedata/discworld.txt -------------------------------------------------------------------------------- /src/main/resources/bruteforcedata/fruit.txt: -------------------------------------------------------------------------------- 1 | apple 2 | pear 3 | orange 4 | banana 5 | lemon 6 | mango 7 | akia 8 | almond 9 | apricot 10 | avocado 11 | breadfruit 12 | cactus 13 | caimitillo 14 | cashew 15 | cherimoya 16 | cherry 17 | chilipepper 18 | coffee 19 | cotton 20 | cucumber 21 | date 22 | egg-fruit 23 | elengi 24 | fig 25 | gooseberry 26 | gourka 27 | grape 28 | grapefruit 29 | guava 30 | imbu 31 | jackfruit 32 | ketembilla 33 | kumquat 34 | lilikoi 35 | lime 36 | loquat 37 | lychee 38 | mandarin 39 | mangosteen 40 | nectarine 41 | nightshade 42 | oleandar 43 | papaya 44 | passionflower 45 | passionfruit 46 | peach 47 | pepper 48 | plum 49 | pomegranate 50 | prune 51 | pummelo 52 | quince 53 | sandalwood 54 | santol 55 | sapodilla 56 | sapote 57 | seagrape 58 | soursop 59 | strawberry 60 | tangerine 61 | tomato 62 | walnut 63 | wampi 64 | ylang-ylang 65 | granadilla 66 | mulberry 67 | plum 68 | -------------------------------------------------------------------------------- /src/main/resources/bruteforcedata/greek.txt: -------------------------------------------------------------------------------- 1 | Apollo 2 | Hermes 3 | Prometheus 4 | Eros 5 | Zeus 6 | Ares 7 | Artemis 8 | Athene 9 | Cheiron 10 | Circe 11 | Dawn 12 | Demeter 13 | Dione 14 | Enyo 15 | Eos 16 | Erida 17 | Erinyes 18 | Eris 19 | Eros 20 | Eurynome 21 | Fates 22 | Gorgon 23 | Graces 24 | Hades 25 | Hebe 26 | Helios 27 | Hephaistos 28 | Hera 29 | Herakles 30 | Hestia 31 | Hours 32 | Hyperion 33 | Hypnos 34 | Io 35 | Iris 36 | Kalypso 37 | Kronos 38 | Leto 39 | Medusa 40 | Muses 41 | Nereids 42 | Odysseus 43 | Pan 44 | Persephone 45 | Poseidon 46 | Rheia 47 | Rivers 48 | Skylla 49 | Styx 50 | Thanatos 51 | Thetis 52 | Winds 53 | Zeus 54 | Aphrodite -------------------------------------------------------------------------------- /src/main/resources/bruteforcedata/matrix.txt: -------------------------------------------------------------------------------- 1 | neo 2 | smith 3 | trinity 4 | morpheus 5 | cypher 6 | abel 7 | ajax 8 | ak 9 | alexa 10 | anderson 11 | apoc 12 | architect 13 | ash 14 | axel 15 | ballard 16 | bane 17 | binary 18 | bobby 19 | brown 20 | cain 21 | cas 22 | charra 23 | choi 24 | chyron 25 | cis 26 | clarence 27 | colt 28 | cujo 29 | dillard 30 | dozer 31 | dujour 32 | ghost 33 | grace 34 | hamann 35 | ice 36 | jax 37 | jerry 38 | johnson 39 | jones 40 | jue 41 | kaiser 42 | kali 43 | kamala 44 | kandra 45 | keymaker 46 | kid 47 | link 48 | lock 49 | maggie 50 | malachi 51 | mattis 52 | mauser 53 | merovingian 54 | mifune 55 | mifune 56 | mouse 57 | niobe 58 | oce 59 | oracle 60 | persephone 61 | roland 62 | rook 63 | sati 64 | seraph 65 | soren 66 | sparks 67 | switch 68 | tank 69 | thaddeus 70 | thompson 71 | tirant 72 | trainman 73 | twins 74 | vector 75 | west 76 | zee 77 | zuka 78 | -------------------------------------------------------------------------------- /src/main/resources/bruteforcedata/planets.txt: -------------------------------------------------------------------------------- 1 | Mercury 2 | Venus 3 | Earth 4 | Mars 5 | Jupiter 6 | Saturn 7 | Uranus 8 | Neptune 9 | Pluto 10 | Sedna -------------------------------------------------------------------------------- /src/main/resources/conf/application.properties: -------------------------------------------------------------------------------- 1 | plugin.nmap.location=/usr/bin/nmap 2 | reverseLookup.ThreadCount=50 3 | tld.ThreadCount=20 4 | tld.RetryCount=2 5 | forwardLookup.BruteLocaction=/bruteforcedata 6 | geoip.ip2city=/geoipdata/GeoLiteCity.dat 7 | whois.tldServerFile=/whois/domains.csv 8 | forwardLookup.ThreadCount=20 9 | database.type=0 10 | forwardLookup.RetryCount=2 11 | plugins.location=/scripts 12 | tld.SourceList=/tlddata/tld_full.txt 13 | forwardLookup.wildCardDnsCheckSubdomain=diulukaygeejoekaykseriovs 14 | plugin.whatweb.location=/usr/bin/whatweb 15 | cert.ThreadCount=10 16 | app.showconfigonstartup=true 17 | geoip.country=/geoipdata/GeoIP.dat 18 | bing.ThreadCount=10 19 | cert.SocketTimeout=10000 20 | -------------------------------------------------------------------------------- /src/main/resources/db/default.db.org: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/resources/db/default.db.org -------------------------------------------------------------------------------- /src/main/resources/db/hibernate.mysql.properties: -------------------------------------------------------------------------------- 1 | hibernate.dialect=org.hibernate.dialect.MySQLDialect 2 | hibernate.connection.driver_class=com.mysql.jdbc.Driver 3 | hibernate.connection.url=jdbc:mysql:your_url 4 | hibernate.connection.username= 5 | hibernate.connection.password= -------------------------------------------------------------------------------- /src/main/resources/db/hibernate.sqlite.properties: -------------------------------------------------------------------------------- 1 | hibernate.dialect=com.sensepost.yeti.persistence.SQLiteDialect 2 | hibernate.connection.driver_class=org.sqlite.JDBC 3 | hibernate.connection.url=jdbc:sqlite:/db/default.db -------------------------------------------------------------------------------- /src/main/resources/geoipdata/GeoIP.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/resources/geoipdata/GeoIP.dat -------------------------------------------------------------------------------- /src/main/resources/geoipdata/GeoLiteCity.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/src/main/resources/geoipdata/GeoLiteCity.dat -------------------------------------------------------------------------------- /src/main/resources/hibernate-annotation.cfg.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | false 9 | 10 | true 11 | update 12 | 13 | 14 | 10 15 | 16 | 17 | thread 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/main/resources/scripts/attributePlugins/NMap - All hosts.groovy: -------------------------------------------------------------------------------- 1 | import groovy.util.XmlParser; 2 | 3 | def executeOnShell(String command) { 4 | return executeOnShell(command, new File(System.properties.'user.dir')) 5 | } 6 | 7 | private def executeOnShell(String command, File workingDir) { 8 | println command 9 | try { 10 | process = new ProcessBuilder(addShellPrefix(command)) 11 | .directory(workingDir) 12 | .redirectErrorStream(true) 13 | .start() 14 | process.inputStream.eachLine {controller.addOutput(it+"\n")} 15 | process.waitFor(); 16 | return process.exitValue() 17 | } catch (all) { 18 | controller.addOutput(": error!!!! "+all) 19 | } 20 | } 21 | 22 | private def addShellPrefix(String command) { 23 | commandArray = new String[3] 24 | commandArray[0] = "sh" 25 | commandArray[1] = "-c" 26 | commandArray[2] = command 27 | return commandArray 28 | } 29 | 30 | controller.addOutput("Starting the script"); 31 | filename = "/tmp/yeti_nmap_temp.xml" 32 | nmapLocation = utilApi.getConfigValue("nmap.location"); 33 | if (nmapLocation == ""){ 34 | nmapLocation = utilApi.showInputBox("Please enter nmap exe location") 35 | if (nmapLocation != ""){ 36 | utilApi.setConfigValue("nmap.location",nmapLocation) 37 | } 38 | } 39 | commandString = utilApi.showInputBox("Enter nmap params") 40 | commandString = commandString + " -oX " + filename 41 | controller.addOutput("Removing old file") 42 | executeOnShell("rm "+filename) 43 | 44 | 45 | for (ip in dataApi.getAllIPS()){ 46 | commandString = commandString + " " + ip 47 | } 48 | controller.addOutput("Executing: " + nmapLocation + " " +commandString) 49 | executeOnShell(nmapLocation + " " +commandString) 50 | 51 | if (filename != ""){ 52 | controller.addOutput("Import started") 53 | String xml = "" 54 | resultsFile = new File(filename) 55 | resultsFile.eachLine{ xml=xml+it+"\n"} 56 | xml=xml.trim() 57 | controller.addOutput("Done reading "+filename) 58 | try{ 59 | controller.addOutput(xml) 60 | targets = new XmlParser().parseText(xml) 61 | for (t in targets.host){ 62 | ipAddr = t.address.'@addr'.text() 63 | for (p in t.ports[0]){ 64 | if (p.state[0] != null){ 65 | portNumber = p.'@portid' 66 | portState = p.state[0].'@state' 67 | name="" 68 | version="" 69 | extraInfo="" 70 | product="" 71 | if (p.service[0] != null){ 72 | name = p.service[0].'@name' 73 | version = p.service[0].'@version' 74 | if (version == null) version = "" 75 | extraInfo = p.service[0].'@extrainfo' 76 | if (extraInfo == null) extraInfo = "" 77 | product = p.service[0].'@product' 78 | if (product == null) product = "" 79 | extraInfo = (extraInfo + " " + product).trim() 80 | } 81 | dataApi.addPortToIP(ipAddr, Integer.parseInt(portNumber),portState,name,version,extraInfo) 82 | controller.addOutput(ipAddr +":"+portNumber+" "+portState+" "+name+" "+version+" "+extraInfo) 83 | } 84 | } 85 | } 86 | } catch(all){ 87 | controller.addOutput(": error: "+all) 88 | } 89 | } 90 | controller.addOutput("Script done.") -------------------------------------------------------------------------------- /src/main/resources/scripts/attributePlugins/NMap - Import XML.groovy: -------------------------------------------------------------------------------- 1 | filename = utilApi.saveFileDialog(".xml") 2 | if (filename != ""){ 3 | controller.addOutput("Import started") 4 | String xml = "" 5 | resultsFile = new File(filename) 6 | resultsFile.eachLine{ xml=xml+it+"\n"} 7 | xml=xml.trim() 8 | controller.addOutput("Done reading "+filename) 9 | try{ 10 | controller.addOutput(xml) 11 | targets = new XmlParser().parseText(xml) 12 | for (t in targets.host){ 13 | ipAddr = t.address.'@addr'.text() 14 | for (p in t.ports[0]){ 15 | if (p.state[0] != null){ 16 | portNumber = p.'@portid' 17 | portState = p.state[0].'@state' 18 | name="" 19 | version="" 20 | extraInfo="" 21 | product="" 22 | if (p.service[0] != null){ 23 | name = p.service[0].'@name' 24 | version = p.service[0].'@version' 25 | if (version == null) version = "" 26 | extraInfo = p.service[0].'@extrainfo' 27 | if (extraInfo == null) extraInfo = "" 28 | product = p.service[0].'@product' 29 | if (product == null) product = "" 30 | extraInfo = (extraInfo + " " + product).trim() 31 | } 32 | dataApi.addPortToIP(ipAddr, Integer.parseInt(portNumber),portState,name,version,extraInfo) 33 | controller.addOutput(ipAddr +":"+portNumber+" "+portState+" "+name+" "+version+" "+extraInfo) 34 | } 35 | } 36 | } 37 | } catch(all){ 38 | controller.addOutput(": error: "+all) 39 | } 40 | } 41 | controller.addOutput("Import done.") -------------------------------------------------------------------------------- /src/main/resources/scripts/attributePlugins/WhatWeb (All hosts).bsh: -------------------------------------------------------------------------------- 1 | import com.sensepost.yeti.plugins.DataAPI; 2 | import com.sensepost.yeti.plugins.UtilAPI; 3 | import java.io.File; 4 | import javax.xml.parsers.DocumentBuilder; 5 | import javax.xml.parsers.DocumentBuilderFactory; 6 | import org.w3c.dom.Document; 7 | import org.w3c.dom.Element; 8 | import org.w3c.dom.Node; 9 | import org.w3c.dom.NodeList; 10 | 11 | controller.addOutput("Starting WhatWeb plugin..."); 12 | wwLocation = utilApi.getConfigValue("whatweb.location"); 13 | if (wwLocation.isEmpty()) { 14 | wwLocation = utilApi.showInputBox("Please enter WhatWeb executable location"); 15 | if (!wwLocation.isEmpty()) { 16 | utilApi.setConfigValue("whatweb.location", wwLocation); 17 | } 18 | } 19 | 20 | tempFileStr = System.getProperty("java.io.tmpdir") + "/wwTemp.xml"; 21 | for (host : dataApi.getHosts(dataApi.getCurrentFootprintId())) { 22 | controller.addOutput("Lookup for: " + host + "..."); 23 | try { 24 | f = new File(tempFileStr); 25 | if (f.exists()){ 26 | f.delete(); 27 | } else { 28 | f.createNewFile(); 29 | } 30 | 31 | cmd = wwLocation + " --log-xml=" + tempFileStr + " " + host; 32 | run = Runtime.getRuntime(); 33 | exec(cmd); 34 | 35 | dbFactory = DocumentBuilderFactory.newInstance(); 36 | dBuilder = dbFactory.newDocumentBuilder(); 37 | doc = dBuilder.parse(f); 38 | doc.getDocumentElement().normalize(); 39 | 40 | nList = doc.getElementsByTagName("plugin"); 41 | if (nList != null) { 42 | for (int i = 0; i < nList.getLength(); i++) { 43 | node = nList.item(i); 44 | if (node != null && node.getNodeType() == Node.ELEMENT_NODE) { 45 | eElement = (Element) node; 46 | name = eElement.getElementsByTagName("name").item(0).getTextContent(); 47 | String value = ""; 48 | 49 | nl = eElement.getElementsByTagName("string"); 50 | if (nl.getLength() == 0) { 51 | nl = eElement.getElementsByTagName("version"); 52 | } 53 | if (nl.getLength() > 0) { 54 | value = nl.item(0).getTextContent(); 55 | } 56 | 57 | nl = eElement.getElementsByTagName("certainty"); 58 | if (nl.getLength() > 0) { 59 | value = "[guess --> " + nl.item(0).getTextContent() + "% certainty]"; 60 | } 61 | out = " - " + name; 62 | if (value != null && !value.isEmpty()) { 63 | out += ":" + value; 64 | } 65 | controller.addOutput(out); 66 | dataApi.addHostAttribute(host, name, value); 67 | } 68 | } 69 | } 70 | 71 | nList = doc.getElementsByTagName("http-status"); 72 | if (nList != null && nList.getLength() > 0) { 73 | status = nList.item(0).getTextContent(); 74 | controller.addOutput(" - http-status:" + status); 75 | dataApi.addHostAttribute(host, "http-status", status); 76 | } 77 | } catch (Exception e) { 78 | controller.addOutput(e); 79 | } 80 | } 81 | controller.addOutput("WhatWeb plugin done"); -------------------------------------------------------------------------------- /src/main/resources/scripts/collectorPlugins/Bing - Search (ip:).bsh: -------------------------------------------------------------------------------- 1 | import java.io.IOException; 2 | import java.io.InputStream; 3 | import java.io.InputStreamReader; 4 | import java.io.UnsupportedEncodingException; 5 | import java.net.MalformedURLException; 6 | import java.net.URL; 7 | import java.net.URLConnection; 8 | import java.net.URLEncoder; 9 | import org.apache.commons.codec.binary.Base64; 10 | import org.json.JSONException; 11 | import org.json.JSONObject; 12 | import org.sensepost.yeti.results.CollectorResult; 13 | 14 | String info = "This plugin uses the Bing Search engine with the IP: dork, add a list of IP addresses you want to search"; 15 | 16 | public void searchBing(String target, String bingKey){ 17 | controller.debug(target); 18 | String accountKey = ":"+bingKey; 19 | byte[] accountKeyBytes = Base64.encodeBase64(accountKey.getBytes()); 20 | String accountKeyEnc = new String(accountKeyBytes); 21 | String q = "'ip:"+target+"'"; 22 | String bingURL = "https://api.datamarket.azure.com/Bing/SearchWeb/Web?Query=" + URLEncoder.encode(q, "UTF-8") + "&$format=json"; 23 | controller.debug("url:"+bingURL); 24 | 25 | JSONObject result = null; 26 | 27 | try { 28 | URL url = new URL(bingURL); 29 | URLConnection urlConnection = url.openConnection(); 30 | urlConnection.setRequestProperty("Authorization", "Basic " + accountKeyEnc); 31 | InputStream is = urlConnection.getInputStream(); 32 | InputStreamReader isr = new InputStreamReader(is); 33 | 34 | int numCharsRead; 35 | char[] charArray = new char[1024]; 36 | StringBuilder sb = new StringBuilder(); 37 | while ((numCharsRead = isr.read(charArray)) > 0) { 38 | sb.append(charArray, 0, numCharsRead); 39 | } 40 | result = new JSONObject(sb.toString()); 41 | int len = result.getJSONObject("d").getJSONArray("results").length(); 42 | System.out.println(len); 43 | for (int x=0; x 0) { 39 | sb.append(charArray, 0, numCharsRead); 40 | } 41 | result = new JSONObject(sb.toString()); 42 | int len = result.getJSONObject("d").getJSONArray("results").length(); 43 | List hostnames = new ArrayList(); 44 | 45 | for (int x=0; x 0) { 15 | for (attr in attrs) { 16 | outFile << attr + "\n" 17 | } 18 | } else { 19 | outFile << "No attributes found" 20 | } 21 | } 22 | } 23 | } catch(all){ 24 | controller.addOutput("Error: " + all) 25 | } 26 | controller.addOutput("Done writing file, size: " + outFile.text.size()) 27 | -------------------------------------------------------------------------------- /src/main/resources/scripts/exportPlugins/ExportDomainList.groovy: -------------------------------------------------------------------------------- 1 | filename = utilApi.saveFileDialog("") 2 | try{ 3 | if (filename != ""){ 4 | controller.addOutput("Saving data to: " + filename) 5 | outFile = new File(filename) 6 | appendFlag = false 7 | outStream = new FileOutputStream(outFile, appendFlag) 8 | writer = new FileWriter(outFile, appendFlag) 9 | outChannel = outStream.channel 10 | for (domain in dataApi.getDomains()){ 11 | controller.addOutput("exporting: " +domain) 12 | outFile << "*."+domain+"\n" 13 | } 14 | } 15 | } catch(all){ 16 | controller.addOutput("error: "+all) 17 | } 18 | controller.addOutput("Done writing file, size: " + outFile.text.size()) -------------------------------------------------------------------------------- /src/main/resources/scripts/exportPlugins/ExportHostAttributes.groovy: -------------------------------------------------------------------------------- 1 | filename = utilApi.saveFileDialog("txt") 2 | try { 3 | if (filename != "") { 4 | controller.addOutput("Saving data to: " + filename) 5 | outFile = new File(filename) 6 | appendFlag = false 7 | outStream = new FileOutputStream(outFile, appendFlag) 8 | writer = new FileWriter(outFile, appendFlag) 9 | outChannel = outStream.channel 10 | for (host in dataApi.getHosts()) { 11 | controller.addOutput("Exporting attributes for: " + host) 12 | outFile << host + ":\n" 13 | attrs = dataApi.getHostAttributes(host) 14 | if (attrs != null && attrs.size() > 0) { 15 | for (attr in attrs) { 16 | outFile << attr + "\n" 17 | } 18 | } else { 19 | outFile << "No attributes found" 20 | } 21 | } 22 | } 23 | } catch(all){ 24 | controller.addOutput("Error: " + all) 25 | } 26 | controller.addOutput("Done writing file, size: " + outFile.text.size()) 27 | -------------------------------------------------------------------------------- /src/main/resources/scripts/exportPlugins/ExportHostList.groovy: -------------------------------------------------------------------------------- 1 | filename = utilApi.saveFileDialog("") 2 | try{ 3 | if (filename != ""){ 4 | controller.addOutput("Saving data to: " + filename) 5 | outFile = new File(filename) 6 | appendFlag = false 7 | outStream = new FileOutputStream(outFile, appendFlag) 8 | writer = new FileWriter(outFile, appendFlag) 9 | outChannel = outStream.channel 10 | for (host in dataApi.getHosts()){ 11 | controller.addOutput("exporting: " +host) 12 | outFile << host+"\n" 13 | } 14 | } 15 | } catch(all){ 16 | controller.addOutput("error: "+all) 17 | } 18 | controller.addOutput("Done writing file, size: " + outFile.text.size()) -------------------------------------------------------------------------------- /src/main/resources/scripts/exportPlugins/ExportIPList.groovy: -------------------------------------------------------------------------------- 1 | filename = utilApi.saveFileDialog("") 2 | try{ 3 | if (filename != ""){ 4 | controller.addOutput("Saving data to: " + filename) 5 | outFile = new File(filename) 6 | appendFlag = false 7 | outStream = new FileOutputStream(outFile, appendFlag) 8 | writer = new FileWriter(outFile, appendFlag) 9 | outChannel = outStream.channel 10 | for (ip in dataApi.getAllIPS()){ 11 | controller.addOutput("exporting: " +ip) 12 | outFile << ip+"\n" 13 | } 14 | } 15 | } catch(all){ 16 | controller.addOutput("error: "+all) 17 | } 18 | controller.addOutput("Done writing file, size: " + outFile.text.size()) -------------------------------------------------------------------------------- /src/main/resources/scripts/exportPlugins/ExportIPPortList.groovy: -------------------------------------------------------------------------------- 1 | filename = utilApi.saveFileDialog("txt") 2 | try { 3 | if (filename != "") { 4 | controller.addOutput("Saving data to: " + filename) 5 | outFile = new File(filename) 6 | appendFlag = false 7 | outStream = new FileOutputStream(outFile, appendFlag) 8 | writer = new FileWriter(outFile, appendFlag) 9 | outChannel = outStream.channel 10 | for (ip in dataApi.getAllIPS()) { 11 | controller.addOutput("Exporting attributes for: " + ip) 12 | outFile << ip + ":\n" 13 | attrs = dataApi.getIpAttributes(ip) 14 | if (attrs != null && attrs.size() > 0) { 15 | for (attr in attrs) { 16 | outFile << attr + "\n" 17 | } 18 | } else { 19 | outFile << "No attributes found" 20 | } 21 | } 22 | } 23 | } catch(all){ 24 | controller.addOutput("Error: " + all) 25 | } 26 | controller.addOutput("Done writing file, size: " + outFile.text.size()) 27 | -------------------------------------------------------------------------------- /src/main/resources/scripts/importPlugins/Import Domains (from txt).bsh: -------------------------------------------------------------------------------- 1 | import java.io.BufferedReader; 2 | import java.io.File; 3 | import java.io.FileReader; 4 | import java.io.IOException; 5 | import java.io.InputStreamReader; 6 | import java.util.Iterator; 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | import com.sensepost.yeti.results.SOARecordResult; 10 | 11 | controller.addOutput("Importing domains from text file"); 12 | 13 | String readFile(String filename) 14 | { 15 | String content = null; 16 | File file = new File(filename); //for ex foo.txt 17 | try { 18 | FileReader reader = new FileReader(file); 19 | char[] chars = new char[(int) file.length()]; 20 | reader.read(chars); 21 | content = new String(chars); 22 | reader.close(); 23 | } catch (IOException e) { 24 | e.printStackTrace(); 25 | } 26 | return content; 27 | } 28 | 29 | txtFile = utilApi.showInputBox("Enter path to xxx file"); 30 | controller.addOutput(txtFile); 31 | if (txtFile != ""){ 32 | content = readFile(txtFile); 33 | if (content != null) { 34 | String[] domains = content.split("\n"); 35 | for (int idx = 0; idx < domains.length; idx++) { 36 | controller.addOutput("Checking SOA for: " +domains[idx]); 37 | try { 38 | SOARecordResult r = dataApi.getSOARecord(domains[idx]); 39 | controller.addOutput("Found SOA: Admin -> " + r.getAdminName()); 40 | dataApi.addDomainToCurrentFootprint(r); 41 | dataApi.addDomainAttribute(domains[idx], "Admin", r.getAdminName()); 42 | dataApi.addDomainAttribute(domains[idx], "dnsrecord", "SOA"); 43 | dataApi.addDomainAttribute(domains[idx], "SOA Nameserver", r.getNameServer()); 44 | } catch (Exception e) { 45 | e.printStackTrace(); 46 | } 47 | } 48 | } 49 | } else { 50 | controller.addOutput("No file selected, nothing to import"); 51 | } 52 | -------------------------------------------------------------------------------- /src/main/resources/scripts/importPlugins/Import Hosts (from txt).bsh: -------------------------------------------------------------------------------- 1 | import java.io.BufferedReader; 2 | import java.io.File; 3 | import java.io.FileReader; 4 | import java.io.IOException; 5 | import java.io.InputStreamReader; 6 | import java.util.Iterator; 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | import com.sensepost.yeti.results.SOARecordResult; 10 | 11 | controller.addOutput("Importing hosts from text file"); 12 | 13 | String readFile(String filename) 14 | { 15 | String content = null; 16 | File file = new File(filename); //for ex foo.txt 17 | try { 18 | FileReader reader = new FileReader(file); 19 | char[] chars = new char[(int) file.length()]; 20 | reader.read(chars); 21 | content = new String(chars); 22 | reader.close(); 23 | } catch (IOException e) { 24 | e.printStackTrace(); 25 | } 26 | return content; 27 | } 28 | 29 | txtFile = utilApi.showInputBox("Enter path toxxx file"); 30 | controller.addOutput(txtFile); 31 | if (txtFile != ""){ 32 | content = readFile(txtFile); 33 | if (content != null) { 34 | String[] domains = content.split("\n"); 35 | for (int idx = 0; idx < domains.length; idx++) { 36 | controller.addOutput("Checking SOA for: " +domains[idx]); 37 | try { 38 | SOARecordResult r = dataApi.getSOARecord(domains[idx]); 39 | controller.addOutput("Found SOA: Admin -> " + r.getAdminName()); 40 | dataApi.addDomainToCurrentFootprint(r); 41 | dataApi.addDomainAttribute(domains[idx], "Admin", r.getAdminName()); 42 | dataApi.addDomainAttribute(domains[idx], "dnsrecord", "SOA"); 43 | dataApi.addDomainAttribute(domains[idx], "SOA Nameserver", r.getNameServer()); 44 | } catch (Exception e) { 45 | e.printStackTrace(); 46 | } 47 | } 48 | } 49 | } else { 50 | controller.addOutput("No file selected, nothing to import"); 51 | } 52 | -------------------------------------------------------------------------------- /src/main/resources/tlddata/tld_test.txt: -------------------------------------------------------------------------------- 1 | .co.za 2 | .com 3 | .net 4 | .co.uk 5 | .info 6 | .co.bw 7 | .org 8 | .biz 9 | .mobi 10 | -------------------------------------------------------------------------------- /src/main/resources/whois/domains.csv: -------------------------------------------------------------------------------- 1 | .aero,whois.aero 2 | .ac,whois.nic.ac 3 | .ae,whois.uaenic.ae 4 | .ae.org,whois.centralnic.net 5 | .af,whois.nic.af 6 | .ag,whois.nic.ag 7 | .am,whois.amnic.net 8 | .as,whois.nic.as 9 | .asia,whois.nic.asia 10 | .at,whois.nic.at 11 | .au,whois.aunic.net 12 | .be,whois.dns.be 13 | .bg,whois.register.bg 14 | .biz,whois.biz 15 | .br,whois.registro.br 16 | .br.com,whois.centralnic.net 17 | .bz,whois2.afilias-grs.net 18 | .ca,whois.cira.ca 19 | .cat,whois.cat 20 | .cc,whois.nic.cc 21 | .cd,whois.cd 22 | .ch,whois.nic.ch 23 | .ck,whois.nic.ck 24 | .cl,whois.nic.cl 25 | .cn,whois.cnnic.net.cn 26 | .cn.com,whois.centralnic.net 27 | .com,whois.verisign-grs.net 28 | .coop,whois.nic.coop 29 | .cx,whois.nic.cx 30 | .cz,whois.nic.cz 31 | .de,whois.denic.de 32 | .de.com,whois.centralnic.net 33 | .dk,whois.dk-hostmaster.dk 34 | .dm,whois.nic.dm 35 | .edu,whois.verisign-grs.net 36 | .ee,whois.eenet.ee 37 | .eu,whois.eu 38 | .eu.com,whois.centralnic.net 39 | .fi,whois.ficora.fi 40 | .fo,whois.ripe.net 41 | .fr,whois.nic.fr 42 | .gb.com,whois.centralnic.net 43 | .gb.net,whois.centralnic.net 44 | .gd,whois.adamsnames.tc 45 | .gl,whois.ripe.net 46 | .gov,whois.nic.gov 47 | .gs,whois.nic.gs 48 | .hk,whois.hkdnr.net.hk 49 | .hm,whois.registry.hm 50 | .hu,whois.nic.hu 51 | .hu.com,whois.centralnic.net 52 | .ie,whois.domainregistry.ie 53 | .il,whois.isoc.org.il 54 | .in,whois.inregistry.net 55 | .info,whois.afilias.info 56 | .int,whois.iana.org 57 | .io,whois.nic.io 58 | .is,whois.isnic.is 59 | .it,whois.nic.it 60 | .jobs,jobswhois.verisign-grs.com 61 | .jp,whois.jprs.jp 62 | .jpn.com,whois.centralnic.net 63 | .ki,whois.nic.ki 64 | .kp,whois.kcce.kp 65 | .kr,whois.krnic.net 66 | .kr.com,whois.centralnic.net 67 | .la,whois.nic.la 68 | .li,whois.nic.li 69 | .lk,whois.nic.lk 70 | .lt,whois.domreg.lt 71 | .lu,whois.dns.lu 72 | .lv,whois.nic.lv 73 | .ly,whois.nic.ly 74 | .mc,whois.ripe.net 75 | .me,whois.meregistry.net 76 | .mil,whois.nic.mil 77 | .mobi,whois.dotmobiregistry.net 78 | .ms,whois.adamsnames.tc 79 | .mu,whois.nic.mu 80 | .museum,whois.museum 81 | .mx,whois.nic.mx 82 | .my,whois.mynic.net.my 83 | .na,whois.na-nic.com.na 84 | .name,whois.nic.name 85 | .net,whois.verisign-grs.net 86 | .nf,whois.nic.nf 87 | .nl,whois.domain-registry.nl 88 | .no,whois.norid.no 89 | .no.com,whois.centralnic.net 90 | .nu,whois.nic.nu 91 | .nz,whois.srs.net.nz 92 | .org,whois.pir.org 93 | .pl,whois.dns.pl 94 | .pro,whois.registrypro.pro 95 | .pt,whois.dns.pt 96 | .qc.com,whois.centralnic.net 97 | .re,whois.nic.fr 98 | .ro,whois.rotld.ro 99 | .ru,whois.ripn.net 100 | .ru.com,whois.centralnic.net 101 | .sa,saudinic.net.sa 102 | .sa.com,whois.centralnic.net 103 | .sc,whois2.afilias-grs.net 104 | .se,whois.iis.se 105 | .se.com,whois.centralnic.net 106 | .se.net,whois.centralnic.net 107 | .sg,whois.nic.net.sg 108 | .sh,whois.nic.sh 109 | .si,whois.arnes.si 110 | .sk,whois.ripe.net 111 | .sm,whois.ripe.net 112 | .st,whois.nic.st 113 | .tc,whois.adamsnames.tc 114 | .tf,whois.nic.fr 115 | .th,whois.thnic.net 116 | .tk,whois.dot.tk 117 | .tl,whois.nic.tl 118 | .tm,whois.nic.tm 119 | .to,whois.tonic.to 120 | .tp,whois.nic.tl 121 | .tr,whois.nic.tr 122 | .tv,whois.nic.tv 123 | .tw,whois.twnic.net 124 | .ua,whois.net.ua 125 | .uk,whois.nic.uk 126 | .uk.com,whois.centralnic.net 127 | .uk.net,whois.centralnic.net 128 | .us,whois.nic.us 129 | .us.com,whois.centralnic.net 130 | .uy.com,whois.centralnic.net 131 | .va,whois.ripe.net 132 | .vc,whois2.afilias-grs.net 133 | .vg,whois.adamsnames.tc 134 | .web.com,whois.centralnic.net 135 | .ws,whois.website.ws 136 | .za.com,whois.centralnic.net 137 | .za,whois.registry.net.za 138 | -------------------------------------------------------------------------------- /src/test/java/com/sensepost/yeti/HibernateAnnotationMain.java: -------------------------------------------------------------------------------- 1 | package com.sensepost.yeti; 2 | 3 | import com.sensepost.yeti.persistence.HibernateUtil; 4 | import com.sensepost.yeti.persistence.dao.FootprintDao; 5 | import com.sensepost.yeti.persistence.dao.HibernateDaoFactory; 6 | import com.sensepost.yeti.persistence.entities.Footprint; 7 | import java.util.List; 8 | import org.hibernate.Transaction; 9 | 10 | /** 11 | * 12 | * @author Johan Snyman 13 | */ 14 | public class HibernateAnnotationMain { 15 | 16 | public static void main(String[] args) { 17 | Transaction tx = null; 18 | try { 19 | tx = HibernateUtil.getSession().beginTransaction(); 20 | 21 | Footprint fp1 = new Footprint(); 22 | fp1.setName("Footprint1"); 23 | 24 | Footprint fp2 = new Footprint(); 25 | fp2.setName("Footprint2"); 26 | 27 | Footprint fp3 = new Footprint(); 28 | fp3.setName("Footprint3"); 29 | 30 | FootprintDao fpDao = HibernateDaoFactory.getInstance().getFootprintDao(); 31 | fpDao.saveOrUpdate(fp1); 32 | fpDao.saveOrUpdate(fp2); 33 | fpDao.saveOrUpdate(fp3); 34 | 35 | tx.commit(); 36 | 37 | tx = HibernateUtil.getSession().beginTransaction(); 38 | 39 | fpDao = HibernateDaoFactory.getInstance().getFootprintDao(); 40 | List footprints = fpDao.findAll(); 41 | 42 | System.out.println("Footprints found:"); 43 | for (Footprint f : footprints) { 44 | System.out.println(f); 45 | } 46 | 47 | tx.commit(); 48 | } catch (RuntimeException re) { 49 | if (tx != null) { 50 | tx.rollback(); 51 | } 52 | System.err.println("EXCEPTION CAUGHT!!!!!!!!!!!!!"); 53 | re.printStackTrace(); 54 | } finally { 55 | System.out.println("FINISHED"); 56 | System.exit(0); 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /target/Yeti-1.0-distribution.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensepost/yeti/a459f77ec86d2103cf54116a05ff7a7789beb72a/target/Yeti-1.0-distribution.zip --------------------------------------------------------------------------------