Skip to content

Commit fbcf366

Browse files
authored
Merge pull request s0md3v#29 from thehappydinoa/master
Stylize and Error Handling
2 parents b4a2494 + ebbf2e6 commit fbcf366

26 files changed

+151
-111
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
21
*.pyc

README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
<img src='https://i.imgur.com/MDPLLbV.png' />
1+
![](https://i.imgur.com/MDPLLbV.png)
22

33
# Striker
4+
45
Striker is an offensive information and vulnerability scanner.
56

67
## Features
7-
Just supply a domain name to <b>Striker</b> and it will automatically do the following for you:
8+
9+
Just supply a domain name to **Striker** and it will automatically do the following for you:
10+
811
- [x] Check and Bypass Cloudflare
912
- [x] Retrieve Server and Powered by Headers
1013
- [x] Fingerprint the operating system of Web Server
@@ -24,6 +27,7 @@ Just supply a domain name to <b>Striker</b> and it will automatically do the fol
2427
- [x] Basic XSS scanning
2528

2629
## Install
30+
2731
```bash
2832
git clone https://github.com/UltimateHackers/Striker
2933
cd Striker
@@ -32,10 +36,9 @@ python striker.py
3236
```
3337

3438
### Screenshots
35-
<img src='https://i.imgur.com/8nqAD1v.png' />
36-
<img src='https://i.imgur.com/2IdJwr8.png' />
37-
<img src='https://dnsdumpster.com/static/map/jnujaipur.ac.in.png' />
38-
Want to see what else it can do? Try it yourself.
39+
40+
![](https://i.imgur.com/8nqAD1v.png) ![](https://i.imgur.com/2IdJwr8.png) ![](https://dnsdumpster.com/static/map/jnujaipur.ac.in.png) Want to see what else it can do? Try it yourself.
3941

4042
#### Contribute
43+
4144
If you want to contribute to this project, report any bugs you encounter and help me add more features to it.

plugins/DNSDumpsterAPI.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ def display_message(self, s):
2323
if self.verbose:
2424
print('[verbose] %s' % s)
2525

26-
2726
def retrieve_results(self, table):
2827
res = []
2928
trs = table.findAll('tr')
@@ -56,20 +55,21 @@ def retrieve_txt_record(self, table):
5655
res.append(td.text)
5756
return res
5857

59-
6058
def search(self, domain):
6159
dnsdumpster_url = 'https://dnsdumpster.com/'
6260
s = requests.session()
6361

6462
req = s.get(dnsdumpster_url)
6563
soup = BeautifulSoup(req.content, 'html.parser')
66-
csrf_middleware = soup.findAll('input', attrs={'name': 'csrfmiddlewaretoken'})[0]['value']
64+
csrf_middleware = soup.findAll(
65+
'input', attrs={'name': 'csrfmiddlewaretoken'})[0]['value']
6766
self.display_message('Retrieved token: %s' % csrf_middleware)
6867

6968
cookies = {'csrftoken': csrf_middleware}
7069
headers = {'Referer': dnsdumpster_url}
7170
data = {'csrfmiddlewaretoken': csrf_middleware, 'targetip': domain}
72-
req = s.post(dnsdumpster_url, cookies=cookies, data=data, headers=headers)
71+
req = s.post(dnsdumpster_url, cookies=cookies,
72+
data=data, headers=headers)
7373

7474
if req.status_code != 200:
7575
print(
@@ -107,12 +107,13 @@ def search(self, domain):
107107
# XLS hosts.
108108
# eg. tsebo.com-201606131255.xlsx
109109
try:
110-
pattern = r'https://dnsdumpster.com/static/xls/' + domain + '-[0-9]{12}\.xlsx'
110+
pattern = r'https://dnsdumpster.com/static/xls/' + \
111+
domain + '-[0-9]{12}\.xlsx'
111112
xls_url = re.findall(pattern, req.content)[0]
112113
xls_data = requests.get(xls_url).content.encode('base64')
113114
except:
114115
xls_data = None
115116
finally:
116117
res['xls_data'] = xls_data
117118

118-
return res
119+
return res

plugins/discovery/DNS/Base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
class DNSError(Exception):
2323
pass
2424

25+
2526
defaults = {'protocol': 'udp', 'port': 53, 'opcode': Opcode.QUERY,
2627
'qtype': Type.A, 'rd': 1, 'timing': 1, 'timeout': 30}
2728

plugins/discovery/DNS/Class.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212

1313
IN = 1 # the Internet
1414
CS = 2 # the CSNET class (Obsolete - used only for examples in
15-
# some obsolete RFCs)
15+
# some obsolete RFCs)
1616
CH = 3 # the CHAOS class. When someone shows me python running on
17-
# a Symbolics Lisp machine, I'll look at implementing this.
17+
# a Symbolics Lisp machine, I'll look at implementing this.
1818
HS = 4 # Hesiod [Dyer 87]
1919

2020
# QCLASS values (section 3.2.5)

plugins/discovery/DNS/Lib.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class PackError(DNSError):
4343

4444
# Low-level 16 and 32 bit integer packing and unpacking
4545

46+
4647
from struct import pack as struct_pack
4748
from struct import unpack as struct_unpack
4849
from socket import inet_ntoa, inet_aton
@@ -702,6 +703,7 @@ def dumpRR(u):
702703
else:
703704
print ' binary rdata:', u.getbytes(rdlength)
704705

706+
705707
if __name__ == "__main__":
706708
testpacker()
707709
#
@@ -753,10 +755,10 @@ def dumpRR(u):
753755
# added identifying header to top of each file
754756
#
755757
# Revision 1.7 2001/07/19 07:50:44 anthony
756-
# Added SRV (RFC 2782) support. Code from Michael Ströder.
758+
# Added SRV (RFC 2782) support. Code from Michael Str�der.
757759
#
758760
# Revision 1.6 2001/07/19 07:39:18 anthony
759-
# 'type' -> 'rrtype' in getRRheader(). Fix from Michael Ströder.
761+
# 'type' -> 'rrtype' in getRRheader(). Fix from Michael Str�der.
760762
#
761763
# Revision 1.5 2001/07/19 07:34:19 anthony
762764
# oops. glitch in storeRR (fixed now).

plugins/discovery/DNS/win32dns.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ def RegistryResolve():
116116
_winreg.CloseKey(x)
117117
return nameservers
118118

119+
119120
if __name__ == "__main__":
120121
print "Name servers:", RegistryResolve()
121122

plugins/discovery/IPy.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ def strNormal(self, wantprefixlen=None):
469469
ret = self.strFullsize(0)
470470
elif self._ipversion == 6:
471471
ret = ':'.join([hex(x)[2:] for x in [int(x, 16)
472-
for x in self.strFullsize(0).split(':')]])
472+
for x in self.strFullsize(0).split(':')]])
473473
else:
474474
raise ValueError("only IPv4 and IPv6 supported")
475475

