mop

Make OK for Public. A simplistic pre-filter (not (yet) a substitute for manual examination).

Usage

mop < /var/log/nginx/error_log > cleaned_file
vim cleaned_file # check for anything it might've missed
jist -co cleaned_file # upload, copy its URL to clipboard, open in browser

Note

This thing is really in its beginning phases. It currently:

  • Deletes too much
  • Leaves too much

However, all Issues will be addressed. Just file 'em.'

Currently Works With

  • Passwords
    • "password: secr3t""password: hiddenpass"
    • "password: secr3t""password: hiddenpass"
    • "password:\n\tsecr3t""password:\n\thiddenpass"
    • "password: 'secr3t'""password: hiddenpass"
    • "password:secr3t""password:hiddenpass"
    • "passwd:secr3t""passwd:hiddenpass"
    • "passwd: secr3t""passwd: hiddenpass"
    • "password=secr3t""password=hiddenpass"
    • "passwd=secr3t""passwd=hiddenpass"
    • "password=\"secr3t\"""password=hiddenpass"
    • "buzbuz password: secr3t bizbiz""buzbuz password: hiddenpass bizbiz"
    • "buzbuz password: secr3t bizbiz another password: secr4t bazbaz""buzbuz password: hiddenpass bizbiz another password: hiddenpass bazbaz"
    • "USER: user55 PASS: secr3t""USER: hiddenuser PASS: hiddenpass"
    • "U/N: user55 P/W: secr3t""U/N: hiddenuser P/W: hiddenpass"
    • "U: user55 P: secr3t""U: hiddenuser P: hiddenpass"
    • "U=user55 P=secr3t""U=hiddenuser P=hiddenpass"
    • "u=user55 p=secr3t""u=hiddenuser p=hiddenpass"
    • "u: user55 p: secr3t""u: hiddenuser p: hiddenpass"
    • "L=user55 P=secr3t""L=hiddenuser P=hiddenpass"
  • Users
    • "user: user55""user: hiddenuser"
    • "User=user55""User=hiddenuser"
    • "/Users/user55""hiddenuser"
    • "/home/user55""hiddenuser"
  • IPv4 Addresses
    • "1.2.3.4""XX.YY.ZZ.AA"
    • "asdf 1.2.3.4 asdf""asdf XX.YY.ZZ.AA asdf"
    • "1.2.3.4:22""XX.YY.ZZ.AA:22"
    • "123.45.67.89""XX.YY.ZZ.AA"
    • "0.0.0.0" (unchanged)
    • "127.0.0.1" (unchanged)
  • IPv6 Addresses (probably many patterns TODO on this one)
    • "21:43:6f:1a:f6:f6""aa:bb:cc:dd:ee:ff"
  • Capistrano's deploy.rb
    • "host_name: 'shouldhide'""host_name: caphidden"
    • "host_name: \"shouldhide\"""host_name: caphidden"
    • ":host_name => 'shouldhide'"":host_name => caphidden"
    • ":host_name, 'shouldhide'"":host_name, caphidden"
    • ":port => 'shouldhide'"":port => caphidden"
    • "deploy_to, 'shouldhide'""deploy_to, caphidden"
    • "server 'shouldhide', …""server capserver …"
    • "set :application, \"shouldhide\"""set :application, caphidden"
    • "set :user, \"shouldhide\"""set :user, hiddenuser"
    • "server without comma" (unchanged)
    • "portage" (unchanged)
  • /etc/passwd having "fakeuser" and "fakeuser2"
    • "foo bar fakeuser baz""foo bar hiddenuser baz"
    • "~/fakeuser""~/hiddenuser"
    • "/home/fakeuser/.foo""hiddenuser"
    • "fakeuser2""hiddenuser"
    • "cron" (unchanged)
    • "root" (unchanged)
  • hostname being 'gargantatron'
    • "gargantatron""hiddenhost"
  • Git repos
  • SSH
    • "ssh://user55@secrethost/path/to/reponame.git/""ssh://hiddensshurl"

TODO

  • Add -j for ConradIrwin's jist gem
  • Make distinct (similar to an uglifier's symbol replacement)
    • first.host.name ⇒ hiddenhostname1
    • second.host.name ⇒ hiddenhostname2
  • Learn more about IPv6 Addresses
  • Dorky ISP-given hostnames that show IP addresses