|
88 | 88 | cpassword_bad = "blah"
|
89 | 89 |
|
90 | 90 | describe Rex::Parser::GPP do
|
91 |
| - GPP = Rex::Parser::GPP |
92 |
| - |
93 |
| - ## |
94 |
| - # Decrypt |
95 |
| - ## |
96 |
| - it "Decrypt returns Local*P4ssword! for normal cpassword" do |
97 |
| - result = GPP.decrypt(cpassword_normal) |
98 |
| - result.should eq("Local*P4ssword!") |
99 |
| - end |
100 |
| - |
101 |
| - it "Decrypt returns blank for bad cpassword" do |
102 |
| - result = GPP.decrypt(cpassword_bad) |
103 |
| - result.should eq("") |
104 |
| - end |
105 |
| - |
106 |
| - it "Decrypt returns blank for nil cpassword" do |
107 |
| - result = GPP.decrypt(nil) |
108 |
| - result.should eq("") |
109 |
| - end |
| 91 | + GPP = Rex::Parser::GPP |
| 92 | + |
| 93 | + ## |
| 94 | + # Decrypt |
| 95 | + ## |
| 96 | + it "Decrypt returns Local*P4ssword! for normal cpassword" do |
| 97 | + result = GPP.decrypt(cpassword_normal) |
| 98 | + result.should eq("Local*P4ssword!") |
| 99 | + end |
| 100 | + |
| 101 | + it "Decrypt returns blank for bad cpassword" do |
| 102 | + result = GPP.decrypt(cpassword_bad) |
| 103 | + result.should eq("") |
| 104 | + end |
| 105 | + |
| 106 | + it "Decrypt returns blank for nil cpassword" do |
| 107 | + result = GPP.decrypt(nil) |
| 108 | + result.should eq("") |
| 109 | + end |
110 | 110 |
|
111 | 111 | it 'Decrypts a cpassword containing junk padding' do
|
112 | 112 | cpassword_win2k8.each do |encrypted, expected|
|
|
115 | 115 | end
|
116 | 116 | end
|
117 | 117 |
|
118 |
| - ## |
119 |
| - # Parse |
120 |
| - ## |
121 |
| - |
122 |
| - it "Parse returns empty [] for nil" do |
123 |
| - GPP.parse(nil).should be_empty |
124 |
| - end |
125 |
| - |
126 |
| - it "Parse returns results for xml_ms and password is empty" do |
127 |
| - results = GPP.parse(xml_ms) |
128 |
| - results.should_not be_empty |
129 |
| - results[0][:PASS].should be_empty |
130 |
| - end |
131 |
| - |
132 |
| - it "Parse returns results for xml_datasrc, and attributes, and password is test1" do |
133 |
| - results = GPP.parse(xml_datasrc) |
134 |
| - results.should_not be_empty |
135 |
| - results[0].include?(:ATTRIBUTES).should be_true |
136 |
| - results[0][:ATTRIBUTES].should_not be_empty |
137 |
| - results[0][:PASS].should eq("test") |
138 |
| - end |
139 |
| - |
140 |
| - xmls = [] |
141 |
| - xmls << xml_group |
142 |
| - xmls << xml_drive |
143 |
| - xmls << xml_schd |
144 |
| - xmls << xml_serv |
145 |
| - xmls << xml_datasrc |
146 |
| - |
147 |
| - it "Parse returns results for all good xmls and passwords" do |
148 |
| - xmls.each do |xml| |
149 |
| - results = GPP.parse(xml) |
150 |
| - results.should_not be_empty |
151 |
| - results[0][:PASS].should_not be_empty |
152 |
| - end |
153 |
| - end |
154 |
| - |
155 |
| - ## |
156 |
| - # Create_Tables |
157 |
| - ## |
158 |
| - it "Create_tables returns tables for all good xmls" do |
159 |
| - xmls.each do |xml| |
160 |
| - results = GPP.parse(xml) |
161 |
| - tables = GPP.create_tables(results, "test") |
162 |
| - tables.should_not be_empty |
163 |
| - end |
164 |
| - end |
| 118 | + ## |
| 119 | + # Parse |
| 120 | + ## |
| 121 | + |
| 122 | + it "Parse returns empty [] for nil" do |
| 123 | + GPP.parse(nil).should be_empty |
| 124 | + end |
| 125 | + |
| 126 | + it "Parse returns results for xml_ms and password is empty" do |
| 127 | + results = GPP.parse(xml_ms) |
| 128 | + results.should_not be_empty |
| 129 | + results[0][:PASS].should be_empty |
| 130 | + end |
| 131 | + |
| 132 | + it "Parse returns results for xml_datasrc, and attributes, and password is test1" do |
| 133 | + results = GPP.parse(xml_datasrc) |
| 134 | + results.should_not be_empty |
| 135 | + results[0].include?(:ATTRIBUTES).should be_true |
| 136 | + results[0][:ATTRIBUTES].should_not be_empty |
| 137 | + results[0][:PASS].should eq("test") |
| 138 | + end |
| 139 | + |
| 140 | + xmls = [] |
| 141 | + xmls << xml_group |
| 142 | + xmls << xml_drive |
| 143 | + xmls << xml_schd |
| 144 | + xmls << xml_serv |
| 145 | + xmls << xml_datasrc |
| 146 | + |
| 147 | + it "Parse returns results for all good xmls and passwords" do |
| 148 | + xmls.each do |xml| |
| 149 | + results = GPP.parse(xml) |
| 150 | + results.should_not be_empty |
| 151 | + results[0][:PASS].should_not be_empty |
| 152 | + end |
| 153 | + end |
| 154 | + |
| 155 | + ## |
| 156 | + # Create_Tables |
| 157 | + ## |
| 158 | + it "Create_tables returns tables for all good xmls" do |
| 159 | + xmls.each do |xml| |
| 160 | + results = GPP.parse(xml) |
| 161 | + tables = GPP.create_tables(results, "test") |
| 162 | + tables.should_not be_empty |
| 163 | + end |
| 164 | + end |
165 | 165 | end
|
0 commit comments