@@ -1295,6 +1295,7 @@ def _test():
12951295
import IPy
12961296
return doctest.testmod(IPy)
12971297

1298+
12981299
if __name__ == "__main__":
12991300
_test()
13001301

plugins/discovery/crtsh.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def __init__(self, word):
1616
self.userAgent = "(Mozilla/5.0 (Windows; U; Windows NT 6.0;en-US; rv:1.9.2) Gecko/20100116 Firefox/3.7"
1717
self.quantity = "100"
1818
self.counter = 0
19-
19+
2020

2121
def do_search(self):
2222
try:
@@ -37,4 +37,4 @@ def get_hostnames(self):
3737

3838
def process(self):
3939
self.do_search()
40-
print "\tSearching CRT.sh results.."
40+
print "\tSearching CRT.sh results.."

plugins/discovery/exaleadsearch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,4 @@ def process_files(self, files):
8888
if more == "1":
8989
self.counter += 50
9090
else:
91-
break
91+
break

plugins/discovery/googleCSE.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def __init__(self, word, limit, start):
2121
self.counter = 1
2222
self.api_key = ""
2323
self.cse_id = ""
24-
self.lowRange = start
24+
self.lowRange = start
2525
self.highRange = start+100
2626

2727
def do_search(self):
@@ -68,7 +68,7 @@ def get_files(self):
6868
rawres = myparser.parser(self.totalresults, self.word)
6969
return rawres.fileurls(self.files)
7070

