@@ -32,6 +32,7 @@ module Text
32
32
#
33
33
##
34
34
35
+ TLDs = [ 'com' , 'net' , 'org' , 'gov' , 'biz' , 'edu' ]
35
36
States = [ "AK" , "AL" , "AR" , "AZ" , "CA" , "CO" , "CT" , "DE" , "FL" , "GA" , "HI" ,
36
37
"IA" , "ID" , "IL" , "IN" , "KS" , "KY" , "LA" , "MA" , "MD" , "ME" , "MI" , "MN" ,
37
38
"MO" , "MS" , "MT" , "NC" , "ND" , "NE" , "NH" , "NJ" , "NM" , "NV" , "NY" , "OH" ,
@@ -102,6 +103,62 @@ module Text
102
103
nil , nil , nil , nil , nil , nil , nil , nil , nil
103
104
]
104
105
106
+ #
107
+ # Most 100 common surnames, male/female names in the U.S. (http://names.mongabay.com/)
108
+ #
109
+
110
+ Surnames = [
111
+ "adams" , "alexander" , "allen" , "anderson" , "bailey" , "baker" , "barnes" ,
112
+ "bell" , "bennett" , "brooks" , "brown" , "bryant" , "butler" , "campbell" ,
113
+ "carter" , "clark" , "coleman" , "collins" , "cook" , "cooper" , "cox" ,
114
+ "davis" , "diaz" , "edwards" , "evans" , "flores" , "foster" , "garcia" ,
115
+ "gonzales" , "gonzalez" , "gray" , "green" , "griffin" , "hall" , "harris" ,
116
+ "hayes" , "henderson" , "hernandez" , "hill" , "howard" , "hughes" , "jackson" ,
117
+ "james" , "jenkins" , "johnson" , "jones" , "kelly" , "king" , "lee" , "lewis" ,
118
+ "long" , "lopez" , "martin" , "martinez" , "miller" , "mitchell" , "moore" ,
119
+ "morgan" , "morris" , "murphy" , "nelson" , "parker" , "patterson" , "perez" ,
120
+ "perry" , "peterson" , "phillips" , "powell" , "price" , "ramirez" , "reed" ,
121
+ "richardson" , "rivera" , "roberts" , "robinson" , "rodriguez" , "rogers" ,
122
+ "ross" , "russell" , "sanchez" , "sanders" , "scott" , "simmons" , "smith" ,
123
+ "stewart" , "taylor" , "thomas" , "thompson" , "torres" , "turner" , "walker" ,
124
+ "ward" , "washington" , "watson" , "white" , "williams" , "wilson" , "wood" ,
125
+ "wright" , "young"
126
+ ]
127
+
128
+ Names_Male = [
129
+ "aaron" , "adam" , "alan" , "albert" , "andrew" , "anthony" , "antonio" ,
130
+ "arthur" , "benjamin" , "billy" , "bobby" , "brandon" , "brian" , "bruce" ,
131
+ "carl" , "carlos" , "charles" , "chris" , "christopher" , "clarence" , "craig" ,
132
+ "daniel" , "david" , "dennis" , "donald" , "douglas" , "earl" , "edward" ,
133
+ "eric" , "ernest" , "eugene" , "frank" , "fred" , "gary" , "george" , "gerald" ,
134
+ "gregory" , "harold" , "harry" , "henry" , "howard" , "jack" , "james" , "jason" ,
135
+ "jeffrey" , "jeremy" , "jerry" , "jesse" , "jimmy" , "joe" , "john" , "johnny" ,
136
+ "jonathan" , "jose" , "joseph" , "joshua" , "juan" , "justin" , "keith" ,
137
+ "kenneth" , "kevin" , "larry" , "lawrence" , "louis" , "mark" , "martin" ,
138
+ "matthew" , "michael" , "nicholas" , "patrick" , "paul" , "peter" , "philip" ,
139
+ "phillip" , "ralph" , "randy" , "raymond" , "richard" , "robert" , "roger" ,
140
+ "ronald" , "roy" , "russell" , "ryan" , "samuel" , "scott" , "sean" , "shawn" ,
141
+ "stephen" , "steve" , "steven" , "terry" , "thomas" , "timothy" , "todd" ,
142
+ "victor" , "walter" , "wayne" , "william" , "willie"
143
+ ]
144
+
145
+ Names_Female = [
146
+ "alice" , "amanda" , "amy" , "andrea" , "angela" , "ann" , "anna" , "anne" ,
147
+ "annie" , "ashley" , "barbara" , "betty" , "beverly" , "bonnie" , "brenda" ,
148
+ "carol" , "carolyn" , "catherine" , "cheryl" , "christina" , "christine" ,
149
+ "cynthia" , "deborah" , "debra" , "denise" , "diana" , "diane" , "donna" ,
150
+ "doris" , "dorothy" , "elizabeth" , "emily" , "evelyn" , "frances" , "gloria" ,
151
+ "heather" , "helen" , "irene" , "jacqueline" , "jane" , "janet" , "janice" ,
152
+ "jean" , "jennifer" , "jessica" , "joan" , "joyce" , "judith" , "judy" , "julia" ,
153
+ "julie" , "karen" , "katherine" , "kathleen" , "kathryn" , "kathy" , "kelly" ,
154
+ "kimberly" , "laura" , "lillian" , "linda" , "lisa" , "lois" , "lori" , "louise" ,
155
+ "margaret" , "maria" , "marie" , "marilyn" , "martha" , "mary" , "melissa" ,
156
+ "michelle" , "mildred" , "nancy" , "nicole" , "norma" , "pamela" , "patricia" ,
157
+ "paula" , "phyllis" , "rachel" , "rebecca" , "robin" , "rose" , "ruby" , "ruth" ,
158
+ "sandra" , "sara" , "sarah" , "sharon" , "shirley" , "stephanie" , "susan" ,
159
+ "tammy" , "teresa" , "theresa" , "tina" , "virginia" , "wanda"
160
+ ]
161
+
105
162
##
106
163
#
107
164
# Serialization
@@ -1525,8 +1582,7 @@ def self.rand_hostname
1525
1582
( rand ( 5 ) + 1 ) . times {
1526
1583
host . push ( Rex ::Text . rand_text_alphanumeric ( rand ( 10 ) + 1 ) )
1527
1584
}
1528
- d = [ 'com' , 'net' , 'org' , 'gov' ]
1529
- host . push ( d [ rand ( d . size ) ] )
1585
+ host . push ( TLDs [ rand ( TLDs . size ) ] )
1530
1586
host . join ( '.' ) . downcase
1531
1587
end
1532
1588
@@ -1535,6 +1591,40 @@ def self.rand_state()
1535
1591
States [ rand ( States . size ) ]
1536
1592
end
1537
1593
1594
+ # Generate a surname
1595
+ def self . rand_surname
1596
+ Surnames [ rand ( Surnames . size ) ]
1597
+ end
1598
+
1599
+ # Generate a name
1600
+ def self . rand_name
1601
+ if rand ( 10 ) % 2 == 0
1602
+ Names_Male [ rand ( Names_Male . size ) ]
1603
+ else
1604
+ Names_Female [ rand ( Names_Female . size ) ]
1605
+ end
1606
+ end
1607
+
1608
+ # Generate a male name
1609
+ def self . rand_name_male
1610
+ Names_Male [ rand ( Names_Male . size ) ]
1611
+ end
1612
+
1613
+ # Generate a female name
1614
+ def self . rand_name_female
1615
+ Names_Female [ rand ( Names_Female . size ) ]
1616
+ end
1617
+
1618
+ # Generate a random mail address
1619
+ def self . rand_mail_address
1620
+ mail_address = ''
1621
+ mail_address << Rex ::Text . rand_name
1622
+ mail_address << '.'
1623
+ mail_address << Rex ::Text . rand_surname
1624
+ mail_address << '@'
1625
+ mail_address << Rex ::Text . rand_hostname
1626
+ end
1627
+
1538
1628
1539
1629
#
1540
1630
# Calculate the ROR13 hash of a given string
0 commit comments