Jump to content

Issues with sed and grep on a loot file


Koeptis

Recommended Posts

Hi guys,

I have trouble getting sed and grep on a text file looted using a modified samba exfiltrator.

I use firmware 1.6 and the command used to gather the IP addresses is "(Get-NetIPAddress -AddressFamily ipv4).IPAddress" (will later try to gather LAN IP addresses).

I tried the commands on Kali without an issue, but on the bash bunny it does not work as expected.

root@bunny:~# cat /loot/smb/e/DESKTOP-63THJCH/hacked.txt
▒▒172.16.64.10
192.168.56.1
169.254.42.194
169.254.8.188
169.254.247.206
169.254.150.40
192.168.1.48
127.0.0.1
root@bunny:~# cat /loot/smb/e/DESKTOP-63THJCH/hacked.txt | grep "169"
root@bunny:~# sed -i '/^169\.[0-9]/d' /loot/smb/e/DESKTOP-63THJCH/hacked.txt
root@bunny:~# sed '/^169\.[0-9]/d' /loot/smb/e/DESKTOP-63THJCH/hacked.txt
▒▒172.16.64.10
192.168.56.1
169.254.42.194
169.254.8.188
169.254.247.206
169.254.150.40
192.168.1.48
127.0.0.1
root@bunny:~#

 

I am using the commands wrong ?

 

Link to comment
Share on other sites

  • 2 weeks later...

Hm, I tried the commands exactly as you posted here and it worked for me (on the bunny), so there isn't a mistake with the commands.

Try "apt-get upgrade grep", maybe that will help.

What also kind of annoys me are those  ▒▒. Try deleting those and try it again.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...