71-
71+
7272
def process(self):
7373
tracker=self.counter + self.lowRange
7474
while tracker <= self.limit:
@@ -86,7 +86,7 @@ def process(self):
8686
else:
8787
self.counter += 10
8888
tracker=self.counter + self.lowRange
89-
89+
9090
def store_results(self):
9191
filename = "debug_results.txt"
9292
file = open(filename, 'w')

plugins/discovery/googleplussearch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def do_search(self):
2828
r=requests.get(urly,headers=headers)
2929
except Exception,e:
3030
print e
31-
self.results = r.content
31+
self.results = r.content
3232
self.totalresults += self.results
3333

3434
def get_people(self):

plugins/discovery/googlesearch.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,30 +17,32 @@ def __init__(self, word, limit, start):
1717
self.quantity = "100"
1818
self.limit = limit
1919
self.counter = start
20-
20+
2121
def do_search(self):
2222
try:
23-
urly="http://" + self.server + "/search?num=" + self.quantity + "&start=" + str(self.counter) + "&hl=en&meta=&q=%40\"" + self.word + "\""
23+
urly = "http://" + self.server + "/search?num=" + self.quantity + \
24+
"&start=" + str(self.counter) + \
25+
"&hl=en&meta=&q=%40\"" + self.word + "\""
2426
except Exception, e:
2527
print e
2628
try:
27-
r=requests.get(urly)
28-
except Exception,e:
29+
r = requests.get(urly)
30+
except Exception, e:
2931
print e
30-
self.results = r.content
32+
self.results = r.content
3133
self.totalresults += self.results
3234

33-
3435
def do_search_profiles(self):
3536
try:
36-
urly="http://" + self.server + "/search?num=" + self.quantity + "&start=" + str(self.counter) + "&hl=en&meta=&q=site:www.google.com%20intitle:\"Google%20Profile\"%20\"Companies%20I%27ve%20worked%20for\"%20\"at%20" + self.word + "\""
37+
urly = "http://" + self.server + "/search?num=" + self.quantity + "&start=" + \
38+
str(self.counter) + "&hl=en&meta=&q=site:www.google.com%20intitle:\"Google%20Profile\"%20\"Companies%20I%27ve%20worked%20for\"%20\"at%20" + self.word + "\""
3739
except Exception, e:
3840
print e
3941
try:
40-
r=requests.get(urly)
41-
except Exception,e:
42+
r = requests.get(urly)
43+
except Exception, e:
4244
print e
43-
self.results = r.content
45+
self.results = r.content
4446

4547
#'&hl=en&meta=&q=site:www.google.com%20intitle:"Google%20Profile"%20"Companies%20I%27ve%20worked%20for"%20"at%20' + self.word + '"')
4648
self.totalresults += self.results
@@ -68,9 +70,8 @@ def process(self):
6870
time.sleep(1)
6971
self.counter += 100
7072

71-
7273
def process_profiles(self):
7374
while self.counter < self.limit:
7475
self.do_search_profiles()
7576
time.sleep(0.3)
76-
self.counter += 100
77+
self.counter += 100

plugins/discovery/jigsaw.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import sys
44
import myparser
55
import re
6-
# http://www.jigsaw.com/SearchAcrossCompanies.xhtml?opCode=refresh&rpage=4&mode=0&cnCountry=&order=0&orderby=0&cmName=accuvant&cnDead=false&cnExOwned=false&count=0&screenNameType=0&screenName=&omitScreenNameType=0&omitScreenName=&companyId=0&estimatedCount=277&rowsPerPage=50
6+
# http://www.jigsaw.com/SearchAcrossCompanies.xhtml?opCode=refresh&rpage=4&mode=0&cnCountry=&order=0&orderby=0&cmName=accuvant&cnDead=false&cnExOwned=false&count=0&screenNameType=0&screenName=&omitScreenNameType=0&omitScreenName=&companyId=0&estimatedCount=277&rowsPerPage=50
77

88

99
class search_jigsaw:

plugins/discovery/linkedinsearch.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,14 @@ def __init__(self, word, limit):
1919

2020
def do_search(self):
2121
try:
22-
urly="http://"+ self.server + "/search?num=100&start=" + str(self.counter) + "&hl=en&meta=&q=site%3Alinkedin.com/in%20" + self.word
22+
urly = "http://" + self.server + "/search?num=100&start=" + \
23+
str(self.counter) + \
24+
"&hl=en&meta=&q=site%3Alinkedin.com/in%20" + self.word
2325
except Exception, e:
2426
print e
2527
try:
26-
r=requests.get(urly)
27-
except Exception,e:
28+
r = requests.get(urly)
29+
except Exception, e:
2830
print e
2931
self.results = r.content
3032
self.totalresults += self.results

