Skip to content

Commit d511491

Browse files
author
Brent Cook
committed
Land rapid7#8365, automatically set LHOST inside the docker container
2 parents 5d326f3 + 23e97f4 commit d511491

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

docker/msfconsole.rc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
<ruby>
2-
run_single("setg LHOST #{ENV['LHOST']}") if ENV['LHOST']
32
run_single("setg LPORT #{ENV['LPORT']}") if ENV['LPORT']
3+
if ENV['LHOST']
4+
lhost = ENV['LHOST']
5+
else
6+
lhost = %x(hostname -i)
7+
end
8+
run_single("setg LHOST #{lhost}")
49
run_single("db_connect #{ENV['DATABASE_URL'].gsub('postrgres://', '')}") if ENV['DATABASE_URL']
510
</ruby>

0 commit comments

Comments
 (0)