본문 바로가기
프로그래밍

PyOps - 스카피 소개

by it-view 2022. 2. 15.
반응형

스카피 정보

치료 모듈

트레이서루트

traceroute(target, dport=80, minttl=1, maxttl=30, sport=, l4=None, filter=None, timeout=2, verbose=None, **kargs)
 
  • target: 추적할 대상 개체(도메인 이름 또는 IP)이며 유형은 목록입니다. ["www.qq.com", www.baidu.com","www.baidu.com"]과 같은 여러 대상을 동시에 지정할 수 있다.
  • dport: destination port(대상 포트)(유형: 목록)는 [80,time]과 같은 여러 포트를 동시에 지정할 수 있습니다.
  • minttl: 추적 라우팅(노드 번호)을 위한 최소 홉 수를 지정합니다.
  • maxtl: 경로 추적을 위한 최대 홉(홉) 수를 지정합니다.

연습하세요.

코드:

import time
import warnings
import logging
warnings.filterwarnings("ignore", category=DeprecationWarning)
logging.getLogger('scapy.runtime').setLevel(logging.ERROR)
from scapy import traceroute
domains = input('Please input one or more IP/domain: ')
target = domains.split(' ')
dport = [80]
if len(target) >= 1 and target[0] != '':
    res,unans = traceroute(target, dport=dport, retry=-2)
    res.graph(target='> output.svg')
    time.sleep(1)
else:
    print("IP/domain number of errors, exit")

출력:

 
Please input one or more IP/domain: google.com
Begin emission:
Finished sending 30 packets.
***************************.Begin emission:
Finished sending 3 packets.
Begin emission:
Finished sending 3 packets.
..
Received 30 packets, got 27 answers, remaining 3 packets
   142.250.80.110:tcp80 
   1  192.168.1.1     11   
3  100.41.25.94    11   
4  140.222.3.212   11   
7  140.222.1.45    11   
8  204.148.20.6    11   
9  108.170.248.33  11   
10 142.251.65.113  11   
11 142.250.80.110  SA   
12 142.250.80.110  SA   
...
28 142.250.80.110  SA   
29 142.250.80.110  SA   
30 142.250.80.110  SA

생성된 그래프:

결론

scapy
INFO: Can't import matplotlib. Won't be able to plot.
INFO: Can't import PyX. Won't be able to use psdump() or pdfdump().
WARNING: No IPv4 address found on en5 !
  WARNING: No IPv4 address found on en1 !
    WARNING: more No IPv4 address found on en2 !
      INFO: Can't import python-cryptography v1.7+. Disabled WEP decryption/encryption. (Dot11)
INFO: Can't import python-cryptography v1.7+. Disabled IPsec encryption/authentication.
WARNING: IPython not available. Using standard Python shell instead.
AutoCompletion, History are disabled.

                     aSPY//YASa       
             apyyyyCY//////////YCa       |
                         sY//////YSpcs  scpCY//Pp     | Welcome to Scapy
                          ayp ayyyyyyySCP//Pp           syY//C    | Version 2.4.5
                           AYAsAYYYYYYYY///Ps              cY//S   |
                                    pCCCCY//p          cSSps y//Y   | https://github.com/secdev/scapy
                                             SPPPP///a          pP///AC//Y   |
                                                           A//A            cyP////C   | Have fun!
                                                                         p///Ac            sC///a   |
                                                                                       P////YCpc           A//A   | Craft packets like it is your last
                                                                                              scccccp///pSP///p          p//Y   | day on earth.
                                                                                                    sY/////////y  caa           S//P   |                      -- Lao-Tze
                                                                                                           cayCyayP//Ya              pY/Ya   |
                                                                                                                   sY/PsY////YCc          aC//Yp 
         sc  sccaCY//PCypaapyCP//YSs  
                           spCPY//////YPSps    
                                                  ccaacs         

                                                  >>>
                                                    ```

                                                    <div class="content-ad"></div>

                                                    ```js
                                                    >>> ls()
                                                    AH         : AH
                                                    AKMSuite   : AKM suite
                                                    ARP        : ARP
                                                    ASN1P_INTEGER : None
                                                    ASN1P_OID  : None
                                                    ASN1P_PRIVSEQ : None
                                                    ASN1_Packet : None
                                                    ATT_Error_Response : Error Response
                                                    ATT_Exchange_MTU_Request : Exchange MTU Request
                                                    ATT_Exchange_MTU_Response : Exchange MTU Response
                                                    ATT_Execute_Write_Request : Execute Write Request
                                                    ATT_Execute_Write_Response : Execute Write Response
                                                    ATT_Find_By_Type_Value_Request : Find By Type Value Request
                                                    ```

                                                    ```js
                                                    >>> lsc()
                                                    IPID_count          : Identify IP id values classes in a list of packets
                                                    arpcachepoison      : Poison target's cache with (your MAC,victim's IP) couple
                                                    arping              : Send ARP who-has requests to determine which hosts are up
                                                    arpleak             : Exploit ARP leak flaws, like NetBSD-SA2017-002.
                                                    ...
                                                    tshark              : Sniff packets and print them calling pkt.summary().
                                                    wireshark           : 
                                                    wrpcap              : Write a list of packets to a pcap file
                                                    ```

댓글