plugins/discovery/netcraft.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ def __init__(self, word):
1616
self.userAgent = "(Mozilla/5.0 (Windows; U; Windows NT 6.0;en-US; rv:1.9.2) Gecko/20100116 Firefox/3.7"
1717
self.quantity = "100"
1818
self.counter = 0
19-
2019

2120
def do_search(self):
2221
try:
23-
urly="https://searchdns.netcraft.com/?restriction=site+ends+with&host=" + self.word
22+
urly = "https://searchdns.netcraft.com/?restriction=site+ends+with&host=" + self.word
2423
except Exception, e:
2524
print e
26-
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:34.0) Gecko/20100101 Firefox/34.0'}
25+
headers = {
26+
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:34.0) Gecko/20100101 Firefox/34.0'}
2727
try:
28-
r=requests.get(urly,headers=headers)
29-
except Exception,e:
28+
r = requests.get(urly, headers=headers)
29+
except Exception, e:
3030
print e
3131
self.results = r.content
3232
self.totalresults += self.results

plugins/discovery/pgpsearch.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ def __init__(self, word):
1010
self.word = word
1111
self.results = ""
1212
self.server = "pgp.mit.edu"
13-
#self.server = "pgp.rediris.es:11371" Not working at the moment
13+
# self.server = "pgp.rediris.es:11371" Not working at the moment
1414
self.hostname = "pgp.mit.edu"
1515
self.userAgent = "(Mozilla/5.0 (Windows; U; Windows NT 6.0;en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6"
16-
16+
1717
def process(self):
1818
h = httplib.HTTP(self.server)
1919
h.putrequest('GET', "/pks/lookup?search=" + self.word + "&op=index")

plugins/discovery/twittersearch.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,16 @@ def __init__(self, word, limit):
2020

2121
def do_search(self):
2222
try:
23-
urly="https://"+ self.server + "/search?num=100&start=" + str(self.counter) + "&hl=en&meta=&q=site%3Atwitter.com%20intitle%3A%22on+Twitter%22%20" + self.word
23+
urly = "https://" + self.server + "/search?num=100&start=" + \
24+
str(self.counter) + \
25+
"&hl=en&meta=&q=site%3Atwitter.com%20intitle%3A%22on+Twitter%22%20" + self.word
2426
except Exception, e:
2527
print e
26-
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:34.0) Gecko/20100101 Firefox/34.0'}
28+
headers = {
29+
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:34.0) Gecko/20100101 Firefox/34.0'}
2730
try:
28-
r=requests.get(urly,headers=headers)
29-
except Exception,e:
31+
r = requests.get(urly, headers=headers)
32+
except Exception, e:
3033
print e
3134
self.results = r.content
3235
self.totalresults += self.results

plugins/discovery/virustotal.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ def __init__(self, word):
1616
self.userAgent = "(Mozilla/5.0 (Windows; U; Windows NT 6.0;en-US; rv:1.9.2) Gecko/20100116 Firefox/3.7"
1717
self.quantity = "100"
1818
self.counter = 0
19-
2019

2120
def do_search(self):
2221
try:
23-
urly="https://www.virustotal.com/en/domain/" + self.word + "/information/"
22+
urly = "https://www.virustotal.com/en/domain/" + self.word + "/information/"
2423
except Exception, e:
2524
print e
26-
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:34.0) Gecko/20100101 Firefox/34.0'}
25+
headers = {
26+
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:34.0) Gecko/20100101 Firefox/34.0'}
2727
try:
28-
r=requests.get(urly,headers=headers)
29-
except Exception,e:
28+
r = requests.get(urly, headers=headers)
29+
except Exception, e:
3030
print e
3131
self.results = r.content
3232
self.totalresults += self.results
@@ -37,4 +37,4 @@ def get_hostnames(self):
3737

3838
def process(self):
3939
self.do_search()
40-
print "\tSearching CRT.sh results.."
40+
print "\tSearching CRT.sh results.."

0 commit comments

Comments
 (0)