

The next step now would be to count the lines of all the repeated IP addresses. To do this, we just feed the output of the cut command through “sort”:Īs you see from the excerpt above, some IP addresses are responsible for a single request only while others have hit the website multiple times. For our task it’s quite enough to sort the addresses in a simple alphabetical way. Sort lets you sort existing data in different ways - as for instance alphabetically or numerically. Now that we have extracted all the IP addresses, we need to put them in order to process them further.Īnd if you need to “put something in order” - if you need to sort something at the Linux command line - then the tool “sort” is the way to go. (and isn’t simplicity always king?) Put the lines in order with sort Site note: Although the data extraction with grep is way more powerful than extracting data fields with cut, I’ll stick with “cut” for the rest of this article. So we can simply call “cut” in the following way, to extract all the IP addresses from a log file called “demolog”:Īs you see - as soon as you can describe the data you are interested in as a regular expression, you can use “grep” to extract only the data of interest. And this first field is separated by a single space from the rest of the line.We are interested in the first field of every line.This works in our example here perfectly: This tool is a command you can use, if you want to extract fields from lines of text, if these fields are separated with a dedicated single character from each other. The first approach is to use the command-line tool “cut” for extracting the IP addresses. Where the first part of every line shows the IP address where the request came from.Īnd our goal is now, to take the whole log file and generate the top 10 IP addresses that sent the most requests to my web server.Īnd if we wanna have a top 10 list of the IP addresses, we first need to extract them from the log.įor this step I wanna show you two different approaches: Extract the IP addresses with cut If you can help, I would be pleased also if you can stop making fun about this problem since I should not explain you all what is behind all this, as it is not the right place but I was seriously offended by a person who did not even consider I could track the hacking and the abusive file and who foolishly has understimated this act which is potentially criminal.IP-ADDRESS - REQUEST & REQUEST-INFORMATION You can laugh as much as you want of course that I know that a file should not so be so easy to find and as a matter of fact I did not located it just few days after but more than a month later furthermore as already explained before, its date and time of acquisition, is prior my access to my local network and internet, considering the administrative events in windows. If a hacker left a file that was going to 'phone home' hopefully they wouldn't be that stupid to make it so easy to locate and report to authorities where his server is. would he his home network as almost everyone's home networks starts with those) The IP address in that video is in plain text and would the destination IP at best, not the source. That video isn't showing you anything but what a hex editor can read.
#Grep ip address from file how to
I found in any case this page which actually (as far as I understand) it would be possible to get IP address of a file with linux, ad also I found a video in youtube on the same topic I do not know if you can explain them to me and to help how to retreive useful details in order to report hacking and abusive file to the police.
#Grep ip address from file password
Ok the windows firewall is and was on when I retrieved signs of hacking (I needed to re-input password and the antivirus option for mail was unchecked) I found this file whose date and time is prior my connection through internet, so it was not downloade my me even by mistake. You need to start with basic anti-virus and anti-malware scans. If you have a firewall enabled on the computer you may be able to see what IP addresses interacted with the computer. Your computer wrote that file (unless you have the folder shared). Files don't have IP addresses, computers do.
