信息收集-C 段扫描
本文最后更新于 420 天前,其中的信息可能已经有所发展或是发生改变。

:::info
💘渗透全流程:
信息👣收集 – 漏洞发现 – 漏洞利用 – 权限提升 – 隧道搭建 – 内网渗透 – 横向移动 – 后渗透
:::

C 段扫描

思路分析:
确定 IP 的 C 段,使用字典扫描
实现步骤:

  1. 确定 C 段
  2. 拼接组成完成 IP
  3. ping 这个 IP,查看响应

V1.0

基本功能实现

#! usr/bin/env python3

'''
1. ping 扫描 C 段(注意间隔,防止蓝屏)
2. 判断响应 TTL 值

优化:
'''

import threading
from multiprocessing import Queue
from subprocess import Popen, PIPE

class CScan(threading.Thread):

    def __init__(self, queue):
        threading.Thread.__init__(self)
        self.queue = queue

    def run(self):
        while not self.queue.empty():
            ip = self.queue.get()
            try:
                check_ip = Popen('ping %s \n' % ip, stdin=PIPE, stdout=PIPE, shell=True)
                data = check_ip.stdout.read()
                if 'TTL' in str(data):
                    print('[+] %s is online. \n' % ip)
                else:
                    # print(data)
                    pass
            except:
                ...

def start(count):
    queue = Queue()

    for i in range(1, 5):
        queue.put('192.168.225.%s' % i)

    threads = []
    thread_count = int(count)

    for i in range(thread_count):
        threads.append(CScan(queue))

    for t in threads:
        t.start()

    for t in threads:
        t.join()

if __name__ == '__main__':
    count = 16
    start(16)

image.png

V2.0

参考 CScan 继续优化:
https://github.com/AmbroseCdMeng/Cscan

学海无涯,回头是岸。 --- hola
暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