using the Uniq command, you can filter out duplicate lines in a text file, statistics, and so on, and it also accepts input from the pipeline. With awk, you can even manipulate columns in rows, such as counting the number of independent IPs in Nginx log messages, listing the most visited IPs, and so on. It is important to note that Uniq only handles connected rows, so the sort operation is generally done fi
When using Python Crawlers, we sometimes use IP proxies. Inadvertently found a free proxy IP site:http://www.xicidaili.com/nn/. However, the discovery of a lot of IP is not used. Therefore , a script is written in Python, which can detect the proxy IP that can be used . The script is as follows:#encoding =utf8import urllib2from bs4 import beautifulsoupimport urllibimport socketuser_agent = ' mozilla/5.0 (Windows NT 6.3; WOW64; rv:43.0) gecko/20100101 firefox/43.0 ' header = {}header[' user-agen
" ], "selectinterfaces": [ "InterfaceID", "IP" ] }, "ID": 2, "Auth": Token_num,} request= Requests.post (url=url,headers=headers,data=json.dumps (data)) Dict=json.loads (request.content)#print dict[' result ' returndict['result']#organize the information, output the information you want, combine it into a dictionary, I propose IP here. defGetproc (data): Dict={} list=Data forIinchList:host= i['Hos
Label: shell script ping all ips on the same network segment
The environment is centos7 / bin / bash
Note When copying the test, be sure to change the ip network segment in the example to your own ip network segment.
ctrl + z can enter the script into the background, and then kill the process.
1.
#! / bin / bash
for i in {1..254} #define 1 to 254
do
HOST = 192.168.168. $ I
ping -c 2 $ HOST > / dev / null
if [$? -eq 0]; then # -eq Determine
When the same domain name corresponds to multiple IPs, PHP gets the function of the Remote Web page content [Article Zhang feast this article version: v1.0 last modified: 2008.12.15 reproduced Please specify the original link: http://blog.zyan.cc/post/389/] PHP gets Remote Web page content in several ways, such as using its own file_get_contents, fopen and other functions. Reference PHP Gets the Remote Web page content function when the same domai
The company has become a Symantec senior partner, I will be responsible for Symantec and Kaspersky Pre-Sales Technology and after-sale support, a preliminary understanding of the 7100 series and the SxS of the new Sysmantec mode, think it is very good, Especially ids/ips on the solution, deeply admired. Self-sensing IDs differs from IPs in that one is a color congenial, one is a watchdog, one can see can no
Security Managers face many challenges in protecting enterprise network servers from attacks. Although the Intrusion Detection System (IDS) was once widely used, the attack methods on the Internet are constantly being improved. At the same time, the signature technology IDS cannot detect new and deformation attacks, therefore, traditional IDS gradually show their limitations in terms of initiative.
So what are the choices for enterprises? Intrusion Protection System (
: ' {print '} ' |sort |uniq-c | sort-n-R#tcpdump Crawl 100 packets, access to the local 80 IP for reordering only show the first 20, these IP is the attack source IP, we need to seal it offTCPDUMP-TNN DST Port 80-c 100 | Awk-f "." ' {print $ '. $ "." $ "." $4} ' | Sort | uniq-c | Sort-n-R |head-20#新建一个setname. txt files, add these IPs in the following format (how many IPs are the number of lines)Vim setname
PHP Gets the Remote Web page content function when the same domain name corresponds to multiple IPs
The FGC is simply read and encapsulates everything.
Fopen also carries out some encapsulation, but requires you to iterate through all the data.
Fsockopen This is the socket operation of the straight plate.
If you just read an HTML page, FGC is better.
If the company is online through a firewall, the general file_get_content function will not be. Of cou
Solution 1:cat Access_log | awk ' {print '} ' | Sort | uniq-c | Sort-n-R | HEAD-10 Solution 2:cat Access_log | Awk-f "--" ' {print $} ' | Sort-t. | uniq-c | Sort-n-R | Head-10awk ' {a[$1] + = 1;} END {for (I in a) printf ("%d%s\n", a[i], i);} ' log file | Sort-n | TailFirst, you use awk to get a list, then sort it out, and finally use tail to take the last 10.The above parameters can be slightly modified to display more data, such as the tail plus-n parameters, and other log format commands may
ObjectiveTake the recent discovery of a free proxy IP site for example: http://www.xicidaili.com/nn/. In the use of the time to find a lot of IP is not used.So I wrote a script in Python that could detect the proxy IP that could be used.1 #Encoding=utf82 ImportUrllib23 fromBs4ImportBeautifulSoup4 ImportUrllib5 ImportSocket6 7User_agent ='mozilla/5.0 (Windows NT 6.3; WOW64; rv:43.0) gecko/20100101 firefox/43.0'8Header = {}9header['user-agent'] =user_agentTen One " " A get all proxy IP addre
number of available IPs that are currently found4Okipnum =05 forProxyinchproxies:6 #random use of different useragent7UserList =useragentlist.userlist8headers = {'user-agent': Userlist[random.randint (0, Len (userlist)-1)]}9 #request is sent with a different useragent, with a test IP proxyTen #If there is an exception, skip directly, there may be a connection to the supermarket anomalies, etc. One Try: AText_web = Requests.get ("http
StatementThe Stars last nightBlog:http://yestreenstars.blog.51cto.com/This article by oneself creation, if need reprint, please indicate source, thank cooperation!ObjectiveAutomatically logs the logon IP for Windows Remote Desktop Connection.EnvironmentSystem: Windows Server 2003Steps1. Create a new c:/rdp directory;2. New c:/rdp/rdplog.txt file; 3. New c:/rdp/rdplog.bat file and add the following content: date/t >>rdplog.txttime/t >>rdplog.txtNetstat-n-P TCP | Find ": 3389" >>rdplog.
computers and the subnet mask above, we can see that the result of the operation is the same. are 192.168.0.0, so these two computers can be considered to be the same subnet.Input Description:Enter a subnet mask, two IP addressesOutput Description:Get calculated resultsInput Example:255.255.255.0192.168.224.256192.168.10.4Output Example:1Import java.util.*;p Ublic class Main {public static void main (string[] args) {Scanner scan=new Scanner (system.in); String[] Str1=scan.nextline (). split ("\
127.0.0.1:3306 0.0.0.0:* LISTEN
......
Display 3690 while listening, but only valid on 127.0.0.1, cannot accept external connections.But I've already added the-G parameter to the SSH manual saying this option will bind the port to the external IP so that the other machines can connect, but why is this invalid?Google learns the Answer (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=228064):Original-G is only valid for local forwarding, to make remote forwarding also use external IP, you mu
In response to the CC attack, Ddosdefender software was deployed. However, the software has a bug, when adding a blacklist will not determine whether the IP has been added, resulting in a firewall list has a lot of duplicate IP address, you can use the following command to delete duplicate data, only one.Iptables-vnl|grep DROP |awk ' {print $8} ' |Grep-v "0.0.0.0" |awk '/[0-9]/' |Sort | Uniq-c|sort-nr |awk ' {if ($ >1) print $ "" $ |awk ' {for (i=1;iThis article from "Leboit" blog, declined repr
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.