有问题请朋友们指出
@echo off
setlocal enabledelayedexpansion
for %%x in (jpg) do (
set /a c=0
for %%f in (*.%%x) do (
set "d=!c!.%%x"
if exist "!d!" (
echo "!d!"
) else (
ren "%%f" "!d!"
echo %c%
)
set /a c+=1
)
echo .
)
pause
第一步:右键浏览器空白处,选择检查,点击网络,ctrl+r刷新,点击名称列表中的任意一个,然
后再右侧的标头中下拉,找到User-Agent复制后面的内容,
比如是Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML,
like Gecko) Chrome/127.0.0.0 Safari/537.36
再找到referer复制后面的内容,比如是
https://www.3gbizhi.com/wallMV/index.html
第二步:构造一个http(s)请求头
注意事先需导入两个库
4.
r表示服务器的应答,requests.get表示采用get请求(http请求的一种),headers是刚才的字
典,url在单引号里,参数在左,变量在右.
r.status_code输出应该是200,不然后续无法进行.接着print(r.text)
输出html文本内容一共有1359行
右键view查看.
对于html,现在应该用xpath表达式筛选出里面的img标签.
第六步:在浏览器中找到xpath右键检查,按下ctrl+shift+c
随便点一个图片检查找到该元素右键复制,复制xpath,
比如是/html/body/main/div[4]/ul/li[11]/a/img,
去掉/html/body以及[]里的数字,就像这样//main/div/ul/li/a/img,
注意main前面是//
第七步:我们要使r.text有一个向量xpath,
首先要把它转化为一个parsel对象,例如parsel.Selector(r.text)
然后
print(pasel.Selector(r.text).xpath('//main/div/ul/li/a/img').getall())
可以看到有一大堆输出,其中有一堆属性是lay-src,=号后的内容直接指向了图片所在
的url地址(相当于点击"在新标签页中打开图片")
例如https://pic.3gbizhi.com/uploads/xxx.jpg
我们要获取这个属性,只需要
返回一个图片列表.
第八步:for循环遍历这个列表
这将把他们一行一行的输出,如果想把他们保存,只需要
源码:
总结,parsel只是用了一种正则表达式的方法,beauifulsoup甚至linux的perl命令也可以筛
选(三个月内发表)
本文在三个月前被我写下,现在发现它还可以运行,高兴极了.
(眨眼两年过去了)
后再右侧的标头中下拉,找到User-Agent复制后面的内容,
比如是Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML,
like Gecko) Chrome/127.0.0.0 Safari/537.36
再找到referer复制后面的内容,比如是
https://www.3gbizhi.com/wallMV/index.html
第二步:构造一个http(s)请求头
headers={
'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36',
'Referer':'https://www.3gbizhi.com/wallMV/index.html'
}注意事先需导入两个库
import requests
import parsel
4.
url='http://www.3gbizhi.com/wallMV/index.html'
r=requests.get(url=url,headers=headers)
r表示服务器的应答,requests.get表示采用get请求(http请求的一种),headers是刚才的字
典,url在单引号里,参数在左,变量在右.
r.status_code输出应该是200,不然后续无法进行.接着print(r.text)
输出html文本内容一共有1359行
右键view查看.
对于html,现在应该用xpath表达式筛选出里面的img标签.
第六步:在浏览器中找到xpath右键检查,按下ctrl+shift+c
随便点一个图片检查找到该元素右键复制,复制xpath,
比如是/html/body/main/div[4]/ul/li[11]/a/img,
去掉/html/body以及[]里的数字,就像这样//main/div/ul/li/a/img,
注意main前面是//
第七步:我们要使r.text有一个向量xpath,
首先要把它转化为一个parsel对象,例如parsel.Selector(r.text)
然后
print(pasel.Selector(r.text).xpath('//main/div/ul/li/a/img').getall())
可以看到有一大堆输出,其中有一堆属性是lay-src,=号后的内容直接指向了图片所在
的url地址(相当于点击"在新标签页中打开图片")
例如https://pic.3gbizhi.com/uploads/xxx.jpg
我们要获取这个属性,只需要
print(pasel.Selector(r.text).xpath('//main/div/ul/li/a/img/@lay-src').getall())返回一个图片列表.
第八步:for循环遍历这个列表
datalist=pasel.Selector(r.text).xpath('//main/div/ul/li/a/img/@lay-src').getall(
)
for data in datalist:
print(data)这将把他们一行一行的输出,如果想把他们保存,只需要
number=1
for data in datalist:
with open (f'www3gbizhi/{number}.jpg','wb') as p:
#wb模式针对二进制数据的写入 f表示格式化,不然要加双斜杠
#www3gbizh是路径,as表示把它重命名为p
p.write(requests.get(url=data,headers=headers).content)
#.content表示二进制格式的数据write表示写入
number+=1
#让number从一开始,不断+1
#前提,同目录下一定要有一个空文件夹www3gbizhi
源码:
import requests
import parsel
number=1
for page in range(2,35):
print('=========={}=========='.format(page))
#{}是一个占位符,范围从1到34
base_url="https://www.3gbizhi.com/wallMV/index_{}.html".format(page)#同理
headers={'User-agent' : 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebkit/537.1 (KHTML ,like Gecko) Safari/537.1'}
response=requests.get(url=base_url) html_data=response.text
parse=parsel.Selector(html_data)
data_list=parse.xpath('/html/body/main/div/ul/li/a/img/@lay-src').getall()
for data in data_list:
imgdata=requests.get(url=data,headers=headers).content
with open (f'www3g/{number}.jpg',mode='wb') as f:
f.write(imgdata)
number+=1
总结,parsel只是用了一种正则表达式的方法,beauifulsoup甚至linux的perl命令也可以筛
选(三个月内发表)
本文在三个月前被我写下,现在发现它还可以运行,高兴极了.
(眨眼两年过去了)
Forwarded from Webpage Bot
GitHub
GitHub - bytecategory/githubtts: 输入 /table 可打印所有已记录的IETF语言标签. 输入语言标签, 后跟一个空格和一段简短文本, 即可使用Google翻译的文本转语音API将该文本朗读为MP3文件.立即使用 Telegram:…
输入 /table 可打印所有已记录的IETF语言标签. 输入语言标签, 后跟一个空格和一段简短文本, 即可使用Google翻译的文本转语音API将该文本朗读为MP3文件.立即使用 Telegram: https://t.me/githubtts_bot - bytecategory/githubtts
https://github.com/shuakami/qq-chat-exporter/
[问题] Json文件中回复类型的消息的发送者错位
问题类型: 导出相关
我的问题:
这三行是已尝试的方法中的python3的stdout中的一个切片
gfwrev [回复 gfwrev: message_sample_1]
bytecategory [回复 bytecategory: message_sample_3]
bytecategory [回复 gfwrev: message_sample_2]
其中第三行是预期正确的 而第一行和第二行是错误的
分别应该是
gfwrev [回复 bytecategory: message_sample_1]
gfwrev [回复 bytecategory: message_sample_3]
这个问题看似是无中生有的 实际上有价值
已尝试的方法如下
[问题] Json文件中回复类型的消息的发送者错位
问题类型: 导出相关
我的问题:
这三行是已尝试的方法中的python3的stdout中的一个切片
gfwrev [回复 gfwrev: message_sample_1]
bytecategory [回复 bytecategory: message_sample_3]
bytecategory [回复 gfwrev: message_sample_2]
其中第三行是预期正确的 而第一行和第二行是错误的
分别应该是
gfwrev [回复 bytecategory: message_sample_1]
gfwrev [回复 bytecategory: message_sample_3]
这个问题看似是无中生有的 实际上有价值
已尝试的方法如下
from itertools import islice,cycle
length = 0
with open("/root/114514.json",'r') as f:
data = f.read()
data = json.loads(data)
senders = {'1912723': 'gfwrev','19031218': 'bytecategory'}
iterable = iter(data['messages'])
while (item := next(iterable, None)) and item.get("system") is True:
length +=1
for message in data['messages'][length:]:
text = message['content']['text']
first_key = next(iter(senders))
second_key = next(islice(senders, 1, None))
first_value = next(iter(senders.values()))
second_value = next(islice(senders.values(), 1, None))
text = text.replace(first_key, first_value)
text = text.replace(second_key, second_value)
if message['type'] == 'type_1' and message['system'] != True:
sender_name = message['sender']['name']
elif message['type'] == 'type_3':
uid = message['sender']['uid']
people_name = cycle(senders.values())
while True:
name = next(people_name)
if name == senders[uid]:
break
sender_name = next(people_name)
else:
del(text)
if 'text' in vars() and sender_name != None:
print(sender_name,text)
从今以后我抓鸡都用这个模板了,望周知.
import urllib3
http = urllib3.PoolManager(
timeout=urllib3.Timeout(connect=114514,read=1314520),
retries=False
)
aband = []
act = []
file_path = 'assets_2026211.txt'
with open(file_path,'r',encoding='utf-8') as f:
for line in f:
line = line.strip()
if not line:
continue
parts = [p.strip() for p in line.split(',')]
if len(parts) == 3 and parts[2]:
aband.append(parts)
elif len(parts) >= 2:
act.append(parts[:2])
del aband
for b in act:
ip = b[0]
port = b[1]
url = "http://" + ip + ":" + port + ""
try:
response = http.request('GET',url)
if b'root' in response.data:
print(ip + ':' + port)
else:
print(ip + ';' + port)
except:
pass
masscan 0.0.0.0/0 -pU:123 -oX ntp.xml --rate 160000 --exclude 255.255.255.255
from lxml import etree
port = None
address = None
parsedServers = []
#Opens the file used to store single enteries.
outputFile = open('output.txt', 'a')
#Iterates through the masscan XML file.
for event, element in etree.iterparse('ntp.xml', tag="host"):
for child in element:
if child.tag == 'address':
#Assigns the current iterations address to the address variable.
address = child.attrib['addr']
if child.tag == 'ports':
for a in child:
#Assigns the current iterations port to the port variable.
port = a.attrib['portid']
#is both port and IP address are present.
if port != None and address != None:
#If the IP hasnt yet been added to the output file.
if address not in parsedServers:
print(address)
#Write the IP address to the file.
outputFile.write(address + '\n')
#write the IP to the parsedServers list
parsedServers.append(address)
port = None
address = None
element.clear()
outputFile.close()
print('End')
from scapy.all import *
import _thread
#Raw packet data used to request Monlist from NTP server
rawData = "\x17\x00\x03\x2a" + "\x00" * 61
#File containing all IP addresses with NTP port open.
logfile = open('output.txt', 'r')
#Output file used to store all monlist enabled servers
outputFile = open('monlistServers.txt', 'a')
def sniffer():
#Sniffs incomming network traffic on UDP port 48769, all packets meeting thease requirements run through the analyser function.
sniffedPacket = sniff(filter="udp port 48769", store=0, prn=analyser)
def analyser(packet):
#If the server responds to the GET_MONLIST command.
print(len(packet))
if len(packet) > 200:
if packet.haslayer(IP):
print(packet.getlayer(IP).src)
#Outputs the IP address to a log file.
outputFile.write(packet.getlayer(IP).src + '\n')
_thread.start_new_thread(sniffer, ())
for address in logfile:
#Creates a UDP packet with NTP port 123 as the destination and the MON_GETLIST payload.
address=address.strip()
send(IP(dst=address)/UDP(sport=48769, dport=123)/Raw(load=rawData))
print('End')
https://www.ja.meswoolley.co.uk/ntp-amplification-discovery/
JA.MESWOOLLEY.CO.UK
NTP Amplification Discovery
Introduction
bytecat
masscan 0.0.0.0/0 -pU:123 -oX ntp.xml --rate 160000 --exclude 255.255.255.255 from lxml import etree port = None address = None parsedServers = [] #Opens the file used to store single enteries. outputFile = open('output.txt', 'a') #Iterates through the masscan…
200 is just experience points.
There are only 1907 devices.
There are only 1907 devices.
今天,还要特别感谢 Officialwhyte22的这篇推文 x.com/Officialwhyte22/status/2025164814180331798
PS C:\Users\Administrator> whoami
desktop-t5qs5ms\administrator
PS C:\Users\Administrator> get-date2026年2月22日 17:28:49PS C:\Users\Administrator> get-netadapter | select-object name,statname Status LinkSpeed---- ------ ---------
OpenVPN TAP-Windows6 Disconnected 1 Gbps
Ethernet0 Up 1 GbpsPS C:\Users\Administrator> get-netipinterface | sort-object interfa
ily,interfacemetric | select-object -first 6InterfaceAliasias AddressFamily interfacemetric----------------- ------------- ---------------
IPv4 25
IPv4 25
IPv6 25
IPv6 25
IPv4 75
IPv6 75PS C:\Users\Administrator> route print | select-string "0.0.0.0" 0.0.0.0 0.0.0.0 192.168.110.1 192.168.110.4
224.0.0.0 240.0.0.0 在链路上 127.
224.0.0.0 240.0.0.0 在链路上 192.168.1PS C:\Users\Administrator> Get-NetTCPConnection -state Established
localaddress,localport,remoteaddress,remoteport,owningprocesslocaladdress : 192.168.110.47
localport : 1541
remoteaddress : 4.145.79.82
remoteport : 443
owningprocess : 68localaddress : 192.168.110.47
localport : 1941
remoteaddress : 117.21.204.18
remoteport : 443
owningprocess : 2140localaddress : 192.168.110.47
localport : 1943
remoteaddress : 2.23.244.9
remoteport : 443
owningprocess : 2140localaddress : 192.168.110.47
localport : 1939
remoteaddress : 117.21.204.18
remoteport : 443
owningprocess : 2140localaddress : 192.168.110.47
localport : 1937
remoteaddress : 117.21.204.18
remoteport : 443
owningprocess : 2140localaddress : 192.168.110.47
localport : 1938
remoteaddress : 117.21.204.18
remoteport : 443
owningprocess : 2140localaddress : 192.168.110.47
localport : 1947
remoteaddress : 2.23.244.9
remoteport : 443
owningprocess : 2140localaddress : 192.168.110.47
localport : 1954
remoteaddress : 72.247.234.254
remoteport : 80
owningprocess : 2140PS C:\Users\Administrator> get-process -id 4Handles NPM(K) PM(K) WS(K) CPU(s) Id SI ProcessNa------- ------ ----- ----- ------ -- -- ---------
2356 0 140 124 71.30 4 0 System
给中国的朋友:
这就是@grok 认为的金玉良言, 我认为这是幼儿园的把戏, 脚本小子都要笑掉大牙.
你为什么要在简介里说自己是道德黑客?你连黑客的门槛都摸不到, 先学点本事再来炫耀吧. 你那套愚蠢的说辞居然还有9.9万查看, 我一边吃饭一边笑的肚子都疼了, 我女朋友还得拍拍我的背安慰我.
执行几个cmdlet把你牛逼的,就像我永远自由一样,你注定永远平庸.
PS C:\Users\Administrator> whoami
desktop-t5qs5ms\administrator
PS C:\Users\Administrator> get-date2026年2月22日 17:28:49PS C:\Users\Administrator> get-netadapter | select-object name,statname Status LinkSpeed---- ------ ---------
OpenVPN TAP-Windows6 Disconnected 1 Gbps
Ethernet0 Up 1 GbpsPS C:\Users\Administrator> get-netipinterface | sort-object interfa
ily,interfacemetric | select-object -first 6InterfaceAliasias AddressFamily interfacemetric----------------- ------------- ---------------
IPv4 25
IPv4 25
IPv6 25
IPv6 25
IPv4 75
IPv6 75PS C:\Users\Administrator> route print | select-string "0.0.0.0" 0.0.0.0 0.0.0.0 192.168.110.1 192.168.110.4
224.0.0.0 240.0.0.0 在链路上 127.
224.0.0.0 240.0.0.0 在链路上 192.168.1PS C:\Users\Administrator> Get-NetTCPConnection -state Established
localaddress,localport,remoteaddress,remoteport,owningprocesslocaladdress : 192.168.110.47
localport : 1541
remoteaddress : 4.145.79.82
remoteport : 443
owningprocess : 68localaddress : 192.168.110.47
localport : 1941
remoteaddress : 117.21.204.18
remoteport : 443
owningprocess : 2140localaddress : 192.168.110.47
localport : 1943
remoteaddress : 2.23.244.9
remoteport : 443
owningprocess : 2140localaddress : 192.168.110.47
localport : 1939
remoteaddress : 117.21.204.18
remoteport : 443
owningprocess : 2140localaddress : 192.168.110.47
localport : 1937
remoteaddress : 117.21.204.18
remoteport : 443
owningprocess : 2140localaddress : 192.168.110.47
localport : 1938
remoteaddress : 117.21.204.18
remoteport : 443
owningprocess : 2140localaddress : 192.168.110.47
localport : 1947
remoteaddress : 2.23.244.9
remoteport : 443
owningprocess : 2140localaddress : 192.168.110.47
localport : 1954
remoteaddress : 72.247.234.254
remoteport : 80
owningprocess : 2140PS C:\Users\Administrator> get-process -id 4Handles NPM(K) PM(K) WS(K) CPU(s) Id SI ProcessNa------- ------ ----- ----- ------ -- -- ---------
2356 0 140 124 71.30 4 0 System
给中国的朋友:
这就是@grok 认为的金玉良言, 我认为这是幼儿园的把戏, 脚本小子都要笑掉大牙.
你为什么要在简介里说自己是道德黑客?你连黑客的门槛都摸不到, 先学点本事再来炫耀吧. 你那套愚蠢的说辞居然还有9.9万查看, 我一边吃饭一边笑的肚子都疼了, 我女朋友还得拍拍我的背安慰我.
执行几个cmdlet把你牛逼的,就像我永远自由一样,你注定永远平庸.
Forwarded from Webpage Bot
GitHub
GitHub - bytecategory/homeip: I will teach you how to "buy" a home IP for free,analyze CVE-2024-3721,launch a udp flood attack.…
I will teach you how to "buy" a home IP for free,analyze CVE-2024-3721,launch a udp flood attack. please refer to the html file, not the README.md file. - bytecategory/homeip
i cordially invite technical personnel to expose the scale,targets,methods,and background of the internet censorship groups.
https://twitter.com/i/communities/2014897439694848202
https://twitter.com/i/communities/2014897439694848202
X (formerly Twitter)
gfwvector
i cordially invite technical personnel to expose the scale,targets,methods,and background of the internet censorship groups.
import socket
def q(d):
e = b'\x12\x34'
"""
A 16 bit identifier assigned by the program
程序分配的16位标识符
that generates any kind of query
This identifier is copied
the corresponding reply and can be used by the requester
to match replies to outstanding queries
RFC1035 section4.1.1
nslookup程序出自Debian软件包bind9-dnsutils
它的可执行文件路径是/usr/bin/nslookup
它的源代码文件路径是/bin/dig/nslookup.c(这是gitlab的路径)
在其中搜索字符串uint16(_t) 只有一个端口变量 所以我跳过了
port = (uint16_t)n
过了一年(度秒如年) 我注意到/usr/lib/x86_64-linux-gnu目录下有libdns-9.20.9-1-Debian.so文件
以及libisc-9.20.9-1-Debian.so文件
它们在gitlab上的路径分别为/lib/dns和/lib/isc/
文件分别为dispatch.c和random.c
在dispatch.c中搜索id 第4个在第98行
dns_messageid_t id;
但它还不是 继续搜索dns_messageid
第4个在第1416行
...
总之我认为它要么是指针idp所指向的值
要么是isc_random16()的返回值
resp->id = ((options & DNS_DISPATCHOPT_FIXEDID) != 0)
? *idp
: (dns_messageid_t)isc_random16()
如上
所以现在我可以在random.c中搜索isc_random16
isc_random16(void) {
isc__random_initialize();
return (uint16_t)next();
}
返回值是uint16_t类型的 而next不与说明
"""
h = b'\x01\x00\x00\x01\x00\x00\x00\x00\x00\x00'
y = b''
for p in d.split('.'):
y += bytes([len(p)])+p.encode('utf-8')
y += b'\x00'
y += b'\x00\x01'
y += b'\x00\x01'
pkt = e + h + y
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.sendto(pkt, ('127.0.0.1', 53))
r=s.recvfrom(512)[0]
s.close()
b = r[slice(-4,None)]
return '.'.join(str(x) for x in b)
if __name__ == '__main__':
IP = q('bytecategory.com')
print(f"bytecategory.com\t{IP}")
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
int main() {
int f, d;
struct sockaddr_in v, c;
socklen_t client_len = sizeof(c);
char b[1024];
f = socket(AF_INET, SOCK_STREAM, 0);
int p = 1;
setsockp(f, SOL_SOCKET, SO_REUSEADDR, &p, sizeof(p));
memset(&v, 0, sizeof(v));
v.sin_family = AF_INET;
v.sin_addr.s_addr = INADDR_ANY;
v.sin_port = htons(80);
bind(f, (struct sockaddr *)&v, sizeof(v));
listen(f, 3);
daemon(1, 1);
while (1) {
if ((d = accept(f, (struct sockaddr *)&c, &client_len)) < 0) {
continue;
}
int s = read(d, b, 1024);
if (s < 0) {
close(d);
continue;
}
const char *r = "HTTP/1.1 200 OK\r\n\r\n<p style='text-align: center;color: pink;font-size: 24px'>cyw,我喜欢你</p>";
send(d, r, strlen(r), 0);
close(d);
}
close(f);
return 0;
}
mips-linux-gnu-gcc -march=mips2 -EB -mtune=mips2 -mabi=32 -mhard-float -static -O0 -o E E.c