Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Diff of /phish/phish_fromStruct.py [b703d3] .. [52da40] Maximize Restore

  Switch to side-by-side view

--- a/phish/phish_fromStruct.py
+++ b/phish/phish_fromStruct.py
@@ -40,7 +40,7 @@
 
 def main(argv):
     _language = "en-US"
-    _testing = False
+    _file = False
     _dump = False
     configFile = "iodef_phish_config.ini"
     msg=""
@@ -54,8 +54,9 @@
             usage() 
             sys.exit() 
         elif opt == '-t':
-	    _testing = True
- 	    from phishStruct_test import phishStruct
+	    _file = True
+            phishFile = open( arg, 'r')
+ 	    from phishFile import phishStruct
 	elif opt == '-l':
 	    _language = arg
 	elif opt == '-d':
@@ -64,9 +65,6 @@
 	    msg = open( arg, 'r')
 	elif opt =='-c':
 	    configFile = arg
-
-    if not _testing:
-	phishStruct = {}
  
     ''' Step 1: Read static configs '''
     config = readConfig( configFile )
@@ -74,7 +72,81 @@
 # Questions are too hard, use the struct or the web page.
 #    if not _testing:
 #      askQuestions(_language, phishStruct)
-    
+ 
+    if not _file:
+        # Put your code here to fill in the phishStruct
+
+        # YOUR CODE CAN LOOK LIKE THIS:
+        ''' phishStruct = {}   
+
+        phishStruct['brand'] = None
+        phishStruct['method'] = 'A standard phishing message.'
+        phishStruct['from'] = None
+        phishStruct['recipient'] = None
+        phishStruct['source'] = {}
+        phishStruct['source']['IpAddress'] = None
+        phishStruct['source']['dns'] = {}
+        phishStruct['source']['dns']['name'] = None
+        phishStruct['source']['dns']['registrar'] = None
+        phishStruct['subject'] = None
+        phishStruct['sent'] = None
+        phishStruct['datetime'] = None
+        phishStruct['count'] = 1
+        phishStruct['lang'] = 'en-US'
+        phishStruct['message'] = None
+        phishStruct['collector'] = {}
+        phishStruct['collector']['lang'] = None
+        phishStruct['collector']['url'] = None
+        phishStruct['collector']['type'] = None
+        phishStruct['collector']['confidence'] =  '65'
+        phishStruct['collector']['IpAddress'] = None
+        phishStruct['collector']['dns'] = {}
+        phishStruct['collector']['dns']['name'] = None
+        phishStruct['collector']['dns']['registrar'] = None
+        '''
+        # OR YOUR CODE CAN LOOK LIKE THIS:
+        '''phishStruct = {
+           'brand': 'Big Company',
+           'method' : 'A standard phish lure.',
+           'from': 'thebarrio@example.com',
+           'recipient': 'gullibles@all.net',
+           'source' : {
+	       'ipAddress': '127.0.0.1',
+  	       'dns' : {
+	 	   'name':'1.0.0.127.dhcp.example.com',
+		   'registrar' : 'Bad Registrars, Inc.'
+ 	       }
+           },
+           'subject': 'Click me, you fool!',
+           'sent': None,
+           'datetime': '2012-12-25T00:01:00-05:00',
+           'count' : 0,
+           'confidence' : '65',
+           'lang' : 'en-US',
+           'message' : 'This is the lure',
+           'collector' : {  
+	       'lang' : 'po-US',
+	       'type': 'web', 'uri': 'collector.example.com',
+	       #'type': 'email', 'uri': 'mail@example.com',
+	       #'type': 'unspecified', 'uri': 'Something unknown',
+	       #'type': 'automation', 'uri': '10.0.13.66',
+	       #'type': 'domain', 'uri': 'example.com',
+	       #'type': 'phonenumber', 'uri': '+1.800.555.1212',
+ 	       'confidence' : '65',
+	       'ipAddress' : '127.0.0.2', 
+ 	       'dns' : {
+	  	    'name':'pat.the.phisher.org',
+		    'registrar' : 'Bad Registrars, Inc.'
+	       }
+            }
+        }
+        '''
+	# Or even like this:
+
+        from phishStruct_test import phishStruct
+
+        # End your code here.
+
 
     ''' Step 3: Build phishDetails Element '''
     phishz = build_phraudReport( config, phishStruct, phishStruct.get('message',  msg))
@@ -106,6 +178,7 @@
 
 
 if __name__ == '__main__':
-    import pdb; pdb.set_trace()
+    # This is for python debugging
+    #    import pdb; pdb.set_trace()
     main(sys.argv[1:])